diff options
Diffstat (limited to 'mysql-test')
62 files changed, 1569 insertions, 616 deletions
diff --git a/mysql-test/extra/rpl_tests/rpl_record_compare.test b/mysql-test/extra/rpl_tests/rpl_record_compare.test index f29e4fb791a..210aee025d0 100644 --- a/mysql-test/extra/rpl_tests/rpl_record_compare.test +++ b/mysql-test/extra/rpl_tests/rpl_record_compare.test @@ -62,4 +62,24 @@ UPDATE t1 SET c1= 0; DROP TABLE t1; -- sync_slave_with_master +# +# BUG#11766865: 60091: RBR + NO PK + UPDATE NULL VALUE --> SLAVE BREAK WITH ERROR HA_ERR_END_OF_ +# + +--connection master +--source include/rpl_reset.inc +--connection master + +--eval CREATE TABLE t1 (c1 int(11) NOT NULL, c2 int(11) NOT NULL, c3 int(11) DEFAULT '-1') ENGINE=$engine DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (1,2,NULL); +UPDATE t1 SET c1=1, c2=2, c3=-1 WHERE c1=1 AND c2=2 AND ISNULL(c3); + +--sync_slave_with_master + +--let $diff_tables=master:test.t1, slave:test.t1 +--source include/diff_tables.inc + +--connection master +DROP TABLE t1; +--sync_slave_with_master diff --git a/mysql-test/include/not_crashrep.inc b/mysql-test/include/not_crashrep.inc new file mode 100644 index 00000000000..e126f339a5f --- /dev/null +++ b/mysql-test/include/not_crashrep.inc @@ -0,0 +1,24 @@ +# Check if CrashReporter is enabled and would open a window + +perl; +sub skip_test { + # Only relevant on Mac OS X + return 0 unless $^O eq 'darwin'; + my $crep= `defaults read com.apple.CrashReporter DialogType`; + return 0 if $?; + chomp ($crep); + $crep= lc $crep; + return ($crep eq 'basic' || $crep eq 'developer'); +} +my $skip= skip_test(); +open (F, ">" . $ENV{'MYSQL_TMP_DIR'} . "/crashrep.inc"); +print F "let \$crashrep= $skip;\n"; +close F; +EOF + +--source $MYSQL_TMP_DIR/crashrep.inc +--remove_file $MYSQL_TMP_DIR/crashrep.inc + +if ($crashrep) { + --skip CrashReporter would popup a window +} diff --git a/mysql-test/r/bootstrap.result b/mysql-test/r/bootstrap.result index 3301ca74324..484724373d2 100644 --- a/mysql-test/r/bootstrap.result +++ b/mysql-test/r/bootstrap.result @@ -6,3 +6,15 @@ set @my_max_allowed_packet= @@max_allowed_packet; set global max_allowed_packet=100*@@max_allowed_packet; set global max_allowed_packet=@my_max_allowed_packet; drop table t1; +End of 5.1 tests +# +# Bug #11766306: 59393: HAVE_INNODB=YES WHEN MYSQLD +# STARTED WITH --SKIP-INNODB +# +SHOW VARIABLES LIKE 'have_innodb'; +Variable_name Value +have_innodb DISABLED +SELECT SUPPORT FROM INFORMATION_SCHEMA.ENGINES WHERE engine='innodb'; +SUPPORT +NO +End of 5.5 tests diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result index a27c7dc18ee..b0ca5daaea2 100644 --- a/mysql-test/r/events_bugs.result +++ b/mysql-test/r/events_bugs.result @@ -747,6 +747,15 @@ event_name originator ev1 4294967295 DROP EVENT ev1; SET GLOBAL server_id = @old_server_id; +CREATE DATABASE event_test12; +USE event_test12; +CREATE EVENT ev1 ON SCHEDULE EVERY 1 DAY DO SELECT 1; +CREATE DATABASE event_test1; +USE event_test1; +SHOW EVENTS; +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +DROP DATABASE event_test1; +DROP DATABASE event_test12; DROP DATABASE events_test; SET GLOBAL event_scheduler= 'ON'; SET @@global.concurrent_insert= @concurrent_insert; diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index 2716a06b22f..5454446984a 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -1737,6 +1737,15 @@ SELECT MIN(GET_LOCK('aaaaaaaaaaaaaaaaa',0) / '0b11111111111111111111111111111111 SELECT MIN(GET_LOCK('aaaaaaaaaaaaaaaaa',0) / '0b1111111111111111111111111111111111111111111111111111111111111111111111111' ^ (RAND())); SELECT RELEASE_LOCK('aaaaaaaaaaaaaaaaa'); # +# Bug #11766094 - 59132: MIN() AND MAX() REMOVE UNSIGNEDNESS +# +CREATE TABLE t1 (a BIGINT UNSIGNED); +INSERT INTO t1 VALUES (18446668621106209655); +SELECT MAX(LENGTH(a)), LENGTH(MAX(a)), MIN(a), MAX(a), CONCAT(MIN(a)), CONCAT(MAX(a)) FROM t1; +MAX(LENGTH(a)) LENGTH(MAX(a)) MIN(a) MAX(a) CONCAT(MIN(a)) CONCAT(MAX(a)) +20 20 18446668621106209655 18446668621106209655 18446668621106209655 18446668621106209655 +DROP TABLE t1; +# End of 5.1 tests # # Bug#52123 Assertion failed: aggregator == aggr->Aggrtype(), diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index 57ec0cc0aca..525ee0dc506 100644 --- a/mysql-test/r/func_math.result +++ b/mysql-test/r/func_math.result @@ -514,6 +514,13 @@ t1 CREATE TABLE `t1` ( `C` varchar(23) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; +# +# Bug#11764994 57900: CREATE TABLE .. SELECT ASSERTS SCALE >= 0 && PRECISION > 0 && SCALE <= PR +# +CREATE TABLE t1 SELECT CEIL(LINESTRINGFROMWKB(1) DIV NULL); +DROP TABLE t1; +CREATE TABLE t1 SELECT FLOOR(LINESTRINGFROMWKB(1) DIV NULL); +DROP TABLE t1; End of 5.1 tests # # Bug #8433: Overflow must be an error diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index 09b0af61ea5..43e37dab9d5 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -1347,6 +1347,36 @@ Warning 1292 Truncated incorrect time value: '' Warning 1292 Truncated incorrect time value: '' Warning 1292 Truncated incorrect time value: '' DROP TABLE t1; +# +# Bug#11766112 59151:UNINITIALIZED VALUES IN EXTRACT_DATE_TIME WITH STR_TO_DATE(SPACE(..) ... +# +SELECT STR_TO_DATE(SPACE(2),'1'); +STR_TO_DATE(SPACE(2),'1') +0000-00-00 +# +# Bug#11765216 58154: UNINITIALIZED VARIABLE FORMAT IN STR_TO_DATE FUNCTION +# +SET GLOBAL SQL_MODE=''; +DO STR_TO_DATE((''), FROM_DAYS(@@GLOBAL.SQL_MODE)); +SET GLOBAL SQL_MODE=DEFAULT; +# +# Bug#11766087 59125: VALGRIND UNINITIALISED VALUE WARNING IN ULL2DEC, LONGLONG2DECIMAL +# +SELECT FORMAT(YEAR(STR_TO_DATE('',GET_FORMAT(TIME,''))),1); +FORMAT(YEAR(STR_TO_DATE('',GET_FORMAT(TIME,''))),1) +NULL +# +# Bug#11766126 59166: ANOTHER DATETIME VALGRIND UNINITIALIZED WARNING +# +SELECT CAST((MONTH(FROM_UNIXTIME(@@GLOBAL.SQL_MODE))) AS BINARY(1025)); +CAST((MONTH(FROM_UNIXTIME(@@GLOBAL.SQL_MODE))) AS BINARY(1025)) +NULL +# +# Bug#11766124 59164: VALGRIND: UNINITIALIZED VALUE IN NUMBER_TO_DATETIME +# +SELECT ADDDATE(MONTH(FROM_UNIXTIME(NULL)),INTERVAL 1 HOUR); +ADDDATE(MONTH(FROM_UNIXTIME(NULL)),INTERVAL 1 HOUR) +NULL End of 5.1 tests # # Bug#57039: constant subtime expression returns incorrect result. diff --git a/mysql-test/r/innodb_mysql_lock.result b/mysql-test/r/innodb_mysql_lock.result index bf1c3a89f40..cd9487721b6 100644 --- a/mysql-test/r/innodb_mysql_lock.result +++ b/mysql-test/r/innodb_mysql_lock.result @@ -148,3 +148,25 @@ COMMIT; # Connection default DROP TABLE t1, t2; DROP VIEW v1; +# +# Bug#11815600 [ERROR] INNODB COULD NOT FIND INDEX PRIMARY +# KEY NO 0 FOR TABLE IN ERROR LOG +# +DROP TABLE IF EXISTS t1; +# Connection default +CREATE TABLE t1 (id INT PRIMARY KEY, value INT) ENGINE = InnoDB; +INSERT INTO t1 VALUES (1, 12345); +START TRANSACTION; +SELECT * FROM t1; +id value +1 12345 +# Connection con1 +SET lock_wait_timeout=1; +ALTER TABLE t1 ADD INDEX idx(value); +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +# Connection default +SELECT * FROM t1; +id value +1 12345 +COMMIT; +DROP TABLE t1; diff --git a/mysql-test/r/innodb_mysql_sync.result b/mysql-test/r/innodb_mysql_sync.result index 8e210a7e205..71f567a4ad2 100644 --- a/mysql-test/r/innodb_mysql_sync.result +++ b/mysql-test/r/innodb_mysql_sync.result @@ -94,74 +94,6 @@ SET DEBUG_SYNC= 'RESET'; # Bug#42230 during add index, cannot do queries on storage engines # that implement add_index # -DROP DATABASE IF EXISTS db1; -DROP TABLE IF EXISTS t1; -# Test 1: Secondary index, should not block reads (original test case). -# Connection default -CREATE DATABASE db1; -CREATE TABLE db1.t1(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, value INT) engine=innodb; -INSERT INTO db1.t1(value) VALUES (1), (2); -SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; -# Sending: -ALTER TABLE db1.t1 ADD INDEX(value); -# Connection con1 -SET DEBUG_SYNC= "now WAIT_FOR manage"; -USE db1; -SELECT * FROM t1; -id value -1 1 -2 2 -SET DEBUG_SYNC= "now SIGNAL query"; -# Connection default -# Reaping: ALTER TABLE db1.t1 ADD INDEX(value) -DROP DATABASE db1; -# Test 2: Primary index (implicit), should block reads. -CREATE TABLE t1(a INT NOT NULL, b INT NOT NULL) engine=innodb; -SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; -# Sending: -ALTER TABLE t1 ADD UNIQUE INDEX(a); -# Connection con1 -SET DEBUG_SYNC= "now WAIT_FOR manage"; -USE test; -# Sending: -SELECT * FROM t1; -# Connection con2 -# Waiting for SELECT to be blocked by the metadata lock on t1 -SET DEBUG_SYNC= "now SIGNAL query"; -# Connection default -# Reaping: ALTER TABLE t1 ADD UNIQUE INDEX(a) -# Connection con1 -# Reaping: SELECT * FROM t1 -a b -# Test 3: Primary index (explicit), should block reads. -# Connection default -ALTER TABLE t1 DROP INDEX a; -SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; -# Sending: -ALTER TABLE t1 ADD PRIMARY KEY (a); -# Connection con1 -SET DEBUG_SYNC= "now WAIT_FOR manage"; -# Sending: -SELECT * FROM t1; -# Connection con2 -# Waiting for SELECT to be blocked by the metadata lock on t1 -SET DEBUG_SYNC= "now SIGNAL query"; -# Connection default -# Reaping: ALTER TABLE t1 ADD PRIMARY KEY (a) -# Connection con1 -# Reaping: SELECT * FROM t1 -a b -# Test 4: Secondary unique index, should not block reads. -# Connection default -SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; -# Sending: -ALTER TABLE t1 ADD UNIQUE (b); -# Connection con1 -SET DEBUG_SYNC= "now WAIT_FOR manage"; -SELECT * FROM t1; -a b -SET DEBUG_SYNC= "now SIGNAL query"; -# Connection default -# Reaping: ALTER TABLE t1 ADD UNIQUE (b) -SET DEBUG_SYNC= "RESET"; -DROP TABLE t1; +# +# DISABLED due to Bug#11815600 +# diff --git a/mysql-test/r/lowercase_table2.result b/mysql-test/r/lowercase_table2.result index caee7a7662b..abd16641b56 100644 --- a/mysql-test/r/lowercase_table2.result +++ b/mysql-test/r/lowercase_table2.result @@ -175,6 +175,35 @@ TABLE_SCHEMA TABLE_NAME mysqltest_lc2 myUC use test; drop database mysqltest_LC2; +# +# Bug #11758687: 50924: object names not resolved correctly +# on lctn2 systems +# +CREATE DATABASE BUP_XPFM_COMPAT_DB2; +CREATE TABLE BUP_XPFM_COMPAT_DB2.TABLE2 (c13 INT) DEFAULT CHARSET latin1; +CREATE TABLE BUP_XPFM_COMPAT_DB2.table1 (c13 INT) DEFAULT CHARSET latin1; +CREATE TABLE bup_xpfm_compat_db2.table3 (c13 INT) DEFAULT CHARSET latin1; +CREATE TRIGGER BUP_XPFM_COMPAT_DB2.trigger1 AFTER INSERT +ON BUP_XPFM_COMPAT_DB2.table1 FOR EACH ROW +update BUP_XPFM_COMPAT_DB2.table1 set c13=12; +| +CREATE TRIGGER BUP_XPFM_COMPAT_DB2.TRIGGER2 AFTER INSERT +ON BUP_XPFM_COMPAT_DB2.TABLE2 FOR EACH ROW +update BUP_XPFM_COMPAT_DB2.table1 set c13=12; +| +CREATE TRIGGER BUP_XPFM_COMPAT_DB2.TrigGer3 AFTER INSERT +ON BUP_XPFM_COMPAT_DB2.TaBle3 FOR EACH ROW +update BUP_XPFM_COMPAT_DB2.table1 set c13=12; +| +SELECT trigger_schema, trigger_name, event_object_table FROM +INFORMATION_SCHEMA.TRIGGERS +WHERE trigger_schema COLLATE utf8_bin = 'BUP_XPFM_COMPAT_DB2' + ORDER BY trigger_schema, trigger_name; +trigger_schema trigger_name event_object_table +BUP_XPFM_COMPAT_DB2 trigger1 table1 +BUP_XPFM_COMPAT_DB2 TRIGGER2 TABLE2 +BUP_XPFM_COMPAT_DB2 TrigGer3 table3 +DROP DATABASE BUP_XPFM_COMPAT_DB2; # End of 5.1 tests # # Test for bug #44738 "fill_schema_table_from_frm() opens tables without diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result index 0b9f6db05b8..5a47b6700c0 100644 --- a/mysql-test/r/mysqlbinlog.result +++ b/mysql-test/r/mysqlbinlog.result @@ -903,3 +903,15 @@ master-bin.000002 # Query # # CREATE DATABASE test1 master-bin.000002 # Query # # use `test1`; CREATE TABLE t1(id int) master-bin.000002 # Query # # use `test1`; DROP TABLE `t1` /* generated by server */ master-bin.000002 # Query # # DROP DATABASE test1 +RESET MASTER; +USE test; +CREATE TABLE t1 (a INT); +SET GLOBAL SERVER_ID = 2; +DROP TABLE t1; +FLUSH LOGS; +SHOW TABLES IN test; +Tables_in_test +t1 +SHOW TABLES IN test; +Tables_in_test +SET GLOBAL SERVER_ID = 1; diff --git a/mysql-test/r/packet.result b/mysql-test/r/packet.result index ecbb47d4ee0..dcc2c608d0b 100644 --- a/mysql-test/r/packet.result +++ b/mysql-test/r/packet.result @@ -3,6 +3,7 @@ set @net_buffer_length=@@global.net_buffer_length; set global max_allowed_packet=100; Warnings: Warning 1292 Truncated incorrect max_allowed_packet value: '100' +Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' set global net_buffer_length=100; Warnings: Warning 1292 Truncated incorrect net_buffer_length value: '100' diff --git a/mysql-test/r/partition_error.result b/mysql-test/r/partition_error.result index 87eafb234a8..252a6b4386a 100644 --- a/mysql-test/r/partition_error.result +++ b/mysql-test/r/partition_error.result @@ -710,95 +710,8 @@ DROP TABLE t1; CREATE TABLE t1 (c TIMESTAMP) PARTITION BY HASH (c) PARTITIONS 4; ERROR HY000: Field 'c' is of a not allowed type for this type of partitioning +# Moved to partition_myisam, since it was MyISAM specific # Added test with existing TIMESTAMP partitioning (when it was allowed). -CREATE TABLE t1 (a TIMESTAMP) -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=MyISAM 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#49161: Out of memory; restart server and try again (needed 2 bytes) -# -CREATE TABLE t1 (a INT) PARTITION BY HASH (a); -FLUSH TABLES; -CHECK TABLE t1; -Table Op Msg_type Msg_text -test.t1 check Error Failed to read from the .par file -test.t1 check Error Incorrect information in file: './test/t1.frm' -test.t1 check error Corrupt -SELECT * FROM t1; -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' # # Bug#49477: Assertion `0' failed in ha_partition.cc:5530 # with temporary table and partitions @@ -831,10 +744,10 @@ Table Create Table t1 CREATE TABLE `t1` ( `id` int(11) DEFAULT NULL, `purchased` date DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=<curr_engine> DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(purchased)) SUBPARTITION BY HASH (TO_DAYS(purchased)) -(PARTITION p0 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ +(PARTITION p0 VALUES LESS THAN MAXVALUE ENGINE = <curr_engine>) */ DROP TABLE t1; CREATE TABLE t1 (id INT, purchased DATE) PARTITION BY RANGE(YEAR(purchased)) @@ -852,12 +765,12 @@ Table Create Table t1 CREATE TABLE `t1` ( `id` int(11) DEFAULT NULL, `purchased` date DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=<curr_engine> DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(purchased)) SUBPARTITION BY HASH (TO_DAYS(purchased)) (PARTITION p0 VALUES LESS THAN MAXVALUE - (SUBPARTITION sp0 ENGINE = MyISAM, - SUBPARTITION sp1 ENGINE = MyISAM)) */ + (SUBPARTITION sp0 ENGINE = <curr_engine>, + SUBPARTITION sp1 ENGINE = <curr_engine>)) */ DROP TABLE t1; CREATE TABLE t1 (id INT, purchased DATE) PARTITION BY RANGE(YEAR(purchased)) @@ -872,53 +785,11 @@ Table Create Table t1 CREATE TABLE `t1` ( `id` int(11) DEFAULT NULL, `purchased` date DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=<curr_engine> DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(purchased)) -(PARTITION p0 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ +(PARTITION p0 VALUES LESS THAN MAXVALUE ENGINE = <curr_engine>) */ DROP TABLE t1; SET @@sql_mode= @org_mode; -# -# Bug#50392: insert_id is not reset for partitioned tables -# auto_increment on duplicate entry -CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY); -SET INSERT_ID= 13; -INSERT INTO t1 VALUES (NULL); -SET INSERT_ID= 12; -INSERT INTO t1 VALUES (NULL), (NULL), (NULL); -ERROR 23000: Duplicate entry '13' for key 'PRIMARY' -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) NOT NULL AUTO_INCREMENT, - PRIMARY KEY (`a`) -) ENGINE=MyISAM AUTO_INCREMENT=14 DEFAULT CHARSET=latin1 -INSERT INTO t1 VALUES (NULL); -SELECT * FROM t1; -a -12 -13 -14 -DROP TABLE t1; -CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY) PARTITION BY KEY(a); -SET INSERT_ID= 13; -INSERT INTO t1 VALUES (NULL); -SET INSERT_ID= 12; -INSERT INTO t1 VALUES (NULL), (NULL), (NULL); -ERROR 23000: Duplicate entry '13' for key 'PRIMARY' -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) NOT NULL AUTO_INCREMENT, - PRIMARY KEY (`a`) -) ENGINE=MyISAM AUTO_INCREMENT=14 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) */ -INSERT INTO t1 VALUES (NULL); -SELECT * FROM t1; -a -12 -13 -14 -DROP TABLE t1; CREATE TABLE t1 (a INTEGER NOT NULL, PRIMARY KEY (a)); INSERT INTO t1 VALUES (1),(1); ERROR 23000: Duplicate entry '1' for key 'PRIMARY' @@ -928,19 +799,6 @@ PARTITION BY KEY (a) PARTITIONS 2; INSERT INTO t1 VALUES (1),(1); ERROR 23000: Duplicate entry '1' for key 'PRIMARY' DROP TABLE t1; -CREATE TABLE t1 (a INT) -PARTITION BY HASH (a) -( PARTITION p0 ENGINE=MyISAM, -PARTITION p1); -ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL -CREATE TABLE t1 (a INT) -PARTITION BY LIST (a) -SUBPARTITION BY HASH (a) -( PARTITION p0 VALUES IN (0) -( SUBPARTITION s0, SUBPARTITION s1 ENGINE=MyISAM, SUBPARTITION s2), -PARTITION p1 VALUES IN (1) -( SUBPARTITION s3 ENGINE=MyISAM, SUBPARTITION s4, SUBPARTITION s5 ENGINE=MyISAM)); -ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL CREATE TABLE t1 ( a int ) diff --git a/mysql-test/r/partition_myisam.result b/mysql-test/r/partition_myisam.result new file mode 100644 index 00000000000..57228c8d9a0 --- /dev/null +++ b/mysql-test/r/partition_myisam.result @@ -0,0 +1,241 @@ +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=<curr_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) +PARTITION BY HASH (a) +( PARTITION p0 ENGINE=MyISAM, +PARTITION p1); +ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL +CREATE TABLE t1 (a INT) +PARTITION BY LIST (a) +SUBPARTITION BY HASH (a) +( PARTITION p0 VALUES IN (0) +( SUBPARTITION s0, SUBPARTITION s1 ENGINE=MyISAM, SUBPARTITION s2), +PARTITION p1 VALUES IN (1) +( SUBPARTITION s3 ENGINE=MyISAM, SUBPARTITION s4, SUBPARTITION s5 ENGINE=MyISAM)); +ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL +# +# Bug#49161: Out of memory; restart server and try again (needed 2 bytes) +# +CREATE TABLE t1 (a INT) +ENGINE = MyISAM +PARTITION BY HASH (a); +FLUSH TABLES; +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check Error Failed to read from the .par file +test.t1 check Error Incorrect information in file: './test/t1.frm' +test.t1 check error Corrupt +SELECT * FROM t1; +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' +# +# Bug#50392: insert_id is not reset for partitioned tables +# auto_increment on duplicate entry +CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY) +ENGINE = MyISAM; +SET INSERT_ID= 13; +INSERT INTO t1 VALUES (NULL); +SET INSERT_ID= 12; +# For transactional engines, 12 will not be inserted, since the failing +# statement is rolled back. +INSERT INTO t1 VALUES (NULL), (NULL), (NULL); +ERROR 23000: Duplicate entry '13' for key 'PRIMARY' +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`a`) +) ENGINE=MyISAM AUTO_INCREMENT=14 DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (NULL); +# NOTE: 12 exists only in non transactional engines! +SELECT * FROM t1; +a +12 +13 +14 +DROP TABLE t1; +CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY) +ENGINE = MyISAM +PARTITION BY KEY(a); +SET INSERT_ID= 13; +INSERT INTO t1 VALUES (NULL); +SET INSERT_ID= 12; +INSERT INTO t1 VALUES (NULL), (NULL), (NULL); +ERROR 23000: Duplicate entry '13' for key 'PRIMARY' +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`a`) +) ENGINE=MyISAM AUTO_INCREMENT=14 DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY KEY (a) */ +INSERT INTO t1 VALUES (NULL); +SELECT * FROM t1; +a +12 +13 +14 +DROP TABLE t1; +# Bug#30102 test +CREATE TABLE t1 (a INT) +ENGINE = MyISAM +PARTITION BY RANGE (a) +(PARTITION p0 VALUES LESS THAN (6), +PARTITION `p1....................` VALUES LESS THAN (9), +PARTITION p2 VALUES LESS THAN MAXVALUE); +# List of files in database `test`, all original t1-files here +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYD +t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1.frm +t1.par +INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +# Renaming to a file name where the first partition is 250 chars +# and the second partition is 350 chars +RENAME TABLE t1 TO `t2_new..............................................end`; +Got one of the listed errors +# List of files in database `test`, should not be any t2-files here +# List of files in database `test`, should be all t1-files here +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYD +t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1.frm +t1.par +SELECT * FROM t1; +a +1 +10 +2 +3 +4 +5 +6 +7 +8 +9 +# List of files in database `test`, should be all t1-files here +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYD +t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1.frm +t1.par +# Renaming to a file name where the first partition is 156 chars +# and the second partition is 256 chars +RENAME TABLE t1 TO `t2_............................_end`; +Got one of the listed errors +# List of files in database `test`, should not be any t2-files here +# List of files in database `test`, should be all t1-files here +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYD +t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1.frm +t1.par +SELECT * FROM t1; +a +1 +10 +2 +3 +4 +5 +6 +7 +8 +9 +DROP TABLE t1; +# Should not be any files left here +# End of bug#30102 test. diff --git a/mysql-test/r/partition_not_embedded.result b/mysql-test/r/partition_not_embedded.result deleted file mode 100644 index c942189a956..00000000000 --- a/mysql-test/r/partition_not_embedded.result +++ /dev/null @@ -1,81 +0,0 @@ -DROP TABLE IF EXISTS t1, t2; -# Bug#30102 test -CREATE TABLE t1 (a INT) -PARTITION BY RANGE (a) -(PARTITION p0 VALUES LESS THAN (6), -PARTITION `p1....................` VALUES LESS THAN (9), -PARTITION p2 VALUES LESS THAN MAXVALUE); -# List of files in database `test`, all original t1-files here -t1#P#p0.MYD -t1#P#p0.MYI -t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYD -t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYI -t1#P#p2.MYD -t1#P#p2.MYI -t1.frm -t1.par -INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); -# Renaming to a file name where the first partition is 250 chars -# and the second partition is 350 chars -RENAME TABLE t1 TO `t2_new..............................................end`; -Got one of the listed errors -# List of files in database `test`, should not be any t2-files here -# List of files in database `test`, should be all t1-files here -t1#P#p0.MYD -t1#P#p0.MYI -t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYD -t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYI -t1#P#p2.MYD -t1#P#p2.MYI -t1.frm -t1.par -SELECT * FROM t1; -a -1 -10 -2 -3 -4 -5 -6 -7 -8 -9 -# List of files in database `test`, should be all t1-files here -t1#P#p0.MYD -t1#P#p0.MYI -t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYD -t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYI -t1#P#p2.MYD -t1#P#p2.MYI -t1.frm -t1.par -# Renaming to a file name where the first partition is 156 chars -# and the second partition is 256 chars -RENAME TABLE t1 TO `t2_............................_end`; -Got one of the listed errors -# List of files in database `test`, should not be any t2-files here -# List of files in database `test`, should be all t1-files here -t1#P#p0.MYD -t1#P#p0.MYI -t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYD -t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYI -t1#P#p2.MYD -t1#P#p2.MYI -t1.frm -t1.par -SELECT * FROM t1; -a -1 -10 -2 -3 -4 -5 -6 -7 -8 -9 -DROP TABLE t1; -# Should not be any files left here -# End of bug#30102 test. diff --git a/mysql-test/r/partition_symlink.result b/mysql-test/r/partition_symlink.result index 60184d11d9c..f26a1642a52 100644 --- a/mysql-test/r/partition_symlink.result +++ b/mysql-test/r/partition_symlink.result @@ -6,11 +6,12 @@ DROP DATABASE IF EXISTS mysqltest2; CREATE USER mysqltest_1@localhost; CREATE DATABASE mysqltest2; USE mysqltest2; -CREATE TABLE t1 (a INT); +CREATE TABLE t1 (a INT) ENGINE = MyISAM; INSERT INTO t1 VALUES (0); # user mysqltest_1: USE test; CREATE TABLE t1 (a INT) +ENGINE = MyISAM PARTITION BY LIST (a) ( PARTITION p0 VALUES IN (0) DATA DIRECTORY 'MYSQLTEST_VARDIR/tmp' @@ -47,6 +48,7 @@ DROP DATABASE mysqltest2; CREATE DATABASE mysqltest2; USE mysqltest2; CREATE TABLE t1 (a INT) +ENGINE = MyISAM PARTITION BY LIST (a) ( PARTITION p0 VALUES IN (0) DATA DIRECTORY 'MYSQLTEST_VARDIR/tmp' @@ -58,6 +60,7 @@ DATA DIRECTORY 'MYSQLTEST_VARDIR/tmp' # user mysqltest_1: USE test; CREATE TABLE t1 (a INT) +ENGINE = MyISAM PARTITION BY LIST (a) ( PARTITION p0 VALUES IN (0) DATA DIRECTORY 'MYSQLTEST_VARDIR/tmp' @@ -68,6 +71,7 @@ DATA DIRECTORY 'MYSQLTEST_VARDIR/tmp' ); Got one of the listed errors CREATE TABLE t1 (a INT) +ENGINE = MyISAM PARTITION BY LIST (a) ( PARTITION p0 VALUES IN (0) DATA DIRECTORY 'MYSQLTEST_VARDIR/tmp' @@ -82,6 +86,7 @@ DROP DATABASE mysqltest2; USE test; DROP USER mysqltest_1@localhost; create table t2 (i int ) +ENGINE = MyISAM partition by range (i) ( partition p01 values less than (1000) @@ -94,6 +99,7 @@ select @@sql_mode; @@sql_mode NO_DIR_IN_CREATE create table t1 (i int ) +ENGINE = MyISAM partition by range (i) ( partition p01 values less than (1000) @@ -113,10 +119,12 @@ t2 CREATE TABLE `t2` ( DROP TABLE t1, t2; set @@sql_mode=@org_mode; create table t1 (a int) +ENGINE = MyISAM partition by key (a) (partition p0 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data'); Got one of the listed errors create table t1 (a int) +ENGINE = MyISAM partition by key (a) (partition p0, partition p1 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data'); diff --git a/mysql-test/r/plugin_auth.result b/mysql-test/r/plugin_auth.result index 591a403a0c5..91a5d2d8478 100644 --- a/mysql-test/r/plugin_auth.result +++ b/mysql-test/r/plugin_auth.result @@ -400,4 +400,51 @@ ORDER BY COLUMN_NAME; IS_NULLABLE COLUMN_NAME YES authentication_string YES plugin +# +# Bug #11936829: diff. between mysql.user (authentication_string) +# in fresh and upgraded 5.5.11 +# +SELECT IS_NULLABLE, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS +WHERE TABLE_SCHEMA= 'mysql' AND TABLE_NAME= 'user' AND +COLUMN_NAME IN ('plugin', 'authentication_string') +ORDER BY COLUMN_NAME; +IS_NULLABLE COLUMN_NAME +YES authentication_string +YES plugin +ALTER TABLE mysql.user MODIFY plugin char(64) DEFAULT '' NOT NULL; +ALTER TABLE mysql.user MODIFY authentication_string TEXT NOT NULL; +Run mysql_upgrade on a 5.5.10 external authentication column layout +mtr.global_suppressions OK +mtr.test_suppressions OK +mysql.columns_priv OK +mysql.db OK +mysql.event OK +mysql.func OK +mysql.general_log OK +mysql.help_category OK +mysql.help_keyword OK +mysql.help_relation OK +mysql.help_topic OK +mysql.host OK +mysql.ndb_binlog_index OK +mysql.plugin OK +mysql.proc OK +mysql.procs_priv OK +mysql.proxies_priv OK +mysql.servers OK +mysql.slow_log OK +mysql.tables_priv OK +mysql.time_zone OK +mysql.time_zone_leap_second OK +mysql.time_zone_name OK +mysql.time_zone_transition OK +mysql.time_zone_transition_type OK +mysql.user OK +SELECT IS_NULLABLE, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS +WHERE TABLE_SCHEMA= 'mysql' AND TABLE_NAME= 'user' AND +COLUMN_NAME IN ('plugin', 'authentication_string') +ORDER BY COLUMN_NAME; +IS_NULLABLE COLUMN_NAME +YES authentication_string +YES plugin End of 5.5 tests diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 17f639cdca3..afa105a39b8 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -3731,5 +3731,19 @@ CREATE TABLE t1 (a INT); BEGIN; PREPARE stmt1 FROM "SELECT * FROM t1"; DROP TABLE t1; + +# +# Bug#56115: invalid memory reads when PS selecting from +# information_schema tables +# Bug#58701: crash in Field::make_field, cursor-protocol +# +# NOTE: MTR should be run both with --ps-protocol and --cursor-protocol. +# + +SELECT * +FROM (SELECT 1 UNION SELECT 2) t; +1 +1 +2 # -# End of 6.0 tests. +# End of 5.5 tests. diff --git a/mysql-test/r/shm.result b/mysql-test/r/shm.result index 4f57049406d..53b2483d97e 100644 --- a/mysql-test/r/shm.result +++ b/mysql-test/r/shm.result @@ -2155,6 +2155,8 @@ mysqld is alive SET @max_allowed_packet= @@global.max_allowed_packet; SET @net_buffer_length= @@global.net_buffer_length; SET GLOBAL max_allowed_packet= 1024; +Warnings: +Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' SET GLOBAL net_buffer_length= 1024; ERROR 1153 (08S01) at line 1: Got a packet bigger than 'max_allowed_packet' bytes SET GLOBAL max_allowed_packet= @max_allowed_packet; diff --git a/mysql-test/r/tablespace.result b/mysql-test/r/tablespace.result new file mode 100644 index 00000000000..38d450ae430 --- /dev/null +++ b/mysql-test/r/tablespace.result @@ -0,0 +1,112 @@ +CREATE TABLE t1(a int) TABLESPACE ts ENGINE=MyISAM; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 TABLESPACE ts */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(a int) TABLESPACE ts STORAGE DISK ENGINE=MyISAM; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(a int) TABLESPACE ts STORAGE MEMORY ENGINE=MyISAM; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 TABLESPACE ts STORAGE MEMORY */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(a int) STORAGE MEMORY ENGINE=MyISAM; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 STORAGE MEMORY */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(a int) STORAGE DISK ENGINE=MyISAM; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 STORAGE DISK */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(a int) TABLESPACE ts ENGINE=MyISAM; +ALTER TABLE t1 ADD COLUMN b int; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) /*!50100 TABLESPACE ts */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(a int) TABLESPACE ts STORAGE DISK ENGINE=MyISAM; +ALTER TABLE t1 ADD COLUMN b int; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(a int) ENGINE=MyISAM; +ALTER TABLE t1 TABLESPACE ts; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 TABLESPACE ts */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +ALTER TABLE t1 TABLESPACE ts2; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 TABLESPACE ts2 */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(a int) ENGINE=MyISAM; +ALTER TABLE t1 STORAGE MEMORY; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 STORAGE MEMORY */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +ALTER TABLE t1 STORAGE DISK; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 STORAGE DISK */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(a int) ENGINE=MyISAM; +ALTER TABLE t1 STORAGE MEMORY TABLESPACE ts; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 TABLESPACE ts STORAGE MEMORY */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +ALTER TABLE t1 STORAGE DISK TABLESPACE ts2; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 TABLESPACE ts2 STORAGE DISK */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + `d` int(11) NOT NULL, + `e` int(11) DEFAULT NULL, + `f` int(11) DEFAULT NULL, + `g` int(11) DEFAULT NULL, + `h` int(11) NOT NULL, + `i` int(11) DEFAULT NULL, + `j` int(11) DEFAULT NULL, + `k` int(11) DEFAULT NULL, + PRIMARY KEY (`a`) +) /*!50100 TABLESPACE the_tablespacename STORAGE DISK */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; diff --git a/mysql-test/r/variables-notembedded.result b/mysql-test/r/variables-notembedded.result index 8c6d54757ed..ceac676589f 100644 --- a/mysql-test/r/variables-notembedded.result +++ b/mysql-test/r/variables-notembedded.result @@ -108,3 +108,27 @@ SET @@session.slave_skip_errors= 7; ERROR HY000: Variable 'slave_skip_errors' is a read only variable SET @@global.slave_skip_errors= 7; ERROR HY000: Variable 'slave_skip_errors' is a read only variable +# +# Bug #11766769 : 59959: SMALL VALUES OF --MAX-ALLOWED-PACKET +# ARE NOT BEING HONORED +# +CREATE TABLE t1 (a MEDIUMTEXT); +SET GLOBAL max_allowed_packet=2048; +Warnings: +Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' +SET GLOBAL net_buffer_length=4096; +Warnings: +Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' +SHOW SESSION VARIABLES LIKE 'max_allowed_packet'; +Variable_name Value +max_allowed_packet 2048 +SHOW SESSION VARIABLES LIKE 'net_buffer_length'; +Variable_name Value +net_buffer_length 4096 +ERROR 08S01: Got a packet bigger than 'max_allowed_packet' bytes +SELECT LENGTH(a) FROM t1; +LENGTH(a) +SET GLOBAL max_allowed_packet=default; +SET GLOBAL net_buffer_length=default; +DROP TABLE t1; +End of 5.1 tests diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 96db86262c2..2b71117f789 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -505,6 +505,7 @@ set low_priority_updates=1; set global max_allowed_packet=100; Warnings: Warning 1292 Truncated incorrect max_allowed_packet value: '100' +Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' set global max_binlog_cache_size=100; Warnings: Warning 1292 Truncated incorrect max_binlog_cache_size value: '100' @@ -1059,6 +1060,8 @@ set global max_write_lock_count =default; set global myisam_data_pointer_size =@my_myisam_data_pointer_size; set global myisam_max_sort_file_size =@my_myisam_max_sort_file_size; set global net_buffer_length =@my_net_buffer_length; +Warnings: +Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' set global net_write_timeout =@my_net_write_timeout; set global net_read_timeout =@my_net_read_timeout; set global query_cache_limit =@my_query_cache_limit; @@ -1543,6 +1546,22 @@ Warning 1292 Truncated incorrect key_cache_block_size value: '0' select @@max_long_data_size; @@max_long_data_size 1048576 +# +# Bug#11766424 59527: DECIMAL_BIN_SIZE: ASSERTION `SCALE >= 0 && PRECISION > 0 && SCALE <= PRE +# +CREATE TABLE t1(f1 DECIMAL(1,1) UNSIGNED); +INSERT INTO t1 VALUES (0.2),(0.1); +SELECT 1 FROM t1 GROUP BY @a:= (SELECT ROUND(f1) FROM t1 WHERE @a=f1); +1 +1 +DROP TABLE t1; +CREATE TABLE t1 AS SELECT @a:= CAST(1 AS UNSIGNED) AS a; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(1) unsigned NOT NULL DEFAULT '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; SET @@global.max_binlog_cache_size=DEFAULT; SET @@global.max_join_size=DEFAULT; SET @@global.key_buffer_size=@kbs; diff --git a/mysql-test/std_data/cluster_7022_table.MYD b/mysql-test/std_data/cluster_7022_table.MYD new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/mysql-test/std_data/cluster_7022_table.MYD diff --git a/mysql-test/std_data/cluster_7022_table.MYI b/mysql-test/std_data/cluster_7022_table.MYI Binary files differnew file mode 100644 index 00000000000..332b0e64797 --- /dev/null +++ b/mysql-test/std_data/cluster_7022_table.MYI diff --git a/mysql-test/std_data/cluster_7022_table.frm b/mysql-test/std_data/cluster_7022_table.frm Binary files differnew file mode 100644 index 00000000000..84714a1721a --- /dev/null +++ b/mysql-test/std_data/cluster_7022_table.frm diff --git a/mysql-test/suite/binlog/t/binlog_index.test b/mysql-test/suite/binlog/t/binlog_index.test index b735574fdb9..086c0842b20 100644 --- a/mysql-test/suite/binlog/t/binlog_index.test +++ b/mysql-test/suite/binlog/t/binlog_index.test @@ -6,6 +6,8 @@ source include/not_embedded.inc; # Don't test this under valgrind, memory leaks will occur --source include/not_valgrind.inc source include/have_debug.inc; +# Avoid CrashReporter popup on Mac +--source include/not_crashrep.inc call mtr.add_suppression('Attempting backtrace'); call mtr.add_suppression('MSYQL_BIN_LOG::purge_logs failed to process registered files that would be purged.'); call mtr.add_suppression('MSYQL_BIN_LOG::open failed to sync the index file'); diff --git a/mysql-test/suite/binlog/t/disabled.def b/mysql-test/suite/binlog/t/disabled.def index a8485f185bc..d80a42c6e27 100644 --- a/mysql-test/suite/binlog/t/disabled.def +++ b/mysql-test/suite/binlog/t/disabled.def @@ -11,4 +11,3 @@ ############################################################################## binlog_truncate_innodb : BUG#57291 2010-10-20 anitha Originally disabled due to BUG#42643. Product bug fixed, but test changes needed binlog_spurious_ddl_errors : BUG#54195 2010-06-03 alik binlog_spurious_ddl_errors.test fails, thus disabled -binlog_row_failure_mixing_engines : BUG#58416 2010-11-23 ramil Fails on win x86 debug_max diff --git a/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result index 84edc693a4a..95b160ce745 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result @@ -185,7 +185,7 @@ def mysql time_zone_transition_type Time_zone_id 1 NULL NO int NULL NULL 10 0 NU def mysql time_zone_transition_type Transition_type_id 2 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI def mysql user Alter_priv 17 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') def mysql user Alter_routine_priv 28 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') -def mysql user authentication_string 42 NULL NO text 65535 65535 NULL NULL utf8 utf8_bin text +def mysql user authentication_string 42 NULL YES text 65535 65535 NULL NULL utf8 utf8_bin text def mysql user Create_priv 8 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') def mysql user Create_routine_priv 27 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') def mysql user Create_tablespace_priv 32 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') @@ -207,7 +207,7 @@ def mysql user max_questions 37 0 NO int NULL NULL 10 0 NULL NULL int(11) unsign def mysql user max_updates 38 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned def mysql user max_user_connections 40 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned def mysql user Password 3 NO char 41 41 NULL NULL latin1 latin1_bin char(41) -def mysql user plugin 41 NO char 64 192 NULL NULL utf8 utf8_bin char(64) +def mysql user plugin 41 YES char 64 192 NULL NULL utf8 utf8_bin char(64) def mysql user Process_priv 12 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') def mysql user References_priv 15 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') def mysql user Reload_priv 10 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') diff --git a/mysql-test/suite/innodb/r/innodb_bug60196.result b/mysql-test/suite/innodb/r/innodb_bug60196.result new file mode 100755 index 00000000000..85707f81a28 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug60196.result @@ -0,0 +1,73 @@ +CREATE TABLE Bug_60196_FK1 (Primary_Key INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE Bug_60196_FK2 (Primary_Key INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE Bug_60196 ( +FK1_Key INT NOT NULL, +FK2_Key INT NOT NULL, +PRIMARY KEY (FK2_Key, FK1_Key), +KEY FK1_Key (FK1_Key), +KEY FK2_Key (FK2_Key), +CONSTRAINT FK_FK1 FOREIGN KEY (FK1_Key) +REFERENCES Bug_60196_FK1 (Primary_Key) +ON DELETE CASCADE +ON UPDATE CASCADE, +CONSTRAINT FK_FK2 FOREIGN KEY (FK2_Key) +REFERENCES Bug_60196_FK2 (Primary_Key) +ON DELETE CASCADE +ON UPDATE CASCADE +) ENGINE=InnoDB; +INSERT INTO Bug_60196_FK1 VALUES (1), (2), (3), (4), (5); +INSERT INTO Bug_60196_FK2 VALUES (1), (2), (3), (4), (5); +INSERT INTO Bug_60196 VALUES (1, 1); +INSERT INTO Bug_60196 VALUES (1, 2); +INSERT INTO Bug_60196 VALUES (1, 3); +INSERT INTO Bug_60196 VALUES (1, 99); +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`bug_60196`, CONSTRAINT `FK_FK2` FOREIGN KEY (`FK2_Key`) REFERENCES `Bug_60196_FK2` (`Primary_Key`) ON DELETE CASCADE ON UPDATE CASCADE) +INSERT INTO Bug_60196 VALUES (99, 1); +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`bug_60196`, CONSTRAINT `FK_FK1` FOREIGN KEY (`FK1_Key`) REFERENCES `Bug_60196_FK1` (`Primary_Key`) ON DELETE CASCADE ON UPDATE CASCADE) +SELECT * FROM bug_60196_FK1; +Primary_Key +1 +2 +3 +4 +5 +SELECT * FROM bug_60196_FK2; +Primary_Key +1 +2 +3 +4 +5 +SELECT * FROM bug_60196; +FK1_Key FK2_Key +1 1 +1 2 +1 3 +# Stop server +# Restart server. +# +# Try to insert more to the example table with foreign keys. +# Bug60196 causes the foreign key file not to be found after +# the resstart above. +# +SELECT * FROM Bug_60196; +FK1_Key FK2_Key +1 1 +1 2 +1 3 +INSERT INTO Bug_60196 VALUES (2, 1); +INSERT INTO Bug_60196 VALUES (2, 2); +INSERT INTO Bug_60196 VALUES (2, 3); +SELECT * FROM Bug_60196; +FK1_Key FK2_Key +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 + +# Clean up. +DROP TABLE Bug_60196; +DROP TABLE Bug_60196_FK1; +DROP TABLE Bug_60196_FK2; diff --git a/mysql-test/suite/innodb/t/innodb_bug53756.test b/mysql-test/suite/innodb/t/innodb_bug53756.test index 67a95371821..ae23e9d41a3 100644 --- a/mysql-test/suite/innodb/t/innodb_bug53756.test +++ b/mysql-test/suite/innodb/t/innodb_bug53756.test @@ -17,6 +17,9 @@ # This test case needs InnoDB. -- source include/have_innodb.inc +# Avoid CrashReporter popup on Mac +--source include/not_crashrep.inc + # # Precautionary clean up. # diff --git a/mysql-test/suite/innodb/t/innodb_bug60196-master.opt b/mysql-test/suite/innodb/t/innodb_bug60196-master.opt new file mode 100755 index 00000000000..c0a1981fa7c --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug60196-master.opt @@ -0,0 +1 @@ +--lower-case-table-names=2
diff --git a/mysql-test/suite/innodb/t/innodb_bug60196.test b/mysql-test/suite/innodb/t/innodb_bug60196.test new file mode 100755 index 00000000000..47c646a5a75 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug60196.test @@ -0,0 +1,87 @@ +# Bug#60196 - Setting lowercase_table_names to 2 on Windows causing +# Foreign Key problems after an engine is restarted. + +# This test case needs InnoDB, a lowercase file system, +# lower-case-table-names=2, and cannot use the embedded server +# because it restarts the server. +--source include/not_embedded.inc +--source include/have_lowercase2.inc +--source include/have_case_insensitive_file_system.inc +--source include/have_innodb.inc + +# +# Create test data. +# +CREATE TABLE Bug_60196_FK1 (Primary_Key INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE Bug_60196_FK2 (Primary_Key INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE Bug_60196 ( + FK1_Key INT NOT NULL, + FK2_Key INT NOT NULL, + PRIMARY KEY (FK2_Key, FK1_Key), + KEY FK1_Key (FK1_Key), + KEY FK2_Key (FK2_Key), + CONSTRAINT FK_FK1 FOREIGN KEY (FK1_Key) + REFERENCES Bug_60196_FK1 (Primary_Key) + ON DELETE CASCADE + ON UPDATE CASCADE, + CONSTRAINT FK_FK2 FOREIGN KEY (FK2_Key) + REFERENCES Bug_60196_FK2 (Primary_Key) + ON DELETE CASCADE + ON UPDATE CASCADE +) ENGINE=InnoDB; +INSERT INTO Bug_60196_FK1 VALUES (1), (2), (3), (4), (5); +INSERT INTO Bug_60196_FK2 VALUES (1), (2), (3), (4), (5); +INSERT INTO Bug_60196 VALUES (1, 1); +INSERT INTO Bug_60196 VALUES (1, 2); +INSERT INTO Bug_60196 VALUES (1, 3); +--error ER_NO_REFERENCED_ROW_2 +INSERT INTO Bug_60196 VALUES (1, 99); +--error ER_NO_REFERENCED_ROW_2 +INSERT INTO Bug_60196 VALUES (99, 1); + +SELECT * FROM bug_60196_FK1; +SELECT * FROM bug_60196_FK2; +SELECT * FROM bug_60196; + +--echo # Stop server + +# Write file to make mysql-test-run.pl wait for the server to stop +-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +# Send a shutdown request to the server +-- shutdown_server 10 + +# Call script that will poll the server waiting for it to disapear +-- source include/wait_until_disconnected.inc + +--echo # Restart server. + +# Write file to make mysql-test-run.pl start up the server again +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +# Turn on reconnect +--enable_reconnect + +# Call script that will poll the server waiting for it to be back online again +--source include/wait_until_connected_again.inc + +# Turn off reconnect again +--disable_reconnect + +--echo # +--echo # Try to insert more to the example table with foreign keys. +--echo # Bug60196 causes the foreign key file not to be found after +--echo # the resstart above. +--echo # +SELECT * FROM Bug_60196; +INSERT INTO Bug_60196 VALUES (2, 1); +INSERT INTO Bug_60196 VALUES (2, 2); +INSERT INTO Bug_60196 VALUES (2, 3); +SELECT * FROM Bug_60196; + +--echo +--echo # Clean up. +DROP TABLE Bug_60196; +DROP TABLE Bug_60196_FK1; +DROP TABLE Bug_60196_FK2; + diff --git a/mysql-test/suite/rpl/r/rpl_packet.result b/mysql-test/suite/rpl/r/rpl_packet.result index 9239a718504..6190f458367 100644 --- a/mysql-test/suite/rpl/r/rpl_packet.result +++ b/mysql-test/suite/rpl/r/rpl_packet.result @@ -49,6 +49,8 @@ SET @max_allowed_packet_2= @@session.max_allowed_packet; ==== clean up ==== DROP TABLE t1; SET @@global.max_allowed_packet= 1024; +Warnings: +Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' SET @@global.net_buffer_length= 1024; DROP TABLE t1; RESET SLAVE; diff --git a/mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result b/mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result index d9ebb52493b..523564a222e 100644 --- a/mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result @@ -25,4 +25,10 @@ INSERT INTO t1(c1) VALUES (NULL); UPDATE t1 SET c1= 0; include/diff_tables.inc [master:t1, slave:t1] DROP TABLE t1; +include/rpl_reset.inc +CREATE TABLE t1 (c1 int(11) NOT NULL, c2 int(11) NOT NULL, c3 int(11) DEFAULT '-1') ENGINE=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES (1,2,NULL); +UPDATE t1 SET c1=1, c2=2, c3=-1 WHERE c1=1 AND c2=2 AND ISNULL(c3); +include/diff_tables.inc [master:test.t1, slave:test.t1] +DROP TABLE t1; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result b/mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result index e9ffcc927be..4dc7c0bc7a3 100644 --- a/mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result +++ b/mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result @@ -1,5 +1,14 @@ include/master-slave.inc [connection master] +## coverage purposes - Field_bits +## 1 X bit + 2 Null bits + 5 bits => last_null_bit_pos==0 +include/rpl_reset.inc +CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bit(5)) ENGINE=MyISAM DEFAULT CHARSET=latin1; +INSERT INTO t1(c1,c2) VALUES (10, b'1'); +INSERT INTO t1(c1,c2) VALUES (NULL, b'1'); +UPDATE t1 SET c1= 0; +include/diff_tables.inc [master:t1, slave:t1] +DROP TABLE t1; ## case #1 - last_null_bit_pos==0 in record_compare without X bit include/rpl_reset.inc CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 varchar(1) DEFAULT '', c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0, c8 bigint(20) DEFAULT 0) ENGINE=MyISAM DEFAULT CHARSET=latin1; @@ -25,13 +34,10 @@ INSERT INTO t1(c1) VALUES (NULL); UPDATE t1 SET c1= 0; include/diff_tables.inc [master:t1, slave:t1] DROP TABLE t1; -## coverage purposes - Field_bits -## 1 X bit + 2 Null bits + 5 bits => last_null_bit_pos==0 include/rpl_reset.inc -CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bit(5)) ENGINE=MyISAM DEFAULT CHARSET=latin1; -INSERT INTO t1(c1,c2) VALUES (10, b'1'); -INSERT INTO t1(c1,c2) VALUES (NULL, b'1'); -UPDATE t1 SET c1= 0; -include/diff_tables.inc [master:t1, slave:t1] +CREATE TABLE t1 (c1 int(11) NOT NULL, c2 int(11) NOT NULL, c3 int(11) DEFAULT '-1') ENGINE=MyISAM DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES (1,2,NULL); +UPDATE t1 SET c1=1, c2=2, c3=-1 WHERE c1=1 AND c2=2 AND ISNULL(c3); +include/diff_tables.inc [master:test.t1, slave:test.t1] DROP TABLE t1; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_map-master.opt b/mysql-test/suite/rpl/t/rpl_loaddata_map-master.opt index 831680eb5ef..5fdeb855110 100644 --- a/mysql-test/suite/rpl/t/rpl_loaddata_map-master.opt +++ b/mysql-test/suite/rpl/t/rpl_loaddata_map-master.opt @@ -1 +1 @@ ---read_buffer_size=12K --max_allowed_packet=8K +--read_buffer_size=12K --max_allowed_packet=8K --net-buffer-length=8K diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_map-slave.opt b/mysql-test/suite/rpl/t/rpl_loaddata_map-slave.opt index 95f55bcf7d8..7d404fae240 100644 --- a/mysql-test/suite/rpl/t/rpl_loaddata_map-slave.opt +++ b/mysql-test/suite/rpl/t/rpl_loaddata_map-slave.opt @@ -1 +1 @@ ---max_allowed_packet=8K +--max_allowed_packet=8K --net-buffer-length=8K diff --git a/mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test b/mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test index e40cd615ca6..f96603f69ed 100644 --- a/mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test +++ b/mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test @@ -1,12 +1,11 @@ -- source include/have_binlog_format_row.inc -- source include/master-slave.inc +-- let $engine= MyISAM # # BUG#52868 Wrong handling of NULL value during update, replication out of sync # --- let $engine= MyISAM --- source extra/rpl_tests/rpl_record_compare.test -- echo ## coverage purposes - Field_bits -- echo ## 1 X bit + 2 Null bits + 5 bits => last_null_bit_pos==0 @@ -28,4 +27,7 @@ UPDATE t1 SET c1= 0; -- connection master DROP TABLE t1; -- sync_slave_with_master + +-- source extra/rpl_tests/rpl_record_compare.test + --source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_event.test b/mysql-test/suite/rpl/t/rpl_semi_sync_event.test index 68e52c4a028..cd73a84d569 100644 --- a/mysql-test/suite/rpl/t/rpl_semi_sync_event.test +++ b/mysql-test/suite/rpl/t/rpl_semi_sync_event.test @@ -15,6 +15,7 @@ call mtr.add_suppression("Unsafe statement written to the binary log using state connection slave; call mtr.add_suppression("Master server does not support semi-sync"); call mtr.add_suppression("Semi-sync slave .* reply"); +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); enable_query_log; connection master; diff --git a/mysql-test/suite/rpl/t/rpl_sync.test b/mysql-test/suite/rpl/t/rpl_sync.test index 639214f9d93..e1750be0ff6 100644 --- a/mysql-test/suite/rpl/t/rpl_sync.test +++ b/mysql-test/suite/rpl/t/rpl_sync.test @@ -31,6 +31,7 @@ --source include/not_valgrind.inc --source include/have_debug.inc --source include/have_innodb.inc +--source include/not_crashrep.inc call mtr.add_suppression('Attempting backtrace'); call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001"); diff --git a/mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result b/mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result index 32048a7cfb0..ffa43415bd3 100644 --- a/mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result +++ b/mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result @@ -7,6 +7,7 @@ SET @@global.max_allowed_packet = DEFAULT; SET @@global.max_allowed_packet = 1000; Warnings: Warning 1292 Truncated incorrect max_allowed_packet value: '1000' +Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' SET @@global.max_allowed_packet = DEFAULT; SELECT @@global.max_allowed_packet; @@global.max_allowed_packet @@ -25,12 +26,15 @@ SELECT @@global.max_allowed_packet = 1048576; 1 '#--------------------FN_DYNVARS_070_03-------------------------#' SET @@global.max_allowed_packet = 1024; +Warnings: +Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' SELECT @@global.max_allowed_packet; @@global.max_allowed_packet 1024 SET @@global.max_allowed_packet = 1025; Warnings: Warning 1292 Truncated incorrect max_allowed_packet value: '1025' +Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' SELECT @@global.max_allowed_packet; @@global.max_allowed_packet 1024 @@ -74,18 +78,21 @@ SELECT @@session.max_allowed_packet; SET @@global.max_allowed_packet = 0; Warnings: Warning 1292 Truncated incorrect max_allowed_packet value: '0' +Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' SELECT @@global.max_allowed_packet; @@global.max_allowed_packet 1024 SET @@global.max_allowed_packet = -1024; Warnings: Warning 1292 Truncated incorrect max_allowed_packet value: '-1024' +Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' SELECT @@global.max_allowed_packet; @@global.max_allowed_packet 1024 SET @@global.max_allowed_packet = 1023; Warnings: Warning 1292 Truncated incorrect max_allowed_packet value: '1023' +Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' SELECT @@global.max_allowed_packet; @@global.max_allowed_packet 1024 @@ -148,17 +155,21 @@ WHERE VARIABLE_NAME='max_allowed_packet'; SET @@global.max_allowed_packet = TRUE; Warnings: Warning 1292 Truncated incorrect max_allowed_packet value: '1' +Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' SELECT @@global.max_allowed_packet; @@global.max_allowed_packet 1024 SET @@global.max_allowed_packet = FALSE; Warnings: Warning 1292 Truncated incorrect max_allowed_packet value: '0' +Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' SELECT @@global.max_allowed_packet; @@global.max_allowed_packet 1024 '#---------------------FN_DYNVARS_070_09----------------------#' SET @@global.max_allowed_packet = 2048; +Warnings: +Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' SELECT @@max_allowed_packet = @@global.max_allowed_packet; @@max_allowed_packet = @@global.max_allowed_packet 0 diff --git a/mysql-test/suite/sys_vars/r/max_allowed_packet_func.result b/mysql-test/suite/sys_vars/r/max_allowed_packet_func.result index 0d682b65aea..1e20776973c 100644 --- a/mysql-test/suite/sys_vars/r/max_allowed_packet_func.result +++ b/mysql-test/suite/sys_vars/r/max_allowed_packet_func.result @@ -23,6 +23,8 @@ SELECT @@session.net_buffer_length; '#--------------------FN_DYNVARS_070_02-------------------------#' ## Setting value of max_allowed packet and net_buffer_length to 1024 ## SET @@global.max_allowed_packet = 1024; +Warnings: +Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' SET @@global.net_buffer_length = 1024; SELECT @@global.max_allowed_packet; @@global.max_allowed_packet diff --git a/mysql-test/t/bootstrap.test b/mysql-test/t/bootstrap.test index e98afb81ff1..5b432653e45 100644 --- a/mysql-test/t/bootstrap.test +++ b/mysql-test/t/bootstrap.test @@ -49,3 +49,15 @@ remove_file $MYSQLTEST_VARDIR/tmp/long_query.sql; set global max_allowed_packet=@my_max_allowed_packet; drop table t1; +--echo End of 5.1 tests + +--echo # +--echo # Bug #11766306: 59393: HAVE_INNODB=YES WHEN MYSQLD +--echo # STARTED WITH --SKIP-INNODB +--echo # + +# need the --skip-innodb option present for the test to succeed +SHOW VARIABLES LIKE 'have_innodb'; +SELECT SUPPORT FROM INFORMATION_SCHEMA.ENGINES WHERE engine='innodb'; + +--echo End of 5.5 tests diff --git a/mysql-test/t/crash_commit_before.test b/mysql-test/t/crash_commit_before.test index e3dba58d4df..6e36d2345e1 100644 --- a/mysql-test/t/crash_commit_before.test +++ b/mysql-test/t/crash_commit_before.test @@ -1,6 +1,8 @@ -- source include/not_embedded.inc # Don't test this under valgrind, memory leaks will occur --source include/not_valgrind.inc +# Avoid CrashReporter popup on Mac +--source include/not_crashrep.inc # Binary must be compiled with debug for crash to occur --source include/have_debug.inc diff --git a/mysql-test/t/events_bugs.test b/mysql-test/t/events_bugs.test index 8d9959f1b0a..9432e64e032 100644 --- a/mysql-test/t/events_bugs.test +++ b/mysql-test/t/events_bugs.test @@ -1221,6 +1221,21 @@ SELECT event_name, originator FROM INFORMATION_SCHEMA.EVENTS; DROP EVENT ev1; SET GLOBAL server_id = @old_server_id; +# +# Bug#11751148: show events shows events in other schema +# + +CREATE DATABASE event_test12; +USE event_test12; +CREATE EVENT ev1 ON SCHEDULE EVERY 1 DAY DO SELECT 1; +CREATE DATABASE event_test1; +USE event_test1; +# Following show events should not show ev1 +SHOW EVENTS; +DROP DATABASE event_test1; +DROP DATABASE event_test12; + + ########################################################################### # # End of tests diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test index a0527f70b25..1c25a5bf8c7 100644 --- a/mysql-test/t/func_group.test +++ b/mysql-test/t/func_group.test @@ -1117,6 +1117,16 @@ SELECT RELEASE_LOCK('aaaaaaaaaaaaaaaaa'); --enable_result_log + +--echo # +--echo # Bug #11766094 - 59132: MIN() AND MAX() REMOVE UNSIGNEDNESS +--echo # + +CREATE TABLE t1 (a BIGINT UNSIGNED); +INSERT INTO t1 VALUES (18446668621106209655); +SELECT MAX(LENGTH(a)), LENGTH(MAX(a)), MIN(a), MAX(a), CONCAT(MIN(a)), CONCAT(MAX(a)) FROM t1; +DROP TABLE t1; + --echo # --echo End of 5.1 tests diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test index daa338a8424..687d96f8804 100644 --- a/mysql-test/t/func_math.test +++ b/mysql-test/t/func_math.test @@ -345,6 +345,15 @@ CREATE TABLE t1 SELECT CAST((CASE(('')) WHEN (CONVERT(1, CHAR(1))) THEN (('' / 1 SHOW CREATE TABLE t1; DROP TABLE t1; +--echo # +--echo # Bug#11764994 57900: CREATE TABLE .. SELECT ASSERTS SCALE >= 0 && PRECISION > 0 && SCALE <= PR +--echo # + +CREATE TABLE t1 SELECT CEIL(LINESTRINGFROMWKB(1) DIV NULL); +DROP TABLE t1; +CREATE TABLE t1 SELECT FLOOR(LINESTRINGFROMWKB(1) DIV NULL); +DROP TABLE t1; + --echo End of 5.1 tests --echo # diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index 9488ad4265d..96a73a454c3 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -862,6 +862,38 @@ INSERT INTO t1 VALUES (''),(''); SELECT COUNT(*) FROM t1 GROUP BY TIME_TO_SEC(a); DROP TABLE t1; +--echo # +--echo # Bug#11766112 59151:UNINITIALIZED VALUES IN EXTRACT_DATE_TIME WITH STR_TO_DATE(SPACE(..) ... +--echo # + +SELECT STR_TO_DATE(SPACE(2),'1'); + +--echo # +--echo # Bug#11765216 58154: UNINITIALIZED VARIABLE FORMAT IN STR_TO_DATE FUNCTION +--echo # + +SET GLOBAL SQL_MODE=''; +DO STR_TO_DATE((''), FROM_DAYS(@@GLOBAL.SQL_MODE)); +SET GLOBAL SQL_MODE=DEFAULT; + +--echo # +--echo # Bug#11766087 59125: VALGRIND UNINITIALISED VALUE WARNING IN ULL2DEC, LONGLONG2DECIMAL +--echo # + +SELECT FORMAT(YEAR(STR_TO_DATE('',GET_FORMAT(TIME,''))),1); + +--echo # +--echo # Bug#11766126 59166: ANOTHER DATETIME VALGRIND UNINITIALIZED WARNING +--echo # + +SELECT CAST((MONTH(FROM_UNIXTIME(@@GLOBAL.SQL_MODE))) AS BINARY(1025)); + +--echo # +--echo # Bug#11766124 59164: VALGRIND: UNINITIALIZED VALUE IN NUMBER_TO_DATETIME +--echo # + +SELECT ADDDATE(MONTH(FROM_UNIXTIME(NULL)),INTERVAL 1 HOUR); + --echo End of 5.1 tests --echo # diff --git a/mysql-test/t/innodb_mysql_lock.test b/mysql-test/t/innodb_mysql_lock.test index 975444a44b1..f1dc0d52484 100644 --- a/mysql-test/t/innodb_mysql_lock.test +++ b/mysql-test/t/innodb_mysql_lock.test @@ -279,6 +279,38 @@ disconnect con2; disconnect con3; +--echo # +--echo # Bug#11815600 [ERROR] INNODB COULD NOT FIND INDEX PRIMARY +--echo # KEY NO 0 FOR TABLE IN ERROR LOG +--echo # + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--connect (con1,localhost,root) + +--echo # Connection default +connection default; +CREATE TABLE t1 (id INT PRIMARY KEY, value INT) ENGINE = InnoDB; +INSERT INTO t1 VALUES (1, 12345); +START TRANSACTION; +SELECT * FROM t1; + +--echo # Connection con1 +--connection con1 +SET lock_wait_timeout=1; +--error ER_LOCK_WAIT_TIMEOUT +ALTER TABLE t1 ADD INDEX idx(value); + +--echo # Connection default +--connection default +SELECT * FROM t1; +COMMIT; +DROP TABLE t1; +disconnect con1; + + # Check that all connections opened by test cases in this file are really # gone so execution of other tests won't be affected by their presence. --source include/wait_until_count_sessions.inc diff --git a/mysql-test/t/innodb_mysql_sync.test b/mysql-test/t/innodb_mysql_sync.test index bf1e5de1587..13c854d6b61 100644 --- a/mysql-test/t/innodb_mysql_sync.test +++ b/mysql-test/t/innodb_mysql_sync.test @@ -152,129 +152,133 @@ disconnect con1; --echo # that implement add_index --echo # ---disable_warnings -DROP DATABASE IF EXISTS db1; -DROP TABLE IF EXISTS t1; ---enable_warnings - -connect(con1,localhost,root); -connect(con2,localhost,root); - ---echo # Test 1: Secondary index, should not block reads (original test case). - ---echo # Connection default -connection default; -CREATE DATABASE db1; -CREATE TABLE db1.t1(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, value INT) engine=innodb; -INSERT INTO db1.t1(value) VALUES (1), (2); -SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; ---echo # Sending: ---send ALTER TABLE db1.t1 ADD INDEX(value) - ---echo # Connection con1 -connection con1; -SET DEBUG_SYNC= "now WAIT_FOR manage"; -# Neither of these two statements should be blocked -USE db1; -SELECT * FROM t1; -SET DEBUG_SYNC= "now SIGNAL query"; - ---echo # Connection default -connection default; ---echo # Reaping: ALTER TABLE db1.t1 ADD INDEX(value) ---reap -DROP DATABASE db1; - ---echo # Test 2: Primary index (implicit), should block reads. - -CREATE TABLE t1(a INT NOT NULL, b INT NOT NULL) engine=innodb; -SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; ---echo # Sending: ---send ALTER TABLE t1 ADD UNIQUE INDEX(a) - ---echo # Connection con1 -connection con1; -SET DEBUG_SYNC= "now WAIT_FOR manage"; -USE test; ---echo # Sending: ---send SELECT * FROM t1 - ---echo # Connection con2 -connection con2; ---echo # Waiting for SELECT to be blocked by the metadata lock on t1 -let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist - WHERE state= 'Waiting for table metadata lock' - AND info='SELECT * FROM t1'; ---source include/wait_condition.inc -SET DEBUG_SYNC= "now SIGNAL query"; - ---echo # Connection default -connection default; ---echo # Reaping: ALTER TABLE t1 ADD UNIQUE INDEX(a) ---reap - ---echo # Connection con1 -connection con1; ---echo # Reaping: SELECT * FROM t1 ---reap - ---echo # Test 3: Primary index (explicit), should block reads. - ---echo # Connection default -connection default; -ALTER TABLE t1 DROP INDEX a; -SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; ---echo # Sending: ---send ALTER TABLE t1 ADD PRIMARY KEY (a) - ---echo # Connection con1 -connection con1; -SET DEBUG_SYNC= "now WAIT_FOR manage"; ---echo # Sending: ---send SELECT * FROM t1 - ---echo # Connection con2 -connection con2; ---echo # Waiting for SELECT to be blocked by the metadata lock on t1 -let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist - WHERE state= 'Waiting for table metadata lock' - AND info='SELECT * FROM t1'; ---source include/wait_condition.inc -SET DEBUG_SYNC= "now SIGNAL query"; - ---echo # Connection default -connection default; ---echo # Reaping: ALTER TABLE t1 ADD PRIMARY KEY (a) ---reap - ---echo # Connection con1 -connection con1; ---echo # Reaping: SELECT * FROM t1 ---reap - ---echo # Test 4: Secondary unique index, should not block reads. - ---echo # Connection default -connection default; -SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; ---echo # Sending: ---send ALTER TABLE t1 ADD UNIQUE (b) - ---echo # Connection con1 -connection con1; -SET DEBUG_SYNC= "now WAIT_FOR manage"; -SELECT * FROM t1; -SET DEBUG_SYNC= "now SIGNAL query"; - ---echo # Connection default -connection default; ---echo # Reaping: ALTER TABLE t1 ADD UNIQUE (b) ---reap +--echo # +--echo # DISABLED due to Bug#11815600 +--echo # -disconnect con1; -disconnect con2; -SET DEBUG_SYNC= "RESET"; -DROP TABLE t1; +#--disable_warnings +#DROP DATABASE IF EXISTS db1; +#DROP TABLE IF EXISTS t1; +#--enable_warnings +# +#connect(con1,localhost,root); +#connect(con2,localhost,root); +# +#--echo # Test 1: Secondary index, should not block reads (original test case). +# +#--echo # Connection default +#connection default; +#CREATE DATABASE db1; +#CREATE TABLE db1.t1(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, value INT) engine=innodb; +#INSERT INTO db1.t1(value) VALUES (1), (2); +#SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; +#--echo # Sending: +#--send ALTER TABLE db1.t1 ADD INDEX(value) +# +#--echo # Connection con1 +#connection con1; +#SET DEBUG_SYNC= "now WAIT_FOR manage"; +# # Neither of these two statements should be blocked +#USE db1; +#SELECT * FROM t1; +#SET DEBUG_SYNC= "now SIGNAL query"; +# +#--echo # Connection default +#connection default; +#--echo # Reaping: ALTER TABLE db1.t1 ADD INDEX(value) +#--reap +#DROP DATABASE db1; +# +#--echo # Test 2: Primary index (implicit), should block reads. +# +#CREATE TABLE t1(a INT NOT NULL, b INT NOT NULL) engine=innodb; +#SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; +#--echo # Sending: +#--send ALTER TABLE t1 ADD UNIQUE INDEX(a) +# +#--echo # Connection con1 +#connection con1; +#SET DEBUG_SYNC= "now WAIT_FOR manage"; +#USE test; +#--echo # Sending: +#--send SELECT * FROM t1 +# +#--echo # Connection con2 +#connection con2; +#--echo # Waiting for SELECT to be blocked by the metadata lock on t1 +#let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist +# WHERE state= 'Waiting for table metadata lock' +# AND info='SELECT * FROM t1'; +#--source include/wait_condition.inc +#SET DEBUG_SYNC= "now SIGNAL query"; +# +#--echo # Connection default +#connection default; +#--echo # Reaping: ALTER TABLE t1 ADD UNIQUE INDEX(a) +#--reap +# +#--echo # Connection con1 +#connection con1; +#--echo # Reaping: SELECT * FROM t1 +#--reap +# +#--echo # Test 3: Primary index (explicit), should block reads. +# +#--echo # Connection default +#connection default; +#ALTER TABLE t1 DROP INDEX a; +#SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; +#--echo # Sending: +#--send ALTER TABLE t1 ADD PRIMARY KEY (a) +# +#--echo # Connection con1 +#connection con1; +#SET DEBUG_SYNC= "now WAIT_FOR manage"; +#--echo # Sending: +#--send SELECT * FROM t1 +# +#--echo # Connection con2 +#connection con2; +#--echo # Waiting for SELECT to be blocked by the metadata lock on t1 +#let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist +# WHERE state= 'Waiting for table metadata lock' +# AND info='SELECT * FROM t1'; +#--source include/wait_condition.inc +#SET DEBUG_SYNC= "now SIGNAL query"; +# +#--echo # Connection default +#connection default; +#--echo # Reaping: ALTER TABLE t1 ADD PRIMARY KEY (a) +#--reap +# +#--echo # Connection con1 +#connection con1; +#--echo # Reaping: SELECT * FROM t1 +#--reap +# +#--echo # Test 4: Secondary unique index, should not block reads. +# +#--echo # Connection default +#connection default; +#SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; +#--echo # Sending: +#--send ALTER TABLE t1 ADD UNIQUE (b) +# +#--echo # Connection con1 +#connection con1; +#SET DEBUG_SYNC= "now WAIT_FOR manage"; +#SELECT * FROM t1; +#SET DEBUG_SYNC= "now SIGNAL query"; +# +#--echo # Connection default +#connection default; +#--echo # Reaping: ALTER TABLE t1 ADD UNIQUE (b) +#--reap +# +#disconnect con1; +#disconnect con2; +#SET DEBUG_SYNC= "RESET"; +#DROP TABLE t1; # Check that all connections opened by test cases in this file are really diff --git a/mysql-test/t/lowercase_table2.test b/mysql-test/t/lowercase_table2.test index d8aa4e97fb3..30433d15be4 100644 --- a/mysql-test/t/lowercase_table2.test +++ b/mysql-test/t/lowercase_table2.test @@ -151,6 +151,41 @@ where TABLE_SCHEMA ='mysqltest_LC2'; use test; drop database mysqltest_LC2; + +--echo # +--echo # Bug #11758687: 50924: object names not resolved correctly +--echo # on lctn2 systems +--echo # + +CREATE DATABASE BUP_XPFM_COMPAT_DB2; + +CREATE TABLE BUP_XPFM_COMPAT_DB2.TABLE2 (c13 INT) DEFAULT CHARSET latin1; +CREATE TABLE BUP_XPFM_COMPAT_DB2.table1 (c13 INT) DEFAULT CHARSET latin1; +CREATE TABLE bup_xpfm_compat_db2.table3 (c13 INT) DEFAULT CHARSET latin1; + +delimiter |; +# +CREATE TRIGGER BUP_XPFM_COMPAT_DB2.trigger1 AFTER INSERT + ON BUP_XPFM_COMPAT_DB2.table1 FOR EACH ROW + update BUP_XPFM_COMPAT_DB2.table1 set c13=12; +| +CREATE TRIGGER BUP_XPFM_COMPAT_DB2.TRIGGER2 AFTER INSERT + ON BUP_XPFM_COMPAT_DB2.TABLE2 FOR EACH ROW + update BUP_XPFM_COMPAT_DB2.table1 set c13=12; +| +CREATE TRIGGER BUP_XPFM_COMPAT_DB2.TrigGer3 AFTER INSERT + ON BUP_XPFM_COMPAT_DB2.TaBle3 FOR EACH ROW + update BUP_XPFM_COMPAT_DB2.table1 set c13=12; +| +delimiter ;| + +SELECT trigger_schema, trigger_name, event_object_table FROM +INFORMATION_SCHEMA.TRIGGERS + WHERE trigger_schema COLLATE utf8_bin = 'BUP_XPFM_COMPAT_DB2' + ORDER BY trigger_schema, trigger_name; + +DROP DATABASE BUP_XPFM_COMPAT_DB2; + --echo # End of 5.1 tests diff --git a/mysql-test/t/myisam_crash_before_flush_keys.test b/mysql-test/t/myisam_crash_before_flush_keys.test index 0b0491098cd..a9f36f40d10 100644 --- a/mysql-test/t/myisam_crash_before_flush_keys.test +++ b/mysql-test/t/myisam_crash_before_flush_keys.test @@ -10,6 +10,8 @@ call mtr.add_suppression("Got an error from thread_id=.*ha_myisam.cc:"); call mtr.add_suppression("MySQL thread id .*, query id .* localhost.*root Checking table"); +# Avoid CrashReporter popup on Mac +--source include/not_crashrep.inc let $MYSQLD_DATADIR= `select @@datadir`; SET GLOBAL delay_key_write=ALL; diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index 714cfbbaa9b..f64d8b502ae 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -527,3 +527,23 @@ exec $MYSQL_BINLOG $MYSQLD_DATADIR/$master_binlog | $MYSQL test 2>&1; let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1); source include/show_binlog_events.inc; +# +# BUG#11766427 BUG#59530: Filter by server id in mysqlbinlog fails +# This test checks that the format description log event is not +# filtered out by the --server-id option. +# +RESET MASTER; +USE test; +CREATE TABLE t1 (a INT); +--let $old_server_id= `SELECT @@GLOBAL.SERVER_ID` +SET GLOBAL SERVER_ID = 2; +DROP TABLE t1; +--let $master_binlog= query_get_value(SHOW MASTER STATUS, File, 1) +FLUSH LOGS; +# The following should only create t1, not drop it. +--exec $MYSQL_BINLOG --server-id=1 $MYSQLD_DATADIR/$master_binlog | $MYSQL +SHOW TABLES IN test; +# The following should only drop t1, not create it. +--exec $MYSQL_BINLOG --server-id=2 $MYSQLD_DATADIR/$master_binlog | $MYSQL +SHOW TABLES IN test; +eval SET GLOBAL SERVER_ID = $old_server_id; diff --git a/mysql-test/t/partition_error.test b/mysql-test/t/partition_error.test index 61b14b81fca..536935420a4 100644 --- a/mysql-test/t/partition_error.test +++ b/mysql-test/t/partition_error.test @@ -741,65 +741,9 @@ DROP TABLE t1; CREATE TABLE t1 (c TIMESTAMP) PARTITION BY HASH (c) PARTITIONS 4; +--echo # Moved to partition_myisam, since it was MyISAM specific --echo # Added test with existing TIMESTAMP partitioning (when it was allowed). -CREATE TABLE t1 (a TIMESTAMP) -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 -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 # ---echo # Bug#49161: Out of memory; restart server and try again (needed 2 bytes) ---echo # -CREATE TABLE t1 (a INT) PARTITION BY HASH (a); -FLUSH TABLES; ---remove_file $MYSQLD_DATADIR/test/t1.par ---replace_result $MYSQLD_DATADIR ./ -CHECK TABLE t1; ---error ER_FAILED_READ_FROM_PAR_FILE -SELECT * FROM t1; ---echo # Note that it is currently impossible to drop a partitioned table ---echo # without the .par file ---error ER_BAD_TABLE_ERROR -DROP TABLE t1; ---remove_file $MYSQLD_DATADIR/test/t1.frm ---remove_file $MYSQLD_DATADIR/test/t1#P#p0.MYI ---remove_file $MYSQLD_DATADIR/test/t1#P#p0.MYD - --echo # --echo # Bug#49477: Assertion `0' failed in ha_partition.cc:5530 --echo # with temporary table and partitions @@ -820,6 +764,7 @@ SUBPARTITION BY HASH(TO_DAYS(purchased)) (PARTITION p0 VALUES LESS THAN MAXVALUE DATA DIRECTORY = '/tmp/not-existing' INDEX DIRECTORY = '/tmp/not-existing'); +--replace_result MyISAM <curr_engine> InnoDB <curr_engine> SHOW CREATE TABLE t1; DROP TABLE t1; CREATE TABLE t1 (id INT, purchased DATE) @@ -830,6 +775,7 @@ SUBPARTITION BY HASH(TO_DAYS(purchased)) SUBPARTITIONS 2 DATA DIRECTORY = '/tmp/not-existing' INDEX DIRECTORY = '/tmp/not-existing', SUBPARTITION sp1)); +--replace_result MyISAM <curr_engine> InnoDB <curr_engine> SHOW CREATE TABLE t1; DROP TABLE t1; CREATE TABLE t1 (id INT, purchased DATE) @@ -837,34 +783,11 @@ PARTITION BY RANGE(YEAR(purchased)) (PARTITION p0 VALUES LESS THAN MAXVALUE DATA DIRECTORY = '/tmp/not-existing' INDEX DIRECTORY = '/tmp/not-existing'); +--replace_result MyISAM <curr_engine> InnoDB <curr_engine> SHOW CREATE TABLE t1; DROP TABLE t1; SET @@sql_mode= @org_mode; ---echo # ---echo # Bug#50392: insert_id is not reset for partitioned tables ---echo # auto_increment on duplicate entry -CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY); -SET INSERT_ID= 13; -INSERT INTO t1 VALUES (NULL); -SET INSERT_ID= 12; ---error ER_DUP_ENTRY -INSERT INTO t1 VALUES (NULL), (NULL), (NULL); -SHOW CREATE TABLE t1; -INSERT INTO t1 VALUES (NULL); -SELECT * FROM t1; -DROP TABLE t1; -CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY) PARTITION BY KEY(a); -SET INSERT_ID= 13; -INSERT INTO t1 VALUES (NULL); -SET INSERT_ID= 12; ---error ER_DUP_ENTRY -INSERT INTO t1 VALUES (NULL), (NULL), (NULL); -SHOW CREATE TABLE t1; -INSERT INTO t1 VALUES (NULL); -SELECT * FROM t1; -DROP TABLE t1; - # # Bug#38719: Partitioning returns a different error code for a # duplicate key error @@ -879,24 +802,6 @@ INSERT INTO t1 VALUES (1),(1); DROP TABLE t1; # -# Bug#31931: Mix of handlers error message -# ---error ER_MIX_HANDLER_ERROR -CREATE TABLE t1 (a INT) -PARTITION BY HASH (a) -( PARTITION p0 ENGINE=MyISAM, - PARTITION p1); ---error ER_MIX_HANDLER_ERROR -CREATE TABLE t1 (a INT) -PARTITION BY LIST (a) -SUBPARTITION BY HASH (a) -( PARTITION p0 VALUES IN (0) -( SUBPARTITION s0, SUBPARTITION s1 ENGINE=MyISAM, SUBPARTITION s2), - PARTITION p1 VALUES IN (1) -( SUBPARTITION s3 ENGINE=MyISAM, SUBPARTITION s4, SUBPARTITION s5 ENGINE=MyISAM)); - - -# # Bug 29368: # Incorrect error, 1467, for syntax error when creating partition --error ER_PARTITION_REQUIRES_VALUES_ERROR @@ -912,7 +817,7 @@ PARTITION BY RANGE (a) # # Partition by key stand-alone error # ---error 1064 +--error ER_PARSE_ERROR partition by list (a) partitions 3 (partition x1 values in (1,2,9,4) tablespace ts1, @@ -949,7 +854,7 @@ partitions 3 # # Partition by key, partition function not allowed # ---error 1064 +--error ER_PARSE_ERROR CREATE TABLE t1 ( a int not null, b int not null, @@ -964,7 +869,7 @@ partitions 3 # # Partition by key, no partition name # ---error 1064 +--error ER_PARSE_ERROR CREATE TABLE t1 ( a int not null, b int not null, @@ -995,7 +900,7 @@ select load_file('$MYSQLD_DATADIR/test/t1.par'); # # Partition by hash, invalid field in function # ---error 1054 +--error ER_BAD_FIELD_ERROR CREATE TABLE t1 ( a int not null, b int not null, @@ -1025,7 +930,7 @@ partitions 3 # # Partition by key specified 3 partitions but only defined 2 => error # ---error 1064 +--error ER_PARSE_ERROR CREATE TABLE t1 ( a int not null, b int not null, @@ -1038,7 +943,7 @@ partitions 3 # # Partition by hash, random function # ---error 1064 +--error ER_PARSE_ERROR CREATE TABLE t1 ( a int not null, b int not null, @@ -1051,7 +956,7 @@ partitions 2 # # Partition by range, random function # ---error 1064 +--error ER_PARSE_ERROR CREATE TABLE t1 ( a int not null, b int not null, @@ -1064,7 +969,7 @@ partitions 2 # # Partition by list, random function # ---error 1064 +--error ER_PARSE_ERROR CREATE TABLE t1 ( a int not null, b int not null, @@ -1200,7 +1105,7 @@ select load_file('$MYSQLD_DATADIR/test/t1.par'); # # Subpartition by hash, no partitions defined, wrong subpartition function # ---error 1064 +--error ER_PARSE_ERROR CREATE TABLE t1 ( a int not null, b int not null, @@ -1227,7 +1132,7 @@ select load_file('$MYSQLD_DATADIR/test/t1.par'); # # Subpartition by hash, no partitions defined, wrong subpartition function # ---error 1064 +--error ER_PARSE_ERROR CREATE TABLE t1 ( a int not null, b int not null, @@ -1268,7 +1173,7 @@ subpartition by hash (3+4); # # Subpartition by hash, no partitions defined, wrong subpartition function # ---error 1054 +--error ER_BAD_FIELD_ERROR CREATE TABLE t1 ( a int not null, b int not null, @@ -1294,7 +1199,7 @@ select load_file('$MYSQLD_DATADIR/test/t1.par'); # # Partition by range, invalid field in function # ---error 1054 +--error ER_BAD_FIELD_ERROR CREATE TABLE t1 ( a int not null, b int not null, @@ -1448,7 +1353,7 @@ partitions 2 # # Subpartition by hash, wrong number of subpartitions # ---error 1064 +--error ER_PARSE_ERROR CREATE TABLE t1 ( a int not null, b int not null, @@ -1468,7 +1373,7 @@ subpartitions 3 # # Subpartition by hash, wrong number of subpartitions # ---error 1064 +--error ER_PARSE_ERROR CREATE TABLE t1 ( a int not null, b int not null, @@ -1488,7 +1393,7 @@ subpartition by hash (a+b) # # Subpartition by list => error # ---error 1064 +--error ER_PARSE_ERROR CREATE TABLE t1 ( a int not null, b int not null, @@ -1507,7 +1412,7 @@ subpartition by list (a+b) # # Subpartition by list => error # ---error 1064 +--error ER_PARSE_ERROR CREATE TABLE t1 ( a int not null, b int not null, @@ -1551,7 +1456,7 @@ partitions 2 # # Partition by list, invalid field in function # ---error 1054 +--error ER_BAD_FIELD_ERROR CREATE TABLE t1 ( a int not null, b int not null, @@ -1635,7 +1540,7 @@ partitions 2 # # Partition by list, missing parenthesis # ---error 1064 +--error ER_PARSE_ERROR CREATE TABLE t1 ( a int not null, b int not null, @@ -1649,7 +1554,7 @@ partitions 2 # # Bug #13439: Crash when LESS THAN (non-literal) # ---error 1054 +--error ER_BAD_FIELD_ERROR CREATE TABLE t1 (a int) PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (x1)); @@ -1676,13 +1581,13 @@ partition by range (ascii(v)) (partition p0 values less than (10)); #drop table t1; --- error 1064 +-- error ER_PARSE_ERROR create table t1 (a int) partition by hash (rand(a)); --- error 1064 +-- error ER_PARSE_ERROR create table t1 (a int) partition by hash(CURTIME() + a); --- error 1064 +-- error ER_PARSE_ERROR create table t1 (a int) partition by hash (NOW()+a); -- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED diff --git a/mysql-test/t/partition_myisam.test b/mysql-test/t/partition_myisam.test new file mode 100644 index 00000000000..37d4a071fb9 --- /dev/null +++ b/mysql-test/t/partition_myisam.test @@ -0,0 +1,173 @@ +-- source include/have_partition.inc + +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +--enable_warnings + +# These tests is only useful when running on MyISAM, +# due to DATA/INDEX directory, non transactional behavior, tests with MyISAM +# files etc. + +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 <curr_engine> InnoDB <curr_engine> +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 # +--echo # Bug#31931: Mix of handlers error message +--echo # +--error ER_MIX_HANDLER_ERROR +CREATE TABLE t1 (a INT) +PARTITION BY HASH (a) +( PARTITION p0 ENGINE=MyISAM, + PARTITION p1); +--error ER_MIX_HANDLER_ERROR +CREATE TABLE t1 (a INT) +PARTITION BY LIST (a) +SUBPARTITION BY HASH (a) +( PARTITION p0 VALUES IN (0) +( SUBPARTITION s0, SUBPARTITION s1 ENGINE=MyISAM, SUBPARTITION s2), + PARTITION p1 VALUES IN (1) +( SUBPARTITION s3 ENGINE=MyISAM, SUBPARTITION s4, SUBPARTITION s5 ENGINE=MyISAM)); + +--echo # +--echo # Bug#49161: Out of memory; restart server and try again (needed 2 bytes) +--echo # +CREATE TABLE t1 (a INT) +ENGINE = MyISAM +PARTITION BY HASH (a); +FLUSH TABLES; +--remove_file $MYSQLD_DATADIR/test/t1.par +--replace_result $MYSQLD_DATADIR ./ +CHECK TABLE t1; +--error ER_FAILED_READ_FROM_PAR_FILE +SELECT * FROM t1; +--echo # Note that it is currently impossible to drop a partitioned table +--echo # without the .par file +--error ER_BAD_TABLE_ERROR +DROP TABLE t1; +--remove_file $MYSQLD_DATADIR/test/t1.frm +--remove_file $MYSQLD_DATADIR/test/t1#P#p0.MYI +--remove_file $MYSQLD_DATADIR/test/t1#P#p0.MYD + +--echo # +--echo # Bug#50392: insert_id is not reset for partitioned tables +--echo # auto_increment on duplicate entry +CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY) +ENGINE = MyISAM; +SET INSERT_ID= 13; +INSERT INTO t1 VALUES (NULL); +SET INSERT_ID= 12; +--echo # For transactional engines, 12 will not be inserted, since the failing +--echo # statement is rolled back. +--error ER_DUP_ENTRY +INSERT INTO t1 VALUES (NULL), (NULL), (NULL); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (NULL); +--echo # NOTE: 12 exists only in non transactional engines! +SELECT * FROM t1; +DROP TABLE t1; +CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY) +ENGINE = MyISAM +PARTITION BY KEY(a); +SET INSERT_ID= 13; +INSERT INTO t1 VALUES (NULL); +SET INSERT_ID= 12; +--error ER_DUP_ENTRY +INSERT INTO t1 VALUES (NULL), (NULL), (NULL); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (NULL); +SELECT * FROM t1; +DROP TABLE t1; +# +# Bug#30102: rename table does corrupt tables with partition files on failure +# +--echo # Bug#30102 test +CREATE TABLE t1 (a INT) +ENGINE = MyISAM +PARTITION BY RANGE (a) +(PARTITION p0 VALUES LESS THAN (6), + PARTITION `p1....................` VALUES LESS THAN (9), + PARTITION p2 VALUES LESS THAN MAXVALUE); +# partition p1 is 't1#P#p1' + @002e * 20 = 107 characters + file ending +# total path lenght of './test/t1#P#p1@002e@002e<...>@002e.MY[ID]' is 118 chars +--echo # List of files in database `test`, all original t1-files here +--list_files $MYSQLD_DATADIR/test t1* +INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +--echo # Renaming to a file name where the first partition is 250 chars +--echo # and the second partition is 350 chars +# 7,7 avoids the error message, which is not deterministic. +--error 7,7 +RENAME TABLE t1 TO `t2_new..............................................end`; +# 1234567890123456789012345678901234567890123456 +--echo # List of files in database `test`, should not be any t2-files here +--list_files $MYSQLD_DATADIR/test t2* +--echo # List of files in database `test`, should be all t1-files here +--list_files $MYSQLD_DATADIR/test t1* +--sorted_result +SELECT * FROM t1; +--echo # List of files in database `test`, should be all t1-files here +--list_files $MYSQLD_DATADIR/test t1* +--echo # Renaming to a file name where the first partition is 156 chars +--echo # and the second partition is 256 chars +# 7,7 avoids the error message, which is not deterministic. +--error 7,7 +RENAME TABLE t1 TO `t2_............................_end`; +# 1234567890123456789012345678 +# 7 + 4 + 5 + 28 * 5 = 16 + 140 = 156 +--echo # List of files in database `test`, should not be any t2-files here +--list_files $MYSQLD_DATADIR/test t2* +--echo # List of files in database `test`, should be all t1-files here +--list_files $MYSQLD_DATADIR/test t1* +--sorted_result +SELECT * FROM t1; +DROP TABLE t1; +--echo # Should not be any files left here +--list_files $MYSQLD_DATADIR/test t1* +--list_files $MYSQLD_DATADIR/test t2* +--echo # End of bug#30102 test. diff --git a/mysql-test/t/partition_not_embedded.test b/mysql-test/t/partition_not_embedded.test deleted file mode 100644 index 5c512085a9e..00000000000 --- a/mysql-test/t/partition_not_embedded.test +++ /dev/null @@ -1,53 +0,0 @@ --- source include/have_partition.inc --- source include/not_embedded.inc ---disable_warnings -DROP TABLE IF EXISTS t1, t2; ---enable_warnings -let $MYSQLD_DATADIR= `SELECT @@datadir`; - -# -# Bug#30102: rename table does corrupt tables with partition files on failure -# ---echo # Bug#30102 test -CREATE TABLE t1 (a INT) -PARTITION BY RANGE (a) -(PARTITION p0 VALUES LESS THAN (6), - PARTITION `p1....................` VALUES LESS THAN (9), - PARTITION p2 VALUES LESS THAN MAXVALUE); -# partition p1 is 't1#P#p1' + @002e * 20 = 107 characters + file ending -# total path lenght of './test/t1#P#p1@002e@002e<...>@002e.MY[ID]' is 118 chars ---echo # List of files in database `test`, all original t1-files here ---list_files $MYSQLD_DATADIR/test t1* -INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); ---echo # Renaming to a file name where the first partition is 250 chars ---echo # and the second partition is 350 chars -# 7,7 avoids the error message, which is not deterministic. ---error 7,7 -RENAME TABLE t1 TO `t2_new..............................................end`; -# 1234567890123456789012345678901234567890123456 ---echo # List of files in database `test`, should not be any t2-files here ---list_files $MYSQLD_DATADIR/test t2* ---echo # List of files in database `test`, should be all t1-files here ---list_files $MYSQLD_DATADIR/test t1* ---sorted_result -SELECT * FROM t1; ---echo # List of files in database `test`, should be all t1-files here ---list_files $MYSQLD_DATADIR/test t1* ---echo # Renaming to a file name where the first partition is 156 chars ---echo # and the second partition is 256 chars -# 7,7 avoids the error message, which is not deterministic. ---error 7,7 -RENAME TABLE t1 TO `t2_............................_end`; -# 1234567890123456789012345678 -# 7 + 4 + 5 + 28 * 5 = 16 + 140 = 156 ---echo # List of files in database `test`, should not be any t2-files here ---list_files $MYSQLD_DATADIR/test t2* ---echo # List of files in database `test`, should be all t1-files here ---list_files $MYSQLD_DATADIR/test t1* ---sorted_result -SELECT * FROM t1; -DROP TABLE t1; ---echo # Should not be any files left here ---list_files $MYSQLD_DATADIR/test t1* ---list_files $MYSQLD_DATADIR/test t2* ---echo # End of bug#30102 test. diff --git a/mysql-test/t/partition_symlink.test b/mysql-test/t/partition_symlink.test index 4147d2c6e89..5fdde8e0abc 100644 --- a/mysql-test/t/partition_symlink.test +++ b/mysql-test/t/partition_symlink.test @@ -1,5 +1,6 @@ # Test that must have symlink. eg. using DATA/INDEX DIR # (DATA/INDEX DIR requires symlinks) +# This test is only useful for MyISAM, since no other engine supports DATA DIR -- source include/have_partition.inc -- source include/have_symlink.inc # remove the not_windows line after fixing bug#33687 @@ -33,13 +34,14 @@ DROP DATABASE IF EXISTS mysqltest2; CREATE USER mysqltest_1@localhost; CREATE DATABASE mysqltest2; USE mysqltest2; - CREATE TABLE t1 (a INT); + CREATE TABLE t1 (a INT) ENGINE = MyISAM; INSERT INTO t1 VALUES (0); connect(con1,localhost,mysqltest_1,,); -- echo # user mysqltest_1: USE test; -- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval CREATE TABLE t1 (a INT) + ENGINE = MyISAM PARTITION BY LIST (a) ( PARTITION p0 VALUES IN (0) DATA DIRECTORY '$MYSQLTEST_VARDIR/tmp' @@ -82,6 +84,7 @@ connection default; USE mysqltest2; -- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval CREATE TABLE t1 (a INT) + ENGINE = MyISAM PARTITION BY LIST (a) ( PARTITION p0 VALUES IN (0) DATA DIRECTORY '$MYSQLTEST_VARDIR/tmp' @@ -96,6 +99,7 @@ connection con1; -- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR -- error 1,1 eval CREATE TABLE t1 (a INT) + ENGINE = MyISAM PARTITION BY LIST (a) ( PARTITION p0 VALUES IN (0) DATA DIRECTORY '$MYSQLTEST_VARDIR/tmp' @@ -107,6 +111,7 @@ connection con1; -- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR -- error 1,1 eval CREATE TABLE t1 (a INT) + ENGINE = MyISAM PARTITION BY LIST (a) ( PARTITION p0 VALUES IN (0) DATA DIRECTORY '$MYSQLTEST_VARDIR/tmp' @@ -128,6 +133,7 @@ connection default; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval create table t2 (i int ) +ENGINE = MyISAM partition by range (i) ( partition p01 values less than (1000) @@ -139,6 +145,7 @@ set @org_mode=@@sql_mode; set @@sql_mode='NO_DIR_IN_CREATE'; select @@sql_mode; create table t1 (i int ) +ENGINE = MyISAM partition by range (i) ( partition p01 values less than (1000) @@ -157,6 +164,7 @@ set @@sql_mode=@org_mode; # Added ER_WRONG_TABLE_NAME and reported bug#39045 -- error ER_WRONG_ARGUMENTS, ER_WRONG_TABLE_NAME create table t1 (a int) +ENGINE = MyISAM partition by key (a) (partition p0 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data'); @@ -167,6 +175,7 @@ partition by key (a) # Added ER_WRONG_TABLE_NAME and reported bug#39045 --error ER_WRONG_ARGUMENTS, ER_WRONG_TABLE_NAME create table t1 (a int) +ENGINE = MyISAM partition by key (a) (partition p0, partition p1 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data'); diff --git a/mysql-test/t/plugin_auth.test b/mysql-test/t/plugin_auth.test index 1e65f503ee3..a81cf4e4783 100644 --- a/mysql-test/t/plugin_auth.test +++ b/mysql-test/t/plugin_auth.test @@ -490,4 +490,26 @@ SELECT IS_NULLABLE, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA='mysql' ORDER BY COLUMN_NAME; + +--echo # +--echo # Bug #11936829: diff. between mysql.user (authentication_string) +--echo # in fresh and upgraded 5.5.11 +--echo # + +SELECT IS_NULLABLE, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS + WHERE TABLE_SCHEMA= 'mysql' AND TABLE_NAME= 'user' AND + COLUMN_NAME IN ('plugin', 'authentication_string') + ORDER BY COLUMN_NAME; +ALTER TABLE mysql.user MODIFY plugin char(64) DEFAULT '' NOT NULL; +ALTER TABLE mysql.user MODIFY authentication_string TEXT NOT NULL; + +--echo Run mysql_upgrade on a 5.5.10 external authentication column layout +--exec $MYSQL_UPGRADE --skip-verbose --force 2>&1 + +SELECT IS_NULLABLE, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS + WHERE TABLE_SCHEMA= 'mysql' AND TABLE_NAME= 'user' AND + COLUMN_NAME IN ('plugin', 'authentication_string') + ORDER BY COLUMN_NAME; + + --echo End of 5.5 tests diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index eaef1cf3000..e00bd785789 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -3344,7 +3344,21 @@ connection default; DROP TABLE t1; disconnect con1; +--echo +--echo # +--echo # Bug#56115: invalid memory reads when PS selecting from +--echo # information_schema tables +--echo # Bug#58701: crash in Field::make_field, cursor-protocol +--echo # +--echo # NOTE: MTR should be run both with --ps-protocol and --cursor-protocol. +--echo # +--echo + +SELECT * +FROM (SELECT 1 UNION SELECT 2) t; + + --echo # ---echo # End of 6.0 tests. +--echo # End of 5.5 tests. ########################################################################### diff --git a/mysql-test/t/tablespace.test b/mysql-test/t/tablespace.test new file mode 100644 index 00000000000..9f3cf6255ac --- /dev/null +++ b/mysql-test/t/tablespace.test @@ -0,0 +1,122 @@ +# +# BUG#60111 storage type for table not saved in .frm +# + +# +# Check that the table options for TABLESPACE and STORAGE +# are printed in SHOW CREATE TABLE +# + +# TABLESPACE only +CREATE TABLE t1(a int) TABLESPACE ts ENGINE=MyISAM; +SHOW CREATE TABLE t1; +DROP TABLE t1; + +# TABLESPACE + STORAGE DISK +CREATE TABLE t1(a int) TABLESPACE ts STORAGE DISK ENGINE=MyISAM; +SHOW CREATE TABLE t1; +DROP TABLE t1; + +# TABLESPACE + STORAGE MEMORY +CREATE TABLE t1(a int) TABLESPACE ts STORAGE MEMORY ENGINE=MyISAM; +SHOW CREATE TABLE t1; +DROP TABLE t1; + +# STORAGE MEMORY only +CREATE TABLE t1(a int) STORAGE MEMORY ENGINE=MyISAM; +SHOW CREATE TABLE t1; +DROP TABLE t1; + +# STORAGE DISK only +CREATE TABLE t1(a int) STORAGE DISK ENGINE=MyISAM; +SHOW CREATE TABLE t1; +DROP TABLE t1; + +# +# Check that the table options for TABLESPACE and STORAGE +# are kept in an ALTER +# + +# TABLESPACE only +CREATE TABLE t1(a int) TABLESPACE ts ENGINE=MyISAM; +ALTER TABLE t1 ADD COLUMN b int; +SHOW CREATE TABLE t1; +DROP TABLE t1; + +# TABLESPACE and STORAGE DISK +CREATE TABLE t1(a int) TABLESPACE ts STORAGE DISK ENGINE=MyISAM; +ALTER TABLE t1 ADD COLUMN b int; +SHOW CREATE TABLE t1; +DROP TABLE t1; + +# +# Check that the table options for TABLESPACE and STORAGE +# can be changed with an ALTER +# + +# TABLESPACE only +CREATE TABLE t1(a int) ENGINE=MyISAM; + +ALTER TABLE t1 TABLESPACE ts; +SHOW CREATE TABLE t1; + +ALTER TABLE t1 TABLESPACE ts2; +SHOW CREATE TABLE t1; + +DROP TABLE t1; + +# STORAGE only +CREATE TABLE t1(a int) ENGINE=MyISAM; + +ALTER TABLE t1 STORAGE MEMORY; +SHOW CREATE TABLE t1; + +ALTER TABLE t1 STORAGE DISK; +SHOW CREATE TABLE t1; + +DROP TABLE t1; + +# TABLESPACE and STORAGE +CREATE TABLE t1(a int) ENGINE=MyISAM; + +ALTER TABLE t1 STORAGE MEMORY TABLESPACE ts; +SHOW CREATE TABLE t1; + +ALTER TABLE t1 STORAGE DISK TABLESPACE ts2; +SHOW CREATE TABLE t1; + +DROP TABLE t1; + +# +# Check that it's possible to read a .frm fle created +# by MySQL Cluster 7.0(which introduced the new "format +# section) with this statement: +# +# CREATE TABLE cluster_7022_table +# ( +# a int primary key, +# b int, +# c int STORAGE DISK, +# d int STORAGE MEMORY NOT NULL, +# e int COLUMN_FORMAT DYNAMIC, +# f int COLUMN_FORMAT FIXED, +# g int COLUMN_FORMAT DEFAULT, +# h int STORAGE DISK COLUMN_FORMAT DYNAMIC NOT NULL, +# i int STORAGE MEMORY COLUMN_FORMAT DYNAMIC, +# j int STORAGE DISK COLUMN_FORMAT FIXED, +# k int STORAGE MEMORY COLUMN_FORMAT FIXED +# ) STORAGE DISK TABLESPACE the_tablespacename ENGINE=MyISAM; +# +# NOTE! The column level properties will not yet show up +# in SHOW CREATE TABLE of MySQL Server(although they are +# visible in .trace file) +# + +let $MYSQLD_DATADIR= `SELECT @@datadir`; +copy_file std_data/cluster_7022_table.frm $MYSQLD_DATADIR/test/t1.frm; +copy_file std_data/cluster_7022_table.MYD $MYSQLD_DATADIR/test/t1.MYD; +copy_file std_data/cluster_7022_table.MYI $MYSQLD_DATADIR/test/t1.MYI; + +SHOW CREATE TABLE t1; + +DROP TABLE t1; diff --git a/mysql-test/t/variables-notembedded.test b/mysql-test/t/variables-notembedded.test index 7cc068c68c7..b440cfa47b0 100644 --- a/mysql-test/t/variables-notembedded.test +++ b/mysql-test/t/variables-notembedded.test @@ -109,3 +109,30 @@ SET @@session.slave_skip_errors= 7; --error ER_INCORRECT_GLOBAL_LOCAL_VAR SET @@global.slave_skip_errors= 7; # + +--echo # +--echo # Bug #11766769 : 59959: SMALL VALUES OF --MAX-ALLOWED-PACKET +--echo # ARE NOT BEING HONORED +--echo # + +CREATE TABLE t1 (a MEDIUMTEXT); + +SET GLOBAL max_allowed_packet=2048; +SET GLOBAL net_buffer_length=4096; +CONNECT (con1,localhost,root,,test); +SHOW SESSION VARIABLES LIKE 'max_allowed_packet'; +SHOW SESSION VARIABLES LIKE 'net_buffer_length'; +--disable_query_log +--error ER_NET_PACKET_TOO_LARGE +INSERT INTO t1 VALUES ('123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); +--enable_query_log + +CONNECTION default; +DISCONNECT con1; +SELECT LENGTH(a) FROM t1; + +SET GLOBAL max_allowed_packet=default; +SET GLOBAL net_buffer_length=default; +DROP TABLE t1; + +--echo End of 5.1 tests diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 173f8aeaa58..ddf1170de93 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -1286,12 +1286,26 @@ SET @@global.key_cache_block_size=0; # select @@max_long_data_size; +--echo # +--echo # Bug#11766424 59527: DECIMAL_BIN_SIZE: ASSERTION `SCALE >= 0 && PRECISION > 0 && SCALE <= PRE +--echo # + +CREATE TABLE t1(f1 DECIMAL(1,1) UNSIGNED); +INSERT INTO t1 VALUES (0.2),(0.1); +SELECT 1 FROM t1 GROUP BY @a:= (SELECT ROUND(f1) FROM t1 WHERE @a=f1); +DROP TABLE t1; + +CREATE TABLE t1 AS SELECT @a:= CAST(1 AS UNSIGNED) AS a; +SHOW CREATE TABLE t1; +DROP TABLE t1; + # cleanup SET @@global.max_binlog_cache_size=DEFAULT; SET @@global.max_join_size=DEFAULT; SET @@global.key_buffer_size=@kbs; SET @@global.key_cache_block_size=@kcbs; + --echo End of 5.1 tests ########################################################################### |