diff options
author | Alexander Nozdrin <alik@sun.com> | 2010-05-28 09:47:58 +0400 |
---|---|---|
committer | Alexander Nozdrin <alik@sun.com> | 2010-05-28 09:47:58 +0400 |
commit | 4e633ec2342754594fad8937a2d12615e5e5cb96 (patch) | |
tree | 88543c956886365a2376e01ce26a0436c38a4454 /mysql-test | |
parent | 87dfc8ef1ddf9cfebf535fbfce70152ce3ee6c23 (diff) | |
parent | f54464035a4bfae7c7297e7fe1a8ba7e76ea6585 (diff) | |
download | mariadb-git-4e633ec2342754594fad8937a2d12615e5e5cb96.tar.gz |
Auto-merge from mysql-trunk.
Diffstat (limited to 'mysql-test')
125 files changed, 2507 insertions, 203 deletions
diff --git a/mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test b/mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test index 26a70c4319e..68aa949a7c7 100644 --- a/mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test +++ b/mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test @@ -214,7 +214,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB; # execute --error ER_DUP_ENTRY - UPDATE t3,t4 SET t3.a=t4.a + bug27417(1); + UPDATE t3,t4 SET t3.a = t4.a + bug27417(1) where t3.a = 1; # check select count(*) from t1 /* must be 1 */; diff --git a/mysql-test/extra/rpl_tests/rpl_record_compare.test b/mysql-test/extra/rpl_tests/rpl_record_compare.test new file mode 100644 index 00000000000..dc27dcb1f9d --- /dev/null +++ b/mysql-test/extra/rpl_tests/rpl_record_compare.test @@ -0,0 +1,68 @@ + +# +# BUG#52868: Wrong handling of NULL value during update, replication out of sync +# +-- echo ## case #1 - last_null_bit_pos==0 in record_compare without X bit + +-- source include/master-slave-reset.inc +-- connection master + +-- eval 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=$engine DEFAULT CHARSET=latin1 + +INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 ); +INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 ); +-- disable_warnings +UPDATE t1 SET c5 = 'a'; +-- enable_warnings +-- sync_slave_with_master + +-- let $diff_table_1= master:test.t1 +-- let $diff_table_2= slave:test.t1 +-- source include/diff_tables.inc + +--connection master +DROP TABLE t1; +-- sync_slave_with_master + +-- echo ## case #1.1 - last_null_bit_pos==0 in record_compare with X bit +-- echo ## (1 column less and no varchar) +-- source include/master-slave-reset.inc +-- connection master + +-- eval CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 bigint(20) DEFAULT 0, c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0) ENGINE=$engine DEFAULT CHARSET=latin1 + +INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 ); +INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 ); +-- disable_warnings +UPDATE t1 SET c5 = 'a'; +-- enable_warnings +-- sync_slave_with_master + +-- let $diff_table_1= master:test.t1 +-- let $diff_table_2= slave:test.t1 +-- source include/diff_tables.inc + +--connection master +DROP TABLE t1; +-- sync_slave_with_master + +-- echo ## case #2 - X bit is wrongly set. + +-- source include/master-slave-reset.inc +-- connection master + +-- eval CREATE TABLE t1 (c1 int, c2 varchar(1) default '') ENGINE=$engine DEFAULT CHARSET= latin1 +INSERT INTO t1(c1) VALUES (10); +INSERT INTO t1(c1) VALUES (NULL); +UPDATE t1 SET c1= 0; +-- sync_slave_with_master + +-- let $diff_table_1= master:test.t1 +-- let $diff_table_2= slave:test.t1 +-- source include/diff_tables.inc + +-- connection master +DROP TABLE t1; +-- sync_slave_with_master + + diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 58a289422f4..68955010696 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -3811,6 +3811,7 @@ sub extract_warning_lines ($$) { # Skip valgrind summary from tests where server has been restarted # Should this contain memory leaks, the final report will find it $skip_valgrind= 1 if $line =~ /^==\d+== ERROR SUMMARY:/; + $skip_valgrind= 1 if $line =~ /^==\d+== HEAP SUMMARY:/; $skip_valgrind= 0 unless $line =~ /^==\d+==/; next if $skip_valgrind; } diff --git a/mysql-test/r/archive.result b/mysql-test/r/archive.result index 783a54a6b8c..88f38a13b4a 100644 --- a/mysql-test/r/archive.result +++ b/mysql-test/r/archive.result @@ -12748,3 +12748,22 @@ SELECT * FROM t1; ERROR HY000: Can't find file: 't1' (errno: 2) DROP TABLE t1; ERROR 42S02: Unknown table 't1' +# +# BUG#46565 - repair of partition fail for archive engine +# +# Installing corrupted table files for t1. +SELECT * FROM t1; +ERROR HY000: Table 't1' is marked as crashed and should be repaired +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair error Corrupt +SELECT * FROM t1; +ERROR HY000: Table 't1' is marked as crashed and should be repaired +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +SELECT * FROM t1; +a +1 +2 +DROP TABLE t1; diff --git a/mysql-test/r/bug46261.result b/mysql-test/r/bug46261.result new file mode 100644 index 00000000000..f54b698e08f --- /dev/null +++ b/mysql-test/r/bug46261.result @@ -0,0 +1,8 @@ +# +# Bug#46261 Plugins can be installed with --skip-grant-tables +# +INSTALL PLUGIN example SONAME 'ha_example.so'; +ERROR HY000: The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement +UNINSTALL PLUGIN example; +ERROR HY000: The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement +End of 5.1 tests diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index 324848be835..4f033d54043 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -1230,6 +1230,14 @@ SELECT HEX(DAYNAME(19700101)); HEX(DAYNAME(19700101)) 0427043504420432043504400433 SET character_set_connection=latin1; +# +# Bug#52120 create view cause Assertion failed: 0, file .\item_subselect.cc, line 817 +# +CREATE TABLE t1 (a CHAR(1) CHARSET ascii, b CHAR(1) CHARSET latin1); +CREATE VIEW v1 AS SELECT 1 from t1 +WHERE t1.b <=> (SELECT a FROM t1 WHERE a < SOME(SELECT '1')); +DROP VIEW v1; +DROP TABLE t1; End of 5.0 tests # # Start of 5.5 tests diff --git a/mysql-test/r/delete.result b/mysql-test/r/delete.result index 733614b765a..0c9b0d7d2e5 100644 --- a/mysql-test/r/delete.result +++ b/mysql-test/r/delete.result @@ -490,4 +490,13 @@ END | DELETE IGNORE FROM t1; ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger. DROP TABLE t1; +# +# Bug #53450: Crash/assertion +# "virtual int ha_myisam::index_first(uchar*)") at assert.c:81 +# +CREATE TABLE t1 (a INT, b INT, c INT, +INDEX(a), INDEX(b), INDEX(c)); +INSERT INTO t1 VALUES (1,2,3), (4,5,6), (7,8,9); +DELETE FROM t1 WHERE a = 10 OR b = 20 ORDER BY c LIMIT 1; +DROP TABLE t1; End of 5.1 tests diff --git a/mysql-test/r/error_simulation.result b/mysql-test/r/error_simulation.result index 6153dad2534..27e51a33112 100644 --- a/mysql-test/r/error_simulation.result +++ b/mysql-test/r/error_simulation.result @@ -18,3 +18,26 @@ SELECT MAX(a) FROM t1 GROUP BY a,b; ERROR 23000: Can't write; duplicate key in table 'tmp_table' set tmp_table_size=default; DROP TABLE t1; +# +# Bug #50946: fast index creation still seems to copy the table +# +CREATE TABLE t1 (a INT(100) NOT NULL); +INSERT INTO t1 VALUES (1), (0), (2); +SET SESSION debug='+d,alter_table_only_index_change'; +ALTER TABLE t1 ADD INDEX a(a); +SET SESSION debug=DEFAULT; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(100) NOT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT * FROM t1; +a +0 +1 +2 +DROP TABLE t1; +# +# End of 5.1 tests +# diff --git a/mysql-test/r/explain.result b/mysql-test/r/explain.result index 9740303c00e..7042a2c6f6c 100644 --- a/mysql-test/r/explain.result +++ b/mysql-test/r/explain.result @@ -246,4 +246,16 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1003 select '1' AS `f1`,`test`.`t2`.`f2` AS `f2` from `test`.`t2` where (`test`.`t2`.`f2` = 1) drop table t1,t2; +# +# Bug #48419: another explain crash.. +# +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (b BLOB, KEY b(b(100))); +INSERT INTO t2 VALUES ('1'), ('2'), ('3'); +FLUSH TABLES; +EXPLAIN SELECT 1 FROM t1 WHERE a = (SELECT 1 FROM t1 t JOIN t2 WHERE b <= 1 AND t.a); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +DROP TABLE t1, t2; End of 5.1 tests. diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index 1d9fa20f673..a75f502c735 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -639,4 +639,17 @@ CREATE TABLE t1(a CHAR(1),FULLTEXT(a)); SELECT 1 FROM t1 WHERE MATCH(a) AGAINST ('') AND ROW(a,a) > ROW(1,1); 1 DROP TABLE t1; +# +# BUG#51866 - crash with repair by sort and fulltext keys +# +CREATE TABLE t1(a CHAR(4), FULLTEXT(a)); +INSERT INTO t1 VALUES('aaaa'); +SET myisam_sort_buffer_size=4; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '4' +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair status OK +SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size; +DROP TABLE t1; End of 5.1 tests diff --git a/mysql-test/r/func_concat.result b/mysql-test/r/func_concat.result index c4c2b46c6c2..fae8979a6e7 100644 --- a/mysql-test/r/func_concat.result +++ b/mysql-test/r/func_concat.result @@ -130,4 +130,22 @@ SELECT @query; @query abcde,0,1234 DROP PROCEDURE p1; +# +# Bug #40625: Concat fails on DOUBLE values in a Stored Procedure, +# while DECIMAL works +# +CREATE PROCEDURE p1() +BEGIN +DECLARE v1 DOUBLE(10,3); +SET v1= 100; +SET @s = CONCAT('########################################', 40 , v1); +SELECT @s; +END;// +CALL p1(); +@s +########################################40100.000 +CALL p1(); +@s +########################################40100.000 +DROP PROCEDURE p1; # End of 5.1 tests diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index 2d2ca10f54b..1a393b3cdd5 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -1003,6 +1003,21 @@ SELECT 1 FROM 1 1 DROP TABLE t1; +# +# Bug #52397: another crash with explain extended and group_concat +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (0), (0); +EXPLAIN EXTENDED SELECT 1 FROM +(SELECT GROUP_CONCAT(t1.a ORDER BY t1.a ASC) FROM +t1 t2, t1 GROUP BY t1.a) AS d; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY <derived2> system NULL NULL NULL NULL 1 100.00 +2 DERIVED t2 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort +2 DERIVED t1 ALL NULL NULL NULL NULL 2 100.00 Using join buffer +Warnings: +Note 1003 select 1 AS `1` from dual +DROP TABLE t1; End of 5.0 tests DROP TABLE IF EXISTS t1, t2; CREATE TABLE t1 (a VARCHAR(6), b INT); diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 39e2cdc97ba..7539cf43dd9 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -2590,6 +2590,20 @@ FROM t2 WHERE t2.b = 1 GROUP BY t2.b; DECODE((SELECT ENCODE('secret', t1.a) FROM t1,t2 WHERE t1.a = t2.a GROUP BY t1.b LIMIT 1), t2.a) secret DROP TABLE t1, t2; +# +# Bug#52164 Assertion failed: param.sort_length, file .\filesort.cc, line 149 +# +CREATE TABLE t1 (a LONGBLOB NOT NULL); +INSERT INTO t1 VALUES (''),(''); +SELECT 1 FROM t1, t1 t2 +ORDER BY QUOTE(t1.a); +1 +1 +1 +1 +1 +DROP TABLE t1; +End of 5.1 tests Start of 5.4 tests SELECT format(12345678901234567890.123, 3); format(12345678901234567890.123, 3) diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result index 58c603673df..eb9c350f589 100644 --- a/mysql-test/r/gis-rtree.result +++ b/mysql-test/r/gis-rtree.result @@ -1540,5 +1540,12 @@ a HANDLER t1 READ a LAST; a HANDLER t1 CLOSE; +HANDLER t1 OPEN; +HANDLER t1 READ a FIRST; +a +INSERT INTO t1 VALUES (GeomFromText('Polygon((40 40,60 40,60 60,40 60,40 40))')); +# should not crash +HANDLER t1 READ a NEXT; +HANDLER t1 CLOSE; DROP TABLE t1; End of 5.0 tests. diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index b182ee5656c..65ebbd71c39 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -1437,6 +1437,22 @@ SHOW GRANTS FOR mysqltest_1; Grants for mysqltest_1@% GRANT ALL PRIVILEGES ON *.* TO 'mysqltest_1'@'%' DROP USER mysqltest_1; +CREATE DATABASE db1; +CREATE DATABASE db2; +GRANT SELECT ON db1.* to 'testbug'@localhost; +USE db2; +CREATE TABLE t1 (a INT); +USE test; +SELECT * FROM `../db2/tb2`; +ERROR 42S02: Table 'db1.../db2/tb2' doesn't exist +SELECT * FROM `../db2`.tb2; +ERROR 42000: SELECT command denied to user 'testbug'@'localhost' for table 'tb2' +SELECT * FROM `#mysql50#/../db2/tb2`; +ERROR 42S02: Table 'db1.#mysql50#/../db2/tb2' doesn't exist +DROP USER 'testbug'@localhost; +DROP TABLE db2.t1; +DROP DATABASE db1; +DROP DATABASE db2; ######################################################################### # # Bug#38347: ALTER ROUTINE privilege allows SHOW CREATE TABLE. diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index 9d16e0fb3c5..cdf48376fb0 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -1791,4 +1791,24 @@ aa b COUNT( b) 1 10 1 DROP TABLE t1, t2; # +# Bug#52051: Aggregate functions incorrectly returns NULL from outer +# join query +# +CREATE TABLE t1 (a INT PRIMARY KEY); +CREATE TABLE t2 (a INT PRIMARY KEY); +INSERT INTO t2 VALUES (1), (2); +EXPLAIN SELECT MIN(t2.a) FROM t2 LEFT JOIN t1 ON t2.a = t1.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +SELECT MIN(t2.a) FROM t2 LEFT JOIN t1 ON t2.a = t1.a; +MIN(t2.a) +1 +EXPLAIN SELECT MAX(t2.a) FROM t2 LEFT JOIN t1 ON t2.a = t1.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +SELECT MAX(t2.a) FROM t2 LEFT JOIN t1 ON t2.a = t1.a; +MAX(t2.a) +2 +DROP TABLE t1, t2; +# # End of 5.1 tests diff --git a/mysql-test/r/handler_myisam.result b/mysql-test/r/handler_myisam.result index 2625222ec1a..028397b0b24 100644 --- a/mysql-test/r/handler_myisam.result +++ b/mysql-test/r/handler_myisam.result @@ -1721,4 +1721,17 @@ TRUNCATE t1; HANDLER t1 READ FIRST; ERROR 42S02: Unknown table 't1' in HANDLER DROP TABLE t1; +# +# BUG#51877 - HANDLER interface causes invalid memory read +# +CREATE TABLE t1(a INT, KEY(a)); +HANDLER t1 OPEN; +HANDLER t1 READ a FIRST; +a +INSERT INTO t1 VALUES(1); +HANDLER t1 READ a NEXT; +a +1 +HANDLER t1 CLOSE; +DROP TABLE t1; End of 5.1 tests diff --git a/mysql-test/r/having.result b/mysql-test/r/having.result index bedccfc0f04..c69de0f307b 100644 --- a/mysql-test/r/having.result +++ b/mysql-test/r/having.result @@ -472,7 +472,7 @@ HAVING (table2.f2 = 8 AND table1.f1 >= 6); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible HAVING noticed after reading const tables Warnings: -Note 1003 select `test`.`table1`.`f1` AS `f1`,'7' AS `f2` from `test`.`t1` `table1` join `test`.`t1` `table2` where ((`test`.`table1`.`f3` = '9')) group by `test`.`table1`.`f1`,'7' having (('7' = 8) and (`test`.`table1`.`f1` >= 6)) +Note 1003 select `test`.`table1`.`f1` AS `f1`,'7' AS `f2` from `test`.`t1` `table1` join `test`.`t1` `table2` where ((`test`.`table1`.`f3` = '9')) group by `test`.`table1`.`f1`,'7' having 0 EXPLAIN EXTENDED SELECT table1.f1, table2.f2 FROM t1 AS table1 @@ -483,6 +483,52 @@ HAVING (table2.f2 = 8); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible HAVING noticed after reading const tables Warnings: -Note 1003 select `test`.`table1`.`f1` AS `f1`,'7' AS `f2` from `test`.`t1` `table1` join `test`.`t1` `table2` where ((`test`.`table1`.`f3` = '9')) group by `test`.`table1`.`f1`,'7' having ('7' = 8) +Note 1003 select `test`.`table1`.`f1` AS `f1`,'7' AS `f2` from `test`.`t1` `table1` join `test`.`t1` `table2` where ((`test`.`table1`.`f3` = '9')) group by `test`.`table1`.`f1`,'7' having 0 DROP TABLE t1; +# +# Bug#52336 Segfault / crash in 5.1 copy_fields (param=0x9872980) at sql_select.cc:15355 +# +CREATE TABLE t1(f1 INT, f2 INT); +INSERT INTO t1 VALUES (10,8); +CREATE TABLE t2 (f1 INT); +INSERT INTO t2 VALUES (5); +SELECT COUNT(f1) FROM t2 +HAVING (7, 9) IN (SELECT f1, MIN(f2) FROM t1); +COUNT(f1) +DROP TABLE t1, t2; +CREATE TABLE t1 (f1 INT, f2 VARCHAR(1)); +INSERT INTO t1 VALUES (16,'f'); +INSERT INTO t1 VALUES (16,'f'); +CREATE TABLE t2 (f1 INT, f2 VARCHAR(1)); +INSERT INTO t2 VALUES (13,'f'); +INSERT INTO t2 VALUES (20,'f'); +CREATE TABLE t3 (f1 INT, f2 VARCHAR(1)); +INSERT INTO t3 VALUES (7,'f'); +SELECT t1.f2 FROM t1 +STRAIGHT_JOIN (t2 JOIN t3 ON t3.f2 = t2.f2 ) ON t3 .f2 = t2 .f2 +HAVING ('v', 'i') NOT IN (SELECT f2, MIN(f2) FROM t1) +ORDER BY f2; +f2 +f +f +f +f +DROP TABLES t1,t2,t3; +# +# Bug#52340 Segfault: read_cached_record (tab=0x94a2634) at sql_select.cc:14411 +# +CREATE TABLE t1 (f1 INT, f2 VARCHAR(1)); +INSERT INTO t1 VALUES (16,'d'); +CREATE TABLE t2 (f1 INT, f2 VARCHAR(1)); +INSERT INTO t2 VALUES (13,'e'); +INSERT INTO t2 VALUES (20,'d'); +SELECT MAX(t2.f2) FROM t2 JOIN t1 ON t1.f2 +HAVING ('e' , 'd') IN +(SELECT ts1.f2, ts2.f2 FROM t2 ts1 JOIN t2 ts2 ON ts1.f1) +ORDER BY t1.f2; +MAX(t2.f2) +NULL +Warnings: +Warning 1292 Truncated incorrect INTEGER value: 'd' +DROP TABLE t1,t2; End of 5.0 tests diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result index 0a3df1f99b5..1845b32564d 100644 --- a/mysql-test/r/innodb_mysql.result +++ b/mysql-test/r/innodb_mysql.result @@ -2355,6 +2355,64 @@ Index_type BTREE Comment Index_comment DROP TABLE t1; +# +# Bug #47453: InnoDB incorrectly changes TIMESTAMP columns when +# JOINed during an UPDATE +# +CREATE TABLE t1 (d INT) ENGINE=InnoDB; +CREATE TABLE t2 (a INT, b INT, +c TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +ON UPDATE CURRENT_TIMESTAMP) ENGINE=InnoDB; +set up our data elements +INSERT INTO t1 (d) VALUES (1); +INSERT INTO t2 (a,b) VALUES (1,1); +SELECT SECOND(c) INTO @bug47453 FROM t2; +SELECT SECOND(c)-@bug47453 FROM t1 JOIN t2 ON d=a; +SECOND(c)-@bug47453 +0 +UPDATE t1 JOIN t2 ON d=a SET b=1 WHERE a=1; +SELECT SECOND(c)-@bug47453 FROM t1 JOIN t2 ON d=a; +SECOND(c)-@bug47453 +0 +SELECT SLEEP(1); +SLEEP(1) +0 +UPDATE t1 JOIN t2 ON d=a SET b=1 WHERE a=1; +#should be 0 +SELECT SECOND(c)-@bug47453 FROM t1 JOIN t2 ON d=a; +SECOND(c)-@bug47453 +0 +DROP TABLE t1, t2; +# +# Bug #53334: wrong result for outer join with impossible ON condition +# (see the same test case for MyISAM in join.test) +# +CREATE TABLE t1 (id INT PRIMARY KEY); +CREATE TABLE t2 (id INT); +INSERT INTO t1 VALUES (75); +INSERT INTO t1 VALUES (79); +INSERT INTO t1 VALUES (78); +INSERT INTO t1 VALUES (77); +REPLACE INTO t1 VALUES (76); +REPLACE INTO t1 VALUES (76); +INSERT INTO t1 VALUES (104); +INSERT INTO t1 VALUES (103); +INSERT INTO t1 VALUES (102); +INSERT INTO t1 VALUES (101); +INSERT INTO t1 VALUES (105); +INSERT INTO t1 VALUES (106); +INSERT INTO t1 VALUES (107); +INSERT INTO t2 VALUES (107),(75),(1000); +SELECT t1.id,t2.id FROM t2 LEFT JOIN t1 ON t1.id>=74 AND t1.id<=0 +WHERE t2.id=75 AND t1.id IS NULL; +id id +NULL 75 +EXPLAIN SELECT t1.id,t2.id FROM t2 LEFT JOIN t1 ON t1.id>=74 AND t1.id<=0 +WHERE t2.id=75 AND t1.id IS NULL; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 const PRIMARY NULL NULL NULL 1 Impossible ON condition +1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where +DROP TABLE t1,t2; End of 5.1 tests # # Test for bug #39932 "create table fails if column for FK is in different diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result index d1234ecbd56..9f87ea082db 100644 --- a/mysql-test/r/join.result +++ b/mysql-test/r/join.result @@ -1117,6 +1117,45 @@ ON t4.a = t5.a ON t1.a = t3.a; a a a a a a DROP TABLE t1,t2,t3,t4,t5,t6; +# +# Bug#48483: crash in get_best_combination() +# +CREATE TABLE t1(f1 INT); +INSERT INTO t1 VALUES (1),(2); +CREATE VIEW v1 AS SELECT 1 FROM t1 LEFT JOIN t1 AS t2 on 1=1; +EXPLAIN EXTENDED +SELECT 1 FROM v1 right join v1 AS v2 ON RAND(); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 +1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 +1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 +Warnings: +Note 1003 select 1 AS `1` from `test`.`t1` left join `test`.`t1` `t2` on((1 = 1)) left join (`test`.`t1` left join `test`.`t1` `t2` on((1 = 1))) on(rand()) where 1 +DROP VIEW v1; +DROP TABLE t1; +# +# Bug#52177 crash with explain, row comparison, join, text field +# +CREATE TABLE t1 (a TINYINT, b TEXT, KEY (a)); +INSERT INTO t1 VALUES (0,''),(0,''); +FLUSH TABLES; +EXPLAIN SELECT 1 FROM t1 LEFT JOIN t1 a ON 1 +WHERE ROW(t1.a, 1111.11) = ROW(1111.11, 1111.11) AND +ROW(t1.b, 1111.11) <=> ROW('',''); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +DROP TABLE t1; +# +# Bug #50335: Assertion `!(order->used & map)' in eq_ref_table +# +CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, PRIMARY KEY (a,b)); +INSERT INTO t1 VALUES (0,0), (1,1); +SELECT * FROM t1 STRAIGHT_JOIN t1 t2 ON t1.a=t2.a AND t1.a=t2.b ORDER BY t2.a, t1.a; +a b a b +0 0 0 0 +1 1 1 1 +DROP TABLE t1; End of 5.0 tests. CREATE TABLE t1 (f1 int); CREATE TABLE t2 (f1 int); @@ -1145,14 +1184,4 @@ NULL NULL 1 DROP TABLE t1, t2, mm1; -# -# Bug #50335: Assertion `!(order->used & map)' in eq_ref_table -# -CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, PRIMARY KEY (a,b)); -INSERT INTO t1 VALUES (0,0), (1,1); -SELECT * FROM t1 STRAIGHT_JOIN t1 t2 ON t1.a=t2.a AND t1.a=t2.b ORDER BY t2.a, t1.a; -a b a b -0 0 0 0 -1 1 1 1 -DROP TABLE t1; End of 5.1 tests diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result index 461a553d3f0..17363cbc989 100644 --- a/mysql-test/r/join_outer.result +++ b/mysql-test/r/join_outer.result @@ -1312,4 +1312,34 @@ WHERE (COALESCE(t1.f1, t2.f1), f3) IN ((1, 3), (2, 2)); f1 f2 f3 f1 f2 1 NULL 3 NULL NULL DROP TABLE t1, t2; +# +# Bug#52357: Assertion failed: join->best_read in greedy_search +# optimizer_search_depth=0 +# +CREATE TABLE t1( a INT ); +INSERT INTO t1 VALUES (1),(2); +SET optimizer_search_depth = 0; +# Should not core dump on query preparation +EXPLAIN +SELECT 1 +FROM t1 tt3 LEFT OUTER JOIN t1 tt4 ON 1 +LEFT OUTER JOIN t1 tt5 ON 1 +LEFT OUTER JOIN t1 tt6 ON 1 +LEFT OUTER JOIN t1 tt7 ON 1 +LEFT OUTER JOIN t1 tt8 ON 1 +RIGHT OUTER JOIN t1 tt2 ON 1 +RIGHT OUTER JOIN t1 tt1 ON 1 +STRAIGHT_JOIN t1 tt9 ON 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE tt1 ALL NULL NULL NULL NULL 2 +1 SIMPLE tt2 ALL NULL NULL NULL NULL 2 +1 SIMPLE tt3 ALL NULL NULL NULL NULL 2 +1 SIMPLE tt4 ALL NULL NULL NULL NULL 2 +1 SIMPLE tt5 ALL NULL NULL NULL NULL 2 +1 SIMPLE tt6 ALL NULL NULL NULL NULL 2 +1 SIMPLE tt7 ALL NULL NULL NULL NULL 2 +1 SIMPLE tt8 ALL NULL NULL NULL NULL 2 +1 SIMPLE tt9 ALL NULL NULL NULL NULL 2 Using join buffer +SET optimizer_search_depth = DEFAULT; +DROP TABLE t1; End of 5.1 tests diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result index 5e25132880f..7a79603adb3 100644 --- a/mysql-test/r/loaddata.result +++ b/mysql-test/r/loaddata.result @@ -202,12 +202,6 @@ select * from t1; a b c 10 NULL Ten 15 NULL Fifteen -show variables like "secure_file_pri%"; -Variable_name Value -secure_file_priv MYSQLTEST_VARDIR/ -select @@secure_file_priv; -@@secure_file_priv -MYSQLTEST_VARDIR/ set @@secure_file_priv= 0; ERROR HY000: Variable 'secure_file_priv' is a read only variable truncate table t1; @@ -456,6 +450,13 @@ LOAD_FILE("MYSQLTEST_VARDIR/tmp/bug37114.txt") set session sql_mode=@OLD_SQL_MODE; DROP TABLE t1,t2; +# +# Bug #51893: crash with certain characters given to load_file +# function on windows +# +select load_file(0x0A9FB76C661B409C4BEC88098C5DD71B1072F9691F2E827D7EC8F092B299868A3CE196C04F0FB18CAB4E1557EB72331D812379DE7A75CA21C32E7C722C59E5CC33EF262EF04187B0F0EE756FA984DF2EAD37B1E4ADB064C3C5038F2E3B2D661B1C1150AAEB5425512E14D7506166D92D4533872E662F4B2D1428AAB5CCA72E75AA2EF325E196A5A02E2E8278873C64375845994B0F39BE2FF7B478332A7B0AA5E48877C47B6F513E997848AF8CCB8A899F3393AB35333CF0871E36698193862D486B4B9078B70C0A0A507B8A250F3F876F5A067632D5E65193E4445A1EC3A2C9B4C6F07AC334F0F62BC33357CB502E9B1C19D2398B6972AEC2EF21630F8C9134C4F7DD662D8AD7BDC9E19C46720F334B66C22D4BF32ED275144E20E7669FFCF6FC143667C9F02A577F32960FA9F2371BE1FA90E49CBC69C01531F140556854D588DD0E55E1307D78CA38E975CD999F9AEA604266329EE62BFB5ADDA67F549E211ECFBA906C60063696352ABB82AA782D25B17E872EA587871F450446DB1BAE0123D20404A8F2D2698B371002E986C8FCB969A99FF0E150A2709E2ED7633D02ADA87D5B3C9487D27B2BD9D21E2EC3215DCC3CDCD884371281B95A2E9987AAF82EB499C058D9C3E7DC1B66635F60DB121C72F929622DD47B6B2E69F59FF2AE6B63CC2EC60FFBA20EA50569DBAB5DAEFAEB4F03966C9637AB55662EDD28439155A82D053A5299448EDB2E7BEB0F62889E2F84E6C7F34B3212C9AAC32D521D5AB8480993F1906D5450FAB342A0FA6ED223E178BAC036B81E15783604C32A961EA1EF20BE2EBB93D34ED37BC03142B7583303E4557E48551E4BD7CBDDEA146D5485A5D212C35189F0BD6497E66912D2780A59A53B532E12C0A5ED1EC0445D96E8F2DD825221CFE4A65A87AA21DC8750481B9849DD81694C3357A0ED9B78D608D8EDDE28FAFBEC17844DE5709F41E121838DB55639D77E32A259A416D7013B2EB1259FDE1B498CBB9CAEE1D601DF3C915EA91C69B44E6B72062F5F4B3C73F06F2D5AD185E1692E2E0A01E7DD5133693681C52EE13B2BE42D03BDCF48E4E133CF06662339B778E1C3034F9939A433E157449172F7969ACCE1F5D2F65A4E09E4A5D5611EBEDDDBDB0C0C0A); +load_file(0x0A9FB76C661B409C4BEC88098C5DD71B1072F9691F2E827D7EC8F092B299868A3CE196C04F0FB18CAB4E1557EB72331D812379DE7A75CA21C32E7C722C59E5CC33EF262EF04187B0F0EE756FA984DF2EAD37B1E4ADB064C3C5038F2E3B2D661B1C1150AAEB5425512E14D7506166D92D4533872E662F4B2D142 +NULL End of 5.0 tests CREATE TABLE t1 (a int); INSERT INTO t1 VALUES (1); @@ -484,4 +485,15 @@ SET character_set_filesystem=default; select @@character_set_filesystem; @@character_set_filesystem binary +# +# Bug #51850: crash/memory overlap when using load data infile and set +# col equal to itself! +# +CREATE TABLE t1(col0 LONGBLOB); +SELECT 'test' INTO OUTFILE 't1.txt'; +LOAD DATA INFILE 't1.txt' IGNORE INTO TABLE t1 SET col0=col0; +SELECT * FROM t1; +col0 +test +DROP TABLE t1; End of 5.1 tests diff --git a/mysql-test/r/log_state.result b/mysql-test/r/log_state.result index 56e30ac59f8..714a14c1f4f 100644 --- a/mysql-test/r/log_state.result +++ b/mysql-test/r/log_state.result @@ -308,6 +308,37 @@ SET @@global.general_log = @old_general_log; SET @@global.general_log_file = @old_general_log_file; SET @@global.slow_query_log = @old_slow_query_log; SET @@global.slow_query_log_file = @old_slow_query_log_file; +# +# Bug #49756 Rows_examined is always 0 in the slow query log +# for update statements +# +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = "TABLE"; +SET GLOBAL slow_query_log = ON; +SET GLOBAL long_query_time = 0.001; +TRUNCATE TABLE mysql.slow_log; +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (b INT, PRIMARY KEY (b)); +INSERT INTO t2 VALUES (3),(4); +INSERT INTO t1 VALUES (1+sleep(.01)),(2); +INSERT INTO t1 SELECT b+sleep(.01) from t2; +UPDATE t1 SET a=a+sleep(.01) WHERE a>2; +UPDATE t1 SET a=a+sleep(.01) ORDER BY a DESC; +UPDATE t2 set b=b+sleep(.01) limit 1; +UPDATE t1 SET a=a+sleep(.01) WHERE a in (SELECT b from t2); +DELETE FROM t1 WHERE a=a+sleep(.01) ORDER BY a LIMIT 2; +SELECT rows_examined,sql_text FROM mysql.slow_log; +rows_examined sql_text +0 INSERT INTO t1 VALUES (1+sleep(.01)),(2) +2 INSERT INTO t1 SELECT b+sleep(.01) from t2 +4 UPDATE t1 SET a=a+sleep(.01) WHERE a>2 +8 UPDATE t1 SET a=a+sleep(.01) ORDER BY a DESC +2 UPDATE t2 set b=b+sleep(.01) limit 1 +4 UPDATE t1 SET a=a+sleep(.01) WHERE a in (SELECT b from t2) +6 DELETE FROM t1 WHERE a=a+sleep(.01) ORDER BY a LIMIT 2 +DROP TABLE t1,t2; +TRUNCATE TABLE mysql.slow_log; +# end of bug#49756 End of 5.1 tests # -- @@ -334,6 +365,8 @@ SELECT @@general_log_file = @my_glf; 1 SET GLOBAL general_log_file = @old_general_log_file; # Close connection con1 +SET GLOBAL long_query_time = DEFAULT; +SET GLOBAL log_output = @old_log_output; SET global general_log = @old_general_log; SET global general_log_file = @old_general_log_file; SET global slow_query_log = @old_slow_query_log; diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index fa0233ac3a0..e366c5d1110 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -2315,6 +2315,8 @@ INSERT INTO t1 SELECT a+1280,b FROM t1; INSERT INTO t1 SELECT a+2560,b FROM t1; INSERT INTO t1 SELECT a+5120,b FROM t1; SET myisam_sort_buffer_size=4; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '4' REPAIR TABLE t1; Table Op Msg_type Msg_text test.t1 repair error myisam_sort_buffer_size is too small @@ -2365,6 +2367,8 @@ CREATE TABLE t1(a CHAR(255), KEY(a)); SELECT * FROM t1, t1 AS a1; a a SET myisam_sort_buffer_size=4; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '4' INSERT INTO t1 VALUES ('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), ('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result index 55e68e9f8f3..e728eb8244d 100644 --- a/mysql-test/r/mysqlbinlog.result +++ b/mysql-test/r/mysqlbinlog.result @@ -720,7 +720,7 @@ FLUSH LOGS; RESET MASTER; FLUSH LOGS; # -# Test if the 'BEGIN', 'ROLLBACK' and 'COMMIT' are output if the database specified is exist +# Test if the 'BEGIN', 'ROLLBACK' and 'COMMIT' are output if the database specified exists /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -773,7 +773,7 @@ DELIMITER ; ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; # -# Test if the 'BEGIN', 'ROLLBACK' and 'COMMIT' are output if the database specified is not exist +# Test if the 'BEGIN', 'ROLLBACK' and 'COMMIT' are output if the database specified does not exist /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -806,5 +806,76 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +# +# Test if the 'SAVEPOINT', 'ROLLBACK TO' are output if the database specified exists +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; +DELIMITER /*!*/; +SET TIMESTAMP=1266652094/*!*/; +SET @@session.pseudo_thread_id=999999999/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.sql_mode=0/*!*/; +SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +SET @@session.lc_time_names=0/*!*/; +SET @@session.collation_database=DEFAULT/*!*/; +BEGIN +/*!*/; +use test/*!*/; +SET TIMESTAMP=1266652094/*!*/; +SavePoint mixed_cases +/*!*/; +use db1/*!*/; +SET TIMESTAMP=1266652094/*!*/; +INSERT INTO db1.t2 VALUES("in savepoint mixed_cases") +/*!*/; +SET TIMESTAMP=1266652094/*!*/; +INSERT INTO db1.t1 VALUES(40) +/*!*/; +use test/*!*/; +SET TIMESTAMP=1266652094/*!*/; +ROLLBACK TO mixed_cases +/*!*/; +use db1/*!*/; +SET TIMESTAMP=1266652094/*!*/; +INSERT INTO db1.t2 VALUES("after rollback to") +/*!*/; +SET TIMESTAMP=1266652094/*!*/; +INSERT INTO db1.t1 VALUES(50) +/*!*/; +COMMIT/*!*/; +DELIMITER ; +# End of log file +ROLLBACK /* added by mysqlbinlog */; +/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +# +# Test if the 'SAVEPOINT', 'ROLLBACK TO' are output if the database specified does not exist +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; +DELIMITER /*!*/; +SET TIMESTAMP=1266652094/*!*/; +SET @@session.pseudo_thread_id=999999999/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.sql_mode=0/*!*/; +SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +SET @@session.lc_time_names=0/*!*/; +SET @@session.collation_database=DEFAULT/*!*/; +BEGIN +/*!*/; +use test/*!*/; +SET TIMESTAMP=1266652094/*!*/; +SavePoint mixed_cases +/*!*/; +SET TIMESTAMP=1266652094/*!*/; +ROLLBACK TO mixed_cases +/*!*/; +COMMIT/*!*/; +DELIMITER ; +# End of log file +ROLLBACK /* added by mysqlbinlog */; +/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; End of 5.0 tests End of 5.1 tests diff --git a/mysql-test/r/mysqld--help-notwin.result b/mysql-test/r/mysqld--help-notwin.result index 16b493cafec..5f1a25324ed 100644 --- a/mysql-test/r/mysqld--help-notwin.result +++ b/mysql-test/r/mysqld--help-notwin.result @@ -901,6 +901,7 @@ secure-file-priv (No default value) server-id 0 show-slave-auth-info FALSE skip-grant-tables TRUE +skip-name-resolve FALSE skip-networking FALSE skip-show-database FALSE skip-slave-start FALSE diff --git a/mysql-test/r/mysqld--help-win.result b/mysql-test/r/mysqld--help-win.result index ee2bcb51b04..5d517f06add 100644 --- a/mysql-test/r/mysqld--help-win.result +++ b/mysql-test/r/mysqld--help-win.result @@ -907,6 +907,7 @@ shared-memory FALSE shared-memory-base-name MYSQL show-slave-auth-info FALSE skip-grant-tables TRUE +skip-name-resolve FALSE skip-networking FALSE skip-show-database FALSE skip-slave-start FALSE diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 5bb0524e187..892501f2b28 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -4561,5 +4561,20 @@ a b c SET NAMES default; DROP TABLE t1, t2; # +# Bug #53088: mysqldump with -T & --default-character-set set +# truncates text/blob to 766 chars +# +# Also see outfile_loaddata.test +# +CREATE TABLE t1 (a BLOB) CHARSET latin1; +CREATE TABLE t2 LIKE t1; +INSERT INTO t1 VALUES (REPEAT('.', 800)); +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' INTO TABLE t2 CHARACTER SET latin1; +# should be 800 +SELECT LENGTH(a) FROM t2; +LENGTH(a) +800 +DROP TABLE t1, t2; +# # End of 5.1 tests # diff --git a/mysql-test/r/outfile_loaddata.result b/mysql-test/r/outfile_loaddata.result index 453e3adb54c..36a72fd84ce 100644 --- a/mysql-test/r/outfile_loaddata.result +++ b/mysql-test/r/outfile_loaddata.result @@ -239,4 +239,24 @@ a b c 2 NULL NULL SET NAMES default; DROP TABLE t1, t2; +# +# Bug #53088: mysqldump with -T & --default-character-set set +# truncates text/blob to 766 chars +# +# Also see mysqldump.test +# +CREATE TABLE t1 (a BLOB) CHARSET latin1; +CREATE TABLE t2 LIKE t1; +INSERT INTO t1 VALUES (REPEAT('.', 800)); +SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug53088.txt' CHARACTER SET latin1 FROM t1; +# should be greater than 800 +SELECT LENGTH(LOAD_FILE('MYSQLTEST_VARDIR/tmp/bug53088.txt')); +LENGTH(LOAD_FILE('MYSQLTEST_VARDIR/tmp/bug53088.txt')) +801 +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug53088.txt' INTO TABLE t2; +# should be 800 +SELECT LENGTH(a) FROM t2; +LENGTH(a) +800 +DROP TABLE t1, t2; # End of 5.1 tests. diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index 66f8ac68dfe..55366bd2e07 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -2173,4 +2173,15 @@ ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning SELECT * FROM t1; s1 DROP TABLE t1; +# +# BUG#51868 - crash with myisam_use_mmap and partitioned myisam tables +# +SET GLOBAL myisam_use_mmap=1; +CREATE TABLE t1(a INT) PARTITION BY HASH(a) PARTITIONS 1; +INSERT INTO t1 VALUES(0); +FLUSH TABLE t1; +TRUNCATE TABLE t1; +INSERT INTO t1 VALUES(0); +DROP TABLE t1; +SET GLOBAL myisam_use_mmap=default; End of 5.1 tests diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 0b2002b1350..16f6657ceeb 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -155,24 +155,24 @@ execute stmt1 ; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 6 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table -5 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found -4 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +5 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +4 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables execute stmt1 ; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 6 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table -5 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found -4 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +5 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +4 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables explain SELECT (SELECT SUM(c1 + c12 + 0.0) FROM t2 where (t1.c2 - 0e-3) = t2.c2 GROUP BY t1.c15 LIMIT 1) as scalar_s, exists (select 1.0e+0 from t2 where t2.c3 * 9.0000000000 = t1.c4) as exists_s, c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s FROM t1, (select c25 x, c32 y from t2) tt WHERE x * 1 = c25; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 6 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table -5 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found -4 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +5 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +4 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables deallocate prepare stmt1; @@ -2992,6 +2992,19 @@ select @plaintext; bcd deallocate prepare encode; deallocate prepare decode; +# +# Bug#52124 memory leaks like a sieve in datetime, timestamp, time, date fields + warnings +# +CREATE TABLE t1 (a DATETIME NOT NULL, b TINYINT); +INSERT INTO t1 VALUES (0, 0),(0, 0); +PREPARE stmt FROM "SELECT 1 FROM t1 WHERE +ROW(a, b) >= ROW('1', (SELECT 1 FROM t1 WHERE a > 1234))"; +EXECUTE stmt; +1 +EXECUTE stmt; +1 +DEALLOCATE PREPARE stmt; +DROP TABLE t1; End of 5.1 tests. diff --git a/mysql-test/r/query_cache_with_views.result b/mysql-test/r/query_cache_with_views.result index 03430bd504b..7f0417a60c7 100644 --- a/mysql-test/r/query_cache_with_views.result +++ b/mysql-test/r/query_cache_with_views.result @@ -193,4 +193,17 @@ show status like "Qcache_hits"; Variable_name Value Qcache_hits 2 drop table t1; +# +# Bug46615 Assertion in Query_cache::invalidate in INSERT in a VIEW of a MERGE table +# +CREATE TABLE t1 (c1 INT, c2 INT); +CREATE TABLE t2 LIKE t1; +SET AUTOCOMMIT=OFF; +CREATE VIEW t1_view AS SELECT c1 FROM t1 NATURAL JOIN t2 ; +INSERT INTO t1_view (c1, c2) SELECT c1, c2 FROM t1; +ERROR 42S22: Unknown column 'c2' in 'field list' +DROP TABLE t1; +DROP TABLE t2; +DROP VIEW t1_view; +SET AUTOCOMMIT=DEFAULT; set GLOBAL query_cache_size=default; diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index aa04bfc25ea..4587a60ca0d 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -1653,4 +1653,48 @@ a b 0 0 1 1 DROP TABLE t1; +# +# Bug#50939: Loose Index Scan unduly relies on engine to remember range +# endpoints +# +CREATE TABLE t1 ( +a INT, +b INT, +KEY ( a, b ) +) PARTITION BY HASH (a) PARTITIONS 1; +CREATE TABLE t2 ( +a INT, +b INT, +KEY ( a, b ) +); +INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5); +INSERT INTO t1 SELECT a + 5, b + 5 FROM t1; +INSERT INTO t1 SELECT a + 10, b + 10 FROM t1; +INSERT INTO t1 SELECT a + 20, b + 20 FROM t1; +INSERT INTO t1 SELECT a + 40, b + 40 FROM t1; +INSERT INTO t2 SELECT * FROM t1; +# plans should be identical +EXPLAIN SELECT a, MAX(b) FROM t1 WHERE a IN (10,100) GROUP BY a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 5 NULL 1 Using where; Using index for group-by +EXPLAIN SELECT a, MAX(b) FROM t2 WHERE a IN (10,100) GROUP BY a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range a a 5 NULL 2 Using where; Using index for group-by +FLUSH status; +SELECT a, MAX(b) FROM t1 WHERE a IN (10, 100) GROUP BY a; +a MAX(b) +10 10 +# Should be no more than 4 reads. +SHOW status LIKE 'handler_read_key'; +Variable_name Value +Handler_read_key 4 +FLUSH status; +SELECT a, MAX(b) FROM t2 WHERE a IN (10, 100) GROUP BY a; +a MAX(b) +10 10 +# Should be no more than 4 reads. +SHOW status LIKE 'handler_read_key'; +Variable_name Value +Handler_read_key 4 +DROP TABLE t1, t2; End of 5.1 tests diff --git a/mysql-test/r/renamedb.result b/mysql-test/r/renamedb.result index ff8f89592fc..e77aca0d0b7 100644 --- a/mysql-test/r/renamedb.result +++ b/mysql-test/r/renamedb.result @@ -7,6 +7,6 @@ ERROR HY000: Incorrect usage of ALTER DATABASE UPGRADE DATA DIRECTORY NAME and n ALTER DATABASE `#mysql51#not-yet` UPGRADE DATA DIRECTORY NAME; ERROR HY000: Incorrect usage of ALTER DATABASE UPGRADE DATA DIRECTORY NAME and name ALTER DATABASE `#mysql50#` UPGRADE DATA DIRECTORY NAME; -ERROR HY000: Incorrect usage of ALTER DATABASE UPGRADE DATA DIRECTORY NAME and name +ERROR 42000: Incorrect database name '#mysql50#' ALTER DATABASE `#mysql50#upgrade-me` UPGRADE DATA DIRECTORY NAME; ERROR 42000: Unknown database '#mysql50#upgrade-me' diff --git a/mysql-test/r/row.result b/mysql-test/r/row.result index 2eaec67c547..2962123fcb2 100644 --- a/mysql-test/r/row.result +++ b/mysql-test/r/row.result @@ -457,3 +457,12 @@ abc 1 abc 1 select host,user from mysql.user where (host,user) = ('localhost','test'); host user drop table t1,t2; +# +# Bug#52124 memory leaks like a sieve in datetime, timestamp, time, date fields + warnings +# +CREATE TABLE t1 (a DATETIME NOT NULL, b TINYINT); +INSERT INTO t1 VALUES (0, 0),(0, 0); +SELECT 1 FROM t1 WHERE ROW(a, b) >= +ROW('1', (SELECT 1 FROM t1 WHERE a > 1234)); +1 +DROP TABLE t1; diff --git a/mysql-test/r/skip_name_resolve.result b/mysql-test/r/skip_name_resolve.result index 8aa9877a8e9..1d92d52110d 100644 --- a/mysql-test/r/skip_name_resolve.result +++ b/mysql-test/r/skip_name_resolve.result @@ -9,3 +9,30 @@ SELECT USER(); USER() # SHOW PROCESSLIST; +# +# Bug #37168: Missing variable - skip_name_resolve +# +SHOW VARIABLES LIKE 'skip_name_resolve'; +Variable_name Value +skip_name_resolve ON +SHOW GLOBAL VARIABLES LIKE 'skip_name_resolve'; +Variable_name Value +skip_name_resolve ON +SHOW SESSION VARIABLES LIKE 'skip_name_resolve'; +Variable_name Value +skip_name_resolve ON +SELECT @@skip_name_resolve; +@@skip_name_resolve +1 +SELECT @@LOCAL.skip_name_resolve; +ERROR HY000: Variable 'skip_name_resolve' is a GLOBAL variable +SELECT @@GLOBAL.skip_name_resolve; +@@GLOBAL.skip_name_resolve +1 +SET @@skip_name_resolve=0; +ERROR HY000: Variable 'skip_name_resolve' is a read only variable +SET @@LOCAL.skip_name_resolve=0; +ERROR HY000: Variable 'skip_name_resolve' is a read only variable +SET @@GLOBAL.skip_name_resolve=0; +ERROR HY000: Variable 'skip_name_resolve' is a read only variable +End of 5.1 tests diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index b23556887c1..e3aa87876ed 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -4899,3 +4899,92 @@ WHERE t1.a = d1.a; ERROR 42S22: Unknown column 'd1.a' in 'where clause' DROP TABLE t1; End of 5.1 tests. +Set up test tables. +CREATE TABLE t1 ( +t1_id INT UNSIGNED, +PRIMARY KEY(t1_id) +) Engine=MyISAM; +INSERT INTO t1 (t1_id) VALUES (1), (2), (3), (4), (5); +CREATE TABLE t2 SELECT * FROM t1; +CREATE TABLE t3 ( +t3_id INT UNSIGNED AUTO_INCREMENT, +t1_id INT UNSIGNED, +amount DECIMAL(16,2), +PRIMARY KEY(t3_id), +KEY(t1_id) +) Engine=MyISAM; +INSERT INTO t3 (t1_id, t3_id, amount) +VALUES (1, 1, 100.00), (2, 2, 200.00), (4, 4, 400.00); +This is the 'inner query' running by itself. +Produces correct results. +SELECT +t1.t1_id, +IFNULL((SELECT SUM(amount) FROM t3 WHERE t3.t1_id=t1.t1_id), 0) AS total_amount +FROM +t1 +LEFT JOIN t2 ON t2.t1_id=t1.t1_id +GROUP BY +t1.t1_id +; +t1_id total_amount +1 100.00 +2 200.00 +3 0.00 +4 400.00 +5 0.00 +SELECT * FROM (the same inner query) +Produces correct results. +SELECT * FROM ( +SELECT +t1.t1_id, +IFNULL((SELECT SUM(amount) FROM t3 WHERE t3.t1_id=t1.t1_id), 0) AS total_amount +FROM +t1 +LEFT JOIN t2 ON t2.t1_id=t1.t1_id +GROUP BY +t1.t1_id +) AS t; +t1_id total_amount +1 100.00 +2 200.00 +3 0.00 +4 400.00 +5 0.00 +Now make t2.t1_id part of a key. +ALTER TABLE t2 ADD PRIMARY KEY(t1_id); +Same inner query by itself. +Still correct results. +SELECT +t1.t1_id, +IFNULL((SELECT SUM(amount) FROM t3 WHERE t3.t1_id=t1.t1_id), 0) AS total_amount +FROM +t1 +LEFT JOIN t2 ON t2.t1_id=t1.t1_id +GROUP BY +t1.t1_id; +t1_id total_amount +1 100.00 +2 200.00 +3 0 +4 400.00 +5 0 +SELECT * FROM (the same inner query), now with indexes on the LEFT JOIN +SELECT * FROM ( +SELECT +t1.t1_id, +IFNULL((SELECT SUM(amount) FROM t3 WHERE t3.t1_id=t1.t1_id), 0) AS total_amount +FROM +t1 +LEFT JOIN t2 ON t2.t1_id=t1.t1_id +GROUP BY +t1.t1_id +) AS t; +t1_id total_amount +1 100.00 +2 200.00 +3 0.00 +4 400.00 +5 0.00 +DROP TABLE t3; +DROP TABLE t2; +DROP TABLE t1; diff --git a/mysql-test/r/symlink.result b/mysql-test/r/symlink.result index 245dcec04da..4dac7443135 100644 --- a/mysql-test/r/symlink.result +++ b/mysql-test/r/symlink.result @@ -168,4 +168,16 @@ Warning 1618 <DATA DIRECTORY> option ignored Warning 1618 <INDEX DIRECTORY> option ignored DROP TABLE t1; SET @@SQL_MODE=@OLD_SQL_MODE; +# +# BUG#40980 - Drop table can remove another MyISAM table's +# data and index files +# +CREATE TABLE user(a INT) DATA DIRECTORY='MYSQL_TMP_DIR/mysql' + INDEX DIRECTORY='MYSQL_TMP_DIR/mysql'; +FLUSH TABLE user; +# Symlinking mysql database to tmpdir +FLUSH TABLE mysql.user; +DROP TABLE user; +FLUSH TABLE mysql.user; +SELECT * FROM mysql.user; End of 5.1 tests diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result index 90d6071a767..36d82e4045f 100644 --- a/mysql-test/r/trigger.result +++ b/mysql-test/r/trigger.result @@ -2111,6 +2111,44 @@ SET @bug51650 = 1; INSERT IGNORE INTO t2 SET a = '777'; DROP TRIGGER trg1; DROP TABLE t1, t2; +CREATE TABLE t1 (id INT NOT NULL); +CREATE TABLE t2 (id INT NOT NULL); +INSERT t1 VALUES (1),(2),(3); +UPDATE t1 SET id=NULL; +Warnings: +Warning 1048 Column 'id' cannot be null +Warning 1048 Column 'id' cannot be null +Warning 1048 Column 'id' cannot be null +CREATE TRIGGER t1_bu BEFORE UPDATE ON t1 FOR EACH ROW +INSERT INTO t2 VALUES (3); +UPDATE t1 SET id=NULL; +Warnings: +Warning 1048 Column 'id' cannot be null +Warning 1048 Column 'id' cannot be null +Warning 1048 Column 'id' cannot be null +DROP TRIGGER t1_bu; +DROP TABLE t1,t2; +# +# Bug#50755: Crash if stored routine def contains version comments +# +DROP DATABASE IF EXISTS db1; +DROP TRIGGER IF EXISTS trg1; +DROP TABLE IF EXISTS t1, t2; +CREATE DATABASE db1; +USE db1; +CREATE TABLE t1 (b INT); +CREATE TABLE t2 (a INT); +CREATE TRIGGER trg1 BEFORE INSERT ON t2 FOR EACH ROW INSERT/*!INTO*/t1 VALUES (1); +# Used to crash +SHOW TRIGGERS IN db1; +Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation +INSERT INTO t2 VALUES (1); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VALUES (1)' at line 1 +SELECT * FROM t1; +b +# Work around Bug#45235 +DROP DATABASE db1; +USE test; End of 5.1 tests. # # Bug#34453 Can't change size of file (Errcode: 1224) diff --git a/mysql-test/r/upgrade.result b/mysql-test/r/upgrade.result index 034242079b1..da2f55b5bb1 100644 --- a/mysql-test/r/upgrade.result +++ b/mysql-test/r/upgrade.result @@ -112,3 +112,31 @@ select * from `a-b-c`.v1; f1 drop database `a-b-c`; use test; +# End of 5.0 tests +# +# Bug #53804: serious flaws in the alter database .. upgrade data +# directory name command +# +ALTER DATABASE `#mysql50#:` UPGRADE DATA DIRECTORY NAME; +ERROR 42000: Unknown database '#mysql50#:' +ALTER DATABASE `#mysql50#.` UPGRADE DATA DIRECTORY NAME; +ERROR 42000: Incorrect database name '#mysql50#.' +ALTER DATABASE `#mysql50#../` UPGRADE DATA DIRECTORY NAME; +ERROR 42000: Incorrect database name '#mysql50#../' +ALTER DATABASE `#mysql50#../..` UPGRADE DATA DIRECTORY NAME; +ERROR 42000: Incorrect database name '#mysql50#../..' +ALTER DATABASE `#mysql50#../../` UPGRADE DATA DIRECTORY NAME; +ERROR 42000: Incorrect database name '#mysql50#../../' +ALTER DATABASE `#mysql50#./blablabla` UPGRADE DATA DIRECTORY NAME; +ERROR 42000: Incorrect database name '#mysql50#./blablabla' +ALTER DATABASE `#mysql50#../blablabla` UPGRADE DATA DIRECTORY NAME; +ERROR 42000: Incorrect database name '#mysql50#../blablabla' +ALTER DATABASE `#mysql50#/` UPGRADE DATA DIRECTORY NAME; +ERROR 42000: Incorrect database name '#mysql50#/' +ALTER DATABASE `#mysql50#/.` UPGRADE DATA DIRECTORY NAME; +ERROR 42000: Incorrect database name '#mysql50#/.' +USE `#mysql50#.`; +ERROR 42000: Incorrect database name '#mysql50#.' +USE `#mysql50#../blablabla`; +ERROR 42000: Incorrect database name '#mysql50#../blablabla' +# End of 5.1 tests diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index b46f7c3bada..b4cfc28319b 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -526,6 +526,8 @@ select @@max_user_connections; 100 set global max_write_lock_count=100; set myisam_sort_buffer_size=100; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '100' set global net_buffer_length=100; Warnings: Warning 1292 Truncated incorrect net_buffer_length value: '100' @@ -1493,6 +1495,15 @@ SELECT @@GLOBAL.max_binlog_cache_size; @@GLOBAL.max_binlog_cache_size 5368709120 SET GLOBAL max_binlog_cache_size = @old_max_binlog_cache_size; +# +# Bug #37168 : Missing variable - skip_name_resolve +# +SELECT @@skip_name_resolve; +@@skip_name_resolve +0 +SHOW VARIABLES LIKE 'skip_name_resolve'; +Variable_name Value +skip_name_resolve OFF End of 5.1 tests # diff --git a/mysql-test/r/variables_debug.result b/mysql-test/r/variables_debug.result index 89a3202b731..a02d285b15b 100644 --- a/mysql-test/r/variables_debug.result +++ b/mysql-test/r/variables_debug.result @@ -1,3 +1,4 @@ +SET @old_debug = @@GLOBAL.debug; set debug= 'T'; select @@debug; @@debug @@ -17,3 +18,17 @@ SET SESSION debug = ''; SELECT @@session.debug, @@global.debug; @@session.debug @@global.debug +# +# Bug #52629: memory leak from sys_var_thd_dbug in +# binlog.binlog_write_error +# +SET GLOBAL debug='d,injecting_fault_writing'; +SELECT @@global.debug; +@@global.debug +d,injecting_fault_writing +SET GLOBAL debug=''; +SELECT @@global.debug; +@@global.debug + +SET GLOBAL debug=@old_debug; +End of 5.1 tests diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index b7660dbcbd8..95d2827c1a6 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -3986,6 +3986,14 @@ CREATE VIEW v1 AS SELECT 1 FROM t1 WHERE ROW(1,1) >= ROW(1, (SELECT 1 FROM t1 WHERE f1 >= ANY ( SELECT '1' ))); DROP VIEW v1; DROP TABLE t1; +# +# Bug#52120 create view cause Assertion failed: 0, file .\item_subselect.cc, line 817 +# +CREATE TABLE t1 (a CHAR(1) CHARSET latin1, b CHAR(1) CHARSET utf8); +CREATE VIEW v1 AS SELECT 1 from t1 +WHERE t1.b <=> (SELECT a FROM t1 WHERE a < SOME(SELECT '1')); +DROP VIEW v1; +DROP TABLE t1; # ----------------------------------------------------------------- # -- End of 5.1 tests. # ----------------------------------------------------------------- diff --git a/mysql-test/std_data/binlog_savepoint.000001 b/mysql-test/std_data/binlog_savepoint.000001 Binary files differnew file mode 100644 index 00000000000..5109042a184 --- /dev/null +++ b/mysql-test/std_data/binlog_savepoint.000001 diff --git a/mysql-test/std_data/bug46565.ARZ b/mysql-test/std_data/bug46565.ARZ Binary files differnew file mode 100644 index 00000000000..f26b31218a1 --- /dev/null +++ b/mysql-test/std_data/bug46565.ARZ diff --git a/mysql-test/std_data/bug46565.frm b/mysql-test/std_data/bug46565.frm Binary files differnew file mode 100644 index 00000000000..5c0180bdc1e --- /dev/null +++ b/mysql-test/std_data/bug46565.frm diff --git a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result index a15e6808a09..6643c4557c2 100644 --- a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result +++ b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result @@ -53,10 +53,10 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; savepoint my_savepoint +master-bin.000001 # Query # # SAVEPOINT my_savepoint master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; rollback to savepoint my_savepoint +master-bin.000001 # Query # # ROLLBACK TO my_savepoint master-bin.000001 # Xid # # COMMIT /* XID */ delete from t1; delete from t2; @@ -84,10 +84,10 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; savepoint my_savepoint +master-bin.000001 # Query # # SAVEPOINT my_savepoint master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; rollback to savepoint my_savepoint +master-bin.000001 # Query # # ROLLBACK TO my_savepoint master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ @@ -848,11 +848,11 @@ delete from t4; insert into t3 values (1,1),(2,2); insert into t4 values (1,1),(2,2); reset master; -UPDATE t3,t4 SET t3.a=t4.a + bug27417(1); +UPDATE t3,t4 SET t3.a = t4.a + bug27417(1) where t3.a = 1; ERROR 23000: Duplicate entry '2' for key 'PRIMARY' select count(*) from t1 /* must be 1 */; count(*) -2 +1 drop table t4; delete from t1; delete from t2; diff --git a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result index 837aafb9ae7..cea3819cad3 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result +++ b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result @@ -51,10 +51,10 @@ show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into t1 values(3) -master-bin.000001 # Query # # use `test`; savepoint my_savepoint +master-bin.000001 # Query # # SAVEPOINT my_savepoint master-bin.000001 # Query # # use `test`; insert into t1 values(4) master-bin.000001 # Query # # use `test`; insert into t2 select * from t1 -master-bin.000001 # Query # # use `test`; rollback to savepoint my_savepoint +master-bin.000001 # Query # # ROLLBACK TO my_savepoint master-bin.000001 # Xid # # COMMIT /* XID */ delete from t1; delete from t2; @@ -79,10 +79,10 @@ show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into t1 values(5) -master-bin.000001 # Query # # use `test`; savepoint my_savepoint +master-bin.000001 # Query # # SAVEPOINT my_savepoint master-bin.000001 # Query # # use `test`; insert into t1 values(6) master-bin.000001 # Query # # use `test`; insert into t2 select * from t1 -master-bin.000001 # Query # # use `test`; rollback to savepoint my_savepoint +master-bin.000001 # Query # # ROLLBACK TO my_savepoint master-bin.000001 # Query # # use `test`; insert into t1 values(7) master-bin.000001 # Xid # # COMMIT /* XID */ delete from t1; @@ -886,7 +886,7 @@ delete from t4; insert into t3 values (1,1),(2,2); insert into t4 values (1,1),(2,2); reset master; -UPDATE t3,t4 SET t3.a=t4.a + bug27417(1); +UPDATE t3,t4 SET t3.a = t4.a + bug27417(1) where t3.a = 1; ERROR 23000: Duplicate entry '2' for key 'PRIMARY' select count(*) from t1 /* must be 1 */; count(*) diff --git a/mysql-test/suite/engines/README b/mysql-test/suite/engines/README index 3ff6fccc689..0f89d5af67f 100644 --- a/mysql-test/suite/engines/README +++ b/mysql-test/suite/engines/README @@ -50,22 +50,22 @@ The following suites are included: Known Issues ------------ -1) The 'funcs' and 'iuds' suites currently runs only against MySQL 5.1 server. - Running them against MySQL 5.5 will generate errors. - -2) The folowing tests in the 'iuds' suite: +1) The folowing tests in the 'iuds' suite: - delete_decimal - insert_decimal - update_decimal will return a 'Warning 1264 - Out of range value...' warning if run in a 32-bit environment. Add the '--force' option to prevent the test run from aborting. -3) The following tests in the 'funcs' suite will fail when run against the innodb_plugin: +2) The following tests in the 'funcs' suite will fail when run against the innodb_plugin: - crash_manycolumns_string (bug 50495) - ix_unique_lob (bug 52056, masked by an 'Out of memory error' on some 32-bit platforms) - ix_unique_string_length (bug 52056, masked by an 'Out of memory error' on some 32-bit platforms) Add the '--force' option to prevent the test run from aborting. -4) Some of the rpl_xxx tests in the 'funcs' suite require a secific binlog_forat setting and will be +3) Some of the rpl_xxx tests in the 'funcs' suite require a secific binlog_forat setting and will be skipped otherwise. +4) Some of the rpl_xxx tests in the 'funcs' suite will report a 'Statement unsafe for replication' warning + when run againsr a server configured to use statement based replication. + diff --git a/mysql-test/suite/engines/iuds/r/update_delete_calendar.result b/mysql-test/suite/engines/iuds/r/update_delete_calendar.result index a04585dfd72..e2dd83e03b4 100644 --- a/mysql-test/suite/engines/iuds/r/update_delete_calendar.result +++ b/mysql-test/suite/engines/iuds/r/update_delete_calendar.result @@ -791,9 +791,6 @@ Warning 1292 Truncated incorrect datetime value: '2009-01-10 23:60:59' SELECT count(*) FROM t1 WHERE c2='2001-01-11 23:59:60' /* returns 0 */; count(*) 0 -Warnings: -Warning 1292 Incorrect datetime value: '2001-01-11 23:59:60' for column 'c2' at row 1 -Warning 1292 Incorrect datetime value: '2001-01-11 23:59:60' for column 'c2' at row 1 SELECT * FROM t1 WHERE c1='0000-00-00 00:00:00' OR c2='0000-00-00 00:00:00'; c1 c2 c3 0000-00-00 00:00:00 0000-00-00 00:00:00 6 diff --git a/mysql-test/suite/engines/iuds/t/disabled.def b/mysql-test/suite/engines/iuds/t/disabled.def index 7fd504c0996..c8fdf80274b 100644 --- a/mysql-test/suite/engines/iuds/t/disabled.def +++ b/mysql-test/suite/engines/iuds/t/disabled.def @@ -1,3 +1,2 @@ insert_calendar : Bug#52283 Innodb reports extra warnings when SELECT/WHERE is performed using invalid value update_delete_calendar : Bug#52824 + Bug#52283(in case of Innodb) - diff --git a/mysql-test/suite/engines/iuds/t/insert_number.test b/mysql-test/suite/engines/iuds/t/insert_number.test index e2c809fad85..b55bd8dc98a 100644 --- a/mysql-test/suite/engines/iuds/t/insert_number.test +++ b/mysql-test/suite/engines/iuds/t/insert_number.test @@ -7812,6 +7812,9 @@ SELECT * FROM t2 ORDER BY c1,c6 LIMIT 2; SELECT * FROM t2 ORDER BY c1,c6 DESC LIMIT 2; ## ref type access + +# Bug#52283 : Remove the following --disable_warnings +# command when the bug is fixed --disable_warnings SELECT * FROM t2 WHERE c1 = 18446744073709551616 ORDER BY c1,c6; SELECT * FROM t2 WHERE c1 = 18446744073709551616 ORDER BY c1,c6 LIMIT 2; diff --git a/mysql-test/suite/engines/iuds/t/update_delete_calendar.test b/mysql-test/suite/engines/iuds/t/update_delete_calendar.test index aa695953ce1..c6a22511766 100644 --- a/mysql-test/suite/engines/iuds/t/update_delete_calendar.test +++ b/mysql-test/suite/engines/iuds/t/update_delete_calendar.test @@ -300,7 +300,12 @@ INSERT INTO t1 VALUES('2001-01-09','2001-01-10',6),('2001-01-11','2001-01-12',7) UPDATE t1 SET c1='2001-01-09 24:59:59',c2='2009-01-10 23:60:59' WHERE c1='2001-01-09'; UPDATE t1 SET c2='2001-01-11 23:59:60' WHERE c1='2001-01-11'; SELECT count(*) FROM t1 WHERE c1='2001-01-09 24:59:59' AND c2='2009-01-10 23:60:59'; + +# Bug#52283 : Remove the following --disable_warnings +# command when the bug is fixed +--disable_warnings SELECT count(*) FROM t1 WHERE c2='2001-01-11 23:59:60' /* returns 0 */; +--enable_warnings --sorted_result SELECT * FROM t1 WHERE c1='0000-00-00 00:00:00' OR c2='0000-00-00 00:00:00'; diff --git a/mysql-test/suite/parts/r/partition_debug_sync_innodb.result b/mysql-test/suite/parts/r/partition_debug_sync_innodb.result new file mode 100644 index 00000000000..9e72259a150 --- /dev/null +++ b/mysql-test/suite/parts/r/partition_debug_sync_innodb.result @@ -0,0 +1,61 @@ +# +# Bug#50561: ALTER PARTITIONS does not have adequate lock, breaks with +# concurrent I_S query +create table t1 (a int) +engine = innodb +partition by range (a) +(partition p0 values less than MAXVALUE); +insert into t1 values (1), (11), (21), (33); +SELECT * FROM t1; +a +1 +11 +21 +33 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY RANGE (a) +(PARTITION p0 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ +t1#P#p0.ibd +t1.frm +t1.par +SET DEBUG_SYNC='before_open_in_get_all_tables SIGNAL parked WAIT_FOR open'; +SET DEBUG_SYNC='partition_open_error SIGNAL alter WAIT_FOR finish'; +SELECT * FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test'; +SET DEBUG_SYNC = 'now WAIT_FOR parked'; +# When waiting for the name lock in get_all_tables in sql_show.cc +# this will not be concurrent any more, thus the TIMEOUT +SET DEBUG_SYNC = 'before_rename_partitions SIGNAL open WAIT_FOR alter TIMEOUT 1'; +# Needs to be executed twice, since first is this 'SET DEBUG_SYNC ...' +SET DEBUG_SYNC = 'before_close_thread_tables SIGNAL finish EXECUTE 2'; +ALTER TABLE t1 REORGANIZE PARTITION p0 INTO +(PARTITION p0 VALUES LESS THAN (10), +PARTITION p10 VALUES LESS THAN MAXVALUE); +Warnings: +Warning 1639 debug sync point wait timed out +TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME +def test t1 p0 NULL 1 NULL RANGE NULL a NULL 10 1 16384 16384 NULL 0 0 NULL NULL NULL NULL default NULL +def test t1 p10 NULL 2 NULL RANGE NULL a NULL MAXVALUE 3 5461 16384 NULL 0 0 NULL NULL NULL NULL default NULL +t1#P#p0.ibd +t1#P#p10.ibd +t1.frm +t1.par +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY RANGE (a) +(PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, + PARTITION p10 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ +SELECT * FROM t1; +a +1 +11 +21 +33 +drop table t1; +SET DEBUG_SYNC = 'RESET'; diff --git a/mysql-test/suite/parts/t/partition_debug_sync_innodb-master.opt b/mysql-test/suite/parts/t/partition_debug_sync_innodb-master.opt new file mode 100644 index 00000000000..9854fda301d --- /dev/null +++ b/mysql-test/suite/parts/t/partition_debug_sync_innodb-master.opt @@ -0,0 +1 @@ +--innodb_file_per_table=1 diff --git a/mysql-test/suite/parts/t/partition_debug_sync_innodb.test b/mysql-test/suite/parts/t/partition_debug_sync_innodb.test new file mode 100644 index 00000000000..79ef3d537bf --- /dev/null +++ b/mysql-test/suite/parts/t/partition_debug_sync_innodb.test @@ -0,0 +1,44 @@ +--source include/have_innodb.inc +--source include/have_partition.inc +--source include/have_debug_sync.inc + +let $MYSQLD_DATADIR=`SELECT @@datadir`; + +--echo # +--echo # Bug#50561: ALTER PARTITIONS does not have adequate lock, breaks with +--echo # concurrent I_S query +create table t1 (a int) +engine = innodb +partition by range (a) +(partition p0 values less than MAXVALUE); +insert into t1 values (1), (11), (21), (33); +SELECT * FROM t1; +SHOW CREATE TABLE t1; +--list_files $MYSQLD_DATADIR/test + +SET DEBUG_SYNC='before_open_in_get_all_tables SIGNAL parked WAIT_FOR open'; +SET DEBUG_SYNC='partition_open_error SIGNAL alter WAIT_FOR finish'; +send +SELECT * FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test'; + +connect (con1, localhost, root,,); +SET DEBUG_SYNC = 'now WAIT_FOR parked'; +--echo # When waiting for the name lock in get_all_tables in sql_show.cc +--echo # this will not be concurrent any more, thus the TIMEOUT +SET DEBUG_SYNC = 'before_rename_partitions SIGNAL open WAIT_FOR alter TIMEOUT 1'; +--echo # Needs to be executed twice, since first is this 'SET DEBUG_SYNC ...' +SET DEBUG_SYNC = 'before_close_thread_tables SIGNAL finish EXECUTE 2'; +--error 0,ER_TABLE_EXISTS_ERROR +ALTER TABLE t1 REORGANIZE PARTITION p0 INTO +(PARTITION p0 VALUES LESS THAN (10), + PARTITION p10 VALUES LESS THAN MAXVALUE); + +disconnect con1; +connection default; +--reap +--list_files $MYSQLD_DATADIR/test +SHOW CREATE TABLE t1; +SELECT * FROM t1; +drop table t1; +--list_files $MYSQLD_DATADIR/test +SET DEBUG_SYNC = 'RESET'; diff --git a/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result b/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result index dedfa1e8355..1ed7e0116a2 100644 --- a/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result +++ b/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result @@ -8,7 +8,9 @@ call mtr.add_suppression("Unsafe statement written to the binary log using state call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); SET @@session.binlog_direct_non_transactional_updates= FALSE; DROP DATABASE IF EXISTS db1; +DROP DATABASE IF EXISTS db2; CREATE DATABASE db1; +CREATE DATABASE db2; use db1; CREATE TABLE db1.t1 (a INT) ENGINE=InnoDB; CREATE TABLE db1.t2 (s CHAR(255)) ENGINE=MyISAM; @@ -107,8 +109,72 @@ SELECT * from db1.t2; s before call db1.p1() executed db1.p2() +START SLAVE; +# +# SAVEPOINT and ROLLBACK TO have the same problem in BUG#43263 +# This was reported by BUG#50407 +[on master] +SET SESSION AUTOCOMMIT=0 +BEGIN; +INSERT INTO db1.t1 VALUES(20); +# +# Verify whether this statement is binlogged correctly +/*comment*/ SAVEPOINT has_comment; +USE db1; +INSERT INTO db1.t1 VALUES(30); +INSERT INTO db1.t2 VALUES("in savepoint has_comment"); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. +USE db2; +SavePoint mixed_cases; +USE db1; +INSERT INTO db1.t2 VALUES("in savepoint mixed_cases"); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. +INSERT INTO db1.t1 VALUES(40); +USE db2; +ROLLBACK TO mixed_cases; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +ROLLBACK TO has_comment; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +USE db1; +INSERT INTO db1.t2 VALUES("after rollback to"); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. +INSERT INTO db1.t1 VALUES(50); +USE db2; +COMMIT; +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO db1.t1 VALUES(20) +master-bin.000001 # Query # # SAVEPOINT has_comment +master-bin.000001 # Query # # use `db1`; INSERT INTO db1.t1 VALUES(30) +master-bin.000001 # Query # # use `db1`; INSERT INTO db1.t2 VALUES("in savepoint has_comment") +master-bin.000001 # Query # # SAVEPOINT mixed_cases +master-bin.000001 # Query # # use `db1`; INSERT INTO db1.t2 VALUES("in savepoint mixed_cases") +master-bin.000001 # Query # # use `db1`; INSERT INTO db1.t1 VALUES(40) +master-bin.000001 # Query # # ROLLBACK TO mixed_cases +master-bin.000001 # Query # # ROLLBACK TO has_comment +master-bin.000001 # Query # # use `db1`; INSERT INTO db1.t2 VALUES("after rollback to") +master-bin.000001 # Query # # use `db1`; INSERT INTO db1.t1 VALUES(50) +master-bin.000001 # Xid # # COMMIT /* XID */ +[on slave] +# +# Verify INSERT statements in savepoints are executed, for MyISAM table +# is not effected by ROLLBACK TO +SELECT * FROM db1.t2 WHERE s LIKE '% savepoint %'; +s +in savepoint has_comment +in savepoint mixed_cases +# +# Verify INSERT statements on the Innodb table are rolled back; +SELECT * FROM db1.t1 WHERE a IN (30, 40); +a # # Clean up # DROP DATABASE db1; -DROP DATABASE db1; +DROP DATABASE db2; diff --git a/mysql-test/suite/rpl/r/rpl_do_grant.result b/mysql-test/suite/rpl/r/rpl_do_grant.result index 9eecc1bab3f..1cea2cfa9ad 100644 --- a/mysql-test/suite/rpl/r/rpl_do_grant.result +++ b/mysql-test/suite/rpl/r/rpl_do_grant.result @@ -246,4 +246,18 @@ GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION DROP TABLE t1; DROP PROCEDURE p1; DROP USER 'user49119'@'localhost'; +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +grant all on *.* to foo@"1.2.3.4"; +revoke all privileges, grant option from "foo"; +ERROR HY000: Can't revoke all privileges for one or more of the requested users +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; grant all on *.* to foo@"1.2.3.4" +master-bin.000001 # Query # # use `test`; revoke all privileges, grant option from "foo" +DROP USER foo@"1.2.3.4"; "End of test" diff --git a/mysql-test/suite/rpl/r/rpl_events.result b/mysql-test/suite/rpl/r/rpl_events.result index 11ebb760e86..7d4e8a208eb 100644 --- a/mysql-test/suite/rpl/r/rpl_events.result +++ b/mysql-test/suite/rpl/r/rpl_events.result @@ -118,8 +118,14 @@ CREATE /*!50000 DEFINER='user44331' */ EVENT event44331_4 ON SCHEDULE AT CURRENT_TIMESTAMP ON COMPLETION PRESERVE DISABLE DO INSERT INTO test.t1 VALUES('event event44331_4 fired - DEFINER=user1'); -Warnings: -Note 1449 The user specified as a definer ('user44331'@'%') does not exist +# Test for bug#50095 Multi-statement including CREATE EVENT causes rotten +# binlog entry +SELECT 'ABC'; +SELECT '123'| +ABC +ABC +123 +123 #on master select EVENT_SCHEMA, EVENT_NAME, DEFINER from information_schema.events where EVENT_NAME='event44331_1'; diff --git a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result index 88fe7bce4f6..579c5489823 100644 --- a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result +++ b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result @@ -996,7 +996,7 @@ master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES (3, 'before master-bin.000001 # Xid 1 # # master-bin.000001 # Query 1 # BEGIN master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES (5, 'before savepoint s2') -master-bin.000001 # Query 1 # use `test_rpl`; SAVEPOINT s2 +master-bin.000001 # Query 1 # SAVEPOINT s2 master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES (6, 'after savepoint s2') master-bin.000001 # Table_map 1 # table_id: # (test_rpl.t1) master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F diff --git a/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result index fd7df68640e..e7e4e1b8aa4 100644 --- a/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result +++ b/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result @@ -10762,9 +10762,9 @@ COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 4) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B N T S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b- @@ -10774,9 +10774,9 @@ master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VA master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 4) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B N T S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e- @@ -10815,9 +10815,9 @@ COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T N S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b- @@ -10828,9 +10828,9 @@ master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T N S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e- @@ -10869,9 +10869,9 @@ COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T S1 N T R1 C << -b-b-b-b-b-b-b-b-b-b-b- @@ -10882,9 +10882,9 @@ master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T S1 N T R1 C << -e-e-e-e-e-e-e-e-e-e-e- @@ -11852,20 +11852,20 @@ ROLLBACK; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5) master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T S1 T CT R1 R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5) master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T S1 T CT R1 R << -e-e-e-e-e-e-e-e-e-e-e- diff --git a/mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result index fd7df68640e..e7e4e1b8aa4 100644 --- a/mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result +++ b/mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result @@ -10762,9 +10762,9 @@ COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 4) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B N T S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b- @@ -10774,9 +10774,9 @@ master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VA master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 4) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B N T S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e- @@ -10815,9 +10815,9 @@ COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T N S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b- @@ -10828,9 +10828,9 @@ master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T N S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e- @@ -10869,9 +10869,9 @@ COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T S1 N T R1 C << -b-b-b-b-b-b-b-b-b-b-b- @@ -10882,9 +10882,9 @@ master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T S1 N T R1 C << -e-e-e-e-e-e-e-e-e-e-e- @@ -11852,20 +11852,20 @@ ROLLBACK; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5) master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T S1 T CT R1 R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5) master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T S1 T CT R1 R << -e-e-e-e-e-e-e-e-e-e-e- diff --git a/mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result index 366a5342a0e..cde0a9cfa8c 100644 --- a/mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result +++ b/mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result @@ -12240,10 +12240,10 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B N T S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b- @@ -12255,10 +12255,10 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B N T S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e- @@ -12298,10 +12298,10 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T N S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b- @@ -12313,10 +12313,10 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T N S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e- @@ -12356,10 +12356,10 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T S1 N T R1 C << -b-b-b-b-b-b-b-b-b-b-b- @@ -12371,10 +12371,10 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T S1 N T R1 C << -e-e-e-e-e-e-e-e-e-e-e- @@ -13579,10 +13579,10 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T S1 T CT R1 R << -b-b-b-b-b-b-b-b-b-b-b- @@ -13590,10 +13590,10 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T S1 T CT R1 R << -e-e-e-e-e-e-e-e-e-e-e- diff --git a/mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result index 92230b5bfa3..dfceb41948d 100644 --- a/mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result +++ b/mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result @@ -9770,9 +9770,9 @@ COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 4) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B N T S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b- @@ -9782,9 +9782,9 @@ master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VA master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 4) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B N T S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e- @@ -9822,9 +9822,9 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 2) master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (319, 4) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T N S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b- @@ -9832,9 +9832,9 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 2) master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (319, 4) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T N S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e- @@ -9871,20 +9871,20 @@ COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (320, 5) master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T S1 N T R1 C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (320, 5) master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T S1 N T R1 C << -e-e-e-e-e-e-e-e-e-e-e- @@ -10801,20 +10801,20 @@ ROLLBACK; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5) master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T S1 T CT R1 R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5) master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T S1 T CT R1 R << -e-e-e-e-e-e-e-e-e-e-e- diff --git a/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result index 366a5342a0e..cde0a9cfa8c 100644 --- a/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result +++ b/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result @@ -12240,10 +12240,10 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B N T S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b- @@ -12255,10 +12255,10 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B N T S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e- @@ -12298,10 +12298,10 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T N S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b- @@ -12313,10 +12313,10 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T N S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e- @@ -12356,10 +12356,10 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T S1 N T R1 C << -b-b-b-b-b-b-b-b-b-b-b- @@ -12371,10 +12371,10 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T S1 N T R1 C << -e-e-e-e-e-e-e-e-e-e-e- @@ -13579,10 +13579,10 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T S1 T CT R1 R << -b-b-b-b-b-b-b-b-b-b-b- @@ -13590,10 +13590,10 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T S1 T CT R1 R << -e-e-e-e-e-e-e-e-e-e-e- 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 new file mode 100644 index 00000000000..c461cafbd7c --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result @@ -0,0 +1,46 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +## case #1 - last_null_bit_pos==0 in record_compare without X bit +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +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=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 ); +INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 ); +UPDATE t1 SET c5 = 'a'; +Comparing tables master:test.t1 and slave:test.t1 +DROP TABLE t1; +## case #1.1 - last_null_bit_pos==0 in record_compare with X bit +## (1 column less and no varchar) +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 bigint(20) DEFAULT 0, c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0) ENGINE=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 ); +INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 ); +UPDATE t1 SET c5 = 'a'; +Comparing tables master:test.t1 and slave:test.t1 +DROP TABLE t1; +## case #2 - X bit is wrongly set. +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +CREATE TABLE t1 (c1 int, c2 varchar(1) default '') ENGINE=InnoDB DEFAULT CHARSET= latin1; +INSERT INTO t1(c1) VALUES (10); +INSERT INTO t1(c1) VALUES (NULL); +UPDATE t1 SET c1= 0; +Comparing tables master:test.t1 and slave:test.t1 +DROP TABLE t1; 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 new file mode 100644 index 00000000000..38fbe486d2e --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result @@ -0,0 +1,60 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +## case #1 - last_null_bit_pos==0 in record_compare without X bit +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +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; +INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 ); +INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 ); +UPDATE t1 SET c5 = 'a'; +Comparing tables master:test.t1 and slave:test.t1 +DROP TABLE t1; +## case #1.1 - last_null_bit_pos==0 in record_compare with X bit +## (1 column less and no varchar) +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 bigint(20) DEFAULT 0, c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0) ENGINE=MyISAM DEFAULT CHARSET=latin1; +INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 ); +INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 ); +UPDATE t1 SET c5 = 'a'; +Comparing tables master:test.t1 and slave:test.t1 +DROP TABLE t1; +## case #2 - X bit is wrongly set. +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +CREATE TABLE t1 (c1 int, c2 varchar(1) default '') ENGINE=MyISAM DEFAULT CHARSET= latin1; +INSERT INTO t1(c1) VALUES (10); +INSERT INTO t1(c1) VALUES (NULL); +UPDATE t1 SET c1= 0; +Comparing tables master:test.t1 and slave:test.t1 +DROP TABLE t1; +## coverage purposes - Field_bits +## 1 X bit + 2 Null bits + 5 bits => last_null_bit_pos==0 +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +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; +Comparing tables master:test.t1 and slave:test.t1 +DROP TABLE t1; diff --git a/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result index 5cafdf8528d..579e5eb02e9 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result +++ b/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result @@ -10042,9 +10042,9 @@ COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 4) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B N T S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b- @@ -10054,9 +10054,9 @@ master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VA master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 4) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B N T S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e- @@ -10096,9 +10096,9 @@ COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T N S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b- @@ -10108,9 +10108,9 @@ master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VA master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T N S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e- @@ -10150,9 +10150,9 @@ COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T S1 N T R1 C << -b-b-b-b-b-b-b-b-b-b-b- @@ -10162,9 +10162,9 @@ master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VA master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T S1 N T R1 C << -e-e-e-e-e-e-e-e-e-e-e- @@ -11097,20 +11097,20 @@ ROLLBACK; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5) master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T S1 T CT R1 R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5) master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T S1 T CT R1 R << -e-e-e-e-e-e-e-e-e-e-e- @@ -11314,3 +11314,23 @@ master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_1 ################################################################################### # CLEAN ################################################################################### +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +CREATE TABLE `t1` ( +`c1` int(10) unsigned NOT NULL AUTO_INCREMENT, +`c2` tinyint(1) unsigned DEFAULT NULL, +`c3` varchar(300) DEFAULT NULL, +`c4` int(10) unsigned NOT NULL, +`c5` int(10) unsigned DEFAULT NULL, +PRIMARY KEY (`c1`)) ENGINE=MyISAM DEFAULT CHARSET=latin1; +ALTER TABLE `t1` Engine=InnoDB; +SET AUTOCOMMIT=0; +INSERT INTO t1 (c1,c2,c3,c4,c5) VALUES (1, 1, 'X', 1, NULL); +COMMIT; +ROLLBACK; +SET AUTOCOMMIT=1; +Comparing tables master:test.t1 and slave:test.t1 +DROP TABLE `t1`; diff --git a/mysql-test/suite/rpl/t/rpl_begin_commit_rollback-master.opt b/mysql-test/suite/rpl/t/rpl_begin_commit_rollback-master.opt new file mode 100644 index 00000000000..9e6e2b7829a --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_begin_commit_rollback-master.opt @@ -0,0 +1 @@ +--innodb --binlog-ignore-db=db2 diff --git a/mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test b/mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test index 8db4aeccd7a..acb98a0ad88 100644 --- a/mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test +++ b/mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test @@ -12,9 +12,11 @@ SET @@session.binlog_direct_non_transactional_updates= FALSE; disable_warnings; DROP DATABASE IF EXISTS db1; +DROP DATABASE IF EXISTS db2; enable_warnings; CREATE DATABASE db1; +CREATE DATABASE db2; use db1; @@ -124,10 +126,55 @@ eval SELECT $result as 'Must be 0'; SELECT * from db1.t1; SELECT * from db1.t2; +START SLAVE; +source include/wait_for_slave_sql_to_start.inc; + +--echo # +--echo # SAVEPOINT and ROLLBACK TO have the same problem in BUG#43263 +--echo # This was reported by BUG#50407 +connection master; +echo [on master] +SET SESSION AUTOCOMMIT=0; +let $binlog_start=query_get_value(SHOW MASTER STATUS, Position, 1); + +BEGIN; +INSERT INTO db1.t1 VALUES(20); + +--echo # +--echo # Verify whether this statement is binlogged correctly +/*comment*/ SAVEPOINT has_comment; +USE db1; +INSERT INTO db1.t1 VALUES(30); +INSERT INTO db1.t2 VALUES("in savepoint has_comment"); +USE db2; +SavePoint mixed_cases; +USE db1; +INSERT INTO db1.t2 VALUES("in savepoint mixed_cases"); +INSERT INTO db1.t1 VALUES(40); +USE db2; +ROLLBACK TO mixed_cases; +ROLLBACK TO has_comment; +USE db1; +INSERT INTO db1.t2 VALUES("after rollback to"); +INSERT INTO db1.t1 VALUES(50); +USE db2; +COMMIT; +source include/show_binlog_events.inc; +sync_slave_with_master; + +--echo [on slave] +--echo # +--echo # Verify INSERT statements in savepoints are executed, for MyISAM table +--echo # is not effected by ROLLBACK TO +SELECT * FROM db1.t2 WHERE s LIKE '% savepoint %'; +--echo # +--echo # Verify INSERT statements on the Innodb table are rolled back; +SELECT * FROM db1.t1 WHERE a IN (30, 40); + --echo # --echo # Clean up --echo # connection master; DROP DATABASE db1; -connection slave; -DROP DATABASE db1; +DROP DATABASE db2; +source include/master-slave-end.inc; diff --git a/mysql-test/suite/rpl/t/rpl_do_grant.test b/mysql-test/suite/rpl/t/rpl_do_grant.test index e3d7784429e..37358077145 100644 --- a/mysql-test/suite/rpl/t/rpl_do_grant.test +++ b/mysql-test/suite/rpl/t/rpl_do_grant.test @@ -318,4 +318,33 @@ DROP USER 'user49119'@'localhost'; -- sync_slave_with_master +# +# Bug #51987 revoke privileges logs wrong error code +# + +-- connection master +-- source include/master-slave-reset.inc +-- connection master + +grant all on *.* to foo@"1.2.3.4"; +-- error ER_REVOKE_GRANTS +revoke all privileges, grant option from "foo"; + +## assertion: revoke is logged +-- source include/show_binlog_events.inc + +-- sync_slave_with_master + +## assertion: slave replicates revoke and does not fail because master +## logged revoke with correct expected error code +-- let $err= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1) + if ($err) +{ + -- die UNEXPECTED ERROR AT SLAVE: $err +} + +-- connection master +DROP USER foo@"1.2.3.4"; +-- sync_slave_with_master + --echo "End of test" diff --git a/mysql-test/suite/rpl/t/rpl_events.test b/mysql-test/suite/rpl/t/rpl_events.test index 6e5bed8aa21..45ef12862fc 100644 --- a/mysql-test/suite/rpl/t/rpl_events.test +++ b/mysql-test/suite/rpl/t/rpl_events.test @@ -59,10 +59,16 @@ CREATE DEFINER=CURRENT_USER() EVENT event44331_3 ON COMPLETION PRESERVE DISABLE DO INSERT INTO test.t1 VALUES('event event44331_3 fired - DEFINER=CURRENT_USER() function'); +DELIMITER |; CREATE /*!50000 DEFINER='user44331' */ EVENT event44331_4 ON SCHEDULE AT CURRENT_TIMESTAMP ON COMPLETION PRESERVE DISABLE DO INSERT INTO test.t1 VALUES('event event44331_4 fired - DEFINER=user1'); +# Test for bug#50095 Multi-statement including CREATE EVENT causes rotten +# binlog entry + SELECT 'ABC'; + SELECT '123'| +DELIMITER ;| --echo #on master select EVENT_SCHEMA, EVENT_NAME, DEFINER from information_schema.events diff --git a/mysql-test/suite/rpl/t/rpl_row_rec_comp_innodb.test b/mysql-test/suite/rpl/t/rpl_row_rec_comp_innodb.test new file mode 100644 index 00000000000..67e4c4fb14d --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_rec_comp_innodb.test @@ -0,0 +1,10 @@ +-- source include/have_binlog_format_row.inc +-- source include/master-slave.inc +-- source include/have_innodb.inc + +# +# BUG#52868 Wrong handling of NULL value during update, replication out of sync +# + +-- let $engine= InnoDB +-- source extra/rpl_tests/rpl_record_compare.test 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 new file mode 100644 index 00000000000..43fa99a51da --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test @@ -0,0 +1,31 @@ +-- source include/have_binlog_format_row.inc +-- source include/master-slave.inc + +# +# 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 +## Added here because AFAIK it's only MyISAM and NDB that use Field_bits + +-- source include/master-slave-reset.inc +-- connection master + +-- eval CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bit(5)) ENGINE=$engine 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; +-- sync_slave_with_master + +-- let $diff_table_1= master:test.t1 +-- let $diff_table_2= slave:test.t1 +-- source include/diff_tables.inc + +-- connection master +DROP TABLE t1; +-- sync_slave_with_master diff --git a/mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test b/mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test index 39a9522bf6c..f32ab1f01f0 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test +++ b/mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test @@ -8,3 +8,41 @@ let $engine_type=Innodb; --source extra/rpl_tests/rpl_mixing_engines.test + +# +# BUG#49522: Replication problem with mixed MyISAM/InnoDB +# + +-- source include/master-slave-reset.inc +-- connection master + +CREATE TABLE `t1` ( + `c1` int(10) unsigned NOT NULL AUTO_INCREMENT, + `c2` tinyint(1) unsigned DEFAULT NULL, + `c3` varchar(300) DEFAULT NULL, + `c4` int(10) unsigned NOT NULL, + `c5` int(10) unsigned DEFAULT NULL, + PRIMARY KEY (`c1`)) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- sync_slave_with_master +ALTER TABLE `t1` Engine=InnoDB; + +-- connection master +SET AUTOCOMMIT=0; + +INSERT INTO t1 (c1,c2,c3,c4,c5) VALUES (1, 1, 'X', 1, NULL); +COMMIT; +ROLLBACK; +SET AUTOCOMMIT=1; + +-- sync_slave_with_master + +-- let $diff_table_1=master:test.t1 +-- let $diff_table_2=slave:test.t1 +-- source include/diff_tables.inc + +-- connection master +DROP TABLE `t1`; +-- sync_slave_with_master + +-- source include/master-slave-end.inc diff --git a/mysql-test/suite/rpl_ndb/my.cnf b/mysql-test/suite/rpl_ndb/my.cnf index 191683fc9df..0c62988b220 100644 --- a/mysql-test/suite/rpl_ndb/my.cnf +++ b/mysql-test/suite/rpl_ndb/my.cnf @@ -19,6 +19,8 @@ mysqld= ndbcluster # Turn on bin logging log-bin= master-bin +# Cluster only supports row format +binlog-format= row [mysqld.1.1] @@ -32,6 +34,8 @@ log-bin= master-bin log-bin= slave-bin relay-log= slave-relay-bin +# Cluster only supports row format +binlog-format= row init-rpl-role= slave log-slave-updates diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result index 675a69d17a4..5327bfde7e0 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result @@ -4,6 +4,7 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; +SET binlog_format = STATEMENT; *** Test 1 *** diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test index 0d915b0aa00..5e54ca38dc1 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test @@ -27,9 +27,11 @@ --disable_query_log --source include/have_ndb.inc --source include/have_innodb.inc ---source include/have_binlog_format_statement.inc --source include/ndb_master-slave.inc --enable_query_log + +# statement format is supported because master uses innodb +SET binlog_format = STATEMENT; let $off_set = 6; let $rpl_format = 'SBR'; disable_query_log; diff --git a/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result b/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result index 5cb52734d21..b9ecef3e8cc 100644 --- a/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result +++ b/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result @@ -8,11 +8,15 @@ SELECT @start_session_value; 8388608 '#--------------------FN_DYNVARS_005_01-------------------------#' SET @@global.myisam_sort_buffer_size = 100; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '100' SET @@global.myisam_sort_buffer_size = DEFAULT; SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size 8388608 SET @@session.myisam_sort_buffer_size = 200; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '200' SET @@session.myisam_sort_buffer_size = DEFAULT; SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size @@ -28,9 +32,11 @@ SELECT @@session.myisam_sort_buffer_size = 8388608; 1 '#--------------------FN_DYNVARS_005_03-------------------------#' SET @@global.myisam_sort_buffer_size = 4; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '4' SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size -4 +4096 SET @@global.myisam_sort_buffer_size = 4294967295; SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size @@ -41,9 +47,11 @@ SELECT @@global.myisam_sort_buffer_size ; 655354 '#--------------------FN_DYNVARS_005_04-------------------------#' SET @@session.myisam_sort_buffer_size = 4; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '4' SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size -4 +4096 SET @@session.myisam_sort_buffer_size = 4294967295; SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size @@ -58,13 +66,13 @@ Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0' SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size -4 +4096 SET @@global.myisam_sort_buffer_size = -1024; Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '-1024' SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size -4 +4096 SET @@global.myisam_sort_buffer_size = 429496729533; Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '429496729533' @@ -101,28 +109,28 @@ Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0' SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size -4 +4096 SET @@session.myisam_sort_buffer_size = -2; Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '-2' SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size -4 +4096 SET @@session.myisam_sort_buffer_size = 65530.34; ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size -4 +4096 SET @@session.myisam_sort_buffer_size = test; ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size -4 +4096 SET @@session.myisam_sort_buffer_size = "test"; ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size -4 +4096 '#------------------FN_DYNVARS_005_06-----------------------#' SELECT @@global.myisam_sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES @@ -141,20 +149,24 @@ Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '1' SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size -4 +4096 SET @@global.myisam_sort_buffer_size = FALSE; Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0' SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size -4 +4096 '#---------------------FN_DYNVARS_001_09----------------------#' SET @@global.myisam_sort_buffer_size = 10; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '10' SELECT @@myisam_sort_buffer_size = @@global.myisam_sort_buffer_size ; @@myisam_sort_buffer_size = @@global.myisam_sort_buffer_size -0 +1 '#---------------------FN_DYNVARS_001_10----------------------#' SET @@myisam_sort_buffer_size = 100; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '100' SELECT @@myisam_sort_buffer_size = @@local.myisam_sort_buffer_size ; @@myisam_sort_buffer_size = @@local.myisam_sort_buffer_size 1 @@ -167,7 +179,7 @@ Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '1' SELECT @@myisam_sort_buffer_size ; @@myisam_sort_buffer_size -4 +4096 SELECT local.myisam_sort_buffer_size ; ERROR 42S02: Unknown table 'local' in field list SELECT session.myisam_sort_buffer_size ; diff --git a/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_64.result b/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_64.result index 2069b32fdcd..e6be3c28251 100644 --- a/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_64.result +++ b/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_64.result @@ -8,11 +8,15 @@ SELECT @start_session_value; 8388608 '#--------------------FN_DYNVARS_005_01-------------------------#' SET @@global.myisam_sort_buffer_size = 100; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '100' SET @@global.myisam_sort_buffer_size = DEFAULT; SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size 8388608 SET @@session.myisam_sort_buffer_size = 200; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '200' SET @@session.myisam_sort_buffer_size = DEFAULT; SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size @@ -28,9 +32,11 @@ SELECT @@session.myisam_sort_buffer_size = 8388608; 1 '#--------------------FN_DYNVARS_005_03-------------------------#' SET @@global.myisam_sort_buffer_size = 4; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '4' SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size -4 +4096 SET @@global.myisam_sort_buffer_size = 4294967295; SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size @@ -41,9 +47,11 @@ SELECT @@global.myisam_sort_buffer_size ; 655354 '#--------------------FN_DYNVARS_005_04-------------------------#' SET @@session.myisam_sort_buffer_size = 4; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '4' SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size -4 +4096 SET @@session.myisam_sort_buffer_size = 4294967295; SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size @@ -58,13 +66,13 @@ Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0' SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size -4 +4096 SET @@global.myisam_sort_buffer_size = -1024; Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '-1024' SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size -4 +4096 SET @@global.myisam_sort_buffer_size = 429496729533; SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size @@ -99,28 +107,28 @@ Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0' SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size -4 +4096 SET @@session.myisam_sort_buffer_size = -2; Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '-2' SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size -4 +4096 SET @@session.myisam_sort_buffer_size = 65530.34; ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size -4 +4096 SET @@session.myisam_sort_buffer_size = test; ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size -4 +4096 SET @@session.myisam_sort_buffer_size = "test"; ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size -4 +4096 '#------------------FN_DYNVARS_005_06-----------------------#' SELECT @@global.myisam_sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES @@ -139,20 +147,24 @@ Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '1' SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size -4 +4096 SET @@global.myisam_sort_buffer_size = FALSE; Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0' SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size -4 +4096 '#---------------------FN_DYNVARS_001_09----------------------#' SET @@global.myisam_sort_buffer_size = 10; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '10' SELECT @@myisam_sort_buffer_size = @@global.myisam_sort_buffer_size ; @@myisam_sort_buffer_size = @@global.myisam_sort_buffer_size -0 +1 '#---------------------FN_DYNVARS_001_10----------------------#' SET @@myisam_sort_buffer_size = 100; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '100' SELECT @@myisam_sort_buffer_size = @@local.myisam_sort_buffer_size ; @@myisam_sort_buffer_size = @@local.myisam_sort_buffer_size 1 @@ -165,7 +177,7 @@ Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '1' SELECT @@myisam_sort_buffer_size ; @@myisam_sort_buffer_size -4 +4096 SELECT local.myisam_sort_buffer_size ; ERROR 42S02: Unknown table 'local' in field list SELECT session.myisam_sort_buffer_size ; diff --git a/mysql-test/suite/sys_vars/r/secure_file_priv.result b/mysql-test/suite/sys_vars/r/secure_file_priv.result new file mode 100644 index 00000000000..eeeb9a58c0f --- /dev/null +++ b/mysql-test/suite/sys_vars/r/secure_file_priv.result @@ -0,0 +1,22 @@ +# +# Bug50373 --secure-file-priv="" +# +CREATE TABLE t1 (c1 VARCHAR(50)); +INSERT INTO t1 VALUES ("one"),("two"),("three"),("four"),("five"); +SHOW VARIABLES LIKE 'secure_file_priv'; +Variable_name Value +secure_file_priv +c1 +one +two +three +four +five +loaded_file +one +two +three +four +five + +DROP TABLE t1; diff --git a/mysql-test/suite/sys_vars/r/skip_name_resolve_basic.result b/mysql-test/suite/sys_vars/r/skip_name_resolve_basic.result new file mode 100644 index 00000000000..d22a39b32a0 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/skip_name_resolve_basic.result @@ -0,0 +1,23 @@ +SHOW VARIABLES LIKE 'skip_name_resolve'; +Variable_name Value +skip_name_resolve ON +SHOW GLOBAL VARIABLES LIKE 'skip_name_resolve'; +Variable_name Value +skip_name_resolve ON +SHOW SESSION VARIABLES LIKE 'skip_name_resolve'; +Variable_name Value +skip_name_resolve ON +SELECT @@skip_name_resolve; +@@skip_name_resolve +1 +SELECT @@LOCAL.skip_name_resolve; +ERROR HY000: Variable 'skip_name_resolve' is a GLOBAL variable +SELECT @@GLOBAL.skip_name_resolve; +@@GLOBAL.skip_name_resolve +1 +SET @@skip_name_resolve=0; +ERROR HY000: Variable 'skip_name_resolve' is a read only variable +SET @@LOCAL.skip_name_resolve=0; +ERROR HY000: Variable 'skip_name_resolve' is a read only variable +SET @@GLOBAL.skip_name_resolve=0; +ERROR HY000: Variable 'skip_name_resolve' is a read only variable diff --git a/mysql-test/suite/sys_vars/t/secure_file_priv-master.opt b/mysql-test/suite/sys_vars/t/secure_file_priv-master.opt new file mode 100644 index 00000000000..b41d9b04b96 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/secure_file_priv-master.opt @@ -0,0 +1 @@ +--secure_file_priv='' diff --git a/mysql-test/suite/sys_vars/t/secure_file_priv.test b/mysql-test/suite/sys_vars/t/secure_file_priv.test new file mode 100644 index 00000000000..7a534e7d6e4 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/secure_file_priv.test @@ -0,0 +1,21 @@ +--echo # +--echo # Bug50373 --secure-file-priv="" +--echo # +CREATE TABLE t1 (c1 VARCHAR(50)); +INSERT INTO t1 VALUES ("one"),("two"),("three"),("four"),("five"); +SHOW VARIABLES LIKE 'secure_file_priv'; +--disable_query_log +# Atempt to create a file where we normally aren't allowed to create one. +# Doing this in a portable manner is difficult but we should be able to +# count on the depth of the directory hierarchy used. Three steps up from +# the datadir is the 'mysql_test' directory. +--let $PROTECTED_FILE=`SELECT concat(@@datadir,'/../../../bug50373.txt')`; +--eval SELECT * FROM t1 INTO OUTFILE '$PROTECTED_FILE'; +DELETE FROM t1; +--eval LOAD DATA INFILE '$PROTECTED_FILE' INTO TABLE t1; +SELECT * FROM t1; +--eval SELECT load_file('$PROTECTED_FILE') AS loaded_file; +--enable_query_log +remove_file $PROTECTED_FILE; +DROP TABLE t1; + diff --git a/mysql-test/suite/sys_vars/t/secure_file_priv_basic.test b/mysql-test/suite/sys_vars/t/secure_file_priv_basic.test index fee18e441d1..836990cb70e 100644 --- a/mysql-test/suite/sys_vars/t/secure_file_priv_basic.test +++ b/mysql-test/suite/sys_vars/t/secure_file_priv_basic.test @@ -1,3 +1,5 @@ +--source include/not_var_link.inc + # # only global # diff --git a/mysql-test/suite/sys_vars/t/skip_name_resolve_basic-master.opt b/mysql-test/suite/sys_vars/t/skip_name_resolve_basic-master.opt new file mode 100644 index 00000000000..ab6ca1731f5 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/skip_name_resolve_basic-master.opt @@ -0,0 +1 @@ +--skip-name-resolve diff --git a/mysql-test/suite/sys_vars/t/skip_name_resolve_basic.test b/mysql-test/suite/sys_vars/t/skip_name_resolve_basic.test new file mode 100644 index 00000000000..69006a0f2b2 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/skip_name_resolve_basic.test @@ -0,0 +1,15 @@ +SHOW VARIABLES LIKE 'skip_name_resolve'; +SHOW GLOBAL VARIABLES LIKE 'skip_name_resolve'; +SHOW SESSION VARIABLES LIKE 'skip_name_resolve'; + +SELECT @@skip_name_resolve; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +SELECT @@LOCAL.skip_name_resolve; +SELECT @@GLOBAL.skip_name_resolve; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +SET @@skip_name_resolve=0; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +SET @@LOCAL.skip_name_resolve=0; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +SET @@GLOBAL.skip_name_resolve=0; diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test index b2545e98f3e..5b61176b0f6 100644 --- a/mysql-test/t/archive.test +++ b/mysql-test/t/archive.test @@ -1669,3 +1669,26 @@ FLUSH TABLE t1; SELECT * FROM t1; --error ER_BAD_TABLE_ERROR DROP TABLE t1; + + +--echo # +--echo # BUG#46565 - repair of partition fail for archive engine +--echo # +--echo # Installing corrupted table files for t1. +# bug46565 was created, filled and damaged as following: +# CREATE TABLE bug46565(a INT) ENGINE=archive; +# INSERT INTO bug46565 VALUES(1); +# FLUSH TABLE bug46565; +# INSERT INTO bug46565 VALUES(2),(3); +# FLUSH TABLE bug46565; +# dd if=bug46565.ARZ of=std_data/bug46565.ARZ bs=1 count=8670 +copy_file std_data/bug46565.frm $MYSQLD_DATADIR/test/t1.frm; +copy_file std_data/bug46565.ARZ $MYSQLD_DATADIR/test/t1.ARZ; +--error ER_CRASHED_ON_USAGE +SELECT * FROM t1; +REPAIR TABLE t1; +--error ER_CRASHED_ON_USAGE +SELECT * FROM t1; +REPAIR TABLE t1 EXTENDED; +SELECT * FROM t1; +DROP TABLE t1; diff --git a/mysql-test/t/bug46261-master.opt b/mysql-test/t/bug46261-master.opt new file mode 100644 index 00000000000..6be4269e809 --- /dev/null +++ b/mysql-test/t/bug46261-master.opt @@ -0,0 +1 @@ +--skip-grant-tables $EXAMPLE_PLUGIN_OPT diff --git a/mysql-test/t/bug46261.test b/mysql-test/t/bug46261.test new file mode 100644 index 00000000000..67bdc995850 --- /dev/null +++ b/mysql-test/t/bug46261.test @@ -0,0 +1,16 @@ +--source include/not_embedded.inc +--source include/have_example_plugin.inc + +--echo # +--echo # Bug#46261 Plugins can be installed with --skip-grant-tables +--echo # + +--replace_regex /\.dll/.so/ +--error ER_OPTION_PREVENTS_STATEMENT +eval INSTALL PLUGIN example SONAME $HA_EXAMPLE_SO; + +--replace_regex /\.dll/.so/ +--error ER_OPTION_PREVENTS_STATEMENT +eval UNINSTALL PLUGIN example; + +--echo End of 5.1 tests diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test index 8d4b478e68d..a6f3a2c2cbf 100644 --- a/mysql-test/t/ctype_ucs.test +++ b/mysql-test/t/ctype_ucs.test @@ -732,6 +732,15 @@ SELECT HEX(MONTHNAME(19700101)); SELECT HEX(DAYNAME(19700101)); SET character_set_connection=latin1; +--echo # +--echo # Bug#52120 create view cause Assertion failed: 0, file .\item_subselect.cc, line 817 +--echo # +CREATE TABLE t1 (a CHAR(1) CHARSET ascii, b CHAR(1) CHARSET latin1); +CREATE VIEW v1 AS SELECT 1 from t1 +WHERE t1.b <=> (SELECT a FROM t1 WHERE a < SOME(SELECT '1')); +DROP VIEW v1; +DROP TABLE t1; + --echo End of 5.0 tests diff --git a/mysql-test/t/delete.test b/mysql-test/t/delete.test index acd67e0e766..a21fff60d33 100644 --- a/mysql-test/t/delete.test +++ b/mysql-test/t/delete.test @@ -527,5 +527,17 @@ DELETE IGNORE FROM t1; DROP TABLE t1; +--echo # +--echo # Bug #53450: Crash/assertion +--echo # "virtual int ha_myisam::index_first(uchar*)") at assert.c:81 +--echo # + +CREATE TABLE t1 (a INT, b INT, c INT, + INDEX(a), INDEX(b), INDEX(c)); +INSERT INTO t1 VALUES (1,2,3), (4,5,6), (7,8,9); + +DELETE FROM t1 WHERE a = 10 OR b = 20 ORDER BY c LIMIT 1; + +DROP TABLE t1; --echo End of 5.1 tests diff --git a/mysql-test/t/error_simulation.test b/mysql-test/t/error_simulation.test index f730c95208e..7cd16a6bc5a 100644 --- a/mysql-test/t/error_simulation.test +++ b/mysql-test/t/error_simulation.test @@ -33,3 +33,19 @@ set tmp_table_size=default; DROP TABLE t1; +--echo # +--echo # Bug #50946: fast index creation still seems to copy the table +--echo # +CREATE TABLE t1 (a INT(100) NOT NULL); +INSERT INTO t1 VALUES (1), (0), (2); +SET SESSION debug='+d,alter_table_only_index_change'; +ALTER TABLE t1 ADD INDEX a(a); +SET SESSION debug=DEFAULT; +SHOW CREATE TABLE t1; +SELECT * FROM t1; +DROP TABLE t1; + + +--echo # +--echo # End of 5.1 tests +--echo # diff --git a/mysql-test/t/explain.test b/mysql-test/t/explain.test index 30366f6f67e..72406110de1 100644 --- a/mysql-test/t/explain.test +++ b/mysql-test/t/explain.test @@ -210,4 +210,17 @@ explain extended select * from t1 where f1=1; explain extended select * from t1 join t2 on f1=f2 where f1=1; drop table t1,t2; +--echo # +--echo # Bug #48419: another explain crash.. +--echo # +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (b BLOB, KEY b(b(100))); +INSERT INTO t2 VALUES ('1'), ('2'), ('3'); + +FLUSH TABLES; + +EXPLAIN SELECT 1 FROM t1 WHERE a = (SELECT 1 FROM t1 t JOIN t2 WHERE b <= 1 AND t.a); + +DROP TABLE t1, t2; + --echo End of 5.1 tests. diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test index 97a1b5e39dc..388b1432390 100644 --- a/mysql-test/t/fulltext.test +++ b/mysql-test/t/fulltext.test @@ -584,5 +584,14 @@ CREATE TABLE t1(a CHAR(1),FULLTEXT(a)); SELECT 1 FROM t1 WHERE MATCH(a) AGAINST ('') AND ROW(a,a) > ROW(1,1); DROP TABLE t1; +--echo # +--echo # BUG#51866 - crash with repair by sort and fulltext keys +--echo # +CREATE TABLE t1(a CHAR(4), FULLTEXT(a)); +INSERT INTO t1 VALUES('aaaa'); +SET myisam_sort_buffer_size=4; +REPAIR TABLE t1; +SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size; +DROP TABLE t1; --echo End of 5.1 tests diff --git a/mysql-test/t/func_concat.test b/mysql-test/t/func_concat.test index e24b4354b61..e56d1121808 100644 --- a/mysql-test/t/func_concat.test +++ b/mysql-test/t/func_concat.test @@ -124,4 +124,24 @@ SELECT @query; DROP PROCEDURE p1; +--echo # +--echo # Bug #40625: Concat fails on DOUBLE values in a Stored Procedure, +--echo # while DECIMAL works +--echo # + +DELIMITER //; +CREATE PROCEDURE p1() +BEGIN + DECLARE v1 DOUBLE(10,3); + SET v1= 100; + SET @s = CONCAT('########################################', 40 , v1); + SELECT @s; +END;// +DELIMITER ;// + +CALL p1(); +CALL p1(); + +DROP PROCEDURE p1; + --echo # End of 5.1 tests diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test index 0b4f0be114c..e191b9750e3 100644 --- a/mysql-test/t/func_gconcat.test +++ b/mysql-test/t/func_gconcat.test @@ -708,6 +708,18 @@ SELECT 1 FROM DROP TABLE t1; + +--echo # +--echo # Bug #52397: another crash with explain extended and group_concat +--echo # +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (0), (0); +EXPLAIN EXTENDED SELECT 1 FROM + (SELECT GROUP_CONCAT(t1.a ORDER BY t1.a ASC) FROM + t1 t2, t1 GROUP BY t1.a) AS d; +DROP TABLE t1; + + --echo End of 5.0 tests # diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 556a19efce5..10d35b16315 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -1354,6 +1354,17 @@ SELECT DECODE((SELECT ENCODE('secret', t1.a) FROM t1,t2 WHERE t1.a = t2.a GROUP DROP TABLE t1, t2; +--echo # +--echo # Bug#52164 Assertion failed: param.sort_length, file .\filesort.cc, line 149 +--echo # +CREATE TABLE t1 (a LONGBLOB NOT NULL); +INSERT INTO t1 VALUES (''),(''); +SELECT 1 FROM t1, t1 t2 +ORDER BY QUOTE(t1.a); +DROP TABLE t1; + +--echo End of 5.1 tests + --echo Start of 5.4 tests # # WL#4584 Internationalized number format diff --git a/mysql-test/t/gis-rtree.test b/mysql-test/t/gis-rtree.test index c5d5bfee861..b006096528e 100644 --- a/mysql-test/t/gis-rtree.test +++ b/mysql-test/t/gis-rtree.test @@ -914,14 +914,15 @@ HANDLER t1 READ a PREV; HANDLER t1 READ a LAST; HANDLER t1 CLOSE; -#TODO: re-enable this test please when bug #51877 is solved # second crash fixed when the tree has changed since the last search. -#HANDLER t1 OPEN; -#HANDLER t1 READ a FIRST; -#INSERT INTO t1 VALUES (GeomFromText('Polygon((40 40,60 40,60 60,40 60,40 40))')); -#HANDLER t1 READ a NEXT; -#HANDLER t1 CLOSE; -#TODO: end of the 51877 dependent section +HANDLER t1 OPEN; +HANDLER t1 READ a FIRST; +INSERT INTO t1 VALUES (GeomFromText('Polygon((40 40,60 40,60 60,40 60,40 40))')); +--echo # should not crash +--disable_result_log +HANDLER t1 READ a NEXT; +--enable_result_log +HANDLER t1 CLOSE; DROP TABLE t1; diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index bda48fb9ecf..de43d6a74b4 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -1554,6 +1554,30 @@ connection default; disconnect conn1; +# +# Bug #53371: COM_FIELD_LIST can be abused to bypass table level grants. +# + +CREATE DATABASE db1; +CREATE DATABASE db2; +GRANT SELECT ON db1.* to 'testbug'@localhost; +USE db2; +CREATE TABLE t1 (a INT); +USE test; +connect (con1,localhost,testbug,,db1); +--error ER_NO_SUCH_TABLE +SELECT * FROM `../db2/tb2`; +--error ER_TABLEACCESS_DENIED_ERROR +SELECT * FROM `../db2`.tb2; +--error ER_NO_SUCH_TABLE +SELECT * FROM `#mysql50#/../db2/tb2`; +connection default; +disconnect con1; +DROP USER 'testbug'@localhost; +DROP TABLE db2.t1; +DROP DATABASE db1; +DROP DATABASE db2; + # Wait till we reached the initial number of concurrent sessions --source include/wait_until_count_sessions.inc diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index 4f92ff65177..f90c1dc3c58 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -1206,6 +1206,21 @@ SELECT (SELECT t2.a FROM t2 WHERE t2.a = t1.a) aa, b, COUNT( b) DROP TABLE t1, t2; + +--echo # +--echo # Bug#52051: Aggregate functions incorrectly returns NULL from outer +--echo # join query +--echo # +CREATE TABLE t1 (a INT PRIMARY KEY); +CREATE TABLE t2 (a INT PRIMARY KEY); +INSERT INTO t2 VALUES (1), (2); +EXPLAIN SELECT MIN(t2.a) FROM t2 LEFT JOIN t1 ON t2.a = t1.a; +SELECT MIN(t2.a) FROM t2 LEFT JOIN t1 ON t2.a = t1.a; +EXPLAIN SELECT MAX(t2.a) FROM t2 LEFT JOIN t1 ON t2.a = t1.a; +SELECT MAX(t2.a) FROM t2 LEFT JOIN t1 ON t2.a = t1.a; +DROP TABLE t1, t2; + + --echo # --echo # End of 5.1 tests diff --git a/mysql-test/t/handler_myisam.test b/mysql-test/t/handler_myisam.test index da02a90af0f..868ba14480a 100644 --- a/mysql-test/t/handler_myisam.test +++ b/mysql-test/t/handler_myisam.test @@ -37,4 +37,15 @@ TRUNCATE t1; HANDLER t1 READ FIRST; DROP TABLE t1; +--echo # +--echo # BUG#51877 - HANDLER interface causes invalid memory read +--echo # +CREATE TABLE t1(a INT, KEY(a)); +HANDLER t1 OPEN; +HANDLER t1 READ a FIRST; +INSERT INTO t1 VALUES(1); +HANDLER t1 READ a NEXT; +HANDLER t1 CLOSE; +DROP TABLE t1; + --echo End of 5.1 tests diff --git a/mysql-test/t/having.test b/mysql-test/t/having.test index b68ba69b975..65bf9518a5c 100644 --- a/mysql-test/t/having.test +++ b/mysql-test/t/having.test @@ -498,4 +498,49 @@ HAVING (table2.f2 = 8); DROP TABLE t1; +--echo # +--echo # Bug#52336 Segfault / crash in 5.1 copy_fields (param=0x9872980) at sql_select.cc:15355 +--echo # +CREATE TABLE t1(f1 INT, f2 INT); +INSERT INTO t1 VALUES (10,8); +CREATE TABLE t2 (f1 INT); +INSERT INTO t2 VALUES (5); + +SELECT COUNT(f1) FROM t2 +HAVING (7, 9) IN (SELECT f1, MIN(f2) FROM t1); + +DROP TABLE t1, t2; + +CREATE TABLE t1 (f1 INT, f2 VARCHAR(1)); +INSERT INTO t1 VALUES (16,'f'); +INSERT INTO t1 VALUES (16,'f'); +CREATE TABLE t2 (f1 INT, f2 VARCHAR(1)); +INSERT INTO t2 VALUES (13,'f'); +INSERT INTO t2 VALUES (20,'f'); +CREATE TABLE t3 (f1 INT, f2 VARCHAR(1)); +INSERT INTO t3 VALUES (7,'f'); + +SELECT t1.f2 FROM t1 +STRAIGHT_JOIN (t2 JOIN t3 ON t3.f2 = t2.f2 ) ON t3 .f2 = t2 .f2 +HAVING ('v', 'i') NOT IN (SELECT f2, MIN(f2) FROM t1) +ORDER BY f2; + +DROP TABLES t1,t2,t3; + +--echo # +--echo # Bug#52340 Segfault: read_cached_record (tab=0x94a2634) at sql_select.cc:14411 +--echo # +CREATE TABLE t1 (f1 INT, f2 VARCHAR(1)); +INSERT INTO t1 VALUES (16,'d'); +CREATE TABLE t2 (f1 INT, f2 VARCHAR(1)); +INSERT INTO t2 VALUES (13,'e'); +INSERT INTO t2 VALUES (20,'d'); + +SELECT MAX(t2.f2) FROM t2 JOIN t1 ON t1.f2 +HAVING ('e' , 'd') IN +(SELECT ts1.f2, ts2.f2 FROM t2 ts1 JOIN t2 ts2 ON ts1.f1) +ORDER BY t1.f2; + +DROP TABLE t1,t2; + --echo End of 5.0 tests diff --git a/mysql-test/t/innodb_mysql.test b/mysql-test/t/innodb_mysql.test index 63eff93ba7f..f2c770cce42 100644 --- a/mysql-test/t/innodb_mysql.test +++ b/mysql-test/t/innodb_mysql.test @@ -589,6 +589,66 @@ ALTER TABLE t1 DROP INDEX k, ADD UNIQUE INDEX k (a,b); DROP TABLE t1; + +--echo # +--echo # Bug #47453: InnoDB incorrectly changes TIMESTAMP columns when +--echo # JOINed during an UPDATE +--echo # + +CREATE TABLE t1 (d INT) ENGINE=InnoDB; +CREATE TABLE t2 (a INT, b INT, + c TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP + ON UPDATE CURRENT_TIMESTAMP) ENGINE=InnoDB; + +--echo set up our data elements +INSERT INTO t1 (d) VALUES (1); +INSERT INTO t2 (a,b) VALUES (1,1); +SELECT SECOND(c) INTO @bug47453 FROM t2; + +SELECT SECOND(c)-@bug47453 FROM t1 JOIN t2 ON d=a; +UPDATE t1 JOIN t2 ON d=a SET b=1 WHERE a=1; +SELECT SECOND(c)-@bug47453 FROM t1 JOIN t2 ON d=a; + +SELECT SLEEP(1); + +UPDATE t1 JOIN t2 ON d=a SET b=1 WHERE a=1; + +--echo #should be 0 +SELECT SECOND(c)-@bug47453 FROM t1 JOIN t2 ON d=a; + +DROP TABLE t1, t2; + +--echo # +--echo # Bug #53334: wrong result for outer join with impossible ON condition +--echo # (see the same test case for MyISAM in join.test) +--echo # + +CREATE TABLE t1 (id INT PRIMARY KEY); +CREATE TABLE t2 (id INT); + +INSERT INTO t1 VALUES (75); +INSERT INTO t1 VALUES (79); +INSERT INTO t1 VALUES (78); +INSERT INTO t1 VALUES (77); +REPLACE INTO t1 VALUES (76); +REPLACE INTO t1 VALUES (76); +INSERT INTO t1 VALUES (104); +INSERT INTO t1 VALUES (103); +INSERT INTO t1 VALUES (102); +INSERT INTO t1 VALUES (101); +INSERT INTO t1 VALUES (105); +INSERT INTO t1 VALUES (106); +INSERT INTO t1 VALUES (107); + +INSERT INTO t2 VALUES (107),(75),(1000); + +SELECT t1.id,t2.id FROM t2 LEFT JOIN t1 ON t1.id>=74 AND t1.id<=0 + WHERE t2.id=75 AND t1.id IS NULL; +EXPLAIN SELECT t1.id,t2.id FROM t2 LEFT JOIN t1 ON t1.id>=74 AND t1.id<=0 + WHERE t2.id=75 AND t1.id IS NULL; + +DROP TABLE t1,t2; + --echo End of 5.1 tests diff --git a/mysql-test/t/join.test b/mysql-test/t/join.test index 761121313e5..43b373c9703 100644 --- a/mysql-test/t/join.test +++ b/mysql-test/t/join.test @@ -784,6 +784,40 @@ FROM DROP TABLE t1,t2,t3,t4,t5,t6; +--echo # +--echo # Bug#48483: crash in get_best_combination() +--echo # + +CREATE TABLE t1(f1 INT); +INSERT INTO t1 VALUES (1),(2); +CREATE VIEW v1 AS SELECT 1 FROM t1 LEFT JOIN t1 AS t2 on 1=1; +EXPLAIN EXTENDED +SELECT 1 FROM v1 right join v1 AS v2 ON RAND(); +DROP VIEW v1; +DROP TABLE t1; + +--echo # +--echo # Bug#52177 crash with explain, row comparison, join, text field +--echo # +CREATE TABLE t1 (a TINYINT, b TEXT, KEY (a)); +INSERT INTO t1 VALUES (0,''),(0,''); +FLUSH TABLES; +EXPLAIN SELECT 1 FROM t1 LEFT JOIN t1 a ON 1 +WHERE ROW(t1.a, 1111.11) = ROW(1111.11, 1111.11) AND +ROW(t1.b, 1111.11) <=> ROW('',''); +DROP TABLE t1; + +--echo # +--echo # Bug #50335: Assertion `!(order->used & map)' in eq_ref_table +--echo # + +CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, PRIMARY KEY (a,b)); +INSERT INTO t1 VALUES (0,0), (1,1); + +SELECT * FROM t1 STRAIGHT_JOIN t1 t2 ON t1.a=t2.a AND t1.a=t2.b ORDER BY t2.a, t1.a; + +DROP TABLE t1; + --echo End of 5.0 tests. @@ -817,15 +851,4 @@ ENGINE=MERGE UNION=(t1,t2); SELECT t1.a FROM mm1,t1; DROP TABLE t1, t2, mm1; ---echo # ---echo # Bug #50335: Assertion `!(order->used & map)' in eq_ref_table ---echo # - -CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, PRIMARY KEY (a,b)); -INSERT INTO t1 VALUES (0,0), (1,1); - -SELECT * FROM t1 STRAIGHT_JOIN t1 t2 ON t1.a=t2.a AND t1.a=t2.b ORDER BY t2.a, t1.a; - -DROP TABLE t1; - --echo End of 5.1 tests diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test index e3d68d71603..aaea8b3120b 100644 --- a/mysql-test/t/join_outer.test +++ b/mysql-test/t/join_outer.test @@ -913,4 +913,27 @@ WHERE (COALESCE(t1.f1, t2.f1), f3) IN ((1, 3), (2, 2)); DROP TABLE t1, t2; +--echo # +--echo # Bug#52357: Assertion failed: join->best_read in greedy_search +--echo # optimizer_search_depth=0 +--echo # +CREATE TABLE t1( a INT ); + +INSERT INTO t1 VALUES (1),(2); +SET optimizer_search_depth = 0; + +--echo # Should not core dump on query preparation +EXPLAIN +SELECT 1 +FROM t1 tt3 LEFT OUTER JOIN t1 tt4 ON 1 + LEFT OUTER JOIN t1 tt5 ON 1 + LEFT OUTER JOIN t1 tt6 ON 1 + LEFT OUTER JOIN t1 tt7 ON 1 + LEFT OUTER JOIN t1 tt8 ON 1 + RIGHT OUTER JOIN t1 tt2 ON 1 + RIGHT OUTER JOIN t1 tt1 ON 1 + STRAIGHT_JOIN t1 tt9 ON 1; + +SET optimizer_search_depth = DEFAULT; +DROP TABLE t1; --echo End of 5.1 tests diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test index 7bfe2491c7c..c10a7d82c43 100644 --- a/mysql-test/t/loaddata.test +++ b/mysql-test/t/loaddata.test @@ -153,10 +153,6 @@ select * from t1; # # It should not be possible to load from a file outside of vardir ---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR -show variables like "secure_file_pri%"; ---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR -select @@secure_file_priv; --error 1238 set @@secure_file_priv= 0; @@ -502,6 +498,13 @@ set session sql_mode=@OLD_SQL_MODE; DROP TABLE t1,t2; +--echo # +--echo # Bug #51893: crash with certain characters given to load_file +--echo # function on windows +--echo # + +select load_file(0x0A9FB76C661B409C4BEC88098C5DD71B1072F9691F2E827D7EC8F092B299868A3CE196C04F0FB18CAB4E1557EB72331D812379DE7A75CA21C32E7C722C59E5CC33EF262EF04187B0F0EE756FA984DF2EAD37B1E4ADB064C3C5038F2E3B2D661B1C1150AAEB5425512E14D7506166D92D4533872E662F4B2D1428AAB5CCA72E75AA2EF325E196A5A02E2E8278873C64375845994B0F39BE2FF7B478332A7B0AA5E48877C47B6F513E997848AF8CCB8A899F3393AB35333CF0871E36698193862D486B4B9078B70C0A0A507B8A250F3F876F5A067632D5E65193E4445A1EC3A2C9B4C6F07AC334F0F62BC33357CB502E9B1C19D2398B6972AEC2EF21630F8C9134C4F7DD662D8AD7BDC9E19C46720F334B66C22D4BF32ED275144E20E7669FFCF6FC143667C9F02A577F32960FA9F2371BE1FA90E49CBC69C01531F140556854D588DD0E55E1307D78CA38E975CD999F9AEA604266329EE62BFB5ADDA67F549E211ECFBA906C60063696352ABB82AA782D25B17E872EA587871F450446DB1BAE0123D20404A8F2D2698B371002E986C8FCB969A99FF0E150A2709E2ED7633D02ADA87D5B3C9487D27B2BD9D21E2EC3215DCC3CDCD884371281B95A2E9987AAF82EB499C058D9C3E7DC1B66635F60DB121C72F929622DD47B6B2E69F59FF2AE6B63CC2EC60FFBA20EA50569DBAB5DAEFAEB4F03966C9637AB55662EDD28439155A82D053A5299448EDB2E7BEB0F62889E2F84E6C7F34B3212C9AAC32D521D5AB8480993F1906D5450FAB342A0FA6ED223E178BAC036B81E15783604C32A961EA1EF20BE2EBB93D34ED37BC03142B7583303E4557E48551E4BD7CBDDEA146D5485A5D212C35189F0BD6497E66912D2780A59A53B532E12C0A5ED1EC0445D96E8F2DD825221CFE4A65A87AA21DC8750481B9849DD81694C3357A0ED9B78D608D8EDDE28FAFBEC17844DE5709F41E121838DB55639D77E32A259A416D7013B2EB1259FDE1B498CBB9CAEE1D601DF3C915EA91C69B44E6B72062F5F4B3C73F06F2D5AD185E1692E2E0A01E7DD5133693681C52EE13B2BE42D03BDCF48E4E133CF06662339B778E1C3034F9939A433E157449172F7969ACCE1F5D2F65A4E09E4A5D5611EBEDDDBDB0C0C0A); + --echo End of 5.0 tests @@ -532,5 +535,19 @@ SET character_set_filesystem=default; select @@character_set_filesystem; +--echo # +--echo # Bug #51850: crash/memory overlap when using load data infile and set +--echo # col equal to itself! +--echo # + +CREATE TABLE t1(col0 LONGBLOB); +SELECT 'test' INTO OUTFILE 't1.txt'; +LOAD DATA INFILE 't1.txt' IGNORE INTO TABLE t1 SET col0=col0; +SELECT * FROM t1; + +DROP TABLE t1; +let $MYSQLD_DATADIR= `select @@datadir`; +remove_file $MYSQLD_DATADIR/test/t1.txt; + --echo End of 5.1 tests diff --git a/mysql-test/t/log_state.test b/mysql-test/t/log_state.test index 4d8c8fc6e74..d47044fbbee 100644 --- a/mysql-test/t/log_state.test +++ b/mysql-test/t/log_state.test @@ -313,6 +313,42 @@ SET @@global.general_log_file = @old_general_log_file; SET @@global.slow_query_log = @old_slow_query_log; SET @@global.slow_query_log_file = @old_slow_query_log_file; +########################################################################### + +--echo # +--echo # Bug #49756 Rows_examined is always 0 in the slow query log +--echo # for update statements +--echo # + +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = "TABLE"; +SET GLOBAL slow_query_log = ON; +SET GLOBAL long_query_time = 0.001; + +# clear slow_log of any residual slow queries +TRUNCATE TABLE mysql.slow_log; +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (b INT, PRIMARY KEY (b)); +INSERT INTO t2 VALUES (3),(4); + +connect (con2,localhost,root,,); +INSERT INTO t1 VALUES (1+sleep(.01)),(2); +INSERT INTO t1 SELECT b+sleep(.01) from t2; +UPDATE t1 SET a=a+sleep(.01) WHERE a>2; +UPDATE t1 SET a=a+sleep(.01) ORDER BY a DESC; +UPDATE t2 set b=b+sleep(.01) limit 1; +UPDATE t1 SET a=a+sleep(.01) WHERE a in (SELECT b from t2); +DELETE FROM t1 WHERE a=a+sleep(.01) ORDER BY a LIMIT 2; + +SELECT rows_examined,sql_text FROM mysql.slow_log; +disconnect con2; +connection default; +DROP TABLE t1,t2; +TRUNCATE TABLE mysql.slow_log; + +--echo # end of bug#49756 + + --echo End of 5.1 tests @@ -361,6 +397,8 @@ disconnect con1; connection default; # Reset global system variables to initial values if forgotten somewhere above. +SET GLOBAL long_query_time = DEFAULT; +SET GLOBAL log_output = @old_log_output; SET global general_log = @old_general_log; SET global general_log_file = @old_general_log_file; SET global slow_query_log = @old_slow_query_log; diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index 5cfd7f9008a..8b250dbb586 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -445,12 +445,19 @@ FLUSH LOGS; # Transaction3 end --echo # ---echo # Test if the 'BEGIN', 'ROLLBACK' and 'COMMIT' are output if the database specified is exist +--echo # Test if the 'BEGIN', 'ROLLBACK' and 'COMMIT' are output if the database specified exists --exec $MYSQL_BINLOG --database=test --short-form $MYSQLTEST_VARDIR/std_data/binlog_transaction.000001 --echo # ---echo # Test if the 'BEGIN', 'ROLLBACK' and 'COMMIT' are output if the database specified is not exist +--echo # Test if the 'BEGIN', 'ROLLBACK' and 'COMMIT' are output if the database specified does not exist --exec $MYSQL_BINLOG --database=not_exist --short-form $MYSQLTEST_VARDIR/std_data/binlog_transaction.000001 +--echo # +--echo # Test if the 'SAVEPOINT', 'ROLLBACK TO' are output if the database specified exists +--exec $MYSQL_BINLOG --database=db1 --short-form $MYSQLTEST_VARDIR/std_data/binlog_savepoint.000001 +--echo # +--echo # Test if the 'SAVEPOINT', 'ROLLBACK TO' are output if the database specified does not exist +--exec $MYSQL_BINLOG --database=not_exist --short-form $MYSQLTEST_VARDIR/std_data/binlog_savepoint.000001 + --echo End of 5.0 tests --echo End of 5.1 tests diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index a260f13e58b..952a3f94fb2 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -1988,6 +1988,7 @@ drop table if exists `load`; create table `load` (a varchar(255)); --copy_file std_data/words.dat $MYSQLTEST_VARDIR/tmp/load.txt +--chmod 0644 $MYSQLTEST_VARDIR/tmp/load.txt --exec $MYSQL_IMPORT --ignore test $MYSQLTEST_VARDIR/tmp/load.txt @@ -2137,6 +2138,35 @@ SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c; SET NAMES default; DROP TABLE t1, t2; +########################################################################### + +--echo # +--echo # Bug #53088: mysqldump with -T & --default-character-set set +--echo # truncates text/blob to 766 chars +--echo # +--echo # Also see outfile_loaddata.test +--echo # + +CREATE TABLE t1 (a BLOB) CHARSET latin1; +CREATE TABLE t2 LIKE t1; + +let $table= t1; +let $dir= $MYSQLTEST_VARDIR/tmp; +let $file= $dir/$table.txt; +let $length= 800; + +--eval INSERT INTO t1 VALUES (REPEAT('.', $length)) + +--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --default-character-set=latin1 --tab=$dir/ test $table +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR + +--eval LOAD DATA INFILE '$file' INTO TABLE t2 CHARACTER SET latin1 +--remove_file $file + +--echo # should be $length +SELECT LENGTH(a) FROM t2; + +DROP TABLE t1, t2; ########################################################################### --echo # diff --git a/mysql-test/t/outfile_loaddata.test b/mysql-test/t/outfile_loaddata.test index 3f62acbd214..26760f9a1b2 100644 --- a/mysql-test/t/outfile_loaddata.test +++ b/mysql-test/t/outfile_loaddata.test @@ -251,6 +251,40 @@ SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c; SET NAMES default; DROP TABLE t1, t2; +########################################################################### + +--echo # +--echo # Bug #53088: mysqldump with -T & --default-character-set set +--echo # truncates text/blob to 766 chars +--echo # +--echo # Also see mysqldump.test +--echo # + +CREATE TABLE t1 (a BLOB) CHARSET latin1; +CREATE TABLE t2 LIKE t1; + +let $file= '$MYSQLTEST_VARDIR/tmp/bug53088.txt'; +let $length= 800; + +--eval INSERT INTO t1 VALUES (REPEAT('.', $length)) + +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--eval SELECT * INTO OUTFILE $file CHARACTER SET latin1 FROM t1 + +--echo # should be greater than $length +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--eval SELECT LENGTH(LOAD_FILE($file)) + +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--eval LOAD DATA INFILE $file INTO TABLE t2 + +--remove_file $MYSQLTEST_VARDIR/tmp/bug53088.txt + +--echo # should be $length +SELECT LENGTH(a) FROM t2; + +DROP TABLE t1, t2; + ########################################################################### --echo # End of 5.1 tests. diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index bcb5d4b5d92..1224dee24ed 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -2185,4 +2185,16 @@ SELECT * FROM t1; DROP TABLE t1; +--echo # +--echo # BUG#51868 - crash with myisam_use_mmap and partitioned myisam tables +--echo # +SET GLOBAL myisam_use_mmap=1; +CREATE TABLE t1(a INT) PARTITION BY HASH(a) PARTITIONS 1; +INSERT INTO t1 VALUES(0); +FLUSH TABLE t1; +TRUNCATE TABLE t1; +INSERT INTO t1 VALUES(0); +DROP TABLE t1; +SET GLOBAL myisam_use_mmap=default; + --echo End of 5.1 tests diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index dcea4d9828b..f7ce70c1d3a 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -3065,6 +3065,20 @@ select @plaintext; deallocate prepare encode; deallocate prepare decode; +--echo # +--echo # Bug#52124 memory leaks like a sieve in datetime, timestamp, time, date fields + warnings +--echo # +CREATE TABLE t1 (a DATETIME NOT NULL, b TINYINT); +INSERT INTO t1 VALUES (0, 0),(0, 0); +PREPARE stmt FROM "SELECT 1 FROM t1 WHERE +ROW(a, b) >= ROW('1', (SELECT 1 FROM t1 WHERE a > 1234))"; +--disable_warnings +EXECUTE stmt; +EXECUTE stmt; +--enable_warnings +DEALLOCATE PREPARE stmt; +DROP TABLE t1; + ########################################################################### --echo diff --git a/mysql-test/t/query_cache_with_views.test b/mysql-test/t/query_cache_with_views.test index d4ebe45b7ac..97e37c53aa3 100644 --- a/mysql-test/t/query_cache_with_views.test +++ b/mysql-test/t/query_cache_with_views.test @@ -126,5 +126,22 @@ show status like "Qcache_inserts"; show status like "Qcache_hits"; drop table t1; +--echo # +--echo # Bug46615 Assertion in Query_cache::invalidate in INSERT in a VIEW of a MERGE table +--echo # +CREATE TABLE t1 (c1 INT, c2 INT); +CREATE TABLE t2 LIKE t1; +SET AUTOCOMMIT=OFF; +CREATE VIEW t1_view AS SELECT c1 FROM t1 NATURAL JOIN t2 ; +# Before the bug patch the below INSERT stmt used to +# crash when other fields than the ones listed in the +# view definition were used. +--error ER_BAD_FIELD_ERROR +INSERT INTO t1_view (c1, c2) SELECT c1, c2 FROM t1; +DROP TABLE t1; +DROP TABLE t2; +DROP VIEW t1_view; +SET AUTOCOMMIT=DEFAULT; + # Reset default environment. set GLOBAL query_cache_size=default; diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test index 5d5ad180f1a..2d2a6f75d73 100644 --- a/mysql-test/t/range.test +++ b/mysql-test/t/range.test @@ -1313,4 +1313,45 @@ SELECT * FROM t1 FORCE INDEX (PRIMARY) DROP TABLE t1; +--echo # +--echo # Bug#50939: Loose Index Scan unduly relies on engine to remember range +--echo # endpoints +--echo # +CREATE TABLE t1 ( + a INT, + b INT, + KEY ( a, b ) +) PARTITION BY HASH (a) PARTITIONS 1; + +CREATE TABLE t2 ( + a INT, + b INT, + KEY ( a, b ) +); + +INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5); + +INSERT INTO t1 SELECT a + 5, b + 5 FROM t1; +INSERT INTO t1 SELECT a + 10, b + 10 FROM t1; +INSERT INTO t1 SELECT a + 20, b + 20 FROM t1; +INSERT INTO t1 SELECT a + 40, b + 40 FROM t1; + +INSERT INTO t2 SELECT * FROM t1; + +--echo # plans should be identical +EXPLAIN SELECT a, MAX(b) FROM t1 WHERE a IN (10,100) GROUP BY a; +EXPLAIN SELECT a, MAX(b) FROM t2 WHERE a IN (10,100) GROUP BY a; + +FLUSH status; +SELECT a, MAX(b) FROM t1 WHERE a IN (10, 100) GROUP BY a; +--echo # Should be no more than 4 reads. +SHOW status LIKE 'handler_read_key'; + +FLUSH status; +SELECT a, MAX(b) FROM t2 WHERE a IN (10, 100) GROUP BY a; +--echo # Should be no more than 4 reads. +SHOW status LIKE 'handler_read_key'; + +DROP TABLE t1, t2; + --echo End of 5.1 tests diff --git a/mysql-test/t/renamedb.test b/mysql-test/t/renamedb.test index 84315090b7a..71d0c127058 100644 --- a/mysql-test/t/renamedb.test +++ b/mysql-test/t/renamedb.test @@ -44,7 +44,7 @@ ALTER DATABASE `#mysql41#not-supported` UPGRADE DATA DIRECTORY NAME; --error ER_WRONG_USAGE ALTER DATABASE `#mysql51#not-yet` UPGRADE DATA DIRECTORY NAME; ---error ER_WRONG_USAGE +--error ER_WRONG_DB_NAME ALTER DATABASE `#mysql50#` UPGRADE DATA DIRECTORY NAME; --error ER_BAD_DB_ERROR diff --git a/mysql-test/t/row.test b/mysql-test/t/row.test index fcc4259168b..cec44078279 100644 --- a/mysql-test/t/row.test +++ b/mysql-test/t/row.test @@ -255,3 +255,14 @@ select * from t1,t2 where (a,b) = (c,d); select host,user from mysql.user where (host,user) = ('localhost','test'); drop table t1,t2; + +--echo # +--echo # Bug#52124 memory leaks like a sieve in datetime, timestamp, time, date fields + warnings +--echo # +CREATE TABLE t1 (a DATETIME NOT NULL, b TINYINT); +INSERT INTO t1 VALUES (0, 0),(0, 0); +--disable_warnings +SELECT 1 FROM t1 WHERE ROW(a, b) >= +ROW('1', (SELECT 1 FROM t1 WHERE a > 1234)); +--enable_warnings +DROP TABLE t1; diff --git a/mysql-test/t/skip_name_resolve.test b/mysql-test/t/skip_name_resolve.test index cd7ffe1690d..a14f3af5cd6 100644 --- a/mysql-test/t/skip_name_resolve.test +++ b/mysql-test/t/skip_name_resolve.test @@ -29,3 +29,24 @@ disconnect con1; # Wait till all disconnects are completed --source include/wait_until_count_sessions.inc +--echo # +--echo # Bug #37168: Missing variable - skip_name_resolve +--echo # + +SHOW VARIABLES LIKE 'skip_name_resolve'; +SHOW GLOBAL VARIABLES LIKE 'skip_name_resolve'; +SHOW SESSION VARIABLES LIKE 'skip_name_resolve'; + +SELECT @@skip_name_resolve; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +SELECT @@LOCAL.skip_name_resolve; +SELECT @@GLOBAL.skip_name_resolve; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +SET @@skip_name_resolve=0; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +SET @@LOCAL.skip_name_resolve=0; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +SET @@GLOBAL.skip_name_resolve=0; + +--echo End of 5.1 tests diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 50f2644ff9e..06aaf5dfb7f 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -3838,3 +3838,86 @@ DROP TABLE t1; --echo End of 5.1 tests. + +# +# Bug #47904 Incorrect results w/ table subquery, derived SQs, and LEFT JOIN on index +# + +--echo Set up test tables. +CREATE TABLE t1 ( + t1_id INT UNSIGNED, + + PRIMARY KEY(t1_id) +) Engine=MyISAM; + +INSERT INTO t1 (t1_id) VALUES (1), (2), (3), (4), (5); + +CREATE TABLE t2 SELECT * FROM t1; + +CREATE TABLE t3 ( + t3_id INT UNSIGNED AUTO_INCREMENT, + t1_id INT UNSIGNED, + amount DECIMAL(16,2), + + PRIMARY KEY(t3_id), + KEY(t1_id) +) Engine=MyISAM; + +INSERT INTO t3 (t1_id, t3_id, amount) + VALUES (1, 1, 100.00), (2, 2, 200.00), (4, 4, 400.00); + +--echo This is the 'inner query' running by itself. +--echo Produces correct results. +SELECT + t1.t1_id, + IFNULL((SELECT SUM(amount) FROM t3 WHERE t3.t1_id=t1.t1_id), 0) AS total_amount +FROM + t1 + LEFT JOIN t2 ON t2.t1_id=t1.t1_id +GROUP BY + t1.t1_id +; + +--echo SELECT * FROM (the same inner query) +--echo Produces correct results. +SELECT * FROM ( +SELECT + t1.t1_id, + IFNULL((SELECT SUM(amount) FROM t3 WHERE t3.t1_id=t1.t1_id), 0) AS total_amount +FROM + t1 + LEFT JOIN t2 ON t2.t1_id=t1.t1_id +GROUP BY + t1.t1_id +) AS t; + +--echo Now make t2.t1_id part of a key. +ALTER TABLE t2 ADD PRIMARY KEY(t1_id); + +--echo Same inner query by itself. +--echo Still correct results. +SELECT + t1.t1_id, + IFNULL((SELECT SUM(amount) FROM t3 WHERE t3.t1_id=t1.t1_id), 0) AS total_amount +FROM + t1 + LEFT JOIN t2 ON t2.t1_id=t1.t1_id +GROUP BY + t1.t1_id; + +--echo SELECT * FROM (the same inner query), now with indexes on the LEFT JOIN +SELECT * FROM ( +SELECT + t1.t1_id, + IFNULL((SELECT SUM(amount) FROM t3 WHERE t3.t1_id=t1.t1_id), 0) AS total_amount +FROM + t1 + LEFT JOIN t2 ON t2.t1_id=t1.t1_id +GROUP BY + t1.t1_id +) AS t; + + +DROP TABLE t3; +DROP TABLE t2; +DROP TABLE t1; diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test index c805dd40fe8..073fcd28246 100644 --- a/mysql-test/t/symlink.test +++ b/mysql-test/t/symlink.test @@ -249,4 +249,26 @@ eval CREATE TABLE t1(a INT) DATA DIRECTORY='$MYSQLTEST_VARDIR/tmp' INDEX DIRECTO DROP TABLE t1; SET @@SQL_MODE=@OLD_SQL_MODE; +--echo # +--echo # BUG#40980 - Drop table can remove another MyISAM table's +--echo # data and index files +--echo # +--mkdir $MYSQL_TMP_DIR/mysql +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +eval CREATE TABLE user(a INT) DATA DIRECTORY='$MYSQL_TMP_DIR/mysql' + INDEX DIRECTORY='$MYSQL_TMP_DIR/mysql'; +FLUSH TABLE user; +--echo # Symlinking mysql database to tmpdir +--remove_file $MYSQL_TMP_DIR/mysql/user.MYD +--remove_file $MYSQL_TMP_DIR/mysql/user.MYI +--rmdir $MYSQL_TMP_DIR/mysql +--exec ln -s $MYSQLD_DATADIR/mysql $MYSQL_TMP_DIR/mysql +FLUSH TABLE mysql.user; +DROP TABLE user; +FLUSH TABLE mysql.user; +--disable_result_log +SELECT * FROM mysql.user; +--enable_result_log +--remove_file $MYSQL_TMP_DIR/mysql + --echo End of 5.1 tests diff --git a/mysql-test/t/trigger.test b/mysql-test/t/trigger.test index 8ba21ed696a..2eb086cace5 100644 --- a/mysql-test/t/trigger.test +++ b/mysql-test/t/trigger.test @@ -2426,6 +2426,50 @@ INSERT IGNORE INTO t2 SET a = '777'; DROP TRIGGER trg1; DROP TABLE t1, t2; +# +# Bug #48525: trigger changes "Column 'id' cannot be null" behaviour +# +CREATE TABLE t1 (id INT NOT NULL); +CREATE TABLE t2 (id INT NOT NULL); +INSERT t1 VALUES (1),(2),(3); +UPDATE t1 SET id=NULL; +CREATE TRIGGER t1_bu BEFORE UPDATE ON t1 FOR EACH ROW + INSERT INTO t2 VALUES (3); +UPDATE t1 SET id=NULL; +DROP TRIGGER t1_bu; +DROP TABLE t1,t2; + +--echo # +--echo # Bug#50755: Crash if stored routine def contains version comments +--echo # + +--disable_warnings +DROP DATABASE IF EXISTS db1; +DROP TRIGGER IF EXISTS trg1; +DROP TABLE IF EXISTS t1, t2; +--enable_warnings + +CREATE DATABASE db1; +USE db1; + +CREATE TABLE t1 (b INT); +CREATE TABLE t2 (a INT); + +CREATE TRIGGER trg1 BEFORE INSERT ON t2 FOR EACH ROW INSERT/*!INTO*/t1 VALUES (1); +--echo # Used to crash +SHOW TRIGGERS IN db1; +--error ER_PARSE_ERROR +INSERT INTO t2 VALUES (1); +SELECT * FROM t1; + +--echo # Work around Bug#45235 +let $MYSQLD_DATADIR = `select @@datadir`; +--remove_file $MYSQLD_DATADIR/db1/t2.TRG +--remove_file $MYSQLD_DATADIR/db1/trg1.TRN + +DROP DATABASE db1; +USE test; + --echo End of 5.1 tests. diff --git a/mysql-test/t/upgrade.test b/mysql-test/t/upgrade.test index e390e8a1253..a7b9a1531ff 100644 --- a/mysql-test/t/upgrade.test +++ b/mysql-test/t/upgrade.test @@ -137,3 +137,37 @@ select * from `a-b-c`.v1; --enable_ps_protocol drop database `a-b-c`; use test; + +--echo # End of 5.0 tests + +--echo # +--echo # Bug #53804: serious flaws in the alter database .. upgrade data +--echo # directory name command +--echo # + +--error ER_BAD_DB_ERROR +ALTER DATABASE `#mysql50#:` UPGRADE DATA DIRECTORY NAME; +--error ER_WRONG_DB_NAME +ALTER DATABASE `#mysql50#.` UPGRADE DATA DIRECTORY NAME; +--error ER_WRONG_DB_NAME +ALTER DATABASE `#mysql50#../` UPGRADE DATA DIRECTORY NAME; +--error ER_WRONG_DB_NAME +ALTER DATABASE `#mysql50#../..` UPGRADE DATA DIRECTORY NAME; +--error ER_WRONG_DB_NAME +ALTER DATABASE `#mysql50#../../` UPGRADE DATA DIRECTORY NAME; +--error ER_WRONG_DB_NAME +ALTER DATABASE `#mysql50#./blablabla` UPGRADE DATA DIRECTORY NAME; +--error ER_WRONG_DB_NAME +ALTER DATABASE `#mysql50#../blablabla` UPGRADE DATA DIRECTORY NAME; +--error ER_WRONG_DB_NAME +ALTER DATABASE `#mysql50#/` UPGRADE DATA DIRECTORY NAME; +--error ER_WRONG_DB_NAME +ALTER DATABASE `#mysql50#/.` UPGRADE DATA DIRECTORY NAME; + +--error ER_WRONG_DB_NAME +USE `#mysql50#.`; +--error ER_WRONG_DB_NAME +USE `#mysql50#../blablabla`; + +--echo # End of 5.1 tests + diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 39fa78ef370..5e9d8473b20 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -1220,6 +1220,14 @@ SET @old_max_binlog_cache_size = @@GLOBAL.max_binlog_cache_size; SET GLOBAL max_binlog_cache_size = 5 * 1024 * 1024 * 1024; SELECT @@GLOBAL.max_binlog_cache_size; SET GLOBAL max_binlog_cache_size = @old_max_binlog_cache_size; + +--echo # +--echo # Bug #37168 : Missing variable - skip_name_resolve +--echo # + +SELECT @@skip_name_resolve; +SHOW VARIABLES LIKE 'skip_name_resolve'; + --echo End of 5.1 tests ########################################################################### diff --git a/mysql-test/t/variables_debug.test b/mysql-test/t/variables_debug.test index dac85345136..8fa2124137a 100644 --- a/mysql-test/t/variables_debug.test +++ b/mysql-test/t/variables_debug.test @@ -1,5 +1,7 @@ --source include/have_debug.inc +SET @old_debug = @@GLOBAL.debug; + # # Bug#34678 @@debug variable's incremental mode # @@ -20,3 +22,17 @@ SELECT @@session.debug, @@global.debug; SET SESSION debug = ''; SELECT @@session.debug, @@global.debug; + +--echo # +--echo # Bug #52629: memory leak from sys_var_thd_dbug in +--echo # binlog.binlog_write_error +--echo # + +SET GLOBAL debug='d,injecting_fault_writing'; +SELECT @@global.debug; +SET GLOBAL debug=''; +SELECT @@global.debug; + +SET GLOBAL debug=@old_debug; + +--echo End of 5.1 tests diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index d1a4d78e58f..4ef8b1898ae 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -3953,6 +3953,15 @@ ROW(1,1) >= ROW(1, (SELECT 1 FROM t1 WHERE f1 >= ANY ( SELECT '1' ))); DROP VIEW v1; DROP TABLE t1; +--echo # +--echo # Bug#52120 create view cause Assertion failed: 0, file .\item_subselect.cc, line 817 +--echo # +CREATE TABLE t1 (a CHAR(1) CHARSET latin1, b CHAR(1) CHARSET utf8); +CREATE VIEW v1 AS SELECT 1 from t1 +WHERE t1.b <=> (SELECT a FROM t1 WHERE a < SOME(SELECT '1')); +DROP VIEW v1; +DROP TABLE t1; + --echo # ----------------------------------------------------------------- --echo # -- End of 5.1 tests. --echo # ----------------------------------------------------------------- |