diff options
author | Sergei Golubchik <sergii@pisem.net> | 2012-03-28 01:04:46 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2012-03-28 01:04:46 +0200 |
commit | 20e706689df1eb87c696304797e9d6184c0a75bb (patch) | |
tree | ff3eab8fa3e060b34687c6e9819cb559ac67d5c5 /mysql-test | |
parent | 3d0775e9af2fcf3fe92b7f19e299ea23068eca1e (diff) | |
parent | bfaebe3f5e4b917c4498e234bad7a9d45d07ca62 (diff) | |
download | mariadb-git-20e706689df1eb87c696304797e9d6184c0a75bb.tar.gz |
mysql-5.5.22 merge
mysql-test/suite/innodb/t/group_commit_crash.test:
remove autoincrement to avoid rbr being used for insert ... select
mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test:
remove autoincrement to avoid rbr being used for insert ... select
mysys/my_addr_resolve.c:
a pointer to a buffer is returned to the caller -> the buffer cannot be on the stack
mysys/stacktrace.c:
my_vsnprintf() is ok here, in 5.5
Diffstat (limited to 'mysql-test')
71 files changed, 1132 insertions, 67 deletions
diff --git a/mysql-test/CMakeLists.txt b/mysql-test/CMakeLists.txt index 954e9c44311..f360ef1c616 100644 --- a/mysql-test/CMakeLists.txt +++ b/mysql-test/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental index b3623402065..1f4d29968a5 100644 --- a/mysql-test/collections/default.experimental +++ b/mysql-test/collections/default.experimental @@ -12,7 +12,6 @@ main.signal_demo3 @solaris # Bug#11753919 2010-01-20 alik Several main.sp @solaris # Bug#11753919 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun main.wait_timeout @solaris # Bug#11758972 2010-04-26 alik wait_timeout fails on OpenSolaris -rpl.rpl_heartbeat_basic # BUG#12403008 2011-04-27 sven fails sporadically rpl.rpl_innodb_bug28430 # Bug#11754425 rpl.rpl_row_sp011 @solaris # Bug#11753919 2011-07-25 sven Several test cases fail on Solaris with error Thread stack overrun diff --git a/mysql-test/extra/rpl_tests/rpl_insert_id_pk.test b/mysql-test/extra/rpl_tests/rpl_insert_id_pk.test index c3ecd9381c9..f6152180e7a 100644 --- a/mysql-test/extra/rpl_tests/rpl_insert_id_pk.test +++ b/mysql-test/extra/rpl_tests/rpl_insert_id_pk.test @@ -10,6 +10,8 @@ # We also check how the foreign_key_check variable is replicated -- source include/master-slave.inc +call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT."); + #should work for both SBR and RBR create table t1(a int auto_increment, primary key(a)); @@ -50,6 +52,7 @@ create table t2(b int auto_increment, c int, primary key(b)); insert into t1 values (10); insert into t1 values (null),(null),(null); insert into t2 values (5,0); +--disable_warnings ONCE insert into t2 (c) select * from t1 ORDER BY a; select * from t2 ORDER BY b; sync_slave_with_master; diff --git a/mysql-test/extra/rpl_tests/rpl_multi_update.test b/mysql-test/extra/rpl_tests/rpl_multi_update.test index bf7707f9d6d..cdbdbc191d7 100644 --- a/mysql-test/extra/rpl_tests/rpl_multi_update.test +++ b/mysql-test/extra/rpl_tests/rpl_multi_update.test @@ -1,5 +1,7 @@ source include/master-slave.inc; +call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.'); + eval CREATE TABLE t1 ( a int unsigned not null auto_increment primary key, b int unsigned @@ -11,6 +13,7 @@ eval CREATE TABLE t2 ( ) ENGINE=$engine_type; INSERT INTO t1 VALUES (NULL, 0); +--disable_warnings ONCE INSERT INTO t1 SELECT NULL, 0 FROM t1; INSERT INTO t2 VALUES (NULL, 0), (NULL,1); @@ -18,6 +21,7 @@ INSERT INTO t2 VALUES (NULL, 0), (NULL,1); SELECT * FROM t1 ORDER BY a; SELECT * FROM t2 ORDER BY a; +--disable_warnings ONCE UPDATE t1, t2 SET t1.b = t2.b WHERE t1.a = t2.a; sync_slave_with_master; diff --git a/mysql-test/extra/rpl_tests/rpl_multi_update2.test b/mysql-test/extra/rpl_tests/rpl_multi_update2.test index ae4261c0516..b85927a2aed 100644 --- a/mysql-test/extra/rpl_tests/rpl_multi_update2.test +++ b/mysql-test/extra/rpl_tests/rpl_multi_update2.test @@ -17,6 +17,8 @@ eval CREATE TABLE t2 ( ) ENGINE=$engine_type; INSERT INTO t1 VALUES (NULL, 0); + +--disable_warnings ONCE INSERT INTO t1 SELECT NULL, 0 FROM t1; INSERT INTO t2 VALUES (NULL, 0), (NULL,1); @@ -24,6 +26,7 @@ INSERT INTO t2 VALUES (NULL, 0), (NULL,1); SELECT * FROM t1 ORDER BY a; SELECT * FROM t2 ORDER BY a; +--disable_warnings ONCE UPDATE t1, t2 SET t1.b = (t2.b+4) WHERE t1.a = t2.a; SELECT * FROM t1 ORDER BY a; SELECT * FROM t2 ORDER BY a; diff --git a/mysql-test/extra/rpl_tests/rpl_multi_update3.test b/mysql-test/extra/rpl_tests/rpl_multi_update3.test index 6c7a980aecb..f7d4815e9e5 100644 --- a/mysql-test/extra/rpl_tests/rpl_multi_update3.test +++ b/mysql-test/extra/rpl_tests/rpl_multi_update3.test @@ -18,6 +18,8 @@ eval CREATE TABLE t2 ( ) ENGINE=$engine_type; INSERT INTO t1 VALUES (NULL, 0); + +--disable_warnings ONCE INSERT INTO t1 SELECT NULL, 0 FROM t1; INSERT INTO t2 VALUES (NULL, 0), (NULL,1); @@ -25,6 +27,7 @@ INSERT INTO t2 VALUES (NULL, 0), (NULL,1); SELECT * FROM t1 ORDER BY a; SELECT * FROM t2 ORDER BY a; +--disable_warnings ONCE UPDATE t2, (SELECT a FROM t1 ORDER BY a) AS t SET t2.b = t.a+5 ; SELECT * FROM t1 ORDER BY a; SELECT * FROM t2 ORDER BY a; diff --git a/mysql-test/extra/rpl_tests/rpl_start_stop_slave.test b/mysql-test/extra/rpl_tests/rpl_start_stop_slave.test index f828c79bc6a..40bc7746ccf 100644 --- a/mysql-test/extra/rpl_tests/rpl_start_stop_slave.test +++ b/mysql-test/extra/rpl_tests/rpl_start_stop_slave.test @@ -182,7 +182,8 @@ DROP TABLE t1; sync_slave_with_master; # -# bug#3593869-64035 uninitialized event_coordinates instance crashes server +# bug#3593869-64035 attempt to read a member of event_coordinates +# referenced by NULL pointer crashes server. # Testing how out of valid range position value is handled with an error. # diff --git a/mysql-test/include/mtr_check.sql b/mysql-test/include/mtr_check.sql index bcbb9b94136..82c0514b7cd 100644 --- a/mysql-test/include/mtr_check.sql +++ b/mysql-test/include/mtr_check.sql @@ -1,4 +1,4 @@ --- Copyright (c) 2008, 2010, Oracle and/or its affiliates +-- Copyright (c) 2008, 2011, Oracle and/or its affiliates -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by diff --git a/mysql-test/include/not_crashrep.inc b/mysql-test/include/not_crashrep.inc index e126f339a5f..7e0d6c19b85 100644 --- a/mysql-test/include/not_crashrep.inc +++ b/mysql-test/include/not_crashrep.inc @@ -22,3 +22,9 @@ EOF if ($crashrep) { --skip CrashReporter would popup a window } + +# the test will crash mysqld. flush tables now to make sure that +# system tables aren't corrupted by the crash +--disable_query_log ONCE +FLUSH TABLES; + diff --git a/mysql-test/mysql-stress-test.pl b/mysql-test/mysql-stress-test.pl index 860be1c1251..74394e2afbd 100755 --- a/mysql-test/mysql-stress-test.pl +++ b/mysql-test/mysql-stress-test.pl @@ -1,5 +1,21 @@ #!/usr/bin/perl +# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; version 2 +# of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + # ====================================================================== # MySQL server stress test system # ====================================================================== diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index bfa7f2bf4e6..fd695d1129f 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1,8 +1,8 @@ #!/usr/bin/perl # -*- cperl -*- -# Copyright (c) 2004, 2011, Oracle and/or its affiliates. -# Copyright (c) 2009-2011 Monty Program Ab +# Copyright (c) 2004, 2012, Oracle and/or its affiliates. +# Copyright (c) 2009, 2012, Monty Program Ab # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/mysql-test/r/bug13633383.result b/mysql-test/r/bug13633383.result new file mode 100644 index 00000000000..89b522724f9 --- /dev/null +++ b/mysql-test/r/bug13633383.result @@ -0,0 +1,53 @@ +# +# Bug#13633383 63183: SMALL SORT_BUFFER_SIZE CRASH IN MERGE_BUFFERS +# +CREATE TABLE t1 ( +`a` int(11) DEFAULT NULL, +`col432` bit(8) DEFAULT NULL, +`col433` multipoint DEFAULT NULL, +`col434` polygon DEFAULT NULL, +`col435` decimal(50,17) unsigned DEFAULT NULL, +`col436` geometry NOT NULL, +`col437` tinyblob NOT NULL, +`col438` multipolygon DEFAULT NULL, +`col439` mediumblob NOT NULL, +`col440` tinyblob NOT NULL, +`col441` double unsigned DEFAULT NULL +); +CREATE TABLE t2 ( +`a` multipoint DEFAULT NULL, +`col460` date DEFAULT NULL, +`col461` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, +`col462` date NOT NULL, +`col463` varbinary(89) NOT NULL, +`col464` year(4) DEFAULT NULL, +`col465` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', +`col466` varchar(236) CHARACTER SET utf8 NOT NULL, +`col467` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' +); +CREATE TABLE t3 ( +`FTS_DOC_ID` bigint(20) unsigned NOT NULL, +`col577` datetime DEFAULT NULL, +`col579` bit(38) NOT NULL, +`col580` varchar(93) NOT NULL, +`col581` datetime DEFAULT NULL, +`col583` multipolygon DEFAULT NULL, +`col584` bit(47) NOT NULL +); +set session sort_buffer_size= 32768; +select col435 +from t3 +natural right outer join t1 +natural right outer join t2 a +left outer join t2 b on 1 +group by +repeat('a',10000) desc, +repeat('a',10000) +with rollup +; +col435 +0.00000000000000000 +0.00000000000000000 +0.00000000000000000 +set session sort_buffer_size= default; +DROP TABLE t1, t2, t3; diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result index 163043c2cef..ebe8255fd8b 100644 --- a/mysql-test/r/join_outer.result +++ b/mysql-test/r/join_outer.result @@ -1648,6 +1648,64 @@ NULL NULL NULL DROP TABLE h,m,k; + +# BUG#12567331 - INFINITE LOOP WHEN RESOLVING AN ALIASED COLUMN +# USED IN GROUP BY + +CREATE TABLE t1 ( +col_varchar_1024_latin1_key varchar(1024), +col_varchar_10_latin1 varchar(10), +col_int int(11), +pk int(11) +); +CREATE TABLE t2 ( +col_int_key int(11), +col_int int(11), +pk int(11) +); +PREPARE prep_stmt_9846 FROM ' +SELECT alias1.pk AS field1 FROM +t1 AS alias1 +LEFT JOIN +( + t2 AS alias2 + RIGHT JOIN + ( + t2 AS alias3 + JOIN t1 AS alias4 + ON 1 + ) + ON 1 +) +ON 1 +GROUP BY field1'; +execute prep_stmt_9846; +field1 +execute prep_stmt_9846; +field1 +drop table t1,t2; +# +# Bug #11765810 58813: SERVER THREAD HANGS WHEN JOIN + WHERE + GROUP BY +# IS EXECUTED TWICE FROM P +# +CREATE TABLE t1 ( a INT ) ENGINE = MYISAM; +INSERT INTO t1 VALUES (1); +PREPARE prep_stmt FROM ' + SELECT 1 AS f FROM t1 + LEFT JOIN t1 t2 + RIGHT JOIN t1 t3 + JOIN t1 t4 + ON 1 + ON 1 + ON 1 + GROUP BY f'; +EXECUTE prep_stmt; +f +1 +EXECUTE prep_stmt; +f +1 +DROP TABLE t1; # # Bug#49600: outer join of two single-row tables with joining attributes # evaluated to nulls diff --git a/mysql-test/r/join_outer_jcl6.result b/mysql-test/r/join_outer_jcl6.result index b29c6241f14..3d0e4cbfc79 100644 --- a/mysql-test/r/join_outer_jcl6.result +++ b/mysql-test/r/join_outer_jcl6.result @@ -1659,6 +1659,64 @@ NULL NULL NULL DROP TABLE h,m,k; + +# BUG#12567331 - INFINITE LOOP WHEN RESOLVING AN ALIASED COLUMN +# USED IN GROUP BY + +CREATE TABLE t1 ( +col_varchar_1024_latin1_key varchar(1024), +col_varchar_10_latin1 varchar(10), +col_int int(11), +pk int(11) +); +CREATE TABLE t2 ( +col_int_key int(11), +col_int int(11), +pk int(11) +); +PREPARE prep_stmt_9846 FROM ' +SELECT alias1.pk AS field1 FROM +t1 AS alias1 +LEFT JOIN +( + t2 AS alias2 + RIGHT JOIN + ( + t2 AS alias3 + JOIN t1 AS alias4 + ON 1 + ) + ON 1 +) +ON 1 +GROUP BY field1'; +execute prep_stmt_9846; +field1 +execute prep_stmt_9846; +field1 +drop table t1,t2; +# +# Bug #11765810 58813: SERVER THREAD HANGS WHEN JOIN + WHERE + GROUP BY +# IS EXECUTED TWICE FROM P +# +CREATE TABLE t1 ( a INT ) ENGINE = MYISAM; +INSERT INTO t1 VALUES (1); +PREPARE prep_stmt FROM ' + SELECT 1 AS f FROM t1 + LEFT JOIN t1 t2 + RIGHT JOIN t1 t3 + JOIN t1 t4 + ON 1 + ON 1 + ON 1 + GROUP BY f'; +EXECUTE prep_stmt; +f +1 +EXECUTE prep_stmt; +f +1 +DROP TABLE t1; # # Bug#49600: outer join of two single-row tables with joining attributes # evaluated to nulls diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result index ca72521a819..e991326cdce 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -1,3 +1,4 @@ +CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT."); drop table if exists t1,t2,t3; drop database if exists mysqltest; drop view if exists v1; @@ -605,7 +606,8 @@ a b 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`; UPDATE t2,t1 SET t2.a=t1.a+2 +master-bin.000001 # Table_map # # table_id: # (test.t2) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT delete from t1; delete from t2; @@ -617,7 +619,8 @@ ERROR 23000: Duplicate entry '4' for key 'PRIMARY' 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`; UPDATE t2,t1 SET t2.a=t2.b where t2.a=t1.a +master-bin.000001 # Table_map # # table_id: # (test.t2) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT drop table t1, t2; set @@session.binlog_format= @sav_binlog_format; diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index 2a2197e7f98..64c61d4ee36 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -2494,6 +2494,19 @@ Table Op Msg_type Msg_text test.t1 check status OK DROP TABLE t1; SET GLOBAL myisam_use_mmap=default; +# +# BUG 11756869 - 48848: MYISAMCHK DOING SORT RECOVER IN CERTAIN +# CASES RESETS DATA POINTER TO SMAL +# +CREATE TABLE t1(a INT, KEY(a)); +ALTER TABLE t1 DISABLE KEYS; +SET @before:= (SELECT MAX_DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='test'); +FLUSH TABLES; +SET @after:= (SELECT MAX_DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='test'); +SELECT @before=@after; +@before=@after +1 +DROP TABLE t1; End of 5.1 tests # # Bug#51327 MyISAM table is automatically repaired on ALTER diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index 7c38fa18faa..1bc1ea31671 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -2354,6 +2354,46 @@ TRUNCATE TABLE t1; INSERT INTO t1 VALUES(0); DROP TABLE t1; SET GLOBAL myisam_use_mmap=default; +# +# Bug#13580775 ASSERTION FAILED: RECORD_LENGTH == M_RECORD_LENGTH, +# FILE FILESORT_UTILS.CC +# +CREATE TABLE t1 ( +a INT PRIMARY KEY, +b INT, +c CHAR(1), +d INT, +KEY (c,d) +) PARTITION BY KEY () PARTITIONS 1; +INSERT INTO t1 VALUES (1,1,'a',1), (2,2,'a',1); +SELECT 1 FROM t1 WHERE 1 IN +(SELECT group_concat(b) +FROM t1 +WHERE c > geomfromtext('point(1 1)') +GROUP BY b +); +1 +1 +1 +DROP TABLE t1; +# +# Bug#13011410 CRASH IN FILESORT CODE WITH GROUP BY/ROLLUP +# +CREATE TABLE t1 ( +a INT, +b MEDIUMINT, +c VARCHAR(300) CHARACTER SET hp8 COLLATE hp8_bin, +PRIMARY KEY (a,c(299))) +ENGINE=myisam +PARTITION BY LINEAR KEY () PARTITIONS 2; +INSERT INTO t1 VALUES (1,2,'test'), (2,3,'hi'), (4,5,'bye'); +SELECT 1 FROM t1 WHERE b < SOME +( SELECT 1 FROM t1 WHERE a >= 1 +GROUP BY b WITH ROLLUP +HAVING b > geomfromtext("") +); +1 +DROP TABLE t1; End of 5.1 tests # # BUG#55385: UPDATE statement throws an error, but still updates diff --git a/mysql-test/r/partition_error.result b/mysql-test/r/partition_error.result index 5cba49645b4..851c97c5ec3 100644 --- a/mysql-test/r/partition_error.result +++ b/mysql-test/r/partition_error.result @@ -1,5 +1,31 @@ drop table if exists t1, t2; # +# Bug#13608188 - 64038: CRASH IN HANDLER::HA_THD ON ALTER TABLE AFTER +# REPAIR NON-EXISTING PARTITION +# +CREATE TABLE t1 ( a INT, b INT ); +INSERT INTO t1 VALUES (5,3),(5,6); +ALTER TABLE t1 PARTITION BY KEY(b) PARTITIONS 3 ; +ALTER TABLE t1 REPAIR PARTITION p1, p3; +Table Op Msg_type Msg_text +test.t1 repair error Error in list of partitions to test.t1 +ALTER TABLE t1 ORDER BY b; +DROP TABLE t1; +# +# Bug#13593865 - 64037: CRASH IN HA_PARTITION::CREATE_HANDLERS ON +# ALTER TABLE AFTER DROP PARTITION +# +CREATE TABLE t1 (a INT) +PARTITION BY RANGE (a) +(PARTITION p0 VALUES LESS THAN (0), +PARTITION p1 VALUES LESS THAN MAXVALUE ) ; +ALTER TABLE t1 DROP PARTITION p1; +ALTER TABLE t1 ANALYZE PARTITION p0, p1; +Table Op Msg_type Msg_text +test.t1 analyze error Error in list of partitions to test.t1 +ALTER TABLE t1 COMMENT 'altered'; +DROP TABLE t1; +# # Bug#57924: crash when creating partitioned table with # multiple columns in the partition key # diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index b4a09091aa6..5f04544e0fb 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -1,3 +1,4 @@ +call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.'); drop table if exists t1,t2,t3,t4; drop database if exists client_test_db; create table t1 diff --git a/mysql-test/r/sp-bugs.result b/mysql-test/r/sp-bugs.result index 2425f40d9c2..7d08ffb2f71 100644 --- a/mysql-test/r/sp-bugs.result +++ b/mysql-test/r/sp-bugs.result @@ -111,4 +111,23 @@ DROP FUNCTION db1.f1; DROP TABLE db1.t1; DROP DATABASE db1; DROP DATABASE db2; +# +# Bug#13105873:valgrind warning:possible crash in foreign +# key handling on subsequent create table if not exists +# +DROP DATABASE IF EXISTS testdb; +CREATE DATABASE testdb; +USE testdb; +CREATE TABLE t1 (id1 INT PRIMARY KEY); +CREATE PROCEDURE `p1`() +BEGIN +CREATE TABLE IF NOT EXISTS t2(id INT PRIMARY KEY, +CONSTRAINT FK FOREIGN KEY (id) REFERENCES t1( id1 )); +END$ +CALL p1(); +# below stmt should not return valgrind warnings +CALL p1(); +Warnings: +Note 1050 Table 't2' already exists +DROP DATABASE testdb; End of 5.1 tests diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index c8743ab112d..ad54f9c0fdf 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -7746,3 +7746,26 @@ DROP PROCEDURE p1; DROP PROCEDURE p2; DROP TABLE t1; # End of 5.5 test +# +# Bug#12663165 SP DEAD CODE REMOVAL DOESN'T UNDERSTAND CONTINUE HANDLERS +# +DROP FUNCTION IF EXISTS f1; +CREATE FUNCTION f1() RETURNS INT +BEGIN +DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; +BEGIN +DECLARE CONTINUE HANDLER FOR SQLEXCEPTION RETURN f1(); +BEGIN +DECLARE CONTINUE HANDLER FOR SQLEXCEPTION RETURN f1(); +RETURN f1(); +END; +END; +RETURN 1; +END $ +SELECT f1(); +f1() +1 +Warnings: +Error 1424 Recursive stored functions and triggers are not allowed. +Error 1305 FUNCTION test.f1 does not exist +DROP FUNCTION f1; diff --git a/mysql-test/suite/binlog/r/binlog_unsafe.result b/mysql-test/suite/binlog/r/binlog_unsafe.result index 17ad4c6e5b1..2f994e9f5fc 100644 --- a/mysql-test/suite/binlog/r/binlog_unsafe.result +++ b/mysql-test/suite/binlog/r/binlog_unsafe.result @@ -1760,7 +1760,7 @@ SELECT COUNT(*) FROM mysql.general_log; Invoking function func_sidef_1 invoking statement that is unsafe in many ways. CREATE FUNCTION func_sidef_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES (47); INSERT DELAYED INTO double_autoinc_table SELECT CONCAT(UUID(), @@hostname, myfunc_int(), NULL) FROM mysql.general_log LIMIT 1; RETURN 0; END; -* binlog_format = STATEMENT: expect 6 warnings. +* binlog_format = STATEMENT: expect 7 warnings. INSERT INTO t1 SELECT func_sidef_1(); Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. @@ -1769,12 +1769,13 @@ Note 1592 Unsafe statement written to the binary log using statement format sinc Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a UDF which may not return the same value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Invoking function func_sidef_2 invoking function func_sidef_1 invoking statement that is unsafe in many ways. CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); RETURN 0; END; -* binlog_format = STATEMENT: expect 6 warnings. +* binlog_format = STATEMENT: expect 7 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. @@ -1783,13 +1784,14 @@ Note 1592 Unsafe statement written to the binary log using statement format sinc Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a UDF which may not return the same value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; Invoking procedure proc_2 invoking function func_sidef_1 invoking statement that is unsafe in many ways. CREATE PROCEDURE proc_2() BEGIN INSERT INTO t1 SELECT func_sidef_1(); INSERT INTO ta2 VALUES (47); END; -* binlog_format = STATEMENT: expect 6 warnings. +* binlog_format = STATEMENT: expect 7 warnings. CALL proc_2(); Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. @@ -1798,13 +1800,14 @@ Note 1592 Unsafe statement written to the binary log using statement format sinc Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a UDF which may not return the same value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PROCEDURE proc_2; Invoking trigger trig_2 invoking function func_sidef_1 invoking statement that is unsafe in many ways. CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; -* binlog_format = STATEMENT: expect 6 warnings. +* binlog_format = STATEMENT: expect 7 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. @@ -1813,6 +1816,7 @@ Note 1592 Unsafe statement written to the binary log using statement format sinc Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a UDF which may not return the same value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -1826,7 +1830,8 @@ Note 1592 Unsafe statement written to the binary log using statement format sinc Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a UDF which may not return the same value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. -* binlog_format = STATEMENT: expect 6 warnings. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave. +* binlog_format = STATEMENT: expect 7 warnings. INSERT INTO t2 SELECT * FROM view_sidef_2; Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. @@ -1835,13 +1840,14 @@ Note 1592 Unsafe statement written to the binary log using statement format sinc Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a UDF which may not return the same value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP VIEW view_sidef_2; Invoking prepared statement prep_2 invoking function func_sidef_1 invoking statement that is unsafe in many ways. PREPARE prep_2 FROM "INSERT INTO t1 SELECT func_sidef_1()"; -* binlog_format = STATEMENT: expect 6 warnings. +* binlog_format = STATEMENT: expect 7 warnings. EXECUTE prep_2; Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. @@ -1850,6 +1856,7 @@ Note 1592 Unsafe statement written to the binary log using statement format sinc Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a UDF which may not return the same value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -1857,7 +1864,7 @@ DROP FUNCTION func_sidef_1; Invoking procedure proc_1 invoking statement that is unsafe in many ways. CREATE PROCEDURE proc_1() BEGIN INSERT DELAYED INTO double_autoinc_table SELECT CONCAT(UUID(), @@hostname, myfunc_int(), NULL) FROM mysql.general_log LIMIT 1; INSERT INTO ta1 VALUES (47); END; -* binlog_format = STATEMENT: expect 6 warnings. +* binlog_format = STATEMENT: expect 7 warnings. CALL proc_1(); Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. @@ -1866,12 +1873,13 @@ Note 1592 Unsafe statement written to the binary log using statement format sinc Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a UDF which may not return the same value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Invoking function func_sidef_2 invoking procedure proc_1 invoking statement that is unsafe in many ways. CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); RETURN 0; END; -* binlog_format = STATEMENT: expect 6 warnings. +* binlog_format = STATEMENT: expect 7 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. @@ -1880,13 +1888,14 @@ Note 1592 Unsafe statement written to the binary log using statement format sinc Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a UDF which may not return the same value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; Invoking procedure proc_2 invoking procedure proc_1 invoking statement that is unsafe in many ways. CREATE PROCEDURE proc_2() BEGIN CALL proc_1(); INSERT INTO ta2 VALUES (47); END; -* binlog_format = STATEMENT: expect 6 warnings. +* binlog_format = STATEMENT: expect 7 warnings. CALL proc_2(); Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. @@ -1895,13 +1904,14 @@ Note 1592 Unsafe statement written to the binary log using statement format sinc Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a UDF which may not return the same value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PROCEDURE proc_2; Invoking trigger trig_2 invoking procedure proc_1 invoking statement that is unsafe in many ways. CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; -* binlog_format = STATEMENT: expect 6 warnings. +* binlog_format = STATEMENT: expect 7 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. @@ -1910,13 +1920,14 @@ Note 1592 Unsafe statement written to the binary log using statement format sinc Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a UDF which may not return the same value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; Invoking prepared statement prep_2 invoking procedure proc_1 invoking statement that is unsafe in many ways. PREPARE prep_2 FROM "CALL proc_1()"; -* binlog_format = STATEMENT: expect 6 warnings. +* binlog_format = STATEMENT: expect 7 warnings. EXECUTE prep_2; Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. @@ -1925,6 +1936,7 @@ Note 1592 Unsafe statement written to the binary log using statement format sinc Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a UDF which may not return the same value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -1932,7 +1944,7 @@ DROP PROCEDURE proc_1; Invoking trigger trig_1 invoking statement that is unsafe in many ways. CREATE TRIGGER trig_1 BEFORE INSERT ON trigger_table_1 FOR EACH ROW BEGIN INSERT INTO ta1 VALUES (47); INSERT DELAYED INTO double_autoinc_table SELECT CONCAT(UUID(), @@hostname, myfunc_int(), NULL) FROM mysql.general_log LIMIT 1; END; -* binlog_format = STATEMENT: expect 6 warnings. +* binlog_format = STATEMENT: expect 7 warnings. INSERT INTO trigger_table_1 VALUES (1); Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. @@ -1941,12 +1953,13 @@ Note 1592 Unsafe statement written to the binary log using statement format sinc Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a UDF which may not return the same value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Invoking function func_sidef_2 invoking trigger trig_1 invoking statement that is unsafe in many ways. CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); RETURN 0; END; -* binlog_format = STATEMENT: expect 6 warnings. +* binlog_format = STATEMENT: expect 7 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. @@ -1955,13 +1968,14 @@ Note 1592 Unsafe statement written to the binary log using statement format sinc Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a UDF which may not return the same value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; Invoking procedure proc_2 invoking trigger trig_1 invoking statement that is unsafe in many ways. CREATE PROCEDURE proc_2() BEGIN INSERT INTO trigger_table_1 VALUES (1); INSERT INTO ta2 VALUES (47); END; -* binlog_format = STATEMENT: expect 6 warnings. +* binlog_format = STATEMENT: expect 7 warnings. CALL proc_2(); Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. @@ -1970,13 +1984,14 @@ Note 1592 Unsafe statement written to the binary log using statement format sinc Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a UDF which may not return the same value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PROCEDURE proc_2; Invoking trigger trig_2 invoking trigger trig_1 invoking statement that is unsafe in many ways. CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; -* binlog_format = STATEMENT: expect 6 warnings. +* binlog_format = STATEMENT: expect 7 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. @@ -1985,13 +2000,14 @@ Note 1592 Unsafe statement written to the binary log using statement format sinc Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a UDF which may not return the same value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; Invoking prepared statement prep_2 invoking trigger trig_1 invoking statement that is unsafe in many ways. PREPARE prep_2 FROM "INSERT INTO trigger_table_1 VALUES (1)"; -* binlog_format = STATEMENT: expect 6 warnings. +* binlog_format = STATEMENT: expect 7 warnings. EXECUTE prep_2; Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. @@ -2000,6 +2016,7 @@ Note 1592 Unsafe statement written to the binary log using statement format sinc Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a UDF which may not return the same value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -2007,7 +2024,7 @@ DROP TRIGGER trig_1; Invoking prepared statement prep_1 invoking statement that is unsafe in many ways. PREPARE prep_1 FROM "INSERT DELAYED INTO double_autoinc_table SELECT CONCAT(UUID(), @@hostname, myfunc_int(), NULL) FROM mysql.general_log LIMIT 1"; -* binlog_format = STATEMENT: expect 6 warnings. +* binlog_format = STATEMENT: expect 7 warnings. EXECUTE prep_1; Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. @@ -2016,12 +2033,13 @@ Note 1592 Unsafe statement written to the binary log using statement format sinc Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a UDF which may not return the same value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_1; Invoking statement that is unsafe in many ways. -* binlog_format = STATEMENT: expect 6 warnings. +* binlog_format = STATEMENT: expect 7 warnings. INSERT DELAYED INTO double_autoinc_table SELECT CONCAT(UUID(), @@hostname, myfunc_int(), NULL) FROM mysql.general_log LIMIT 1; Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. @@ -2030,6 +2048,7 @@ Note 1592 Unsafe statement written to the binary log using statement format sinc Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a UDF which may not return the same value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. diff --git a/mysql-test/suite/binlog/t/binlog_unsafe.test b/mysql-test/suite/binlog/t/binlog_unsafe.test index c64b9197b51..3353855fd0c 100644 --- a/mysql-test/suite/binlog/t/binlog_unsafe.test +++ b/mysql-test/suite/binlog/t/binlog_unsafe.test @@ -233,7 +233,7 @@ while ($unsafe_type < 9) { --let $value_0= --let $sel_sidef_0= --let $sel_retval_0= - --let $CRC_ARG_expected_number_of_warnings= 6 + --let $CRC_ARG_expected_number_of_warnings= 7 } if ($unsafe_type == 8) { diff --git a/mysql-test/suite/engines/funcs/r/db_alter_collate_ascii.result b/mysql-test/suite/engines/funcs/r/db_alter_collate_ascii.result index fdd76f93c10..6a9bfae27db 100644 --- a/mysql-test/suite/engines/funcs/r/db_alter_collate_ascii.result +++ b/mysql-test/suite/engines/funcs/r/db_alter_collate_ascii.result @@ -77,6 +77,7 @@ utf8_persian_ci utf8 208 # # utf8_esperanto_ci utf8 209 # # utf8_hungarian_ci utf8 210 # # utf8_sinhala_ci utf8 211 # # +utf8_general_mysql500_ci utf8 223 # # ucs2_general_ci ucs2 35 Yes # # ucs2_bin ucs2 90 # # ucs2_unicode_ci ucs2 128 # # @@ -99,6 +100,7 @@ ucs2_persian_ci ucs2 144 # # ucs2_esperanto_ci ucs2 145 # # ucs2_hungarian_ci ucs2 146 # # ucs2_sinhala_ci ucs2 147 # # +ucs2_general_mysql500_ci ucs2 159 # # cp866_general_ci cp866 36 Yes # # cp866_bin cp866 68 # # keybcs2_general_ci keybcs2 37 Yes # # diff --git a/mysql-test/suite/engines/funcs/r/db_alter_collate_utf8.result b/mysql-test/suite/engines/funcs/r/db_alter_collate_utf8.result index 4a41ece1fe5..79d1d4cbac2 100644 --- a/mysql-test/suite/engines/funcs/r/db_alter_collate_utf8.result +++ b/mysql-test/suite/engines/funcs/r/db_alter_collate_utf8.result @@ -77,6 +77,7 @@ utf8_persian_ci utf8 208 # # utf8_esperanto_ci utf8 209 # # utf8_hungarian_ci utf8 210 # # utf8_sinhala_ci utf8 211 # # +utf8_general_mysql500_ci utf8 223 # # ucs2_general_ci ucs2 35 Yes # # ucs2_bin ucs2 90 # # ucs2_unicode_ci ucs2 128 # # @@ -99,6 +100,7 @@ ucs2_persian_ci ucs2 144 # # ucs2_esperanto_ci ucs2 145 # # ucs2_hungarian_ci ucs2 146 # # ucs2_sinhala_ci ucs2 147 # # +ucs2_general_mysql500_ci ucs2 159 # # cp866_general_ci cp866 36 Yes # # cp866_bin cp866 68 # # keybcs2_general_ci keybcs2 37 Yes # # diff --git a/mysql-test/suite/innodb/r/group_commit_crash.result b/mysql-test/suite/innodb/r/group_commit_crash.result index 333e47f38ad..cd47ba62ff2 100644 --- a/mysql-test/suite/innodb/r/group_commit_crash.result +++ b/mysql-test/suite/innodb/r/group_commit_crash.result @@ -2,7 +2,7 @@ CREATE TABLE t1(a CHAR(255), b CHAR(255), c CHAR(255), d CHAR(255), -id INT AUTO_INCREMENT, +id INT, PRIMARY KEY(id)) ENGINE=InnoDB; create table t2 like t1; create procedure setcrash(IN i INT) @@ -17,16 +17,16 @@ ELSE BEGIN END; END CASE; end // FLUSH TABLES; -INSERT INTO t2(a, b, c, d) VALUES ('a', 'b', 'c', 'd'); -INSERT INTO t2(a, b, c, d) VALUES ('a', 'b', 'c', 'd'); -INSERT INTO t2(a, b, c, d) VALUES ('a', 'b', 'c', 'd'); -INSERT INTO t2(a, b, c, d) VALUES ('a', 'b', 'c', 'd'); -INSERT INTO t2(a, b, c, d) VALUES ('a', 'b', 'c', 'd'); -INSERT INTO t2(a, b, c, d) VALUES ('a', 'b', 'c', 'd'); -INSERT INTO t2(a, b, c, d) VALUES ('a', 'b', 'c', 'd'); -INSERT INTO t2(a, b, c, d) VALUES ('a', 'b', 'c', 'd'); -INSERT INTO t2(a, b, c, d) VALUES ('a', 'b', 'c', 'd'); -INSERT INTO t2(a, b, c, d) VALUES ('a', 'b', 'c', 'd'); +INSERT INTO t2(a, b, c, d, id) VALUES ('a', 'b', 'c', 'd', 9+1); +INSERT INTO t2(a, b, c, d, id) VALUES ('a', 'b', 'c', 'd', 8+1); +INSERT INTO t2(a, b, c, d, id) VALUES ('a', 'b', 'c', 'd', 7+1); +INSERT INTO t2(a, b, c, d, id) VALUES ('a', 'b', 'c', 'd', 6+1); +INSERT INTO t2(a, b, c, d, id) VALUES ('a', 'b', 'c', 'd', 5+1); +INSERT INTO t2(a, b, c, d, id) VALUES ('a', 'b', 'c', 'd', 4+1); +INSERT INTO t2(a, b, c, d, id) VALUES ('a', 'b', 'c', 'd', 3+1); +INSERT INTO t2(a, b, c, d, id) VALUES ('a', 'b', 'c', 'd', 2+1); +INSERT INTO t2(a, b, c, d, id) VALUES ('a', 'b', 'c', 'd', 1+1); +INSERT INTO t2(a, b, c, d, id) VALUES ('a', 'b', 'c', 'd', 0+1); SET binlog_format= mixed; RESET MASTER; START TRANSACTION; diff --git a/mysql-test/suite/innodb/r/group_commit_crash_no_optimize_thread.result b/mysql-test/suite/innodb/r/group_commit_crash_no_optimize_thread.result index 333e47f38ad..c1ae510d45b 100644 --- a/mysql-test/suite/innodb/r/group_commit_crash_no_optimize_thread.result +++ b/mysql-test/suite/innodb/r/group_commit_crash_no_optimize_thread.result @@ -2,7 +2,7 @@ CREATE TABLE t1(a CHAR(255), b CHAR(255), c CHAR(255), d CHAR(255), -id INT AUTO_INCREMENT, +id INT, PRIMARY KEY(id)) ENGINE=InnoDB; create table t2 like t1; create procedure setcrash(IN i INT) @@ -17,16 +17,16 @@ ELSE BEGIN END; END CASE; end // FLUSH TABLES; -INSERT INTO t2(a, b, c, d) VALUES ('a', 'b', 'c', 'd'); -INSERT INTO t2(a, b, c, d) VALUES ('a', 'b', 'c', 'd'); -INSERT INTO t2(a, b, c, d) VALUES ('a', 'b', 'c', 'd'); -INSERT INTO t2(a, b, c, d) VALUES ('a', 'b', 'c', 'd'); -INSERT INTO t2(a, b, c, d) VALUES ('a', 'b', 'c', 'd'); -INSERT INTO t2(a, b, c, d) VALUES ('a', 'b', 'c', 'd'); -INSERT INTO t2(a, b, c, d) VALUES ('a', 'b', 'c', 'd'); -INSERT INTO t2(a, b, c, d) VALUES ('a', 'b', 'c', 'd'); -INSERT INTO t2(a, b, c, d) VALUES ('a', 'b', 'c', 'd'); -INSERT INTO t2(a, b, c, d) VALUES ('a', 'b', 'c', 'd'); +INSERT INTO t2(a, b, c, d, id) VALUES ('a', 'b', 'c', 'd', 1+9); +INSERT INTO t2(a, b, c, d, id) VALUES ('a', 'b', 'c', 'd', 1+8); +INSERT INTO t2(a, b, c, d, id) VALUES ('a', 'b', 'c', 'd', 1+7); +INSERT INTO t2(a, b, c, d, id) VALUES ('a', 'b', 'c', 'd', 1+6); +INSERT INTO t2(a, b, c, d, id) VALUES ('a', 'b', 'c', 'd', 1+5); +INSERT INTO t2(a, b, c, d, id) VALUES ('a', 'b', 'c', 'd', 1+4); +INSERT INTO t2(a, b, c, d, id) VALUES ('a', 'b', 'c', 'd', 1+3); +INSERT INTO t2(a, b, c, d, id) VALUES ('a', 'b', 'c', 'd', 1+2); +INSERT INTO t2(a, b, c, d, id) VALUES ('a', 'b', 'c', 'd', 1+1); +INSERT INTO t2(a, b, c, d, id) VALUES ('a', 'b', 'c', 'd', 1+0); SET binlog_format= mixed; RESET MASTER; START TRANSACTION; diff --git a/mysql-test/suite/innodb/r/innodb-blob.result b/mysql-test/suite/innodb/r/innodb-blob.result new file mode 100644 index 00000000000..a90f83945e0 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb-blob.result @@ -0,0 +1,119 @@ +CREATE TABLE t1 (a INT PRIMARY KEY, b TEXT) ENGINE=InnoDB; +CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE t3 (a INT PRIMARY KEY, b TEXT, c TEXT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1,REPEAT('a',30000)),(2,REPEAT('b',40000)); +SET DEBUG_SYNC='before_row_upd_extern SIGNAL have_latch WAIT_FOR go1'; +BEGIN; +UPDATE t1 SET a=a+2; +ROLLBACK; +BEGIN; +UPDATE t1 SET b=CONCAT(b,'foo'); +SET DEBUG_SYNC='now WAIT_FOR have_latch'; +SELECT a, RIGHT(b,20) FROM t1; +SET DEBUG_SYNC='now SIGNAL go1'; +a RIGHT(b,20) +1 aaaaaaaaaaaaaaaaaaaa +2 bbbbbbbbbbbbbbbbbbbb +SET DEBUG_DBUG='+d,row_ins_extern_checkpoint'; +SET DEBUG_SYNC='before_row_ins_extern_latch SIGNAL rec_not_blob WAIT_FOR crash'; +ROLLBACK; +BEGIN; +INSERT INTO t1 VALUES (3,REPEAT('c',50000)); +SET DEBUG_SYNC='now WAIT_FOR rec_not_blob'; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +SELECT @@tx_isolation; +@@tx_isolation +READ-UNCOMMITTED +SELECT a, RIGHT(b,20) FROM t1; +a RIGHT(b,20) +1 aaaaaaaaaaaaaaaaaaaa +2 bbbbbbbbbbbbbbbbbbbb +SELECT a FROM t1; +a +1 +2 +3 +SET DEBUG_DBUG='+d,crash_commit_before'; +INSERT INTO t2 VALUES (42); +ERROR HY000: Lost connection to MySQL server during query +ERROR HY000: Lost connection to MySQL server during query +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t3 VALUES +(1,REPEAT('d',7000),REPEAT('e',100)), +(2,REPEAT('g',7000),REPEAT('h',100)); +SET DEBUG_SYNC='before_row_upd_extern SIGNAL have_latch WAIT_FOR go'; +UPDATE t3 SET c=REPEAT('f',3000) WHERE a=1; +SET DEBUG_SYNC='now WAIT_FOR have_latch'; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +SELECT @@tx_isolation; +@@tx_isolation +READ-UNCOMMITTED +SELECT a, RIGHT(b,20), RIGHT(c,20) FROM t3; +SET DEBUG_SYNC='now SIGNAL go'; +a RIGHT(b,20) RIGHT(c,20) +1 dddddddddddddddddddd ffffffffffffffffffff +2 gggggggggggggggggggg hhhhhhhhhhhhhhhhhhhh +CHECK TABLE t1,t2,t3; +Table Op Msg_type Msg_text +test.t1 check status OK +test.t2 check status OK +test.t3 check status OK +BEGIN; +INSERT INTO t2 VALUES (347); +SET DEBUG_DBUG='+d,row_upd_extern_checkpoint'; +SET DEBUG_SYNC='before_row_upd_extern SIGNAL have_latch WAIT_FOR crash'; +UPDATE t3 SET c=REPEAT('i',3000) WHERE a=2; +SET DEBUG_SYNC='now WAIT_FOR have_latch'; +SELECT info FROM information_schema.processlist +WHERE state = 'debug sync point: before_row_upd_extern'; +info +UPDATE t3 SET c=REPEAT('i',3000) WHERE a=2 +SET DEBUG_DBUG='+d,crash_commit_before'; +COMMIT; +ERROR HY000: Lost connection to MySQL server during query +ERROR HY000: Lost connection to MySQL server during query +CHECK TABLE t1,t2,t3; +Table Op Msg_type Msg_text +test.t1 check status OK +test.t2 check status OK +test.t3 check status OK +SELECT a, RIGHT(b,20), RIGHT(c,20) FROM t3; +a RIGHT(b,20) RIGHT(c,20) +1 dddddddddddddddddddd ffffffffffffffffffff +2 gggggggggggggggggggg hhhhhhhhhhhhhhhhhhhh +SELECT a FROM t3; +a +1 +2 +BEGIN; +INSERT INTO t2 VALUES (33101); +SET DEBUG_DBUG='+d,row_upd_extern_checkpoint'; +SET DEBUG_SYNC='after_row_upd_extern SIGNAL have_latch WAIT_FOR crash'; +UPDATE t3 SET c=REPEAT('j',3000) WHERE a=2; +SET DEBUG_SYNC='now WAIT_FOR have_latch'; +SELECT info FROM information_schema.processlist +WHERE state = 'debug sync point: after_row_upd_extern'; +info +UPDATE t3 SET c=REPEAT('j',3000) WHERE a=2 +SET DEBUG_DBUG='+d,crash_commit_before'; +COMMIT; +ERROR HY000: Lost connection to MySQL server during query +ERROR HY000: Lost connection to MySQL server during query +CHECK TABLE t1,t2,t3; +Table Op Msg_type Msg_text +test.t1 check status OK +test.t2 check status OK +test.t3 check status OK +SELECT a, RIGHT(b,20), RIGHT(c,20) FROM t3; +a RIGHT(b,20) RIGHT(c,20) +1 dddddddddddddddddddd ffffffffffffffffffff +2 gggggggggggggggggggg hhhhhhhhhhhhhhhhhhhh +SELECT a FROM t3; +a +1 +2 +SELECT * FROM t2; +a +DROP TABLE t1,t2,t3; diff --git a/mysql-test/suite/innodb/r/innodb-index.result b/mysql-test/suite/innodb/r/innodb-index.result index a33099661aa..48390b14a82 100644 --- a/mysql-test/suite/innodb/r/innodb-index.result +++ b/mysql-test/suite/innodb/r/innodb-index.result @@ -114,6 +114,10 @@ t12963823 CREATE TABLE `t12963823` ( KEY `ndx_o` (`o`(500)), KEY `ndx_p` (`p`(500)) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC +create table t1(a varchar(2) primary key) engine=innodb; +insert into t1 values(''); +create index t1a1 on t1(a(1)); +drop table t1; set global innodb_file_per_table=0; set global innodb_file_format=Antelope; create table t1(a int not null, b int, c char(10) not null, d varchar(20)) engine = innodb; diff --git a/mysql-test/suite/innodb/r/innodb_bug11754376.result b/mysql-test/suite/innodb/r/innodb_bug11754376.result new file mode 100644 index 00000000000..034e4f07403 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug11754376.result @@ -0,0 +1,4 @@ +CREATE TABLE bug11754376 (c INT) ENGINE=INNODB; +SET SESSION DEBUG_DBUG='+d,test_normalize_table_name_low'; +DROP TABLE bug11754376; +SET SESSION DEBUG_DBUG='-d,test_normalize_table_name_low'; diff --git a/mysql-test/suite/innodb/r/innodb_bug13510739.result b/mysql-test/suite/innodb/r/innodb_bug13510739.result new file mode 100644 index 00000000000..8aa4323eeb0 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug13510739.result @@ -0,0 +1,10 @@ +CREATE TABLE bug13510739 (c INTEGER NOT NULL, PRIMARY KEY (c)) ENGINE=INNODB; +INSERT INTO bug13510739 VALUES (1), (2), (3), (4); +DELETE FROM bug13510739 WHERE c=2; +HANDLER bug13510739 OPEN; +HANDLER bug13510739 READ `primary` = (2); +c +HANDLER bug13510739 READ `primary` NEXT; +c +4 +DROP TABLE bug13510739; diff --git a/mysql-test/suite/innodb/t/group_commit_crash.test b/mysql-test/suite/innodb/t/group_commit_crash.test index 3502ab41180..12c92d19244 100644 --- a/mysql-test/suite/innodb/t/group_commit_crash.test +++ b/mysql-test/suite/innodb/t/group_commit_crash.test @@ -14,7 +14,7 @@ CREATE TABLE t1(a CHAR(255), b CHAR(255), c CHAR(255), d CHAR(255), - id INT AUTO_INCREMENT, + id INT, PRIMARY KEY(id)) ENGINE=InnoDB; create table t2 like t1; delimiter //; @@ -39,7 +39,7 @@ let $numinserts = 10; while ($numinserts) { dec $numinserts; - INSERT INTO t2(a, b, c, d) VALUES ('a', 'b', 'c', 'd'); + eval INSERT INTO t2(a, b, c, d, id) VALUES ('a', 'b', 'c', 'd', $numinserts+1); } --enable_reconnect diff --git a/mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test b/mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test index 3502ab41180..2de09d6b0b6 100644 --- a/mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test +++ b/mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test @@ -14,7 +14,7 @@ CREATE TABLE t1(a CHAR(255), b CHAR(255), c CHAR(255), d CHAR(255), - id INT AUTO_INCREMENT, + id INT, PRIMARY KEY(id)) ENGINE=InnoDB; create table t2 like t1; delimiter //; @@ -39,7 +39,7 @@ let $numinserts = 10; while ($numinserts) { dec $numinserts; - INSERT INTO t2(a, b, c, d) VALUES ('a', 'b', 'c', 'd'); + eval INSERT INTO t2(a, b, c, d, id) VALUES ('a', 'b', 'c', 'd', 1+$numinserts); } --enable_reconnect diff --git a/mysql-test/suite/innodb/t/innodb-blob.test b/mysql-test/suite/innodb/t/innodb-blob.test new file mode 100644 index 00000000000..c81d4a8acf1 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb-blob.test @@ -0,0 +1,221 @@ +# Bug#13721257 RACE CONDITION IN UPDATES OR INSERTS OF WIDE RECORDS +# Test what happens when a record is inserted or updated so that some +# columns are stored off-page. + +--source include/have_innodb.inc + +if (`select plugin_auth_version <= "1.1.8-24.1" from information_schema.plugins where plugin_name='innodb'`) +{ + --skip Not fixed in XtraDB 1.1.8-24.1 or earlier +} + +# DEBUG_SYNC must be compiled in. +--source include/have_debug_sync.inc + +# Valgrind would complain about memory leaks when we crash on purpose. +--source include/not_valgrind.inc +# Embedded server does not support crashing +--source include/not_embedded.inc +# Avoid CrashReporter popup on Mac +--source include/not_crashrep.inc + +CREATE TABLE t1 (a INT PRIMARY KEY, b TEXT) ENGINE=InnoDB; +CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE t3 (a INT PRIMARY KEY, b TEXT, c TEXT) ENGINE=InnoDB; + +INSERT INTO t1 VALUES (1,REPEAT('a',30000)),(2,REPEAT('b',40000)); +SET DEBUG_SYNC='before_row_upd_extern SIGNAL have_latch WAIT_FOR go1'; +BEGIN; +# This will not block, because it will not store new BLOBs. +UPDATE t1 SET a=a+2; +ROLLBACK; +BEGIN; +--send +UPDATE t1 SET b=CONCAT(b,'foo'); + +connect (con1,localhost,root,,); +SET DEBUG_SYNC='now WAIT_FOR have_latch'; + +# this one should block due to the clustered index tree and leaf page latches +--send +SELECT a, RIGHT(b,20) FROM t1; + +connect (con2,localhost,root,,); + +# Check that the above SELECT is blocked +let $wait_condition= + select count(*) = 1 from information_schema.processlist + where state = 'Sending data' and + info = 'SELECT a, RIGHT(b,20) FROM t1'; +--source include/wait_condition.inc + +SET DEBUG_SYNC='now SIGNAL go1'; + +connection con1; +reap; +connection default; +reap; +SET DEBUG_DBUG='+d,row_ins_extern_checkpoint'; +SET DEBUG_SYNC='before_row_ins_extern_latch SIGNAL rec_not_blob WAIT_FOR crash'; +ROLLBACK; +BEGIN; +--send +INSERT INTO t1 VALUES (3,REPEAT('c',50000)); + +connection con1; +SET DEBUG_SYNC='now WAIT_FOR rec_not_blob'; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +SELECT @@tx_isolation; + +# this one should see (3,NULL_BLOB) +SELECT a, RIGHT(b,20) FROM t1; +SELECT a FROM t1; + +# Request a crash, and restart the server. +SET DEBUG_DBUG='+d,crash_commit_before'; +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--error 2013 +INSERT INTO t2 VALUES (42); + +disconnect con1; +disconnect con2; +connection default; +# This connection should notice the crash as well. +--error 2013 +reap; + +# Write file to make mysql-test-run.pl restart the server +--enable_reconnect +--source include/wait_until_connected_again.inc +--disable_reconnect + +CHECK TABLE t1; + +INSERT INTO t3 VALUES + (1,REPEAT('d',7000),REPEAT('e',100)), + (2,REPEAT('g',7000),REPEAT('h',100)); +SET DEBUG_SYNC='before_row_upd_extern SIGNAL have_latch WAIT_FOR go'; +# This should move column b off-page. +--send +UPDATE t3 SET c=REPEAT('f',3000) WHERE a=1; + +connect (con1,localhost,root,,); +SET DEBUG_SYNC='now WAIT_FOR have_latch'; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +SELECT @@tx_isolation; + +# this one should block +-- send +SELECT a, RIGHT(b,20), RIGHT(c,20) FROM t3; + +connect (con2,localhost,root,,); + +# Check that the above SELECT is blocked +let $wait_condition= + select count(*) = 1 from information_schema.processlist + where state = 'Sending data' and + info = 'SELECT a, RIGHT(b,20), RIGHT(c,20) FROM t3'; +--source include/wait_condition.inc + +SET DEBUG_SYNC='now SIGNAL go'; + +connection con1; +reap; +disconnect con1; + +connection default; +reap; + +CHECK TABLE t1,t2,t3; + +connection con2; +BEGIN; +INSERT INTO t2 VALUES (347); +connection default; + +# The row_upd_extern_checkpoint was removed in Bug#13721257, +# because the mini-transaction of the B-tree modification would +# remain open while we are writing the off-page columns and are +# stuck in the DEBUG_SYNC. A checkpoint involves a flush, which +# would wait for the buffer-fix to cease. +SET DEBUG_DBUG='+d,row_upd_extern_checkpoint'; +SET DEBUG_SYNC='before_row_upd_extern SIGNAL have_latch WAIT_FOR crash'; +# This should move column b off-page. +--send +UPDATE t3 SET c=REPEAT('i',3000) WHERE a=2; + +connection con2; +SET DEBUG_SYNC='now WAIT_FOR have_latch'; + +# Check that the above UPDATE is blocked +SELECT info FROM information_schema.processlist +WHERE state = 'debug sync point: before_row_upd_extern'; + +# Request a crash, and restart the server. +SET DEBUG_DBUG='+d,crash_commit_before'; +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--error 2013 +COMMIT; + +disconnect con2; +connection default; +# This connection should notice the crash as well. +--error 2013 +reap; + +# Write file to make mysql-test-run.pl restart the server +--enable_reconnect +--source include/wait_until_connected_again.inc +--disable_reconnect + +CHECK TABLE t1,t2,t3; +SELECT a, RIGHT(b,20), RIGHT(c,20) FROM t3; +SELECT a FROM t3; + +connect (con2,localhost,root,,); +BEGIN; +INSERT INTO t2 VALUES (33101); +connection default; + +# The row_upd_extern_checkpoint was removed in Bug#13721257, +# because the mini-transaction of the B-tree modification would +# remain open while we are writing the off-page columns and are +# stuck in the DEBUG_SYNC. A checkpoint involves a flush, which +# would wait for the buffer-fix to cease. +SET DEBUG_DBUG='+d,row_upd_extern_checkpoint'; +SET DEBUG_SYNC='after_row_upd_extern SIGNAL have_latch WAIT_FOR crash'; +# This should move column b off-page. +--send +UPDATE t3 SET c=REPEAT('j',3000) WHERE a=2; + +connection con2; +SET DEBUG_SYNC='now WAIT_FOR have_latch'; + +# Check that the above UPDATE is blocked +SELECT info FROM information_schema.processlist +WHERE state = 'debug sync point: after_row_upd_extern'; + +# Request a crash, and restart the server. +SET DEBUG_DBUG='+d,crash_commit_before'; +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--error 2013 +COMMIT; + +disconnect con2; +connection default; +# This connection should notice the crash as well. +--error 2013 +reap; + +# Write file to make mysql-test-run.pl restart the server +--enable_reconnect +--source include/wait_until_connected_again.inc +--disable_reconnect + +CHECK TABLE t1,t2,t3; +SELECT a, RIGHT(b,20), RIGHT(c,20) FROM t3; +SELECT a FROM t3; + +SELECT * FROM t2; + +DROP TABLE t1,t2,t3; diff --git a/mysql-test/suite/innodb/t/innodb-index.test b/mysql-test/suite/innodb/t/innodb-index.test index cb4527d6cb2..cea9055b873 100644 --- a/mysql-test/suite/innodb/t/innodb-index.test +++ b/mysql-test/suite/innodb/t/innodb-index.test @@ -119,6 +119,11 @@ show create table t12963823; # this file complete before dropping the table. By then, the purge thread # will have delt with the updates above. +# Bug#13654923 BOGUS DEBUG ASSERTION IN INDEX CREATION FOR ZERO-LENGTH RECORD +create table t1(a varchar(2) primary key) engine=innodb; +insert into t1 values(''); +create index t1a1 on t1(a(1)); +drop table t1; eval set global innodb_file_per_table=$per_table; eval set global innodb_file_format=$format; diff --git a/mysql-test/suite/innodb/t/innodb_bug11754376.test b/mysql-test/suite/innodb/t/innodb_bug11754376.test new file mode 100644 index 00000000000..b740b7e08fe --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug11754376.test @@ -0,0 +1,16 @@ +# +# Bug#11754376 45976: INNODB LOST FILES FOR TEMPORARY TABLES ON GRACEFUL SHUTDOWN +# + +-- source include/have_debug.inc +-- source include/have_innodb.inc + +CREATE TABLE bug11754376 (c INT) ENGINE=INNODB; + +# This will invoke test_normalize_table_name_low() in debug builds + +SET SESSION DEBUG_DBUG='+d,test_normalize_table_name_low'; + +DROP TABLE bug11754376; + +SET SESSION DEBUG_DBUG='-d,test_normalize_table_name_low'; diff --git a/mysql-test/suite/innodb/t/innodb_bug13510739.test b/mysql-test/suite/innodb/t/innodb_bug13510739.test new file mode 100644 index 00000000000..f10bcd8e272 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug13510739.test @@ -0,0 +1,20 @@ +# +# Bug#13510739 63775: SERVER CRASH ON HANDLER READ NEXT AFTER DELETE RECORD. +# + +-- source include/have_innodb.inc + +CREATE TABLE bug13510739 (c INTEGER NOT NULL, PRIMARY KEY (c)) ENGINE=INNODB; + +INSERT INTO bug13510739 VALUES (1), (2), (3), (4); + +DELETE FROM bug13510739 WHERE c=2; + +HANDLER bug13510739 OPEN; + +HANDLER bug13510739 READ `primary` = (2); + +# this one crashes the server if the bug is present +HANDLER bug13510739 READ `primary` NEXT; + +DROP TABLE bug13510739; diff --git a/mysql-test/suite/innodb/t/innodb_bug34300.test b/mysql-test/suite/innodb/t/innodb_bug34300.test index 3f496741c6a..7331c1233fc 100644 --- a/mysql-test/suite/innodb/t/innodb_bug34300.test +++ b/mysql-test/suite/innodb/t/innodb_bug34300.test @@ -7,6 +7,8 @@ -- disable_query_log -- disable_result_log +call mtr.add_suppression("InnoDB: Warning: a long semaphore wait:"); + # set packet size and reconnect let $max_packet=`select @@global.max_allowed_packet`; SET @@global.max_allowed_packet=16777216; diff --git a/mysql-test/suite/innodb/t/innodb_bug53756.test b/mysql-test/suite/innodb/t/innodb_bug53756.test index 2f778d45f61..c298c945434 100644 --- a/mysql-test/suite/innodb/t/innodb_bug53756.test +++ b/mysql-test/suite/innodb/t/innodb_bug53756.test @@ -137,6 +137,9 @@ INSERT INTO bug_53756 VALUES (666,666); # Request a crash on next execution of commit. SET SESSION debug_dbug="+d,crash_commit_before"; # +# Write file to make mysql-test-run.pl start up the server again +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +# # Execute the statement that causes the crash. --error 2013 COMMIT; @@ -152,9 +155,6 @@ COMMIT; --echo # --echo # Restart server. # -# Write file to make mysql-test-run.pl start up the server again ---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -# # Turn on reconnect --enable_reconnect # diff --git a/mysql-test/suite/rpl/r/rpl_auto_increment_11932.result b/mysql-test/suite/rpl/r/rpl_auto_increment_11932.result index 62ff28e7159..1d378e2d864 100644 --- a/mysql-test/suite/rpl/r/rpl_auto_increment_11932.result +++ b/mysql-test/suite/rpl/r/rpl_auto_increment_11932.result @@ -1,5 +1,6 @@ include/master-slave.inc [connection master] +call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.'); drop database if exists test1; create database test1; use test1; diff --git a/mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result b/mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result index c132f80f58e..cc693bff752 100644 --- a/mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result +++ b/mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result @@ -11,7 +11,7 @@ reset slave; start slave; include/wait_for_slave_param.inc [Last_IO_Errno] Last_IO_Errno = '1236' -Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'binlog truncated in the middle of event; consider out of disk space on master; the start event position from '.' at XXX, the last event was read from 'master-bin.000001' at XXX, the last byte read was read from 'master-bin.000001' at XXX.'' +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'binlog truncated in the middle of event; consider out of disk space on master; the first event '.' at XXX, the last event read from 'master-bin.000001' at XXX, the last byte read from 'master-bin.000001' at XXX.'' reset master; stop slave; reset slave; diff --git a/mysql-test/suite/rpl/r/rpl_checksum.result b/mysql-test/suite/rpl/r/rpl_checksum.result index feabfc19631..bee43a2a2b3 100644 --- a/mysql-test/suite/rpl/r/rpl_checksum.result +++ b/mysql-test/suite/rpl/r/rpl_checksum.result @@ -71,7 +71,7 @@ insert into t1 values (1) /* will not be applied on slave due to simulation */; set @@global.debug_dbug='d,simulate_slave_unaware_checksum'; start slave; include/wait_for_slave_io_error.inc [errno=1236] -Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'Slave can not handle replication events with the checksum that master is configured to log; the start event position from 'master-bin.000009' at 245, the last event was read from 'master-bin.000010' at 245, the last byte read was read from 'master-bin.000010' at 245.'' +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'Slave can not handle replication events with the checksum that master is configured to log; the first event 'master-bin.000009' at 245, the last event read from 'master-bin.000010' at 245, the last byte read from 'master-bin.000010' at 245.'' select count(*) as zero from t1; zero 0 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 d89bce479e5..193172912be 100644 --- a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result +++ b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result @@ -861,7 +861,8 @@ master-bin.000001 # Table_map # # table_id: # (test_rpl.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t2 SELECT * FROM t1 +master-bin.000001 # Table_map # # table_id: # (test_rpl.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t2 VALUES (1, 't1, text 1') ON DUPLICATE KEY UPDATE b = 't2, text 1' diff --git a/mysql-test/suite/rpl/r/rpl_insert_id_pk.result b/mysql-test/suite/rpl/r/rpl_insert_id_pk.result index c2d6d2c9b0c..467b8c1e5cc 100644 --- a/mysql-test/suite/rpl/r/rpl_insert_id_pk.result +++ b/mysql-test/suite/rpl/r/rpl_insert_id_pk.result @@ -1,5 +1,6 @@ include/master-slave.inc [connection master] +call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT."); create table t1(a int auto_increment, primary key(a)); create table t2(b int auto_increment, c int, primary key(b)); insert into t1 values (1),(2),(3); diff --git a/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result index f7aea20a34f..ea738b710fd 100644 --- a/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result +++ b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result @@ -46,6 +46,7 @@ ON DUPLICATE KEY UPDATE t1.field_3 = t2.field_c; Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slave. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave. INSERT INTO t2 (field_a, field_b, field_c) VALUES (6, 'f', '6f'); INSERT INTO t1 (field_1, field_2, field_3) SELECT t2.field_a, t2.field_b, t2.field_c @@ -54,6 +55,7 @@ ON DUPLICATE KEY UPDATE t1.field_3 = t2.field_c; Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slave. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave. SELECT * FROM t1; id field_1 field_2 field_3 1 1 a 1a diff --git a/mysql-test/suite/rpl/r/rpl_log_pos.result b/mysql-test/suite/rpl/r/rpl_log_pos.result index 941dba2f5af..8910f7c8f74 100644 --- a/mysql-test/suite/rpl/r/rpl_log_pos.result +++ b/mysql-test/suite/rpl/r/rpl_log_pos.result @@ -11,7 +11,7 @@ include/stop_slave.inc change master to master_log_pos=MASTER_LOG_POS; start slave; include/wait_for_slave_io_error.inc [errno=1236] -Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the start event position from 'master-bin.000001' at XXX, the last event was read from 'master-bin.000001' at XXX, the last byte read was read from 'master-bin.000001' at XXX.'' +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the first event 'master-bin.000001' at XXX, the last event read from 'master-bin.000001' at XXX, the last byte read from 'master-bin.000001' at XXX.'' include/stop_slave_sql.inc show master status; File Position Binlog_Do_DB Binlog_Ignore_DB diff --git a/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result b/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result index efe9bf076f0..d5331d0fc93 100644 --- a/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result +++ b/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result @@ -5,7 +5,7 @@ CREATE TABLE t1(c1 INT); FLUSH LOGS; call mtr.add_suppression('Got fatal error 1236 from master when reading data from binary log: .*could not find next log'); include/wait_for_slave_io_error.inc [errno=1236] -Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'could not find next log; the start event position from 'master-bin.000001' at XXX, the last event was read from 'master-bin.000002' at XXX, the last byte read was read from 'master-bin.000002' at XXX.'' +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'could not find next log; the first event 'master-bin.000001' at XXX, the last event read from 'master-bin.000002' at XXX, the last byte read from 'master-bin.000002' at XXX.'' CREATE TABLE t2(c1 INT); FLUSH LOGS; CREATE TABLE t3(c1 INT); diff --git a/mysql-test/suite/rpl/r/rpl_multi_update.result b/mysql-test/suite/rpl/r/rpl_multi_update.result index 8634e86afed..74fb7952a2a 100644 --- a/mysql-test/suite/rpl/r/rpl_multi_update.result +++ b/mysql-test/suite/rpl/r/rpl_multi_update.result @@ -1,5 +1,6 @@ include/master-slave.inc [connection master] +call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.'); CREATE TABLE t1 ( a int unsigned not null auto_increment primary key, b int unsigned diff --git a/mysql-test/suite/rpl/r/rpl_multi_update2.result b/mysql-test/suite/rpl/r/rpl_multi_update2.result index a3cab693322..03ed5de473d 100644 --- a/mysql-test/suite/rpl/r/rpl_multi_update2.result +++ b/mysql-test/suite/rpl/r/rpl_multi_update2.result @@ -1,5 +1,6 @@ include/master-slave.inc [connection master] +call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT'); drop table if exists t1,t2; CREATE TABLE t1 ( a int unsigned not null auto_increment primary key, diff --git a/mysql-test/suite/rpl/r/rpl_multi_update3.result b/mysql-test/suite/rpl/r/rpl_multi_update3.result index 6b9ec5c3947..bf9946f219f 100644 --- a/mysql-test/suite/rpl/r/rpl_multi_update3.result +++ b/mysql-test/suite/rpl/r/rpl_multi_update3.result @@ -1,5 +1,6 @@ include/master-slave.inc [connection master] +call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.'); -------- Test for BUG#9361 -------- CREATE TABLE t1 ( diff --git a/mysql-test/suite/rpl/r/rpl_packet.result b/mysql-test/suite/rpl/r/rpl_packet.result index 4b2a525de27..4d5ffae2d63 100644 --- a/mysql-test/suite/rpl/r/rpl_packet.result +++ b/mysql-test/suite/rpl/r/rpl_packet.result @@ -37,7 +37,7 @@ DROP TABLE t1; CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM; INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), REPEAT('b', @@global.max_allowed_packet)); include/wait_for_slave_io_error.inc [errno=1236] -Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the start event position from '.' at XXX, the last event was read from 'master-bin.000001' at XXX, the last byte read was read from 'master-bin.000001' at XXX.'' +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the first event '.' at XXX, the last event read from 'master-bin.000001' at XXX, the last byte read from 'master-bin.000001' at XXX.'' STOP SLAVE; RESET SLAVE; RESET MASTER; diff --git a/mysql-test/suite/rpl/r/rpl_rotate_logs.result b/mysql-test/suite/rpl/r/rpl_rotate_logs.result index 4b830799dd1..f10e30c698d 100644 --- a/mysql-test/suite/rpl/r/rpl_rotate_logs.result +++ b/mysql-test/suite/rpl/r/rpl_rotate_logs.result @@ -1,3 +1,4 @@ +CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT."); start slave; Got one of the listed errors start slave; diff --git a/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result b/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result index 8bf903b0713..2aa2ee3b573 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result +++ b/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result @@ -75,7 +75,7 @@ CHANGE MASTER TO master_log_pos=MASTER_POS; START SLAVE; include/wait_for_slave_param.inc [Last_IO_Errno] Last_IO_Errno = '1236' -Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'Client requested master to start replication from impossible position; the start event position from 'master-bin.000001' at XXX, the last event was read from 'master-bin.000001' at XXX, the last byte read was read from 'master-bin.000001' at XXX.'' +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'Client requested master to start replication from impossible position; the first event 'master-bin.000001' at XXX, the last event read from 'master-bin.000001' at XXX, the last byte read from 'master-bin.000001' at XXX.'' include/stop_slave.inc RESET SLAVE; RESET MASTER; diff --git a/mysql-test/suite/rpl/t/rpl_auto_increment_11932.test b/mysql-test/suite/rpl/t/rpl_auto_increment_11932.test index d1da69533ec..1e5f9e53478 100644 --- a/mysql-test/suite/rpl/t/rpl_auto_increment_11932.test +++ b/mysql-test/suite/rpl/t/rpl_auto_increment_11932.test @@ -8,6 +8,7 @@ # Test supplied by Are Casilla source include/master-slave.inc; +call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.'); --disable_warnings connection master; drop database if exists test1; @@ -42,12 +43,16 @@ CREATE PROCEDURE simpleproc3 () $ DELIMITER ;$ +--disable_warnings CALL simpleproc3(); +--enable_warnings select * from t2; TRUNCATE TABLE `t1`; +--disable_warnings CALL simpleproc3(); +--enable_warnings select * from t1; diff --git a/mysql-test/suite/rpl/t/rpl_multi_update2.test b/mysql-test/suite/rpl/t/rpl_multi_update2.test index 497568f2738..138c1455952 100644 --- a/mysql-test/suite/rpl/t/rpl_multi_update2.test +++ b/mysql-test/suite/rpl/t/rpl_multi_update2.test @@ -6,6 +6,7 @@ ####################################################### --source include/not_ndb_default.inc --source include/master-slave.inc +call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT'); let $engine_type=MyISAM; --source extra/rpl_tests/rpl_multi_update2.test --source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_multi_update3.test b/mysql-test/suite/rpl/t/rpl_multi_update3.test index f6e70f14b30..dc12d528c24 100644 --- a/mysql-test/suite/rpl/t/rpl_multi_update3.test +++ b/mysql-test/suite/rpl/t/rpl_multi_update3.test @@ -6,6 +6,7 @@ ####################################################### --source include/not_ndb_default.inc --source include/master-slave.inc +call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.'); let $engine_type=MyISAM; -- source extra/rpl_tests/rpl_multi_update3.test --source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_optimize.test b/mysql-test/suite/rpl/t/rpl_optimize.test index b48ef579b6b..47063539ffc 100644 --- a/mysql-test/suite/rpl/t/rpl_optimize.test +++ b/mysql-test/suite/rpl/t/rpl_optimize.test @@ -25,6 +25,7 @@ enable_query_log; create table t1 (a int not null auto_increment primary key, b int, key(b)); INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); +--disable_warnings INSERT INTO t1 (a) SELECT null FROM t1; INSERT INTO t1 (a) SELECT null FROM t1; INSERT INTO t1 (a) SELECT null FROM t1; @@ -38,6 +39,7 @@ INSERT INTO t1 (a) SELECT null FROM t1; INSERT INTO t1 (a) SELECT null FROM t1; INSERT INTO t1 (a) SELECT null FROM t1; INSERT INTO t1 (a) SELECT null FROM t1; +--enable_warnings save_master_pos; # a few updates to force OPTIMIZE to do something --disable_warnings diff --git a/mysql-test/suite/rpl/t/rpl_rotate_logs.test b/mysql-test/suite/rpl/t/rpl_rotate_logs.test index 77ce540ff36..393623888ec 100644 --- a/mysql-test/suite/rpl/t/rpl_rotate_logs.test +++ b/mysql-test/suite/rpl/t/rpl_rotate_logs.test @@ -27,6 +27,7 @@ EOF chmod 0000 $MYSQLD_SLAVE_DATADIR/master.info; connection slave; +CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT."); # START SLAVE will fail because it can't read the file (mode 000) # (system error 13) --replace_result $MYSQL_TEST_DIR TESTDIR diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_event.test b/mysql-test/suite/rpl/t/rpl_semi_sync_event.test index c84f597c1ee..b4a9a9e6e59 100644 --- a/mysql-test/suite/rpl/t/rpl_semi_sync_event.test +++ b/mysql-test/suite/rpl/t/rpl_semi_sync_event.test @@ -52,9 +52,10 @@ SET GLOBAL event_scheduler = ON; replace_result $engine_type ENGINE_TYPE; eval CREATE TABLE t1 (i INT NOT NULL AUTO_INCREMENT PRIMARY KEY, f varchar(8)) ENGINE=$engine_type; INSERT INTO t1 (f) VALUES ('a'),('a'),('a'),('a'),('a'); +--disable_warnings INSERT INTO t1 SELECT i+5, f FROM t1; INSERT INTO t1 SELECT i+10, f FROM t1; - +--enable_warnings CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO t1 VALUES (SLEEP(5),CONCAT('ev1_',CONNECTION_ID())); CREATE EVENT ev2 ON SCHEDULE EVERY 1 SECOND diff --git a/mysql-test/suite/rpl/t/rpl_timezone.test b/mysql-test/suite/rpl/t/rpl_timezone.test index 7355106b6b4..1f0220421ab 100644 --- a/mysql-test/suite/rpl/t/rpl_timezone.test +++ b/mysql-test/suite/rpl/t/rpl_timezone.test @@ -13,14 +13,14 @@ # timezone used in CONVERT_TZ is not binlogged. To debug (by Guilhem # and possibly Konstantin). +source include/master-slave.inc; + --disable_query_log CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); --enable_query_log --disable_ps_protocol -source include/master-slave.inc; - # Save original timezone set @my_time_zone= @@global.time_zone; @@ -90,6 +90,7 @@ insert into t1 values ('20040101000000',NULL), ('20040611093902',NULL); # from originally inserted) # set time_zone='MET'; +--disable_warnings ONCE insert into t2 (select * from t1); SELECT * FROM t1 ORDER BY n; sync_slave_with_master; diff --git a/mysql-test/t/bug13633383.test b/mysql-test/t/bug13633383.test new file mode 100644 index 00000000000..72eb2f81c98 --- /dev/null +++ b/mysql-test/t/bug13633383.test @@ -0,0 +1,82 @@ +--echo # +--echo # Bug#13633383 63183: SMALL SORT_BUFFER_SIZE CRASH IN MERGE_BUFFERS +--echo # + +CREATE TABLE t1 ( + `a` int(11) DEFAULT NULL, + `col432` bit(8) DEFAULT NULL, + `col433` multipoint DEFAULT NULL, + `col434` polygon DEFAULT NULL, + `col435` decimal(50,17) unsigned DEFAULT NULL, + `col436` geometry NOT NULL, + `col437` tinyblob NOT NULL, + `col438` multipolygon DEFAULT NULL, + `col439` mediumblob NOT NULL, + `col440` tinyblob NOT NULL, + `col441` double unsigned DEFAULT NULL +); + +CREATE TABLE t2 ( + `a` multipoint DEFAULT NULL, + `col460` date DEFAULT NULL, + `col461` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `col462` date NOT NULL, + `col463` varbinary(89) NOT NULL, + `col464` year(4) DEFAULT NULL, + `col465` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + `col466` varchar(236) CHARACTER SET utf8 NOT NULL, + `col467` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' +); + +CREATE TABLE t3 ( + `FTS_DOC_ID` bigint(20) unsigned NOT NULL, + `col577` datetime DEFAULT NULL, + `col579` bit(38) NOT NULL, + `col580` varchar(93) NOT NULL, + `col581` datetime DEFAULT NULL, + `col583` multipolygon DEFAULT NULL, + `col584` bit(47) NOT NULL +); + +--disable_query_log + +INSERT INTO t1 VALUES (0,0xFF,'\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 JæÀ',NULL,0.00000000000000000,'\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0àÃ\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0àC\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0àC\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',0xB623A952C5,'\0\0\0\0\0\0\0\0\0\0\0ðiøÀ\0\0\0\0jøÀ',0x22,0xD81F72A9,56403); +INSERT INTO t1 VALUES (-32768,0x00,'\0\0\0\0\0\0\0\0\0\0\0Àrç@\0\0\0\0jøÀ','\0\0\0\0\0\0\0\0\0\0\0\0ÛâÀ\0\0\0\0jøÀ',NULL,'\0\0\0\0\0\0\0\0\0\0\0À6Ò@\0\0\0\0\0jøÀ',0xC80876AF04,'\0\0\0\0\0\0\0\0\0\0\0€[áÀ\0\0\0\0ðiøÀ',0x016C576E34,0x1B,0); +INSERT INTO t1 VALUES (-2147483648,0x17,'\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0]ÇÀ',NULL,0.00000000000000000,'\0\0\0\0\0\0\0\0\0\0\0ðiøÀìÊFQƒìCµ',0x68D352,'\0\0\0\0\0\0\0\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0àÃ\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0àC\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0àÃ\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0àC\0\0\0\0\0àÃ\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0','','',0); +INSERT INTO t1 VALUES (1,0xFF,'\0\0\0\0\0\0\0\0\0\0\0Ð÷À\0\0\0\0Àü×À','\0\0\0\0\0\0\0\0\0\0\0`6ë@\0\0\0\0à²î@',32767.00000000000000000,'\0\0\0\0\0\0\0\0\0\0\0ðiø@†ö¯{âÌ',0x1406B0C524,'\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0àÃ\0\0\0\0\0àC\0\0\0\0\0àC',0xC04B75CCFD,0xC4CD,1); +INSERT INTO t1 VALUES (0,0xFF,NULL,'\0\0\0\0\0\0\0\0\0\0\0\0jø@\0\0\0\0\0(¦À',0.06140000000000000,'\0\0\0\0\0\0\0\0\0\0\0ðiø@$7”H#ÀÐ1',0x3F,'\0\0\0\0\0\0\0\0\0\0\0jøÀCHK¶µ$·',0x1E87C5DA,0xCC870E,NULL); + + +INSERT INTO t2 VALUES ('\0\0\0\0\0\0\0\0\0\0\0\0k¿À\0\0\0\0\0jø@','2011-02-19','2011-08-10 14:21:44','2012-09-25',0xCCC3,0000,'2012-07-28 16:25:23','idpapxbfjrigkfqnhnfmhvtewlvxfmjhfqizhhsowbetimmkhukpzeixbfyzmsalaafssdovflpvxldldmuamfoulanivuxigbjwkzbapcxmmprpyasaozdqwqjuixajzmiepkcvnvtewdvyodupziffgzbcmsfhikbuehyhzfnxlsdzulbsrqmtszzzupcmxlvcpxahuiotgadwhpcuqmyzgrbkxzxwriqkymdaqnzz','2012-01-20 09:01:25'); +INSERT INTO t2 VALUES (NULL,'2011-05-14','2012-10-17 04:33:30','2012-01-20','',0000,'2012-05-08 11:06:53','otbywkbfwwtgpfgurtqwgfcwmmntsdxkounuzueoclrpnadghfzmbrh','2012-03-24 21:01:09'); +INSERT INTO t2 VALUES ('\0\0\0\0\0\0\06ý¹PVh,;bºö$î°','2012-07-21','2011-11-21 04:23:27','2011-06-18',0x21,0000,'2011-09-10 14:01:05','goybgohrexhfqwerpknkbyiqowvcdpyxvbklkbeeuvfbjtkmontmkmgcjutkjphewnvvobzilamtjqjbtvqgczozqcmvbbzvoxkycsvplfykmzpwljdcromsilspjuoyhxwduymxkymvmijehtutftqmpfpbesonppacogyogjqhyonizbsgzwubzgeoehryqswzkftgzhzssnlstuszpwauxmdhgjcawabnjcynzrrh','2012-11-19 18:30:51'); +INSERT INTO t2 VALUES ('\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0À®ÛÀ','2012-09-01','2012-01-20 09:01:34','2011-02-12',0x1FDF59DC65,0000,'2011-07-07 19:48:34','xohwzrslzxbpxdvqfsumavjwwmsdcgczlmxrtxavsqtnpggxesvekbcelnnrxkvvlwqwbydlhwzltwaurkfltafeijstmzueiqddjdxzddymhsungndmojndbspkezvdfhqxijxxrwiolqgnsedenszkiljgropmcbxsjntjmnonnltyiysuejsznuurmonebslawybppziavystrylwunselezpbslmkzggpziffrud','2012-01-19 22:00:00'); +INSERT INTO t2 VALUES ('\0\0\0\0\0\0\0\0\0\0\0\0jø@\0\0\0\0\0\0\0\0','0000-00-00','2012-05-21 09:59:10','2011-04-17',0x02307EDF,0000,'2012-01-20 09:01:34','vjcwlxxeydntegsdqhxgriarmbvzwzwdexcalvacxhilaejpmxdpkuvblukchagzoellbdndelfednqktzobyhjqweqaugqnfikdalmaytyunjqvxcsirhaqnvqsstgrgfscnsemseebdemfditoswccsxthnddzslgjkyujxoqsvzrssymoovqmibcmbboruyxlvopengdqqgqwekrflhvjcpondxivnshvhrnqvfls','2012-09-23 23:54:02'); + + +INSERT INTO t3 VALUES (11787,'2012-07-24 15:22:50',0x00000000FF,'qbdydwxepydtonqnghurnuntughjwfygzttqwtmfzfbtifjcearpatksofbrfgnaccvapahywhsstdplphrxbcubhktov','2011-08-27 19:28:03',NULL,0x00000000001C); + +INSERT INTO t3 VALUES (11788,'2012-05-17 08:38:13',0x3FFFFFFFFF,'jkvkjxaikruljqalyvnbfjptxgbpsgnxlzthhcrswwdcfrhilwwgqmxynxjnehwmyfzdyywjzfyasuvjbrevkxtnyodiu','2012-05-09 11:09:52',NULL,0x0000000000B8); + +INSERT INTO t3 VALUES (1,'2011-02-17 19:55:19',0x000098FAF3,'rnzhemtrqjdrappwbmxnzkfatcgtvqklrpfpdqiwjnjbeaxpcbhqqunbzmtmitdszxyrdvkeedqwpbiefqnwvhiznwfyq','2012-11-10 18:00:25','\0\0\0\0\0\0\0\0\0\0\0\0jøÀ\0\0\0\0€1á@',0x7FFFFFFFFFFF); + +INSERT INTO t3 VALUES (11789,'2011-12-26 01:30:56',0x0000000001,'dhryqjghgixymqywclxpovwnlgnltuzdvggmlaxtzrsbpxkahkiahpkrddpoeftqqwejbjxrdzfgvkzvhcalopgumspgg','2011-03-21 06:25:44',NULL,0x00000000293A); + +INSERT INTO t3 VALUES (4294967296,'2011-04-12 21:05:37',0x0000CE3238,'xwcplgaxcpgfsmcjftxffxgmjwabpmrcycbxmwjvqtlvtlwuipuwgbuygnxomjplqohyuqyzsoiggroigcnchzpiilyhe','2012-03-20 05:35:39',NULL,0x00000000006E); + +--enable_query_log + +set session sort_buffer_size= 32768; +select col435 +from t3 +natural right outer join t1 +natural right outer join t2 a +left outer join t2 b on 1 +group by + repeat('a',10000) desc, + repeat('a',10000) +with rollup +; +set session sort_buffer_size= default; + +DROP TABLE t1, t2, t3; diff --git a/mysql-test/t/events_restart.test b/mysql-test/t/events_restart.test index facf2912087..83d28c0812d 100644 --- a/mysql-test/t/events_restart.test +++ b/mysql-test/t/events_restart.test @@ -106,3 +106,4 @@ let $wait_condition= select count(*) = 0 from information_schema.processlist where db='events_test' and command = 'Connect' and user=current_user(); --source include/wait_condition.inc + diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test index d5c6d995b4c..a4469728c0f 100644 --- a/mysql-test/t/join_outer.test +++ b/mysql-test/t/join_outer.test @@ -1260,6 +1260,62 @@ WHERE TABLE1.pk IS NULL; DROP TABLE h,m,k; +--echo +--echo # BUG#12567331 - INFINITE LOOP WHEN RESOLVING AN ALIASED COLUMN +--echo # USED IN GROUP BY +--echo +CREATE TABLE t1 ( + col_varchar_1024_latin1_key varchar(1024), + col_varchar_10_latin1 varchar(10), + col_int int(11), + pk int(11) +); +CREATE TABLE t2 ( + col_int_key int(11), + col_int int(11), + pk int(11) +); + +PREPARE prep_stmt_9846 FROM ' +SELECT alias1.pk AS field1 FROM +t1 AS alias1 +LEFT JOIN +( + t2 AS alias2 + RIGHT JOIN + ( + t2 AS alias3 + JOIN t1 AS alias4 + ON 1 + ) + ON 1 +) +ON 1 +GROUP BY field1'; +execute prep_stmt_9846; +execute prep_stmt_9846; +drop table t1,t2; + +--echo # +--echo # Bug #11765810 58813: SERVER THREAD HANGS WHEN JOIN + WHERE + GROUP BY +--echo # IS EXECUTED TWICE FROM P +--echo # +CREATE TABLE t1 ( a INT ) ENGINE = MYISAM; +INSERT INTO t1 VALUES (1); +PREPARE prep_stmt FROM ' + SELECT 1 AS f FROM t1 + LEFT JOIN t1 t2 + RIGHT JOIN t1 t3 + JOIN t1 t4 + ON 1 + ON 1 + ON 1 + GROUP BY f'; +EXECUTE prep_stmt; +EXECUTE prep_stmt; + +DROP TABLE t1; + --echo # --echo # Bug#49600: outer join of two single-row tables with joining attributes --echo # evaluated to nulls diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index 51bb64bd31d..48735304aad 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -6,6 +6,8 @@ source include/not_embedded.inc; source include/have_log_bin.inc; +CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT."); + --disable_warnings drop table if exists t1,t2,t3; drop database if exists mysqltest; @@ -142,6 +144,7 @@ INSERT INTO t2(ParId) VALUES(1), (2), (3); select * from t2; +--disable_warnings ONCE UPDATE t2, t1 SET t2.tst = t1.tst, t2.tst1 = t1.tst1 WHERE t2.ParId = t1.Id; select * from t2; @@ -299,6 +302,7 @@ drop table t1,t2; create table t1 (a int not null auto_increment primary key, b int not null); insert into t1 (b) values (1),(2),(3),(4); +--disable_warnings ONCE update t1, t1 as t2 set t1.b=t2.b+1 where t1.a=t2.a; select * from t1; drop table t1; @@ -356,6 +360,7 @@ create table `t2` (`c2_id` int(10) unsigned NULL auto_increment, `c2_p_id` int(1 insert into t1 values (0,'A01-Comp',1); insert into t1 values (0,'B01-Comp',1); insert into t2 values (0,1,'A Note',1); +--disable_warnings ONCE update t1 left join t2 on p_id = c2_p_id set c2_note = 'asdf-1' where p_id = 2; select * from t1; select * from t2; diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index 9bdd6faa422..4199d98073c 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -1718,6 +1718,20 @@ CHECK TABLE t1; DROP TABLE t1; SET GLOBAL myisam_use_mmap=default; +--echo # +--echo # BUG 11756869 - 48848: MYISAMCHK DOING SORT RECOVER IN CERTAIN +--echo # CASES RESETS DATA POINTER TO SMAL +--echo # +CREATE TABLE t1(a INT, KEY(a)); +ALTER TABLE t1 DISABLE KEYS; +let $MYSQLD_DATADIR= `select @@datadir`; +SET @before:= (SELECT MAX_DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='test'); +FLUSH TABLES; +--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR +--exec $MYISAMCHK -sn $MYSQLD_DATADIR/test/t1 +SET @after:= (SELECT MAX_DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='test'); +SELECT @before=@after; +DROP TABLE t1; --echo End of 5.1 tests --echo # diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 3224f4d4081..d6d49c59255 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -2350,6 +2350,51 @@ INSERT INTO t1 VALUES(0); DROP TABLE t1; SET GLOBAL myisam_use_mmap=default; +--echo # +--echo # Bug#13580775 ASSERTION FAILED: RECORD_LENGTH == M_RECORD_LENGTH, +--echo # FILE FILESORT_UTILS.CC +--echo # + +CREATE TABLE t1 ( + a INT PRIMARY KEY, + b INT, + c CHAR(1), + d INT, + KEY (c,d) +) PARTITION BY KEY () PARTITIONS 1; + +INSERT INTO t1 VALUES (1,1,'a',1), (2,2,'a',1); + +SELECT 1 FROM t1 WHERE 1 IN +(SELECT group_concat(b) + FROM t1 + WHERE c > geomfromtext('point(1 1)') + GROUP BY b +); + +DROP TABLE t1; + +--echo # +--echo # Bug#13011410 CRASH IN FILESORT CODE WITH GROUP BY/ROLLUP +--echo # + +CREATE TABLE t1 ( + a INT, + b MEDIUMINT, + c VARCHAR(300) CHARACTER SET hp8 COLLATE hp8_bin, + PRIMARY KEY (a,c(299))) +ENGINE=myisam +PARTITION BY LINEAR KEY () PARTITIONS 2; + +INSERT INTO t1 VALUES (1,2,'test'), (2,3,'hi'), (4,5,'bye'); +SELECT 1 FROM t1 WHERE b < SOME +( SELECT 1 FROM t1 WHERE a >= 1 + GROUP BY b WITH ROLLUP + HAVING b > geomfromtext("") +); + +DROP TABLE t1; + --echo End of 5.1 tests --echo # diff --git a/mysql-test/t/partition_error.test b/mysql-test/t/partition_error.test index 39dd6773ce8..f8f09e4b5e7 100644 --- a/mysql-test/t/partition_error.test +++ b/mysql-test/t/partition_error.test @@ -11,6 +11,34 @@ drop table if exists t1, t2; let $MYSQLD_DATADIR= `SELECT @@datadir`; --echo # +--echo # Bug#13608188 - 64038: CRASH IN HANDLER::HA_THD ON ALTER TABLE AFTER +--echo # REPAIR NON-EXISTING PARTITION +--echo # +CREATE TABLE t1 ( a INT, b INT ); +INSERT INTO t1 VALUES (5,3),(5,6); +ALTER TABLE t1 PARTITION BY KEY(b) PARTITIONS 3 ; +ALTER TABLE t1 REPAIR PARTITION p1, p3; +ALTER TABLE t1 ORDER BY b; +DROP TABLE t1; + +--echo # +--echo # Bug#13593865 - 64037: CRASH IN HA_PARTITION::CREATE_HANDLERS ON +--echo # ALTER TABLE AFTER DROP PARTITION +--echo # + +CREATE TABLE t1 (a INT) +PARTITION BY RANGE (a) +(PARTITION p0 VALUES LESS THAN (0), + PARTITION p1 VALUES LESS THAN MAXVALUE ) ; + +ALTER TABLE t1 DROP PARTITION p1; +ALTER TABLE t1 ANALYZE PARTITION p0, p1; + +ALTER TABLE t1 COMMENT 'altered'; + +DROP TABLE t1; + +--echo # --echo # Bug#57924: crash when creating partitioned table with --echo # multiple columns in the partition key --echo # diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index 58e85c7a3a1..b89c4974b20 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -1,5 +1,6 @@ -- source include/not_embedded.inc -- source include/have_log_bin.inc +call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.'); # # SQL Syntax for Prepared Statements test # @@ -249,8 +250,10 @@ prepare stmt1 from "select 1 into @var"; execute stmt1; execute stmt1; prepare stmt1 from "create table t1 select 1 as i"; +--disable_warnings ONCE execute stmt1; drop table t1; +--disable_warnings ONCE execute stmt1; prepare stmt1 from "insert into t1 select i from t1"; execute stmt1; @@ -443,6 +446,7 @@ deallocate prepare stmt; create table t1 (a int); insert into t1 values (1),(2),(3); create table t2 select * from t1; +--disable_warnings prepare stmt FROM 'create table t2 select * from t1'; drop table t2; execute stmt; @@ -452,6 +456,7 @@ execute stmt; execute stmt; drop table t2; execute stmt; +--enable_warnings drop table t1,t2; deallocate prepare stmt; @@ -1187,6 +1192,7 @@ create database mysqltest character set utf8; prepare stmt1 from "create table mysqltest.t1 (c char(10))"; prepare stmt2 from "create table mysqltest.t2 select 'test'"; execute stmt1; +--disable_warnings ONCE execute stmt2; show create table mysqltest.t1; show create table mysqltest.t2; @@ -1194,6 +1200,7 @@ drop table mysqltest.t1; drop table mysqltest.t2; alter database mysqltest character set latin1; execute stmt1; +--disable_warnings ONCE execute stmt2; show create table mysqltest.t1; show create table mysqltest.t2; diff --git a/mysql-test/t/sp-bugs.test b/mysql-test/t/sp-bugs.test index fe52632c784..a23ccea8189 100644 --- a/mysql-test/t/sp-bugs.test +++ b/mysql-test/t/sp-bugs.test @@ -138,4 +138,28 @@ DROP FUNCTION db1.f1; DROP TABLE db1.t1; DROP DATABASE db1; DROP DATABASE db2; + +--echo # +--echo # Bug#13105873:valgrind warning:possible crash in foreign +--echo # key handling on subsequent create table if not exists +--echo # + +--disable_warnings +DROP DATABASE IF EXISTS testdb; +--enable_warnings +CREATE DATABASE testdb; +USE testdb; +CREATE TABLE t1 (id1 INT PRIMARY KEY); +DELIMITER $; +CREATE PROCEDURE `p1`() +BEGIN + CREATE TABLE IF NOT EXISTS t2(id INT PRIMARY KEY, + CONSTRAINT FK FOREIGN KEY (id) REFERENCES t1( id1 )); +END$ +DELIMITER ;$ +CALL p1(); +--echo # below stmt should not return valgrind warnings +CALL p1(); +DROP DATABASE testdb; + --echo End of 5.1 tests diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index cafa7f0a551..02182dbf0c6 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -9040,3 +9040,32 @@ DROP PROCEDURE p2; DROP TABLE t1; --echo # End of 5.5 test + + +--echo # +--echo # Bug#12663165 SP DEAD CODE REMOVAL DOESN'T UNDERSTAND CONTINUE HANDLERS +--echo # + +--disable_warnings +DROP FUNCTION IF EXISTS f1; +--enable_warnings + +delimiter $; +CREATE FUNCTION f1() RETURNS INT +BEGIN + DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; + BEGIN + DECLARE CONTINUE HANDLER FOR SQLEXCEPTION RETURN f1(); + BEGIN + DECLARE CONTINUE HANDLER FOR SQLEXCEPTION RETURN f1(); + RETURN f1(); + END; + END; +RETURN 1; +END $ +delimiter ;$ + +# This used to cause an assertion. +SELECT f1(); + +DROP FUNCTION f1; diff --git a/mysql-test/valgrind.supp b/mysql-test/valgrind.supp index 54f8c9b45f9..800a5a90b39 100644 --- a/mysql-test/valgrind.supp +++ b/mysql-test/valgrind.supp @@ -1061,7 +1061,7 @@ fun:my_b_flush_io_cache fun:_my_b_write fun:_Z*10write_keysP13st_sort_paramPPhjP11st_io_cacheS4_ - fun:_Z*13find_all_keysP13st_sort_paramP10SQL_SELECTPPhP11st_io_cacheS6_S6_ + fun:_Z*13find_all_keysP13st_sort_paramP10SQL_SELECTPPhP11st_io_cacheS6_ fun:_Z8filesortP3THDP5TABLEP13st_sort_fieldjP10SQL_SELECTybPy } |