RESET MASTER; drop table if exists t1; reset master; create table t1 (a bigint unsigned, b bigint(20) unsigned); Warnings: Warning 1681 Integer display width is deprecated and will be removed in a future release. prepare stmt from "insert into t1 values (?,?)"; set @a= 9999999999999999; set @b= 14632475938453979136; execute stmt using @a, @b; deallocate prepare stmt; drop table t1; include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info binlog.000001 # Query # # use `test`; create table t1 (a bigint unsigned, b bigint(20) unsigned) binlog.000001 # Query # # BEGIN binlog.000001 # Table_map # # table_id: # (test.t1) binlog.000001 # Write_rows # # table_id: # flags: STMT_END_F binlog.000001 # Query # # COMMIT binlog.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ reset master; CREATE DATABASE bug39182 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci; Warnings: Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. Warning 3778 'utf8mb3_unicode_ci' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead. USE bug39182; CREATE TABLE t1 (a VARCHAR(255) COLLATE utf8_unicode_ci) DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; Warnings: Warning 3778 'utf8mb3_unicode_ci' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead. Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. Warning 3778 'utf8mb3_unicode_ci' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead. CREATE PROCEDURE p1() BEGIN DECLARE s1 VARCHAR(255); SET s1= "test"; CREATE TEMPORARY TABLE tmp1 SELECT * FROM t1 WHERE a LIKE CONCAT("%", s1, "%"); SELECT COLLATION(NAME_CONST('s1', _utf8'test')) c1, COLLATION(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) c2, COLLATION(s1) c3, COERCIBILITY(NAME_CONST('s1', _utf8'test')) d1, COERCIBILITY(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) d2, COERCIBILITY(s1) d3; DROP TEMPORARY TABLE tmp1; END// Warnings: Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. CALL p1(); c1 c2 c3 d1 d2 d3 utf8mb3_general_ci utf8mb3_unicode_ci utf8mb3_unicode_ci 4 0 2 Warnings: Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info binlog.000001 # Query # # CREATE DATABASE bug39182 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci binlog.000001 # Query # # use `bug39182`; CREATE TABLE t1 (a VARCHAR(255) COLLATE utf8_unicode_ci) DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci binlog.000001 # Query # # use `bug39182`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`() BEGIN DECLARE s1 VARCHAR(255); SET s1= "test"; CREATE TEMPORARY TABLE tmp1 SELECT * FROM t1 WHERE a LIKE CONCAT("%", s1, "%"); SELECT COLLATION(NAME_CONST('s1', _utf8'test')) c1, COLLATION(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) c2, COLLATION(s1) c3, COERCIBILITY(NAME_CONST('s1', _utf8'test')) d1, COERCIBILITY(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) d2, COERCIBILITY(s1) d3; DROP TEMPORARY TABLE tmp1; END DROP PROCEDURE p1; DROP TABLE t1; DROP DATABASE bug39182; USE test; CREATE PROCEDURE p1(IN v1 INT) BEGIN CREATE TABLE t1 SELECT v1; DROP TABLE t1; END// CREATE PROCEDURE p2() BEGIN DECLARE v1 INT; CREATE TABLE t1 SELECT v1+1; DROP TABLE t1; END// CREATE PROCEDURE p3(IN v1 INT) BEGIN CREATE TABLE t1 SELECT 1 FROM DUAL WHERE v1!=0; DROP TABLE t1; END// CREATE PROCEDURE p4(IN v1 INT) BEGIN DECLARE v2 INT; CREATE TABLE t1 SELECT 1, v1, v2; DROP TABLE t1; CREATE TABLE t1 SELECT 1, v1+1, v2; DROP TABLE t1; END// CALL p1(1); CALL p2(); CALL p3(0); CALL p4(0); DROP PROCEDURE p1; DROP PROCEDURE p2; DROP PROCEDURE p3; DROP PROCEDURE p4; End of 5.0 tests reset master; create table t1 (id tinyint auto_increment primary key); set insert_id=128; insert ignore into t1 values(null); Warnings: Warning 1264 Out of range value for column 'id' at row 1 select * from t1; id 127 drop table t1; create table t1 (a int); create table if not exists t2 select * from t1; create temporary table tt1 (a int); create table if not exists t3 like tt1; USE mysql; INSERT IGNORE INTO user SET host='localhost', user='@#@', authentication_string='*1111111111111111111111111111111111111111'; UPDATE user SET authentication_string='*67092806AE91BFB6BE72DE6C7BE2B7CCA8CFA9DF' WHERE host='localhost' AND user='@#@'; DELETE FROM user WHERE host='localhost' AND user='@#@'; use test; include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info binlog.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key) binlog.000001 # Query # # BEGIN binlog.000001 # Table_map # # table_id: # (test.t1) binlog.000001 # Write_rows # # table_id: # flags: STMT_END_F binlog.000001 # Query # # COMMIT binlog.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ binlog.000001 # Query # # use `test`; create table t1 (a int) binlog.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t2` ( `a` int DEFAULT NULL ) binlog.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t3` ( `a` int DEFAULT NULL ) ENGINE=InnoDB binlog.000001 # Query # # BEGIN binlog.000001 # Table_map # # table_id: # (mysql.user) binlog.000001 # Write_rows # # table_id: # flags: STMT_END_F binlog.000001 # Xid # # COMMIT /* XID */ binlog.000001 # Query # # BEGIN binlog.000001 # Table_map # # table_id: # (mysql.user) binlog.000001 # Update_rows # # table_id: # flags: STMT_END_F binlog.000001 # Xid # # COMMIT /* XID */ binlog.000001 # Query # # BEGIN binlog.000001 # Table_map # # table_id: # (mysql.user) binlog.000001 # Delete_rows # # table_id: # flags: STMT_END_F binlog.000001 # Xid # # COMMIT /* XID */ drop table t1,t2,t3,tt1; # # Bug #45998: database crashes when running "create as select" # CREATE DATABASE test1; USE test1; DROP DATABASE test1; CREATE TABLE test.t1(a int); INSERT INTO test.t1 VALUES (1), (2); CREATE TABLE test.t2 SELECT * FROM test.t1; USE test; DROP TABLES t1, t2; RESET MASTER; CREATE TABLE t1 (a INT PRIMARY KEY); BINLOG ' 3u9kSA8KAAAAZgAAAGoAAAABAAQANS4xLjM1LW1hcmlhLWJldGExLWRlYnVnLWxvZwAAAAAAAAAA AAAAAAAAAAAAAAAAAADe72RIEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC '; INSERT INTO t1 VALUES (1); BINLOG ' 3u9kSBMUAAAAKQAAAJEBAAAAABoAAAAAAAAABHRlc3QAAnQxAAEDAAA= 3u9kSBcUAAAAIgAAALMBAAAQABoAAAAAAAEAAf/+AgAAAA== '; include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info # # Query 1 # use `test`; CREATE TABLE t1 (a INT PRIMARY KEY) # # Query 1 # BEGIN # # Table_map 1 # table_id: # (test.t1) # # Write_rows 1 # table_id: # flags: STMT_END_F # # Query 1 # COMMIT # # Query 1 # BEGIN # # Table_map 1 # table_id: # (test.t1) # # Write_rows 1 # table_id: # flags: STMT_END_F # # Query 1 # COMMIT DROP TABLE t1; # BUG#54903 BINLOG statement toggles session variables # ---------------------------------------------------------------------- # This test verify that BINLOG statement doesn't change current session's # variables foreign_key_checks and unique_checks. CREATE TABLE t1 (c1 INT KEY); SET @@SESSION.foreign_key_checks= ON; SET @@SESSION.unique_checks= ON; # INSERT INTO t1 VALUES (1) # foreign_key_checks=0 and unique_checks=0 BINLOG ' dfLtTBMBAAAAKQAAANcAAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE= dfLtTBcBAAAAIgAAAPkAAAAAABcAAAAAAAcAAf/+AQAAAA== '; SELECT * FROM t1; c1 1 # Their values should be ON SHOW SESSION VARIABLES LIKE "%_checks"; Variable_name Value foreign_key_checks ON unique_checks ON SET @@SESSION.foreign_key_checks= OFF; SET @@SESSION.unique_checks= OFF; # INSERT INTO t1 VALUES(2) # foreign_key_checks=1 and unique_checks=1 BINLOG ' dfLtTBMBAAAAKQAAAKsBAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE= dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA== '; SELECT * FROM t1; c1 1 2 # Their values should be OFF SHOW SESSION VARIABLES LIKE "%_checks"; Variable_name Value foreign_key_checks OFF unique_checks OFF # INSERT INTO t1 VALUES(2) # foreign_key_checks=1 and unique_checks=1 # It should not change current session's variables, even error happens call mtr.add_suppression("Replica SQL.*Could not execute Write_rows_v1 event on table test.t1; Duplicate entry .2. for key .t1.PRIMARY., Error_code: 1062"); BINLOG ' dfLtTBMBAAAAKQAAAKsBAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE= dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA== '; ERROR 23000: Duplicate entry '2' for key 't1.PRIMARY' SELECT * FROM t1; c1 1 2 # Their values should be OFF SHOW SESSION VARIABLES LIKE "%_checks"; Variable_name Value foreign_key_checks OFF unique_checks OFF DROP TABLE t1;