List:Commits« Previous MessageNext Message »
From:holyfoot Date:March 18 2007 6:55pm
Subject:bk commit into 5.1 tree (holyfoot:1.2478) BUG#23603
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@stripped, 2007-03-18 22:55:02+04:00, holyfoot@stripped +4 -0
  Bug #23603 Partitions: reorganize means delete
  added code to raise error in case when there's no partition
  for the existing value(s)

  mysql-test/r/partition.result@stripped, 2007-03-18 22:54:59+04:00, holyfoot@stripped +8 -0
    result fixed

  mysql-test/t/partition.test@stripped, 2007-03-18 22:54:59+04:00, holyfoot@stripped +12 -0
    testcase

  sql/ha_partition.cc@stripped, 2007-03-18 22:54:59+04:00, holyfoot@stripped +4 -1
    now we issue the error instead of increasing deleted counter here
    as deleting records with the ALTER operation is not allowed

  sql/share/errmsg.txt@stripped, 2007-03-18 22:55:00+04:00, holyfoot@stripped +2 -0
    error message 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:	hfmain.(none)
# Root:	/home/hf/work/26063/my51-26063

--- 1.148/sql/share/errmsg.txt	2007-03-18 22:55:07 +04:00
+++ 1.149/sql/share/errmsg.txt	2007-03-18 22:55:07 +04:00
@@ -6053,3 +6053,5 @@ ER_DUP_ENTRY_WITH_KEY_NAME 23000 S1009
 ER_BINLOG_PURGE_EMFILE
         eng "Too many files opened, please execute the command again"
+ER_PARTITION_ALTER_CAUSES_DELETE
+        eng "Impossible ALTER. No partition was specified for some existing values."

--- 1.59/mysql-test/r/partition.result	2007-03-18 22:55:07 +04:00
+++ 1.60/mysql-test/r/partition.result	2007-03-18 22:55:07 +04:00
@@ -1238,4 +1238,12 @@ PARTITION p18   VALUES IN (90, 122, 73, 
 );
 INSERT INTO t1 SELECT code2, country_name, 0 FROM t2;
 DROP TABLE t1, t2;
+create table t1 (r int) partition by list (r) (partition p1 values in (1));
+insert into t1 values (1);
+alter table t1 reorganize partition p1 into (partition p1 values in (0));
+ERROR HY000: Impossible ALTER. No partition was specified for some existing values.
+select * from t1;
+r
+1
+drop table t1;
 End of 5.1 tests

--- 1.53/mysql-test/t/partition.test	2007-03-18 22:55:07 +04:00
+++ 1.54/mysql-test/t/partition.test	2007-03-18 22:55:07 +04:00
@@ -1490,4 +1490,16 @@ INSERT INTO t1 SELECT code2, country_nam
 
 DROP TABLE t1, t2;
 
+#
+# Bug #23603 Partitions: reorganize means delete 
+#
+
+create table t1 (r int) partition by list (r) (partition p1 values in (1));
+insert into t1 values (1);
+--error ER_PARTITION_ALTER_CAUSES_DELETE
+alter table t1 reorganize partition p1 into (partition p1 values in (0));
+select * from t1;
+drop table t1;
+
+
 --echo End of 5.1 tests

--- 1.86/sql/ha_partition.cc	2007-03-18 22:55:07 +04:00
+++ 1.87/sql/ha_partition.cc	2007-03-18 22:55:07 +04:00
@@ -1546,7 +1546,8 @@ int ha_partition::copy_partitions(ulongl
            table since it doesn't fit into any partition any longer due to
            changed partitioning ranges or list values.
         */
-        deleted++;
+        result= ER_PARTITION_ALTER_CAUSES_DELETE;
+        goto error;
       }
       else
       {
@@ -5239,6 +5240,8 @@ void ha_partition::print_error(int error
 
   if (error == HA_ERR_NO_PARTITION_FOUND)
     m_part_info->print_no_partition_found(table);
+  else if (error == ER_PARTITION_ALTER_CAUSES_DELETE)
+    my_error(error, MYF(0));
   else
     m_file[m_last_part]->print_error(error, errflag);
   DBUG_VOID_RETURN;
Thread
bk commit into 5.1 tree (holyfoot:1.2478) BUG#23603holyfoot18 Mar