From 0977734cee1c8197adf747bcc4bd89a91266fe74 Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Mon, 8 Jul 2013 18:35:44 -0700 Subject: [PATCH] Fixed all remaining failures in partition tests. Commented out the test case for bug 50036 as it was done in mysql-5.6.10. --- mysql-test/r/partition_binlog.result | 2 +- mysql-test/r/partition_debug_sync.result | 5 +- mysql-test/r/partition_mgm_err.result | 2 +- mysql-test/r/partition_myisam.result | 79 +------------------- mysql-test/t/partition_binlog.test | 2 +- mysql-test/t/partition_debug_sync.test | 5 +- mysql-test/t/partition_mgm_err.test | 2 +- mysql-test/t/partition_myisam.test | 93 ++++++++++++------------ 8 files changed, 59 insertions(+), 131 deletions(-) diff --git a/mysql-test/r/partition_binlog.result b/mysql-test/r/partition_binlog.result index 2c4ab1d0a30..624295dff1e 100644 --- a/mysql-test/r/partition_binlog.result +++ b/mysql-test/r/partition_binlog.result @@ -9,7 +9,7 @@ PARTITION BY RANGE (id) PARTITION pmax VALUES LESS THAN (MAXVALUE)); INSERT INTO t1 VALUES (1), (10), (100), (1000); ALTER TABLE t1 TRUNCATE PARTITION p1; -ERROR HY000: Incorrect partition name +ERROR HY000: Unknown partition 'p1' in table 't1' ALTER TABLE t1 DROP PARTITION p1; ERROR HY000: Error in list of partitions to DROP # No error returned, output in table format instead: diff --git a/mysql-test/r/partition_debug_sync.result b/mysql-test/r/partition_debug_sync.result index ad0f6df5ff2..42628aca35c 100644 --- a/mysql-test/r/partition_debug_sync.result +++ b/mysql-test/r/partition_debug_sync.result @@ -20,14 +20,15 @@ PARTITION p2 VALUES LESS THAN (100), PARTITION p3 VALUES LESS THAN MAXVALUE ) */; SET SESSION debug_dbug= "+d,sleep_before_create_table_no_lock"; SET DEBUG_SYNC= 'alter_table_before_create_table_no_lock SIGNAL removing_partitioning WAIT_FOR waiting_for_alter'; -SET DEBUG_SYNC= 'alter_table_before_main_binlog SIGNAL partitioning_removed'; +SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL waiting_for_upgrade'; ALTER TABLE t1 REMOVE PARTITIONING; # Con default SET DEBUG_SYNC= 'now WAIT_FOR removing_partitioning'; SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL waiting_for_alter'; -SET DEBUG_SYNC= 'rm_table_no_locks_before_delete_table WAIT_FOR partitioning_removed'; +SET DEBUG_SYNC= 'rm_table_no_locks_before_delete_table WAIT_FOR waiting_for_upgrade'; DROP TABLE IF EXISTS t1; # Con 1 +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction SET SESSION debug_dbug= "-d,sleep_before_create_table_no_lock"; SET DEBUG_SYNC= 'RESET'; SET DEBUG_SYNC= 'RESET'; diff --git a/mysql-test/r/partition_mgm_err.result b/mysql-test/r/partition_mgm_err.result index a13278d724e..cbf45a2b7be 100644 --- a/mysql-test/r/partition_mgm_err.result +++ b/mysql-test/r/partition_mgm_err.result @@ -98,7 +98,7 @@ PARTITION BY KEY (a) (PARTITION x0, PARTITION x1); ALTER TABLE t1 ADD PARTITION PARTITIONS 0; ERROR HY000: At least one partition must be added -ALTER TABLE t1 ADD PARTITION PARTITIONS 1024; +ALTER TABLE t1 ADD PARTITION PARTITIONS 8192; ERROR HY000: Too many partitions (including subpartitions) were defined ALTER TABLE t1 DROP PARTITION x0; ERROR HY000: DROP PARTITION can only be used on RANGE/LIST partitions diff --git a/mysql-test/r/partition_myisam.result b/mysql-test/r/partition_myisam.result index f0844c0b407..6e0642f9cee 100644 --- a/mysql-test/r/partition_myisam.result +++ b/mysql-test/r/partition_myisam.result @@ -1,82 +1,5 @@ DROP TABLE IF EXISTS t1, t2; # -# Bug#50036: Inconsistent errors when using TIMESTAMP -# columns/expressions -# Added test with existing TIMESTAMP partitioning (when it was allowed). -CREATE TABLE t1 (a TIMESTAMP) -ENGINE = MyISAM -PARTITION BY HASH (UNIX_TIMESTAMP(a)); -INSERT INTO t1 VALUES ('2000-01-02 03:04:05'); -SELECT * FROM t1; -a -2000-01-02 03:04:05 -FLUSH TABLES; -# replacing t1.frm with TO_DAYS(a) which was allowed earlier. -# Disable warnings, since the result would differ when running with -# --ps-protocol (only for the 'SELECT * FROM t1' statement). -SELECT * FROM t1; -a -2000-01-02 03:04:05 -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP -) ENGINE= DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (TO_DAYS(a)) */ -INSERT INTO t1 VALUES ('2001-02-03 04:05:06'); -SELECT * FROM t1; -a -2000-01-02 03:04:05 -2001-02-03 04:05:06 -ALTER TABLE t1 ADD PARTITION PARTITIONS 2; -Warnings: -Warning 1486 Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed -ALTER TABLE t1 -PARTITION BY RANGE (TO_DAYS(a)) -(PARTITION p0 VALUES LESS THAN (10000), -PARTITION p1 VALUES LESS THAN (MAXVALUE)); -ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (TO_DAYS(a)) -PARTITIONS 3 */ -CREATE TABLE t2 LIKE t1; -SHOW CREATE TABLE t2; -Table Create Table -t2 CREATE TABLE `t2` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (TO_DAYS(a)) -PARTITIONS 3 */ -Warnings: -Warning 1486 Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed -DROP TABLE t2; -CREATE TABLE t2 SELECT * FROM t1; -DROP TABLE t2; -ALTER TABLE t1 PARTITION BY HASH (UNIX_TIMESTAMP(a)); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (UNIX_TIMESTAMP(a)) */ -ALTER TABLE t1 ADD PARTITION PARTITIONS 2; -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (UNIX_TIMESTAMP(a)) -PARTITIONS 3 */ -SELECT * FROM t1; -a -2000-01-02 03:04:05 -2001-02-03 04:05:06 -DROP TABLE t1; -# # Bug#31931: Mix of handlers error message # CREATE TABLE t1 (a INT) @@ -109,7 +32,7 @@ ERROR HY000: Failed to read from the .par file # Note that it is currently impossible to drop a partitioned table # without the .par file DROP TABLE t1; -ERROR 42S02: Unknown table 't1' +ERROR 42S02: Unknown table 'test.t1' # # Bug#50392: insert_id is not reset for partitioned tables # auto_increment on duplicate entry diff --git a/mysql-test/t/partition_binlog.test b/mysql-test/t/partition_binlog.test index 9869be75759..d6986c86ebe 100644 --- a/mysql-test/t/partition_binlog.test +++ b/mysql-test/t/partition_binlog.test @@ -20,7 +20,7 @@ INSERT INTO t1 VALUES (1), (10), (100), (1000); --let $binlog_file=query_get_value(SHOW MASTER STATUS, File, 1) --let $binlog_start=query_get_value(SHOW MASTER STATUS, Position, 1) ---error ER_WRONG_PARTITION_NAME +--error ER_UNKNOWN_PARTITION ALTER TABLE t1 TRUNCATE PARTITION p1; --error ER_DROP_PARTITION_NON_EXISTENT ALTER TABLE t1 DROP PARTITION p1; diff --git a/mysql-test/t/partition_debug_sync.test b/mysql-test/t/partition_debug_sync.test index 027a4bd19a7..694c95bfa0e 100644 --- a/mysql-test/t/partition_debug_sync.test +++ b/mysql-test/t/partition_debug_sync.test @@ -32,16 +32,17 @@ ENGINE = MYISAM PARTITION p3 VALUES LESS THAN MAXVALUE ) */; SET SESSION debug_dbug= "+d,sleep_before_create_table_no_lock"; SET DEBUG_SYNC= 'alter_table_before_create_table_no_lock SIGNAL removing_partitioning WAIT_FOR waiting_for_alter'; -SET DEBUG_SYNC= 'alter_table_before_main_binlog SIGNAL partitioning_removed'; +SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL waiting_for_upgrade'; --send ALTER TABLE t1 REMOVE PARTITIONING connection default; --echo # Con default SET DEBUG_SYNC= 'now WAIT_FOR removing_partitioning'; SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL waiting_for_alter'; -SET DEBUG_SYNC= 'rm_table_no_locks_before_delete_table WAIT_FOR partitioning_removed'; +SET DEBUG_SYNC= 'rm_table_no_locks_before_delete_table WAIT_FOR waiting_for_upgrade'; DROP TABLE IF EXISTS t1; --echo # Con 1 connection con1; +--error ER_LOCK_DEADLOCK --reap SET SESSION debug_dbug= "-d,sleep_before_create_table_no_lock"; connection default; diff --git a/mysql-test/t/partition_mgm_err.test b/mysql-test/t/partition_mgm_err.test index f921fa8ebca..0987c427fc7 100644 --- a/mysql-test/t/partition_mgm_err.test +++ b/mysql-test/t/partition_mgm_err.test @@ -147,7 +147,7 @@ PARTITION BY KEY (a) ALTER TABLE t1 ADD PARTITION PARTITIONS 0; --error ER_TOO_MANY_PARTITIONS_ERROR -ALTER TABLE t1 ADD PARTITION PARTITIONS 1024; +ALTER TABLE t1 ADD PARTITION PARTITIONS 8192; --error ER_ONLY_ON_RANGE_LIST_PARTITION ALTER TABLE t1 DROP PARTITION x0; diff --git a/mysql-test/t/partition_myisam.test b/mysql-test/t/partition_myisam.test index 49c5d793169..0a4d14662a3 100644 --- a/mysql-test/t/partition_myisam.test +++ b/mysql-test/t/partition_myisam.test @@ -11,51 +11,54 @@ DROP TABLE IF EXISTS t1, t2; let $MYSQLD_DATADIR= `SELECT @@datadir`; ---echo # ---echo # Bug#50036: Inconsistent errors when using TIMESTAMP ---echo # columns/expressions - ---echo # Added test with existing TIMESTAMP partitioning (when it was allowed). -CREATE TABLE t1 (a TIMESTAMP) -ENGINE = MyISAM -PARTITION BY HASH (UNIX_TIMESTAMP(a)); -INSERT INTO t1 VALUES ('2000-01-02 03:04:05'); ---sorted_result -SELECT * FROM t1; -FLUSH TABLES; ---echo # replacing t1.frm with TO_DAYS(a) which was allowed earlier. ---remove_file $MYSQLD_DATADIR/test/t1.frm ---copy_file std_data/parts/t1TIMESTAMP.frm $MYSQLD_DATADIR/test/t1.frm ---echo # Disable warnings, since the result would differ when running with ---echo # --ps-protocol (only for the 'SELECT * FROM t1' statement). ---disable_warnings ---sorted_result -SELECT * FROM t1; ---enable_warnings ---replace_result MyISAM InnoDB -SHOW CREATE TABLE t1; -INSERT INTO t1 VALUES ('2001-02-03 04:05:06'); ---sorted_result -SELECT * FROM t1; -ALTER TABLE t1 ADD PARTITION PARTITIONS 2; ---error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR -ALTER TABLE t1 -PARTITION BY RANGE (TO_DAYS(a)) -(PARTITION p0 VALUES LESS THAN (10000), - PARTITION p1 VALUES LESS THAN (MAXVALUE)); -SHOW CREATE TABLE t1; -CREATE TABLE t2 LIKE t1; -SHOW CREATE TABLE t2; -DROP TABLE t2; -CREATE TABLE t2 SELECT * FROM t1; -DROP TABLE t2; -ALTER TABLE t1 PARTITION BY HASH (UNIX_TIMESTAMP(a)); -SHOW CREATE TABLE t1; -ALTER TABLE t1 ADD PARTITION PARTITIONS 2; -SHOW CREATE TABLE t1; ---sorted_result -SELECT * FROM t1; -DROP TABLE t1; +# +# Disabled by WL#946: binary format for timestamp column is not compatible. +# So the trick with replacing FRM file does not work any more. +#--echo # +#--echo # Bug#50036: Inconsistent errors when using TIMESTAMP +#--echo # columns/expressions +# +#--echo # Added test with existing TIMESTAMP partitioning (when it was allowed). +#CREATE TABLE t1 (a TIMESTAMP) +#ENGINE = MyISAM +#PARTITION BY HASH (UNIX_TIMESTAMP(a)); +#INSERT INTO t1 VALUES ('2000-01-02 03:04:05'); +#--sorted_result +#SELECT * FROM t1; +#FLUSH TABLES; +#--echo # replacing t1.frm with TO_DAYS(a) which was allowed earlier. +#--remove_file $MYSQLD_DATADIR/test/t1.frm +#--copy_file std_data/parts/t1TIMESTAMP.frm $MYSQLD_DATADIR/test/t1.frm +#--echo # Disable warnings, since the result would differ when running with +#--echo # --ps-protocol (only for the 'SELECT * FROM t1' statement). +#--disable_warnings +#--sorted_result +#SELECT * FROM t1; +#--enable_warnings +#--replace_result MyISAM InnoDB +#SHOW CREATE TABLE t1; +#INSERT INTO t1 VALUES ('2001-02-03 04:05:06'); +#--sorted_result +#SELECT * FROM t1; +#ALTER TABLE t1 ADD PARTITION PARTITIONS 2; +#--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR +#ALTER TABLE t1 +#PARTITION BY RANGE (TO_DAYS(a)) +#(PARTITION p0 VALUES LESS THAN (10000), +# PARTITION p1 VALUES LESS THAN (MAXVALUE)); +#SHOW CREATE TABLE t1; +#CREATE TABLE t2 LIKE t1; +#SHOW CREATE TABLE t2; +#DROP TABLE t2; +#CREATE TABLE t2 SELECT * FROM t1; +#DROP TABLE t2; +#ALTER TABLE t1 PARTITION BY HASH (UNIX_TIMESTAMP(a)); +#SHOW CREATE TABLE t1; +#ALTER TABLE t1 ADD PARTITION PARTITIONS 2; +#SHOW CREATE TABLE t1; +#--sorted_result +#SELECT * FROM t1; +#DROP TABLE t1; --echo #