List:Commits« Previous MessageNext Message »
From:holyfoot Date:December 15 2005 12:21pm
Subject:bk commit into 5.1 tree (holyfoot:1.1965) BUG#15524
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of hf. When hf does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.1965 05/12/15 16:20:56 holyfoot@deer.(none) +5 -0
  bug #15524 (partitioning range/list violation error message is insufficient)

  sql/share/errmsg.txt
    1.62 05/12/15 16:20:50 holyfoot@stripped +2 -0
    Error message added

  sql/ha_partition.cc
    1.13 05/12/15 16:20:50 holyfoot@stripped +6 -2
    now we launch the informative error message here

  mysql-test/t/partition_error.test
    1.5 05/12/15 16:20:50 holyfoot@stripped +8 -0
    test case added

  mysql-test/r/partition_error.result
    1.3 05/12/15 16:20:50 holyfoot@stripped +5 -0
    test result fixed

  include/my_base.h
    1.76 05/12/15 16:20:50 holyfoot@stripped +2 -1
    HA_ERR_NO_PARTITION_FOUND added

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	holyfoot
# Host:	deer.(none)
# Root:	/home/hf/work/mysql-5.1.clean

--- 1.75/include/my_base.h	Thu Dec  1 16:34:08 2005
+++ 1.76/include/my_base.h	Thu Dec 15 16:20:50 2005
@@ -343,8 +343,9 @@
 #define HA_ERR_NO_CONNECTION     157  /* Could not connect to storage engine */
 #define HA_ERR_NULL_IN_SPATIAL   158  /* NULLs are not supported in spatial index */
 #define HA_ERR_TABLE_DEF_CHANGED 159  /* The table changed in storage engine */
+#define HA_ERR_NO_PARTITION_FOUND 160  /* There's no partition in table for given value */
 
-#define HA_ERR_LAST              159  /*Copy last error nr.*/
+#define HA_ERR_LAST              160  /*Copy last error nr.*/
 /* Add error numbers before HA_ERR_LAST and change it accordingly. */
 #define HA_ERR_ERRORS            (HA_ERR_LAST - HA_ERR_FIRST + 1)
 

--- 1.61/sql/share/errmsg.txt	Wed Dec  7 18:21:54 2005
+++ 1.62/sql/share/errmsg.txt	Thu Dec 15 16:20:50 2005
@@ -5725,3 +5725,5 @@
 	eng "Plugin '%-.64s' is not loaded"
 ER_WRONG_VALUE
 	eng "Incorrect %-.32s value: '%-.128s'"
+ER_NO_PARTITION_FOR_GIVEN_VALUE
+	eng "Table has no partition for value %d"

--- 1.12/sql/ha_partition.cc	Sat Nov 26 08:17:12 2005
+++ 1.13/sql/ha_partition.cc	Thu Dec 15 16:20:50 2005
@@ -1174,7 +1174,7 @@
   }
 #endif
   if (unlikely(error))
-    DBUG_RETURN(error);
+    DBUG_RETURN(HA_ERR_NO_PARTITION_FOUND);
   m_last_part= part_id;
   DBUG_PRINT("info", ("Insert in partition %d", part_id));
   DBUG_RETURN(m_file[part_id]->write_row(buf));
@@ -2973,7 +2973,11 @@
   DBUG_ENTER("ha_partition::print_error");
   /* Should probably look for my own errors first */
   /* monty: needs to be called for the last used partition ! */
-  m_file[0]->print_error(error, errflag);
+  if (error == HA_ERR_NO_PARTITION_FOUND)
+    my_error(ER_NO_PARTITION_FOR_GIVEN_VALUE, MYF(0),
+             m_part_info->part_expr->val_int());
+  else
+    m_file[0]->print_error(error, errflag);
   DBUG_VOID_RETURN;
 }
 

--- 1.2/mysql-test/r/partition_error.result	Sat Jul 23 00:17:00 2005
+++ 1.3/mysql-test/r/partition_error.result	Thu Dec 15 16:20:50 2005
@@ -544,3 +544,8 @@
 partition x2 values in (5));
 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '4,
 partition x2 values in (5))' at line 8
+CREATE TABLE t1(a int)
+PARTITION BY RANGE (a) (PARTITION p1 VALUES LESS THAN(5));
+insert into t1 values (10);
+ERROR HY000: Table has no partition for value 10
+drop table t1;

--- 1.4/mysql-test/t/partition_error.test	Fri Aug 19 19:25:27 2005
+++ 1.5/mysql-test/t/partition_error.test	Thu Dec 15 16:20:50 2005
@@ -727,3 +727,11 @@
 (partition x1 values in 4,
  partition x2 values in (5));
 
+#
+# No partition for the given value
+#
+CREATE TABLE t1(a int)
+  PARTITION BY RANGE (a) (PARTITION p1 VALUES LESS THAN(5));
+--error ER_NO_PARTITION_FOR_GIVEN_VALUE
+insert into t1 values (10);
+drop table t1;
Thread
bk commit into 5.1 tree (holyfoot:1.1965) BUG#15524holyfoot15 Dec