List:Commits« Previous MessageNext Message »
From:Jim Winstead Date:March 8 2006 3:09am
Subject:bk commit into 5.1 tree (jimw:1.2167) BUG#17097
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of jimw. When jimw 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.2167 06/03/07 18:08:52 jimw@stripped +3 -0
  Bug #17097: Partitions: failing ADD PRIMARY KEY leads to temporary rotten
  metadata,crash
   When an ALTER TABLE on a table using partitioning fails, throw away the
   cached table definition, because it is no longer valid.

  sql/sql_table.cc
    1.312 06/03/07 18:08:48 jimw@stripped +2 -0
    Force table to get reloaded when an ALTER TABLE fails and it is partitioned

  mysql-test/t/partition.test
    1.20 06/03/07 18:08:48 jimw@stripped +11 -0
    New regression test

  mysql-test/r/partition.result
    1.16 06/03/07 18:08:48 jimw@stripped +11 -0
    New results

# 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:	jimw
# Host:	rama.(none)
# Root:	/home/jimw/my/mysql-5.1-17097

--- 1.311/sql/sql_table.cc	2006-03-06 01:23:51 -08:00
+++ 1.312/sql/sql_table.cc	2006-03-07 18:08:48 -08:00
@@ -4670,6 +4670,8 @@
     if (!new_table)
     {
       VOID(quick_rm_table(new_db_type,new_db,tmp_name));
+      if (table->part_info)
+        table->s->version= 0;
       goto err;
     }
   }

--- 1.15/mysql-test/r/partition.result	2006-03-07 03:23:15 -08:00
+++ 1.16/mysql-test/r/partition.result	2006-03-07 18:08:48 -08:00
@@ -422,4 +422,15 @@
 x123	11,12	1
 x234	NULL,1	1
 drop table t1;
+create table t1 (a int, b int) partition by list (a)
+(partition p1 values in (1), partition p2 values in (2));
+alter table t1 add primary key (b);
+ERROR HY000: A PRIMARY KEY need to include all fields in the partition function
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) DEFAULT NULL,
+  `b` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY LIST (a) (PARTITION p1 VALUES IN (1)
ENGINE = MyISAM, PARTITION p2 VALUES IN (2) ENGINE = MyISAM)
+drop table t1;
 End of 5.1 tests

--- 1.19/mysql-test/t/partition.test	2006-03-07 03:23:15 -08:00
+++ 1.20/mysql-test/t/partition.test	2006-03-07 18:08:48 -08:00
@@ -540,4 +540,15 @@
 from information_schema.partitions where table_schema ='test';
 drop table t1;
 
+#
+# Bug #17097: Partitions: failing ADD PRIMARY KEY leads to temporary rotten
+# metadata,crash
+#
+create table t1 (a int, b int) partition by list (a)
+  (partition p1 values in (1), partition p2 values in (2));
+--error ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF
+alter table t1 add primary key (b);
+show create table t1;
+drop table t1;
+
 --echo End of 5.1 tests
Thread
bk commit into 5.1 tree (jimw:1.2167) BUG#17097Jim Winstead8 Mar