List:Commits« Previous MessageNext Message »
From:Mattias Jonsson Date:November 16 2010 12:40am
Subject:bzr commit into mysql-trunk branch (mattias.jonsson:3342)
View as plain text  
#At file:///Users/mattiasj/mysql-bzr/topush-trunk-bugfixing/ based on revid:mattias.jonsson@stripped

 3342 Mattias Jonsson	2010-11-16 [merge]
      merge

    modified:
      mysql-test/r/partition_exchange.result
      mysql-test/t/partition_exchange.test
      sql/sql_partition_admin.cc
      sql/sql_yacc.yy
=== modified file 'mysql-test/r/partition_exchange.result'
--- a/mysql-test/r/partition_exchange.result	2010-10-21 22:25:09 +0000
+++ b/mysql-test/r/partition_exchange.result	2010-11-16 00:39:46 +0000
@@ -135,46 +135,6 @@ a	b
 64	Sixty four
 ALTER TABLE tp EXCHANGE PARTITION p1 WITH TABLE t;
 ERROR HY000: Found row that does not match the partition
-ALTER TABLE tp EXCHANGE PARTITION p1 WITH TABLE t IGNORE;
-SHOW CREATE TABLE t;
-Table	Create Table
-t	CREATE TABLE `t` (
-  `a` int(11) NOT NULL DEFAULT '0',
-  `b` varchar(55) DEFAULT NULL,
-  PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SHOW CREATE TABLE tp;
-Table	Create Table
-tp	CREATE TABLE `tp` (
-  `a` int(11) NOT NULL DEFAULT '0',
-  `b` varchar(55) DEFAULT NULL,
-  PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY RANGE (a)
-(PARTITION p0 VALUES LESS THAN (100) ENGINE = MyISAM,
- PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
-SELECT * FROM t;
-a	b
-161	161
-162	162
-163	163
-164	164
-200	Two hundred, end of values
-SELECT * FROM tp;
-a	b
-1	First value
-10	Ten
-2	First value
-3	Three
-5	Five
-50	Fifty
-61	Sixty one
-62	Sixty two
-63	Sixty three
-64	Sixty four
-99	End of values
-# No need to use ignore on the original partition
-ALTER TABLE tp EXCHANGE PARTITION p1 WITH TABLE t;
 SHOW CREATE TABLE t;
 Table	Create Table
 t	CREATE TABLE `t` (
@@ -213,15 +173,19 @@ a	b
 63	Sixty three
 64	Sixty four
 # Test list of partitions
+ALTER TABLE tp EXCHANGE PARTITION p1 WITH TABLE t IGNORE;
+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 'IGNORE' at line 1
 ALTER TABLE tp EXCHANGE PARTITION p0,p1 WITH TABLE t IGNORE;
 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 'p1 WITH TABLE t IGNORE' at line 1
+ALTER TABLE tp EXCHANGE PARTITION p0,p1 WITH TABLE t;
+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 'p1 WITH TABLE t' at line 1
 ALTER TABLE tp EXCHANGE PARTITION (p0,p1) WITH TABLE t;
 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 '(p0,p1) WITH TABLE t' at line 1
-ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE (t,t2) IGNORE;
-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 '(t,t2) IGNORE' at line 1
+ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE (t,t2);
+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 '(t,t2)' at line 1
 ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t,t2;
 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 't2' at line 1
-ALTER TABLE tp EXCHANGE PARTITION non_existent WITH TABLE t IGNORE;
+ALTER TABLE tp EXCHANGE PARTITION non_existent WITH TABLE t;
 ERROR HY000: Unknown partition 'non_existent' in table 'tp'
 ALTER TABLE tsp EXCHANGE PARTITION p0 WITH TABLE t;
 ERROR HY000: Subpartitioned table, use subpartition instead of partition
@@ -280,7 +244,7 @@ a	b
 63	Sixty three
 64	Sixty four
 # Test exchange partition
-ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t IGNORE;
+ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t;
 SHOW CREATE TABLE t;
 Table	Create Table
 t	CREATE TABLE `t` (
@@ -356,46 +320,8 @@ a	b
 62	Sixty two
 63	Sixty three
 64	Sixty four
-ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t;
-SHOW CREATE TABLE t;
-Table	Create Table
-t	CREATE TABLE `t` (
-  `a` int(11) NOT NULL DEFAULT '0',
-  `b` varchar(55) DEFAULT NULL,
-  PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SHOW CREATE TABLE tp;
-Table	Create Table
-tp	CREATE TABLE `tp` (
-  `a` int(11) NOT NULL DEFAULT '0',
-  `b` varchar(55) DEFAULT NULL,
-  PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY RANGE (a)
-(PARTITION p0 VALUES LESS THAN (100) ENGINE = MyISAM,
- PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
-SELECT * FROM t;
-a	b
-10	Ten
-2	First value
-50	Fifty
-61	Sixty one
-62	Sixty two
-63	Sixty three
-64	Sixty four
-SELECT * FROM tp;
-a	b
-1	First value
-161	161
-162	162
-163	163
-164	164
-200	Two hundred, end of values
-3	Three
-5	Five
-99	End of values
-# Test exchange subpartition with IGNORE
-ALTER TABLE tsp EXCHANGE PARTITION sp3 WITH TABLE t IGNORE;
+# Test exchange subpartition
+ALTER TABLE tsp EXCHANGE PARTITION sp1 WITH TABLE t;
 SHOW CREATE TABLE t;
 Table	Create Table
 t	CREATE TABLE `t` (
@@ -420,28 +346,25 @@ SUBPARTITION BY HASH (a)
   SUBPARTITION sp3 ENGINE = MyISAM)) */
 SELECT * FROM t;
 a	b
-161	161
-163	163
+61	Sixty one
+63	Sixty three
 SELECT * FROM tsp;
 a	b
+1	First value
 10	Ten
-10	Ten
+161	161
 162	162
+163	163
 164	164
 2	First value
-2	First value
 200	Two hundred, end of values
+3	Three
+5	Five
 50	Fifty
-50	Fifty
-61	Sixty one
-61	Sixty one
-62	Sixty two
 62	Sixty two
-63	Sixty three
-63	Sixty three
-64	Sixty four
 64	Sixty four
-ALTER TABLE tsp EXCHANGE PARTITION sp3 WITH TABLE t IGNORE;
+99	End of values
+ALTER TABLE tsp EXCHANGE PARTITION sp1 WITH TABLE t;
 ALTER TABLE t ENGINE = InnoDB;
 ALTER TABLE tp ENGINE = InnoDB;
 SHOW CREATE TABLE t;
@@ -463,25 +386,25 @@ tp	CREATE TABLE `tp` (
  PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
 SELECT * FROM t;
 a	b
-10	Ten
-2	First value
-50	Fifty
-61	Sixty one
-62	Sixty two
-63	Sixty three
-64	Sixty four
+1	First value
+3	Three
+5	Five
+99	End of values
 SELECT * FROM tp;
 a	b
-1	First value
+10	Ten
 161	161
 162	162
 163	163
 164	164
+2	First value
 200	Two hundred, end of values
-3	Three
-5	Five
-99	End of values
-ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t IGNORE;
+50	Fifty
+61	Sixty one
+62	Sixty two
+63	Sixty three
+64	Sixty four
+ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t;
 SHOW CREATE TABLE t;
 Table	Create Table
 t	CREATE TABLE `t` (
@@ -501,25 +424,25 @@ tp	CREATE TABLE `tp` (
  PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
 SELECT * FROM t;
 a	b
-1	First value
-3	Three
-5	Five
-99	End of values
-SELECT * FROM tp;
-a	b
 10	Ten
-161	161
-162	162
-163	163
-164	164
 2	First value
-200	Two hundred, end of values
 50	Fifty
 61	Sixty one
 62	Sixty two
 63	Sixty three
 64	Sixty four
-ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t IGNORE;
+SELECT * FROM tp;
+a	b
+1	First value
+161	161
+162	162
+163	163
+164	164
+200	Two hundred, end of values
+3	Three
+5	Five
+99	End of values
+ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t;
 # test different engines
 ALTER TABLE t ENGINE = MyISAM;
 ALTER TABLE tp ENGINE = InnoDB;
@@ -540,7 +463,7 @@ tp	CREATE TABLE `tp` (
 /*!50100 PARTITION BY RANGE (a)
 (PARTITION p0 VALUES LESS THAN (100) ENGINE = InnoDB,
  PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
-ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t IGNORE;
+ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t;
 ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL
 SHOW CREATE TABLE t;
 Table	Create Table
@@ -566,7 +489,7 @@ INSERT INTO tmp SELECT * FROM t;
 RENAME TABLE t TO tmp2, tmp TO t;
 ALTER TABLE tp ENGINE = MyISAM;
 ALTER TABLE t CHARACTER SET = koi8r COLLATE koi8r_general_ci;
-ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t IGNORE;
+ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t;
 ERROR HY000: Non matching attribute 'CHARACTER SET' between partition and table
 DROP TABLE t;
 # Test multiple different table options
@@ -592,7 +515,7 @@ tp	CREATE TABLE `tp` (
 /*!50100 PARTITION BY RANGE (a)
 (PARTITION p0 VALUES LESS THAN (100) ENGINE = MyISAM,
  PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
-ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t IGNORE;
+ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t;
 ERROR HY000: Non matching attribute 'MAX_ROWS' between partition and table
 SHOW WARNINGS;
 Level	Code	Message
@@ -603,7 +526,7 @@ RENAME TABLE tmp2 TO t;
 ALTER TABLE t ADD KEY ba_key (b, a);
 ALTER TABLE tp ADD KEY ba_key (b, a);
 ALTER TABLE tsp ADD KEY ba_key (b, a);
-ALTER TABLE tp EXCHANGE PARTITION p1 WITH TABLE t IGNORE;
+ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t;
 SHOW CREATE TABLE t;
 Table	Create Table
 t	CREATE TABLE `t` (
@@ -625,35 +548,35 @@ tp	CREATE TABLE `tp` (
  PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
 SELECT * FROM t;
 a	b
-161	161
-162	162
-163	163
-164	164
-200	Two hundred, end of values
-SELECT * FROM tp;
-a	b
-1	First value
 10	Ten
 2	First value
-3	Three
-5	Five
 50	Fifty
 61	Sixty one
 62	Sixty two
 63	Sixty three
 64	Sixty four
+SELECT * FROM tp;
+a	b
+1	First value
+161	161
+162	162
+163	163
+164	164
+200	Two hundred, end of values
+3	Three
+5	Five
 99	End of values
-ALTER TABLE tp EXCHANGE PARTITION p1 WITH TABLE t IGNORE;
+ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t;
 ALTER TABLE t DROP KEY ba_key;
-ALTER TABLE tp EXCHANGE PARTITION p1 WITH TABLE t IGNORE;
+ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t;
 ERROR HY000: Tables have different definitions
 ALTER TABLE t ADD KEY b_key (b);
-ALTER TABLE tsp EXCHANGE PARTITION sp1 WITH TABLE t IGNORE;
+ALTER TABLE tsp EXCHANGE PARTITION sp1 WITH TABLE t;
 ERROR HY000: Tables have different definitions
 ALTER TABLE t ADD KEY ba_key (b, a);
 ALTER TABLE t DROP KEY b_key;
 ALTER TABLE t CHANGE a c INT;
-ALTER TABLE tsp EXCHANGE PARTITION sp1 WITH TABLE t IGNORE;
+ALTER TABLE tsp EXCHANGE PARTITION sp1 WITH TABLE t;
 ERROR HY000: Tables have different definitions
 ALTER TABLE t CHANGE c a INT;
 # test temporary table
@@ -682,7 +605,7 @@ tp	CREATE TABLE `tp` (
 /*!50100 PARTITION BY RANGE (a)
 (PARTITION p0 VALUES LESS THAN (100) ENGINE = MyISAM,
  PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
-ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t IGNORE;
+ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t;
 ERROR HY000: Table to exchange with partition is temporary: 't'
 SHOW CREATE TABLE t;
 Table	Create Table
@@ -707,7 +630,7 @@ DROP TEMPORARY TABLE t;
 ALTER TABLE tmp2 RENAME TO t;
 # Test non partitioned table
 ALTER TABLE tp REMOVE PARTITIONING;
-ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t IGNORE;
+ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t;
 ERROR HY000: Partition management on a not partitioned table is not possible
 DROP TABLE t, tp, tsp;
 # Test with general_log

=== modified file 'mysql-test/t/partition_exchange.test'
--- a/mysql-test/t/partition_exchange.test	2010-08-25 14:00:02 +0000
+++ b/mysql-test/t/partition_exchange.test	2010-10-29 10:20:18 +0000
@@ -73,15 +73,6 @@ SELECT * FROM t;
 SELECT * FROM tp;
 --error ER_ROW_DOES_NOT_MATCH_PARTITION
 ALTER TABLE tp EXCHANGE PARTITION p1 WITH TABLE t;
-ALTER TABLE tp EXCHANGE PARTITION p1 WITH TABLE t IGNORE;
-SHOW CREATE TABLE t;
-SHOW CREATE TABLE tp;
---sorted_result
-SELECT * FROM t;
---sorted_result
-SELECT * FROM tp;
---echo # No need to use ignore on the original partition
-ALTER TABLE tp EXCHANGE PARTITION p1 WITH TABLE t;
 SHOW CREATE TABLE t;
 SHOW CREATE TABLE tp;
 --sorted_result
@@ -90,15 +81,19 @@ SELECT * FROM t;
 SELECT * FROM tp;
 --echo # Test list of partitions
 --error ER_PARSE_ERROR
+ALTER TABLE tp EXCHANGE PARTITION p1 WITH TABLE t IGNORE;
+--error ER_PARSE_ERROR
 ALTER TABLE tp EXCHANGE PARTITION p0,p1 WITH TABLE t IGNORE;
 --error ER_PARSE_ERROR
+ALTER TABLE tp EXCHANGE PARTITION p0,p1 WITH TABLE t;
+--error ER_PARSE_ERROR
 ALTER TABLE tp EXCHANGE PARTITION (p0,p1) WITH TABLE t;
 --error ER_PARSE_ERROR
-ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE (t,t2) IGNORE;
+ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE (t,t2);
 --error ER_PARSE_ERROR
 ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t,t2;
 --error ER_UNKNOWN_PARTITION
-ALTER TABLE tp EXCHANGE PARTITION non_existent WITH TABLE t IGNORE;
+ALTER TABLE tp EXCHANGE PARTITION non_existent WITH TABLE t;
 --error ER_PARTITION_INSTEAD_OF_SUBPARTITION
 ALTER TABLE tsp EXCHANGE PARTITION p0 WITH TABLE t;
 --error ER_PARTITION_EXCHANGE_PART_TABLE
@@ -111,13 +106,6 @@ SELECT * FROM t;
 --sorted_result
 SELECT * FROM tp;
 --echo # Test exchange partition
-ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t IGNORE;
-SHOW CREATE TABLE t;
-SHOW CREATE TABLE tp;
---sorted_result
-SELECT * FROM t;
---sorted_result
-SELECT * FROM tp;
 ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t;
 SHOW CREATE TABLE t;
 SHOW CREATE TABLE tp;
@@ -132,15 +120,15 @@ SHOW CREATE TABLE tp;
 SELECT * FROM t;
 --sorted_result
 SELECT * FROM tp;
---echo # Test exchange subpartition with IGNORE
-ALTER TABLE tsp EXCHANGE PARTITION sp3 WITH TABLE t IGNORE;
+--echo # Test exchange subpartition
+ALTER TABLE tsp EXCHANGE PARTITION sp1 WITH TABLE t;
 SHOW CREATE TABLE t;
 SHOW CREATE TABLE tsp;
 --sorted_result
 SELECT * FROM t;
 --sorted_result
 SELECT * FROM tsp;
-ALTER TABLE tsp EXCHANGE PARTITION sp3 WITH TABLE t IGNORE;
+ALTER TABLE tsp EXCHANGE PARTITION sp1 WITH TABLE t;
 ALTER TABLE t ENGINE = InnoDB;
 ALTER TABLE tp ENGINE = InnoDB;
 SHOW CREATE TABLE t;
@@ -149,21 +137,21 @@ SHOW CREATE TABLE tp;
 SELECT * FROM t;
 --sorted_result
 SELECT * FROM tp;
-ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t IGNORE;
+ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t;
 SHOW CREATE TABLE t;
 SHOW CREATE TABLE tp;
 --sorted_result
 SELECT * FROM t;
 --sorted_result
 SELECT * FROM tp;
-ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t IGNORE;
+ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t;
 --echo # test different engines
 ALTER TABLE t ENGINE = MyISAM;
 ALTER TABLE tp ENGINE = InnoDB;
 SHOW CREATE TABLE t;
 SHOW CREATE TABLE tp;
 --error ER_MIX_HANDLER_ERROR
-ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t IGNORE;
+ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t;
 SHOW CREATE TABLE t;
 SHOW CREATE TABLE tp;
 --echo # Test different charsets
@@ -174,7 +162,7 @@ RENAME TABLE t TO tmp2, tmp TO t;
 ALTER TABLE tp ENGINE = MyISAM;
 ALTER TABLE t CHARACTER SET = koi8r COLLATE koi8r_general_ci;
 --error ER_PARTITION_EXCHANGE_DIFFERENT_OPTION
-ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t IGNORE;
+ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t;
 DROP TABLE t;
 --echo # Test multiple different table options
 CREATE TABLE t (a INT,
@@ -185,7 +173,7 @@ INSERT INTO t SELECT * FROM tmp2;
 SHOW CREATE TABLE t;
 SHOW CREATE TABLE tp;
 --error ER_PARTITION_EXCHANGE_DIFFERENT_OPTION
-ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t IGNORE;
+ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t;
 SHOW WARNINGS;
 DROP TABLE t;
 RENAME TABLE tmp2 TO t;
@@ -193,27 +181,27 @@ RENAME TABLE tmp2 TO t;
 ALTER TABLE t ADD KEY ba_key (b, a);
 ALTER TABLE tp ADD KEY ba_key (b, a);
 ALTER TABLE tsp ADD KEY ba_key (b, a);
-ALTER TABLE tp EXCHANGE PARTITION p1 WITH TABLE t IGNORE;
+ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t;
 SHOW CREATE TABLE t;
 SHOW CREATE TABLE tp;
 --sorted_result
 SELECT * FROM t;
 --sorted_result
 SELECT * FROM tp;
-ALTER TABLE tp EXCHANGE PARTITION p1 WITH TABLE t IGNORE;
+ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t;
 ALTER TABLE t DROP KEY ba_key;
 --error ER_TABLES_DIFFERENT_METADATA
-ALTER TABLE tp EXCHANGE PARTITION p1 WITH TABLE t IGNORE;
+ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t;
 ALTER TABLE t ADD KEY b_key (b);
 --error ER_TABLES_DIFFERENT_METADATA
-ALTER TABLE tsp EXCHANGE PARTITION sp1 WITH TABLE t IGNORE;
+ALTER TABLE tsp EXCHANGE PARTITION sp1 WITH TABLE t;
 ALTER TABLE t ADD KEY ba_key (b, a);
 ALTER TABLE t DROP KEY b_key;
 # test different index types
 # test different columns
 ALTER TABLE t CHANGE a c INT;
 --error ER_TABLES_DIFFERENT_METADATA
-ALTER TABLE tsp EXCHANGE PARTITION sp1 WITH TABLE t IGNORE;
+ALTER TABLE tsp EXCHANGE PARTITION sp1 WITH TABLE t;
 ALTER TABLE t CHANGE c a INT;
 # test different data/index dir
 # test different options (row_format, max/min_rows, comments, tablespace,
@@ -229,7 +217,7 @@ ALTER TABLE tmp RENAME TO t;
 SHOW CREATE TABLE t;
 SHOW CREATE TABLE tp;
 --error ER_PARTITION_EXCHANGE_TEMP_TABLE
-ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t IGNORE;
+ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t;
 SHOW CREATE TABLE t;
 SHOW CREATE TABLE tp;
 DROP TEMPORARY TABLE t;
@@ -237,7 +225,7 @@ ALTER TABLE tmp2 RENAME TO t;
 --echo # Test non partitioned table
 ALTER TABLE tp REMOVE PARTITIONING;
 --error ER_PARTITION_MGMT_ON_NONPARTITIONED
-ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t IGNORE;
+ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t;
 
 # TODO:
 # Verify that it is possible to read a table that is going to be exchanged

=== modified file 'sql/sql_partition_admin.cc'
--- a/sql/sql_partition_admin.cc	2010-10-29 10:34:33 +0000
+++ b/sql/sql_partition_admin.cc	2010-11-16 00:39:46 +0000
@@ -448,13 +448,13 @@ err_no_action_written:
   @brief Swap places between a partition and a table.
 
   @details Verify that the tables are compatible (same engine, definition etc),
-  if not IGNORE is given, verify that all rows in the table will fit in the
-  partition, if all OK, rename table to tmp name, rename partition to table
+  verify that all rows in the table will fit in the partition,
+  if all OK, rename table to tmp name, rename partition to table
   and finally rename tmp name to partition.
 
   1) Take upgradable mdl, open tables and then lock them (inited in parse)
   2) Verify that metadata matches
-  3) If not ignore, verify data
+  3) verify data
   4) Upgrade to exclusive mdl for both tables
   5) Rename table <-> partition
   6) Rely on close_thread_tables to release mdl and table locks
@@ -463,7 +463,6 @@ err_no_action_written:
   @param table_list     Table where the partition exists as first table,
                         Table to swap with the partition as second table
   @param alter_info     Contains partition name to swap
-  @param ignore         flag to skip verification of partition values
 
   @note This is a DDL operation so triggers will not be used.
 */
@@ -484,7 +483,7 @@ bool Sql_cmd_alter_table_exchange_partit
   Alter_table_prelocking_strategy alter_prelocking_strategy(alter_info);
   MDL_ticket *swap_table_mdl_ticket= NULL;
   MDL_ticket *part_table_mdl_ticket= NULL;
-  bool error= TRUE, ignore= thd->lex->ignore;
+  bool error= TRUE;
   DBUG_ENTER("mysql_exchange_partition");
   DBUG_ASSERT(alter_info->flags & ALTER_EXCHANGE_PARTITION);
 
@@ -574,11 +573,10 @@ bool Sql_cmd_alter_table_exchange_partit
 
   /* Table and partition has same structure/options, OK to exchange */
 
-  if (!ignore)
-  {
-    if (verify_data_with_partition(swap_table, part_table, swap_part_id))
-      DBUG_RETURN(TRUE);
-  }
+  thd_proc_info(thd, "verifying data with partition");
+
+  if (verify_data_with_partition(swap_table, part_table, swap_part_id))
+    DBUG_RETURN(TRUE);
 
   /*
     Get exclusive mdl lock on both tables, alway the non partitioned table

=== modified file 'sql/sql_yacc.yy'
--- a/sql/sql_yacc.yy	2010-11-05 12:03:40 +0000
+++ b/sql/sql_yacc.yy	2010-11-16 00:39:46 +0000
@@ -6595,7 +6595,6 @@ alter_commands:
             if (lex->m_sql_cmd == NULL)
               MYSQL_YYABORT;
           }
-          opt_ignore
         ;
 
 remove_partitioning:

No bundle (reason: revision is a merge).
Thread
bzr commit into mysql-trunk branch (mattias.jonsson:3342) Mattias Jonsson16 Nov