diff options
Diffstat (limited to 'mysql-test/suite')
220 files changed, 12761 insertions, 785 deletions
diff --git a/mysql-test/suite/binlog/r/binlog_multi_engine.result b/mysql-test/suite/binlog/r/binlog_multi_engine.result index 2cdd62655fa..b0ec756b651 100644 --- a/mysql-test/suite/binlog/r/binlog_multi_engine.result +++ b/mysql-test/suite/binlog/r/binlog_multi_engine.result @@ -8,14 +8,14 @@ INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2); INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2); UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. The last event before the COMMIT is use `test`; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c *** Please look in binlog_multi_engine.test if you have a diff here **** START TRANSACTION; INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2); UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c; COMMIT; TRUNCATE t1m; diff --git a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result index a15e6808a09..86da7468892 100644 --- a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result +++ b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result @@ -53,10 +53,10 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; savepoint my_savepoint +master-bin.000001 # Query # # SAVEPOINT my_savepoint master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; rollback to savepoint my_savepoint +master-bin.000001 # Query # # ROLLBACK TO my_savepoint master-bin.000001 # Xid # # COMMIT /* XID */ delete from t1; delete from t2; @@ -84,10 +84,10 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; savepoint my_savepoint +master-bin.000001 # Query # # SAVEPOINT my_savepoint master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; rollback to savepoint my_savepoint +master-bin.000001 # Query # # ROLLBACK TO my_savepoint master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ @@ -412,13 +412,41 @@ master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE IF NOT EXISTS `t2` ( + `a` int(11) NOT NULL DEFAULT '0', + `b` int(11) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE IF NOT EXISTS `t2` ( + `a` int(11) NOT NULL DEFAULT '0', + `b` int(11) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB +master-bin.000001 # Query # # ROLLBACK +master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE IF NOT EXISTS `t2` ( + `a` int(11) NOT NULL DEFAULT '0', + `b` int(11) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE IF NOT EXISTS `t2` ( + `a` int(11) NOT NULL DEFAULT '0', + `b` int(11) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB +master-bin.000001 # Query # # ROLLBACK master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `t2` /* generated by server */ reset master; @@ -848,11 +876,11 @@ delete from t4; insert into t3 values (1,1),(2,2); insert into t4 values (1,1),(2,2); reset master; -UPDATE t3,t4 SET t3.a=t4.a + bug27417(1); +UPDATE t3,t4 SET t3.a = t4.a + bug27417(1) where t3.a = 1; ERROR 23000: Duplicate entry '2' for key 'PRIMARY' select count(*) from t1 /* must be 1 */; count(*) -2 +1 drop table t4; delete from t1; delete from t2; diff --git a/mysql-test/suite/binlog/r/binlog_spurious_ddl_errors.result b/mysql-test/suite/binlog/r/binlog_spurious_ddl_errors.result new file mode 100644 index 00000000000..17a473ff062 --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_spurious_ddl_errors.result @@ -0,0 +1,53 @@ +SET @old_binlog_format= @@global.binlog_format; +INSTALL PLUGIN example SONAME 'ha_example.so'; +################################################################################ +# Verifies if ER_BINLOG_STMT_MODE_AND_ROW_ENGINE happens by setting the binlog +# format to STATEMENT and the transaction isolation level to READ COMMITTED as +# such changes force Innodb to accept changes in the row format. +# +# When CREATE TABLE, ALTER TABLE, CREATE INDEX and CREATE TRIGGER are executed +# any error should be triggered. +# +# In contrast, CREATE TABLE ... SELECT should trigger the following error: +# ER_BINLOG_STMT_MODE_AND_ROW_ENGINE. +################################################################################ +SET binlog_format = STATEMENT; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +CREATE TABLE t_row (a VARCHAR(100)) ENGINE = InnoDB; +ALTER TABLE t_row ADD COLUMN b INT; +CREATE TRIGGER trig_row BEFORE INSERT ON t_row FOR EACH ROW INSERT INTO t_stmt VALUES (1); +CREATE INDEX i ON t_row(a); +CREATE TABLE t_row_new ENGINE = InnoDB SELECT * FROM t_row; +ERROR HY000: Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED. +DROP TABLE t_row; + + +################################################################################ +# Verifies if ER_BINLOG_ROW_MODE_AND_STMT_ENGINE happens by setting the binlog +# format to ROW and using a engine, i.e. EXAMPLE, that only supports STATEMENT. +# +# When CREATE TABLE, ALTER TABLE, CREATE INDEX and CREATE TRIGGER are executed +# the error ER_BINLOG_ROW_MODE_AND_STMT_ENGINE is not triggered. Note that other +# errors are triggered due to restrictions in the engine. +# +# In contrast, CREATE TABLE ... SELECT should trigger the following error: +# ER_BINLOG_ROW_MODE_AND_STMT_ENGINE. +################################################################################ +SET binlog_format = ROW; +CREATE TABLE t_stmt (a VARCHAR(100)) ENGINE = EXAMPLE; +ALTER TABLE t_stmt ADD COLUMN b INT; +ERROR 42000: This version of MySQL doesn't yet support 'ALTER TABLE' +CREATE TRIGGER trig_stmt BEFORE INSERT ON t_stmt FOR EACH ROW INSERT INTO t_stmt VALUES (1); +CREATE INDEX i ON t_stmt(a); +ERROR 42000: Too many key parts specified; max 0 parts allowed +CREATE TABLE t_stmt_new ENGINE = EXAMPLE SELECT * FROM t_stmt; +ERROR HY000: Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-based logging. +DROP TABLE t_stmt; + + +################################################################################ +# CLEAN UP # +################################################################################ +UNINSTALL PLUGIN example; +SET @@global.binlog_format = @old_binlog_format; +SET @@session.binlog_format = @old_binlog_format; diff --git a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result index 837aafb9ae7..9bf6f4de144 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result +++ b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result @@ -8,7 +8,7 @@ begin; insert into t1 values(1); insert into t2 select * from t1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. commit; show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info @@ -23,7 +23,7 @@ begin; insert into t1 values(2); insert into t2 select * from t1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. rollback; Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back @@ -42,7 +42,7 @@ savepoint my_savepoint; insert into t1 values(4); insert into t2 select * from t1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. rollback to savepoint my_savepoint; Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back @@ -51,10 +51,10 @@ show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into t1 values(3) -master-bin.000001 # Query # # use `test`; savepoint my_savepoint +master-bin.000001 # Query # # SAVEPOINT my_savepoint master-bin.000001 # Query # # use `test`; insert into t1 values(4) master-bin.000001 # Query # # use `test`; insert into t2 select * from t1 -master-bin.000001 # Query # # use `test`; rollback to savepoint my_savepoint +master-bin.000001 # Query # # ROLLBACK TO my_savepoint master-bin.000001 # Xid # # COMMIT /* XID */ delete from t1; delete from t2; @@ -65,7 +65,7 @@ savepoint my_savepoint; insert into t1 values(6); insert into t2 select * from t1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. rollback to savepoint my_savepoint; Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back @@ -79,10 +79,10 @@ show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into t1 values(5) -master-bin.000001 # Query # # use `test`; savepoint my_savepoint +master-bin.000001 # Query # # SAVEPOINT my_savepoint master-bin.000001 # Query # # use `test`; insert into t1 values(6) master-bin.000001 # Query # # use `test`; insert into t2 select * from t1 -master-bin.000001 # Query # # use `test`; rollback to savepoint my_savepoint +master-bin.000001 # Query # # ROLLBACK TO my_savepoint master-bin.000001 # Query # # use `test`; insert into t1 values(7) master-bin.000001 # Xid # # COMMIT /* XID */ delete from t1; @@ -95,7 +95,7 @@ begin; insert into t1 values(8); insert into t2 select * from t1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. select get_lock("a",10); get_lock("a",10) 1 @@ -111,7 +111,7 @@ reset master; insert into t1 values(9); insert into t2 select * from t1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN @@ -127,7 +127,7 @@ insert into t1 values(10); begin; insert into t2 select * from t1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN @@ -246,7 +246,7 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back create table t0 (n int); insert t0 select * from t1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. set autocommit=1; insert into t0 select GET_LOCK("lock1",null); Warnings: @@ -418,6 +418,9 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t2 values (100,100) master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO t2 values (101,101) +master-bin.000001 # Query # # ROLLBACK master-bin.000001 # Query # # use `test`; DROP TABLE t1,t2 reset master; create table t1 (a int) engine=innodb; @@ -429,7 +432,7 @@ begin; insert into t1 values(8); insert into t2 select * from t1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. select get_lock("a",10); get_lock("a",10) 1 @@ -886,7 +889,7 @@ delete from t4; insert into t3 values (1,1),(2,2); insert into t4 values (1,1),(2,2); reset master; -UPDATE t3,t4 SET t3.a=t4.a + bug27417(1); +UPDATE t3,t4 SET t3.a = t4.a + bug27417(1) where t3.a = 1; ERROR 23000: Duplicate entry '2' for key 'PRIMARY' select count(*) from t1 /* must be 1 */; count(*) diff --git a/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result b/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result index e3250f00dbf..d6d44ccad8e 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result +++ b/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result @@ -67,11 +67,8 @@ Note 1592 Unsafe statement written to the binary log using statement format sinc SELECT sf_bug50192(); sf_bug50192() 1 -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctly. SHOW WARNINGS; Level Code Message -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctly. DROP FUNCTION sf_bug50192; DROP TRIGGER tr_bug50192; DROP TABLE t1, t2; diff --git a/mysql-test/suite/binlog/r/binlog_switch_inside_trans.result b/mysql-test/suite/binlog/r/binlog_switch_inside_trans.result index de224a190c2..48b6dfa61d9 100644 --- a/mysql-test/suite/binlog/r/binlog_switch_inside_trans.result +++ b/mysql-test/suite/binlog/r/binlog_switch_inside_trans.result @@ -1,5 +1,6 @@ set @save_binlog_format= @@global.binlog_format; set @save_binlog_dirct= @@global.binlog_direct_non_transactional_updates; +set @save_sql_log_bin= @@global.sql_log_bin; create table t1 (a int) engine= myisam; create table t2 (a int) engine= innodb; SELECT @@session.binlog_format; @@ -8,116 +9,148 @@ ROW SELECT @@session.binlog_direct_non_transactional_updates; @@session.binlog_direct_non_transactional_updates 1 +SELECT @@session.sql_log_bin; +@@session.sql_log_bin +1 SET AUTOCOMMIT=1; -# Test that the session variable 'binlog_format' and -# 'binlog_direct_non_transactional_updates' are -# writable outside a transaction. -# Current session values are ROW and FALSE, respectively. +# Test that the session variable 'binlog_format', +# 'binlog_direct_non_transactional_updates' and 'sql_log_bin' +# are writable outside a transaction. +# Current session values are ROW, FALSE, TRUE, respectively. set @@session.binlog_format= statement; set @@session.binlog_direct_non_transactional_updates= TRUE; +set @@session.sql_log_bin= FALSE; SELECT @@session.binlog_format; @@session.binlog_format STATEMENT SELECT @@session.binlog_direct_non_transactional_updates; @@session.binlog_direct_non_transactional_updates 1 +SELECT @@session.sql_log_bin; +@@session.sql_log_bin +0 begin; -# Test that the session variable 'binlog_format' and -# 'binlog_direct_non_transactional_updates' are +# Test that the session variable 'binlog_format', +# 'binlog_direct_non_transactional_updates' and 'sql_log_bin' are # read-only inside a transaction with no preceding updates. -# Current session values are STATEMENT and TRUE, respectively. +# Current session values are STATEMENT, TRUE, FALSE, respectively. set @@session.binlog_format= mixed; ERROR HY000: Cannot modify @@session.binlog_format inside a transaction set @@session.binlog_direct_non_transactional_updates= FALSE; ERROR HY000: Cannot modify @@session.binlog_direct_non_transactional_updates inside a transaction +set @@session.sql_log_bin= FALSE; +ERROR HY000: Cannot modify @@session.sql_log_bin inside a transaction insert into t2 values (1); -# Test that the session variable 'binlog_format' and -# 'binlog_direct_non_transactional_updates' are +# Test that the session variable 'binlog_format', +# 'binlog_direct_non_transactional_updates' and 'sql_log_bin' are # read-only inside a transaction with preceding transactional updates. -# Current session values are STATEMENT and TRUE, respectively. +# Current session values are STATEMENT, TRUE and FALSE, respectively. set @@session.binlog_format= row; ERROR HY000: Cannot modify @@session.binlog_format inside a transaction set @@session.binlog_direct_non_transactional_updates= FALSE; ERROR HY000: Cannot modify @@session.binlog_direct_non_transactional_updates inside a transaction +set @@session.sql_log_bin= FALSE; +ERROR HY000: Cannot modify @@session.sql_log_bin inside a transaction commit; begin; insert into t1 values (2); -# Test that the session variable 'binlog_format' and -# 'binlog_direct_non_transactional_updates' are +# Test that the session variable 'binlog_format' +# 'binlog_direct_non_transactional_updates' and 'sql_log_bin' are # read-only inside a transaction with preceding non-transactional updates. -# Current session values are STATEMENT and TRUE, respectively. +# Current session values are STATEMENT, TRUE, FALSE, respectively. set @@session.binlog_format= mixed; ERROR HY000: Cannot modify @@session.binlog_format inside a transaction set @@session.binlog_direct_non_transactional_updates= FALSE; ERROR HY000: Cannot modify @@session.binlog_direct_non_transactional_updates inside a transaction +set @@session.sql_log_bin= FALSE; +ERROR HY000: Cannot modify @@session.sql_log_bin inside a transaction commit; -# Test that the session variable 'binlog_format' and -# 'binlog_direct_non_transactional_updates' are +# Test that the session variable 'binlog_format', +# 'binlog_direct_non_transactional_updates' and 'sql_log_bin' are # writable when AUTOCOMMIT=0, before a transaction has started. -# Current session values are STATEMENT and TRUE, respectively. +# Current session values are STATEMENT, TRUE, FALSE, respectively. set AUTOCOMMIT=0; set @@session.binlog_format= row; set @@session.binlog_direct_non_transactional_updates= FALSE; +set @@session.sql_log_bin= TRUE; SELECT @@session.binlog_format; @@session.binlog_format ROW SELECT @@session.binlog_direct_non_transactional_updates; @@session.binlog_direct_non_transactional_updates 0 +SELECT @@session.sql_log_bin; +@@session.sql_log_bin +1 insert into t1 values (3); -# Test that the session variable 'binlog_format' and -# 'binlog_direct_non_transactional_updates' are +# Test that the session variable 'binlog_format', +# 'binlog_direct_non_transactional_updates' and 'sql_log_bin' are # read-only inside an AUTOCOMMIT=0 transaction # with preceding non-transactional updates. -# Current session values are ROW and FALSE, respectively. +# Current session values are ROW, FALSE, TRUE, respectively. set @@session.binlog_format= statement; ERROR HY000: Cannot modify @@session.binlog_format inside a transaction set @@session.binlog_direct_non_transactional_updates= TRUE; ERROR HY000: Cannot modify @@session.binlog_direct_non_transactional_updates inside a transaction +set @@session.sql_log_bin= FALSE; +ERROR HY000: Cannot modify @@session.sql_log_bin inside a transaction SELECT @@session.binlog_format; @@session.binlog_format ROW SELECT @@session.binlog_direct_non_transactional_updates; @@session.binlog_direct_non_transactional_updates 0 +SELECT @@session.sql_log_bin; +@@session.sql_log_bin +1 commit; insert into t2 values (4); -# Test that the session variable 'binlog_format' and -# 'binlog_direct_non_transactional_updates' are +# Test that the session variable 'binlog_format', +# 'binlog_direct_non_transactional_updates' and 'sql_log_bin' are # read-only inside an AUTOCOMMIT=0 transaction with # preceding transactional updates. -# Current session values are ROW and FALSE, respectively. +# Current session values are ROW, FALSE, TRUE, respectively. set @@session.binlog_format= statement; ERROR HY000: Cannot modify @@session.binlog_format inside a transaction set @@session.binlog_direct_non_transactional_updates= TRUE; ERROR HY000: Cannot modify @@session.binlog_direct_non_transactional_updates inside a transaction +set @@session.sql_log_bin= FALSE; +ERROR HY000: Cannot modify @@session.sql_log_bin inside a transaction SELECT @@session.binlog_format; @@session.binlog_format ROW SELECT @@session.binlog_direct_non_transactional_updates; @@session.binlog_direct_non_transactional_updates 0 +SELECT @@session.sql_log_bin; +@@session.sql_log_bin +1 commit; begin; insert into t2 values (5); # Test that the global variable 'binlog_format' and -# 'binlog_direct_non_transactional_updates' are +# 'binlog_direct_non_transactional_updates' and 'sql_log_bin' are # writable inside a transaction. -# Current session values are ROW and FALSE, respectively. +# Current session values are ROW, FALSE, TRUE respectively. SELECT @@global.binlog_format; @@global.binlog_format ROW set @@global.binlog_format= statement; set @@global.binlog_direct_non_transactional_updates= TRUE; +set @@global.sql_log_bin= FALSE; SELECT @@global.binlog_format; @@global.binlog_format STATEMENT SELECT @@global.binlog_direct_non_transactional_updates; @@global.binlog_direct_non_transactional_updates 1 +SELECT @@global.sql_log_bin; +@@global.sql_log_bin +0 commit; set @@global.binlog_format= @save_binlog_format; set @@global.binlog_direct_non_transactional_updates= @save_binlog_dirct; +set @@global.sql_log_bin= @save_sql_log_bin; create table t3(a int, b int) engine= innodb; create table t4(a int) engine= innodb; create table t5(a int) engine= innodb; @@ -153,6 +186,23 @@ ERROR HY000: Cannot change the binlog direct flag inside a stored function or tr SELECT @@session.binlog_direct_non_transactional_updates; @@session.binlog_direct_non_transactional_updates 0 +create table t9(a int, b int) engine= innodb; +create table t10(a int) engine= innodb; +create table t11(a int) engine= innodb; +create trigger tr3 after insert on t9 for each row begin +insert into t10(a) values(1); +set @@session.sql_log_bin= TRUE; +insert into t10(a) values(2); +insert into t11(a) values(3); +end | +# Test that the session variable 'sql_log_bin' is +# read-only in sub-statements. +# Current session value is FALSE. +insert into t9(a,b) values(1,1); +ERROR HY000: Cannot change the sql_log_bin inside a stored function or trigger +SELECT @@session.sql_log_bin; +@@session.sql_log_bin +1 drop table t1; drop table t2; drop table t3; @@ -161,3 +211,6 @@ drop table t5; drop table t6; drop table t7; drop table t8; +drop table t9; +drop table t10; +drop table t11; diff --git a/mysql-test/suite/binlog/t/binlog_spurious_ddl_errors-master.opt b/mysql-test/suite/binlog/t/binlog_spurious_ddl_errors-master.opt new file mode 100644 index 00000000000..ffa981152ea --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_spurious_ddl_errors-master.opt @@ -0,0 +1 @@ +--innodb $EXAMPLE_PLUGIN_OPT diff --git a/mysql-test/suite/binlog/t/binlog_spurious_ddl_errors.test b/mysql-test/suite/binlog/t/binlog_spurious_ddl_errors.test new file mode 100644 index 00000000000..6514ff1f712 --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_spurious_ddl_errors.test @@ -0,0 +1,95 @@ +################################################################################ +# BUG#50479 DDL stmt on row-only/stmt-only tables generate spurious +# binlog_format errors +# +# In the fix of BUG#39934 in 5.1-rep+3, errors are generated when +# binlog_format=row and a statement modifies a table restricted to +# statement-logging (ER_BINLOG_ROW_MODE_AND_STMT_ENGINE); or if +# binlog_format=statement and a statement modifies a table limited to +# row-logging (ER_BINLOG_STMT_MODE_AND_ROW_ENGINE). +# +# In this test case, we check if some DDL statements that lock tables do not +# trigger errors as they do not generate rows events and as such are harmless +# from the point of view of conflicts between the engine's supported logging +# format and the value of binlog_format. +# +# In particular, we check if: +# 1 - ALTER TABLE, CREATE INDEX and CREATE TRIGGER do not generate either +# ER_BINLOG_STMT_MODE_AND_ROW_ENGINE or ER_BINLOG_STMT_MODE_AND_ROW_ENGINE +# +# 2 - CREATE TABLE ... SELECT generates an error because the command can +# generate row events but CREATE TABLE without SELECT does not generate +# an error. +################################################################################ +--source include/have_innodb.inc +--source include/have_example_plugin.inc +--source include/have_log_bin.inc + +SET @old_binlog_format= @@global.binlog_format; +INSTALL PLUGIN example SONAME 'ha_example.so'; + +--echo ################################################################################ +--echo # Verifies if ER_BINLOG_STMT_MODE_AND_ROW_ENGINE happens by setting the binlog +--echo # format to STATEMENT and the transaction isolation level to READ COMMITTED as +--echo # such changes force Innodb to accept changes in the row format. +--echo # +--echo # When CREATE TABLE, ALTER TABLE, CREATE INDEX and CREATE TRIGGER are executed +--echo # any error should be triggered. +--echo # +--echo # In contrast, CREATE TABLE ... SELECT should trigger the following error: +--echo # ER_BINLOG_STMT_MODE_AND_ROW_ENGINE. +--echo ################################################################################ +SET binlog_format = STATEMENT; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +CREATE TABLE t_row (a VARCHAR(100)) ENGINE = InnoDB; + +ALTER TABLE t_row ADD COLUMN b INT; + +CREATE TRIGGER trig_row BEFORE INSERT ON t_row FOR EACH ROW INSERT INTO t_stmt VALUES (1); + +CREATE INDEX i ON t_row(a); + +--error ER_BINLOG_STMT_MODE_AND_ROW_ENGINE +CREATE TABLE t_row_new ENGINE = InnoDB SELECT * FROM t_row; + +DROP TABLE t_row; + +--echo +--echo + +--echo ################################################################################ +--echo # Verifies if ER_BINLOG_ROW_MODE_AND_STMT_ENGINE happens by setting the binlog +--echo # format to ROW and using a engine, i.e. EXAMPLE, that only supports STATEMENT. +--echo # +--echo # When CREATE TABLE, ALTER TABLE, CREATE INDEX and CREATE TRIGGER are executed +--echo # the error ER_BINLOG_ROW_MODE_AND_STMT_ENGINE is not triggered. Note that other +--echo # errors are triggered due to restrictions in the engine. +--echo # +--echo # In contrast, CREATE TABLE ... SELECT should trigger the following error: +--echo # ER_BINLOG_ROW_MODE_AND_STMT_ENGINE. +--echo ################################################################################ +SET binlog_format = ROW; +CREATE TABLE t_stmt (a VARCHAR(100)) ENGINE = EXAMPLE; + +--error ER_NOT_SUPPORTED_YET +ALTER TABLE t_stmt ADD COLUMN b INT; + +CREATE TRIGGER trig_stmt BEFORE INSERT ON t_stmt FOR EACH ROW INSERT INTO t_stmt VALUES (1); + +--error ER_TOO_MANY_KEY_PARTS +CREATE INDEX i ON t_stmt(a); + +--error ER_BINLOG_ROW_MODE_AND_STMT_ENGINE +CREATE TABLE t_stmt_new ENGINE = EXAMPLE SELECT * FROM t_stmt; + +DROP TABLE t_stmt; + +--echo +--echo + +--echo ################################################################################ +--echo # CLEAN UP # +--echo ################################################################################ +UNINSTALL PLUGIN example; +SET @@global.binlog_format = @old_binlog_format; +SET @@session.binlog_format = @old_binlog_format; diff --git a/mysql-test/suite/binlog/t/binlog_switch_inside_trans.test b/mysql-test/suite/binlog/t/binlog_switch_inside_trans.test index cdc94198933..06c5e78bd0e 100644 --- a/mysql-test/suite/binlog/t/binlog_switch_inside_trans.test +++ b/mysql-test/suite/binlog/t/binlog_switch_inside_trans.test @@ -10,107 +10,128 @@ source include/have_binlog_format_row.inc; set @save_binlog_format= @@global.binlog_format; set @save_binlog_dirct= @@global.binlog_direct_non_transactional_updates; +set @save_sql_log_bin= @@global.sql_log_bin; create table t1 (a int) engine= myisam; create table t2 (a int) engine= innodb; SELECT @@session.binlog_format; SELECT @@session.binlog_direct_non_transactional_updates; +SELECT @@session.sql_log_bin; SET AUTOCOMMIT=1; ---echo # Test that the session variable 'binlog_format' and ---echo # 'binlog_direct_non_transactional_updates' are ---echo # writable outside a transaction. ---echo # Current session values are ROW and FALSE, respectively. +--echo # Test that the session variable 'binlog_format', +--echo # 'binlog_direct_non_transactional_updates' and 'sql_log_bin' +--echo # are writable outside a transaction. +--echo # Current session values are ROW, FALSE, TRUE, respectively. set @@session.binlog_format= statement; set @@session.binlog_direct_non_transactional_updates= TRUE; +set @@session.sql_log_bin= FALSE; SELECT @@session.binlog_format; SELECT @@session.binlog_direct_non_transactional_updates; +SELECT @@session.sql_log_bin; begin; ---echo # Test that the session variable 'binlog_format' and ---echo # 'binlog_direct_non_transactional_updates' are +--echo # Test that the session variable 'binlog_format', +--echo # 'binlog_direct_non_transactional_updates' and 'sql_log_bin' are --echo # read-only inside a transaction with no preceding updates. ---echo # Current session values are STATEMENT and TRUE, respectively. +--echo # Current session values are STATEMENT, TRUE, FALSE, respectively. --error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT set @@session.binlog_format= mixed; --error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT set @@session.binlog_direct_non_transactional_updates= FALSE; +--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN +set @@session.sql_log_bin= FALSE; insert into t2 values (1); ---echo # Test that the session variable 'binlog_format' and ---echo # 'binlog_direct_non_transactional_updates' are +--echo # Test that the session variable 'binlog_format', +--echo # 'binlog_direct_non_transactional_updates' and 'sql_log_bin' are --echo # read-only inside a transaction with preceding transactional updates. ---echo # Current session values are STATEMENT and TRUE, respectively. +--echo # Current session values are STATEMENT, TRUE and FALSE, respectively. --error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT set @@session.binlog_format= row; --error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT set @@session.binlog_direct_non_transactional_updates= FALSE; +--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN +set @@session.sql_log_bin= FALSE; commit; begin; insert into t1 values (2); ---echo # Test that the session variable 'binlog_format' and ---echo # 'binlog_direct_non_transactional_updates' are +--echo # Test that the session variable 'binlog_format' +--echo # 'binlog_direct_non_transactional_updates' and 'sql_log_bin' are --echo # read-only inside a transaction with preceding non-transactional updates. ---echo # Current session values are STATEMENT and TRUE, respectively. +--echo # Current session values are STATEMENT, TRUE, FALSE, respectively. --error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT set @@session.binlog_format= mixed; --error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT set @@session.binlog_direct_non_transactional_updates= FALSE; +--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN +set @@session.sql_log_bin= FALSE; commit; ---echo # Test that the session variable 'binlog_format' and ---echo # 'binlog_direct_non_transactional_updates' are +--echo # Test that the session variable 'binlog_format', +--echo # 'binlog_direct_non_transactional_updates' and 'sql_log_bin' are --echo # writable when AUTOCOMMIT=0, before a transaction has started. ---echo # Current session values are STATEMENT and TRUE, respectively. +--echo # Current session values are STATEMENT, TRUE, FALSE, respectively. set AUTOCOMMIT=0; set @@session.binlog_format= row; set @@session.binlog_direct_non_transactional_updates= FALSE; +set @@session.sql_log_bin= TRUE; SELECT @@session.binlog_format; SELECT @@session.binlog_direct_non_transactional_updates; +SELECT @@session.sql_log_bin; insert into t1 values (3); ---echo # Test that the session variable 'binlog_format' and ---echo # 'binlog_direct_non_transactional_updates' are +--echo # Test that the session variable 'binlog_format', +--echo # 'binlog_direct_non_transactional_updates' and 'sql_log_bin' are --echo # read-only inside an AUTOCOMMIT=0 transaction --echo # with preceding non-transactional updates. ---echo # Current session values are ROW and FALSE, respectively. +--echo # Current session values are ROW, FALSE, TRUE, respectively. --error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT set @@session.binlog_format= statement; --error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT set @@session.binlog_direct_non_transactional_updates= TRUE; +--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN +set @@session.sql_log_bin= FALSE; SELECT @@session.binlog_format; SELECT @@session.binlog_direct_non_transactional_updates; +SELECT @@session.sql_log_bin; commit; insert into t2 values (4); ---echo # Test that the session variable 'binlog_format' and ---echo # 'binlog_direct_non_transactional_updates' are +--echo # Test that the session variable 'binlog_format', +--echo # 'binlog_direct_non_transactional_updates' and 'sql_log_bin' are --echo # read-only inside an AUTOCOMMIT=0 transaction with --echo # preceding transactional updates. ---echo # Current session values are ROW and FALSE, respectively. +--echo # Current session values are ROW, FALSE, TRUE, respectively. --error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT set @@session.binlog_format= statement; --error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT set @@session.binlog_direct_non_transactional_updates= TRUE; +--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN +set @@session.sql_log_bin= FALSE; SELECT @@session.binlog_format; SELECT @@session.binlog_direct_non_transactional_updates; +SELECT @@session.sql_log_bin; commit; begin; insert into t2 values (5); --echo # Test that the global variable 'binlog_format' and ---echo # 'binlog_direct_non_transactional_updates' are +--echo # 'binlog_direct_non_transactional_updates' and 'sql_log_bin' are --echo # writable inside a transaction. ---echo # Current session values are ROW and FALSE, respectively. +--echo # Current session values are ROW, FALSE, TRUE respectively. SELECT @@global.binlog_format; set @@global.binlog_format= statement; set @@global.binlog_direct_non_transactional_updates= TRUE; + set @@global.sql_log_bin= FALSE; SELECT @@global.binlog_format; SELECT @@global.binlog_direct_non_transactional_updates; + SELECT @@global.sql_log_bin; commit; set @@global.binlog_format= @save_binlog_format; set @@global.binlog_direct_non_transactional_updates= @save_binlog_dirct; +set @@global.sql_log_bin= @save_sql_log_bin; create table t3(a int, b int) engine= innodb; create table t4(a int) engine= innodb; @@ -151,6 +172,25 @@ delimiter ;| insert into t6(a,b) values(1,1); SELECT @@session.binlog_direct_non_transactional_updates; +create table t9(a int, b int) engine= innodb; +create table t10(a int) engine= innodb; +create table t11(a int) engine= innodb; +delimiter |; +eval create trigger tr3 after insert on t9 for each row begin + insert into t10(a) values(1); + set @@session.sql_log_bin= TRUE; + insert into t10(a) values(2); + insert into t11(a) values(3); +end | +delimiter ;| + +--echo # Test that the session variable 'sql_log_bin' is +--echo # read-only in sub-statements. +--echo # Current session value is FALSE. +--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SQL_LOG_BIN +insert into t9(a,b) values(1,1); +SELECT @@session.sql_log_bin; + drop table t1; drop table t2; drop table t3; @@ -159,3 +199,6 @@ drop table t5; drop table t6; drop table t7; drop table t8; +drop table t9; +drop table t10; +drop table t11; diff --git a/mysql-test/suite/binlog/t/disabled.def b/mysql-test/suite/binlog/t/disabled.def index b12a0a1d96d..35ecf52decf 100644 --- a/mysql-test/suite/binlog/t/disabled.def +++ b/mysql-test/suite/binlog/t/disabled.def @@ -9,5 +9,7 @@ # Do not use any TAB characters for whitespace. # ############################################################################## -binlog_unsafe : BUG#50312 2010-01-13 lsoares Warnings for unsafe sub-statement not returned to client +binlog_truncate_innodb : BUG#42643 2009-02-06 mats Changes to InnoDB requires to complete fix for BUG#36763 +binlog_unsafe : BUG#50312 2010-01-13 lsoares Warnings for unsafe sub-statement not returned to client +binlog_spurious_ddl_errors : BUG#54195 2010-06-03 alik binlog_spurious_ddl_errors.test fails, thus disabled diff --git a/mysql-test/suite/engines/README b/mysql-test/suite/engines/README index 3ff6fccc689..0f89d5af67f 100644 --- a/mysql-test/suite/engines/README +++ b/mysql-test/suite/engines/README @@ -50,22 +50,22 @@ The following suites are included: Known Issues ------------ -1) The 'funcs' and 'iuds' suites currently runs only against MySQL 5.1 server. - Running them against MySQL 5.5 will generate errors. - -2) The folowing tests in the 'iuds' suite: +1) The folowing tests in the 'iuds' suite: - delete_decimal - insert_decimal - update_decimal will return a 'Warning 1264 - Out of range value...' warning if run in a 32-bit environment. Add the '--force' option to prevent the test run from aborting. -3) The following tests in the 'funcs' suite will fail when run against the innodb_plugin: +2) The following tests in the 'funcs' suite will fail when run against the innodb_plugin: - crash_manycolumns_string (bug 50495) - ix_unique_lob (bug 52056, masked by an 'Out of memory error' on some 32-bit platforms) - ix_unique_string_length (bug 52056, masked by an 'Out of memory error' on some 32-bit platforms) Add the '--force' option to prevent the test run from aborting. -4) Some of the rpl_xxx tests in the 'funcs' suite require a secific binlog_forat setting and will be +3) Some of the rpl_xxx tests in the 'funcs' suite require a secific binlog_forat setting and will be skipped otherwise. +4) Some of the rpl_xxx tests in the 'funcs' suite will report a 'Statement unsafe for replication' warning + when run againsr a server configured to use statement based replication. + diff --git a/mysql-test/suite/engines/iuds/r/update_delete_calendar.result b/mysql-test/suite/engines/iuds/r/update_delete_calendar.result index a04585dfd72..e2dd83e03b4 100644 --- a/mysql-test/suite/engines/iuds/r/update_delete_calendar.result +++ b/mysql-test/suite/engines/iuds/r/update_delete_calendar.result @@ -791,9 +791,6 @@ Warning 1292 Truncated incorrect datetime value: '2009-01-10 23:60:59' SELECT count(*) FROM t1 WHERE c2='2001-01-11 23:59:60' /* returns 0 */; count(*) 0 -Warnings: -Warning 1292 Incorrect datetime value: '2001-01-11 23:59:60' for column 'c2' at row 1 -Warning 1292 Incorrect datetime value: '2001-01-11 23:59:60' for column 'c2' at row 1 SELECT * FROM t1 WHERE c1='0000-00-00 00:00:00' OR c2='0000-00-00 00:00:00'; c1 c2 c3 0000-00-00 00:00:00 0000-00-00 00:00:00 6 diff --git a/mysql-test/suite/engines/iuds/t/disabled.def b/mysql-test/suite/engines/iuds/t/disabled.def index 7fd504c0996..c8fdf80274b 100644 --- a/mysql-test/suite/engines/iuds/t/disabled.def +++ b/mysql-test/suite/engines/iuds/t/disabled.def @@ -1,3 +1,2 @@ insert_calendar : Bug#52283 Innodb reports extra warnings when SELECT/WHERE is performed using invalid value update_delete_calendar : Bug#52824 + Bug#52283(in case of Innodb) - diff --git a/mysql-test/suite/engines/iuds/t/insert_number.test b/mysql-test/suite/engines/iuds/t/insert_number.test index e2c809fad85..b55bd8dc98a 100644 --- a/mysql-test/suite/engines/iuds/t/insert_number.test +++ b/mysql-test/suite/engines/iuds/t/insert_number.test @@ -7812,6 +7812,9 @@ SELECT * FROM t2 ORDER BY c1,c6 LIMIT 2; SELECT * FROM t2 ORDER BY c1,c6 DESC LIMIT 2; ## ref type access + +# Bug#52283 : Remove the following --disable_warnings +# command when the bug is fixed --disable_warnings SELECT * FROM t2 WHERE c1 = 18446744073709551616 ORDER BY c1,c6; SELECT * FROM t2 WHERE c1 = 18446744073709551616 ORDER BY c1,c6 LIMIT 2; diff --git a/mysql-test/suite/engines/iuds/t/update_delete_calendar.test b/mysql-test/suite/engines/iuds/t/update_delete_calendar.test index aa695953ce1..c6a22511766 100644 --- a/mysql-test/suite/engines/iuds/t/update_delete_calendar.test +++ b/mysql-test/suite/engines/iuds/t/update_delete_calendar.test @@ -300,7 +300,12 @@ INSERT INTO t1 VALUES('2001-01-09','2001-01-10',6),('2001-01-11','2001-01-12',7) UPDATE t1 SET c1='2001-01-09 24:59:59',c2='2009-01-10 23:60:59' WHERE c1='2001-01-09'; UPDATE t1 SET c2='2001-01-11 23:59:60' WHERE c1='2001-01-11'; SELECT count(*) FROM t1 WHERE c1='2001-01-09 24:59:59' AND c2='2009-01-10 23:60:59'; + +# Bug#52283 : Remove the following --disable_warnings +# command when the bug is fixed +--disable_warnings SELECT count(*) FROM t1 WHERE c2='2001-01-11 23:59:60' /* returns 0 */; +--enable_warnings --sorted_result SELECT * FROM t1 WHERE c1='0000-00-00 00:00:00' OR c2='0000-00-00 00:00:00'; diff --git a/mysql-test/suite/innodb/r/innodb-autoinc-44030.result b/mysql-test/suite/innodb/r/innodb-autoinc-44030.result new file mode 100644 index 00000000000..54e972843f5 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb-autoinc-44030.result @@ -0,0 +1,30 @@ +drop table if exists t1; +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; +CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (null); +INSERT INTO t1 VALUES (null); +ALTER TABLE t1 CHANGE c1 d1 INT NOT NULL AUTO_INCREMENT; +SELECT * FROM t1; +d1 +1 +2 +SELECT * FROM t1; +d1 +1 +2 +INSERT INTO t1 VALUES(null); +ALTER TABLE t1 AUTO_INCREMENT = 3; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `d1` int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`d1`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES(null); +SELECT * FROM t1; +d1 +1 +2 +3 +4 +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/r/innodb-autoinc.result b/mysql-test/suite/innodb/r/innodb-autoinc.result new file mode 100644 index 00000000000..a36b3a1a865 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb-autoinc.result @@ -0,0 +1,1246 @@ +drop table if exists t1; +CREATE TABLE t1 (c1 BIGINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (9223372036854775807, null); +INSERT INTO t1 (c2) VALUES ('innodb'); +Got one of the listed errors +SELECT * FROM t1; +c1 c2 +9223372036854775807 NULL +DROP TABLE t1; +CREATE TABLE t1 (c1 TINYINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (127, null); +INSERT INTO t1 (c2) VALUES ('innodb'); +Got one of the listed errors +SELECT * FROM t1; +c1 c2 +127 NULL +DROP TABLE t1; +CREATE TABLE t1 (c1 TINYINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (255, null); +INSERT INTO t1 (c2) VALUES ('innodb'); +Got one of the listed errors +SELECT * FROM t1; +c1 c2 +255 NULL +DROP TABLE t1; +CREATE TABLE t1 (c1 SMALLINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (32767, null); +INSERT INTO t1 (c2) VALUES ('innodb'); +Got one of the listed errors +SELECT * FROM t1; +c1 c2 +32767 NULL +DROP TABLE t1; +CREATE TABLE t1 (c1 SMALLINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (65535, null); +INSERT INTO t1 (c2) VALUES ('innodb'); +Got one of the listed errors +SELECT * FROM t1; +c1 c2 +65535 NULL +DROP TABLE t1; +CREATE TABLE t1 (c1 MEDIUMINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (8388607, null); +INSERT INTO t1 (c2) VALUES ('innodb'); +Got one of the listed errors +SELECT * FROM t1; +c1 c2 +8388607 NULL +DROP TABLE t1; +CREATE TABLE t1 (c1 MEDIUMINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (16777215, null); +INSERT INTO t1 (c2) VALUES ('innodb'); +Got one of the listed errors +SELECT * FROM t1; +c1 c2 +16777215 NULL +DROP TABLE t1; +CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (2147483647, null); +INSERT INTO t1 (c2) VALUES ('innodb'); +Got one of the listed errors +SELECT * FROM t1; +c1 c2 +2147483647 NULL +DROP TABLE t1; +CREATE TABLE t1 (c1 INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (4294967295, null); +INSERT INTO t1 (c2) VALUES ('innodb'); +Got one of the listed errors +SELECT * FROM t1; +c1 c2 +4294967295 NULL +DROP TABLE t1; +CREATE TABLE t1 (c1 BIGINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (9223372036854775807, null); +INSERT INTO t1 (c2) VALUES ('innodb'); +Got one of the listed errors +SELECT * FROM t1; +c1 c2 +9223372036854775807 NULL +DROP TABLE t1; +CREATE TABLE t1 (c1 BIGINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (18446744073709551615, null); +INSERT INTO t1 (c2) VALUES ('innodb'); +Got one of the listed errors +SELECT * FROM t1; +c1 c2 +18446744073709551615 NULL +DROP TABLE t1; +CREATE TABLE t1(c1 INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1), (2), (3); +INSERT INTO t1 VALUES (NULL), (NULL), (NULL); +SELECT c1 FROM t1; +c1 +1 +2 +3 +4 +5 +6 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1 +TRUNCATE TABLE t1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (1), (2), (3); +INSERT INTO t1 VALUES (NULL), (NULL), (NULL); +SELECT c1 FROM t1; +c1 +1 +2 +3 +4 +5 +6 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(c1 INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1), (2), (3); +INSERT INTO t1 VALUES (NULL), (NULL), (NULL); +SELECT c1 FROM t1; +c1 +1 +2 +3 +4 +5 +6 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1 +DELETE FROM t1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (1), (2), (3); +INSERT INTO t1 VALUES (NULL), (NULL), (NULL); +SELECT c1 FROM t1; +c1 +1 +2 +3 +7 +8 +9 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 't1' +CREATE TABLE t1 (c1 INT AUTO_INCREMENT, c2 INT, PRIMARY KEY(c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (NULL, 1); +DELETE FROM t1 WHERE c1 = 1; +INSERT INTO t1 VALUES (2,1); +INSERT INTO t1 VALUES (NULL,8); +SELECT * FROM t1; +c1 c2 +2 1 +3 8 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 't1' +CREATE TABLE t1 (c1 INT AUTO_INCREMENT, c2 INT, PRIMARY KEY(c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (NULL, 1); +DELETE FROM t1 WHERE c1 = 1; +INSERT INTO t1 VALUES (2,1), (NULL, 8); +INSERT INTO t1 VALUES (NULL,9); +SELECT * FROM t1; +c1 c2 +2 1 +3 8 +5 9 +DROP TABLE t1; +SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10; +SHOW VARIABLES LIKE "%auto_inc%"; +Variable_name Value +auto_increment_increment 100 +auto_increment_offset 10 +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 't1' +CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (NULL),(5),(NULL); +INSERT INTO t1 VALUES (250),(NULL); +SELECT * FROM t1; +c1 +5 +10 +110 +250 +310 +INSERT INTO t1 VALUES (1000); +SET @@INSERT_ID=400; +INSERT INTO t1 VALUES(NULL),(NULL); +SELECT * FROM t1; +c1 +5 +10 +110 +250 +310 +400 +410 +1000 +DROP TABLE t1; +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; +SET @@INSERT_ID=1; +SHOW VARIABLES LIKE "%auto_inc%"; +Variable_name Value +auto_increment_increment 1 +auto_increment_offset 1 +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 't1' +CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES(0); +SELECT * FROM t1; +c1 +1 +SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10; +INSERT INTO t1 VALUES (-1), (NULL),(2),(NULL); +INSERT INTO t1 VALUES (250),(NULL); +SELECT * FROM t1; +c1 +-1 +1 +2 +10 +110 +250 +410 +SET @@INSERT_ID=400; +INSERT INTO t1 VALUES(NULL),(NULL); +Got one of the listed errors +SELECT * FROM t1; +c1 +-1 +1 +2 +10 +110 +250 +410 +DROP TABLE t1; +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; +SET @@INSERT_ID=1; +SHOW VARIABLES LIKE "%auto_inc%"; +Variable_name Value +auto_increment_increment 1 +auto_increment_offset 1 +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 't1' +CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES(-1); +SELECT * FROM t1; +c1 +-1 +SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10; +SHOW VARIABLES LIKE "%auto_inc%"; +Variable_name Value +auto_increment_increment 100 +auto_increment_offset 10 +INSERT INTO t1 VALUES (-2), (NULL),(2),(NULL); +INSERT INTO t1 VALUES (250),(NULL); +SELECT * FROM t1; +c1 +-2 +-1 +1 +2 +10 +250 +310 +INSERT INTO t1 VALUES (1000); +SET @@INSERT_ID=400; +INSERT INTO t1 VALUES(NULL),(NULL); +SELECT * FROM t1; +c1 +-2 +-1 +1 +2 +10 +250 +310 +400 +410 +1000 +DROP TABLE t1; +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; +SET @@INSERT_ID=1; +SHOW VARIABLES LIKE "%auto_inc%"; +Variable_name Value +auto_increment_increment 1 +auto_increment_offset 1 +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 't1' +CREATE TABLE t1 (c1 INT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES(-1); +Warnings: +Warning 1264 Out of range value for column 'c1' at row 1 +SELECT * FROM t1; +c1 +1 +SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10; +SHOW VARIABLES LIKE "%auto_inc%"; +Variable_name Value +auto_increment_increment 100 +auto_increment_offset 10 +INSERT INTO t1 VALUES (-2); +Warnings: +Warning 1264 Out of range value for column 'c1' at row 1 +INSERT INTO t1 VALUES (NULL); +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (NULL); +INSERT INTO t1 VALUES (250); +INSERT INTO t1 VALUES (NULL); +SELECT * FROM t1; +c1 +1 +2 +10 +110 +210 +250 +310 +INSERT INTO t1 VALUES (1000); +SET @@INSERT_ID=400; +INSERT INTO t1 VALUES(NULL); +INSERT INTO t1 VALUES(NULL); +SELECT * FROM t1; +c1 +1 +2 +10 +110 +210 +250 +310 +400 +1000 +1010 +DROP TABLE t1; +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; +SET @@INSERT_ID=1; +SHOW VARIABLES LIKE "%auto_inc%"; +Variable_name Value +auto_increment_increment 1 +auto_increment_offset 1 +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 't1' +CREATE TABLE t1 (c1 INT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES(-1); +Warnings: +Warning 1264 Out of range value for column 'c1' at row 1 +SELECT * FROM t1; +c1 +1 +SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10; +SHOW VARIABLES LIKE "%auto_inc%"; +Variable_name Value +auto_increment_increment 100 +auto_increment_offset 10 +INSERT INTO t1 VALUES (-2),(NULL),(2),(NULL); +Warnings: +Warning 1264 Out of range value for column 'c1' at row 1 +INSERT INTO t1 VALUES (250),(NULL); +SELECT * FROM t1; +c1 +1 +2 +10 +110 +210 +250 +410 +INSERT INTO t1 VALUES (1000); +SET @@INSERT_ID=400; +INSERT INTO t1 VALUES(NULL),(NULL); +Got one of the listed errors +SELECT * FROM t1; +c1 +1 +2 +10 +110 +210 +250 +410 +1000 +DROP TABLE t1; +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; +SET @@INSERT_ID=1; +SHOW VARIABLES LIKE "%auto_inc%"; +Variable_name Value +auto_increment_increment 1 +auto_increment_offset 1 +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 't1' +CREATE TABLE t1 (c1 BIGINT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES(NULL); +INSERT INTO t1 VALUES (9223372036854775794); +SELECT * FROM t1; +c1 +1 +9223372036854775794 +SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10; +SHOW VARIABLES LIKE "%auto_inc%"; +Variable_name Value +auto_increment_increment 2 +auto_increment_offset 10 +INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL); +SELECT * FROM t1; +c1 +1 +9223372036854775794 +9223372036854775796 +9223372036854775798 +9223372036854775800 +9223372036854775802 +9223372036854775804 +9223372036854775806 +DROP TABLE t1; +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; +SET @@INSERT_ID=1; +SHOW VARIABLES LIKE "%auto_inc%"; +Variable_name Value +auto_increment_increment 1 +auto_increment_offset 1 +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 't1' +CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES(NULL); +INSERT INTO t1 VALUES (18446744073709551603); +SELECT * FROM t1; +c1 +1 +18446744073709551603 +SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10; +SHOW VARIABLES LIKE "%auto_inc%"; +Variable_name Value +auto_increment_increment 2 +auto_increment_offset 10 +INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL); +SELECT * FROM t1; +c1 +1 +18446744073709551603 +18446744073709551604 +18446744073709551606 +18446744073709551608 +18446744073709551610 +18446744073709551612 +18446744073709551614 +DROP TABLE t1; +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; +SET @@INSERT_ID=1; +SHOW VARIABLES LIKE "%auto_inc%"; +Variable_name Value +auto_increment_increment 1 +auto_increment_offset 1 +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 't1' +CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES(NULL); +INSERT INTO t1 VALUES (18446744073709551603); +SELECT * FROM t1; +c1 +1 +18446744073709551603 +SET @@SESSION.AUTO_INCREMENT_INCREMENT=5, @@SESSION.AUTO_INCREMENT_OFFSET=7; +SHOW VARIABLES LIKE "%auto_inc%"; +Variable_name Value +auto_increment_increment 5 +auto_increment_offset 7 +INSERT INTO t1 VALUES (NULL),(NULL); +SELECT * FROM t1; +c1 +1 +18446744073709551603 +18446744073709551607 +18446744073709551612 +DROP TABLE t1; +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; +SET @@INSERT_ID=1; +SHOW VARIABLES LIKE "%auto_inc%"; +Variable_name Value +auto_increment_increment 1 +auto_increment_offset 1 +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 't1' +CREATE TABLE t1 (c1 BIGINT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES(NULL); +INSERT INTO t1 VALUES(-9223372036854775806); +INSERT INTO t1 VALUES(-9223372036854775807); +INSERT INTO t1 VALUES(-9223372036854775808); +SELECT * FROM t1; +c1 +-9223372036854775808 +-9223372036854775807 +-9223372036854775806 +1 +SET @@SESSION.AUTO_INCREMENT_INCREMENT=3, @@SESSION.AUTO_INCREMENT_OFFSET=3; +SHOW VARIABLES LIKE "%auto_inc%"; +Variable_name Value +auto_increment_increment 3 +auto_increment_offset 3 +INSERT INTO t1 VALUES (NULL),(NULL), (NULL); +SELECT * FROM t1; +c1 +-9223372036854775808 +-9223372036854775807 +-9223372036854775806 +1 +3 +6 +9 +DROP TABLE t1; +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; +SET @@INSERT_ID=1; +SHOW VARIABLES LIKE "%auto_inc%"; +Variable_name Value +auto_increment_increment 1 +auto_increment_offset 1 +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 't1' +CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES(NULL); +INSERT INTO t1 VALUES (18446744073709551610); +SELECT * FROM t1; +c1 +1 +18446744073709551610 +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1152921504606846976, @@SESSION.AUTO_INCREMENT_OFFSET=1152921504606846976; +Warnings: +Warning 1292 Truncated incorrect auto_increment_increment value: '1152921504606846976' +Warning 1292 Truncated incorrect auto_increment_offset value: '1152921504606846976' +SHOW VARIABLES LIKE "%auto_inc%"; +Variable_name Value +auto_increment_increment 65535 +auto_increment_offset 65535 +INSERT INTO t1 VALUES (NULL); +SELECT * FROM t1; +c1 +1 +18446744073709551610 +18446744073709551615 +DROP TABLE t1; +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; +SET @@INSERT_ID=1; +SHOW VARIABLES LIKE "%auto_inc%"; +Variable_name Value +auto_increment_increment 1 +auto_increment_offset 1 +CREATE TABLE t1 (c1 DOUBLE NOT NULL AUTO_INCREMENT, c2 INT, PRIMARY KEY (c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES(NULL, 1); +INSERT INTO t1 VALUES(NULL, 2); +SELECT * FROM t1; +c1 c2 +1 1 +2 2 +ALTER TABLE t1 CHANGE c1 c1 SERIAL; +SELECT * FROM t1; +c1 c2 +1 1 +2 2 +INSERT INTO t1 VALUES(NULL, 3); +INSERT INTO t1 VALUES(NULL, 4); +SELECT * FROM t1; +c1 c2 +1 1 +2 2 +3 3 +4 4 +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c1 FLOAT NOT NULL AUTO_INCREMENT, c2 INT, PRIMARY KEY (c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES(NULL, 1); +INSERT INTO t1 VALUES(NULL, 2); +SELECT * FROM t1; +c1 c2 +1 1 +2 2 +ALTER TABLE t1 CHANGE c1 c1 SERIAL; +SELECT * FROM t1; +c1 c2 +1 1 +2 2 +INSERT INTO t1 VALUES(NULL, 3); +INSERT INTO t1 VALUES(NULL, 4); +SELECT * FROM t1; +c1 c2 +1 1 +2 2 +3 3 +4 4 +DROP TABLE t1; +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=5; +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 't1' +DROP TABLE IF EXISTS t2; +Warnings: +Note 1051 Unknown table 't2' +CREATE TABLE t1 ( +a INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, +b INT(10) UNSIGNED NOT NULL, +c ENUM('FALSE','TRUE') DEFAULT NULL, +PRIMARY KEY (a)) ENGINE = InnoDB; +CREATE TABLE t2 ( +m INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, +n INT(10) UNSIGNED NOT NULL, +o enum('FALSE','TRUE') DEFAULT NULL, +PRIMARY KEY (m)) ENGINE = InnoDB; +INSERT INTO t2 (n,o) VALUES +(1 , 'true'), (1 , 'false'), (2 , 'true'), (2 , 'false'), (3 , 'true'), +(3 , 'false'), (4 , 'true'), (4 , 'false'), (5 , 'true'), (5 , 'false'); +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `m` int(11) unsigned NOT NULL AUTO_INCREMENT, + `n` int(10) unsigned NOT NULL, + `o` enum('FALSE','TRUE') DEFAULT NULL, + PRIMARY KEY (`m`) +) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1 +INSERT INTO t1 (b,c) SELECT n,o FROM t2 ; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) unsigned NOT NULL AUTO_INCREMENT, + `b` int(10) unsigned NOT NULL, + `c` enum('FALSE','TRUE') DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1 +INSERT INTO t1 (b,c) SELECT n,o FROM t2 ; +SELECT * FROM t1; +a b c +1 1 TRUE +2 1 FALSE +3 2 TRUE +4 2 FALSE +5 3 TRUE +6 3 FALSE +7 4 TRUE +8 4 FALSE +9 5 TRUE +10 5 FALSE +13 1 TRUE +14 1 FALSE +15 2 TRUE +16 2 FALSE +17 3 TRUE +18 3 FALSE +19 4 TRUE +20 4 FALSE +21 5 TRUE +22 5 FALSE +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) unsigned NOT NULL AUTO_INCREMENT, + `b` int(10) unsigned NOT NULL, + `c` enum('FALSE','TRUE') DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=latin1 +INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false'; +SELECT * FROM t1; +a b c +1 1 TRUE +2 1 FALSE +3 2 TRUE +4 2 FALSE +5 3 TRUE +6 3 FALSE +7 4 TRUE +8 4 FALSE +9 5 TRUE +10 5 FALSE +13 1 TRUE +14 1 FALSE +15 2 TRUE +16 2 FALSE +17 3 TRUE +18 3 FALSE +19 4 TRUE +20 4 FALSE +21 5 TRUE +22 5 FALSE +23 1 FALSE +24 2 FALSE +25 3 FALSE +26 4 FALSE +27 5 FALSE +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) unsigned NOT NULL AUTO_INCREMENT, + `b` int(10) unsigned NOT NULL, + `c` enum('FALSE','TRUE') DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=latin1 +INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false'; +SELECT * FROM t1; +a b c +1 1 TRUE +2 1 FALSE +3 2 TRUE +4 2 FALSE +5 3 TRUE +6 3 FALSE +7 4 TRUE +8 4 FALSE +9 5 TRUE +10 5 FALSE +13 1 TRUE +14 1 FALSE +15 2 TRUE +16 2 FALSE +17 3 TRUE +18 3 FALSE +19 4 TRUE +20 4 FALSE +21 5 TRUE +22 5 FALSE +23 1 FALSE +24 2 FALSE +25 3 FALSE +26 4 FALSE +27 5 FALSE +30 1 FALSE +31 2 FALSE +32 3 FALSE +33 4 FALSE +34 5 FALSE +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) unsigned NOT NULL AUTO_INCREMENT, + `b` int(10) unsigned NOT NULL, + `c` enum('FALSE','TRUE') DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=latin1 +INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false'; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) unsigned NOT NULL AUTO_INCREMENT, + `b` int(10) unsigned NOT NULL, + `c` enum('FALSE','TRUE') DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=latin1 +INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false'; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) unsigned NOT NULL AUTO_INCREMENT, + `b` int(10) unsigned NOT NULL, + `c` enum('FALSE','TRUE') DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB AUTO_INCREMENT=51 DEFAULT CHARSET=latin1 +INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false'; +SELECT * FROM t1; +a b c +1 1 TRUE +2 1 FALSE +3 2 TRUE +4 2 FALSE +5 3 TRUE +6 3 FALSE +7 4 TRUE +8 4 FALSE +9 5 TRUE +10 5 FALSE +13 1 TRUE +14 1 FALSE +15 2 TRUE +16 2 FALSE +17 3 TRUE +18 3 FALSE +19 4 TRUE +20 4 FALSE +21 5 TRUE +22 5 FALSE +23 1 FALSE +24 2 FALSE +25 3 FALSE +26 4 FALSE +27 5 FALSE +30 1 FALSE +31 2 FALSE +32 3 FALSE +33 4 FALSE +34 5 FALSE +37 1 FALSE +38 2 FALSE +39 3 FALSE +40 4 FALSE +41 5 FALSE +44 1 FALSE +45 2 FALSE +46 3 FALSE +47 4 FALSE +48 5 FALSE +51 1 FALSE +52 2 FALSE +53 3 FALSE +54 4 FALSE +55 5 FALSE +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) unsigned NOT NULL AUTO_INCREMENT, + `b` int(10) unsigned NOT NULL, + `c` enum('FALSE','TRUE') DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB AUTO_INCREMENT=58 DEFAULT CHARSET=latin1 +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 't1' +DROP TABLE IF EXISTS t2; +Warnings: +Note 1051 Unknown table 't2' +CREATE TABLE t1( +c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT +PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL); +CREATE TABLE t2( +c1 TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT +PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t2 SELECT c1 FROM t1; +Got one of the listed errors +INSERT INTO t2 SELECT NULL FROM t1; +Got one of the listed errors +DROP TABLE t1; +DROP TABLE t2; +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; +SHOW VARIABLES LIKE "%auto_inc%"; +Variable_name Value +auto_increment_increment 1 +auto_increment_offset 1 +CREATE TABLE t1 (c1 TINYINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, NULL); +INSERT INTO t1 VALUES (-1, 'innodb'); +INSERT INTO t1 VALUES (-127, 'innodb'); +INSERT INTO t1 VALUES (NULL, NULL); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` tinyint(4) NOT NULL AUTO_INCREMENT, + `c2` varchar(10) DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 +SELECT * FROM t1; +c1 c2 +-127 innodb +-1 innodb +1 NULL +2 NULL +DROP TABLE t1; +CREATE TABLE t1 (c1 TINYINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, NULL); +INSERT INTO t1 VALUES (-1, 'innodb'); +Warnings: +Warning 1264 Out of range value for column 'c1' at row 1 +INSERT INTO t1 VALUES (-127, 'innodb'); +Warnings: +Warning 1264 Out of range value for column 'c1' at row 1 +INSERT INTO t1 VALUES (NULL, NULL); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, + `c2` varchar(10) DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1 +SELECT * FROM t1; +c1 c2 +1 NULL +2 innodb +3 innodb +4 NULL +DROP TABLE t1; +CREATE TABLE t1 (c1 SMALLINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, NULL); +INSERT INTO t1 VALUES (-1, 'innodb'); +INSERT INTO t1 VALUES (-32767, 'innodb'); +INSERT INTO t1 VALUES (NULL, NULL); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` smallint(6) NOT NULL AUTO_INCREMENT, + `c2` varchar(10) DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 +SELECT * FROM t1; +c1 c2 +-32767 innodb +-1 innodb +1 NULL +2 NULL +DROP TABLE t1; +CREATE TABLE t1 (c1 SMALLINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, NULL); +INSERT INTO t1 VALUES (-1, 'innodb'); +Warnings: +Warning 1264 Out of range value for column 'c1' at row 1 +INSERT INTO t1 VALUES (-32757, 'innodb'); +Warnings: +Warning 1264 Out of range value for column 'c1' at row 1 +INSERT INTO t1 VALUES (NULL, NULL); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` smallint(5) unsigned NOT NULL AUTO_INCREMENT, + `c2` varchar(10) DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1 +SELECT * FROM t1; +c1 c2 +1 NULL +2 innodb +3 innodb +4 NULL +DROP TABLE t1; +CREATE TABLE t1 (c1 MEDIUMINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, NULL); +INSERT INTO t1 VALUES (-1, 'innodb'); +INSERT INTO t1 VALUES (-8388607, 'innodb'); +INSERT INTO t1 VALUES (NULL, NULL); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` mediumint(9) NOT NULL AUTO_INCREMENT, + `c2` varchar(10) DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 +SELECT * FROM t1; +c1 c2 +-8388607 innodb +-1 innodb +1 NULL +2 NULL +DROP TABLE t1; +CREATE TABLE t1 (c1 MEDIUMINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, NULL); +INSERT INTO t1 VALUES (-1, 'innodb'); +Warnings: +Warning 1264 Out of range value for column 'c1' at row 1 +INSERT INTO t1 VALUES (-8388607, 'innodb'); +Warnings: +Warning 1264 Out of range value for column 'c1' at row 1 +INSERT INTO t1 VALUES (NULL, NULL); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `c2` varchar(10) DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1 +SELECT * FROM t1; +c1 c2 +1 NULL +2 innodb +3 innodb +4 NULL +DROP TABLE t1; +CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, NULL); +INSERT INTO t1 VALUES (-1, 'innodb'); +INSERT INTO t1 VALUES (-2147483647, 'innodb'); +INSERT INTO t1 VALUES (NULL, NULL); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + `c2` varchar(10) DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 +SELECT * FROM t1; +c1 c2 +-2147483647 innodb +-1 innodb +1 NULL +2 NULL +DROP TABLE t1; +CREATE TABLE t1 (c1 INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, NULL); +INSERT INTO t1 VALUES (-1, 'innodb'); +Warnings: +Warning 1264 Out of range value for column 'c1' at row 1 +INSERT INTO t1 VALUES (-2147483647, 'innodb'); +Warnings: +Warning 1264 Out of range value for column 'c1' at row 1 +INSERT INTO t1 VALUES (NULL, NULL); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(10) unsigned NOT NULL AUTO_INCREMENT, + `c2` varchar(10) DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1 +SELECT * FROM t1; +c1 c2 +1 NULL +2 innodb +3 innodb +4 NULL +DROP TABLE t1; +CREATE TABLE t1 (c1 BIGINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, NULL); +INSERT INTO t1 VALUES (-1, 'innodb'); +INSERT INTO t1 VALUES (-9223372036854775807, 'innodb'); +INSERT INTO t1 VALUES (NULL, NULL); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` bigint(20) NOT NULL AUTO_INCREMENT, + `c2` varchar(10) DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 +SELECT * FROM t1; +c1 c2 +-9223372036854775807 innodb +-1 innodb +1 NULL +2 NULL +DROP TABLE t1; +CREATE TABLE t1 (c1 BIGINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, NULL); +INSERT INTO t1 VALUES (-1, 'innodb'); +Warnings: +Warning 1264 Out of range value for column 'c1' at row 1 +INSERT INTO t1 VALUES (-9223372036854775807, 'innodb'); +Warnings: +Warning 1264 Out of range value for column 'c1' at row 1 +INSERT INTO t1 VALUES (NULL, NULL); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `c2` varchar(10) DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1 +SELECT * FROM t1; +c1 c2 +1 NULL +2 innodb +3 innodb +4 NULL +DROP TABLE t1; +CREATE TABLE t1 (c1 INT AUTO_INCREMENT, c2 INT, PRIMARY KEY(c1)) AUTO_INCREMENT=10 ENGINE=InnoDB; +CREATE INDEX i1 on t1(c2); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + `c2` int(11) DEFAULT NULL, + PRIMARY KEY (`c1`), + KEY `i1` (`c2`) +) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1 +INSERT INTO t1 (c2) values (0); +SELECT * FROM t1; +c1 c2 +10 0 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 't1' +CREATE TABLE t1(C1 DOUBLE AUTO_INCREMENT KEY, C2 CHAR(10)) ENGINE=InnoDB; +INSERT INTO t1(C1, C2) VALUES (1, 'innodb'), (3, 'innodb'); +INSERT INTO t1(C2) VALUES ('innodb'); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `C1` double NOT NULL AUTO_INCREMENT, + `C2` char(10) DEFAULT NULL, + PRIMARY KEY (`C1`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(C1 FLOAT AUTO_INCREMENT KEY, C2 CHAR(10)) ENGINE=InnoDB; +INSERT INTO t1(C1, C2) VALUES (1, 'innodb'), (3, 'innodb'); +INSERT INTO t1(C2) VALUES ('innodb'); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `C1` float NOT NULL AUTO_INCREMENT, + `C2` char(10) DEFAULT NULL, + PRIMARY KEY (`C1`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 't1' +CREATE TABLE t1 (c1 INT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 SET c1 = 1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 +INSERT INTO t1 SET c1 = 2; +INSERT INTO t1 SET c1 = -1; +SELECT * FROM t1; +c1 +-1 +1 +2 +INSERT INTO t1 SET c1 = -1; +Got one of the listed errors +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 +REPLACE INTO t1 VALUES (-1); +SELECT * FROM t1; +c1 +-1 +1 +2 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 't1' +CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (-685113344), (1), (NULL), (NULL); +SELECT * FROM t1; +c1 +-685113344 +1 +2 +3 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (-685113344), (2), (NULL), (NULL); +SELECT * FROM t1; +c1 +-685113344 +2 +3 +4 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (NULL), (2), (-685113344), (NULL); +INSERT INTO t1 VALUES (4), (5), (6), (NULL); +SELECT * FROM t1; +c1 +-685113344 +1 +2 +3 +4 +5 +6 +7 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (NULL), (2), (-685113344), (5); +SELECT * FROM t1; +c1 +-685113344 +1 +2 +5 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1), (2), (-685113344), (NULL); +SELECT * FROM t1; +c1 +-685113344 +1 +2 +3 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1 +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/r/innodb-consistent.result b/mysql-test/suite/innodb/r/innodb-consistent.result new file mode 100644 index 00000000000..9115791b99c --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb-consistent.result @@ -0,0 +1,35 @@ +drop table if exists t1; +set session transaction isolation level read committed; +create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1; +create table t2 like t1; +insert into t2 values (1),(2),(3),(4),(5),(6),(7); +set autocommit=0; +begin; +replace into t1 select * from t2; +set session transaction isolation level read committed; +set autocommit=0; +delete from t2 where a=5; +commit; +delete from t2; +commit; +commit; +begin; +insert into t1 select * from t2; +set session transaction isolation level read committed; +set autocommit=0; +delete from t2 where a=5; +commit; +delete from t2; +commit; +commit; +select * from t1; +a +1 +2 +3 +4 +5 +6 +7 +drop table t1; +drop table t2; diff --git a/mysql-test/suite/innodb/r/innodb-index.result b/mysql-test/suite/innodb/r/innodb-index.result index 67fbe0dce02..5d67a06b80f 100644 --- a/mysql-test/suite/innodb/r/innodb-index.result +++ b/mysql-test/suite/innodb/r/innodb-index.result @@ -46,13 +46,6 @@ t1 CREATE TABLE `t1` ( KEY `d2` (`d`), KEY `b` (`b`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -CREATE TABLE `t1#1`(a INT PRIMARY KEY) ENGINE=InnoDB; -alter table t1 add unique index (c), add index (d); -ERROR HY000: Table 'test.t1#1' already exists -rename table `t1#1` to `t1#2`; -alter table t1 add unique index (c), add index (d); -ERROR HY000: Table 'test.t1#2' already exists -drop table `t1#2`; alter table t1 add unique index (c), add index (d); show create table t1; Table Create Table @@ -441,6 +434,7 @@ t3 CREATE TABLE `t3` ( KEY `c` (`c`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 alter table t2 drop index b, add index (b); +ERROR 42000: Incorrect index name 'b' show create table t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -451,8 +445,8 @@ t2 CREATE TABLE `t2` ( `e` int(11) DEFAULT NULL, PRIMARY KEY (`a`), UNIQUE KEY `dc` (`d`,`c`), - KEY `c` (`c`), KEY `b` (`b`), + KEY `c` (`c`), CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`b`) REFERENCES `t1` (`b`) ON DELETE CASCADE, CONSTRAINT `t2_ibfk_2` FOREIGN KEY (`c`) REFERENCES `t3` (`c`), CONSTRAINT `t2_ibfk_3` FOREIGN KEY (`d`) REFERENCES `t4` (`d`) @@ -841,48 +835,6 @@ test.t1 check status OK explain select * from t1 where b like 'adfd%'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL b NULL NULL NULL 15 Using where -create table t2(a int, b varchar(255), primary key(a,b)) engine=innodb; -insert into t2 select a,left(b,255) from t1; -drop table t1; -rename table t2 to t1; -set innodb_lock_wait_timeout=1; -begin; -select a from t1 limit 1 for update; -a -22 -set innodb_lock_wait_timeout=1; -create index t1ba on t1 (b,a); -ERROR HY000: Lock wait timeout exceeded; try restarting transaction -commit; -begin; -select a from t1 limit 1 lock in share mode; -a -22 -create index t1ba on t1 (b,a); -drop index t1ba on t1; -ERROR HY000: Lock wait timeout exceeded; try restarting transaction -commit; -explain select a from t1 order by b; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL t1ba 261 NULL 15 Using index -select a,sleep(2+a/100) from t1 order by b limit 3; -select sleep(1); -sleep(1) -0 -drop index t1ba on t1; -a sleep(2+a/100) -22 0 -44 0 -66 0 -explain select a from t1 order by b; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL PRIMARY 261 NULL 15 Using index; Using filesort -select a from t1 order by b limit 3; -a -22 -66 -44 -commit; drop table t1; set global innodb_file_per_table=on; set global innodb_file_format='Barracuda'; @@ -1133,39 +1085,3 @@ t2 CREATE TABLE `t2` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 DROP TABLE t2; DROP TABLE t1; -CREATE TABLE t1 (a INT, b CHAR(1)) ENGINE=InnoDB; -INSERT INTO t1 VALUES (3,'a'),(3,'b'),(1,'c'),(0,'d'),(1,'e'); -BEGIN; -SELECT * FROM t1; -a b -3 a -3 b -1 c -0 d -1 e -CREATE INDEX t1a ON t1(a); -SELECT * FROM t1; -a b -3 a -3 b -1 c -0 d -1 e -SELECT * FROM t1 FORCE INDEX(t1a) ORDER BY a; -ERROR HY000: Table definition has changed, please retry transaction -SELECT * FROM t1; -a b -3 a -3 b -1 c -0 d -1 e -COMMIT; -SELECT * FROM t1 FORCE INDEX(t1a) ORDER BY a; -a b -0 d -1 c -1 e -3 a -3 b -DROP TABLE t1; diff --git a/mysql-test/suite/innodb/r/innodb-lock.result b/mysql-test/suite/innodb/r/innodb-lock.result new file mode 100644 index 00000000000..41f308788a2 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb-lock.result @@ -0,0 +1,91 @@ +set global innodb_table_locks=1; +select @@innodb_table_locks; +@@innodb_table_locks +1 +drop table if exists t1; +set @@innodb_table_locks=1; +create table t1 (id integer, x integer) engine=INNODB; +insert into t1 values(0, 0); +set autocommit=0; +SELECT * from t1 where id = 0 FOR UPDATE; +id x +0 0 +set autocommit=0; +lock table t1 write; +update t1 set x=1 where id = 0; +select * from t1; +id x +0 1 +commit; +update t1 set x=2 where id = 0; +commit; +unlock tables; +select * from t1; +id x +0 2 +commit; +drop table t1; +# +# Old lock method (where LOCK TABLE was ignored by InnoDB) no longer +# works when LOCK TABLE ... WRITE is used due to fix for bugs #46272 +# "MySQL 5.4.4, new MDL: unnecessary and bug #37346 "innodb does not +# detect deadlock between update and alter table". But it still works +# for LOCK TABLE ... READ. +# +set @@innodb_table_locks=0; +create table t1 (id integer primary key, x integer) engine=INNODB; +insert into t1 values(0, 0),(1,1),(2,2); +commit; +SELECT * from t1 where id = 0 FOR UPDATE; +id x +0 0 +# Connection 'con2'. +set autocommit=0; +set @@innodb_table_locks=0; +# The following statement should block because SQL-level lock +# is taken on t1 which will wait until concurrent transaction +# is commited. +# Sending: +lock table t1 write;; +# Connection 'con1'. +# Wait until LOCK TABLE is blocked on SQL-level lock. +# We should be able to do UPDATEs and SELECTs within transaction. +update t1 set x=1 where id = 0; +select * from t1; +id x +0 1 +1 1 +2 2 +# Unblock LOCK TABLE. +commit; +# Connection 'con2'. +# Reap LOCK TABLE. +unlock tables; +# Connection 'con1'. +select * from t1 where id = 0 for update; +id x +0 1 +# Connection 'con2'. +# The below statement should not be blocked as LOCK TABLES ... READ +# does not take strong SQL-level lock on t1. SELECTs which do not +# conflict with transaction in the first connections should not be +# blocked. +lock table t1 read; +select * from t1; +id x +0 1 +1 1 +2 2 +select * from t1 where id = 1 lock in share mode; +id x +1 1 +unlock tables; +select * from t1; +id x +0 1 +1 1 +2 2 +commit; +# Connection 'con1'. +commit; +drop table t1; diff --git a/mysql-test/suite/innodb/r/innodb-replace.result b/mysql-test/suite/innodb/r/innodb-replace.result new file mode 100644 index 00000000000..c926bb89a2e --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb-replace.result @@ -0,0 +1,13 @@ +drop table if exists t1; +create table t1 (c1 char(5) unique not null, c2 int, stamp timestamp) engine=innodb; +select * from t1; +c1 c2 stamp +replace delayed into t1 (c1, c2) values ( "text1","11"); +ERROR HY000: DELAYED option not supported for table 't1' +select * from t1; +c1 c2 stamp +replace delayed into t1 (c1, c2) values ( "text1","12"); +ERROR HY000: DELAYED option not supported for table 't1' +select * from t1; +c1 c2 stamp +drop table t1; diff --git a/mysql-test/suite/innodb/r/innodb-semi-consistent.result b/mysql-test/suite/innodb/r/innodb-semi-consistent.result new file mode 100644 index 00000000000..ca0e362ef80 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb-semi-consistent.result @@ -0,0 +1,47 @@ +drop table if exists t1; +set binlog_format=mixed; +set session transaction isolation level repeatable read; +create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1; +insert into t1 values (1),(2),(3),(4),(5),(6),(7); +set autocommit=0; +select * from t1 where a=3 lock in share mode; +a +3 +set binlog_format=mixed; +set session transaction isolation level repeatable read; +set autocommit=0; +update t1 set a=10 where a=5; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +commit; +set session transaction isolation level read committed; +update t1 set a=10 where a=5; +select * from t1 where a=2 for update; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +select * from t1 where a=2 limit 1 for update; +a +2 +update t1 set a=11 where a=6; +update t1 set a=12 where a=2; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +update t1 set a=13 where a=1; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +commit; +update t1 set a=14 where a=1; +commit; +select * from t1; +a +14 +2 +3 +4 +10 +11 +7 +drop table t1; +create table t1 (a int, b int) engine=myisam; +create table t2 (c int, d int, key (c)) engine=innodb; +insert into t1 values (1,1); +insert into t2 values (1,2); +set session transaction isolation level read committed; +delete from t1 using t1 join t2 on t1.a = t2.c where t2.d in (1); +drop table t1, t2; diff --git a/mysql-test/suite/innodb/r/innodb-system-table-view.result b/mysql-test/suite/innodb/r/innodb-system-table-view.result new file mode 100644 index 00000000000..ffa57ee32ce --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb-system-table-view.result @@ -0,0 +1,110 @@ +SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES; +TABLE_ID NAME FLAG N_COLS SPACE +11 SYS_FOREIGN 0 7 0 +12 SYS_FOREIGN_COLS 0 7 0 +SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES; +INDEX_ID NAME TABLE_ID TYPE N_FIELDS PAGE_NO SPACE +11 ID_IND 11 3 1 302 0 +12 FOR_IND 11 0 1 303 0 +13 REF_IND 11 0 1 304 0 +14 ID_IND 12 3 2 305 0 +SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS; +TABLE_ID NAME POS MTYPE PRTYPE LEN +11 ID 0 1 524292 0 +11 FOR_NAME 1 1 524292 0 +11 REF_NAME 2 1 524292 0 +11 N_COLS 3 6 0 4 +12 ID 0 1 524292 0 +12 POS 1 6 0 4 +12 FOR_COL_NAME 2 1 524292 0 +12 REF_COL_NAME 3 1 524292 0 +SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FIELDS; +INDEX_ID NAME POS +11 ID 0 +12 FOR_NAME 0 +13 REF_NAME 0 +14 ID 0 +14 POS 1 +SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN; +ID FOR_NAME REF_NAME N_COLS TYPE +SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS; +ID FOR_COL_NAME REF_COL_NAME POS +SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS; +TABLE_ID NAME STATS_INITIALIZED NUM_ROWS CLUST_INDEX_SIZE OTHER_INDEX_SIZE MODIFIED_COUNTER AUTOINC MYSQL_HANDLES_OPENED +11 SYS_FOREIGN Uninitialized 0 0 0 0 0 0 +12 SYS_FOREIGN_COLS Uninitialized 0 0 0 0 0 0 +CREATE TABLE parent (id INT NOT NULL, +PRIMARY KEY (id)) ENGINE=INNODB; +CREATE TABLE child (id INT, parent_id INT, +INDEX par_ind (parent_id), +CONSTRAINT constraint_test +FOREIGN KEY (parent_id) REFERENCES parent(id) +ON DELETE CASCADE) ENGINE=INNODB; +SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN; +ID FOR_NAME REF_NAME N_COLS TYPE +test/constraint_test test/child test/parent 1 1 +SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS; +ID FOR_COL_NAME REF_COL_NAME POS +test/constraint_test parent_id id 0 +INSERT INTO parent VALUES(1); +SELECT name, num_rows, mysql_handles_opened +FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS +WHERE name LIKE "%parent"; +name num_rows mysql_handles_opened +test/parent 1 1 +SELECT NAME, FLAG, N_COLS, SPACE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES; +NAME FLAG N_COLS SPACE +SYS_FOREIGN 0 7 0 +SYS_FOREIGN_COLS 0 7 0 +test/child 1 5 0 +test/parent 1 4 0 +SELECT name, n_fields +from INFORMATION_SCHEMA.INNODB_SYS_INDEXES +WHERE table_id In (SELECT table_id from +INFORMATION_SCHEMA.INNODB_SYS_TABLES +WHERE name LIKE "%parent%"); +name n_fields +PRIMARY 1 +SELECT name, n_fields +from INFORMATION_SCHEMA.INNODB_SYS_INDEXES +WHERE table_id In (SELECT table_id from +INFORMATION_SCHEMA.INNODB_SYS_TABLES +WHERE name LIKE "%child%"); +name n_fields +GEN_CLUST_INDEX 0 +par_ind 1 +SELECT name, pos, mtype, len +from INFORMATION_SCHEMA.INNODB_SYS_COLUMNS +WHERE table_id In (SELECT table_id from +INFORMATION_SCHEMA.INNODB_SYS_TABLES +WHERE name LIKE "%child%"); +name pos mtype len +id 0 6 4 +parent_id 1 6 4 +DROP TABLE child; +DROP TABLE parent; +CREATE TABLE parent (id INT NOT NULL, newid INT NOT NULL, +PRIMARY KEY (id, newid)) ENGINE=INNODB; +CREATE TABLE child (id INT, parent_id INT, +INDEX par_ind (parent_id), +CONSTRAINT constraint_test +FOREIGN KEY (id, parent_id) REFERENCES parent(id, newid) +ON DELETE CASCADE) ENGINE=INNODB; +SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN; +ID FOR_NAME REF_NAME N_COLS TYPE +test/constraint_test test/child test/parent 2 1 +SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS; +ID FOR_COL_NAME REF_COL_NAME POS +test/constraint_test id id 0 +test/constraint_test parent_id newid 1 +INSERT INTO parent VALUES(1, 9); +SELECT * FROM parent WHERE id IN (SELECT id FROM parent); +id newid +1 9 +SELECT name, num_rows, mysql_handles_opened +FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS +WHERE name LIKE "%parent"; +name num_rows mysql_handles_opened +test/parent 1 2 +DROP TABLE child; +DROP TABLE parent; diff --git a/mysql-test/suite/innodb/r/innodb.result b/mysql-test/suite/innodb/r/innodb.result new file mode 100644 index 00000000000..2e5585ee7af --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb.result @@ -0,0 +1,3177 @@ +drop table if exists t1,t2,t3,t4; +drop database if exists mysqltest; +create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) engine=innodb; +insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David'), (2, 'Erik'), (3, 'Sasha'), (3, 'Jeremy'), (4, 'Matt'); +select id, code, name from t1 order by id; +id code name +1 1 Tim +2 1 Monty +3 2 David +4 2 Erik +5 3 Sasha +6 3 Jeremy +7 4 Matt +update ignore t1 set id = 8, name = 'Sinisa' where id < 3; +select id, code, name from t1 order by id; +id code name +2 1 Monty +3 2 David +4 2 Erik +5 3 Sasha +6 3 Jeremy +7 4 Matt +8 1 Sinisa +update ignore t1 set id = id + 10, name = 'Ralph' where id < 4; +select id, code, name from t1 order by id; +id code name +3 2 David +4 2 Erik +5 3 Sasha +6 3 Jeremy +7 4 Matt +8 1 Sinisa +12 1 Ralph +drop table t1; +CREATE TABLE t1 ( +id int(11) NOT NULL auto_increment, +parent_id int(11) DEFAULT '0' NOT NULL, +level tinyint(4) DEFAULT '0' NOT NULL, +PRIMARY KEY (id), +KEY parent_id (parent_id), +KEY level (level) +) engine=innodb; +INSERT INTO t1 VALUES (1,0,0),(3,1,1),(4,1,1),(8,2,2),(9,2,2),(17,3,2),(22,4,2),(24,4,2),(28,5,2),(29,5,2),(30,5,2),(31,6,2),(32,6,2),(33,6,2),(203,7,2),(202,7,2),(20,3,2),(157,0,0),(193,5,2),(40,7,2),(2,1,1),(15,2,2),(6,1,1),(34,6,2),(35,6,2),(16,3,2),(7,1,1),(36,7,2),(18,3,2),(26,5,2),(27,5,2),(183,4,2),(38,7,2),(25,5,2),(37,7,2),(21,4,2),(19,3,2),(5,1,1),(179,5,2); +update t1 set parent_id=parent_id+100; +select * from t1 where parent_id=102; +id parent_id level +8 102 2 +9 102 2 +15 102 2 +update t1 set id=id+1000; +update t1 set id=1024 where id=1009; +Got one of the listed errors +select * from t1; +id parent_id level +1001 100 0 +1002 101 1 +1003 101 1 +1004 101 1 +1005 101 1 +1006 101 1 +1007 101 1 +1008 102 2 +1009 102 2 +1015 102 2 +1016 103 2 +1017 103 2 +1018 103 2 +1019 103 2 +1020 103 2 +1021 104 2 +1022 104 2 +1024 104 2 +1025 105 2 +1026 105 2 +1027 105 2 +1028 105 2 +1029 105 2 +1030 105 2 +1031 106 2 +1032 106 2 +1033 106 2 +1034 106 2 +1035 106 2 +1036 107 2 +1037 107 2 +1038 107 2 +1040 107 2 +1157 100 0 +1179 105 2 +1183 104 2 +1193 105 2 +1202 107 2 +1203 107 2 +update ignore t1 set id=id+1; +select * from t1; +id parent_id level +1001 100 0 +1002 101 1 +1003 101 1 +1004 101 1 +1005 101 1 +1006 101 1 +1007 101 1 +1008 102 2 +1010 102 2 +1015 102 2 +1016 103 2 +1017 103 2 +1018 103 2 +1019 103 2 +1020 103 2 +1021 104 2 +1023 104 2 +1024 104 2 +1025 105 2 +1026 105 2 +1027 105 2 +1028 105 2 +1029 105 2 +1030 105 2 +1031 106 2 +1032 106 2 +1033 106 2 +1034 106 2 +1035 106 2 +1036 107 2 +1037 107 2 +1039 107 2 +1041 107 2 +1158 100 0 +1180 105 2 +1184 104 2 +1194 105 2 +1202 107 2 +1204 107 2 +update ignore t1 set id=1023 where id=1010; +select * from t1 where parent_id=102; +id parent_id level +1008 102 2 +1010 102 2 +1015 102 2 +explain select level from t1 where level=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref level level 1 const # Using index +explain select level,id from t1 where level=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref level level 1 const # Using index +explain select level,id,parent_id from t1 where level=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref level level 1 const # +select level,id from t1 where level=1; +level id +1 1002 +1 1003 +1 1004 +1 1005 +1 1006 +1 1007 +select level,id,parent_id from t1 where level=1; +level id parent_id +1 1002 101 +1 1003 101 +1 1004 101 +1 1005 101 +1 1006 101 +1 1007 101 +optimize table t1; +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +show keys from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 PRIMARY 1 id A # NULL NULL BTREE +t1 1 parent_id 1 parent_id A # NULL NULL BTREE +t1 1 level 1 level A # NULL NULL BTREE +drop table t1; +CREATE TABLE t1 ( +gesuchnr int(11) DEFAULT '0' NOT NULL, +benutzer_id int(11) DEFAULT '0' NOT NULL, +PRIMARY KEY (gesuchnr,benutzer_id) +) engine=innodb; +replace into t1 (gesuchnr,benutzer_id) values (2,1); +replace into t1 (gesuchnr,benutzer_id) values (1,1); +replace into t1 (gesuchnr,benutzer_id) values (1,1); +select * from t1; +gesuchnr benutzer_id +1 1 +2 1 +drop table t1; +create table t1 (a int) engine=innodb; +insert into t1 values (1), (2); +optimize table t1; +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +delete from t1 where a = 1; +select * from t1; +a +2 +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +drop table t1; +create table t1 (a int,b varchar(20)) engine=innodb; +insert into t1 values (1,""), (2,"testing"); +delete from t1 where a = 1; +select * from t1; +a b +2 testing +create index skr on t1 (a); +insert into t1 values (3,""), (4,"testing"); +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +show keys from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 skr 1 a A # NULL NULL YES BTREE +drop table t1; +create table t1 (a int,b varchar(20),key(a)) engine=innodb; +insert into t1 values (1,""), (2,"testing"); +select * from t1 where a = 1; +a b +1 +drop table t1; +create table t1 (n int not null primary key) engine=innodb; +set autocommit=0; +insert into t1 values (4); +rollback; +select n, "after rollback" from t1; +n after rollback +insert into t1 values (4); +commit; +select n, "after commit" from t1; +n after commit +4 after commit +commit; +insert into t1 values (5); +insert into t1 values (4); +ERROR 23000: Duplicate entry '4' for key 'PRIMARY' +commit; +select n, "after commit" from t1; +n after commit +4 after commit +5 after commit +set autocommit=1; +insert into t1 values (6); +insert into t1 values (4); +ERROR 23000: Duplicate entry '4' for key 'PRIMARY' +select n from t1; +n +4 +5 +6 +set autocommit=0; +begin; +savepoint `my_savepoint`; +insert into t1 values (7); +savepoint `savept2`; +insert into t1 values (3); +select n from t1; +n +3 +4 +5 +6 +7 +savepoint savept3; +rollback to savepoint savept2; +rollback to savepoint savept3; +ERROR 42000: SAVEPOINT savept3 does not exist +rollback to savepoint savept2; +release savepoint `my_savepoint`; +select n from t1; +n +4 +5 +6 +7 +rollback to savepoint `my_savepoint`; +ERROR 42000: SAVEPOINT my_savepoint does not exist +rollback to savepoint savept2; +ERROR 42000: SAVEPOINT savept2 does not exist +insert into t1 values (8); +savepoint sv; +commit; +savepoint sv; +set autocommit=1; +rollback; +drop table t1; +create table t1 (n int not null primary key) engine=innodb; +start transaction; +insert into t1 values (4); +flush tables with read lock; +commit; +unlock tables; +commit; +select * from t1; +n +4 +drop table t1; +create table t1 ( id int NOT NULL PRIMARY KEY, nom varchar(64)) engine=innodb; +begin; +insert into t1 values(1,'hamdouni'); +select id as afterbegin_id,nom as afterbegin_nom from t1; +afterbegin_id afterbegin_nom +1 hamdouni +rollback; +select id as afterrollback_id,nom as afterrollback_nom from t1; +afterrollback_id afterrollback_nom +set autocommit=0; +insert into t1 values(2,'mysql'); +select id as afterautocommit0_id,nom as afterautocommit0_nom from t1; +afterautocommit0_id afterautocommit0_nom +2 mysql +rollback; +select id as afterrollback_id,nom as afterrollback_nom from t1; +afterrollback_id afterrollback_nom +set autocommit=1; +drop table t1; +CREATE TABLE t1 (id char(8) not null primary key, val int not null) engine=innodb; +insert into t1 values ('pippo', 12); +insert into t1 values ('pippo', 12); +ERROR 23000: Duplicate entry 'pippo' for key 'PRIMARY' +delete from t1; +delete from t1 where id = 'pippo'; +select * from t1; +id val +insert into t1 values ('pippo', 12); +set autocommit=0; +delete from t1; +rollback; +select * from t1; +id val +pippo 12 +delete from t1; +commit; +select * from t1; +id val +drop table t1; +create table t1 (a integer) engine=innodb; +start transaction; +rename table t1 to t2; +create table t1 (b integer) engine=innodb; +insert into t1 values (1); +rollback; +drop table t1; +rename table t2 to t1; +drop table t1; +set autocommit=1; +CREATE TABLE t1 (ID INTEGER NOT NULL PRIMARY KEY, NAME VARCHAR(64)) ENGINE=innodb; +INSERT INTO t1 VALUES (1, 'Jochen'); +select * from t1; +ID NAME +1 Jochen +drop table t1; +CREATE TABLE t1 ( _userid VARCHAR(60) NOT NULL PRIMARY KEY) ENGINE=innodb; +set autocommit=0; +INSERT INTO t1 SET _userid='marc@anyware.co.uk'; +COMMIT; +SELECT * FROM t1; +_userid +marc@anyware.co.uk +SELECT _userid FROM t1 WHERE _userid='marc@anyware.co.uk'; +_userid +marc@anyware.co.uk +drop table t1; +set autocommit=1; +CREATE TABLE t1 ( +user_id int(10) DEFAULT '0' NOT NULL, +name varchar(100), +phone varchar(100), +ref_email varchar(100) DEFAULT '' NOT NULL, +detail varchar(200), +PRIMARY KEY (user_id,ref_email) +)engine=innodb; +INSERT INTO t1 VALUES (10292,'sanjeev','29153373','sansh777@hotmail.com','xxx'),(10292,'shirish','2333604','shirish@yahoo.com','ddsds'),(10292,'sonali','323232','sonali@bolly.com','filmstar'); +select * from t1 where user_id=10292; +user_id name phone ref_email detail +10292 sanjeev 29153373 sansh777@hotmail.com xxx +10292 shirish 2333604 shirish@yahoo.com ddsds +10292 sonali 323232 sonali@bolly.com filmstar +INSERT INTO t1 VALUES (10291,'sanjeev','29153373','sansh777@hotmail.com','xxx'),(10293,'shirish','2333604','shirish@yahoo.com','ddsds'); +select * from t1 where user_id=10292; +user_id name phone ref_email detail +10292 sanjeev 29153373 sansh777@hotmail.com xxx +10292 shirish 2333604 shirish@yahoo.com ddsds +10292 sonali 323232 sonali@bolly.com filmstar +select * from t1 where user_id>=10292; +user_id name phone ref_email detail +10292 sanjeev 29153373 sansh777@hotmail.com xxx +10292 shirish 2333604 shirish@yahoo.com ddsds +10292 sonali 323232 sonali@bolly.com filmstar +10293 shirish 2333604 shirish@yahoo.com ddsds +select * from t1 where user_id>10292; +user_id name phone ref_email detail +10293 shirish 2333604 shirish@yahoo.com ddsds +select * from t1 where user_id<10292; +user_id name phone ref_email detail +10291 sanjeev 29153373 sansh777@hotmail.com xxx +drop table t1; +CREATE TABLE t1 (a int not null, b int not null,c int not null, +key(a),primary key(a,b), unique(c),key(a),unique(b)); +show index from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 PRIMARY 1 a A # NULL NULL BTREE +t1 0 PRIMARY 2 b A # NULL NULL BTREE +t1 0 c 1 c A # NULL NULL BTREE +t1 0 b 1 b A # NULL NULL BTREE +t1 1 a 1 a A # NULL NULL BTREE +t1 1 a_2 1 a A # NULL NULL BTREE +drop table t1; +create table t1 (col1 int not null, col2 char(4) not null, primary key(col1)); +alter table t1 engine=innodb; +insert into t1 values ('1','1'),('5','2'),('2','3'),('3','4'),('4','4'); +select * from t1; +col1 col2 +1 1 +2 3 +3 4 +4 4 +5 2 +update t1 set col2='7' where col1='4'; +select * from t1; +col1 col2 +1 1 +2 3 +3 4 +4 7 +5 2 +alter table t1 add co3 int not null; +select * from t1; +col1 col2 co3 +1 1 0 +2 3 0 +3 4 0 +4 7 0 +5 2 0 +update t1 set col2='9' where col1='2'; +select * from t1; +col1 col2 co3 +1 1 0 +2 9 0 +3 4 0 +4 7 0 +5 2 0 +drop table t1; +create table t1 (a int not null , b int, primary key (a)) engine = innodb; +create table t2 (a int not null , b int, primary key (a)) engine = myisam; +insert into t1 VALUES (1,3) , (2,3), (3,3); +select * from t1; +a b +1 3 +2 3 +3 3 +insert into t2 select * from t1; +select * from t2; +a b +1 3 +2 3 +3 3 +delete from t1 where b = 3; +select * from t1; +a b +insert into t1 select * from t2; +select * from t1; +a b +1 3 +2 3 +3 3 +select * from t2; +a b +1 3 +2 3 +3 3 +drop table t1,t2; +CREATE TABLE t1 ( +user_name varchar(12), +password text, +subscribed char(1), +user_id int(11) DEFAULT '0' NOT NULL, +quota bigint(20), +weight double, +access_date date, +access_time time, +approved datetime, +dummy_primary_key int(11) NOT NULL auto_increment, +PRIMARY KEY (dummy_primary_key) +) ENGINE=innodb; +INSERT INTO t1 VALUES ('user_0','somepassword','N',0,0,0,'2000-09-07','23:06:59','2000-09-07 23:06:59',1); +INSERT INTO t1 VALUES ('user_1','somepassword','Y',1,1,1,'2000-09-07','23:06:59','2000-09-07 23:06:59',2); +INSERT INTO t1 VALUES ('user_2','somepassword','N',2,2,1.4142135623731,'2000-09-07','23:06:59','2000-09-07 23:06:59',3); +INSERT INTO t1 VALUES ('user_3','somepassword','Y',3,3,1.7320508075689,'2000-09-07','23:06:59','2000-09-07 23:06:59',4); +INSERT INTO t1 VALUES ('user_4','somepassword','N',4,4,2,'2000-09-07','23:06:59','2000-09-07 23:06:59',5); +select user_name, password , subscribed, user_id, quota, weight, access_date, access_time, approved, dummy_primary_key from t1 order by user_name; +user_name password subscribed user_id quota weight access_date access_time approved dummy_primary_key +user_0 somepassword N 0 0 0 2000-09-07 23:06:59 2000-09-07 23:06:59 1 +user_1 somepassword Y 1 1 1 2000-09-07 23:06:59 2000-09-07 23:06:59 2 +user_2 somepassword N 2 2 1.4142135623731 2000-09-07 23:06:59 2000-09-07 23:06:59 3 +user_3 somepassword Y 3 3 1.7320508075689 2000-09-07 23:06:59 2000-09-07 23:06:59 4 +user_4 somepassword N 4 4 2 2000-09-07 23:06:59 2000-09-07 23:06:59 5 +drop table t1; +CREATE TABLE t1 ( +id int(11) NOT NULL auto_increment, +parent_id int(11) DEFAULT '0' NOT NULL, +level tinyint(4) DEFAULT '0' NOT NULL, +KEY (id), +KEY parent_id (parent_id), +KEY level (level) +) engine=innodb; +INSERT INTO t1 VALUES (1,0,0),(3,1,1),(4,1,1),(8,2,2),(9,2,2),(17,3,2),(22,4,2),(24,4,2),(28,5,2),(29,5,2),(30,5,2),(31,6,2),(32,6,2),(33,6,2),(203,7,2),(202,7,2),(20,3,2),(157,0,0),(193,5,2),(40,7,2),(2,1,1),(15,2,2),(6,1,1),(34,6,2),(35,6,2),(16,3,2),(7,1,1),(36,7,2),(18,3,2),(26,5,2),(27,5,2),(183,4,2),(38,7,2),(25,5,2),(37,7,2),(21,4,2),(19,3,2),(5,1,1); +INSERT INTO t1 values (179,5,2); +update t1 set parent_id=parent_id+100; +select * from t1 where parent_id=102; +id parent_id level +8 102 2 +9 102 2 +15 102 2 +update t1 set id=id+1000; +update t1 set id=1024 where id=1009; +select * from t1; +id parent_id level +1001 100 0 +1003 101 1 +1004 101 1 +1008 102 2 +1024 102 2 +1017 103 2 +1022 104 2 +1024 104 2 +1028 105 2 +1029 105 2 +1030 105 2 +1031 106 2 +1032 106 2 +1033 106 2 +1203 107 2 +1202 107 2 +1020 103 2 +1157 100 0 +1193 105 2 +1040 107 2 +1002 101 1 +1015 102 2 +1006 101 1 +1034 106 2 +1035 106 2 +1016 103 2 +1007 101 1 +1036 107 2 +1018 103 2 +1026 105 2 +1027 105 2 +1183 104 2 +1038 107 2 +1025 105 2 +1037 107 2 +1021 104 2 +1019 103 2 +1005 101 1 +1179 105 2 +update ignore t1 set id=id+1; +select * from t1; +id parent_id level +1002 100 0 +1004 101 1 +1005 101 1 +1009 102 2 +1025 102 2 +1018 103 2 +1023 104 2 +1025 104 2 +1029 105 2 +1030 105 2 +1031 105 2 +1032 106 2 +1033 106 2 +1034 106 2 +1204 107 2 +1203 107 2 +1021 103 2 +1158 100 0 +1194 105 2 +1041 107 2 +1003 101 1 +1016 102 2 +1007 101 1 +1035 106 2 +1036 106 2 +1017 103 2 +1008 101 1 +1037 107 2 +1019 103 2 +1027 105 2 +1028 105 2 +1184 104 2 +1039 107 2 +1026 105 2 +1038 107 2 +1022 104 2 +1020 103 2 +1006 101 1 +1180 105 2 +update ignore t1 set id=1023 where id=1010; +select * from t1 where parent_id=102; +id parent_id level +1009 102 2 +1025 102 2 +1016 102 2 +explain select level from t1 where level=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref level level 1 const # Using index +select level,id from t1 where level=1; +level id +1 1004 +1 1005 +1 1003 +1 1007 +1 1008 +1 1006 +select level,id,parent_id from t1 where level=1; +level id parent_id +1 1004 101 +1 1005 101 +1 1003 101 +1 1007 101 +1 1008 101 +1 1006 101 +select level,id from t1 where level=1 order by id; +level id +1 1003 +1 1004 +1 1005 +1 1006 +1 1007 +1 1008 +delete from t1 where level=1; +select * from t1; +id parent_id level +1002 100 0 +1009 102 2 +1025 102 2 +1018 103 2 +1023 104 2 +1025 104 2 +1029 105 2 +1030 105 2 +1031 105 2 +1032 106 2 +1033 106 2 +1034 106 2 +1204 107 2 +1203 107 2 +1021 103 2 +1158 100 0 +1194 105 2 +1041 107 2 +1016 102 2 +1035 106 2 +1036 106 2 +1017 103 2 +1037 107 2 +1019 103 2 +1027 105 2 +1028 105 2 +1184 104 2 +1039 107 2 +1026 105 2 +1038 107 2 +1022 104 2 +1020 103 2 +1180 105 2 +drop table t1; +CREATE TABLE t1 ( +sca_code char(6) NOT NULL, +cat_code char(6) NOT NULL, +sca_desc varchar(50), +lan_code char(2) NOT NULL, +sca_pic varchar(100), +sca_sdesc varchar(50), +sca_sch_desc varchar(16), +PRIMARY KEY (sca_code, cat_code, lan_code), +INDEX sca_pic (sca_pic) +) engine = innodb ; +INSERT INTO t1 ( sca_code, cat_code, sca_desc, lan_code, sca_pic, sca_sdesc, sca_sch_desc) VALUES ( 'PD', 'J', 'PENDANT', 'EN', NULL, NULL, 'PENDANT'),( 'RI', 'J', 'RING', 'EN', NULL, NULL, 'RING'),( 'QQ', 'N', 'RING', 'EN', 'not null', NULL, 'RING'); +select count(*) from t1 where sca_code = 'PD'; +count(*) +1 +select count(*) from t1 where sca_code <= 'PD'; +count(*) +1 +select count(*) from t1 where sca_pic is null; +count(*) +2 +alter table t1 drop index sca_pic, add index sca_pic (cat_code, sca_pic); +alter table t1 drop index sca_pic; +alter table t1 add index sca_pic (cat_code, sca_pic); +select count(*) from t1 where sca_code='PD' and sca_pic is null; +count(*) +1 +select count(*) from t1 where cat_code='E'; +count(*) +0 +alter table t1 drop index sca_pic, add index (sca_pic, cat_code); +ERROR 42000: Incorrect index name 'sca_pic' +alter table t1 drop index sca_pic; +alter table t1 add index (sca_pic, cat_code); +select count(*) from t1 where sca_code='PD' and sca_pic is null; +count(*) +1 +select count(*) from t1 where sca_pic >= 'n'; +count(*) +1 +select sca_pic from t1 where sca_pic is null; +sca_pic +NULL +NULL +update t1 set sca_pic="test" where sca_pic is null; +delete from t1 where sca_code='pd'; +drop table t1; +set @a:=now(); +CREATE TABLE t1 (a int not null, b timestamp not null, primary key (a)) engine=innodb; +insert into t1 (a) values(1),(2),(3); +select t1.a from t1 natural join t1 as t2 where t1.b >= @a order by t1.a; +a +1 +2 +3 +select a from t1 natural join t1 as t2 where b >= @a order by a; +a +1 +2 +3 +update t1 set a=5 where a=1; +select a from t1; +a +2 +3 +5 +drop table t1; +create table t1 (a varchar(100) not null, primary key(a), b int not null) engine=innodb; +insert into t1 values("hello",1),("world",2); +select * from t1 order by b desc; +a b +world 2 +hello 1 +optimize table t1; +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +show keys from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 PRIMARY 1 a A # NULL NULL BTREE +drop table t1; +create table t1 (i int, j int ) ENGINE=innodb; +insert into t1 values (1,2); +select * from t1 where i=1 and j=2; +i j +1 2 +create index ax1 on t1 (i,j); +select * from t1 where i=1 and j=2; +i j +1 2 +drop table t1; +CREATE TABLE t1 ( +a int3 unsigned NOT NULL, +b int1 unsigned NOT NULL, +UNIQUE (a, b) +) ENGINE = innodb; +INSERT INTO t1 VALUES (1, 1); +SELECT MIN(B),MAX(b) FROM t1 WHERE t1.a = 1; +MIN(B) MAX(b) +1 1 +drop table t1; +CREATE TABLE t1 (a int unsigned NOT NULL) engine=innodb; +INSERT INTO t1 VALUES (1); +SELECT * FROM t1; +a +1 +DROP TABLE t1; +create table t1 (a int primary key,b int, c int, d int, e int, f int, g int, h int, i int, j int, k int, l int, m int, n int, o int, p int, q int, r int, s int, t int, u int, v int, w int, x int, y int, z int, a1 int, a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int, b1 int, b2 int, b3 int, b4 int, b5 int, b6 int) engine = innodb; +insert into t1 values (1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1); +explain select * from t1 where a > 0 and a < 50; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL # Using where +drop table t1; +create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) engine=innodb; +insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL'); +LOCK TABLES t1 WRITE; +insert into t1 values (99,1,2,'D'),(1,1,2,'D'); +ERROR 23000: Duplicate entry '1-1' for key 'PRIMARY' +select id from t1; +id +0 +1 +2 +select id from t1; +id +0 +1 +2 +UNLOCK TABLES; +DROP TABLE t1; +create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) engine=innodb; +insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL'); +LOCK TABLES t1 WRITE; +begin; +insert into t1 values (99,1,2,'D'),(1,1,2,'D'); +ERROR 23000: Duplicate entry '1-1' for key 'PRIMARY' +select id from t1; +id +0 +1 +2 +insert ignore into t1 values (100,1,2,'D'),(1,1,99,'D'); +commit; +select id,id3 from t1; +id id3 +0 0 +1 1 +2 2 +100 2 +UNLOCK TABLES; +DROP TABLE t1; +create table t1 (a char(20), unique (a(5))) engine=innodb; +drop table t1; +create table t1 (a char(20), index (a(5))) engine=innodb; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(20) DEFAULT NULL, + KEY `a` (`a`(5)) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t1; +create temporary table t1 (a int not null auto_increment, primary key(a)) engine=innodb; +insert into t1 values (NULL),(NULL),(NULL); +delete from t1 where a=3; +insert into t1 values (NULL); +select * from t1; +a +1 +2 +4 +alter table t1 add b int; +select * from t1; +a b +1 NULL +2 NULL +4 NULL +drop table t1; +create table t1 +( +id int auto_increment primary key, +name varchar(32) not null, +value text not null, +uid int not null, +unique key(name,uid) +) engine=innodb; +insert into t1 values (1,'one','one value',101), +(2,'two','two value',102),(3,'three','three value',103); +set insert_id=5; +replace into t1 (value,name,uid) values ('other value','two',102); +delete from t1 where uid=102; +set insert_id=5; +replace into t1 (value,name,uid) values ('other value','two',102); +set insert_id=6; +replace into t1 (value,name,uid) values ('other value','two',102); +select * from t1; +id name value uid +1 one one value 101 +3 three three value 103 +6 two other value 102 +drop table t1; +create database mysqltest; +create table mysqltest.t1 (a int not null) engine= innodb; +insert into mysqltest.t1 values(1); +create table mysqltest.t2 (a int not null) engine= myisam; +insert into mysqltest.t2 values(1); +create table mysqltest.t3 (a int not null) engine= heap; +insert into mysqltest.t3 values(1); +commit; +drop database mysqltest; +show tables from mysqltest; +ERROR 42000: Unknown database 'mysqltest' +set autocommit=0; +create table t1 (a int not null) engine= innodb; +insert into t1 values(1),(2); +truncate table t1; +commit; +truncate table t1; +truncate table t1; +select * from t1; +a +insert into t1 values(1),(2); +delete from t1; +select * from t1; +a +commit; +drop table t1; +set autocommit=1; +create table t1 (a int not null) engine= innodb; +insert into t1 values(1),(2); +truncate table t1; +insert into t1 values(1),(2); +select * from t1; +a +1 +2 +truncate table t1; +insert into t1 values(1),(2); +delete from t1; +select * from t1; +a +drop table t1; +create table t1 (a int not null, b int not null, c int not null, primary key (a),key(b)) engine=innodb; +insert into t1 values (3,3,3),(1,1,1),(2,2,2),(4,4,4); +explain select * from t1 order by a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL PRIMARY 4 NULL # +explain select * from t1 order by b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL # Using filesort +explain select * from t1 order by c; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL # Using filesort +explain select a from t1 order by a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL PRIMARY 4 NULL # Using index +explain select b from t1 order by b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL b 4 NULL # Using index +explain select a,b from t1 order by b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL b 4 NULL # Using index +explain select a,b from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL b 4 NULL # Using index +explain select a,b,c from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL # +drop table t1; +create table t1 (t int not null default 1, key (t)) engine=innodb; +desc t1; +Field Type Null Key Default Extra +t int(11) NO MUL 1 +drop table t1; +CREATE TABLE t1 ( +number bigint(20) NOT NULL default '0', +cname char(15) NOT NULL default '', +carrier_id smallint(6) NOT NULL default '0', +privacy tinyint(4) NOT NULL default '0', +last_mod_date timestamp NOT NULL, +last_mod_id smallint(6) NOT NULL default '0', +last_app_date timestamp NOT NULL, +last_app_id smallint(6) default '-1', +version smallint(6) NOT NULL default '0', +assigned_scps int(11) default '0', +status tinyint(4) default '0' +) ENGINE=InnoDB; +INSERT INTO t1 VALUES (4077711111,'SeanWheeler',90,2,20020111112846,500,00000000000000,-1,2,3,1); +INSERT INTO t1 VALUES (9197722223,'berry',90,3,20020111112809,500,20020102114532,501,4,10,0); +INSERT INTO t1 VALUES (650,'San Francisco',0,0,20011227111336,342,00000000000000,-1,1,24,1); +INSERT INTO t1 VALUES (302467,'Sue\'s Subshop',90,3,20020109113241,500,20020102115111,501,7,24,0); +INSERT INTO t1 VALUES (6014911113,'SudzCarwash',520,1,20020102115234,500,20020102115259,501,33,32768,0); +INSERT INTO t1 VALUES (333,'tubs',99,2,20020109113440,501,20020109113440,500,3,10,0); +CREATE TABLE t2 ( +number bigint(20) NOT NULL default '0', +cname char(15) NOT NULL default '', +carrier_id smallint(6) NOT NULL default '0', +privacy tinyint(4) NOT NULL default '0', +last_mod_date timestamp NOT NULL, +last_mod_id smallint(6) NOT NULL default '0', +last_app_date timestamp NOT NULL, +last_app_id smallint(6) default '-1', +version smallint(6) NOT NULL default '0', +assigned_scps int(11) default '0', +status tinyint(4) default '0' +) ENGINE=InnoDB; +INSERT INTO t2 VALUES (4077711111,'SeanWheeler',0,2,20020111112853,500,00000000000000,-1,2,3,1); +INSERT INTO t2 VALUES (9197722223,'berry',90,3,20020111112818,500,20020102114532,501,4,10,0); +INSERT INTO t2 VALUES (650,'San Francisco',90,0,20020109113158,342,00000000000000,-1,1,24,1); +INSERT INTO t2 VALUES (333,'tubs',99,2,20020109113453,501,20020109113453,500,3,10,0); +select * from t1; +number cname carrier_id privacy last_mod_date last_mod_id last_app_date last_app_id version assigned_scps status +4077711111 SeanWheeler 90 2 2002-01-11 11:28:46 500 0000-00-00 00:00:00 -1 2 3 1 +9197722223 berry 90 3 2002-01-11 11:28:09 500 2002-01-02 11:45:32 501 4 10 0 +650 San Francisco 0 0 2001-12-27 11:13:36 342 0000-00-00 00:00:00 -1 1 24 1 +302467 Sue's Subshop 90 3 2002-01-09 11:32:41 500 2002-01-02 11:51:11 501 7 24 0 +6014911113 SudzCarwash 520 1 2002-01-02 11:52:34 500 2002-01-02 11:52:59 501 33 32768 0 +333 tubs 99 2 2002-01-09 11:34:40 501 2002-01-09 11:34:40 500 3 10 0 +select * from t2; +number cname carrier_id privacy last_mod_date last_mod_id last_app_date last_app_id version assigned_scps status +4077711111 SeanWheeler 0 2 2002-01-11 11:28:53 500 0000-00-00 00:00:00 -1 2 3 1 +9197722223 berry 90 3 2002-01-11 11:28:18 500 2002-01-02 11:45:32 501 4 10 0 +650 San Francisco 90 0 2002-01-09 11:31:58 342 0000-00-00 00:00:00 -1 1 24 1 +333 tubs 99 2 2002-01-09 11:34:53 501 2002-01-09 11:34:53 500 3 10 0 +delete t1, t2 from t1 left join t2 on t1.number=t2.number where (t1.carrier_id=90 and t1.number=t2.number) or (t2.carrier_id=90 and t1.number=t2.number) or (t1.carrier_id=90 and t2.number is null); +select * from t1; +number cname carrier_id privacy last_mod_date last_mod_id last_app_date last_app_id version assigned_scps status +6014911113 SudzCarwash 520 1 2002-01-02 11:52:34 500 2002-01-02 11:52:59 501 33 32768 0 +333 tubs 99 2 2002-01-09 11:34:40 501 2002-01-09 11:34:40 500 3 10 0 +select * from t2; +number cname carrier_id privacy last_mod_date last_mod_id last_app_date last_app_id version assigned_scps status +333 tubs 99 2 2002-01-09 11:34:53 501 2002-01-09 11:34:53 500 3 10 0 +select * from t2; +number cname carrier_id privacy last_mod_date last_mod_id last_app_date last_app_id version assigned_scps status +333 tubs 99 2 2002-01-09 11:34:53 501 2002-01-09 11:34:53 500 3 10 0 +drop table t1,t2; +create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) engine=innodb; +BEGIN; +SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; +SELECT @@tx_isolation,@@global.tx_isolation; +@@tx_isolation @@global.tx_isolation +SERIALIZABLE REPEATABLE-READ +insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David'); +select id, code, name from t1 order by id; +id code name +1 1 Tim +2 1 Monty +3 2 David +COMMIT; +BEGIN; +SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ; +insert into t1 (code, name) values (2, 'Erik'), (3, 'Sasha'); +select id, code, name from t1 order by id; +id code name +1 1 Tim +2 1 Monty +3 2 David +4 2 Erik +5 3 Sasha +COMMIT; +SET binlog_format='MIXED'; +BEGIN; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +insert into t1 (code, name) values (3, 'Jeremy'), (4, 'Matt'); +select id, code, name from t1 order by id; +id code name +1 1 Tim +2 1 Monty +3 2 David +4 2 Erik +5 3 Sasha +6 3 Jeremy +7 4 Matt +COMMIT; +DROP TABLE t1; +create table t1 (n int(10), d int(10)) engine=innodb; +create table t2 (n int(10), d int(10)) engine=innodb; +insert into t1 values(1,1),(1,2); +insert into t2 values(1,10),(2,20); +UPDATE t1,t2 SET t1.d=t2.d,t2.d=30 WHERE t1.n=t2.n; +select * from t1; +n d +1 10 +1 10 +select * from t2; +n d +1 30 +2 20 +drop table t1,t2; +drop table if exists t1, t2; +CREATE TABLE t1 (a int, PRIMARY KEY (a)); +CREATE TABLE t2 (a int, PRIMARY KEY (a)) ENGINE=InnoDB; +create trigger trg_del_t2 after delete on t2 for each row +insert into t1 values (1); +insert into t1 values (1); +insert into t2 values (1),(2); +delete t2 from t2; +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +select count(*) from t2 /* must be 2 as restored after rollback caused by the error */; +count(*) +2 +drop table t1, t2; +drop table if exists t1, t2; +CREATE TABLE t1 (a int, PRIMARY KEY (a)); +CREATE TABLE t2 (a int, PRIMARY KEY (a)) ENGINE=InnoDB; +create trigger trg_del_t2 after delete on t2 for each row +insert into t1 values (1); +insert into t1 values (1); +insert into t2 values (1),(2); +delete t2 from t2; +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +select count(*) from t2 /* must be 2 as restored after rollback caused by the error */; +count(*) +2 +drop table t1, t2; +create table t1 (a int, b int) engine=innodb; +insert into t1 values(20,null); +select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on +t2.b=t3.a; +b ifnull(t2.b,"this is null") +NULL this is null +select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on +t2.b=t3.a order by 1; +b ifnull(t2.b,"this is null") +NULL this is null +insert into t1 values(10,null); +select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on +t2.b=t3.a order by 1; +b ifnull(t2.b,"this is null") +NULL this is null +NULL this is null +drop table t1; +create table t1 (a varchar(10) not null) engine=myisam; +create table t2 (b varchar(10) not null unique) engine=innodb; +select t1.a from t1,t2 where t1.a=t2.b; +a +drop table t1,t2; +create table t1 (a int not null, b int, primary key (a)) engine = innodb; +create table t2 (a int not null, b int, primary key (a)) engine = innodb; +insert into t1 values (10, 20); +insert into t2 values (10, 20); +update t1, t2 set t1.b = 150, t2.b = t1.b where t2.a = t1.a and t1.a = 10; +drop table t1,t2; +CREATE TABLE t1 (id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB; +CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (t1_id) REFERENCES t1(id) ON DELETE CASCADE ) ENGINE=INNODB; +insert into t1 set id=1; +insert into t2 set id=1, t1_id=1; +delete t1,t2 from t1,t2 where t1.id=t2.t1_id; +select * from t1; +id +select * from t2; +id t1_id +drop table t2,t1; +CREATE TABLE t1(id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB; +CREATE TABLE t2(id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id) ) ENGINE=INNODB; +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1, 1); +SELECT * from t1; +id +1 +UPDATE t1,t2 SET t1.id=t1.id+1, t2.t1_id=t1.id+1; +SELECT * from t1; +id +2 +UPDATE t1,t2 SET t1.id=t1.id+1 where t1.id!=t2.id; +SELECT * from t1; +id +3 +DROP TABLE t1,t2; +set autocommit=0; +CREATE TABLE t1 (id CHAR(15) NOT NULL, value CHAR(40) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB; +CREATE TABLE t2 (id CHAR(15) NOT NULL, value CHAR(40) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB; +CREATE TABLE t3 (id1 CHAR(15) NOT NULL, id2 CHAR(15) NOT NULL, PRIMARY KEY(id1, id2)) ENGINE=InnoDB; +INSERT INTO t3 VALUES("my-test-1", "my-test-2"); +COMMIT; +INSERT INTO t1 VALUES("this-key", "will disappear"); +INSERT INTO t2 VALUES("this-key", "will also disappear"); +DELETE FROM t3 WHERE id1="my-test-1"; +SELECT * FROM t1; +id value +this-key will disappear +SELECT * FROM t2; +id value +this-key will also disappear +SELECT * FROM t3; +id1 id2 +ROLLBACK; +SELECT * FROM t1; +id value +SELECT * FROM t2; +id value +SELECT * FROM t3; +id1 id2 +my-test-1 my-test-2 +SELECT * FROM t3 WHERE id1="my-test-1" LOCK IN SHARE MODE; +id1 id2 +my-test-1 my-test-2 +COMMIT; +set autocommit=1; +DROP TABLE t1,t2,t3; +CREATE TABLE t1 (a int not null primary key, b int not null, unique (b)) engine=innodb; +INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +UPDATE t1 set a=a+100 where b between 2 and 3 and a < 1000; +SELECT * from t1; +a b +1 1 +102 2 +103 3 +4 4 +5 5 +6 6 +7 7 +8 8 +9 9 +drop table t1; +CREATE TABLE t2 ( NEXT_T BIGINT NOT NULL PRIMARY KEY) ENGINE=MyISAM; +CREATE TABLE t1 ( B_ID INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB; +SET AUTOCOMMIT=0; +INSERT INTO t1 ( B_ID ) VALUES ( 1 ); +INSERT INTO t2 ( NEXT_T ) VALUES ( 1 ); +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +SELECT * FROM t1; +B_ID +drop table t1,t2; +create table t1 ( pk int primary key, parent int not null, child int not null, index (parent) ) engine = innodb; +insert into t1 values (1,0,4), (2,1,3), (3,2,1), (4,1,2); +select distinct parent,child from t1 order by parent; +parent child +0 4 +1 2 +1 3 +2 1 +drop table t1; +create table t1 (a int not null auto_increment primary key, b int, c int, key(c)) engine=innodb; +create table t2 (a int not null auto_increment primary key, b int); +insert into t1 (b) values (null),(null),(null),(null),(null),(null),(null); +insert into t2 (a) select b from t1; +insert into t1 (b) select b from t2; +insert into t2 (a) select b from t1; +insert into t1 (a) select b from t2; +insert into t2 (a) select b from t1; +insert into t1 (a) select b from t2; +insert into t2 (a) select b from t1; +insert into t1 (a) select b from t2; +insert into t2 (a) select b from t1; +insert into t1 (a) select b from t2; +select count(*) from t1; +count(*) +623 +explain select * from t1 where c between 1 and 2500; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range c c 5 NULL # Using where +update t1 set c=a; +explain select * from t1 where c between 1 and 2500; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL c NULL NULL NULL # Using where +drop table t1,t2; +create table t1 (id int primary key auto_increment, fk int, index index_fk (fk)) engine=innodb; +insert into t1 (id) values (null),(null),(null),(null),(null); +update t1 set fk=69 where fk is null order by id limit 1; +SELECT * from t1; +id fk +2 NULL +3 NULL +4 NULL +5 NULL +1 69 +drop table t1; +create table t1 (a int not null, b int not null, key (a)); +insert into t1 values (1,1),(1,2),(1,3),(3,1),(3,2),(3,3),(3,1),(3,2),(3,3),(2,1),(2,2),(2,3); +SET @tmp=0; +update t1 set b=(@tmp:=@tmp+1) order by a; +update t1 set b=99 where a=1 order by b asc limit 1; +update t1 set b=100 where a=1 order by b desc limit 2; +update t1 set a=a+10+b where a=1 order by b; +select * from t1 order by a,b; +a b +2 4 +2 5 +2 6 +3 7 +3 8 +3 9 +3 10 +3 11 +3 12 +13 2 +111 100 +111 100 +drop table t1; +create table t1 ( c char(8) not null ) engine=innodb; +insert into t1 values ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7'),('8'),('9'); +insert into t1 values ('A'),('B'),('C'),('D'),('E'),('F'); +alter table t1 add b char(8) not null; +alter table t1 add a char(8) not null; +alter table t1 add primary key (a,b,c); +update t1 set a=c, b=c; +create table t2 (c char(8) not null, b char(8) not null, a char(8) not null, primary key(a,b,c)) engine=innodb; +insert into t2 select * from t1; +delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b; +drop table t1,t2; +SET AUTOCOMMIT=1; +create table t1 (a integer auto_increment primary key) engine=innodb; +insert into t1 (a) values (NULL),(NULL); +truncate table t1; +insert into t1 (a) values (NULL),(NULL); +SELECT * from t1; +a +1 +2 +drop table t1; +CREATE TABLE t1 (`id 1` INT NOT NULL, PRIMARY KEY (`id 1`)) ENGINE=INNODB; +CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (`t1_id`) REFERENCES `t1`(`id 1`) ON DELETE CASCADE ) ENGINE=INNODB; +drop table t2,t1; +create table `t1` (`id` int( 11 ) not null ,primary key ( `id` )) engine = innodb; +insert into `t1`values ( 1 ) ; +create table `t2` (`id` int( 11 ) not null default '0',unique key `id` ( `id` ) ,constraint `t1_id_fk` foreign key ( `id` ) references `t1` (`id` )) engine = innodb; +insert into `t2`values ( 1 ) ; +create table `t3` (`id` int( 11 ) not null default '0',key `id` ( `id` ) ,constraint `t2_id_fk` foreign key ( `id` ) references `t2` (`id` )) engine = innodb; +insert into `t3`values ( 1 ) ; +delete t3,t2,t1 from t1,t2,t3 where t1.id =1 and t2.id = t1.id and t3.id = t2.id; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`)) +update t1,t2,t3 set t3.id=5, t2.id=6, t1.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`)) +update t3 set t3.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id; +ERROR 42S22: Unknown column 't1.id' in 'where clause' +drop table t3,t2,t1; +create table t1( +id int primary key, +pid int, +index(pid), +foreign key(pid) references t1(id) on delete cascade) engine=innodb; +insert into t1 values(0,0),(1,0),(2,1),(3,2),(4,3),(5,4),(6,5),(7,6), +(8,7),(9,8),(10,9),(11,10),(12,11),(13,12),(14,13),(15,14); +delete from t1 where id=0; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t1`, CONSTRAINT `t1_ibfk_1` FOREIGN KEY (`pid`) REFERENCES `t1` (`id`) ON DELETE CASCADE) +delete from t1 where id=15; +delete from t1 where id=0; +drop table t1; +CREATE TABLE t1 (col1 int(1))ENGINE=InnoDB; +CREATE TABLE t2 (col1 int(1),stamp TIMESTAMP,INDEX stamp_idx +(stamp))ENGINE=InnoDB; +insert into t1 values (1),(2),(3); +insert into t2 values (1, 20020204130000),(2, 20020204130000),(4,20020204310000 ),(5,20020204230000); +Warnings: +Warning 1265 Data truncated for column 'stamp' at row 3 +SELECT col1 FROM t1 UNION SELECT col1 FROM t2 WHERE stamp < +'20020204120000' GROUP BY col1; +col1 +1 +2 +3 +4 +drop table t1,t2; +CREATE TABLE t1 ( +`id` int(10) unsigned NOT NULL auto_increment, +`id_object` int(10) unsigned default '0', +`id_version` int(10) unsigned NOT NULL default '1', +`label` varchar(100) NOT NULL default '', +`description` text, +PRIMARY KEY (`id`), +KEY `id_object` (`id_object`), +KEY `id_version` (`id_version`) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES("6", "3382", "9", "Test", NULL), ("7", "102", "5", "Le Pekin (Test)", NULL),("584", "1794", "4", "Test de resto", NULL),("837", "1822", "6", "Test 3", NULL),("1119", "3524", "1", "Societe Test", NULL),("1122", "3525", "1", "Fournisseur Test", NULL); +CREATE TABLE t2 ( +`id` int(10) unsigned NOT NULL auto_increment, +`id_version` int(10) unsigned NOT NULL default '1', +PRIMARY KEY (`id`), +KEY `id_version` (`id_version`) +) ENGINE=InnoDB; +INSERT INTO t2 VALUES("3524", "1"),("3525", "1"),("1794", "4"),("102", "5"),("1822", "6"),("3382", "9"); +SELECT t2.id, t1.`label` FROM t2 INNER JOIN +(SELECT t1.id_object as id_object FROM t1 WHERE t1.`label` LIKE '%test%') AS lbl +ON (t2.id = lbl.id_object) INNER JOIN t1 ON (t2.id = t1.id_object); +id label +3382 Test +102 Le Pekin (Test) +1794 Test de resto +1822 Test 3 +3524 Societe Test +3525 Fournisseur Test +drop table t1,t2; +create table t1 (a int, b varchar(200), c text not null) checksum=1 engine=myisam; +create table t2 (a int, b varchar(200), c text not null) checksum=0 engine=innodb; +create table t3 (a int, b varchar(200), c text not null) checksum=1 engine=innodb; +insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, ""); +insert t2 select * from t1; +insert t3 select * from t1; +checksum table t1, t2, t3, t4 quick; +Table Checksum +test.t1 2948697075 +test.t2 NULL +test.t3 NULL +test.t4 NULL +Warnings: +Error 1146 Table 'test.t4' doesn't exist +checksum table t1, t2, t3, t4; +Table Checksum +test.t1 2948697075 +test.t2 2948697075 +test.t3 2948697075 +test.t4 NULL +Warnings: +Error 1146 Table 'test.t4' doesn't exist +checksum table t1, t2, t3, t4 extended; +Table Checksum +test.t1 2948697075 +test.t2 2948697075 +test.t3 2948697075 +test.t4 NULL +Warnings: +Error 1146 Table 'test.t4' doesn't exist +drop table t1,t2,t3; +create table t1 (id int, name char(10) not null, name2 char(10) not null) engine=innodb; +insert into t1 values(1,'first','fff'),(2,'second','sss'),(3,'third','ttt'); +select trim(name2) from t1 union all select trim(name) from t1 union all select trim(id) from t1; +trim(name2) +fff +sss +ttt +first +second +third +1 +2 +3 +drop table t1; +create table t1 (a int) engine=innodb; +create table t2 like t1; +drop table t1,t2; +create table t1 (id int(11) not null, id2 int(11) not null, unique (id,id2)) engine=innodb; +create table t2 (id int(11) not null, constraint t1_id_fk foreign key ( id ) references t1 (id)) engine = innodb; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL, + `id2` int(11) NOT NULL, + UNIQUE KEY `id` (`id`,`id2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL, + KEY `t1_id_fk` (`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +create index id on t2 (id); +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL, + KEY `id` (`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +create index id2 on t2 (id); +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL, + KEY `id` (`id`), + KEY `id2` (`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop index id2 on t2; +drop index id on t2; +ERROR HY000: Cannot drop index 'id': needed in a foreign key constraint +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL, + KEY `id` (`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id,id2) references t1 (id,id2)) engine = innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL, + `id2` int(11) NOT NULL, + KEY `t1_id_fk` (`id`,`id2`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`, `id2`) REFERENCES `t1` (`id`, `id2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +create unique index id on t2 (id,id2); +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL, + `id2` int(11) NOT NULL, + UNIQUE KEY `id` (`id`,`id2`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`, `id2`) REFERENCES `t1` (`id`, `id2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2),constraint t1_id_fk foreign key (id2,id) references t1 (id,id2)) engine = innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL, + `id2` int(11) NOT NULL, + UNIQUE KEY `id` (`id`,`id2`), + KEY `t1_id_fk` (`id2`,`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id2`, `id`) REFERENCES `t1` (`id`, `id2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2), constraint t1_id_fk foreign key (id) references t1 (id)) engine = innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL, + `id2` int(11) NOT NULL, + UNIQUE KEY `id` (`id`,`id2`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2),constraint t1_id_fk foreign key (id2,id) references t1 (id,id2)) engine = innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL, + `id2` int(11) NOT NULL, + UNIQUE KEY `id` (`id`,`id2`), + KEY `t1_id_fk` (`id2`,`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id2`, `id`) REFERENCES `t1` (`id`, `id2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id), primary key (id), index (id,id2)) engine = innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `id2` int(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `id` (`id`,`id2`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id)) engine= innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `id2` int(11) NOT NULL, + KEY `t1_id_fk` (`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +alter table t2 add index id_test (id), add index id_test2 (id,id2); +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `id2` int(11) NOT NULL, + KEY `id_test` (`id`), + KEY `id_test2` (`id`,`id2`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb; +ERROR 42000: Incorrect foreign key definition for 't1_id_fk': Key reference and table reference don't match +create table t2 (a int auto_increment primary key, b int, index(b), foreign key (b) references t1(id), unique(b)) engine=innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) NOT NULL AUTO_INCREMENT, + `b` int(11) DEFAULT NULL, + PRIMARY KEY (`a`), + UNIQUE KEY `b_2` (`b`), + KEY `b` (`b`), + CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`b`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (a int auto_increment primary key, b int, foreign key (b) references t1(id), foreign key (b) references t1(id), unique(b)) engine=innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) NOT NULL AUTO_INCREMENT, + `b` int(11) DEFAULT NULL, + PRIMARY KEY (`a`), + UNIQUE KEY `b` (`b`), + CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`b`) REFERENCES `t1` (`id`), + CONSTRAINT `t2_ibfk_2` FOREIGN KEY (`b`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2, t1; +create table t1 (c char(10), index (c,c)) engine=innodb; +ERROR 42S21: Duplicate column name 'c' +create table t1 (c1 char(10), c2 char(10), index (c1,c2,c1)) engine=innodb; +ERROR 42S21: Duplicate column name 'c1' +create table t1 (c1 char(10), c2 char(10), index (c1,c1,c2)) engine=innodb; +ERROR 42S21: Duplicate column name 'c1' +create table t1 (c1 char(10), c2 char(10), index (c2,c1,c1)) engine=innodb; +ERROR 42S21: Duplicate column name 'c1' +create table t1 (c1 char(10), c2 char(10)) engine=innodb; +alter table t1 add key (c1,c1); +ERROR 42S21: Duplicate column name 'c1' +alter table t1 add key (c2,c1,c1); +ERROR 42S21: Duplicate column name 'c1' +alter table t1 add key (c1,c2,c1); +ERROR 42S21: Duplicate column name 'c1' +alter table t1 add key (c1,c1,c2); +ERROR 42S21: Duplicate column name 'c1' +drop table t1; +CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB; +SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE); +ERROR HY000: The used table type doesn't support FULLTEXT indexes +DROP TABLE t1; +CREATE TABLE t1 (a_id tinyint(4) NOT NULL default '0', PRIMARY KEY (a_id)) ENGINE=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES (1),(2),(3); +CREATE TABLE t2 (b_id tinyint(4) NOT NULL default '0',b_a tinyint(4) NOT NULL default '0', PRIMARY KEY (b_id), KEY (b_a), +CONSTRAINT fk_b_a FOREIGN KEY (b_a) REFERENCES t1 (a_id) ON DELETE CASCADE ON UPDATE NO ACTION) ENGINE=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t2 VALUES (1,1),(2,1),(3,1),(4,2),(5,2); +SELECT * FROM (SELECT t1.*,GROUP_CONCAT(t2.b_id SEPARATOR ',') as b_list FROM (t1 LEFT JOIN (t2) on t1.a_id = t2.b_a) GROUP BY t1.a_id ) AS xyz; +a_id b_list +1 1,2,3 +2 4,5 +3 NULL +DROP TABLE t2; +DROP TABLE t1; +create temporary table t1 (a int) engine=innodb; +insert into t1 values (4711); +truncate t1; +insert into t1 values (42); +select * from t1; +a +42 +drop table t1; +create table t1 (a int) engine=innodb; +insert into t1 values (4711); +truncate t1; +insert into t1 values (42); +select * from t1; +a +42 +drop table t1; +create table t1 (a int not null, b int not null, c blob not null, d int not null, e int, primary key (a,b,c(255),d)) engine=innodb; +insert into t1 values (2,2,"b",2,2),(1,1,"a",1,1),(3,3,"ab",3,3); +select * from t1 order by a,b,c,d; +a b c d e +1 1 a 1 1 +2 2 b 2 2 +3 3 ab 3 3 +explain select * from t1 order by a,b,c,d; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using filesort +drop table t1; +create table t1 (a char(1), b char(1), key(a, b)) engine=innodb; +insert into t1 values ('8', '6'), ('4', '7'); +select min(a) from t1; +min(a) +4 +select min(b) from t1 where a='8'; +min(b) +6 +drop table t1; +create table t1 (x bigint unsigned not null primary key) engine=innodb; +insert into t1(x) values (0xfffffffffffffff0),(0xfffffffffffffff1); +select * from t1; +x +18446744073709551600 +18446744073709551601 +select count(*) from t1 where x>0; +count(*) +2 +select count(*) from t1 where x=0; +count(*) +0 +select count(*) from t1 where x<0; +count(*) +0 +select count(*) from t1 where x < -16; +count(*) +0 +select count(*) from t1 where x = -16; +count(*) +0 +explain select count(*) from t1 where x > -16; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index PRIMARY PRIMARY 8 NULL 2 Using where; Using index +select count(*) from t1 where x > -16; +count(*) +2 +select * from t1 where x > -16; +x +18446744073709551600 +18446744073709551601 +select count(*) from t1 where x = 18446744073709551601; +count(*) +1 +drop table t1; +SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total'; +variable_value +511 +SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_page_size'; +variable_value +16384 +SELECT variable_value - @innodb_rows_deleted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_deleted'; +variable_value - @innodb_rows_deleted_orig +71 +SELECT variable_value - @innodb_rows_inserted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_inserted'; +variable_value - @innodb_rows_inserted_orig +1065 +SELECT variable_value - @innodb_rows_updated_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_updated'; +variable_value - @innodb_rows_updated_orig +865 +SELECT variable_value - @innodb_row_lock_waits_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_waits'; +variable_value - @innodb_row_lock_waits_orig +0 +SELECT variable_value - @innodb_row_lock_current_waits_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_current_waits'; +variable_value - @innodb_row_lock_current_waits_orig +0 +SELECT variable_value - @innodb_row_lock_time_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time'; +variable_value - @innodb_row_lock_time_orig +0 +SELECT variable_value - @innodb_row_lock_time_max_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_max'; +variable_value - @innodb_row_lock_time_max_orig +0 +SELECT variable_value - @innodb_row_lock_time_avg_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_avg'; +variable_value - @innodb_row_lock_time_avg_orig +0 +SET @innodb_sync_spin_loops_orig = @@innodb_sync_spin_loops; +show variables like "innodb_sync_spin_loops"; +Variable_name Value +innodb_sync_spin_loops 30 +set global innodb_sync_spin_loops=1000; +show variables like "innodb_sync_spin_loops"; +Variable_name Value +innodb_sync_spin_loops 1000 +set global innodb_sync_spin_loops=0; +show variables like "innodb_sync_spin_loops"; +Variable_name Value +innodb_sync_spin_loops 0 +set global innodb_sync_spin_loops=20; +show variables like "innodb_sync_spin_loops"; +Variable_name Value +innodb_sync_spin_loops 20 +set global innodb_sync_spin_loops=@innodb_sync_spin_loops_orig; +show variables like "innodb_thread_concurrency"; +Variable_name Value +innodb_thread_concurrency 0 +set global innodb_thread_concurrency=1001; +Warnings: +Warning 1292 Truncated incorrect innodb_thread_concurrency value: '1001' +show variables like "innodb_thread_concurrency"; +Variable_name Value +innodb_thread_concurrency 1000 +set global innodb_thread_concurrency=0; +show variables like "innodb_thread_concurrency"; +Variable_name Value +innodb_thread_concurrency 0 +set global innodb_thread_concurrency=16; +show variables like "innodb_thread_concurrency"; +Variable_name Value +innodb_thread_concurrency 16 +show variables like "innodb_concurrency_tickets"; +Variable_name Value +innodb_concurrency_tickets 500 +set global innodb_concurrency_tickets=1000; +show variables like "innodb_concurrency_tickets"; +Variable_name Value +innodb_concurrency_tickets 1000 +set global innodb_concurrency_tickets=0; +Warnings: +Warning 1292 Truncated incorrect innodb_concurrency_tickets value: '0' +show variables like "innodb_concurrency_tickets"; +Variable_name Value +innodb_concurrency_tickets 1 +set global innodb_concurrency_tickets=500; +show variables like "innodb_concurrency_tickets"; +Variable_name Value +innodb_concurrency_tickets 500 +show variables like "innodb_thread_sleep_delay"; +Variable_name Value +innodb_thread_sleep_delay 10000 +set global innodb_thread_sleep_delay=100000; +show variables like "innodb_thread_sleep_delay"; +Variable_name Value +innodb_thread_sleep_delay 100000 +set global innodb_thread_sleep_delay=0; +show variables like "innodb_thread_sleep_delay"; +Variable_name Value +innodb_thread_sleep_delay 0 +set global innodb_thread_sleep_delay=10000; +show variables like "innodb_thread_sleep_delay"; +Variable_name Value +innodb_thread_sleep_delay 10000 +set storage_engine=INNODB; +set session old_alter_table=1; +drop table if exists t1,t2,t3; +--- Testing varchar --- +--- Testing varchar --- +create table t1 (v varchar(10), c char(10), t text); +insert into t1 values('+ ', '+ ', '+ '); +set @a=repeat(' ',20); +insert into t1 values (concat('+',@a),concat('+',@a),concat('+',@a)); +Warnings: +Note 1265 Data truncated for column 'v' at row 1 +select concat('*',v,'*',c,'*',t,'*') from t1; +concat('*',v,'*',c,'*',t,'*') +*+ *+*+ * +*+ *+*+ * +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `v` varchar(10) DEFAULT NULL, + `c` char(10) DEFAULT NULL, + `t` text +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +create table t2 like t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `v` varchar(10) DEFAULT NULL, + `c` char(10) DEFAULT NULL, + `t` text +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +create table t3 select * from t1; +show create table t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `v` varchar(10) DEFAULT NULL, + `c` char(10) DEFAULT NULL, + `t` text +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +alter table t1 modify c varchar(10); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `v` varchar(10) DEFAULT NULL, + `c` varchar(10) DEFAULT NULL, + `t` text +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +alter table t1 modify v char(10); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `v` char(10) DEFAULT NULL, + `c` varchar(10) DEFAULT NULL, + `t` text +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +alter table t1 modify t varchar(10); +Warnings: +Note 1265 Data truncated for column 't' at row 2 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `v` char(10) DEFAULT NULL, + `c` varchar(10) DEFAULT NULL, + `t` varchar(10) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +select concat('*',v,'*',c,'*',t,'*') from t1; +concat('*',v,'*',c,'*',t,'*') +*+*+*+ * +*+*+*+ * +drop table t1,t2,t3; +create table t1 (v varchar(10), c char(10), t text, key(v), key(c), key(t(10))); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `v` varchar(10) DEFAULT NULL, + `c` char(10) DEFAULT NULL, + `t` text, + KEY `v` (`v`), + KEY `c` (`c`), + KEY `t` (`t`(10)) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +select count(*) from t1; +count(*) +270 +insert into t1 values(concat('a',char(1)),concat('a',char(1)),concat('a',char(1))); +select count(*) from t1 where v='a'; +count(*) +10 +select count(*) from t1 where c='a'; +count(*) +10 +select count(*) from t1 where t='a'; +count(*) +10 +select count(*) from t1 where v='a '; +count(*) +10 +select count(*) from t1 where c='a '; +count(*) +10 +select count(*) from t1 where t='a '; +count(*) +10 +select count(*) from t1 where v between 'a' and 'a '; +count(*) +10 +select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; +count(*) +10 +select count(*) from t1 where v like 'a%'; +count(*) +11 +select count(*) from t1 where c like 'a%'; +count(*) +11 +select count(*) from t1 where t like 'a%'; +count(*) +11 +select count(*) from t1 where v like 'a %'; +count(*) +9 +explain select count(*) from t1 where v='a '; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref v v 13 const # Using where; Using index +explain select count(*) from t1 where c='a '; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref c c 11 const # Using where; Using index +explain select count(*) from t1 where t='a '; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref t t 13 const # Using where +explain select count(*) from t1 where v like 'a%'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range v v 13 NULL # Using where; Using index +explain select count(*) from t1 where v between 'a' and 'a '; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref v v 13 const # Using where; Using index +explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref v v 13 const # Using where; Using index +alter table t1 add unique(v); +ERROR 23000: Duplicate entry '{ ' for key 'v_2' +alter table t1 add key(v); +select concat('*',v,'*',c,'*',t,'*') as qq from t1 where v='a'; +qq +*a*a*a* +*a *a*a * +*a *a*a * +*a *a*a * +*a *a*a * +*a *a*a * +*a *a*a * +*a *a*a * +*a *a*a * +*a *a*a * +explain select * from t1 where v='a'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref v,v_2 # 13 const # Using where +select v,count(*) from t1 group by v limit 10; +v count(*) +a 1 +a 10 +b 10 +c 10 +d 10 +e 10 +f 10 +g 10 +h 10 +i 10 +select v,count(t) from t1 group by v limit 10; +v count(t) +a 1 +a 10 +b 10 +c 10 +d 10 +e 10 +f 10 +g 10 +h 10 +i 10 +select v,count(c) from t1 group by v limit 10; +v count(c) +a 1 +a 10 +b 10 +c 10 +d 10 +e 10 +f 10 +g 10 +h 10 +i 10 +select sql_big_result v,count(t) from t1 group by v limit 10; +v count(t) +a 1 +a 10 +b 10 +c 10 +d 10 +e 10 +f 10 +g 10 +h 10 +i 10 +select sql_big_result v,count(c) from t1 group by v limit 10; +v count(c) +a 1 +a 10 +b 10 +c 10 +d 10 +e 10 +f 10 +g 10 +h 10 +i 10 +select c,count(*) from t1 group by c limit 10; +c count(*) +a 1 +a 10 +b 10 +c 10 +d 10 +e 10 +f 10 +g 10 +h 10 +i 10 +select c,count(t) from t1 group by c limit 10; +c count(t) +a 1 +a 10 +b 10 +c 10 +d 10 +e 10 +f 10 +g 10 +h 10 +i 10 +select sql_big_result c,count(t) from t1 group by c limit 10; +c count(t) +a 1 +a 10 +b 10 +c 10 +d 10 +e 10 +f 10 +g 10 +h 10 +i 10 +select t,count(*) from t1 group by t limit 10; +t count(*) +a 1 +a 10 +b 10 +c 10 +d 10 +e 10 +f 10 +g 10 +h 10 +i 10 +select t,count(t) from t1 group by t limit 10; +t count(t) +a 1 +a 10 +b 10 +c 10 +d 10 +e 10 +f 10 +g 10 +h 10 +i 10 +select sql_big_result t,count(t) from t1 group by t limit 10; +t count(t) +a 1 +a 10 +b 10 +c 10 +d 10 +e 10 +f 10 +g 10 +h 10 +i 10 +alter table t1 modify v varchar(300), drop key v, drop key v_2, add key v (v); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `v` varchar(300) DEFAULT NULL, + `c` char(10) DEFAULT NULL, + `t` text, + KEY `c` (`c`), + KEY `t` (`t`(10)), + KEY `v` (`v`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +select count(*) from t1 where v='a'; +count(*) +10 +select count(*) from t1 where v='a '; +count(*) +10 +select count(*) from t1 where v between 'a' and 'a '; +count(*) +10 +select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; +count(*) +10 +select count(*) from t1 where v like 'a%'; +count(*) +11 +select count(*) from t1 where v like 'a %'; +count(*) +9 +explain select count(*) from t1 where v='a '; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref v v 303 const # Using where; Using index +explain select count(*) from t1 where v like 'a%'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range v v 303 NULL # Using where; Using index +explain select count(*) from t1 where v between 'a' and 'a '; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref v v 303 const # Using where; Using index +explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref v v 303 const # Using where; Using index +explain select * from t1 where v='a'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref v v 303 const # Using where +select v,count(*) from t1 group by v limit 10; +v count(*) +a 1 +a 10 +b 10 +c 10 +d 10 +e 10 +f 10 +g 10 +h 10 +i 10 +select v,count(t) from t1 group by v limit 10; +v count(t) +a 1 +a 10 +b 10 +c 10 +d 10 +e 10 +f 10 +g 10 +h 10 +i 10 +select sql_big_result v,count(t) from t1 group by v limit 10; +v count(t) +a 1 +a 10 +b 10 +c 10 +d 10 +e 10 +f 10 +g 10 +h 10 +i 10 +alter table t1 drop key v, add key v (v(30)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `v` varchar(300) DEFAULT NULL, + `c` char(10) DEFAULT NULL, + `t` text, + KEY `c` (`c`), + KEY `t` (`t`(10)), + KEY `v` (`v`(30)) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +select count(*) from t1 where v='a'; +count(*) +10 +select count(*) from t1 where v='a '; +count(*) +10 +select count(*) from t1 where v between 'a' and 'a '; +count(*) +10 +select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; +count(*) +10 +select count(*) from t1 where v like 'a%'; +count(*) +11 +select count(*) from t1 where v like 'a %'; +count(*) +9 +explain select count(*) from t1 where v='a '; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref v v 33 const # Using where +explain select count(*) from t1 where v like 'a%'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range v v 33 NULL # Using where +explain select count(*) from t1 where v between 'a' and 'a '; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref v v 33 const # Using where +explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref v v 33 const # Using where +explain select * from t1 where v='a'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref v v 33 const # Using where +select v,count(*) from t1 group by v limit 10; +v count(*) +a 1 +a 10 +b 10 +c 10 +d 10 +e 10 +f 10 +g 10 +h 10 +i 10 +select v,count(t) from t1 group by v limit 10; +v count(t) +a 1 +a 10 +b 10 +c 10 +d 10 +e 10 +f 10 +g 10 +h 10 +i 10 +select sql_big_result v,count(t) from t1 group by v limit 10; +v count(t) +a 1 +a 10 +b 10 +c 10 +d 10 +e 10 +f 10 +g 10 +h 10 +i 10 +alter table t1 modify v varchar(600), drop key v, add key v (v); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `v` varchar(600) DEFAULT NULL, + `c` char(10) DEFAULT NULL, + `t` text, + KEY `c` (`c`), + KEY `t` (`t`(10)), + KEY `v` (`v`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +select v,count(*) from t1 group by v limit 10; +v count(*) +a 1 +a 10 +b 10 +c 10 +d 10 +e 10 +f 10 +g 10 +h 10 +i 10 +select v,count(t) from t1 group by v limit 10; +v count(t) +a 1 +a 10 +b 10 +c 10 +d 10 +e 10 +f 10 +g 10 +h 10 +i 10 +select sql_big_result v,count(t) from t1 group by v limit 10; +v count(t) +a 1 +a 10 +b 10 +c 10 +d 10 +e 10 +f 10 +g 10 +h 10 +i 10 +drop table t1; +create table t1 (a char(10), unique (a)); +insert into t1 values ('a '); +insert into t1 values ('a '); +ERROR 23000: Duplicate entry 'a' for key 'a' +alter table t1 modify a varchar(10); +insert into t1 values ('a '),('a '),('a '),('a '); +ERROR 23000: Duplicate entry 'a ' for key 'a' +insert into t1 values ('a '); +ERROR 23000: Duplicate entry 'a ' for key 'a' +insert into t1 values ('a '); +ERROR 23000: Duplicate entry 'a ' for key 'a' +insert into t1 values ('a '); +ERROR 23000: Duplicate entry 'a ' for key 'a' +update t1 set a='a ' where a like 'a%'; +select concat(a,'.') from t1; +concat(a,'.') +a . +update t1 set a='abc ' where a like 'a '; +select concat(a,'.') from t1; +concat(a,'.') +a . +update t1 set a='a ' where a like 'a %'; +select concat(a,'.') from t1; +concat(a,'.') +a . +update t1 set a='a ' where a like 'a '; +select concat(a,'.') from t1; +concat(a,'.') +a . +drop table t1; +create table t1 (v varchar(10), c char(10), t text, key(v(5)), key(c(5)), key(t(5))); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `v` varchar(10) DEFAULT NULL, + `c` char(10) DEFAULT NULL, + `t` text, + KEY `v` (`v`(5)), + KEY `c` (`c`(5)), + KEY `t` (`t`(5)) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t1; +create table t1 (v char(10) character set utf8); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `v` char(10) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t1; +create table t1 (v varchar(10), c char(10)) row_format=fixed; +Warnings: +Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT. +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `v` varchar(10) DEFAULT NULL, + `c` char(10) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED +insert into t1 values('a','a'),('a ','a '); +select concat('*',v,'*',c,'*') from t1; +concat('*',v,'*',c,'*') +*a*a* +*a *a* +drop table t1; +create table t1 (v varchar(65530), key(v(10))); +insert into t1 values(repeat('a',65530)); +select length(v) from t1 where v=repeat('a',65530); +length(v) +65530 +drop table t1; +create table t1(a int, b varchar(12), key ba(b, a)); +insert into t1 values (1, 'A'), (20, NULL); +explain select * from t1 where a=20 and b is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref ba ba 20 const,const 1 Using where; Using index +select * from t1 where a=20 and b is null; +a b +20 NULL +drop table t1; +set session old_alter_table=0; +create table t1 (v varchar(65530), key(v)); +Warnings: +Warning 1071 Specified key was too long; max key length is 767 bytes +drop table t1; +create table t1 (v varchar(65536)); +Warnings: +Note 1246 Converting column 'v' from VARCHAR to TEXT +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `v` mediumtext +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t1; +create table t1 (v varchar(65530) character set utf8); +Warnings: +Note 1246 Converting column 'v' from VARCHAR to TEXT +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `v` mediumtext CHARACTER SET utf8 +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t1; +set storage_engine=MyISAM; +create table t1 (v varchar(16384)) engine=innodb; +drop table t1; +create table t1 (a char(1), b char(1), key(a, b)) engine=innodb; +insert into t1 values ('8', '6'), ('4', '7'); +select min(a) from t1; +min(a) +4 +select min(b) from t1 where a='8'; +min(b) +6 +drop table t1; +CREATE TABLE t1 ( `a` int(11) NOT NULL auto_increment, `b` int(11) default NULL,PRIMARY KEY (`a`),UNIQUE KEY `b` (`b`)) ENGINE=innodb; +insert into t1 (b) values (1); +replace into t1 (b) values (2), (1), (3); +select * from t1; +a b +3 1 +2 2 +4 3 +truncate table t1; +insert into t1 (b) values (1); +replace into t1 (b) values (2); +replace into t1 (b) values (1); +replace into t1 (b) values (3); +select * from t1; +a b +3 1 +2 2 +4 3 +drop table t1; +create table t1 (rowid int not null auto_increment, val int not null,primary +key (rowid), unique(val)) engine=innodb; +replace into t1 (val) values ('1'),('2'); +replace into t1 (val) values ('1'),('2'); +insert into t1 (val) values ('1'),('2'); +ERROR 23000: Duplicate entry '1' for key 'val' +select * from t1; +rowid val +3 1 +4 2 +drop table t1; +create table t1 (a int not null auto_increment primary key, val int) engine=InnoDB; +insert into t1 (val) values (1); +update t1 set a=2 where a=1; +insert into t1 (val) values (1); +ERROR 23000: Duplicate entry '2' for key 'PRIMARY' +select * from t1; +a val +2 1 +drop table t1; +CREATE TABLE t1 (GRADE DECIMAL(4) NOT NULL, PRIMARY KEY (GRADE)) ENGINE=INNODB; +INSERT INTO t1 (GRADE) VALUES (151),(252),(343); +SELECT GRADE FROM t1 WHERE GRADE > 160 AND GRADE < 300; +GRADE +252 +SELECT GRADE FROM t1 WHERE GRADE= 151; +GRADE +151 +DROP TABLE t1; +create table t1 (f1 varchar(10), f2 varchar(10), primary key (f1,f2)) engine=innodb; +create table t2 (f3 varchar(10), f4 varchar(10), key (f4)) engine=innodb; +insert into t2 values ('aa','cc'); +insert into t1 values ('aa','bb'),('aa','cc'); +delete t1 from t1,t2 where f1=f3 and f4='cc'; +select * from t1; +f1 f2 +drop table t1,t2; +CREATE TABLE t1 ( +id INTEGER NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) +) ENGINE=InnoDB; +CREATE TABLE t2 ( +id INTEGER NOT NULL, +FOREIGN KEY (id) REFERENCES t1 (id) +) ENGINE=InnoDB; +INSERT INTO t1 (id) VALUES (NULL); +SELECT * FROM t1; +id +1 +TRUNCATE t1; +INSERT INTO t1 (id) VALUES (NULL); +SELECT * FROM t1; +id +1 +DELETE FROM t1; +TRUNCATE t1; +INSERT INTO t1 (id) VALUES (NULL); +SELECT * FROM t1; +id +1 +DROP TABLE t2, t1; +CREATE TABLE t1 +( +id INT PRIMARY KEY +) ENGINE=InnoDB; +CREATE TEMPORARY TABLE t2 +( +id INT NOT NULL PRIMARY KEY, +b INT, +FOREIGN KEY (b) REFERENCES test.t1(id) +) ENGINE=InnoDB; +Got one of the listed errors +DROP TABLE t1; +create table t1 (col1 varchar(2000), index (col1(767))) +character set = latin1 engine = innodb; +create table t2 (col1 char(255), index (col1)) +character set = latin1 engine = innodb; +create table t3 (col1 binary(255), index (col1)) +character set = latin1 engine = innodb; +create table t4 (col1 varchar(767), index (col1)) +character set = latin1 engine = innodb; +create table t5 (col1 varchar(767) primary key) +character set = latin1 engine = innodb; +create table t6 (col1 varbinary(767) primary key) +character set = latin1 engine = innodb; +create table t7 (col1 text, index(col1(767))) +character set = latin1 engine = innodb; +create table t8 (col1 blob, index(col1(767))) +character set = latin1 engine = innodb; +create table t9 (col1 varchar(512), col2 varchar(512), index(col1, col2)) +character set = latin1 engine = innodb; +show create table t9; +Table Create Table +t9 CREATE TABLE `t9` ( + `col1` varchar(512) DEFAULT NULL, + `col2` varchar(512) DEFAULT NULL, + KEY `col1` (`col1`,`col2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t1, t2, t3, t4, t5, t6, t7, t8, t9; +create table t1 (col1 varchar(768), index(col1)) +character set = latin1 engine = innodb; +Warnings: +Warning 1071 Specified key was too long; max key length is 767 bytes +create table t2 (col1 varbinary(768), index(col1)) +character set = latin1 engine = innodb; +Warnings: +Warning 1071 Specified key was too long; max key length is 767 bytes +create table t3 (col1 text, index(col1(768))) +character set = latin1 engine = innodb; +Warnings: +Warning 1071 Specified key was too long; max key length is 767 bytes +create table t4 (col1 blob, index(col1(768))) +character set = latin1 engine = innodb; +Warnings: +Warning 1071 Specified key was too long; max key length is 767 bytes +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `col1` varchar(768) DEFAULT NULL, + KEY `col1` (`col1`(767)) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t1, t2, t3, t4; +create table t1 (col1 varchar(768) primary key) +character set = latin1 engine = innodb; +ERROR 42000: Specified key was too long; max key length is 767 bytes +create table t2 (col1 varbinary(768) primary key) +character set = latin1 engine = innodb; +ERROR 42000: Specified key was too long; max key length is 767 bytes +create table t3 (col1 text, primary key(col1(768))) +character set = latin1 engine = innodb; +ERROR 42000: Specified key was too long; max key length is 767 bytes +create table t4 (col1 blob, primary key(col1(768))) +character set = latin1 engine = innodb; +ERROR 42000: Specified key was too long; max key length is 767 bytes +CREATE TABLE t1 +( +id INT PRIMARY KEY +) ENGINE=InnoDB; +CREATE TABLE t2 +( +v INT, +CONSTRAINT c1 FOREIGN KEY (v) REFERENCES t1(id) +) ENGINE=InnoDB; +INSERT INTO t2 VALUES(2); +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`)) +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1); +DELETE FROM t1 WHERE id = 1; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`)) +DROP TABLE t1; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails +SET FOREIGN_KEY_CHECKS=0; +DROP TABLE t1; +SET FOREIGN_KEY_CHECKS=1; +INSERT INTO t2 VALUES(3); +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`)) +DROP TABLE t2; +create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1; +insert into t1 values (1),(2); +set autocommit=0; +checksum table t1; +Table Checksum +test.t1 1531596814 +insert into t1 values(3); +checksum table t1; +Table Checksum +test.t1 1531596814 +commit; +checksum table t1; +Table Checksum +test.t1 2050879373 +commit; +drop table t1; +create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1; +insert into t1 values (1),(2); +set autocommit=1; +checksum table t1; +Table Checksum +test.t1 1531596814 +set autocommit=1; +insert into t1 values(3); +checksum table t1; +Table Checksum +test.t1 2050879373 +drop table t1; +set foreign_key_checks=0; +create table t2 (a int primary key, b int, foreign key (b) references t1(a)) engine = innodb; +create table t1(a char(10) primary key, b varchar(20)) engine = innodb; +ERROR HY000: Can't create table 'test.t1' (errno: 150) +set foreign_key_checks=1; +drop table t2; +set foreign_key_checks=0; +create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1; +create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=utf8; +ERROR HY000: Can't create table 'test.t2' (errno: 150) +set foreign_key_checks=1; +drop table t1; +set foreign_key_checks=0; +create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb; +create table t1(a varchar(10) primary key) engine = innodb; +alter table t1 modify column a int; +Got one of the listed errors +set foreign_key_checks=1; +drop table t2,t1; +set foreign_key_checks=0; +create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1; +create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1; +alter table t1 convert to character set utf8; +set foreign_key_checks=1; +drop table t2,t1; +set foreign_key_checks=0; +create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1; +create table t3(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=utf8; +rename table t3 to t1; +ERROR HY000: Error on rename of './test/t3' to './test/t1' (errno: 150) +set foreign_key_checks=1; +drop table t2,t3; +create table t1(a int primary key) row_format=redundant engine=innodb; +create table t2(a int primary key,constraint foreign key(a)references t1(a)) row_format=compact engine=innodb; +create table t3(a int primary key) row_format=compact engine=innodb; +create table t4(a int primary key,constraint foreign key(a)references t3(a)) row_format=redundant engine=innodb; +insert into t1 values(1); +insert into t3 values(1); +insert into t2 values(2); +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`)) +insert into t4 values(2); +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t4`, CONSTRAINT `t4_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t3` (`a`)) +insert into t2 values(1); +insert into t4 values(1); +update t1 set a=2; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`)) +update t2 set a=2; +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`)) +update t3 set a=2; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t4`, CONSTRAINT `t4_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t3` (`a`)) +update t4 set a=2; +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t4`, CONSTRAINT `t4_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t3` (`a`)) +truncate t1; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`)) +truncate t3; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t4`, CONSTRAINT `t4_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t3` (`a`)) +truncate t2; +truncate t4; +truncate t1; +truncate t3; +drop table t4,t3,t2,t1; +create table t1 (a varchar(255) character set utf8, +b varchar(255) character set utf8, +c varchar(255) character set utf8, +d varchar(255) character set utf8, +key (a,b,c,d)) engine=innodb; +drop table t1; +create table t1 (a varchar(255) character set utf8, +b varchar(255) character set utf8, +c varchar(255) character set utf8, +d varchar(255) character set utf8, +e varchar(255) character set utf8, +key (a,b,c,d,e)) engine=innodb; +ERROR 42000: Specified key was too long; max key length is 3072 bytes +create table t1 (s1 varbinary(2),primary key (s1)) engine=innodb; +create table t2 (s1 binary(2),primary key (s1)) engine=innodb; +create table t3 (s1 varchar(2) binary,primary key (s1)) engine=innodb; +create table t4 (s1 char(2) binary,primary key (s1)) engine=innodb; +insert into t1 values (0x41),(0x4120),(0x4100); +insert into t2 values (0x41),(0x4120),(0x4100); +ERROR 23000: Duplicate entry 'A' for key 'PRIMARY' +insert into t2 values (0x41),(0x4120); +insert into t3 values (0x41),(0x4120),(0x4100); +ERROR 23000: Duplicate entry 'A ' for key 'PRIMARY' +insert into t3 values (0x41),(0x4100); +insert into t4 values (0x41),(0x4120),(0x4100); +ERROR 23000: Duplicate entry 'A' for key 'PRIMARY' +insert into t4 values (0x41),(0x4100); +select hex(s1) from t1; +hex(s1) +41 +4100 +4120 +select hex(s1) from t2; +hex(s1) +4100 +4120 +select hex(s1) from t3; +hex(s1) +4100 +41 +select hex(s1) from t4; +hex(s1) +4100 +41 +drop table t1,t2,t3,t4; +create table t1 (a int primary key,s1 varbinary(3) not null unique) engine=innodb; +create table t2 (s1 binary(2) not null, constraint c foreign key(s1) references t1(s1) on update cascade) engine=innodb; +insert into t1 values(1,0x4100),(2,0x41),(3,0x4120),(4,0x42); +insert into t2 values(0x42); +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE) +insert into t2 values(0x41); +select hex(s1) from t2; +hex(s1) +4100 +update t1 set s1=0x123456 where a=2; +select hex(s1) from t2; +hex(s1) +4100 +update t1 set s1=0x12 where a=1; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE) +update t1 set s1=0x12345678 where a=1; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE) +update t1 set s1=0x123457 where a=1; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE) +update t1 set s1=0x1220 where a=1; +select hex(s1) from t2; +hex(s1) +1220 +update t1 set s1=0x1200 where a=1; +select hex(s1) from t2; +hex(s1) +1200 +update t1 set s1=0x4200 where a=1; +select hex(s1) from t2; +hex(s1) +4200 +delete from t1 where a=1; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE) +delete from t1 where a=2; +update t2 set s1=0x4120; +delete from t1; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE) +delete from t1 where a!=3; +select a,hex(s1) from t1; +a hex(s1) +3 4120 +select hex(s1) from t2; +hex(s1) +4120 +drop table t2,t1; +create table t1 (a int primary key,s1 varchar(2) binary not null unique) engine=innodb; +create table t2 (s1 char(2) binary not null, constraint c foreign key(s1) references t1(s1) on update cascade) engine=innodb; +insert into t1 values(1,0x4100),(2,0x41); +insert into t2 values(0x41); +select hex(s1) from t2; +hex(s1) +41 +update t1 set s1=0x1234 where a=1; +select hex(s1) from t2; +hex(s1) +41 +update t1 set s1=0x12 where a=2; +select hex(s1) from t2; +hex(s1) +12 +delete from t1 where a=1; +delete from t1 where a=2; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE) +select a,hex(s1) from t1; +a hex(s1) +2 12 +select hex(s1) from t2; +hex(s1) +12 +drop table t2,t1; +CREATE TABLE t1(a INT, PRIMARY KEY(a)) ENGINE=InnoDB; +CREATE TABLE t2(a INT) ENGINE=InnoDB; +ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1(a); +ALTER TABLE t2 DROP FOREIGN KEY t2_ibfk_1; +ALTER TABLE t2 ADD CONSTRAINT t2_ibfk_0 FOREIGN KEY (a) REFERENCES t1(a); +ALTER TABLE t2 DROP FOREIGN KEY t2_ibfk_0; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + KEY `t2_ibfk_0` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +DROP TABLE t2,t1; +CREATE TABLE t1 ( +field1 varchar(8) NOT NULL DEFAULT '', +field2 varchar(8) NOT NULL DEFAULT '', +PRIMARY KEY (field1, field2) +) ENGINE=InnoDB; +CREATE TABLE t2 ( +field1 varchar(8) NOT NULL DEFAULT '' PRIMARY KEY, +FOREIGN KEY (field1) REFERENCES t1 (field1) +ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB; +INSERT INTO t1 VALUES ('old', 'somevalu'); +INSERT INTO t1 VALUES ('other', 'anyvalue'); +INSERT INTO t2 VALUES ('old'); +INSERT INTO t2 VALUES ('other'); +UPDATE t1 SET field1 = 'other' WHERE field2 = 'somevalu'; +ERROR 23000: Upholding foreign key constraints for table 't1', entry 'other-somevalu', key 1 would lead to a duplicate entry +DROP TABLE t2; +DROP TABLE t1; +create table t1 ( +c1 bigint not null, +c2 bigint not null, +primary key (c1), +unique key (c2) +) engine=innodb; +create table t2 ( +c1 bigint not null, +primary key (c1) +) engine=innodb; +alter table t1 add constraint c2_fk foreign key (c2) +references t2(c1) on delete cascade; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` bigint(20) NOT NULL, + `c2` bigint(20) NOT NULL, + PRIMARY KEY (`c1`), + UNIQUE KEY `c2` (`c2`), + CONSTRAINT `c2_fk` FOREIGN KEY (`c2`) REFERENCES `t2` (`c1`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +alter table t1 drop foreign key c2_fk; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` bigint(20) NOT NULL, + `c2` bigint(20) NOT NULL, + PRIMARY KEY (`c1`), + UNIQUE KEY `c2` (`c2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1(a date) engine=innodb; +create table t2(a date, key(a)) engine=innodb; +insert into t1 values('2005-10-01'); +insert into t2 values('2005-10-01'); +select * from t1, t2 +where t2.a between t1.a - interval 2 day and t1.a + interval 2 day; +a a +2005-10-01 2005-10-01 +drop table t1, t2; +create table t1 (id int not null, f_id int not null, f int not null, +primary key(f_id, id)) engine=innodb; +create table t2 (id int not null,s_id int not null,s varchar(200), +primary key(id)) engine=innodb; +INSERT INTO t1 VALUES (8, 1, 3); +INSERT INTO t1 VALUES (1, 2, 1); +INSERT INTO t2 VALUES (1, 0, ''); +INSERT INTO t2 VALUES (8, 1, ''); +commit; +DELETE ml.* FROM t1 AS ml LEFT JOIN t2 AS mm ON (mm.id=ml.id) +WHERE mm.id IS NULL; +select ml.* from t1 as ml left join t2 as mm on (mm.id=ml.id) +where mm.id is null lock in share mode; +id f_id f +drop table t1,t2; +create table t1(a int not null, b int, primary key(a)) engine=innodb; +insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2),(7,3); +commit; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +update t1 set b = 5 where b = 1; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +select * from t1 where a = 7 and b = 3 for update; +a b +7 3 +commit; +commit; +drop table t1; +create table t1(a int not null, b int, primary key(a)) engine=innodb; +insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2); +commit; +set autocommit = 0; +select * from t1 lock in share mode; +a b +1 1 +2 2 +3 1 +4 2 +5 1 +6 2 +update t1 set b = 5 where b = 1; +set autocommit = 0; +select * from t1 where a = 2 and b = 2 for update; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +commit; +commit; +drop table t1; +create table t1(a int not null, b int, primary key(a)) engine=innodb; +insert into t1 values (1,2),(5,3),(4,2); +create table t2(d int not null, e int, primary key(d)) engine=innodb; +insert into t2 values (8,6),(12,1),(3,1); +commit; +set autocommit = 0; +select * from t2 for update; +d e +3 1 +8 6 +12 1 +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +insert into t1 select * from t2; +update t1 set b = (select e from t2 where a = d); +create table t3(d int not null, e int, primary key(d)) engine=innodb +select * from t2; +commit; +commit; +drop table t1, t2, t3; +create table t1(a int not null, b int, primary key(a)) engine=innodb; +insert into t1 values (1,2),(5,3),(4,2); +create table t2(a int not null, b int, primary key(a)) engine=innodb; +insert into t2 values (8,6),(12,1),(3,1); +create table t3(d int not null, b int, primary key(d)) engine=innodb; +insert into t3 values (8,6),(12,1),(3,1); +create table t5(a int not null, b int, primary key(a)) engine=innodb; +insert into t5 values (1,2),(5,3),(4,2); +create table t6(d int not null, e int, primary key(d)) engine=innodb; +insert into t6 values (8,6),(12,1),(3,1); +create table t8(a int not null, b int, primary key(a)) engine=innodb; +insert into t8 values (1,2),(5,3),(4,2); +create table t9(d int not null, e int, primary key(d)) engine=innodb; +insert into t9 values (8,6),(12,1),(3,1); +commit; +set autocommit = 0; +select * from t2 for update; +a b +3 1 +8 6 +12 1 +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; +insert into t1 select * from t2; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; +update t3 set b = (select b from t2 where a = d); +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; +create table t4(a int not null, b int, primary key(a)) engine=innodb select * from t2; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +insert into t5 (select * from t2 lock in share mode); +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +update t6 set e = (select b from t2 where a = d lock in share mode); +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +create table t7(a int not null, b int, primary key(a)) engine=innodb select * from t2 lock in share mode; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +insert into t8 (select * from t2 for update); +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +update t9 set e = (select b from t2 where a = d for update); +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +create table t10(a int not null, b int, primary key(a)) engine=innodb select * from t2 for update; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +commit; +drop table t1, t2, t3, t5, t6, t8, t9; +CREATE TABLE t1 (DB_ROW_ID int) engine=innodb; +ERROR 42000: Incorrect column name 'DB_ROW_ID' +CREATE TABLE t1 ( +a BIGINT(20) NOT NULL, +PRIMARY KEY (a) +) ENGINE=INNODB DEFAULT CHARSET=UTF8; +CREATE TABLE t2 ( +a BIGINT(20) NOT NULL, +b VARCHAR(128) NOT NULL, +c TEXT NOT NULL, +PRIMARY KEY (a,b), +KEY idx_t2_b_c (b,c(200)), +CONSTRAINT t_fk FOREIGN KEY (a) REFERENCES t1 (a) +ON DELETE CASCADE +) ENGINE=INNODB DEFAULT CHARSET=UTF8; +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (1, 'bar', 'vbar'); +INSERT INTO t2 VALUES (1, 'BAR2', 'VBAR'); +INSERT INTO t2 VALUES (1, 'bar_bar', 'bibi'); +INSERT INTO t2 VALUES (1, 'customer_over', '1'); +SELECT * FROM t2 WHERE b = 'customer_over'; +a b c +1 customer_over 1 +SELECT * FROM t2 WHERE BINARY b = 'customer_over'; +a b c +1 customer_over 1 +SELECT DISTINCT p0.a FROM t2 p0 WHERE p0.b = 'customer_over'; +a +1 +/* Bang: Empty result set, above was expected: */ +SELECT DISTINCT p0.a FROM t2 p0 WHERE BINARY p0.b = 'customer_over'; +a +1 +SELECT p0.a FROM t2 p0 WHERE BINARY p0.b = 'customer_over'; +a +1 +drop table t2, t1; +CREATE TABLE t1 ( a int ) ENGINE=innodb; +BEGIN; +INSERT INTO t1 VALUES (1); +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +DROP TABLE t1; +CREATE TABLE t1 (id int PRIMARY KEY, f int NOT NULL, INDEX(f)) ENGINE=InnoDB; +CREATE TABLE t2 (id int PRIMARY KEY, f INT NOT NULL, +CONSTRAINT t2_t1 FOREIGN KEY (id) REFERENCES t1 (id) +ON DELETE CASCADE ON UPDATE CASCADE) ENGINE=InnoDB; +ALTER TABLE t2 ADD FOREIGN KEY (f) REFERENCES t1 (f) ON +DELETE CASCADE ON UPDATE CASCADE; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL, + `f` int(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `f` (`f`), + CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`f`) REFERENCES `t1` (`f`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `t2_t1` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +DROP TABLE t2, t1; +CREATE TABLE t1 (a INT, INDEX(a)) ENGINE=InnoDB; +CREATE TABLE t2 (a INT, INDEX(a)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (1); +ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1 (a) ON DELETE SET NULL; +ALTER TABLE t2 MODIFY a INT NOT NULL; +ERROR HY000: Error on rename of '#sql-temporary' to './test/t2' (errno: 150) +DELETE FROM t1; +DROP TABLE t2,t1; +CREATE TABLE t1 (a VARCHAR(5) COLLATE utf8_unicode_ci PRIMARY KEY) +ENGINE=InnoDB; +INSERT INTO t1 VALUES (0xEFBCA4EFBCA4EFBCA4); +DELETE FROM t1; +INSERT INTO t1 VALUES ('DDD'); +SELECT * FROM t1; +a +DDD +DROP TABLE t1; +CREATE TABLE t1 (id int PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB +AUTO_INCREMENT=42; +INSERT INTO t1 VALUES (0),(347),(0); +SELECT * FROM t1; +id +42 +347 +348 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=349 DEFAULT CHARSET=latin1 +CREATE TABLE t2 (id int PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t2 VALUES(42),(347),(348); +ALTER TABLE t1 ADD CONSTRAINT t1_t2 FOREIGN KEY (id) REFERENCES t2(id); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`id`), + CONSTRAINT `t1_t2` FOREIGN KEY (`id`) REFERENCES `t2` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=349 DEFAULT CHARSET=latin1 +DROP TABLE t1,t2; +set innodb_strict_mode=on; +CREATE TABLE t1 ( +c01 CHAR(255), c02 CHAR(255), c03 CHAR(255), c04 CHAR(255), +c05 CHAR(255), c06 CHAR(255), c07 CHAR(255), c08 CHAR(255), +c09 CHAR(255), c10 CHAR(255), c11 CHAR(255), c12 CHAR(255), +c13 CHAR(255), c14 CHAR(255), c15 CHAR(255), c16 CHAR(255), +c17 CHAR(255), c18 CHAR(255), c19 CHAR(255), c20 CHAR(255), +c21 CHAR(255), c22 CHAR(255), c23 CHAR(255), c24 CHAR(255), +c25 CHAR(255), c26 CHAR(255), c27 CHAR(255), c28 CHAR(255), +c29 CHAR(255), c30 CHAR(255), c31 CHAR(255), c32 CHAR(255) +) ENGINE = InnoDB; +ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 't1' +CREATE TABLE t1( +id BIGINT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY +) ENGINE=InnoDB; +INSERT INTO t1 VALUES(-10); +SELECT * FROM t1; +id +-10 +INSERT INTO t1 VALUES(NULL); +SELECT * FROM t1; +id +-10 +1 +DROP TABLE t1; +SET binlog_format='MIXED'; +SET TX_ISOLATION='read-committed'; +SET AUTOCOMMIT=0; +DROP TABLE IF EXISTS t1, t2; +Warnings: +Note 1051 Unknown table 't1' +Note 1051 Unknown table 't2' +CREATE TABLE t1 ( a int ) ENGINE=InnoDB; +CREATE TABLE t2 LIKE t1; +SELECT * FROM t2; +a +SET binlog_format='MIXED'; +SET TX_ISOLATION='read-committed'; +SET AUTOCOMMIT=0; +INSERT INTO t1 VALUES (1); +COMMIT; +SELECT * FROM t1 WHERE a=1; +a +1 +SET binlog_format='MIXED'; +SET TX_ISOLATION='read-committed'; +SET AUTOCOMMIT=0; +SELECT * FROM t2; +a +SET binlog_format='MIXED'; +SET TX_ISOLATION='read-committed'; +SET AUTOCOMMIT=0; +INSERT INTO t1 VALUES (2); +COMMIT; +SELECT * FROM t1 WHERE a=2; +a +2 +SELECT * FROM t1 WHERE a=2; +a +2 +DROP TABLE t1; +DROP TABLE t2; +create table t1 (i int, j int) engine=innodb; +insert into t1 (i, j) values (1, 1), (2, 2); +update t1 set j = 2; +affected rows: 1 +info: Rows matched: 2 Changed: 1 Warnings: 0 +drop table t1; +create table t1 (id int) comment='this is a comment' engine=innodb; +select table_comment, data_free > 0 as data_free_is_set +from information_schema.tables +where table_schema='test' and table_name = 't1'; +table_comment data_free_is_set +this is a comment 1 +drop table t1; +CREATE TABLE t1 ( +c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, +c2 VARCHAR(128) NOT NULL, +PRIMARY KEY(c1) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=100; +CREATE TABLE t2 ( +c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, +c2 INT(10) UNSIGNED DEFAULT NULL, +PRIMARY KEY(c1) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=200; +SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't2'; +AUTO_INCREMENT +200 +ALTER TABLE t2 ADD CONSTRAINT t1_t2_1 FOREIGN KEY(c1) REFERENCES t1(c1); +SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't2'; +AUTO_INCREMENT +200 +DROP TABLE t2; +DROP TABLE t1; +CREATE TABLE t1 (c1 int default NULL, +c2 int default NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +TRUNCATE TABLE t1; +affected rows: 0 +INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5); +affected rows: 5 +info: Records: 5 Duplicates: 0 Warnings: 0 +TRUNCATE TABLE t1; +affected rows: 0 +DROP TABLE t1; +Variable_name Value +Handler_update 0 +Variable_name Value +Handler_delete 0 +Variable_name Value +Handler_update 1 +Variable_name Value +Handler_delete 1 diff --git a/mysql-test/suite/innodb/r/innodb_bug21704.result b/mysql-test/suite/innodb/r/innodb_bug21704.result new file mode 100644 index 00000000000..ffbfa8a337e --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug21704.result @@ -0,0 +1,55 @@ +# +# Bug#21704: Renaming column does not update FK definition. +# + +# Test that it's not possible to rename columns participating in a +# foreign key (either in the referencing or referenced table). + +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; +DROP TABLE IF EXISTS t3; +CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ROW_FORMAT=COMPACT ENGINE=INNODB; +CREATE TABLE t2 (a INT PRIMARY KEY, b INT, +CONSTRAINT fk1 FOREIGN KEY (a) REFERENCES t1(a)) +ROW_FORMAT=COMPACT ENGINE=INNODB; +CREATE TABLE t3 (a INT PRIMARY KEY, b INT, KEY(b), C INT, +CONSTRAINT fk2 FOREIGN KEY (b) REFERENCES t3 (a)) +ROW_FORMAT=COMPACT ENGINE=INNODB; +INSERT INTO t1 VALUES (1,1),(2,2),(3,3); +INSERT INTO t2 VALUES (1,1),(2,2),(3,3); +INSERT INTO t3 VALUES (1,1,1),(2,2,2),(3,3,3); + +# Test renaming the column in the referenced table. + +ALTER TABLE t1 CHANGE a c INT; +ERROR HY000: Error on rename of '#sql-temporary' to './test/t1' (errno: 150) +# Ensure that online column rename works. +ALTER TABLE t1 CHANGE b c INT; +affected rows: 3 +info: Records: 3 Duplicates: 0 Warnings: 0 + +# Test renaming the column in the referencing table + +ALTER TABLE t2 CHANGE a c INT; +ERROR HY000: Error on rename of '#sql-temporary' to './test/t2' (errno: 150) +# Ensure that online column rename works. +ALTER TABLE t2 CHANGE b c INT; +affected rows: 3 +info: Records: 3 Duplicates: 0 Warnings: 0 + +# Test with self-referential constraints + +ALTER TABLE t3 CHANGE a d INT; +ERROR HY000: Error on rename of '#sql-temporary' to './test/t3' (errno: 150) +ALTER TABLE t3 CHANGE b d INT; +ERROR HY000: Error on rename of '#sql-temporary' to './test/t3' (errno: 150) +# Ensure that online column rename works. +ALTER TABLE t3 CHANGE c d INT; +affected rows: 3 +info: Records: 3 Duplicates: 0 Warnings: 0 + +# Cleanup. + +DROP TABLE t3; +DROP TABLE t2; +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/r/innodb_bug34053.result b/mysql-test/suite/innodb/r/innodb_bug34053.result new file mode 100644 index 00000000000..195775f74c8 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug34053.result @@ -0,0 +1 @@ +SET storage_engine=InnoDB; diff --git a/mysql-test/suite/innodb/r/innodb_bug34300.result b/mysql-test/suite/innodb/r/innodb_bug34300.result new file mode 100644 index 00000000000..ae9fee81ad7 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug34300.result @@ -0,0 +1,4 @@ +f4 f8 +xxx zzz +f4 f8 +xxx zzz diff --git a/mysql-test/suite/innodb/r/innodb_bug35220.result b/mysql-test/suite/innodb/r/innodb_bug35220.result new file mode 100644 index 00000000000..195775f74c8 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug35220.result @@ -0,0 +1 @@ +SET storage_engine=InnoDB; diff --git a/mysql-test/suite/innodb/r/innodb_bug38231.result b/mysql-test/suite/innodb/r/innodb_bug38231.result new file mode 100644 index 00000000000..195775f74c8 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug38231.result @@ -0,0 +1 @@ +SET storage_engine=InnoDB; diff --git a/mysql-test/suite/innodb/r/innodb_bug39438.result b/mysql-test/suite/innodb/r/innodb_bug39438.result new file mode 100644 index 00000000000..195775f74c8 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug39438.result @@ -0,0 +1 @@ +SET storage_engine=InnoDB; diff --git a/mysql-test/suite/innodb/r/innodb_bug40565.result b/mysql-test/suite/innodb/r/innodb_bug40565.result new file mode 100644 index 00000000000..21e923d9336 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug40565.result @@ -0,0 +1,9 @@ +create table bug40565(value decimal(4,2)) engine=innodb; +insert into bug40565 values (1), (null); +update bug40565 set value=NULL; +affected rows: 1 +info: Rows matched: 2 Changed: 1 Warnings: 0 +update bug40565 set value=NULL; +affected rows: 0 +info: Rows matched: 2 Changed: 0 Warnings: 0 +drop table bug40565; diff --git a/mysql-test/suite/innodb/r/innodb_bug42101-nonzero.result b/mysql-test/suite/innodb/r/innodb_bug42101-nonzero.result new file mode 100644 index 00000000000..f43cb9da239 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug42101-nonzero.result @@ -0,0 +1,26 @@ +set global innodb_commit_concurrency=0; +ERROR 42000: Variable 'innodb_commit_concurrency' can't be set to the value of '0' +select @@innodb_commit_concurrency; +@@innodb_commit_concurrency +1 +set global innodb_commit_concurrency=1; +select @@innodb_commit_concurrency; +@@innodb_commit_concurrency +1 +set global innodb_commit_concurrency=42; +select @@innodb_commit_concurrency; +@@innodb_commit_concurrency +42 +set global innodb_commit_concurrency=DEFAULT; +select @@innodb_commit_concurrency; +@@innodb_commit_concurrency +1 +set global innodb_commit_concurrency=0; +ERROR 42000: Variable 'innodb_commit_concurrency' can't be set to the value of '0' +select @@innodb_commit_concurrency; +@@innodb_commit_concurrency +1 +set global innodb_commit_concurrency=1; +select @@innodb_commit_concurrency; +@@innodb_commit_concurrency +1 diff --git a/mysql-test/suite/innodb/r/innodb_bug42101.result b/mysql-test/suite/innodb/r/innodb_bug42101.result new file mode 100644 index 00000000000..4e3367d5a54 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug42101.result @@ -0,0 +1,22 @@ +set global innodb_commit_concurrency=0; +select @@innodb_commit_concurrency; +@@innodb_commit_concurrency +0 +set global innodb_commit_concurrency=1; +ERROR 42000: Variable 'innodb_commit_concurrency' can't be set to the value of '1' +select @@innodb_commit_concurrency; +@@innodb_commit_concurrency +0 +set global innodb_commit_concurrency=42; +ERROR 42000: Variable 'innodb_commit_concurrency' can't be set to the value of '42' +select @@innodb_commit_concurrency; +@@innodb_commit_concurrency +0 +set global innodb_commit_concurrency=0; +select @@innodb_commit_concurrency; +@@innodb_commit_concurrency +0 +set global innodb_commit_concurrency=DEFAULT; +select @@innodb_commit_concurrency; +@@innodb_commit_concurrency +0 diff --git a/mysql-test/suite/innodb/r/innodb_bug44369.result b/mysql-test/suite/innodb/r/innodb_bug44369.result new file mode 100644 index 00000000000..ff25c774aa2 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug44369.result @@ -0,0 +1,6 @@ +create table bug44369 (DB_ROW_ID int) engine=innodb; +ERROR 42000: Incorrect column name 'DB_ROW_ID' +create table bug44369 (db_row_id int) engine=innodb; +ERROR 42000: Incorrect column name 'db_row_id' +create table bug44369 (db_TRX_Id int) engine=innodb; +ERROR 42000: Incorrect column name 'db_TRX_Id' diff --git a/mysql-test/suite/innodb/r/innodb_bug44571.result b/mysql-test/suite/innodb/r/innodb_bug44571.result new file mode 100644 index 00000000000..7ee7820a02d --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug44571.result @@ -0,0 +1,8 @@ +CREATE TABLE bug44571 (foo INT) ENGINE=InnoDB; +ALTER TABLE bug44571 CHANGE foo bar INT; +ALTER TABLE bug44571 ADD INDEX bug44571b (foo); +ERROR 42000: Key column 'foo' doesn't exist in table +ALTER TABLE bug44571 ADD INDEX bug44571c (bar); +DROP INDEX bug44571c ON bug44571; +CREATE INDEX bug44571c ON bug44571 (bar); +DROP TABLE bug44571; diff --git a/mysql-test/suite/innodb/r/innodb_bug45357.result b/mysql-test/suite/innodb/r/innodb_bug45357.result new file mode 100644 index 00000000000..7adeff2062f --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug45357.result @@ -0,0 +1,7 @@ +set session transaction isolation level read committed; +create table bug45357(a int, b int,key(b))engine=innodb; +insert into bug45357 values (25170,6122); +update bug45357 set a=1 where b=30131; +delete from bug45357 where b < 20996; +delete from bug45357 where b < 7001; +drop table bug45357; diff --git a/mysql-test/suite/innodb/r/innodb_bug46000.result b/mysql-test/suite/innodb/r/innodb_bug46000.result new file mode 100644 index 00000000000..c8e3db8d641 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug46000.result @@ -0,0 +1,19 @@ +create table bug46000(`id` int,key `GEN_CLUST_INDEX`(`id`))engine=innodb; +ERROR 42000: Incorrect index name 'GEN_CLUST_INDEX' +create table bug46000(`id` int, key `GEN_clust_INDEX`(`id`))engine=innodb; +ERROR 42000: Incorrect index name 'GEN_CLUST_INDEX' +show warnings; +Level Code Message +Warning 1280 Cannot Create Index with name 'GEN_CLUST_INDEX'. The name is reserved for the system default primary index. +Error 1280 Incorrect index name 'GEN_CLUST_INDEX' +Error 1005 Can't create table 'test.bug46000' (errno: -1) +create table bug46000(id int) engine=innodb; +create index GEN_CLUST_INDEX on bug46000(id); +ERROR 42000: Incorrect index name 'GEN_CLUST_INDEX' +show warnings; +Level Code Message +Warning 1280 Cannot Create Index with name 'GEN_CLUST_INDEX'. The name is reserved for the system default primary index. +Error 1280 Incorrect index name 'GEN_CLUST_INDEX' +Error 1030 Got error -1 from storage engine +create index idx on bug46000(id); +drop table bug46000; diff --git a/mysql-test/suite/innodb/r/innodb_bug47621.result b/mysql-test/suite/innodb/r/innodb_bug47621.result new file mode 100644 index 00000000000..c5f56c09788 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug47621.result @@ -0,0 +1,21 @@ +CREATE TABLE bug47621 (salesperson INT) ENGINE=InnoDB; +ALTER TABLE bug47621 CHANGE salesperson sales_acct_id INT; +create index orgs on bug47621(sales_acct_id); +ALTER TABLE bug47621 CHANGE sales_acct_id salesperson INT; +drop table bug47621; +CREATE TABLE bug47621_sale ( +salesperson INT, +PRIMARY KEY(salesperson)) engine = innodb; +CREATE TABLE bug47621_shirt( +id SMALLINT, +owner INT, +FOREIGN KEY(owner) +references bug47621_sale(salesperson) ON DELETE RESTRICT) +engine = innodb; +insert into bug47621_sale values(9); +insert into bug47621_shirt values(1, 9); +ALTER TABLE bug47621_shirt CHANGE id new_id INT; +drop table bug47621_shirt; +ALTER TABLE bug47621_sale CHANGE salesperson sales_acct_id INT; +ALTER TABLE bug47621_sale ADD INDEX idx (sales_acct_id); +drop table bug47621_sale; diff --git a/mysql-test/suite/innodb/r/innodb_bug47622.result b/mysql-test/suite/innodb/r/innodb_bug47622.result new file mode 100644 index 00000000000..f5d13711c52 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug47622.result @@ -0,0 +1,23 @@ +CREATE TABLE bug47622( +`rule_key` int(11) NOT NULL DEFAULT '0', +`seq` smallint(6) NOT NULL DEFAULT '0', +`action` smallint(6) NOT NULL DEFAULT '0', +`arg_id` smallint(6) DEFAULT NULL, +`else_ind` TINYINT NOT NULL, +KEY IDX_A (`arg_id`) +) ENGINE=InnoDB; +ALTER TABLE bug47622 ADD UNIQUE IDX_B (rule_key,else_ind,seq,action,arg_id); +drop index IDX_B on bug47622; +create index idx on bug47622(seq, arg_id); +ALTER TABLE bug47622 ADD UNIQUE IDX_X (rule_key,else_ind,seq,action); +drop table bug47622; +CREATE TABLE bug47622 ( +`a` int(11) NOT NULL, +`b` int(11) DEFAULT NULL, +`c` char(10) DEFAULT NULL, +`d` varchar(20) DEFAULT NULL, +PRIMARY KEY (`a`), +KEY `b` (`b`) +) ENGINE=InnoDB; +alter table bug47622 add unique index (c), add index (d); +drop table bug47622; diff --git a/mysql-test/suite/innodb/r/innodb_bug47777.result b/mysql-test/suite/innodb/r/innodb_bug47777.result new file mode 100644 index 00000000000..fbba47edcfc --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug47777.result @@ -0,0 +1,13 @@ +create table bug47777(c2 linestring not null, primary key (c2(1))) engine=innodb; +insert into bug47777 values (geomfromtext('linestring(1 2,3 4,5 6,7 8,9 10)')); +select count(*) from bug47777 where c2 =geomfromtext('linestring(1 2,3 4,5 6,7 8,9 10)'); +count(*) +1 +update bug47777 set c2=GeomFromText('POINT(1 1)'); +select count(*) from bug47777 where c2 =geomfromtext('linestring(1 2,3 4,5 6,7 8,9 10)'); +count(*) +0 +select count(*) from bug47777 where c2 = GeomFromText('POINT(1 1)'); +count(*) +1 +drop table bug47777; diff --git a/mysql-test/suite/innodb/r/innodb_bug48024.result b/mysql-test/suite/innodb/r/innodb_bug48024.result new file mode 100644 index 00000000000..611923d2796 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug48024.result @@ -0,0 +1,10 @@ +CREATE TABLE bug48024(a int PRIMARY KEY,b int NOT NULL,KEY(b)) ENGINE=InnoDB; +CREATE TABLE bug48024_b(b int PRIMARY KEY) ENGINE=InnoDB; +ALTER TABLE bug48024 /*/ADD CONSTRAINT FOREIGN KEY(c) REFERENCES(a),/*/ +ADD CONSTRAINT FOREIGN KEY(b) REFERENCES bug48024_b(b); +DROP TABLE bug48024,bug48024_b; +CREATE TABLE bug48024(a int PRIMARY KEY,b int NOT NULL,KEY(b)) ENGINE=InnoDB; +CREATE TABLE bug48024_b(b int PRIMARY KEY) ENGINE=InnoDB; +ALTER TABLE bug48024 /*/ADD CONSTRAINT FOREIGN KEY(c) REFERENCES(a),/*/ +ADD CONSTRAINT FOREIGN KEY(b) REFERENCES bug48024_b(b)| +DROP TABLE bug48024,bug48024_b; diff --git a/mysql-test/suite/innodb/r/innodb_bug49164.result b/mysql-test/suite/innodb/r/innodb_bug49164.result new file mode 100644 index 00000000000..9456702e1d0 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug49164.result @@ -0,0 +1,42 @@ +SET tx_isolation = 'READ-COMMITTED'; +CREATE TABLE bug49164 (a INT, b BIGINT, c TINYINT, PRIMARY KEY (a, b)) +ENGINE=InnoDB; +insert into bug49164 values (1,1,1), (2,2,2), (3,3,3); +begin; +update bug49164 set c=7; +select * from bug49164; +a b c +1 1 7 +2 2 7 +3 3 7 +rollback; +select * from bug49164; +a b c +1 1 1 +2 2 2 +3 3 3 +begin; +update bug49164 set c=7; +SET tx_isolation = 'READ-COMMITTED'; +begin; +select * from bug49164; +a b c +1 1 1 +2 2 2 +3 3 3 +commit; +begin; +update bug49164 set c=6 where a=1 and b=1; +rollback; +select * from bug49164; +a b c +1 1 1 +2 2 2 +3 3 3 +commit; +select * from bug49164; +a b c +1 1 6 +2 2 2 +3 3 3 +drop table bug49164; diff --git a/mysql-test/suite/innodb/r/innodb_bug51378.result b/mysql-test/suite/innodb/r/innodb_bug51378.result new file mode 100644 index 00000000000..a3ca73c16a9 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug51378.result @@ -0,0 +1,66 @@ +create table bug51378 ( +col1 int not null, +col2 blob not null, +col3 time not null) engine = innodb; +create unique index idx on bug51378(col1, col2(31)); +alter table bug51378 add unique index idx2(col1, col2(31)); +create unique index idx3 on bug51378(col1, col3); +SHOW CREATE TABLE bug51378; +Table Create Table +bug51378 CREATE TABLE `bug51378` ( + `col1` int(11) NOT NULL, + `col2` blob NOT NULL, + `col3` time NOT NULL, + UNIQUE KEY `idx3` (`col1`,`col3`), + UNIQUE KEY `idx` (`col1`,`col2`(31)), + UNIQUE KEY `idx2` (`col1`,`col2`(31)) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop index idx3 on bug51378; +SHOW CREATE TABLE bug51378; +Table Create Table +bug51378 CREATE TABLE `bug51378` ( + `col1` int(11) NOT NULL, + `col2` blob NOT NULL, + `col3` time NOT NULL, + UNIQUE KEY `idx` (`col1`,`col2`(31)), + UNIQUE KEY `idx2` (`col1`,`col2`(31)) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +alter table bug51378 add primary key idx3(col1, col2(31)); +SHOW CREATE TABLE bug51378; +Table Create Table +bug51378 CREATE TABLE `bug51378` ( + `col1` int(11) NOT NULL, + `col2` blob NOT NULL, + `col3` time NOT NULL, + PRIMARY KEY (`col1`,`col2`(31)), + UNIQUE KEY `idx` (`col1`,`col2`(31)), + UNIQUE KEY `idx2` (`col1`,`col2`(31)) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table bug51378; +create table bug51378 ( +col1 int not null, +col2 blob not null, +col3 time not null, primary key(col1, col2(31))) engine = innodb; +create unique index idx on bug51378(col1, col2(31)); +SHOW CREATE TABLE bug51378; +Table Create Table +bug51378 CREATE TABLE `bug51378` ( + `col1` int(11) NOT NULL, + `col2` blob NOT NULL, + `col3` time NOT NULL, + PRIMARY KEY (`col1`,`col2`(31)), + UNIQUE KEY `idx` (`col1`,`col2`(31)) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table bug51378; +create table bug51378 ( +col1 int not null, +col2 int ) engine = innodb; +create unique index idx on bug51378(col1, col2); +SHOW CREATE TABLE bug51378; +Table Create Table +bug51378 CREATE TABLE `bug51378` ( + `col1` int(11) NOT NULL, + `col2` int(11) DEFAULT NULL, + UNIQUE KEY `idx` (`col1`,`col2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table bug51378; diff --git a/mysql-test/suite/innodb/r/innodb_bug51920.result b/mysql-test/suite/innodb/r/innodb_bug51920.result new file mode 100644 index 00000000000..7ded141c239 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug51920.result @@ -0,0 +1,13 @@ +CREATE TABLE bug51920 (i INT) ENGINE=InnoDB; +INSERT INTO bug51920 VALUES (1); +BEGIN; +SELECT * FROM bug51920 FOR UPDATE; +i +1 +UPDATE bug51920 SET i=2; +SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST +WHERE INFO="UPDATE bug51920 SET i=2" +INTO @thread_id; +KILL @thread_id; +Got one of the listed errors +DROP TABLE bug51920; diff --git a/mysql-test/suite/innodb/r/innodb_bug52663.result b/mysql-test/suite/innodb/r/innodb_bug52663.result new file mode 100644 index 00000000000..89add18617b --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug52663.result @@ -0,0 +1,26 @@ +set session transaction isolation level read committed; +create table innodb_bug52663 (what varchar(5), id integer, count integer, primary key +(what, id)) engine=innodb; +insert into innodb_bug52663 values ('total', 0, 0); +begin; +set session transaction isolation level read committed; +begin; +update innodb_bug52663 set count = count + 1 where what = 'total' and id = 0; +select * from innodb_bug52663; +what id count +total 0 1 +update innodb_bug52663 set count = count + 1 where what = 'total' and id = 0; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +select * from innodb_bug52663; +what id count +total 0 0 +commit; +update innodb_bug52663 set count = count + 1 where what = 'total' and id = 0; +commit; +select * from innodb_bug52663; +what id count +total 0 2 +select * from innodb_bug52663; +what id count +total 0 2 +drop table innodb_bug52663; diff --git a/mysql-test/suite/innodb/r/innodb_bug52745.result b/mysql-test/suite/innodb/r/innodb_bug52745.result new file mode 100644 index 00000000000..254c6525257 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug52745.result @@ -0,0 +1,130 @@ +SET GLOBAL innodb_file_format='Barracuda'; +SET GLOBAL innodb_file_per_table=on; +CREATE TABLE bug52745 ( +a2 int(10) unsigned DEFAULT NULL, +col37 time DEFAULT NULL, +col38 char(229) CHARACTER SET utf8 DEFAULT NULL, +col39 text, +col40 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, +col41 int(10) unsigned DEFAULT NULL, +col42 varchar(248) CHARACTER SET utf8 DEFAULT NULL, +col43 smallint(5) unsigned zerofill DEFAULT NULL, +col44 varchar(150) CHARACTER SET utf8 DEFAULT NULL, +col45 float unsigned zerofill DEFAULT NULL, +col46 binary(1) DEFAULT NULL, +col47 tinyint(4) DEFAULT NULL, +col48 tinyint(1) DEFAULT NULL, +col49 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', +col50 binary(1) DEFAULT NULL, +col51 double unsigned zerofill DEFAULT NULL, +col52 int(10) unsigned DEFAULT NULL, +col53 time DEFAULT NULL, +col54 double unsigned DEFAULT NULL, +col55 time DEFAULT NULL, +col56 mediumtext CHARACTER SET latin2, +col57 blob, +col58 decimal(52,16) unsigned zerofill NOT NULL DEFAULT '000000000000000000000000000000000000.0000000000000000', +col59 binary(1) DEFAULT NULL, +col60 longblob, +col61 time DEFAULT NULL, +col62 longtext CHARACTER SET utf8 COLLATE utf8_persian_ci, +col63 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', +col64 int(10) unsigned DEFAULT NULL, +col65 date DEFAULT NULL, +col66 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', +col67 binary(1) DEFAULT NULL, +col68 tinyblob, +col69 date DEFAULT NULL, +col70 tinyint(3) unsigned zerofill DEFAULT NULL, +col71 varchar(44) CHARACTER SET utf8 DEFAULT NULL, +col72 datetime DEFAULT NULL, +col73 smallint(5) unsigned zerofill DEFAULT NULL, +col74 longblob, +col75 bit(34) DEFAULT NULL, +col76 float unsigned zerofill DEFAULT NULL, +col77 year(2) DEFAULT NULL, +col78 tinyint(3) unsigned DEFAULT NULL, +col79 set('msfheowh','tbpxbgf','by','wahnrjw','myqfasxz','rsokyumrt') CHARACTER SET latin2 DEFAULT NULL, +col80 datetime DEFAULT NULL, +col81 smallint(6) DEFAULT NULL, +col82 enum('xtaurnqfqz','rifrse','kuzwpbvb','niisabk','zxavro','rbvasv','','uulrfaove','','') DEFAULT NULL, +col83 bigint(20) unsigned zerofill DEFAULT NULL, +col84 float unsigned zerofill DEFAULT NULL, +col85 double DEFAULT NULL, +col86 enum('ylannv','','vlkhycqc','snke','cxifustp','xiaxaswzp','oxl') CHARACTER SET latin1 COLLATE latin1_german2_ci DEFAULT NULL, +col87 varbinary(221) DEFAULT NULL, +col88 double unsigned DEFAULT NULL, +col89 float unsigned zerofill DEFAULT NULL, +col90 tinyblob +) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; +Warnings: +Note 1291 Column 'col82' has duplicated value '' in ENUM +Note 1291 Column 'col82' has duplicated value '' in ENUM +INSERT INTO bug52745 SET +col40='0000-00-00 00:00:00', +col51=16547, +col53='7711484', +col54=-28604, +col55='7112612', +col56='wakefulness\'', +col57=repeat('absorbefacient\'',106), +col58=11027, +col59='AM09gW7', +col60=repeat('Noelani\'',16), +col61='2520576', +col62='substitutiv', +col63='19950106155112', +col64=-12038, +col65='86238806', +col66='19600719080256', +col68=repeat('Sagittarius\'',54), +col69='38943902', +col70=1232, +col71='Elora\'', +col74=repeat('zipp',11), +col75='0', +col76=23254, +col78=13247, +col79='56219', +col80='20500609035724', +col81=11632, +col82=7, +col84=-23863, +col85=6341, +col87='HZdkf.4 s7t,5Rmq 8so fmr,ruGLUG25TrtI.yQ 2SuHq0ML7rw7.4 b2yf2E5TJxOtBBZImezDnzpj,uPYfznnEUDN1e9aQoO 2DsplB7TFWy oQJ br HLF :F,eQ p4i1oWsr lL3PG,hjCz6hYqN h1QTjLCjrv:QCdSzpYBibJAtZCxLOk3l6Blsh.W', +col88=16894, +col89=6161, +col90=repeat('gale',48); +Warnings: +Warning 1265 Data truncated for column 'col53' at row 1 +Warning 1264 Out of range value for column 'col54' at row 1 +Warning 1265 Data truncated for column 'col59' at row 1 +Warning 1265 Data truncated for column 'col61' at row 1 +Warning 1264 Out of range value for column 'col64' at row 1 +Warning 1265 Data truncated for column 'col65' at row 1 +Warning 1264 Out of range value for column 'col66' at row 1 +Warning 1265 Data truncated for column 'col68' at row 1 +Warning 1265 Data truncated for column 'col69' at row 1 +Warning 1264 Out of range value for column 'col70' at row 1 +Warning 1264 Out of range value for column 'col78' at row 1 +Warning 1265 Data truncated for column 'col79' at row 1 +Warning 1264 Out of range value for column 'col84' at row 1 +SHOW WARNINGS; +Level Code Message +Warning 1265 Data truncated for column 'col53' at row 1 +Warning 1264 Out of range value for column 'col54' at row 1 +Warning 1265 Data truncated for column 'col59' at row 1 +Warning 1265 Data truncated for column 'col61' at row 1 +Warning 1264 Out of range value for column 'col64' at row 1 +Warning 1265 Data truncated for column 'col65' at row 1 +Warning 1264 Out of range value for column 'col66' at row 1 +Warning 1265 Data truncated for column 'col68' at row 1 +Warning 1265 Data truncated for column 'col69' at row 1 +Warning 1264 Out of range value for column 'col70' at row 1 +Warning 1264 Out of range value for column 'col78' at row 1 +Warning 1265 Data truncated for column 'col79' at row 1 +Warning 1264 Out of range value for column 'col84' at row 1 +DROP TABLE bug52745; +SET GLOBAL innodb_file_format=Antelope; +SET GLOBAL innodb_file_format_check=Antelope; +SET GLOBAL innodb_file_per_table=0; diff --git a/mysql-test/suite/innodb/r/innodb_bug53290.result b/mysql-test/suite/innodb/r/innodb_bug53290.result new file mode 100644 index 00000000000..46cd7248c4e --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug53290.result @@ -0,0 +1,17 @@ +create table bug53290 (x bigint) engine=innodb; +insert into bug53290 () values (),(),(),(),(),(),(),(),(),(),(),(); +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +alter table bug53290 add unique index `idx` (x); +drop table bug53290; diff --git a/mysql-test/suite/innodb/r/innodb_bug53591.result b/mysql-test/suite/innodb/r/innodb_bug53591.result new file mode 100644 index 00000000000..1f05b6d2a57 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug53591.result @@ -0,0 +1,16 @@ +SET GLOBAL innodb_file_format='Barracuda'; +SET GLOBAL innodb_file_per_table=on; +set old_alter_table=0; +CREATE TABLE bug53591(a text charset utf8 not null) +ENGINE=InnoDB KEY_BLOCK_SIZE=1; +ALTER TABLE bug53591 ADD PRIMARY KEY(a(220)); +ERROR HY000: Too big row +SHOW WARNINGS; +Level Code Message +Error 139 Too big row +Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs +Error 1030 Got error 139 from storage engine +DROP TABLE bug53591; +SET GLOBAL innodb_file_format=Antelope; +SET GLOBAL innodb_file_format_check=Antelope; +SET GLOBAL innodb_file_per_table=0; diff --git a/mysql-test/suite/innodb/r/innodb_bug53592.result b/mysql-test/suite/innodb/r/innodb_bug53592.result new file mode 100644 index 00000000000..63b30f50413 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug53592.result @@ -0,0 +1,43 @@ +set old_alter_table=0; +create table bug53592(a int) engine=innodb row_format=compact; +alter table bug53592 add column b text charset utf8; +alter table bug53592 add column c blob not null; +create index bug53592_b on bug53592(b(81)); +create unique index bug53592_c on bug53592(c(1)); +replace into bug53592 values (),(); +Warnings: +Warning 1364 Field 'c' doesn't have a default value +check table bug53592; +Table Op Msg_type Msg_text +test.bug53592 check status OK +drop table bug53592; +set old_alter_table=1; +create table bug53592(a int) engine=innodb row_format=compact; +alter table bug53592 add column b text charset utf8; +alter table bug53592 add column c blob not null; +create index bug53592_b on bug53592(b(81)); +create unique index bug53592_c on bug53592(c(1)); +replace into bug53592 values (),(); +Warnings: +Warning 1364 Field 'c' doesn't have a default value +check table bug53592; +Table Op Msg_type Msg_text +test.bug53592 check status OK +drop table bug53592; +CREATE TABLE bug53592_1( +col1 int, col2 int, +PRIMARY KEY (col1, col2) +) ENGINE=InnoDB; +CREATE TABLE bug53592_2 ( +col int PRIMARY KEY, +FOREIGN KEY (col) REFERENCES bug53592_1 (col1) +ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB; +INSERT INTO bug53592_1 VALUES (1, 2); +INSERT INTO bug53592_1 VALUES (3, 4); +INSERT INTO bug53592_2 VALUES (1); +INSERT INTO bug53592_2 VALUES (3); +UPDATE bug53592_1 SET col1 = 3 WHERE col2 = 2; +ERROR 23000: Upholding foreign key constraints for table 'bug53592_1', entry '3-2', key 1 would lead to a duplicate entry +drop table bug53592_2; +drop table bug53592_1; diff --git a/mysql-test/suite/innodb/r/innodb_bug53674.result b/mysql-test/suite/innodb/r/innodb_bug53674.result new file mode 100644 index 00000000000..c4021c2e7cd --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug53674.result @@ -0,0 +1,11 @@ +create table bug53674(a int)engine=innodb; +insert into bug53674 values (1),(2); +start transaction; +select * from bug53674 for update; +a +1 +2 +select * from bug53674 where a=(select a from bug53674 where a > 1); +a +2 +drop table bug53674; diff --git a/mysql-test/suite/innodb/r/innodb_file_format.result b/mysql-test/suite/innodb/r/innodb_file_format.result index 107025e4e52..6a573d8658e 100644 --- a/mysql-test/suite/innodb/r/innodb_file_format.result +++ b/mysql-test/suite/innodb/r/innodb_file_format.result @@ -1,4 +1,3 @@ -call mtr.add_suppression("InnoDB: invalid innodb_file_format_check value"); select @@innodb_file_format; @@innodb_file_format Antelope @@ -41,3 +40,4 @@ ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'off' select @@innodb_file_format_check; @@innodb_file_format_check Barracuda +set global innodb_file_format_check=antelope; diff --git a/mysql-test/suite/innodb/r/innodb_information_schema.result b/mysql-test/suite/innodb/r/innodb_information_schema.result index 396cae579ce..ad8729804df 100644 --- a/mysql-test/suite/innodb/r/innodb_information_schema.result +++ b/mysql-test/suite/innodb/r/innodb_information_schema.result @@ -21,3 +21,46 @@ lock_table COUNT(*) "test"."t_max" 2 "test"."t_min" 2 "test"."`t'\""_str" 10 +Field Type Null Key Default Extra +trx_id varchar(18) NO +trx_state varchar(13) NO +trx_started datetime NO 0000-00-00 00:00:00 +trx_requested_lock_id varchar(81) YES NULL +trx_wait_started datetime YES NULL +trx_weight bigint(21) unsigned NO 0 +trx_mysql_thread_id bigint(21) unsigned NO 0 +trx_query varchar(1024) YES NULL +trx_operation_state varchar(64) YES NULL +trx_tables_in_use bigint(21) unsigned NO 0 +trx_tables_locked bigint(21) unsigned NO 0 +trx_lock_structs bigint(21) unsigned NO 0 +trx_lock_memory_bytes bigint(21) unsigned NO 0 +trx_rows_locked bigint(21) unsigned NO 0 +trx_rows_modified bigint(21) unsigned NO 0 +trx_concurrency_tickets bigint(21) unsigned NO 0 +trx_isolation_level varchar(16) NO +trx_unique_checks int(1) NO 0 +trx_foreign_key_checks int(1) NO 0 +trx_last_foreign_key_error varchar(256) YES NULL +trx_apative_hash_latched int(1) NO 0 +trx_adaptive_hash_timeout bigint(21) unsigned NO 0 +trx_operation_state varchar(64) YES NULL +trx_tables_in_use bigint(21) unsigned NO 0 +trx_tables_locked bigint(21) unsigned NO 0 +trx_lock_structs bigint(21) unsigned NO 0 +trx_lock_memory_bytes bigint(21) unsigned NO 0 +trx_rows_locked bigint(21) unsigned NO 0 +trx_rows_modified bigint(21) unsigned NO 0 +trx_concurrency_tickets bigint(21) unsigned NO 0 +trx_isolation_level varchar(16) NO +trx_unique_checks int(1) NO 0 +trx_foreign_key_checks int(1) NO 0 +trx_last_foreign_key_error varchar(256) YES NULL +trx_apative_hash_latched int(1) NO 0 +trx_adaptive_hash_timeout bigint(21) unsigned NO 0 +trx_state trx_weight trx_tables_in_use trx_tables_locked trx_rows_locked trx_rows_modified trx_concurrency_tickets trx_isolation_level trx_unique_checks trx_foreign_key_checks +RUNNING 4 0 0 7 1 0 REPEATABLE READ 1 1 +trx_isolation_level trx_unique_checks trx_foreign_key_checks +SERIALIZABLE 0 0 +trx_state trx_isolation_level trx_last_foreign_key_error +RUNNING SERIALIZABLE `test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`c02`) REFERENCES `t1` (`c01`) diff --git a/mysql-test/suite/innodb/r/innodb_multi_update.result b/mysql-test/suite/innodb/r/innodb_multi_update.result new file mode 100644 index 00000000000..7af9b030d1f --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_multi_update.result @@ -0,0 +1,76 @@ +CREATE TABLE bug38999_1 (a int not null primary key, b int not null, key (b)) engine=innodb; +CREATE TABLE bug38999_2 (a int not null primary key, b int not null, key (b)) engine=innodb; +INSERT INTO bug38999_1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10),(11,11),(12,12); +INSERT INTO bug38999_2 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +update bug38999_1,bug38999_2 set bug38999_1.a=bug38999_1.a+100; +select * from bug38999_1; +a b +101 1 +102 2 +103 3 +104 4 +105 5 +106 6 +107 7 +108 8 +109 9 +110 10 +111 11 +112 12 +update bug38999_1,bug38999_2 set bug38999_1.a=bug38999_1.a+100 where bug38999_1.a=101; +select * from bug38999_1; +a b +201 1 +102 2 +103 3 +104 4 +105 5 +106 6 +107 7 +108 8 +109 9 +110 10 +111 11 +112 12 +update bug38999_1,bug38999_2 set bug38999_1.b=bug38999_1.b+10 where bug38999_1.b=2; +select * from bug38999_1; +a b +201 1 +103 3 +104 4 +105 5 +106 6 +107 7 +108 8 +109 9 +110 10 +111 11 +102 12 +112 12 +update bug38999_1,bug38999_2 set bug38999_1.b=bug38999_1.b+2,bug38999_2.b=bug38999_1.b+10 where bug38999_1.b between 3 and 5 and bug38999_1.a=bug38999_2.a+100; +select * from bug38999_1; +a b +201 1 +103 5 +104 6 +106 6 +105 7 +107 7 +108 8 +109 9 +110 10 +111 11 +102 12 +112 12 +select * from bug38999_2; +a b +1 1 +2 2 +6 6 +7 7 +8 8 +9 9 +3 13 +4 14 +5 15 +drop table bug38999_1,bug38999_2; diff --git a/mysql-test/suite/innodb/r/innodb_trx_weight.result b/mysql-test/suite/innodb/r/innodb_trx_weight.result new file mode 100644 index 00000000000..195775f74c8 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_trx_weight.result @@ -0,0 +1 @@ +SET storage_engine=InnoDB; diff --git a/mysql-test/suite/innodb/t/disabled.def b/mysql-test/suite/innodb/t/disabled.def index 6535ee27887..da04138fd0a 100644 --- a/mysql-test/suite/innodb/t/disabled.def +++ b/mysql-test/suite/innodb/t/disabled.def @@ -1 +1,12 @@ -innodb-index : Bug#49396 2009-12-03 test fails in embedded mode +############################################################################## +# +# List the test cases that are to be disabled temporarily. +# +# Separate the test case name and the comment with ':'. +# +# <testcasename> : BUG#<xxxx> <date disabled> <disabler> <comment> +# +# Do not use any TAB characters for whitespace. +# +############################################################################## +innodb_multi_update: Bug #38999 2010-05-05 mmakela Valgrind warnings diff --git a/mysql-test/suite/innodb/t/innodb-autoinc-44030.test b/mysql-test/suite/innodb/t/innodb-autoinc-44030.test new file mode 100644 index 00000000000..17c836004a1 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb-autoinc-44030.test @@ -0,0 +1,43 @@ +-- source include/have_innodb.inc +# embedded server ignores 'delayed', so skip this +-- source include/not_embedded.inc + +let $innodb_file_format_check_orig=`select @@innodb_file_format_check`; + +--disable_warnings +drop table if exists t1; +--enable_warnings + +# +# 44030: Error: (1500) Couldn't read the MAX(ID) autoinc value from +# the index (PRIMARY) +# This test requires a restart of the server +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; +CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (null); +INSERT INTO t1 VALUES (null); +ALTER TABLE t1 CHANGE c1 d1 INT NOT NULL AUTO_INCREMENT; +SELECT * FROM t1; +# Restart the server +-- source include/restart_mysqld.inc +# The MySQL and InnoDB data dictionaries should now be out of sync. +# The select should print message to the error log +SELECT * FROM t1; +# MySQL have made a change (http://lists.mysql.com/commits/75268) that no +# longer results in the two data dictionaries being out of sync. If they +# revert their changes then this check for ER_AUTOINC_READ_FAILED will need +# to be enabled. Also, see http://bugs.mysql.com/bug.php?id=47621. +#-- error ER_AUTOINC_READ_FAILED,1467 +INSERT INTO t1 VALUES(null); +ALTER TABLE t1 AUTO_INCREMENT = 3; +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES(null); +SELECT * FROM t1; +DROP TABLE t1; + +# +# restore environment to the state it was before this test execution +# + +-- disable_query_log +eval SET GLOBAL innodb_file_format_check=$innodb_file_format_check_orig; diff --git a/mysql-test/suite/innodb/t/innodb-autoinc.test b/mysql-test/suite/innodb/t/innodb-autoinc.test new file mode 100644 index 00000000000..c1cae16153e --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb-autoinc.test @@ -0,0 +1,674 @@ +-- source include/have_innodb.inc +# embedded server ignores 'delayed', so skip this +-- source include/not_embedded.inc + +let $innodb_file_format_check_orig=`select @@innodb_file_format_check`; + +--disable_warnings +drop table if exists t1; +--enable_warnings + +# +# Bug #34335 +# +CREATE TABLE t1 (c1 BIGINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (9223372036854775807, null); +-- error ER_DUP_ENTRY,1062 +INSERT INTO t1 (c2) VALUES ('innodb'); +SELECT * FROM t1; +DROP TABLE t1; +# +## Test AUTOINC overflow +## + +# TINYINT +CREATE TABLE t1 (c1 TINYINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (127, null); +-- error ER_DUP_ENTRY,1062 +INSERT INTO t1 (c2) VALUES ('innodb'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (c1 TINYINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (255, null); +-- error ER_DUP_ENTRY,1062 +INSERT INTO t1 (c2) VALUES ('innodb'); +SELECT * FROM t1; +DROP TABLE t1; +# +# SMALLINT +# +CREATE TABLE t1 (c1 SMALLINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (32767, null); +-- error ER_DUP_ENTRY,1062 +INSERT INTO t1 (c2) VALUES ('innodb'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (c1 SMALLINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (65535, null); +-- error ER_DUP_ENTRY,1062 +INSERT INTO t1 (c2) VALUES ('innodb'); +SELECT * FROM t1; +DROP TABLE t1; +# +# MEDIUMINT +# +CREATE TABLE t1 (c1 MEDIUMINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (8388607, null); +-- error ER_DUP_ENTRY,1062 +INSERT INTO t1 (c2) VALUES ('innodb'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (c1 MEDIUMINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (16777215, null); +-- error ER_DUP_ENTRY,1062 +INSERT INTO t1 (c2) VALUES ('innodb'); +SELECT * FROM t1; +DROP TABLE t1; +# +# INT +# +CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (2147483647, null); +-- error ER_DUP_ENTRY,1062 +INSERT INTO t1 (c2) VALUES ('innodb'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (c1 INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (4294967295, null); +-- error ER_DUP_ENTRY,1062 +INSERT INTO t1 (c2) VALUES ('innodb'); +SELECT * FROM t1; +DROP TABLE t1; +# +# BIGINT +# +CREATE TABLE t1 (c1 BIGINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (9223372036854775807, null); +-- error ER_DUP_ENTRY,1062 +INSERT INTO t1 (c2) VALUES ('innodb'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (c1 BIGINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (18446744073709551615, null); +-- error ER_AUTOINC_READ_FAILED,1467 +INSERT INTO t1 (c2) VALUES ('innodb'); +SELECT * FROM t1; +DROP TABLE t1; + +# +# Bug 37531 +# After truncate, auto_increment behaves incorrectly for InnoDB +# +CREATE TABLE t1(c1 INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1), (2), (3); +INSERT INTO t1 VALUES (NULL), (NULL), (NULL); +SELECT c1 FROM t1; +SHOW CREATE TABLE t1; +TRUNCATE TABLE t1; +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (1), (2), (3); +INSERT INTO t1 VALUES (NULL), (NULL), (NULL); +SELECT c1 FROM t1; +SHOW CREATE TABLE t1; +DROP TABLE t1; + +# +# Deleting all records should not reset the AUTOINC counter. +# +CREATE TABLE t1(c1 INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1), (2), (3); +INSERT INTO t1 VALUES (NULL), (NULL), (NULL); +SELECT c1 FROM t1; +SHOW CREATE TABLE t1; +DELETE FROM t1; +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (1), (2), (3); +INSERT INTO t1 VALUES (NULL), (NULL), (NULL); +SELECT c1 FROM t1; +SHOW CREATE TABLE t1; +DROP TABLE t1; + +# +# Bug 38839 +# Reset the last value generated at end of statement +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c1 INT AUTO_INCREMENT, c2 INT, PRIMARY KEY(c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (NULL, 1); +DELETE FROM t1 WHERE c1 = 1; +INSERT INTO t1 VALUES (2,1); +INSERT INTO t1 VALUES (NULL,8); +SELECT * FROM t1; +DROP TABLE t1; +# Bug 38839 -- same as above but for multi value insert +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c1 INT AUTO_INCREMENT, c2 INT, PRIMARY KEY(c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (NULL, 1); +DELETE FROM t1 WHERE c1 = 1; +INSERT INTO t1 VALUES (2,1), (NULL, 8); +INSERT INTO t1 VALUES (NULL,9); +SELECT * FROM t1; +DROP TABLE t1; + +# +# Test changes to AUTOINC next value calculation +SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10; +SHOW VARIABLES LIKE "%auto_inc%"; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (NULL),(5),(NULL); +INSERT INTO t1 VALUES (250),(NULL); +SELECT * FROM t1; +INSERT INTO t1 VALUES (1000); +SET @@INSERT_ID=400; +INSERT INTO t1 VALUES(NULL),(NULL); +SELECT * FROM t1; +DROP TABLE t1; + +# Test with SIGNED INT column, by inserting a 0 for the first column value +# 0 is treated in the same was NULL. +# Reset the AUTOINC session variables +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; +SET @@INSERT_ID=1; +SHOW VARIABLES LIKE "%auto_inc%"; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES(0); +SELECT * FROM t1; +SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10; +INSERT INTO t1 VALUES (-1), (NULL),(2),(NULL); +INSERT INTO t1 VALUES (250),(NULL); +SELECT * FROM t1; +SET @@INSERT_ID=400; +# Duplicate error expected here for autoinc_lock_mode != TRADITIONAL +-- error ER_DUP_ENTRY,1062 +INSERT INTO t1 VALUES(NULL),(NULL); +SELECT * FROM t1; +DROP TABLE t1; + +# Test with SIGNED INT column +# Reset the AUTOINC session variables +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; +SET @@INSERT_ID=1; +SHOW VARIABLES LIKE "%auto_inc%"; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES(-1); +SELECT * FROM t1; +SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10; +SHOW VARIABLES LIKE "%auto_inc%"; +INSERT INTO t1 VALUES (-2), (NULL),(2),(NULL); +INSERT INTO t1 VALUES (250),(NULL); +SELECT * FROM t1; +INSERT INTO t1 VALUES (1000); +SET @@INSERT_ID=400; +INSERT INTO t1 VALUES(NULL),(NULL); +SELECT * FROM t1; +DROP TABLE t1; + +# Test with UNSIGNED INT column, single insert +# The sign in the value is ignored and a new column value is generated +# Reset the AUTOINC session variables +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; +SET @@INSERT_ID=1; +SHOW VARIABLES LIKE "%auto_inc%"; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c1 INT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES(-1); +SELECT * FROM t1; +SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10; +SHOW VARIABLES LIKE "%auto_inc%"; +INSERT INTO t1 VALUES (-2); +INSERT INTO t1 VALUES (NULL); +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (NULL); +INSERT INTO t1 VALUES (250); +INSERT INTO t1 VALUES (NULL); +SELECT * FROM t1; +INSERT INTO t1 VALUES (1000); +SET @@INSERT_ID=400; +INSERT INTO t1 VALUES(NULL); +INSERT INTO t1 VALUES(NULL); +SELECT * FROM t1; +DROP TABLE t1; + +# Test with UNSIGNED INT column, multi-value inserts +# The sign in the value is ignored and a new column value is generated +# Reset the AUTOINC session variables +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; +SET @@INSERT_ID=1; +SHOW VARIABLES LIKE "%auto_inc%"; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c1 INT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES(-1); +SELECT * FROM t1; +SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10; +SHOW VARIABLES LIKE "%auto_inc%"; +INSERT INTO t1 VALUES (-2),(NULL),(2),(NULL); +INSERT INTO t1 VALUES (250),(NULL); +SELECT * FROM t1; +INSERT INTO t1 VALUES (1000); +SET @@INSERT_ID=400; +# Duplicate error expected here for autoinc_lock_mode != TRADITIONAL +-- error ER_DUP_ENTRY,1062 +INSERT INTO t1 VALUES(NULL),(NULL); +SELECT * FROM t1; +DROP TABLE t1; + +# +# Check for overflow handling when increment is > 1 +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; +SET @@INSERT_ID=1; +SHOW VARIABLES LIKE "%auto_inc%"; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c1 BIGINT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; +# TODO: Fix the autoinc init code +# We have to do this because of a bug in the AUTOINC init code. +INSERT INTO t1 VALUES(NULL); +INSERT INTO t1 VALUES (9223372036854775794); #-- 2^63 - 14 +SELECT * FROM t1; +SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10; +SHOW VARIABLES LIKE "%auto_inc%"; +# This should just fit +INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL); +SELECT * FROM t1; +DROP TABLE t1; + +# +# Check for overflow handling when increment and offser are > 1 +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; +SET @@INSERT_ID=1; +SHOW VARIABLES LIKE "%auto_inc%"; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; +# TODO: Fix the autoinc init code +# We have to do this because of a bug in the AUTOINC init code. +INSERT INTO t1 VALUES(NULL); +INSERT INTO t1 VALUES (18446744073709551603); #-- 2^64 - 13 +SELECT * FROM t1; +SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10; +SHOW VARIABLES LIKE "%auto_inc%"; +# This should fail because of overflow but it doesn't, it seems to be +# a MySQL server bug. It wraps around to 0 for the last value. +# See MySQL Bug# 39828 +# +# Instead of wrapping around, it asserts when MySQL is compiled --with-debug +# (see sql/handler.cc:handler::update_auto_increment()). Don't test for +# overflow until Bug #39828 is fixed. +# +# Since this asserts when compiled --with-debug, we can't properly test this +# until Bug #39828 is fixed. For now, this test is meaningless. +#if Bug #39828 is fixed +#INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL); +#else +INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL); +#endif +SELECT * FROM t1; +DROP TABLE t1; + +# +# Check for overflow handling when increment and offset are odd numbers +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; +SET @@INSERT_ID=1; +SHOW VARIABLES LIKE "%auto_inc%"; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; +# TODO: Fix the autoinc init code +# We have to do this because of a bug in the AUTOINC init code. +INSERT INTO t1 VALUES(NULL); +INSERT INTO t1 VALUES (18446744073709551603); #-- 2^64 - 13 +SELECT * FROM t1; +SET @@SESSION.AUTO_INCREMENT_INCREMENT=5, @@SESSION.AUTO_INCREMENT_OFFSET=7; +SHOW VARIABLES LIKE "%auto_inc%"; +# This should fail because of overflow but it doesn't. It fails with +# a duplicate entry message because of a MySQL server bug, it wraps +# around. See MySQL Bug# 39828, once MySQL fix the bug we can replace +# the ER_DUP_ENTRY, 1062 below with the appropriate error message +# +# Since this asserts when compiled --with-debug, we can't properly test this +# until Bug #39828 is fixed. For now, this test is meaningless. +#if Bug #39828 is fixed +# Still need to fix this error code, error should mention overflow +#-- error ER_DUP_ENTRY,1062 +#INSERT INTO t1 VALUES (NULL),(NULL), (NULL); +#else +INSERT INTO t1 VALUES (NULL),(NULL); +#endif +SELECT * FROM t1; +DROP TABLE t1; + +# Check for overflow handling when increment and offset are odd numbers +# and check for large -ve numbers +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; +SET @@INSERT_ID=1; +SHOW VARIABLES LIKE "%auto_inc%"; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c1 BIGINT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; +# TODO: Fix the autoinc init code +# We have to do this because of a bug in the AUTOINC init code. +INSERT INTO t1 VALUES(NULL); +INSERT INTO t1 VALUES(-9223372036854775806); #-- -2^63 + 2 +INSERT INTO t1 VALUES(-9223372036854775807); #-- -2^63 + 1 +INSERT INTO t1 VALUES(-9223372036854775808); #-- -2^63 +SELECT * FROM t1; +SET @@SESSION.AUTO_INCREMENT_INCREMENT=3, @@SESSION.AUTO_INCREMENT_OFFSET=3; +SHOW VARIABLES LIKE "%auto_inc%"; +INSERT INTO t1 VALUES (NULL),(NULL), (NULL); +SELECT * FROM t1; +DROP TABLE t1; +# +# Check for overflow handling when increment and offset are very +# large numbers 2^60 +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; +SET @@INSERT_ID=1; +SHOW VARIABLES LIKE "%auto_inc%"; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; +# TODO: Fix the autoinc init code +# We have to do this because of a bug in the AUTOINC init code. +INSERT INTO t1 VALUES(NULL); +INSERT INTO t1 VALUES (18446744073709551610); #-- 2^64 - 2 +SELECT * FROM t1; +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1152921504606846976, @@SESSION.AUTO_INCREMENT_OFFSET=1152921504606846976; +SHOW VARIABLES LIKE "%auto_inc%"; +# This should fail because of overflow but it doesn't. It wraps around +# and the autoinc values look bogus too. +# See MySQL Bug# 39828, once MySQL fix the bug we can enable the error +# code expected test. +# -- error ER_AUTOINC_READ_FAILED,1467 +# +# Since this asserts when compiled --with-debug, we can't properly test this +# until Bug #39828 is fixed. For now, this test is meaningless. +#if Bug #39828 is fixed +#-- error ER_AUTOINC_READ_FAILED,1467 +#INSERT INTO t1 VALUES (NULL),(NULL); +#else +INSERT INTO t1 VALUES (NULL); +#endif +SELECT * FROM t1; +DROP TABLE t1; + +# +# Check for floating point autoinc column handling +# +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; +SET @@INSERT_ID=1; +SHOW VARIABLES LIKE "%auto_inc%"; +CREATE TABLE t1 (c1 DOUBLE NOT NULL AUTO_INCREMENT, c2 INT, PRIMARY KEY (c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES(NULL, 1); +INSERT INTO t1 VALUES(NULL, 2); +SELECT * FROM t1; +ALTER TABLE t1 CHANGE c1 c1 SERIAL; +SELECT * FROM t1; +INSERT INTO t1 VALUES(NULL, 3); +INSERT INTO t1 VALUES(NULL, 4); +SELECT * FROM t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c1 FLOAT NOT NULL AUTO_INCREMENT, c2 INT, PRIMARY KEY (c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES(NULL, 1); +INSERT INTO t1 VALUES(NULL, 2); +SELECT * FROM t1; +ALTER TABLE t1 CHANGE c1 c1 SERIAL; +SELECT * FROM t1; +INSERT INTO t1 VALUES(NULL, 3); +INSERT INTO t1 VALUES(NULL, 4); +SELECT * FROM t1; +DROP TABLE t1; + +# +# Bug# 42714: AUTOINC column calculated next value not greater than highest +# value stored in table. +# +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=5; +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; +CREATE TABLE t1 ( + a INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, + b INT(10) UNSIGNED NOT NULL, + c ENUM('FALSE','TRUE') DEFAULT NULL, + PRIMARY KEY (a)) ENGINE = InnoDB; +CREATE TABLE t2 ( + m INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, + n INT(10) UNSIGNED NOT NULL, + o enum('FALSE','TRUE') DEFAULT NULL, + PRIMARY KEY (m)) ENGINE = InnoDB; +INSERT INTO t2 (n,o) VALUES + (1 , 'true'), (1 , 'false'), (2 , 'true'), (2 , 'false'), (3 , 'true'), + (3 , 'false'), (4 , 'true'), (4 , 'false'), (5 , 'true'), (5 , 'false'); +SHOW CREATE TABLE t2; +INSERT INTO t1 (b,c) SELECT n,o FROM t2 ; +SHOW CREATE TABLE t1; +INSERT INTO t1 (b,c) SELECT n,o FROM t2 ; +SELECT * FROM t1; +SHOW CREATE TABLE t1; +INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false'; +SELECT * FROM t1; +SHOW CREATE TABLE t1; +INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false'; +SELECT * FROM t1; +SHOW CREATE TABLE t1; +INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false'; +SHOW CREATE TABLE t1; +INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false'; +SHOW CREATE TABLE t1; +INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false'; +SELECT * FROM t1; +SHOW CREATE TABLE t1; +DROP TABLE t1; +DROP TABLE t2; +# +# 43203: Overflow from auto incrementing causes server segv +# + +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; +CREATE TABLE t1( + c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT + PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL); +CREATE TABLE t2( + c1 TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT + PRIMARY KEY) ENGINE=InnoDB; +-- error ER_DUP_ENTRY,1062 +INSERT INTO t2 SELECT c1 FROM t1; +-- error ER_DUP_ENTRY,1467 +INSERT INTO t2 SELECT NULL FROM t1; +DROP TABLE t1; +DROP TABLE t2; + +# If the user has specified negative values for an AUTOINC column then +# InnoDB should ignore those values when setting the table's max value. +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; +SHOW VARIABLES LIKE "%auto_inc%"; +# TINYINT +CREATE TABLE t1 (c1 TINYINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, NULL); +INSERT INTO t1 VALUES (-1, 'innodb'); +INSERT INTO t1 VALUES (-127, 'innodb'); +INSERT INTO t1 VALUES (NULL, NULL); +SHOW CREATE TABLE t1; +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (c1 TINYINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, NULL); +INSERT INTO t1 VALUES (-1, 'innodb'); +INSERT INTO t1 VALUES (-127, 'innodb'); +INSERT INTO t1 VALUES (NULL, NULL); +SHOW CREATE TABLE t1; +SELECT * FROM t1; +DROP TABLE t1; +# +# SMALLINT +# +CREATE TABLE t1 (c1 SMALLINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, NULL); +INSERT INTO t1 VALUES (-1, 'innodb'); +INSERT INTO t1 VALUES (-32767, 'innodb'); +INSERT INTO t1 VALUES (NULL, NULL); +SHOW CREATE TABLE t1; +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (c1 SMALLINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, NULL); +INSERT INTO t1 VALUES (-1, 'innodb'); +INSERT INTO t1 VALUES (-32757, 'innodb'); +INSERT INTO t1 VALUES (NULL, NULL); +SHOW CREATE TABLE t1; +SELECT * FROM t1; +DROP TABLE t1; +# +# MEDIUMINT +# +CREATE TABLE t1 (c1 MEDIUMINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, NULL); +INSERT INTO t1 VALUES (-1, 'innodb'); +INSERT INTO t1 VALUES (-8388607, 'innodb'); +INSERT INTO t1 VALUES (NULL, NULL); +SHOW CREATE TABLE t1; +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (c1 MEDIUMINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, NULL); +INSERT INTO t1 VALUES (-1, 'innodb'); +INSERT INTO t1 VALUES (-8388607, 'innodb'); +INSERT INTO t1 VALUES (NULL, NULL); +SHOW CREATE TABLE t1; +SELECT * FROM t1; +DROP TABLE t1; +# +# INT +# +CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, NULL); +INSERT INTO t1 VALUES (-1, 'innodb'); +INSERT INTO t1 VALUES (-2147483647, 'innodb'); +INSERT INTO t1 VALUES (NULL, NULL); +SHOW CREATE TABLE t1; +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (c1 INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, NULL); +INSERT INTO t1 VALUES (-1, 'innodb'); +INSERT INTO t1 VALUES (-2147483647, 'innodb'); +INSERT INTO t1 VALUES (NULL, NULL); +SHOW CREATE TABLE t1; +SELECT * FROM t1; +DROP TABLE t1; +# +# BIGINT +# +CREATE TABLE t1 (c1 BIGINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, NULL); +INSERT INTO t1 VALUES (-1, 'innodb'); +INSERT INTO t1 VALUES (-9223372036854775807, 'innodb'); +INSERT INTO t1 VALUES (NULL, NULL); +SHOW CREATE TABLE t1; +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (c1 BIGINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, NULL); +INSERT INTO t1 VALUES (-1, 'innodb'); +INSERT INTO t1 VALUES (-9223372036854775807, 'innodb'); +INSERT INTO t1 VALUES (NULL, NULL); +SHOW CREATE TABLE t1; +SELECT * FROM t1; +DROP TABLE t1; +# +# End negative number check + +## +# 47125: auto_increment start value is ignored if an index is created +# and engine=innodb +# +CREATE TABLE t1 (c1 INT AUTO_INCREMENT, c2 INT, PRIMARY KEY(c1)) AUTO_INCREMENT=10 ENGINE=InnoDB; +CREATE INDEX i1 on t1(c2); +SHOW CREATE TABLE t1; +INSERT INTO t1 (c2) values (0); +SELECT * FROM t1; +DROP TABLE t1; + +## +# 49032: Use the correct function to read the AUTOINC column value +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(C1 DOUBLE AUTO_INCREMENT KEY, C2 CHAR(10)) ENGINE=InnoDB; +INSERT INTO t1(C1, C2) VALUES (1, 'innodb'), (3, 'innodb'); +# Restart the server +-- source include/restart_mysqld.inc +INSERT INTO t1(C2) VALUES ('innodb'); +SHOW CREATE TABLE t1; +DROP TABLE t1; +CREATE TABLE t1(C1 FLOAT AUTO_INCREMENT KEY, C2 CHAR(10)) ENGINE=InnoDB; +INSERT INTO t1(C1, C2) VALUES (1, 'innodb'), (3, 'innodb'); +# Restart the server +-- source include/restart_mysqld.inc +INSERT INTO t1(C2) VALUES ('innodb'); +SHOW CREATE TABLE t1; +DROP TABLE t1; + +## +# 47720: REPLACE INTO Autoincrement column with negative values +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c1 INT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 SET c1 = 1; +SHOW CREATE TABLE t1; +INSERT INTO t1 SET c1 = 2; +INSERT INTO t1 SET c1 = -1; +SELECT * FROM t1; +-- error ER_DUP_ENTRY,1062 +INSERT INTO t1 SET c1 = -1; +SHOW CREATE TABLE t1; +REPLACE INTO t1 VALUES (-1); +SELECT * FROM t1; +SHOW CREATE TABLE t1; +DROP TABLE t1; + +## +# 49497: Error 1467 (ER_AUTOINC_READ_FAILED) on inserting a negative value +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (-685113344), (1), (NULL), (NULL); +SELECT * FROM t1; +SHOW CREATE TABLE t1; +DROP TABLE t1; +CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (-685113344), (2), (NULL), (NULL); +SELECT * FROM t1; +SHOW CREATE TABLE t1; +DROP TABLE t1; +CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (NULL), (2), (-685113344), (NULL); +INSERT INTO t1 VALUES (4), (5), (6), (NULL); +SELECT * FROM t1; +SHOW CREATE TABLE t1; +DROP TABLE t1; +CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (NULL), (2), (-685113344), (5); +SELECT * FROM t1; +SHOW CREATE TABLE t1; +DROP TABLE t1; +CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1), (2), (-685113344), (NULL); +SELECT * FROM t1; +SHOW CREATE TABLE t1; +DROP TABLE t1; + + +# +# restore environment to the state it was before this test execution +# + +-- disable_query_log +eval SET GLOBAL innodb_file_format_check=$innodb_file_format_check_orig; diff --git a/mysql-test/suite/innodb/t/innodb-consistent-master.opt b/mysql-test/suite/innodb/t/innodb-consistent-master.opt new file mode 100644 index 00000000000..e76299453d3 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb-consistent-master.opt @@ -0,0 +1 @@ +--innodb_lock_wait_timeout=2 diff --git a/mysql-test/suite/innodb/t/innodb-consistent.test b/mysql-test/suite/innodb/t/innodb-consistent.test new file mode 100644 index 00000000000..bf829a74ea2 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb-consistent.test @@ -0,0 +1,58 @@ +-- source include/not_embedded.inc +-- source include/have_innodb.inc + +--disable_warnings +drop table if exists t1; +--enable_warnings + +# REPLACE INTO ... SELECT and INSERT INTO ... SELECT should do +# a consistent read of the source table. + +connect (a,localhost,root,,); +connect (b,localhost,root,,); +connection a; +set session transaction isolation level read committed; +create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1; +create table t2 like t1; +insert into t2 values (1),(2),(3),(4),(5),(6),(7); +set autocommit=0; + +# REPLACE INTO ... SELECT case +begin; +# this should not result in any locks on t2. +replace into t1 select * from t2; + +connection b; +set session transaction isolation level read committed; +set autocommit=0; +# should not cause a lock wait. +delete from t2 where a=5; +commit; +delete from t2; +commit; +connection a; +commit; + +# INSERT INTO ... SELECT case +begin; +# this should not result in any locks on t2. +insert into t1 select * from t2; + +connection b; +set session transaction isolation level read committed; +set autocommit=0; +# should not cause a lock wait. +delete from t2 where a=5; +commit; +delete from t2; +commit; +connection a; +commit; + +select * from t1; +drop table t1; +drop table t2; + +connection default; +disconnect a; +disconnect b; diff --git a/mysql-test/suite/innodb/t/innodb-index.test b/mysql-test/suite/innodb/t/innodb-index.test index b5dd2e037e7..f7cf3050704 100644 --- a/mysql-test/suite/innodb/t/innodb-index.test +++ b/mysql-test/suite/innodb/t/innodb-index.test @@ -1,5 +1,7 @@ -- source include/have_innodb.inc +let $MYSQLD_DATADIR= `select @@datadir`; + let $innodb_file_format_check_orig=`select @@innodb_file_format_check`; create table t1(a int not null, b int, c char(10) not null, d varchar(20)) engine = innodb; @@ -19,16 +21,6 @@ show create table t1; alter table t1 add index (b); show create table t1; -# Check how existing tables interfere with temporary tables. -CREATE TABLE `t1#1`(a INT PRIMARY KEY) ENGINE=InnoDB; - ---error 156 -alter table t1 add unique index (c), add index (d); -rename table `t1#1` to `t1#2`; ---error 156 -alter table t1 add unique index (c), add index (d); -drop table `t1#2`; - alter table t1 add unique index (c), add index (d); show create table t1; explain select * from t1 force index(c) order by c; @@ -139,6 +131,8 @@ show create table t4; --error ER_CANT_CREATE_TABLE alter table t3 add constraint dc foreign key (a) references t1(a); show create table t3; +# this should be fixed by MySQL (see Bug #51451) +--error ER_WRONG_NAME_FOR_INDEX alter table t2 drop index b, add index (b); show create table t2; --error ER_ROW_IS_REFERENCED_2 @@ -146,7 +140,9 @@ delete from t1; --error ER_CANT_DROP_FIELD_OR_KEY drop index dc on t4; # there is no foreign key dc on t3 ---replace_regex /'\.\/test\/#sql2-[0-9a-f-]*'/'#sql2-temporary'/ +--replace_regex /'[^']*test\/#sql2-[0-9a-f-]*'/'#sql2-temporary'/ +# Embedded server doesn't chdir to data directory +--replace_result $MYSQLD_DATADIR ./ master-data/ '' --error ER_ERROR_ON_RENAME alter table t3 drop foreign key dc; alter table t4 drop foreign key dc; @@ -157,7 +153,7 @@ select * from t2; drop table t2,t4,t3,t1; -- let charset = utf8 --- source suite/innodb/include/innodb-index.inc +-- source include/innodb-index.inc create table t1(a int not null, b int) engine = innodb; insert into t1 values (1,1),(1,1),(1,1),(1,1); @@ -292,66 +288,73 @@ show create table t1; check table t1; explain select * from t1 where b like 'adfd%'; +# The following tests are disabled because of the introduced timeouts for +# metadata locks at the MySQL level as part of the fix for +# Bug#45225 Locking: hang if drop table with no timeout +# The following commands now play with MySQL metadata locks instead of +# InnoDB locks +# start disabled45225_1 +## +## Test locking +## # -# Test locking +#create table t2(a int, b varchar(255), primary key(a,b)) engine=innodb; +#insert into t2 select a,left(b,255) from t1; +#drop table t1; +#rename table t2 to t1; # - -create table t2(a int, b varchar(255), primary key(a,b)) engine=innodb; -insert into t2 select a,left(b,255) from t1; -drop table t1; -rename table t2 to t1; - -connect (a,localhost,root,,); -connect (b,localhost,root,,); -connection a; -set innodb_lock_wait_timeout=1; -begin; -# Obtain an IX lock on the table -select a from t1 limit 1 for update; -connection b; -set innodb_lock_wait_timeout=1; -# This would require an S lock on the table, conflicting with the IX lock. ---error ER_LOCK_WAIT_TIMEOUT -create index t1ba on t1 (b,a); -connection a; -commit; -begin; -# Obtain an IS lock on the table -select a from t1 limit 1 lock in share mode; -connection b; -# This will require an S lock on the table. No conflict with the IS lock. -create index t1ba on t1 (b,a); -# This would require an X lock on the table, conflicting with the IS lock. ---error ER_LOCK_WAIT_TIMEOUT -drop index t1ba on t1; -connection a; -commit; -explain select a from t1 order by b; ---send -select a,sleep(2+a/100) from t1 order by b limit 3; - -# The following DROP INDEX will succeed, altough the SELECT above has -# opened a read view. However, during the execution of the SELECT, -# MySQL should hold a table lock that should block the execution -# of the DROP INDEX below. - -connection b; -select sleep(1); -drop index t1ba on t1; - -# After the index was dropped, subsequent SELECTs will use the same -# read view, but they should not be accessing the dropped index any more. - -connection a; -reap; -explain select a from t1 order by b; -select a from t1 order by b limit 3; -commit; - -connection default; -disconnect a; -disconnect b; - +#connect (a,localhost,root,,); +#connect (b,localhost,root,,); +#connection a; +#set innodb_lock_wait_timeout=1; +#begin; +## Obtain an IX lock on the table +#select a from t1 limit 1 for update; +#connection b; +#set innodb_lock_wait_timeout=1; +## This would require an S lock on the table, conflicting with the IX lock. +#--error ER_LOCK_WAIT_TIMEOUT +#create index t1ba on t1 (b,a); +#connection a; +#commit; +#begin; +## Obtain an IS lock on the table +#select a from t1 limit 1 lock in share mode; +#connection b; +## This will require an S lock on the table. No conflict with the IS lock. +#create index t1ba on t1 (b,a); +## This would require an X lock on the table, conflicting with the IS lock. +#--error ER_LOCK_WAIT_TIMEOUT +#drop index t1ba on t1; +#connection a; +#commit; +#explain select a from t1 order by b; +#--send +#select a,sleep(2+a/100) from t1 order by b limit 3; +# +## The following DROP INDEX will succeed, altough the SELECT above has +## opened a read view. However, during the execution of the SELECT, +## MySQL should hold a table lock that should block the execution +## of the DROP INDEX below. +# +#connection b; +#select sleep(1); +#drop index t1ba on t1; +# +## After the index was dropped, subsequent SELECTs will use the same +## read view, but they should not be accessing the dropped index any more. +# +#connection a; +#reap; +#explain select a from t1 order by b; +#select a from t1 order by b limit 3; +#commit; +# +#connection default; +#disconnect a; +#disconnect b; +# +# end disabled45225_1 drop table t1; let $per_table=`select @@innodb_file_per_table`; @@ -513,28 +516,34 @@ SHOW CREATE TABLE t2; DROP TABLE t2; DROP TABLE t1; -connect (a,localhost,root,,); -connect (b,localhost,root,,); -connection a; -CREATE TABLE t1 (a INT, b CHAR(1)) ENGINE=InnoDB; -INSERT INTO t1 VALUES (3,'a'),(3,'b'),(1,'c'),(0,'d'),(1,'e'); -connection b; -BEGIN; -SELECT * FROM t1; -connection a; -CREATE INDEX t1a ON t1(a); -connection b; -SELECT * FROM t1; ---error ER_TABLE_DEF_CHANGED -SELECT * FROM t1 FORCE INDEX(t1a) ORDER BY a; -SELECT * FROM t1; -COMMIT; -SELECT * FROM t1 FORCE INDEX(t1a) ORDER BY a; -connection default; -disconnect a; -disconnect b; - -DROP TABLE t1; +# The following tests are disabled because of the introduced timeouts for +# metadata locks at the MySQL level as part of the fix for +# Bug#45225 Locking: hang if drop table with no timeout +# The following CREATE INDEX t1a ON t1(a); causes a lock wait timeout +# start disabled45225_2 +#connect (a,localhost,root,,); +#connect (b,localhost,root,,); +#connection a; +#CREATE TABLE t1 (a INT, b CHAR(1)) ENGINE=InnoDB; +#INSERT INTO t1 VALUES (3,'a'),(3,'b'),(1,'c'),(0,'d'),(1,'e'); +#connection b; +#BEGIN; +#SELECT * FROM t1; +#connection a; +#CREATE INDEX t1a ON t1(a); +#connection b; +#SELECT * FROM t1; +#--error ER_TABLE_DEF_CHANGED +#SELECT * FROM t1 FORCE INDEX(t1a) ORDER BY a; +#SELECT * FROM t1; +#COMMIT; +#SELECT * FROM t1 FORCE INDEX(t1a) ORDER BY a; +#connection default; +#disconnect a; +#disconnect b; +# +#DROP TABLE t1; +# end disabled45225_2 # # restore environment to the state it was before this test execution diff --git a/mysql-test/suite/innodb/t/innodb-index_ucs2.test b/mysql-test/suite/innodb/t/innodb-index_ucs2.test index db4626ac346..fff9a4da1a8 100644 --- a/mysql-test/suite/innodb/t/innodb-index_ucs2.test +++ b/mysql-test/suite/innodb/t/innodb-index_ucs2.test @@ -2,4 +2,4 @@ -- source include/have_ucs2.inc -- let charset = ucs2 --- source suite/innodb/include/innodb-index.inc +-- source include/innodb-index.inc diff --git a/mysql-test/suite/innodb/t/innodb-lock.test b/mysql-test/suite/innodb/t/innodb-lock.test new file mode 100644 index 00000000000..05df3615822 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb-lock.test @@ -0,0 +1,128 @@ +-- source include/have_innodb.inc + +# +# Check and select innodb lock type +# + +set global innodb_table_locks=1; + +select @@innodb_table_locks; + +# +# Testing of explicit table locks with enforced table locks +# + +connect (con1,localhost,root,,); +connect (con2,localhost,root,,); + +--disable_warnings +drop table if exists t1; +--enable_warnings + +# +# Testing of explicit table locks with enforced table locks +# + +set @@innodb_table_locks=1; + +connection con1; +create table t1 (id integer, x integer) engine=INNODB; +insert into t1 values(0, 0); +set autocommit=0; +SELECT * from t1 where id = 0 FOR UPDATE; + +connection con2; +set autocommit=0; + +# The following statement should hang because con1 is locking the page +--send +lock table t1 write; +--sleep 2 + +connection con1; +update t1 set x=1 where id = 0; +select * from t1; +commit; + +connection con2; +reap; +update t1 set x=2 where id = 0; +commit; +unlock tables; + +connection con1; +select * from t1; +commit; + +drop table t1; + +--echo # +--echo # Old lock method (where LOCK TABLE was ignored by InnoDB) no longer +--echo # works when LOCK TABLE ... WRITE is used due to fix for bugs #46272 +--echo # "MySQL 5.4.4, new MDL: unnecessary and bug #37346 "innodb does not +--echo # detect deadlock between update and alter table". But it still works +--echo # for LOCK TABLE ... READ. +--echo # + +set @@innodb_table_locks=0; + +create table t1 (id integer primary key, x integer) engine=INNODB; +insert into t1 values(0, 0),(1,1),(2,2); +commit; +SELECT * from t1 where id = 0 FOR UPDATE; + +--echo # Connection 'con2'. +connection con2; +set autocommit=0; +set @@innodb_table_locks=0; + +--echo # The following statement should block because SQL-level lock +--echo # is taken on t1 which will wait until concurrent transaction +--echo # is commited. +--echo # Sending: +--send lock table t1 write; + +--echo # Connection 'con1'. +connection con1; +--echo # Wait until LOCK TABLE is blocked on SQL-level lock. +let $wait_condition= + select count(*) = 1 from information_schema.processlist + where state = "Waiting for table" and info = "lock table t1 write"; +--source include/wait_condition.inc +--echo # We should be able to do UPDATEs and SELECTs within transaction. +update t1 set x=1 where id = 0; +select * from t1; +--echo # Unblock LOCK TABLE. +commit; + +--echo # Connection 'con2'. +connection con2; +--echo # Reap LOCK TABLE. +--reap +unlock tables; + +--echo # Connection 'con1'. +connection con1; + +select * from t1 where id = 0 for update; + +--echo # Connection 'con2'. +connection con2; +--echo # The below statement should not be blocked as LOCK TABLES ... READ +--echo # does not take strong SQL-level lock on t1. SELECTs which do not +--echo # conflict with transaction in the first connections should not be +--echo # blocked. +lock table t1 read; +select * from t1; +select * from t1 where id = 1 lock in share mode; +unlock tables; +select * from t1; +commit; + +--echo # Connection 'con1'. +connection con1; +commit; + +drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/suite/innodb/t/innodb-master.opt b/mysql-test/suite/innodb/t/innodb-master.opt new file mode 100644 index 00000000000..4901efb416c --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb-master.opt @@ -0,0 +1 @@ +--binlog_cache_size=32768 --innodb_lock_wait_timeout=1 diff --git a/mysql-test/suite/innodb/t/innodb-replace.test b/mysql-test/suite/innodb/t/innodb-replace.test new file mode 100644 index 00000000000..8c3aacde5e8 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb-replace.test @@ -0,0 +1,22 @@ +-- source include/have_innodb.inc +# embedded server ignores 'delayed', so skip this +-- source include/not_embedded.inc + +--disable_warnings +drop table if exists t1; +--enable_warnings + +# +# Bug #1078 +# +create table t1 (c1 char(5) unique not null, c2 int, stamp timestamp) engine=innodb; +select * from t1; +--error ER_DELAYED_NOT_SUPPORTED +replace delayed into t1 (c1, c2) values ( "text1","11"); +select * from t1; +--error ER_DELAYED_NOT_SUPPORTED +replace delayed into t1 (c1, c2) values ( "text1","12"); +select * from t1; +drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/suite/innodb/t/innodb-semi-consistent-master.opt b/mysql-test/suite/innodb/t/innodb-semi-consistent-master.opt new file mode 100644 index 00000000000..e76299453d3 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb-semi-consistent-master.opt @@ -0,0 +1 @@ +--innodb_lock_wait_timeout=2 diff --git a/mysql-test/suite/innodb/t/innodb-semi-consistent.test b/mysql-test/suite/innodb/t/innodb-semi-consistent.test new file mode 100644 index 00000000000..61ad7815ca9 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb-semi-consistent.test @@ -0,0 +1,68 @@ +-- source include/not_embedded.inc +-- source include/have_innodb.inc + +--disable_warnings +drop table if exists t1; +--enable_warnings + +# basic tests of semi-consistent reads + +connect (a,localhost,root,,); +connect (b,localhost,root,,); +connection a; +set binlog_format=mixed; +set session transaction isolation level repeatable read; +create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1; +insert into t1 values (1),(2),(3),(4),(5),(6),(7); +set autocommit=0; +# this should lock the entire table +select * from t1 where a=3 lock in share mode; +connection b; +set binlog_format=mixed; +set session transaction isolation level repeatable read; +set autocommit=0; +-- error ER_LOCK_WAIT_TIMEOUT +update t1 set a=10 where a=5; +connection a; +commit; +connection b; +# perform a semi-consisent read (and unlock non-matching rows) +set session transaction isolation level read committed; +update t1 set a=10 where a=5; +connection a; +-- error ER_LOCK_WAIT_TIMEOUT +select * from t1 where a=2 for update; +# this should lock the records (1),(2) +select * from t1 where a=2 limit 1 for update; +connection b; +# semi-consistent read will skip non-matching locked rows a=1, a=2 +update t1 set a=11 where a=6; +-- error ER_LOCK_WAIT_TIMEOUT +update t1 set a=12 where a=2; +-- error ER_LOCK_WAIT_TIMEOUT +update t1 set a=13 where a=1; +connection a; +commit; +connection b; +update t1 set a=14 where a=1; +commit; +connection a; +select * from t1; +drop table t1; + +connection default; +disconnect a; +disconnect b; + +# Bug 39320 +create table t1 (a int, b int) engine=myisam; +create table t2 (c int, d int, key (c)) engine=innodb; +insert into t1 values (1,1); +insert into t2 values (1,2); +connect (a,localhost,root,,); +connection a; +set session transaction isolation level read committed; +delete from t1 using t1 join t2 on t1.a = t2.c where t2.d in (1); +connection default; +disconnect a; +drop table t1, t2; diff --git a/mysql-test/suite/innodb/t/innodb-system-table-view.test b/mysql-test/suite/innodb/t/innodb-system-table-view.test new file mode 100644 index 00000000000..e570a33b59d --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb-system-table-view.test @@ -0,0 +1,94 @@ +# This is the test for Information Schema System Table View +# that displays the InnoDB system table content through +# information schema tables. + +--source include/have_innodb.inc + +SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES; + +SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES; + +SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS; + +SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FIELDS; + +SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN; + +SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS; + +SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS; + +# Create a foreign key constraint, and verify the information +# in INFORMATION_SCHEMA.INNODB_SYS_FOREIGN and +# INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS +CREATE TABLE parent (id INT NOT NULL, + PRIMARY KEY (id)) ENGINE=INNODB; + +CREATE TABLE child (id INT, parent_id INT, + INDEX par_ind (parent_id), + CONSTRAINT constraint_test + FOREIGN KEY (parent_id) REFERENCES parent(id) + ON DELETE CASCADE) ENGINE=INNODB; + +SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN; + +SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS; + +# Insert a row in the table "parent", and see whether that reflected in +# INNODB_SYS_TABLESTATS +INSERT INTO parent VALUES(1); + +SELECT name, num_rows, mysql_handles_opened +FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS +WHERE name LIKE "%parent"; + +SELECT NAME, FLAG, N_COLS, SPACE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES; + +SELECT name, n_fields +from INFORMATION_SCHEMA.INNODB_SYS_INDEXES +WHERE table_id In (SELECT table_id from + INFORMATION_SCHEMA.INNODB_SYS_TABLES + WHERE name LIKE "%parent%"); + +SELECT name, n_fields +from INFORMATION_SCHEMA.INNODB_SYS_INDEXES +WHERE table_id In (SELECT table_id from + INFORMATION_SCHEMA.INNODB_SYS_TABLES + WHERE name LIKE "%child%"); + +SELECT name, pos, mtype, len +from INFORMATION_SCHEMA.INNODB_SYS_COLUMNS +WHERE table_id In (SELECT table_id from + INFORMATION_SCHEMA.INNODB_SYS_TABLES + WHERE name LIKE "%child%"); + +DROP TABLE child; + +DROP TABLE parent; + +# Create table with 2 columns in the foreign key constraint +CREATE TABLE parent (id INT NOT NULL, newid INT NOT NULL, + PRIMARY KEY (id, newid)) ENGINE=INNODB; + +CREATE TABLE child (id INT, parent_id INT, + INDEX par_ind (parent_id), + CONSTRAINT constraint_test + FOREIGN KEY (id, parent_id) REFERENCES parent(id, newid) + ON DELETE CASCADE) ENGINE=INNODB; + +SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN; + +SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS; + +INSERT INTO parent VALUES(1, 9); + +# Nested query will open the table handle twice +SELECT * FROM parent WHERE id IN (SELECT id FROM parent); + +SELECT name, num_rows, mysql_handles_opened +FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS +WHERE name LIKE "%parent"; + +DROP TABLE child; + +DROP TABLE parent; diff --git a/mysql-test/suite/innodb/t/innodb-use-sys-malloc-master.opt b/mysql-test/suite/innodb/t/innodb-use-sys-malloc-master.opt index 8ec086387f8..acf3b8729ed 100644 --- a/mysql-test/suite/innodb/t/innodb-use-sys-malloc-master.opt +++ b/mysql-test/suite/innodb/t/innodb-use-sys-malloc-master.opt @@ -1,2 +1 @@ ---loose-innodb-use-sys-malloc=true ---loose-innodb-use-sys-malloc=true +--innodb-use-sys-malloc=true diff --git a/mysql-test/suite/innodb/t/innodb-zip.test b/mysql-test/suite/innodb/t/innodb-zip.test index eb517563416..8ba83517b44 100644 --- a/mysql-test/suite/innodb/t/innodb-zip.test +++ b/mysql-test/suite/innodb/t/innodb-zip.test @@ -85,7 +85,8 @@ SELECT table_schema, table_name, row_format FROM information_schema.tables WHERE engine='innodb'; drop table t1,t2; -# The following should fail even in non-strict mode. +# The following should fail in non-strict mode too. +# (The fix of Bug #50945 only affects REDUNDANT and COMPACT tables.) SET SESSION innodb_strict_mode = off; --error ER_TOO_BIG_ROWSIZE CREATE TABLE t1( diff --git a/mysql-test/suite/innodb/t/innodb.test b/mysql-test/suite/innodb/t/innodb.test new file mode 100644 index 00000000000..a283cd26ccb --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb.test @@ -0,0 +1,2567 @@ +--source include/not_windows_embedded.inc +# remove this when +# Bug#53947 InnoDB: Assertion failure in thread 4224 in file +# .\sync\sync0sync.c line 324 +# is fixed + +####################################################################### +# # +# Please, DO NOT TOUCH this file as well as the innodb.result file. # +# These files are to be modified ONLY BY INNOBASE guys. # +# # +# Use innodb_mysql.[test|result] files instead. # +# # +# If nevertheless you need to make some changes here, please, forward # +# your commit message # +# To: innodb_dev_ww@oracle.com # +# Cc: dev-innodb@mysql.com # +# (otherwise your changes may be erased). # +# # +####################################################################### + +-- source include/have_innodb.inc + +let $MYSQLD_DATADIR= `select @@datadir`; + +# Save the original values of some variables in order to be able to +# estimate how much they have changed during the tests. Previously this +# test assumed that e.g. rows_deleted is 0 here and after deleting 23 +# rows it expected that rows_deleted will be 23. Now we do not make +# assumptions about the values of the variables at the beginning, e.g. +# rows_deleted should be 23 + "rows_deleted before the test". This allows +# the test to be run multiple times without restarting the mysqld server. +# See Bug#43309 Test main.innodb can't be run twice +-- disable_query_log +SET @innodb_thread_concurrency_orig = @@innodb_thread_concurrency; + +SET @innodb_rows_deleted_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_deleted'); +SET @innodb_rows_inserted_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_inserted'); +SET @innodb_rows_updated_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_updated'); +SET @innodb_row_lock_waits_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_waits'); +SET @innodb_row_lock_current_waits_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_current_waits'); +SET @innodb_row_lock_time_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time'); +SET @innodb_row_lock_time_max_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_max'); +SET @innodb_row_lock_time_avg_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_avg'); +-- enable_query_log + +--disable_warnings +drop table if exists t1,t2,t3,t4; +drop database if exists mysqltest; +--enable_warnings + +# +# Small basic test with ignore +# + +create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) engine=innodb; + +insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David'), (2, 'Erik'), (3, 'Sasha'), (3, 'Jeremy'), (4, 'Matt'); +select id, code, name from t1 order by id; + +update ignore t1 set id = 8, name = 'Sinisa' where id < 3; +select id, code, name from t1 order by id; +update ignore t1 set id = id + 10, name = 'Ralph' where id < 4; +select id, code, name from t1 order by id; + +drop table t1; + +# +# A bit bigger test +# The 'replace_column' statements are needed because the cardinality calculated +# by innodb is not always the same between runs +# + +CREATE TABLE t1 ( + id int(11) NOT NULL auto_increment, + parent_id int(11) DEFAULT '0' NOT NULL, + level tinyint(4) DEFAULT '0' NOT NULL, + PRIMARY KEY (id), + KEY parent_id (parent_id), + KEY level (level) +) engine=innodb; +INSERT INTO t1 VALUES (1,0,0),(3,1,1),(4,1,1),(8,2,2),(9,2,2),(17,3,2),(22,4,2),(24,4,2),(28,5,2),(29,5,2),(30,5,2),(31,6,2),(32,6,2),(33,6,2),(203,7,2),(202,7,2),(20,3,2),(157,0,0),(193,5,2),(40,7,2),(2,1,1),(15,2,2),(6,1,1),(34,6,2),(35,6,2),(16,3,2),(7,1,1),(36,7,2),(18,3,2),(26,5,2),(27,5,2),(183,4,2),(38,7,2),(25,5,2),(37,7,2),(21,4,2),(19,3,2),(5,1,1),(179,5,2); +update t1 set parent_id=parent_id+100; +select * from t1 where parent_id=102; +update t1 set id=id+1000; +-- error ER_DUP_ENTRY,1022 +update t1 set id=1024 where id=1009; +select * from t1; +update ignore t1 set id=id+1; # This will change all rows +select * from t1; +update ignore t1 set id=1023 where id=1010; +select * from t1 where parent_id=102; +--replace_column 9 # +explain select level from t1 where level=1; +--replace_column 9 # +explain select level,id from t1 where level=1; +--replace_column 9 # +explain select level,id,parent_id from t1 where level=1; +select level,id from t1 where level=1; +select level,id,parent_id from t1 where level=1; +optimize table t1; +--replace_column 7 # +show keys from t1; +drop table t1; + +# +# Test replace +# + +CREATE TABLE t1 ( + gesuchnr int(11) DEFAULT '0' NOT NULL, + benutzer_id int(11) DEFAULT '0' NOT NULL, + PRIMARY KEY (gesuchnr,benutzer_id) +) engine=innodb; + +replace into t1 (gesuchnr,benutzer_id) values (2,1); +replace into t1 (gesuchnr,benutzer_id) values (1,1); +replace into t1 (gesuchnr,benutzer_id) values (1,1); +select * from t1; +drop table t1; + +# +# test delete using hidden_primary_key +# + +create table t1 (a int) engine=innodb; +insert into t1 values (1), (2); +optimize table t1; +delete from t1 where a = 1; +select * from t1; +check table t1; +drop table t1; + +create table t1 (a int,b varchar(20)) engine=innodb; +insert into t1 values (1,""), (2,"testing"); +delete from t1 where a = 1; +select * from t1; +create index skr on t1 (a); +insert into t1 values (3,""), (4,"testing"); +analyze table t1; +--replace_column 7 # +show keys from t1; +drop table t1; + + +# Test of reading on secondary key with may be null + +create table t1 (a int,b varchar(20),key(a)) engine=innodb; +insert into t1 values (1,""), (2,"testing"); +select * from t1 where a = 1; +drop table t1; + +# +# Test rollback +# + +create table t1 (n int not null primary key) engine=innodb; +set autocommit=0; +insert into t1 values (4); +rollback; +select n, "after rollback" from t1; +insert into t1 values (4); +commit; +select n, "after commit" from t1; +commit; +insert into t1 values (5); +-- error ER_DUP_ENTRY +insert into t1 values (4); +commit; +select n, "after commit" from t1; +set autocommit=1; +insert into t1 values (6); +-- error ER_DUP_ENTRY +insert into t1 values (4); +select n from t1; +set autocommit=0; +# +# savepoints +# +begin; +savepoint `my_savepoint`; +insert into t1 values (7); +savepoint `savept2`; +insert into t1 values (3); +select n from t1; +savepoint savept3; +rollback to savepoint savept2; +--error 1305 +rollback to savepoint savept3; +rollback to savepoint savept2; +release savepoint `my_savepoint`; +select n from t1; +-- error 1305 +rollback to savepoint `my_savepoint`; +--error 1305 +rollback to savepoint savept2; +insert into t1 values (8); +savepoint sv; +commit; +savepoint sv; +set autocommit=1; +# nop +rollback; +drop table t1; + +# +# Test for commit and FLUSH TABLES WITH READ LOCK +# + +create table t1 (n int not null primary key) engine=innodb; +start transaction; +insert into t1 values (4); +flush tables with read lock; +# +# Current code can't handle a read lock in middle of transaction +#--error 1223; +commit; +unlock tables; +commit; +select * from t1; +drop table t1; + +# +# Testing transactions +# + +create table t1 ( id int NOT NULL PRIMARY KEY, nom varchar(64)) engine=innodb; +begin; +insert into t1 values(1,'hamdouni'); +select id as afterbegin_id,nom as afterbegin_nom from t1; +rollback; +select id as afterrollback_id,nom as afterrollback_nom from t1; +set autocommit=0; +insert into t1 values(2,'mysql'); +select id as afterautocommit0_id,nom as afterautocommit0_nom from t1; +rollback; +select id as afterrollback_id,nom as afterrollback_nom from t1; +set autocommit=1; +drop table t1; + +# +# Simple not autocommit test +# + +CREATE TABLE t1 (id char(8) not null primary key, val int not null) engine=innodb; +insert into t1 values ('pippo', 12); +-- error ER_DUP_ENTRY +insert into t1 values ('pippo', 12); # Gives error +delete from t1; +delete from t1 where id = 'pippo'; +select * from t1; + +insert into t1 values ('pippo', 12); +set autocommit=0; +delete from t1; +rollback; +select * from t1; +delete from t1; +commit; +select * from t1; +drop table t1; + +# +# Test of active transactions +# + +create table t1 (a integer) engine=innodb; +start transaction; +rename table t1 to t2; +create table t1 (b integer) engine=innodb; +insert into t1 values (1); +rollback; +drop table t1; +rename table t2 to t1; +drop table t1; +set autocommit=1; + +# +# The following simple tests failed at some point +# + +CREATE TABLE t1 (ID INTEGER NOT NULL PRIMARY KEY, NAME VARCHAR(64)) ENGINE=innodb; +INSERT INTO t1 VALUES (1, 'Jochen'); +select * from t1; +drop table t1; + +CREATE TABLE t1 ( _userid VARCHAR(60) NOT NULL PRIMARY KEY) ENGINE=innodb; +set autocommit=0; +INSERT INTO t1 SET _userid='marc@anyware.co.uk'; +COMMIT; +SELECT * FROM t1; +SELECT _userid FROM t1 WHERE _userid='marc@anyware.co.uk'; +drop table t1; +set autocommit=1; + +# +# Test when reading on part of unique key +# +CREATE TABLE t1 ( + user_id int(10) DEFAULT '0' NOT NULL, + name varchar(100), + phone varchar(100), + ref_email varchar(100) DEFAULT '' NOT NULL, + detail varchar(200), + PRIMARY KEY (user_id,ref_email) +)engine=innodb; + +INSERT INTO t1 VALUES (10292,'sanjeev','29153373','sansh777@hotmail.com','xxx'),(10292,'shirish','2333604','shirish@yahoo.com','ddsds'),(10292,'sonali','323232','sonali@bolly.com','filmstar'); +select * from t1 where user_id=10292; +INSERT INTO t1 VALUES (10291,'sanjeev','29153373','sansh777@hotmail.com','xxx'),(10293,'shirish','2333604','shirish@yahoo.com','ddsds'); +select * from t1 where user_id=10292; +select * from t1 where user_id>=10292; +select * from t1 where user_id>10292; +select * from t1 where user_id<10292; +drop table t1; + +# +# Test that keys are created in right order +# + +CREATE TABLE t1 (a int not null, b int not null,c int not null, +key(a),primary key(a,b), unique(c),key(a),unique(b)); +--replace_column 7 # +show index from t1; +drop table t1; + +# +# Test of ALTER TABLE and innodb tables +# + +create table t1 (col1 int not null, col2 char(4) not null, primary key(col1)); +alter table t1 engine=innodb; +insert into t1 values ('1','1'),('5','2'),('2','3'),('3','4'),('4','4'); +select * from t1; +update t1 set col2='7' where col1='4'; +select * from t1; +alter table t1 add co3 int not null; +select * from t1; +update t1 set col2='9' where col1='2'; +select * from t1; +drop table t1; + +# +# INSERT INTO innodb tables +# + +create table t1 (a int not null , b int, primary key (a)) engine = innodb; +create table t2 (a int not null , b int, primary key (a)) engine = myisam; +insert into t1 VALUES (1,3) , (2,3), (3,3); +select * from t1; +insert into t2 select * from t1; +select * from t2; +delete from t1 where b = 3; +select * from t1; +insert into t1 select * from t2; +select * from t1; +select * from t2; +drop table t1,t2; + +# +# ORDER BY on not primary key +# + +CREATE TABLE t1 ( + user_name varchar(12), + password text, + subscribed char(1), + user_id int(11) DEFAULT '0' NOT NULL, + quota bigint(20), + weight double, + access_date date, + access_time time, + approved datetime, + dummy_primary_key int(11) NOT NULL auto_increment, + PRIMARY KEY (dummy_primary_key) +) ENGINE=innodb; +INSERT INTO t1 VALUES ('user_0','somepassword','N',0,0,0,'2000-09-07','23:06:59','2000-09-07 23:06:59',1); +INSERT INTO t1 VALUES ('user_1','somepassword','Y',1,1,1,'2000-09-07','23:06:59','2000-09-07 23:06:59',2); +INSERT INTO t1 VALUES ('user_2','somepassword','N',2,2,1.4142135623731,'2000-09-07','23:06:59','2000-09-07 23:06:59',3); +INSERT INTO t1 VALUES ('user_3','somepassword','Y',3,3,1.7320508075689,'2000-09-07','23:06:59','2000-09-07 23:06:59',4); +INSERT INTO t1 VALUES ('user_4','somepassword','N',4,4,2,'2000-09-07','23:06:59','2000-09-07 23:06:59',5); +select user_name, password , subscribed, user_id, quota, weight, access_date, access_time, approved, dummy_primary_key from t1 order by user_name; +drop table t1; + +# +# Testing of tables without primary keys +# + +CREATE TABLE t1 ( + id int(11) NOT NULL auto_increment, + parent_id int(11) DEFAULT '0' NOT NULL, + level tinyint(4) DEFAULT '0' NOT NULL, + KEY (id), + KEY parent_id (parent_id), + KEY level (level) +) engine=innodb; +INSERT INTO t1 VALUES (1,0,0),(3,1,1),(4,1,1),(8,2,2),(9,2,2),(17,3,2),(22,4,2),(24,4,2),(28,5,2),(29,5,2),(30,5,2),(31,6,2),(32,6,2),(33,6,2),(203,7,2),(202,7,2),(20,3,2),(157,0,0),(193,5,2),(40,7,2),(2,1,1),(15,2,2),(6,1,1),(34,6,2),(35,6,2),(16,3,2),(7,1,1),(36,7,2),(18,3,2),(26,5,2),(27,5,2),(183,4,2),(38,7,2),(25,5,2),(37,7,2),(21,4,2),(19,3,2),(5,1,1); +INSERT INTO t1 values (179,5,2); +update t1 set parent_id=parent_id+100; +select * from t1 where parent_id=102; +update t1 set id=id+1000; +update t1 set id=1024 where id=1009; +select * from t1; +update ignore t1 set id=id+1; # This will change all rows +select * from t1; +update ignore t1 set id=1023 where id=1010; +select * from t1 where parent_id=102; +--replace_column 9 # +explain select level from t1 where level=1; +select level,id from t1 where level=1; +select level,id,parent_id from t1 where level=1; +select level,id from t1 where level=1 order by id; +delete from t1 where level=1; +select * from t1; +drop table t1; + +# +# Test of index only reads +# +CREATE TABLE t1 ( + sca_code char(6) NOT NULL, + cat_code char(6) NOT NULL, + sca_desc varchar(50), + lan_code char(2) NOT NULL, + sca_pic varchar(100), + sca_sdesc varchar(50), + sca_sch_desc varchar(16), + PRIMARY KEY (sca_code, cat_code, lan_code), + INDEX sca_pic (sca_pic) +) engine = innodb ; + +INSERT INTO t1 ( sca_code, cat_code, sca_desc, lan_code, sca_pic, sca_sdesc, sca_sch_desc) VALUES ( 'PD', 'J', 'PENDANT', 'EN', NULL, NULL, 'PENDANT'),( 'RI', 'J', 'RING', 'EN', NULL, NULL, 'RING'),( 'QQ', 'N', 'RING', 'EN', 'not null', NULL, 'RING'); +select count(*) from t1 where sca_code = 'PD'; +select count(*) from t1 where sca_code <= 'PD'; +select count(*) from t1 where sca_pic is null; +# this should be fixed by MySQL (see Bug #51451) +# now that http://bugs.mysql.com/49838 is fixed the following ALTER does +# copy the table instead of failing +# --error ER_WRONG_NAME_FOR_INDEX +alter table t1 drop index sca_pic, add index sca_pic (cat_code, sca_pic); +alter table t1 drop index sca_pic; +alter table t1 add index sca_pic (cat_code, sca_pic); +select count(*) from t1 where sca_code='PD' and sca_pic is null; +select count(*) from t1 where cat_code='E'; + +# this should be fixed by MySQL (see Bug #51451) +--error ER_WRONG_NAME_FOR_INDEX +alter table t1 drop index sca_pic, add index (sca_pic, cat_code); +alter table t1 drop index sca_pic; +alter table t1 add index (sca_pic, cat_code); +select count(*) from t1 where sca_code='PD' and sca_pic is null; +select count(*) from t1 where sca_pic >= 'n'; +select sca_pic from t1 where sca_pic is null; +update t1 set sca_pic="test" where sca_pic is null; +delete from t1 where sca_code='pd'; +drop table t1; + +# +# Test of opening table twice and timestamps +# +set @a:=now(); +CREATE TABLE t1 (a int not null, b timestamp not null, primary key (a)) engine=innodb; +insert into t1 (a) values(1),(2),(3); +select t1.a from t1 natural join t1 as t2 where t1.b >= @a order by t1.a; +select a from t1 natural join t1 as t2 where b >= @a order by a; +update t1 set a=5 where a=1; +select a from t1; +drop table t1; + +# +# Test with variable length primary key +# +create table t1 (a varchar(100) not null, primary key(a), b int not null) engine=innodb; +insert into t1 values("hello",1),("world",2); +select * from t1 order by b desc; +optimize table t1; +--replace_column 7 # +show keys from t1; +drop table t1; + +# +# Test of create index with NULL columns +# +create table t1 (i int, j int ) ENGINE=innodb; +insert into t1 values (1,2); +select * from t1 where i=1 and j=2; +create index ax1 on t1 (i,j); +select * from t1 where i=1 and j=2; +drop table t1; + +# +# Test min-max optimization +# + +CREATE TABLE t1 ( + a int3 unsigned NOT NULL, + b int1 unsigned NOT NULL, + UNIQUE (a, b) +) ENGINE = innodb; + +INSERT INTO t1 VALUES (1, 1); +SELECT MIN(B),MAX(b) FROM t1 WHERE t1.a = 1; +drop table t1; + +# +# Test INSERT DELAYED +# + +CREATE TABLE t1 (a int unsigned NOT NULL) engine=innodb; +# Can't test this in 3.23 +# INSERT DELAYED INTO t1 VALUES (1); +INSERT INTO t1 VALUES (1); +SELECT * FROM t1; +DROP TABLE t1; + + +# +# Crash when using many tables (Test case by Jeremy D Zawodny) +# + +create table t1 (a int primary key,b int, c int, d int, e int, f int, g int, h int, i int, j int, k int, l int, m int, n int, o int, p int, q int, r int, s int, t int, u int, v int, w int, x int, y int, z int, a1 int, a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int, b1 int, b2 int, b3 int, b4 int, b5 int, b6 int) engine = innodb; +insert into t1 values (1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1); +--replace_column 9 # +explain select * from t1 where a > 0 and a < 50; +drop table t1; + +# +# Test lock tables +# + +create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) engine=innodb; +insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL'); +LOCK TABLES t1 WRITE; +--error ER_DUP_ENTRY +insert into t1 values (99,1,2,'D'),(1,1,2,'D'); +select id from t1; +select id from t1; +UNLOCK TABLES; +DROP TABLE t1; + +create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) engine=innodb; +insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL'); +LOCK TABLES t1 WRITE; +begin; +--error ER_DUP_ENTRY +insert into t1 values (99,1,2,'D'),(1,1,2,'D'); +select id from t1; +insert ignore into t1 values (100,1,2,'D'),(1,1,99,'D'); +commit; +select id,id3 from t1; +UNLOCK TABLES; +DROP TABLE t1; + +# +# Test prefix key +# +create table t1 (a char(20), unique (a(5))) engine=innodb; +drop table t1; +create table t1 (a char(20), index (a(5))) engine=innodb; +show create table t1; +drop table t1; + +# +# Test using temporary table and auto_increment +# + +create temporary table t1 (a int not null auto_increment, primary key(a)) engine=innodb; +insert into t1 values (NULL),(NULL),(NULL); +delete from t1 where a=3; +insert into t1 values (NULL); +select * from t1; +alter table t1 add b int; +select * from t1; +drop table t1; + +#Slashdot bug +create table t1 + ( + id int auto_increment primary key, + name varchar(32) not null, + value text not null, + uid int not null, + unique key(name,uid) + ) engine=innodb; +insert into t1 values (1,'one','one value',101), + (2,'two','two value',102),(3,'three','three value',103); +set insert_id=5; +replace into t1 (value,name,uid) values ('other value','two',102); +delete from t1 where uid=102; +set insert_id=5; +replace into t1 (value,name,uid) values ('other value','two',102); +set insert_id=6; +replace into t1 (value,name,uid) values ('other value','two',102); +select * from t1; +drop table t1; + +# +# Test DROP DATABASE +# + +create database mysqltest; +create table mysqltest.t1 (a int not null) engine= innodb; +insert into mysqltest.t1 values(1); +create table mysqltest.t2 (a int not null) engine= myisam; +insert into mysqltest.t2 values(1); +create table mysqltest.t3 (a int not null) engine= heap; +insert into mysqltest.t3 values(1); +commit; +drop database mysqltest; +# Don't check error message +--error 1049 +show tables from mysqltest; + +# +# Test truncate table with and without auto_commit +# + +set autocommit=0; +create table t1 (a int not null) engine= innodb; +insert into t1 values(1),(2); +truncate table t1; +commit; +truncate table t1; +truncate table t1; +select * from t1; +insert into t1 values(1),(2); +delete from t1; +select * from t1; +commit; +drop table t1; +set autocommit=1; + +create table t1 (a int not null) engine= innodb; +insert into t1 values(1),(2); +truncate table t1; +insert into t1 values(1),(2); +select * from t1; +truncate table t1; +insert into t1 values(1),(2); +delete from t1; +select * from t1; +drop table t1; + +# +# Test of how ORDER BY works when doing it on the whole table +# + +create table t1 (a int not null, b int not null, c int not null, primary key (a),key(b)) engine=innodb; +insert into t1 values (3,3,3),(1,1,1),(2,2,2),(4,4,4); +--replace_column 9 # +explain select * from t1 order by a; +--replace_column 9 # +explain select * from t1 order by b; +--replace_column 9 # +explain select * from t1 order by c; +--replace_column 9 # +explain select a from t1 order by a; +--replace_column 9 # +explain select b from t1 order by b; +--replace_column 9 # +explain select a,b from t1 order by b; +--replace_column 9 # +explain select a,b from t1; +--replace_column 9 # +explain select a,b,c from t1; +drop table t1; + +# +# Check describe +# + +create table t1 (t int not null default 1, key (t)) engine=innodb; +desc t1; +drop table t1; + +# +# Test of multi-table-delete +# + +CREATE TABLE t1 ( + number bigint(20) NOT NULL default '0', + cname char(15) NOT NULL default '', + carrier_id smallint(6) NOT NULL default '0', + privacy tinyint(4) NOT NULL default '0', + last_mod_date timestamp NOT NULL, + last_mod_id smallint(6) NOT NULL default '0', + last_app_date timestamp NOT NULL, + last_app_id smallint(6) default '-1', + version smallint(6) NOT NULL default '0', + assigned_scps int(11) default '0', + status tinyint(4) default '0' +) ENGINE=InnoDB; +INSERT INTO t1 VALUES (4077711111,'SeanWheeler',90,2,20020111112846,500,00000000000000,-1,2,3,1); +INSERT INTO t1 VALUES (9197722223,'berry',90,3,20020111112809,500,20020102114532,501,4,10,0); +INSERT INTO t1 VALUES (650,'San Francisco',0,0,20011227111336,342,00000000000000,-1,1,24,1); +INSERT INTO t1 VALUES (302467,'Sue\'s Subshop',90,3,20020109113241,500,20020102115111,501,7,24,0); +INSERT INTO t1 VALUES (6014911113,'SudzCarwash',520,1,20020102115234,500,20020102115259,501,33,32768,0); +INSERT INTO t1 VALUES (333,'tubs',99,2,20020109113440,501,20020109113440,500,3,10,0); +CREATE TABLE t2 ( + number bigint(20) NOT NULL default '0', + cname char(15) NOT NULL default '', + carrier_id smallint(6) NOT NULL default '0', + privacy tinyint(4) NOT NULL default '0', + last_mod_date timestamp NOT NULL, + last_mod_id smallint(6) NOT NULL default '0', + last_app_date timestamp NOT NULL, + last_app_id smallint(6) default '-1', + version smallint(6) NOT NULL default '0', + assigned_scps int(11) default '0', + status tinyint(4) default '0' +) ENGINE=InnoDB; +INSERT INTO t2 VALUES (4077711111,'SeanWheeler',0,2,20020111112853,500,00000000000000,-1,2,3,1); +INSERT INTO t2 VALUES (9197722223,'berry',90,3,20020111112818,500,20020102114532,501,4,10,0); +INSERT INTO t2 VALUES (650,'San Francisco',90,0,20020109113158,342,00000000000000,-1,1,24,1); +INSERT INTO t2 VALUES (333,'tubs',99,2,20020109113453,501,20020109113453,500,3,10,0); +select * from t1; +select * from t2; +delete t1, t2 from t1 left join t2 on t1.number=t2.number where (t1.carrier_id=90 and t1.number=t2.number) or (t2.carrier_id=90 and t1.number=t2.number) or (t1.carrier_id=90 and t2.number is null); +select * from t1; +select * from t2; +select * from t2; +drop table t1,t2; + +# +# A simple test with some isolation levels +# TODO: Make this into a test using replication to really test how +# this works. +# + +create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) engine=innodb; + +BEGIN; +SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; +SELECT @@tx_isolation,@@global.tx_isolation; +insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David'); +select id, code, name from t1 order by id; +COMMIT; + +BEGIN; +SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ; +insert into t1 (code, name) values (2, 'Erik'), (3, 'Sasha'); +select id, code, name from t1 order by id; +COMMIT; + +SET binlog_format='MIXED'; +BEGIN; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +insert into t1 (code, name) values (3, 'Jeremy'), (4, 'Matt'); +select id, code, name from t1 order by id; +COMMIT; +DROP TABLE t1; + +# +# Test of multi-table-update +# +create table t1 (n int(10), d int(10)) engine=innodb; +create table t2 (n int(10), d int(10)) engine=innodb; +insert into t1 values(1,1),(1,2); +insert into t2 values(1,10),(2,20); +UPDATE t1,t2 SET t1.d=t2.d,t2.d=30 WHERE t1.n=t2.n; +select * from t1; +select * from t2; +drop table t1,t2; + +# +# Bug #29136 erred multi-delete on trans table does not rollback +# + +# prepare +--disable_warnings +drop table if exists t1, t2; +--enable_warnings +CREATE TABLE t1 (a int, PRIMARY KEY (a)); +CREATE TABLE t2 (a int, PRIMARY KEY (a)) ENGINE=InnoDB; +create trigger trg_del_t2 after delete on t2 for each row + insert into t1 values (1); +insert into t1 values (1); +insert into t2 values (1),(2); + + +# exec cases A, B - see multi_update.test + +# A. send_error() w/o send_eof() branch + +--error ER_DUP_ENTRY +delete t2 from t2; + +# check + +select count(*) from t2 /* must be 2 as restored after rollback caused by the error */; + +# cleanup bug#29136 + +drop table t1, t2; + + +# +# Bug #29136 erred multi-delete on trans table does not rollback +# + +# prepare +--disable_warnings +drop table if exists t1, t2; +--enable_warnings +CREATE TABLE t1 (a int, PRIMARY KEY (a)); +CREATE TABLE t2 (a int, PRIMARY KEY (a)) ENGINE=InnoDB; +create trigger trg_del_t2 after delete on t2 for each row + insert into t1 values (1); +insert into t1 values (1); +insert into t2 values (1),(2); + + +# exec cases A, B - see multi_update.test + +# A. send_error() w/o send_eof() branch + +--error ER_DUP_ENTRY +delete t2 from t2; + +# check + +select count(*) from t2 /* must be 2 as restored after rollback caused by the error */; + +# cleanup bug#29136 + +drop table t1, t2; + + +# +# Testing of IFNULL +# +create table t1 (a int, b int) engine=innodb; +insert into t1 values(20,null); +select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on +t2.b=t3.a; +select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on +t2.b=t3.a order by 1; +insert into t1 values(10,null); +select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on +t2.b=t3.a order by 1; +drop table t1; + +# +# Test of read_through not existing const_table +# + +create table t1 (a varchar(10) not null) engine=myisam; +create table t2 (b varchar(10) not null unique) engine=innodb; +select t1.a from t1,t2 where t1.a=t2.b; +drop table t1,t2; +create table t1 (a int not null, b int, primary key (a)) engine = innodb; +create table t2 (a int not null, b int, primary key (a)) engine = innodb; +insert into t1 values (10, 20); +insert into t2 values (10, 20); +update t1, t2 set t1.b = 150, t2.b = t1.b where t2.a = t1.a and t1.a = 10; +drop table t1,t2; + +# +# Test of multi-table-delete with foreign key constraints +# + +CREATE TABLE t1 (id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB; +CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (t1_id) REFERENCES t1(id) ON DELETE CASCADE ) ENGINE=INNODB; +insert into t1 set id=1; +insert into t2 set id=1, t1_id=1; +delete t1,t2 from t1,t2 where t1.id=t2.t1_id; +select * from t1; +select * from t2; +drop table t2,t1; +CREATE TABLE t1(id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB; +CREATE TABLE t2(id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id) ) ENGINE=INNODB; +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1, 1); +SELECT * from t1; +UPDATE t1,t2 SET t1.id=t1.id+1, t2.t1_id=t1.id+1; +SELECT * from t1; +UPDATE t1,t2 SET t1.id=t1.id+1 where t1.id!=t2.id; +SELECT * from t1; +DROP TABLE t1,t2; + +# +# Test of range_optimizer +# + +set autocommit=0; + +CREATE TABLE t1 (id CHAR(15) NOT NULL, value CHAR(40) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB; + +CREATE TABLE t2 (id CHAR(15) NOT NULL, value CHAR(40) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB; + +CREATE TABLE t3 (id1 CHAR(15) NOT NULL, id2 CHAR(15) NOT NULL, PRIMARY KEY(id1, id2)) ENGINE=InnoDB; + +INSERT INTO t3 VALUES("my-test-1", "my-test-2"); +COMMIT; + +INSERT INTO t1 VALUES("this-key", "will disappear"); +INSERT INTO t2 VALUES("this-key", "will also disappear"); +DELETE FROM t3 WHERE id1="my-test-1"; + +SELECT * FROM t1; +SELECT * FROM t2; +SELECT * FROM t3; +ROLLBACK; + +SELECT * FROM t1; +SELECT * FROM t2; +SELECT * FROM t3; +SELECT * FROM t3 WHERE id1="my-test-1" LOCK IN SHARE MODE; +COMMIT; +set autocommit=1; +DROP TABLE t1,t2,t3; + +# +# Check update with conflicting key +# + +CREATE TABLE t1 (a int not null primary key, b int not null, unique (b)) engine=innodb; +INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +# We need the a < 1000 test here to quard against the halloween problems +UPDATE t1 set a=a+100 where b between 2 and 3 and a < 1000; +SELECT * from t1; +drop table t1; + +CREATE TABLE t2 ( NEXT_T BIGINT NOT NULL PRIMARY KEY) ENGINE=MyISAM; +CREATE TABLE t1 ( B_ID INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB; +SET AUTOCOMMIT=0; +INSERT INTO t1 ( B_ID ) VALUES ( 1 ); +INSERT INTO t2 ( NEXT_T ) VALUES ( 1 ); +ROLLBACK; +SELECT * FROM t1; +drop table t1,t2; +create table t1 ( pk int primary key, parent int not null, child int not null, index (parent) ) engine = innodb; +insert into t1 values (1,0,4), (2,1,3), (3,2,1), (4,1,2); +select distinct parent,child from t1 order by parent; +drop table t1; + +# +# Test that MySQL priorities clustered indexes +# +create table t1 (a int not null auto_increment primary key, b int, c int, key(c)) engine=innodb; +create table t2 (a int not null auto_increment primary key, b int); +insert into t1 (b) values (null),(null),(null),(null),(null),(null),(null); +insert into t2 (a) select b from t1; +insert into t1 (b) select b from t2; +insert into t2 (a) select b from t1; +insert into t1 (a) select b from t2; +insert into t2 (a) select b from t1; +insert into t1 (a) select b from t2; +insert into t2 (a) select b from t1; +insert into t1 (a) select b from t2; +insert into t2 (a) select b from t1; +insert into t1 (a) select b from t2; +select count(*) from t1; +--replace_column 9 # +explain select * from t1 where c between 1 and 2500; +update t1 set c=a; +--replace_column 9 # +explain select * from t1 where c between 1 and 2500; +drop table t1,t2; + +# +# Test of UPDATE ... ORDER BY +# + +create table t1 (id int primary key auto_increment, fk int, index index_fk (fk)) engine=innodb; + +insert into t1 (id) values (null),(null),(null),(null),(null); +update t1 set fk=69 where fk is null order by id limit 1; +SELECT * from t1; +drop table t1; + +create table t1 (a int not null, b int not null, key (a)); +insert into t1 values (1,1),(1,2),(1,3),(3,1),(3,2),(3,3),(3,1),(3,2),(3,3),(2,1),(2,2),(2,3); +SET @tmp=0; +update t1 set b=(@tmp:=@tmp+1) order by a; +update t1 set b=99 where a=1 order by b asc limit 1; +update t1 set b=100 where a=1 order by b desc limit 2; +update t1 set a=a+10+b where a=1 order by b; +select * from t1 order by a,b; +drop table t1; + +# +# Test of multi-table-updates (bug #1980). +# + +create table t1 ( c char(8) not null ) engine=innodb; +insert into t1 values ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7'),('8'),('9'); +insert into t1 values ('A'),('B'),('C'),('D'),('E'),('F'); + +alter table t1 add b char(8) not null; +alter table t1 add a char(8) not null; +alter table t1 add primary key (a,b,c); +update t1 set a=c, b=c; + +create table t2 (c char(8) not null, b char(8) not null, a char(8) not null, primary key(a,b,c)) engine=innodb; +insert into t2 select * from t1; + +delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b; +drop table t1,t2; + +# +# test autoincrement with TRUNCATE +# + +SET AUTOCOMMIT=1; +create table t1 (a integer auto_increment primary key) engine=innodb; +insert into t1 (a) values (NULL),(NULL); +truncate table t1; +insert into t1 (a) values (NULL),(NULL); +SELECT * from t1; +drop table t1; + +# +# Test dictionary handling with spaceand quoting +# + +CREATE TABLE t1 (`id 1` INT NOT NULL, PRIMARY KEY (`id 1`)) ENGINE=INNODB; +CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (`t1_id`) REFERENCES `t1`(`id 1`) ON DELETE CASCADE ) ENGINE=INNODB; +#show create table t2; +drop table t2,t1; + +# +# Test of multi updated and foreign keys +# + +create table `t1` (`id` int( 11 ) not null ,primary key ( `id` )) engine = innodb; +insert into `t1`values ( 1 ) ; +create table `t2` (`id` int( 11 ) not null default '0',unique key `id` ( `id` ) ,constraint `t1_id_fk` foreign key ( `id` ) references `t1` (`id` )) engine = innodb; +insert into `t2`values ( 1 ) ; +create table `t3` (`id` int( 11 ) not null default '0',key `id` ( `id` ) ,constraint `t2_id_fk` foreign key ( `id` ) references `t2` (`id` )) engine = innodb; +insert into `t3`values ( 1 ) ; +--error 1451 +delete t3,t2,t1 from t1,t2,t3 where t1.id =1 and t2.id = t1.id and t3.id = t2.id; +--error 1451 +update t1,t2,t3 set t3.id=5, t2.id=6, t1.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id; +--error 1054 +update t3 set t3.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id; +drop table t3,t2,t1; + +# +# test for recursion depth limit +# +create table t1( + id int primary key, + pid int, + index(pid), + foreign key(pid) references t1(id) on delete cascade) engine=innodb; +insert into t1 values(0,0),(1,0),(2,1),(3,2),(4,3),(5,4),(6,5),(7,6), + (8,7),(9,8),(10,9),(11,10),(12,11),(13,12),(14,13),(15,14); +-- error 1451 +delete from t1 where id=0; +delete from t1 where id=15; +delete from t1 where id=0; + +drop table t1; + +# +# Test timestamps +# + +CREATE TABLE t1 (col1 int(1))ENGINE=InnoDB; +CREATE TABLE t2 (col1 int(1),stamp TIMESTAMP,INDEX stamp_idx +(stamp))ENGINE=InnoDB; +insert into t1 values (1),(2),(3); +# Note that timestamp 3 is wrong +insert into t2 values (1, 20020204130000),(2, 20020204130000),(4,20020204310000 ),(5,20020204230000); +SELECT col1 FROM t1 UNION SELECT col1 FROM t2 WHERE stamp < +'20020204120000' GROUP BY col1; +drop table t1,t2; + +# +# Test by Francois MASUREL +# + +CREATE TABLE t1 ( + `id` int(10) unsigned NOT NULL auto_increment, + `id_object` int(10) unsigned default '0', + `id_version` int(10) unsigned NOT NULL default '1', + `label` varchar(100) NOT NULL default '', + `description` text, + PRIMARY KEY (`id`), + KEY `id_object` (`id_object`), + KEY `id_version` (`id_version`) +) ENGINE=InnoDB; + +INSERT INTO t1 VALUES("6", "3382", "9", "Test", NULL), ("7", "102", "5", "Le Pekin (Test)", NULL),("584", "1794", "4", "Test de resto", NULL),("837", "1822", "6", "Test 3", NULL),("1119", "3524", "1", "Societe Test", NULL),("1122", "3525", "1", "Fournisseur Test", NULL); + +CREATE TABLE t2 ( + `id` int(10) unsigned NOT NULL auto_increment, + `id_version` int(10) unsigned NOT NULL default '1', + PRIMARY KEY (`id`), + KEY `id_version` (`id_version`) +) ENGINE=InnoDB; + +INSERT INTO t2 VALUES("3524", "1"),("3525", "1"),("1794", "4"),("102", "5"),("1822", "6"),("3382", "9"); + +SELECT t2.id, t1.`label` FROM t2 INNER JOIN +(SELECT t1.id_object as id_object FROM t1 WHERE t1.`label` LIKE '%test%') AS lbl +ON (t2.id = lbl.id_object) INNER JOIN t1 ON (t2.id = t1.id_object); +drop table t1,t2; + +create table t1 (a int, b varchar(200), c text not null) checksum=1 engine=myisam; +create table t2 (a int, b varchar(200), c text not null) checksum=0 engine=innodb; +create table t3 (a int, b varchar(200), c text not null) checksum=1 engine=innodb; +insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, ""); +insert t2 select * from t1; +insert t3 select * from t1; +checksum table t1, t2, t3, t4 quick; +checksum table t1, t2, t3, t4; +checksum table t1, t2, t3, t4 extended; +#show table status; +drop table t1,t2,t3; + +# +# Test problem with refering to different fields in same table in UNION +# (Bug #2552) +# +create table t1 (id int, name char(10) not null, name2 char(10) not null) engine=innodb; +insert into t1 values(1,'first','fff'),(2,'second','sss'),(3,'third','ttt'); +select trim(name2) from t1 union all select trim(name) from t1 union all select trim(id) from t1; +drop table t1; + +# +# Bug2160 +# +create table t1 (a int) engine=innodb; +create table t2 like t1; +drop table t1,t2; + +# +# Test of automaticly created foreign keys +# + +create table t1 (id int(11) not null, id2 int(11) not null, unique (id,id2)) engine=innodb; +create table t2 (id int(11) not null, constraint t1_id_fk foreign key ( id ) references t1 (id)) engine = innodb; +show create table t1; +show create table t2; +create index id on t2 (id); +show create table t2; +create index id2 on t2 (id); +show create table t2; +drop index id2 on t2; +--error ER_DROP_INDEX_FK +drop index id on t2; +show create table t2; +drop table t2; + +create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id,id2) references t1 (id,id2)) engine = innodb; +show create table t2; +create unique index id on t2 (id,id2); +show create table t2; +drop table t2; + +# Check foreign key columns created in different order than key columns +create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2),constraint t1_id_fk foreign key (id2,id) references t1 (id,id2)) engine = innodb; +show create table t2; +drop table t2; + +create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2), constraint t1_id_fk foreign key (id) references t1 (id)) engine = innodb; +show create table t2; +drop table t2; + +create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2),constraint t1_id_fk foreign key (id2,id) references t1 (id,id2)) engine = innodb; +show create table t2; +drop table t2; + +create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id), primary key (id), index (id,id2)) engine = innodb; +show create table t2; +drop table t2; + +create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id)) engine= innodb; +show create table t2; +alter table t2 add index id_test (id), add index id_test2 (id,id2); +show create table t2; +drop table t2; + +# Test error handling + +# Embedded server doesn't chdir to data directory +--replace_result $MYSQLTEST_VARDIR . master-data/ '' +--error ER_WRONG_FK_DEF +create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb; + +# bug#3749 + +create table t2 (a int auto_increment primary key, b int, index(b), foreign key (b) references t1(id), unique(b)) engine=innodb; +show create table t2; +drop table t2; +create table t2 (a int auto_increment primary key, b int, foreign key (b) references t1(id), foreign key (b) references t1(id), unique(b)) engine=innodb; +show create table t2; +drop table t2, t1; + + +# +# Bug #6126: Duplicate columns in keys gives misleading error message +# +--error 1060 +create table t1 (c char(10), index (c,c)) engine=innodb; +--error 1060 +create table t1 (c1 char(10), c2 char(10), index (c1,c2,c1)) engine=innodb; +--error 1060 +create table t1 (c1 char(10), c2 char(10), index (c1,c1,c2)) engine=innodb; +--error 1060 +create table t1 (c1 char(10), c2 char(10), index (c2,c1,c1)) engine=innodb; +create table t1 (c1 char(10), c2 char(10)) engine=innodb; +--error 1060 +alter table t1 add key (c1,c1); +--error 1060 +alter table t1 add key (c2,c1,c1); +--error 1060 +alter table t1 add key (c1,c2,c1); +--error 1060 +alter table t1 add key (c1,c1,c2); +drop table t1; + +# +# Bug #4082: integer truncation +# +# disable because the bug has resurfaced +#create table t1(a int(1) , b int(1)) engine=innodb; +#insert into t1 values ('1111', '3333'); +#select distinct concat(a, b) from t1; +#drop table t1; + +# +# BUG#7709 test case - Boolean fulltext query against unsupported +# engines does not fail +# + +CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB; +--error 1214 +SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE); +DROP TABLE t1; + +# +# check null values #1 +# + +--disable_warnings +CREATE TABLE t1 (a_id tinyint(4) NOT NULL default '0', PRIMARY KEY (a_id)) ENGINE=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES (1),(2),(3); +CREATE TABLE t2 (b_id tinyint(4) NOT NULL default '0',b_a tinyint(4) NOT NULL default '0', PRIMARY KEY (b_id), KEY (b_a), + CONSTRAINT fk_b_a FOREIGN KEY (b_a) REFERENCES t1 (a_id) ON DELETE CASCADE ON UPDATE NO ACTION) ENGINE=InnoDB DEFAULT CHARSET=latin1; +--enable_warnings +INSERT INTO t2 VALUES (1,1),(2,1),(3,1),(4,2),(5,2); +SELECT * FROM (SELECT t1.*,GROUP_CONCAT(t2.b_id SEPARATOR ',') as b_list FROM (t1 LEFT JOIN (t2) on t1.a_id = t2.b_a) GROUP BY t1.a_id ) AS xyz; +DROP TABLE t2; +DROP TABLE t1; + +# +# Bug#11816 - Truncate table doesn't work with temporary innodb tables +# This is not an innodb bug, but we test it using innodb. +# +create temporary table t1 (a int) engine=innodb; +insert into t1 values (4711); +truncate t1; +insert into t1 values (42); +select * from t1; +drop table t1; +# Show that it works with permanent tables too. +create table t1 (a int) engine=innodb; +insert into t1 values (4711); +truncate t1; +insert into t1 values (42); +select * from t1; +drop table t1; + +# +# Bug #13025 Server crash during filesort +# + +create table t1 (a int not null, b int not null, c blob not null, d int not null, e int, primary key (a,b,c(255),d)) engine=innodb; +insert into t1 values (2,2,"b",2,2),(1,1,"a",1,1),(3,3,"ab",3,3); +select * from t1 order by a,b,c,d; +explain select * from t1 order by a,b,c,d; +drop table t1; + +# +# BUG#11039,#13218 Wrong key length in min() +# + +create table t1 (a char(1), b char(1), key(a, b)) engine=innodb; +insert into t1 values ('8', '6'), ('4', '7'); +select min(a) from t1; +select min(b) from t1 where a='8'; +drop table t1; + +# End of 4.1 tests + +# +# range optimizer problem +# + +create table t1 (x bigint unsigned not null primary key) engine=innodb; +insert into t1(x) values (0xfffffffffffffff0),(0xfffffffffffffff1); +select * from t1; +select count(*) from t1 where x>0; +select count(*) from t1 where x=0; +select count(*) from t1 where x<0; +select count(*) from t1 where x < -16; +select count(*) from t1 where x = -16; +explain select count(*) from t1 where x > -16; +select count(*) from t1 where x > -16; +select * from t1 where x > -16; +select count(*) from t1 where x = 18446744073709551601; +drop table t1; + + +# Test for testable InnoDB status variables. This test +# uses previous ones(pages_created, rows_deleted, ...). +--replace_result 512 511 +SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total'; +SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_page_size'; +SELECT variable_value - @innodb_rows_deleted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_deleted'; +SELECT variable_value - @innodb_rows_inserted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_inserted'; +SELECT variable_value - @innodb_rows_updated_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_updated'; + +# Test for row locks InnoDB status variables. +SELECT variable_value - @innodb_row_lock_waits_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_waits'; +SELECT variable_value - @innodb_row_lock_current_waits_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_current_waits'; +SELECT variable_value - @innodb_row_lock_time_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time'; +SELECT variable_value - @innodb_row_lock_time_max_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_max'; +SELECT variable_value - @innodb_row_lock_time_avg_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_avg'; + +# Test for innodb_sync_spin_loops variable +SET @innodb_sync_spin_loops_orig = @@innodb_sync_spin_loops; +show variables like "innodb_sync_spin_loops"; +set global innodb_sync_spin_loops=1000; +show variables like "innodb_sync_spin_loops"; +set global innodb_sync_spin_loops=0; +show variables like "innodb_sync_spin_loops"; +set global innodb_sync_spin_loops=20; +show variables like "innodb_sync_spin_loops"; +set global innodb_sync_spin_loops=@innodb_sync_spin_loops_orig; + +# Test for innodb_thread_concurrency variable +show variables like "innodb_thread_concurrency"; +set global innodb_thread_concurrency=1001; +show variables like "innodb_thread_concurrency"; +set global innodb_thread_concurrency=0; +show variables like "innodb_thread_concurrency"; +set global innodb_thread_concurrency=16; +show variables like "innodb_thread_concurrency"; + +# Test for innodb_concurrency_tickets variable +show variables like "innodb_concurrency_tickets"; +set global innodb_concurrency_tickets=1000; +show variables like "innodb_concurrency_tickets"; +set global innodb_concurrency_tickets=0; +show variables like "innodb_concurrency_tickets"; +set global innodb_concurrency_tickets=500; +show variables like "innodb_concurrency_tickets"; + +# Test for innodb_thread_sleep_delay variable +show variables like "innodb_thread_sleep_delay"; +set global innodb_thread_sleep_delay=100000; +show variables like "innodb_thread_sleep_delay"; +set global innodb_thread_sleep_delay=0; +show variables like "innodb_thread_sleep_delay"; +set global innodb_thread_sleep_delay=10000; +show variables like "innodb_thread_sleep_delay"; + +# +# Test varchar +# + +let $default=`select @@storage_engine`; +set storage_engine=INNODB; +# this should be fixed by MySQL (see Bug #51451) +set session old_alter_table=1; +source include/varchar.inc; +set session old_alter_table=0; + +# +# Some errors/warnings on create +# + +# Embedded server doesn't chdir to data directory +--replace_result $MYSQLTEST_VARDIR . master-data/ '' +create table t1 (v varchar(65530), key(v)); +drop table t1; +create table t1 (v varchar(65536)); +show create table t1; +drop table t1; +create table t1 (v varchar(65530) character set utf8); +show create table t1; +drop table t1; + +eval set storage_engine=$default; + +# InnoDB specific varchar tests +create table t1 (v varchar(16384)) engine=innodb; +drop table t1; + +# +# BUG#11039 Wrong key length in min() +# + +create table t1 (a char(1), b char(1), key(a, b)) engine=innodb; +insert into t1 values ('8', '6'), ('4', '7'); +select min(a) from t1; +select min(b) from t1 where a='8'; +drop table t1; + +# +# Bug #11080 & #11005 Multi-row REPLACE fails on a duplicate key error +# + +CREATE TABLE t1 ( `a` int(11) NOT NULL auto_increment, `b` int(11) default NULL,PRIMARY KEY (`a`),UNIQUE KEY `b` (`b`)) ENGINE=innodb; +insert into t1 (b) values (1); +replace into t1 (b) values (2), (1), (3); +select * from t1; +truncate table t1; +insert into t1 (b) values (1); +replace into t1 (b) values (2); +replace into t1 (b) values (1); +replace into t1 (b) values (3); +select * from t1; +drop table t1; + +create table t1 (rowid int not null auto_increment, val int not null,primary +key (rowid), unique(val)) engine=innodb; +replace into t1 (val) values ('1'),('2'); +replace into t1 (val) values ('1'),('2'); +--error ER_DUP_ENTRY +insert into t1 (val) values ('1'),('2'); +select * from t1; +drop table t1; + +# +# Test that update does not change internal auto-increment value +# + +create table t1 (a int not null auto_increment primary key, val int) engine=InnoDB; +insert into t1 (val) values (1); +update t1 set a=2 where a=1; +# We should get the following error because InnoDB does not update the counter +--error ER_DUP_ENTRY +insert into t1 (val) values (1); +select * from t1; +drop table t1; +# +# Bug #10465 +# + +--disable_warnings +CREATE TABLE t1 (GRADE DECIMAL(4) NOT NULL, PRIMARY KEY (GRADE)) ENGINE=INNODB; +--enable_warnings +INSERT INTO t1 (GRADE) VALUES (151),(252),(343); +SELECT GRADE FROM t1 WHERE GRADE > 160 AND GRADE < 300; +SELECT GRADE FROM t1 WHERE GRADE= 151; +DROP TABLE t1; + +# +# Bug #12340 multitable delete deletes only one record +# +create table t1 (f1 varchar(10), f2 varchar(10), primary key (f1,f2)) engine=innodb; +create table t2 (f3 varchar(10), f4 varchar(10), key (f4)) engine=innodb; +insert into t2 values ('aa','cc'); +insert into t1 values ('aa','bb'),('aa','cc'); +delete t1 from t1,t2 where f1=f3 and f4='cc'; +select * from t1; +drop table t1,t2; + +# +# Test that the slow TRUNCATE implementation resets autoincrement columns +# (bug #11946) +# + +CREATE TABLE t1 ( +id INTEGER NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) +) ENGINE=InnoDB; + +CREATE TABLE t2 ( +id INTEGER NOT NULL, +FOREIGN KEY (id) REFERENCES t1 (id) +) ENGINE=InnoDB; + +INSERT INTO t1 (id) VALUES (NULL); +SELECT * FROM t1; +TRUNCATE t1; +INSERT INTO t1 (id) VALUES (NULL); +SELECT * FROM t1; + +# continued from above; test that doing a slow TRUNCATE on a table with 0 +# rows resets autoincrement columns +DELETE FROM t1; +TRUNCATE t1; +INSERT INTO t1 (id) VALUES (NULL); +SELECT * FROM t1; +DROP TABLE t2, t1; + +# Test that foreign keys in temporary tables are not accepted (bug #12084) +CREATE TABLE t1 +( + id INT PRIMARY KEY +) ENGINE=InnoDB; + +--error 1005,1005 +CREATE TEMPORARY TABLE t2 +( + id INT NOT NULL PRIMARY KEY, + b INT, + FOREIGN KEY (b) REFERENCES test.t1(id) +) ENGINE=InnoDB; +DROP TABLE t1; + +# +# Test that index column max sizes are honored (bug #13315) +# + +# prefix index +create table t1 (col1 varchar(2000), index (col1(767))) + character set = latin1 engine = innodb; + +# normal indexes +create table t2 (col1 char(255), index (col1)) + character set = latin1 engine = innodb; +create table t3 (col1 binary(255), index (col1)) + character set = latin1 engine = innodb; +create table t4 (col1 varchar(767), index (col1)) + character set = latin1 engine = innodb; +create table t5 (col1 varchar(767) primary key) + character set = latin1 engine = innodb; +create table t6 (col1 varbinary(767) primary key) + character set = latin1 engine = innodb; +create table t7 (col1 text, index(col1(767))) + character set = latin1 engine = innodb; +create table t8 (col1 blob, index(col1(767))) + character set = latin1 engine = innodb; + +# multi-column indexes are allowed to be longer +create table t9 (col1 varchar(512), col2 varchar(512), index(col1, col2)) + character set = latin1 engine = innodb; + +show create table t9; + +drop table t1, t2, t3, t4, t5, t6, t7, t8, t9; + +# these should have their index length trimmed +create table t1 (col1 varchar(768), index(col1)) + character set = latin1 engine = innodb; +create table t2 (col1 varbinary(768), index(col1)) + character set = latin1 engine = innodb; +create table t3 (col1 text, index(col1(768))) + character set = latin1 engine = innodb; +create table t4 (col1 blob, index(col1(768))) + character set = latin1 engine = innodb; + +show create table t1; + +drop table t1, t2, t3, t4; + +# these should be refused +--error 1071 +create table t1 (col1 varchar(768) primary key) + character set = latin1 engine = innodb; +--error 1071 +create table t2 (col1 varbinary(768) primary key) + character set = latin1 engine = innodb; +--error 1071 +create table t3 (col1 text, primary key(col1(768))) + character set = latin1 engine = innodb; +--error 1071 +create table t4 (col1 blob, primary key(col1(768))) + character set = latin1 engine = innodb; + +# +# Test improved foreign key error messages (bug #3443) +# + +CREATE TABLE t1 +( + id INT PRIMARY KEY +) ENGINE=InnoDB; + +CREATE TABLE t2 +( + v INT, + CONSTRAINT c1 FOREIGN KEY (v) REFERENCES t1(id) +) ENGINE=InnoDB; + +--error 1452 +INSERT INTO t2 VALUES(2); + +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1); + +--error 1451 +DELETE FROM t1 WHERE id = 1; + +--error 1217 +DROP TABLE t1; + +SET FOREIGN_KEY_CHECKS=0; +DROP TABLE t1; +SET FOREIGN_KEY_CHECKS=1; + +--error 1452 +INSERT INTO t2 VALUES(3); + +DROP TABLE t2; +# +# Test that checksum table uses a consistent read Bug #12669 +# +connect (a,localhost,root,,); +connect (b,localhost,root,,); +connection a; +create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1; +insert into t1 values (1),(2); +set autocommit=0; +checksum table t1; +connection b; +insert into t1 values(3); +connection a; +# +# Here checksum should not see insert +# +checksum table t1; +connection a; +commit; +checksum table t1; +commit; +drop table t1; +# +# autocommit = 1 +# +connection a; +create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1; +insert into t1 values (1),(2); +set autocommit=1; +checksum table t1; +connection b; +set autocommit=1; +insert into t1 values(3); +connection a; +# +# Here checksum sees insert +# +checksum table t1; +drop table t1; + +connection default; +disconnect a; +disconnect b; + +# tests for bugs #9802 and #13778 + +# test that FKs between invalid types are not accepted + +set foreign_key_checks=0; +create table t2 (a int primary key, b int, foreign key (b) references t1(a)) engine = innodb; +# Embedded server doesn't chdir to data directory +--replace_result $MYSQLTEST_VARDIR . master-data/ '' +-- error 1005 +create table t1(a char(10) primary key, b varchar(20)) engine = innodb; +set foreign_key_checks=1; +drop table t2; + +# test that FKs between different charsets are not accepted in CREATE even +# when f_k_c is 0 + +set foreign_key_checks=0; +create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1; +# Embedded server doesn't chdir to data directory +--replace_result $MYSQLTEST_VARDIR . master-data/ '' +-- error 1005 +create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=utf8; +set foreign_key_checks=1; +drop table t1; + +# test that invalid datatype conversions with ALTER are not allowed + +set foreign_key_checks=0; +create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb; +create table t1(a varchar(10) primary key) engine = innodb; +-- error 1025,1025 +alter table t1 modify column a int; +set foreign_key_checks=1; +drop table t2,t1; + +# test that charset conversions with ALTER are allowed when f_k_c is 0 + +set foreign_key_checks=0; +create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1; +create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1; +alter table t1 convert to character set utf8; +set foreign_key_checks=1; +drop table t2,t1; + +# test that RENAME does not allow invalid charsets when f_k_c is 0 + +set foreign_key_checks=0; +create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1; +create table t3(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=utf8; +# Embedded server doesn't chdir to data directory +--replace_result $MYSQLD_DATADIR ./ master-data/ '' +-- error 1025 +rename table t3 to t1; +set foreign_key_checks=1; +drop table t2,t3; + +# test that foreign key errors are reported correctly (Bug #15550) + +create table t1(a int primary key) row_format=redundant engine=innodb; +create table t2(a int primary key,constraint foreign key(a)references t1(a)) row_format=compact engine=innodb; +create table t3(a int primary key) row_format=compact engine=innodb; +create table t4(a int primary key,constraint foreign key(a)references t3(a)) row_format=redundant engine=innodb; + +insert into t1 values(1); +insert into t3 values(1); +-- error 1452 +insert into t2 values(2); +-- error 1452 +insert into t4 values(2); +insert into t2 values(1); +insert into t4 values(1); +-- error 1451 +update t1 set a=2; +-- error 1452 +update t2 set a=2; +-- error 1451 +update t3 set a=2; +-- error 1452 +update t4 set a=2; +-- error 1451 +truncate t1; +-- error 1451 +truncate t3; +truncate t2; +truncate t4; +truncate t1; +truncate t3; + +drop table t4,t3,t2,t1; + + +# +# Test that we can create a large (>1K) key +# +create table t1 (a varchar(255) character set utf8, + b varchar(255) character set utf8, + c varchar(255) character set utf8, + d varchar(255) character set utf8, + key (a,b,c,d)) engine=innodb; +drop table t1; +--error ER_TOO_LONG_KEY +create table t1 (a varchar(255) character set utf8, + b varchar(255) character set utf8, + c varchar(255) character set utf8, + d varchar(255) character set utf8, + e varchar(255) character set utf8, + key (a,b,c,d,e)) engine=innodb; + + +# test the padding of BINARY types and collations (Bug #14189) + +create table t1 (s1 varbinary(2),primary key (s1)) engine=innodb; +create table t2 (s1 binary(2),primary key (s1)) engine=innodb; +create table t3 (s1 varchar(2) binary,primary key (s1)) engine=innodb; +create table t4 (s1 char(2) binary,primary key (s1)) engine=innodb; + +insert into t1 values (0x41),(0x4120),(0x4100); +-- error ER_DUP_ENTRY +insert into t2 values (0x41),(0x4120),(0x4100); +insert into t2 values (0x41),(0x4120); +-- error ER_DUP_ENTRY +insert into t3 values (0x41),(0x4120),(0x4100); +insert into t3 values (0x41),(0x4100); +-- error ER_DUP_ENTRY +insert into t4 values (0x41),(0x4120),(0x4100); +insert into t4 values (0x41),(0x4100); +select hex(s1) from t1; +select hex(s1) from t2; +select hex(s1) from t3; +select hex(s1) from t4; +drop table t1,t2,t3,t4; + +create table t1 (a int primary key,s1 varbinary(3) not null unique) engine=innodb; +create table t2 (s1 binary(2) not null, constraint c foreign key(s1) references t1(s1) on update cascade) engine=innodb; + +insert into t1 values(1,0x4100),(2,0x41),(3,0x4120),(4,0x42); +-- error 1452 +insert into t2 values(0x42); +insert into t2 values(0x41); +select hex(s1) from t2; +update t1 set s1=0x123456 where a=2; +select hex(s1) from t2; +-- error 1451 +update t1 set s1=0x12 where a=1; +-- error 1451 +update t1 set s1=0x12345678 where a=1; +-- error 1451 +update t1 set s1=0x123457 where a=1; +update t1 set s1=0x1220 where a=1; +select hex(s1) from t2; +update t1 set s1=0x1200 where a=1; +select hex(s1) from t2; +update t1 set s1=0x4200 where a=1; +select hex(s1) from t2; +-- error 1451 +delete from t1 where a=1; +delete from t1 where a=2; +update t2 set s1=0x4120; +-- error 1451 +delete from t1; +delete from t1 where a!=3; +select a,hex(s1) from t1; +select hex(s1) from t2; + +drop table t2,t1; + +create table t1 (a int primary key,s1 varchar(2) binary not null unique) engine=innodb; +create table t2 (s1 char(2) binary not null, constraint c foreign key(s1) references t1(s1) on update cascade) engine=innodb; + +insert into t1 values(1,0x4100),(2,0x41); +insert into t2 values(0x41); +select hex(s1) from t2; +update t1 set s1=0x1234 where a=1; +select hex(s1) from t2; +update t1 set s1=0x12 where a=2; +select hex(s1) from t2; +delete from t1 where a=1; +-- error 1451 +delete from t1 where a=2; +select a,hex(s1) from t1; +select hex(s1) from t2; + +drop table t2,t1; +# Ensure that <tablename>_ibfk_0 is not mistreated as a +# generated foreign key identifier. (Bug #16387) + +CREATE TABLE t1(a INT, PRIMARY KEY(a)) ENGINE=InnoDB; +CREATE TABLE t2(a INT) ENGINE=InnoDB; +ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1(a); +ALTER TABLE t2 DROP FOREIGN KEY t2_ibfk_1; +ALTER TABLE t2 ADD CONSTRAINT t2_ibfk_0 FOREIGN KEY (a) REFERENCES t1(a); +ALTER TABLE t2 DROP FOREIGN KEY t2_ibfk_0; +SHOW CREATE TABLE t2; +DROP TABLE t2,t1; + +# +# Test case for bug #16229: MySQL/InnoDB uses full explicit table locks in trigger processing +# +## the following cannot be tested after the introduction of metadata locks +## because the create trigger command blocks and waits for connection b to +## commit +## begin disabled_mdl +#connect (a,localhost,root,,); +#connect (b,localhost,root,,); +#connection a; +#create table t1(a int not null, b int, c int, d int, primary key(a)) engine=innodb; +#insert into t1(a) values (1),(2),(3); +#commit; +#connection b; +#set autocommit = 0; +#update t1 set b = 5 where a = 2; +#connection a; +#delimiter |; +#create trigger t1t before insert on t1 for each row begin set NEW.b = NEW.a * 10 + 5, NEW.c = NEW.a / 10; end | +#delimiter ;| +#set autocommit = 0; +#connection a; +#insert into t1(a) values (10),(20),(30),(40),(50),(60),(70),(80),(90),(100), +#(11),(21),(31),(41),(51),(61),(71),(81),(91),(101), +#(12),(22),(32),(42),(52),(62),(72),(82),(92),(102), +#(13),(23),(33),(43),(53),(63),(73),(83),(93),(103), +#(14),(24),(34),(44),(54),(64),(74),(84),(94),(104); +#connection b; +#commit; +#connection a; +#commit; +#drop trigger t1t; +#drop table t1; +#disconnect a; +#disconnect b; +## +## Another trigger test +## +#connect (a,localhost,root,,); +#connect (b,localhost,root,,); +#connection a; +#create table t1(a int not null, b int, c int, d int, primary key(a)) engine=innodb; +#create table t2(a int not null, b int, c int, d int, primary key(a)) engine=innodb; +#create table t3(a int not null, b int, c int, d int, primary key(a)) engine=innodb; +#create table t4(a int not null, b int, c int, d int, primary key(a)) engine=innodb; +#create table t5(a int not null, b int, c int, d int, primary key(a)) engine=innodb; +#insert into t1(a) values (1),(2),(3); +#insert into t2(a) values (1),(2),(3); +#insert into t3(a) values (1),(2),(3); +#insert into t4(a) values (1),(2),(3); +#insert into t3(a) values (5),(7),(8); +#insert into t4(a) values (5),(7),(8); +#insert into t5(a) values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12); +# +#delimiter |; +#create trigger t1t before insert on t1 for each row begin +# INSERT INTO t2 SET a = NEW.a; +#end | +# +#create trigger t2t before insert on t2 for each row begin +# DELETE FROM t3 WHERE a = NEW.a; +#end | +# +#create trigger t3t before delete on t3 for each row begin +# UPDATE t4 SET b = b + 1 WHERE a = OLD.a; +#end | +# +#create trigger t4t before update on t4 for each row begin +# UPDATE t5 SET b = b + 1 where a = NEW.a; +#end | +#delimiter ;| +#commit; +#set autocommit = 0; +#update t1 set b = b + 5 where a = 1; +#update t2 set b = b + 5 where a = 1; +#update t3 set b = b + 5 where a = 1; +#update t4 set b = b + 5 where a = 1; +#insert into t5(a) values(20); +#connection b; +#set autocommit = 0; +#insert into t1(a) values(7); +#insert into t2(a) values(8); +#delete from t2 where a = 3; +#update t4 set b = b + 1 where a = 3; +#commit; +#drop trigger t1t; +#drop trigger t2t; +#drop trigger t3t; +#drop trigger t4t; +#drop table t1, t2, t3, t4, t5; +#connection default; +#disconnect a; +#disconnect b; +## end disabled_mdl + +# +# Test that cascading updates leading to duplicate keys give the correct +# error message (bug #9680) +# + +CREATE TABLE t1 ( + field1 varchar(8) NOT NULL DEFAULT '', + field2 varchar(8) NOT NULL DEFAULT '', + PRIMARY KEY (field1, field2) +) ENGINE=InnoDB; + +CREATE TABLE t2 ( + field1 varchar(8) NOT NULL DEFAULT '' PRIMARY KEY, + FOREIGN KEY (field1) REFERENCES t1 (field1) + ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB; + +INSERT INTO t1 VALUES ('old', 'somevalu'); +INSERT INTO t1 VALUES ('other', 'anyvalue'); + +INSERT INTO t2 VALUES ('old'); +INSERT INTO t2 VALUES ('other'); + +--error ER_FOREIGN_DUPLICATE_KEY +UPDATE t1 SET field1 = 'other' WHERE field2 = 'somevalu'; + +DROP TABLE t2; +DROP TABLE t1; + +# +# Bug#18477 - MySQL/InnoDB Ignoring Foreign Keys in ALTER TABLE +# +create table t1 ( + c1 bigint not null, + c2 bigint not null, + primary key (c1), + unique key (c2) +) engine=innodb; +# +create table t2 ( + c1 bigint not null, + primary key (c1) +) engine=innodb; +# +alter table t1 add constraint c2_fk foreign key (c2) + references t2(c1) on delete cascade; +show create table t1; +# +alter table t1 drop foreign key c2_fk; +show create table t1; +# +drop table t1, t2; + +# +# Bug #14360: problem with intervals +# + +create table t1(a date) engine=innodb; +create table t2(a date, key(a)) engine=innodb; +insert into t1 values('2005-10-01'); +insert into t2 values('2005-10-01'); +select * from t1, t2 + where t2.a between t1.a - interval 2 day and t1.a + interval 2 day; +drop table t1, t2; + +create table t1 (id int not null, f_id int not null, f int not null, +primary key(f_id, id)) engine=innodb; +create table t2 (id int not null,s_id int not null,s varchar(200), +primary key(id)) engine=innodb; +INSERT INTO t1 VALUES (8, 1, 3); +INSERT INTO t1 VALUES (1, 2, 1); +INSERT INTO t2 VALUES (1, 0, ''); +INSERT INTO t2 VALUES (8, 1, ''); +commit; +DELETE ml.* FROM t1 AS ml LEFT JOIN t2 AS mm ON (mm.id=ml.id) +WHERE mm.id IS NULL; +select ml.* from t1 as ml left join t2 as mm on (mm.id=ml.id) +where mm.id is null lock in share mode; +drop table t1,t2; + +# +# Test case where X-locks on unused rows should be released in a +# update (because READ COMMITTED isolation level) +# + +connect (a,localhost,root,,); +connect (b,localhost,root,,); +connection a; +create table t1(a int not null, b int, primary key(a)) engine=innodb; +insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2),(7,3); +commit; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +update t1 set b = 5 where b = 1; +connection b; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +# +# X-lock to record (7,3) should be released in a update +# +select * from t1 where a = 7 and b = 3 for update; +connection a; +commit; +connection b; +commit; +drop table t1; +connection default; +disconnect a; +disconnect b; + +# +# Test case where no locks should be released (because we are not +# using READ COMMITTED isolation level) +# + +connect (a,localhost,root,,); +connect (b,localhost,root,,); +connection a; +create table t1(a int not null, b int, primary key(a)) engine=innodb; +insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2); +commit; +set autocommit = 0; +select * from t1 lock in share mode; +update t1 set b = 5 where b = 1; +connection b; +set autocommit = 0; +# +# S-lock to records (2,2),(4,2), and (6,2) should not be released in a update +# +--error 1205 +select * from t1 where a = 2 and b = 2 for update; +# +# X-lock to record (1,1),(3,1),(5,1) should not be released in a update +# +--error 1205 +connection a; +commit; +connection b; +commit; +connection default; +disconnect a; +disconnect b; +drop table t1; + +# +# Consistent read should be used in following selects +# +# 1) INSERT INTO ... SELECT +# 2) UPDATE ... = ( SELECT ...) +# 3) CREATE ... SELECT + +connect (a,localhost,root,,); +connect (b,localhost,root,,); +connection a; +create table t1(a int not null, b int, primary key(a)) engine=innodb; +insert into t1 values (1,2),(5,3),(4,2); +create table t2(d int not null, e int, primary key(d)) engine=innodb; +insert into t2 values (8,6),(12,1),(3,1); +commit; +set autocommit = 0; +select * from t2 for update; +connection b; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +insert into t1 select * from t2; +update t1 set b = (select e from t2 where a = d); +create table t3(d int not null, e int, primary key(d)) engine=innodb +select * from t2; +commit; +connection a; +commit; +connection default; +disconnect a; +disconnect b; +drop table t1, t2, t3; + +# +# Consistent read should not be used if +# +# (a) isolation level is serializable OR +# (b) select ... lock in share mode OR +# (c) select ... for update +# +# in following queries: +# +# 1) INSERT INTO ... SELECT +# 2) UPDATE ... = ( SELECT ...) +# 3) CREATE ... SELECT + +connect (a,localhost,root,,); +connect (b,localhost,root,,); +connect (c,localhost,root,,); +connect (d,localhost,root,,); +connect (e,localhost,root,,); +connect (f,localhost,root,,); +connect (g,localhost,root,,); +connect (h,localhost,root,,); +connect (i,localhost,root,,); +connect (j,localhost,root,,); +connection a; +create table t1(a int not null, b int, primary key(a)) engine=innodb; +insert into t1 values (1,2),(5,3),(4,2); +create table t2(a int not null, b int, primary key(a)) engine=innodb; +insert into t2 values (8,6),(12,1),(3,1); +create table t3(d int not null, b int, primary key(d)) engine=innodb; +insert into t3 values (8,6),(12,1),(3,1); +create table t5(a int not null, b int, primary key(a)) engine=innodb; +insert into t5 values (1,2),(5,3),(4,2); +create table t6(d int not null, e int, primary key(d)) engine=innodb; +insert into t6 values (8,6),(12,1),(3,1); +create table t8(a int not null, b int, primary key(a)) engine=innodb; +insert into t8 values (1,2),(5,3),(4,2); +create table t9(d int not null, e int, primary key(d)) engine=innodb; +insert into t9 values (8,6),(12,1),(3,1); +commit; +set autocommit = 0; +select * from t2 for update; +connection b; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; +--send +insert into t1 select * from t2; +connection c; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; +--send +update t3 set b = (select b from t2 where a = d); +connection d; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; +--send +create table t4(a int not null, b int, primary key(a)) engine=innodb select * from t2; +connection e; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +--send +insert into t5 (select * from t2 lock in share mode); +connection f; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +--send +update t6 set e = (select b from t2 where a = d lock in share mode); +connection g; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +--send +create table t7(a int not null, b int, primary key(a)) engine=innodb select * from t2 lock in share mode; +connection h; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +--send +insert into t8 (select * from t2 for update); +connection i; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +--send +update t9 set e = (select b from t2 where a = d for update); +connection j; +SET binlog_format='MIXED'; +set autocommit = 0; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +--send +create table t10(a int not null, b int, primary key(a)) engine=innodb select * from t2 for update; + +connection b; +--error 1205 +reap; + +connection c; +--error 1205 +reap; + +connection d; +--error 1205 +reap; + +connection e; +--error 1205 +reap; + +connection f; +--error 1205 +reap; + +connection g; +--error 1205 +reap; + +connection h; +--error 1205 +reap; + +connection i; +--error 1205 +reap; + +connection j; +--error 1205 +reap; + +connection a; +commit; + +connection default; +disconnect a; +disconnect b; +disconnect c; +disconnect d; +disconnect e; +disconnect f; +disconnect g; +disconnect h; +disconnect i; +disconnect j; +drop table t1, t2, t3, t5, t6, t8, t9; + +# bug 18934, "InnoDB crashes when table uses column names like DB_ROW_ID" +--error ER_WRONG_COLUMN_NAME +CREATE TABLE t1 (DB_ROW_ID int) engine=innodb; + +# +# Bug #17152: Wrong result with BINARY comparison on aliased column +# + +CREATE TABLE t1 ( + a BIGINT(20) NOT NULL, + PRIMARY KEY (a) + ) ENGINE=INNODB DEFAULT CHARSET=UTF8; + +CREATE TABLE t2 ( + a BIGINT(20) NOT NULL, + b VARCHAR(128) NOT NULL, + c TEXT NOT NULL, + PRIMARY KEY (a,b), + KEY idx_t2_b_c (b,c(200)), + CONSTRAINT t_fk FOREIGN KEY (a) REFERENCES t1 (a) + ON DELETE CASCADE + ) ENGINE=INNODB DEFAULT CHARSET=UTF8; + +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (1, 'bar', 'vbar'); +INSERT INTO t2 VALUES (1, 'BAR2', 'VBAR'); +INSERT INTO t2 VALUES (1, 'bar_bar', 'bibi'); +INSERT INTO t2 VALUES (1, 'customer_over', '1'); + +SELECT * FROM t2 WHERE b = 'customer_over'; +SELECT * FROM t2 WHERE BINARY b = 'customer_over'; +SELECT DISTINCT p0.a FROM t2 p0 WHERE p0.b = 'customer_over'; +/* Bang: Empty result set, above was expected: */ +SELECT DISTINCT p0.a FROM t2 p0 WHERE BINARY p0.b = 'customer_over'; +SELECT p0.a FROM t2 p0 WHERE BINARY p0.b = 'customer_over'; + +drop table t2, t1; + +# +# Test optimize on table with open transaction +# + +CREATE TABLE t1 ( a int ) ENGINE=innodb; +BEGIN; +INSERT INTO t1 VALUES (1); +OPTIMIZE TABLE t1; +DROP TABLE t1; + +# +# Bug #24741 (existing cascade clauses disappear when adding foreign keys) +# + +CREATE TABLE t1 (id int PRIMARY KEY, f int NOT NULL, INDEX(f)) ENGINE=InnoDB; + +CREATE TABLE t2 (id int PRIMARY KEY, f INT NOT NULL, + CONSTRAINT t2_t1 FOREIGN KEY (id) REFERENCES t1 (id) + ON DELETE CASCADE ON UPDATE CASCADE) ENGINE=InnoDB; + +ALTER TABLE t2 ADD FOREIGN KEY (f) REFERENCES t1 (f) ON +DELETE CASCADE ON UPDATE CASCADE; + +SHOW CREATE TABLE t2; +DROP TABLE t2, t1; + +# +# Bug #25927: Prevent ALTER TABLE ... MODIFY ... NOT NULL on columns +# for which there is a foreign key constraint ON ... SET NULL. +# + +CREATE TABLE t1 (a INT, INDEX(a)) ENGINE=InnoDB; +CREATE TABLE t2 (a INT, INDEX(a)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (1); +ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1 (a) ON DELETE SET NULL; +# mysqltest first does replace_regex, then replace_result +--replace_regex /'[^']*test\/#sql-[0-9a-f_]*'/'#sql-temporary'/ +# Embedded server doesn't chdir to data directory +--replace_result $MYSQLD_DATADIR ./ master-data/ '' +--error 1025 +ALTER TABLE t2 MODIFY a INT NOT NULL; +DELETE FROM t1; +DROP TABLE t2,t1; + +# +# Bug #26835: table corruption after delete+insert +# + +CREATE TABLE t1 (a VARCHAR(5) COLLATE utf8_unicode_ci PRIMARY KEY) +ENGINE=InnoDB; +INSERT INTO t1 VALUES (0xEFBCA4EFBCA4EFBCA4); +DELETE FROM t1; +INSERT INTO t1 VALUES ('DDD'); +SELECT * FROM t1; +DROP TABLE t1; + +# +# Bug #23313 (AUTO_INCREMENT=# not reported back for InnoDB tables) +# Bug #21404 (AUTO_INCREMENT value reset when Adding FKEY (or ALTER?)) +# + +CREATE TABLE t1 (id int PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB +AUTO_INCREMENT=42; + +INSERT INTO t1 VALUES (0),(347),(0); +SELECT * FROM t1; + +SHOW CREATE TABLE t1; + +CREATE TABLE t2 (id int PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t2 VALUES(42),(347),(348); +ALTER TABLE t1 ADD CONSTRAINT t1_t2 FOREIGN KEY (id) REFERENCES t2(id); +SHOW CREATE TABLE t1; + +DROP TABLE t1,t2; + +# +# Bug #21101 (Prints wrong error message if max row size is too large) +# +set innodb_strict_mode=on; +--error 1118 +CREATE TABLE t1 ( + c01 CHAR(255), c02 CHAR(255), c03 CHAR(255), c04 CHAR(255), + c05 CHAR(255), c06 CHAR(255), c07 CHAR(255), c08 CHAR(255), + c09 CHAR(255), c10 CHAR(255), c11 CHAR(255), c12 CHAR(255), + c13 CHAR(255), c14 CHAR(255), c15 CHAR(255), c16 CHAR(255), + c17 CHAR(255), c18 CHAR(255), c19 CHAR(255), c20 CHAR(255), + c21 CHAR(255), c22 CHAR(255), c23 CHAR(255), c24 CHAR(255), + c25 CHAR(255), c26 CHAR(255), c27 CHAR(255), c28 CHAR(255), + c29 CHAR(255), c30 CHAR(255), c31 CHAR(255), c32 CHAR(255) + ) ENGINE = InnoDB; + +# +# Bug #31860 InnoDB assumes AUTOINC values can only be positive. +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1( + id BIGINT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY + ) ENGINE=InnoDB; +INSERT INTO t1 VALUES(-10); +SELECT * FROM t1; +# +# NOTE: The server really needs to be restarted at this point +# for the test to be useful. +# +# Without the fix InnoDB would trip over an assertion here. +INSERT INTO t1 VALUES(NULL); +# The next value should be 1 and not -9 or a -ve number +SELECT * FROM t1; +DROP TABLE t1; + +# +# Bug #21409 Incorrect result returned when in READ-COMMITTED with +# query_cache ON +# +CONNECT (c1,localhost,root,,); +CONNECT (c2,localhost,root,,); +CONNECTION c1; +SET binlog_format='MIXED'; +SET TX_ISOLATION='read-committed'; +SET AUTOCOMMIT=0; +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 ( a int ) ENGINE=InnoDB; +CREATE TABLE t2 LIKE t1; +SELECT * FROM t2; +CONNECTION c2; +SET binlog_format='MIXED'; +SET TX_ISOLATION='read-committed'; +SET AUTOCOMMIT=0; +INSERT INTO t1 VALUES (1); +COMMIT; +CONNECTION c1; +SELECT * FROM t1 WHERE a=1; +DISCONNECT c1; +DISCONNECT c2; +CONNECT (c1,localhost,root,,); +CONNECT (c2,localhost,root,,); +CONNECTION c1; +SET binlog_format='MIXED'; +SET TX_ISOLATION='read-committed'; +SET AUTOCOMMIT=0; +SELECT * FROM t2; +CONNECTION c2; +SET binlog_format='MIXED'; +SET TX_ISOLATION='read-committed'; +SET AUTOCOMMIT=0; +INSERT INTO t1 VALUES (2); +COMMIT; +CONNECTION c1; +# The result set below should be the same for both selects +SELECT * FROM t1 WHERE a=2; +SELECT * FROM t1 WHERE a=2; +DROP TABLE t1; +DROP TABLE t2; +DISCONNECT c1; +DISCONNECT c2; +CONNECTION default; + +# +# Bug #29157 UPDATE, changed rows incorrect +# +create table t1 (i int, j int) engine=innodb; +insert into t1 (i, j) values (1, 1), (2, 2); +--enable_info +update t1 set j = 2; +--disable_info +drop table t1; + +# +# Bug #32440 InnoDB free space info does not appear in SHOW TABLE STATUS or +# I_S +# +create table t1 (id int) comment='this is a comment' engine=innodb; +select table_comment, data_free > 0 as data_free_is_set + from information_schema.tables + where table_schema='test' and table_name = 't1'; +drop table t1; + +# +# Bug 34920 test +# +CONNECTION default; +CREATE TABLE t1 ( + c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + c2 VARCHAR(128) NOT NULL, + PRIMARY KEY(c1) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=100; + +CREATE TABLE t2 ( + c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + c2 INT(10) UNSIGNED DEFAULT NULL, + PRIMARY KEY(c1) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=200; + +SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't2'; +ALTER TABLE t2 ADD CONSTRAINT t1_t2_1 FOREIGN KEY(c1) REFERENCES t1(c1); +SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't2'; +DROP TABLE t2; +DROP TABLE t1; +# End 34920 test +# +# Bug #29507 TRUNCATE shows to many rows effected +# +CONNECTION default; +CREATE TABLE t1 (c1 int default NULL, + c2 int default NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +--enable_info +TRUNCATE TABLE t1; + +INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5); +TRUNCATE TABLE t1; + +--disable_info +DROP TABLE t1; +# +# Bug#35537 Innodb doesn't increment handler_update and handler_delete. +# +-- disable_query_log +-- disable_result_log + +CONNECT (c1,localhost,root,,); + +DROP TABLE IF EXISTS bug35537; +CREATE TABLE bug35537 ( + c1 int +) ENGINE=InnoDB; + +INSERT INTO bug35537 VALUES (1); + +-- enable_result_log + +SHOW SESSION STATUS LIKE 'Handler_update%'; +SHOW SESSION STATUS LIKE 'Handler_delete%'; + +UPDATE bug35537 SET c1 = 2 WHERE c1 = 1; +DELETE FROM bug35537 WHERE c1 = 2; + +SHOW SESSION STATUS LIKE 'Handler_update%'; +SHOW SESSION STATUS LIKE 'Handler_delete%'; + +DROP TABLE bug35537; + +DISCONNECT c1; +CONNECTION default; + +SET GLOBAL innodb_thread_concurrency = @innodb_thread_concurrency_orig; + +-- enable_query_log + +####################################################################### +# # +# Please, DO NOT TOUCH this file as well as the innodb.result file. # +# These files are to be modified ONLY BY INNOBASE guys. # +# # +# Use innodb_mysql.[test|result] files instead. # +# # +# If nevertheless you need to make some changes here, please, forward # +# your commit message # +# To: innodb_dev_ww@oracle.com # +# Cc: dev-innodb@mysql.com # +# (otherwise your changes may be erased). # +# # +####################################################################### diff --git a/mysql-test/suite/innodb/t/innodb_bug21704.test b/mysql-test/suite/innodb/t/innodb_bug21704.test new file mode 100644 index 00000000000..c649b61034c --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug21704.test @@ -0,0 +1,96 @@ +-- source include/have_innodb.inc + +--echo # +--echo # Bug#21704: Renaming column does not update FK definition. +--echo # + +--echo +--echo # Test that it's not possible to rename columns participating in a +--echo # foreign key (either in the referencing or referenced table). +--echo + +--disable_warnings +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; +DROP TABLE IF EXISTS t3; +--enable_warnings + +CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ROW_FORMAT=COMPACT ENGINE=INNODB; + +CREATE TABLE t2 (a INT PRIMARY KEY, b INT, + CONSTRAINT fk1 FOREIGN KEY (a) REFERENCES t1(a)) +ROW_FORMAT=COMPACT ENGINE=INNODB; + +CREATE TABLE t3 (a INT PRIMARY KEY, b INT, KEY(b), C INT, + CONSTRAINT fk2 FOREIGN KEY (b) REFERENCES t3 (a)) +ROW_FORMAT=COMPACT ENGINE=INNODB; + +INSERT INTO t1 VALUES (1,1),(2,2),(3,3); +INSERT INTO t2 VALUES (1,1),(2,2),(3,3); +INSERT INTO t3 VALUES (1,1,1),(2,2,2),(3,3,3); + +--echo +--echo # Test renaming the column in the referenced table. +--echo + +# mysqltest first does replace_regex, then replace_result +--replace_regex /'[^']*test\/#sql-[0-9a-f_]*'/'#sql-temporary'/ +# Embedded server doesn't chdir to data directory +--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ '' +--error ER_ERROR_ON_RENAME +ALTER TABLE t1 CHANGE a c INT; + +--echo # Ensure that online column rename works. + +--enable_info +ALTER TABLE t1 CHANGE b c INT; +--disable_info + +--echo +--echo # Test renaming the column in the referencing table +--echo + +# mysqltest first does replace_regex, then replace_result +--replace_regex /'[^']*test\/#sql-[0-9a-f_]*'/'#sql-temporary'/ +# Embedded server doesn't chdir to data directory +--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ '' +--error ER_ERROR_ON_RENAME +ALTER TABLE t2 CHANGE a c INT; + +--echo # Ensure that online column rename works. + +--enable_info +ALTER TABLE t2 CHANGE b c INT; +--disable_info + +--echo +--echo # Test with self-referential constraints +--echo + +# mysqltest first does replace_regex, then replace_result +--replace_regex /'[^']*test\/#sql-[0-9a-f_]*'/'#sql-temporary'/ +# Embedded server doesn't chdir to data directory +--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ '' +--error ER_ERROR_ON_RENAME +ALTER TABLE t3 CHANGE a d INT; + +# mysqltest first does replace_regex, then replace_result +--replace_regex /'[^']*test\/#sql-[0-9a-f_]*'/'#sql-temporary'/ +# Embedded server doesn't chdir to data directory +--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ '' +--error ER_ERROR_ON_RENAME +ALTER TABLE t3 CHANGE b d INT; + +--echo # Ensure that online column rename works. + +--enable_info +ALTER TABLE t3 CHANGE c d INT; +--disable_info + +--echo +--echo # Cleanup. +--echo + +DROP TABLE t3; +DROP TABLE t2; +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/innodb_bug34053.test b/mysql-test/suite/innodb/t/innodb_bug34053.test new file mode 100644 index 00000000000..b935e45c06d --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug34053.test @@ -0,0 +1,50 @@ +# +# Make sure http://bugs.mysql.com/34053 remains fixed. +# + +-- source include/not_embedded.inc +-- source include/have_innodb.inc + +SET storage_engine=InnoDB; + +# we do not really care about what gets printed, we are only +# interested in getting success or failure according to our +# expectations +-- disable_query_log +-- disable_result_log + +GRANT USAGE ON *.* TO 'shane'@'localhost' IDENTIFIED BY '12345'; +FLUSH PRIVILEGES; + +-- connect (con1,localhost,shane,12345,) + +-- connection con1 +-- error ER_SPECIFIC_ACCESS_DENIED_ERROR +CREATE TABLE innodb_monitor (a INT) ENGINE=INNODB; +-- error ER_SPECIFIC_ACCESS_DENIED_ERROR +CREATE TABLE innodb_mem_validate (a INT) ENGINE=INNODB; +CREATE TABLE innodb_monitorx (a INT) ENGINE=INNODB; +DROP TABLE innodb_monitorx; +CREATE TABLE innodb_monito (a INT) ENGINE=INNODB; +DROP TABLE innodb_monito; +CREATE TABLE xinnodb_monitor (a INT) ENGINE=INNODB; +DROP TABLE xinnodb_monitor; +CREATE TABLE nnodb_monitor (a INT) ENGINE=INNODB; +DROP TABLE nnodb_monitor; + +-- connection default +CREATE TABLE innodb_monitor (a INT) ENGINE=INNODB; +CREATE TABLE innodb_mem_validate (a INT) ENGINE=INNODB; + +-- connection con1 +-- error ER_SPECIFIC_ACCESS_DENIED_ERROR +DROP TABLE innodb_monitor; +-- error ER_SPECIFIC_ACCESS_DENIED_ERROR +DROP TABLE innodb_mem_validate; + +-- connection default +DROP TABLE innodb_monitor; +DROP TABLE innodb_mem_validate; +DROP USER 'shane'@'localhost'; + +-- disconnect con1 diff --git a/mysql-test/suite/innodb/t/innodb_bug34300.test b/mysql-test/suite/innodb/t/innodb_bug34300.test new file mode 100644 index 00000000000..68c385fd72a --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug34300.test @@ -0,0 +1,34 @@ +# +# Bug#34300 Tinyblob & tinytext fields currupted after export/import and alter in 5.1 +# http://bugs.mysql.com/34300 +# + +-- source include/have_innodb.inc + +-- disable_query_log +-- disable_result_log + +# set packet size and reconnect +let $max_packet=`select @@global.max_allowed_packet`; +SET @@global.max_allowed_packet=16777216; +--connect (newconn, localhost, root,,) + +DROP TABLE IF EXISTS bug34300; +CREATE TABLE bug34300 ( + f4 TINYTEXT, + f6 MEDIUMTEXT, + f8 TINYBLOB +) ENGINE=InnoDB; + +INSERT INTO bug34300 VALUES ('xxx', repeat('a', 8459264), 'zzz'); + +-- enable_result_log + +SELECT f4, f8 FROM bug34300; + +ALTER TABLE bug34300 ADD COLUMN (f10 INT); + +SELECT f4, f8 FROM bug34300; + +DROP TABLE bug34300; +EVAL SET @@global.max_allowed_packet=$max_packet; diff --git a/mysql-test/suite/innodb/t/innodb_bug35220.test b/mysql-test/suite/innodb/t/innodb_bug35220.test new file mode 100644 index 00000000000..26f7d6b1ddd --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug35220.test @@ -0,0 +1,16 @@ +# +# Bug#35220 ALTER TABLE too picky on reserved word "foreign" +# http://bugs.mysql.com/35220 +# + +-- source include/have_innodb.inc + +SET storage_engine=InnoDB; + +# we care only that the following SQL commands do not produce errors +-- disable_query_log +-- disable_result_log + +CREATE TABLE bug35220 (foreign_col INT, dummy_cant_delete_all_columns INT); +ALTER TABLE bug35220 DROP foreign_col; +DROP TABLE bug35220; diff --git a/mysql-test/suite/innodb/t/innodb_bug36169.test b/mysql-test/suite/innodb/t/innodb_bug36169.test index 5bf55193b5c..5bbbf45d484 100644 --- a/mysql-test/suite/innodb/t/innodb_bug36169.test +++ b/mysql-test/suite/innodb/t/innodb_bug36169.test @@ -24,6 +24,7 @@ SET GLOBAL innodb_file_per_table=ON; # Generating 10 tables # Creating a table with 94 columns and 24 indexes DROP TABLE IF EXISTS `table0`; +set innodb_strict_mode=on; --error ER_TOO_BIG_ROWSIZE CREATE TABLE IF NOT EXISTS `table0` (`col0` BOOL, diff --git a/mysql-test/suite/innodb/t/innodb_bug38231.test b/mysql-test/suite/innodb/t/innodb_bug38231.test new file mode 100644 index 00000000000..0d4262b4473 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug38231.test @@ -0,0 +1,77 @@ +# +# Bug#38231 Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK +# http://bugs.mysql.com/38231 +# + +-- source include/have_innodb.inc + +# skip this test in embedded mode because "TRUNCATE TABLE bug38231_1" +# hangs in that mode waiting for "lock_wait_timeout" although it is +# preceded by --send +-- source include/not_embedded.inc + +SET storage_engine=InnoDB; + +# we care only that the following SQL commands do not crash the server +-- disable_query_log +-- disable_result_log + +DROP TABLE IF EXISTS bug38231_1; +CREATE TABLE bug38231_1 (a INT); + +-- connect (lock_gain,localhost,root,,) +-- connect (lock_wait1,localhost,root,,) +-- connect (lock_wait2,localhost,root,,) +-- connect (truncate_wait,localhost,root,,) + +-- connection lock_gain +SET autocommit=0; +LOCK TABLE bug38231_1 WRITE; + +-- connection lock_wait1 +SET autocommit=0; +-- send +LOCK TABLE bug38231_1 WRITE; + +-- connection lock_wait2 +SET autocommit=0; +-- send +LOCK TABLE bug38231_1 WRITE; + +-- connection truncate_wait +-- send +TRUNCATE TABLE bug38231_1; + +-- connection lock_gain +# this crashes the server if the bug is present +UNLOCK TABLES; + +# clean up + +# do not clean up - we do not know which of the three has been released +# so the --reap command may hang because the command that is being executed +# in that connection is still running/waiting +#-- connection lock_wait1 +#-- reap +#UNLOCK TABLES; +# +#-- connection lock_wait2 +#-- reap +#UNLOCK TABLES; +# +#-- connection truncate_wait +#-- reap + +-- connection default + +-- disconnect lock_gain +-- disconnect lock_wait1 +-- disconnect lock_wait2 +-- disconnect truncate_wait + +DROP TABLE bug38231_1; + +-- enable_query_log +-- enable_result_log + +-- connection default diff --git a/mysql-test/suite/innodb/t/innodb_bug39438-master.opt b/mysql-test/suite/innodb/t/innodb_bug39438-master.opt new file mode 100644 index 00000000000..43fac202fd4 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug39438-master.opt @@ -0,0 +1 @@ +--innodb-file-per-table=1 diff --git a/mysql-test/suite/innodb/t/innodb_bug39438.test b/mysql-test/suite/innodb/t/innodb_bug39438.test new file mode 100644 index 00000000000..52302871beb --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug39438.test @@ -0,0 +1,51 @@ +# +# Bug#39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch +# http://bugs.mysql.com/39438 +# +# This test must be run with innodb_file_per_table=1 because the crash +# only occurs if that option is turned on and DISCARD TABLESPACE only +# works with innodb_file_per_table. +# + +-- source include/have_innodb.inc + +SET storage_engine=InnoDB; + +# we care only that the following SQL commands do not crash the server +-- disable_query_log +-- disable_result_log + +DROP TABLE IF EXISTS bug39438; + +CREATE TABLE bug39438 (id INT) ENGINE=INNODB; + +# remove: XXX Uncomment the following ALTER and remove those lines after +# remove: applying the patch. +# remove: Obviously this test is useless without this ALTER command, +# remove: but it causes warnings to be printed by mysqld and the whole +# remove: mysql-test suite fails at the end (returns non-zero). Please +# remove: apply this patch to the mysql source tree, remove those lines +# remove: and uncomment the following ALTER. We do not care about the +# remove: warnings, this test is to ensure mysqld does not crash. +# remove: === modified file 'mysql-test/lib/mtr_report.pl' +# remove: --- mysql-test/lib/mtr_report.pl 2008-08-12 10:26:23 +0000 +# remove: +++ mysql-test/lib/mtr_report.pl 2008-10-01 11:57:41 +0000 +# remove: @@ -412,7 +412,10 @@ +# remove: +# remove: # When trying to set lower_case_table_names = 2 +# remove: # on a case sensitive file system. Bug#37402. +# remove: - /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ +# remove: + /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ or +# remove: + +# remove: + # this test is expected to print warnings +# remove: + ($testname eq 'main.innodb_bug39438') +# remove: ) +# remove: { +# remove: next; # Skip these lines +# remove: +#ALTER TABLE bug39438 DISCARD TABLESPACE; + +# this crashes the server if the bug is present +SHOW TABLE STATUS; + +DROP TABLE bug39438; diff --git a/mysql-test/suite/innodb/t/innodb_bug40565.test b/mysql-test/suite/innodb/t/innodb_bug40565.test new file mode 100644 index 00000000000..d7aa0fd514a --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug40565.test @@ -0,0 +1,10 @@ +# Bug #40565 Update Query Results in "1 Row Affected" But Should Be "Zero Rows" +-- source include/have_innodb.inc + +create table bug40565(value decimal(4,2)) engine=innodb; +insert into bug40565 values (1), (null); +--enable_info +update bug40565 set value=NULL; +update bug40565 set value=NULL; +--disable_info +drop table bug40565; diff --git a/mysql-test/suite/innodb/t/innodb_bug42101-nonzero-master.opt b/mysql-test/suite/innodb/t/innodb_bug42101-nonzero-master.opt new file mode 100644 index 00000000000..d71dbe17d5b --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug42101-nonzero-master.opt @@ -0,0 +1 @@ +--innodb_commit_concurrency=1 diff --git a/mysql-test/suite/innodb/t/innodb_bug42101-nonzero.test b/mysql-test/suite/innodb/t/innodb_bug42101-nonzero.test new file mode 100644 index 00000000000..2e4cf1f46dd --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug42101-nonzero.test @@ -0,0 +1,21 @@ +# +# Bug#42101 Race condition in innodb_commit_concurrency +# http://bugs.mysql.com/42101 +# + +-- source include/have_innodb.inc + +--error ER_WRONG_VALUE_FOR_VAR +set global innodb_commit_concurrency=0; +select @@innodb_commit_concurrency; +set global innodb_commit_concurrency=1; +select @@innodb_commit_concurrency; +set global innodb_commit_concurrency=42; +select @@innodb_commit_concurrency; +set global innodb_commit_concurrency=DEFAULT; +select @@innodb_commit_concurrency; +--error ER_WRONG_VALUE_FOR_VAR +set global innodb_commit_concurrency=0; +select @@innodb_commit_concurrency; +set global innodb_commit_concurrency=1; +select @@innodb_commit_concurrency; diff --git a/mysql-test/suite/innodb/t/innodb_bug42101.test b/mysql-test/suite/innodb/t/innodb_bug42101.test new file mode 100644 index 00000000000..f0b88e034a0 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug42101.test @@ -0,0 +1,19 @@ +# +# Bug#42101 Race condition in innodb_commit_concurrency +# http://bugs.mysql.com/42101 +# + +-- source include/have_innodb.inc + +set global innodb_commit_concurrency=0; +select @@innodb_commit_concurrency; +--error ER_WRONG_VALUE_FOR_VAR +set global innodb_commit_concurrency=1; +select @@innodb_commit_concurrency; +--error ER_WRONG_VALUE_FOR_VAR +set global innodb_commit_concurrency=42; +select @@innodb_commit_concurrency; +set global innodb_commit_concurrency=0; +select @@innodb_commit_concurrency; +set global innodb_commit_concurrency=DEFAULT; +select @@innodb_commit_concurrency; diff --git a/mysql-test/suite/innodb/t/innodb_bug44369.test b/mysql-test/suite/innodb/t/innodb_bug44369.test new file mode 100644 index 00000000000..f5d85cd5815 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug44369.test @@ -0,0 +1,17 @@ +# This is the test for bug 44369. We should +# block table creation with columns match +# some innodb internal reserved key words, +# both case sensitively and insensitely. + +--source include/have_innodb.inc + +# This create table operation should fail. +--error ER_WRONG_COLUMN_NAME +create table bug44369 (DB_ROW_ID int) engine=innodb; + +# This create should fail as well +--error ER_WRONG_COLUMN_NAME +create table bug44369 (db_row_id int) engine=innodb; + +--error ER_WRONG_COLUMN_NAME +create table bug44369 (db_TRX_Id int) engine=innodb; diff --git a/mysql-test/suite/innodb/t/innodb_bug44571.test b/mysql-test/suite/innodb/t/innodb_bug44571.test new file mode 100644 index 00000000000..91b6722d8af --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug44571.test @@ -0,0 +1,22 @@ +# +# Bug#44571 InnoDB Plugin crashes on ADD INDEX +# http://bugs.mysql.com/44571 +# Please also refer to related fix in +# http://bugs.mysql.com/47621 +# +-- source include/have_innodb.inc + +CREATE TABLE bug44571 (foo INT) ENGINE=InnoDB; +ALTER TABLE bug44571 CHANGE foo bar INT; +# Create index with the old column name will fail, +# because the CHANGE foo bar is successful. And +# the column name change would communicate to +# InnoDB with the fix from bug #47621 +-- error ER_KEY_COLUMN_DOES_NOT_EXITS +ALTER TABLE bug44571 ADD INDEX bug44571b (foo); +# The following create indexes should succeed, +# indirectly confirm the CHANGE foo bar is successful. +ALTER TABLE bug44571 ADD INDEX bug44571c (bar); +DROP INDEX bug44571c ON bug44571; +CREATE INDEX bug44571c ON bug44571 (bar); +DROP TABLE bug44571; diff --git a/mysql-test/suite/innodb/t/innodb_bug45357.test b/mysql-test/suite/innodb/t/innodb_bug45357.test new file mode 100644 index 00000000000..81727f352dd --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug45357.test @@ -0,0 +1,10 @@ +-- source include/have_innodb.inc + +set session transaction isolation level read committed; + +create table bug45357(a int, b int,key(b))engine=innodb; +insert into bug45357 values (25170,6122); +update bug45357 set a=1 where b=30131; +delete from bug45357 where b < 20996; +delete from bug45357 where b < 7001; +drop table bug45357; diff --git a/mysql-test/suite/innodb/t/innodb_bug46000.test b/mysql-test/suite/innodb/t/innodb_bug46000.test new file mode 100644 index 00000000000..5a3c666326e --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug46000.test @@ -0,0 +1,32 @@ +# This is the test for bug 46000. We shall +# block any index creation with the name of +# "GEN_CLUST_INDEX", which is the reserved +# name for innodb default primary index. + +--source include/have_innodb.inc + +# This 'create table' operation should fail because of +# using the reserve name as its index name. +--error ER_WRONG_NAME_FOR_INDEX +create table bug46000(`id` int,key `GEN_CLUST_INDEX`(`id`))engine=innodb; + +# Mixed upper/lower case of the reserved key words +--error ER_WRONG_NAME_FOR_INDEX +create table bug46000(`id` int, key `GEN_clust_INDEX`(`id`))engine=innodb; + +show warnings; + +create table bug46000(id int) engine=innodb; + +# This 'create index' operation should fail. +--error ER_WRONG_NAME_FOR_INDEX +create index GEN_CLUST_INDEX on bug46000(id); + +show warnings; + +# This 'create index' operation should succeed, no +# temp table left from last failed create index +# operation. +create index idx on bug46000(id); + +drop table bug46000; diff --git a/mysql-test/suite/innodb/t/innodb_bug47621.test b/mysql-test/suite/innodb/t/innodb_bug47621.test new file mode 100644 index 00000000000..4863cc6bba1 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug47621.test @@ -0,0 +1,57 @@ +# This is the test for bug #47621, column rename operation should +# not result in column definition inconsistency between MySQL and +# InnoDB + +--source include/have_innodb.inc + +CREATE TABLE bug47621 (salesperson INT) ENGINE=InnoDB; + +# Change the column name +ALTER TABLE bug47621 CHANGE salesperson sales_acct_id INT; + +# If there is inconsistency of column name definition +# in MySQL or InnoDB, following create index would fail +create index orgs on bug47621(sales_acct_id); + +# Change the column name back with the index defined on it. +ALTER TABLE bug47621 CHANGE sales_acct_id salesperson INT; + +drop table bug47621; + +CREATE TABLE bug47621_sale ( + salesperson INT, + PRIMARY KEY(salesperson)) engine = innodb; + +CREATE TABLE bug47621_shirt( + id SMALLINT, + owner INT, + FOREIGN KEY(owner) + references bug47621_sale(salesperson) ON DELETE RESTRICT) + engine = innodb; + +insert into bug47621_sale values(9); + +insert into bug47621_shirt values(1, 9); + +# Any rename operation on columns involved in a reference constraint will +# fail, as it will be rejected by InnoDB row_rename_table_for_mysql(). +# In above example, any rename on column "salesperson" for table +# "bug47621_sale", or on column "owner" for table "bug47621_shirt will +# be blocked. We do not put such rename in the test since InnoDB error +# message will be printed in the error log, and result in test failure. +# +# ALTER TABLE bug47621_sale CHANGE salesperson sales_acct_id INT; + +# Any rename on columns not involved in the foreign key constraint +# could still proceed +ALTER TABLE bug47621_shirt CHANGE id new_id INT; + +# Referencing table dropped, the rename operation on related columns +# could proceed +drop table bug47621_shirt; + +ALTER TABLE bug47621_sale CHANGE salesperson sales_acct_id INT; + +ALTER TABLE bug47621_sale ADD INDEX idx (sales_acct_id); + +drop table bug47621_sale; diff --git a/mysql-test/suite/innodb/t/innodb_bug47622.test b/mysql-test/suite/innodb/t/innodb_bug47622.test new file mode 100644 index 00000000000..9cf9d0e531b --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug47622.test @@ -0,0 +1,55 @@ +# This is the test for bug 47622. There could be index +# metadata sequence mismatch between MySQL and Innodb +# after creating index through FIC interfaces. +# We resolve the problem by sync the index sequence +# up when opening the table. + +--source include/have_innodb.inc + +connect (a,localhost,root,,); +connect (b,localhost,root,,); + +# Create a table with a non-unique index +CREATE TABLE bug47622( + `rule_key` int(11) NOT NULL DEFAULT '0', + `seq` smallint(6) NOT NULL DEFAULT '0', + `action` smallint(6) NOT NULL DEFAULT '0', + `arg_id` smallint(6) DEFAULT NULL, + `else_ind` TINYINT NOT NULL, + KEY IDX_A (`arg_id`) +) ENGINE=InnoDB; + +connection a; + +# A subsequent creating unique index should not trigger +# any error message. Unique index would be ranked ahead +# of regular index. +ALTER TABLE bug47622 ADD UNIQUE IDX_B (rule_key,else_ind,seq,action,arg_id); + +drop index IDX_B on bug47622; + +# In another connection, create additional set of normal +# index and unique index. Again, unique index would be ranked +# ahead of regular index. +connection b; +create index idx on bug47622(seq, arg_id); + +ALTER TABLE bug47622 ADD UNIQUE IDX_X (rule_key,else_ind,seq,action); + +drop table bug47622; + +# Create a table with one Primary key and a non-unique key +CREATE TABLE bug47622 ( + `a` int(11) NOT NULL, + `b` int(11) DEFAULT NULL, + `c` char(10) DEFAULT NULL, + `d` varchar(20) DEFAULT NULL, + PRIMARY KEY (`a`), + KEY `b` (`b`) +) ENGINE=InnoDB; + +# Add two index with one unique and one non-unique. +# Index sequence is "PRIMARY", "c", "b" and "d" +alter table bug47622 add unique index (c), add index (d); + +drop table bug47622; diff --git a/mysql-test/suite/innodb/t/innodb_bug47777.test b/mysql-test/suite/innodb/t/innodb_bug47777.test new file mode 100644 index 00000000000..8f2985b2cf0 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug47777.test @@ -0,0 +1,24 @@ +# This is the test for bug 47777. GEOMETRY +# data is treated as BLOB data in innodb. +# Consequently, its key value generation/storing +# should follow the process for the BLOB +# datatype as well. + +--source include/have_innodb.inc + +create table bug47777(c2 linestring not null, primary key (c2(1))) engine=innodb; + +insert into bug47777 values (geomfromtext('linestring(1 2,3 4,5 6,7 8,9 10)')); + +# Verify correct row get inserted. +select count(*) from bug47777 where c2 =geomfromtext('linestring(1 2,3 4,5 6,7 8,9 10)'); + +# Update table bug47777 should be successful. +update bug47777 set c2=GeomFromText('POINT(1 1)'); + +# Verify the row get updated successfully. The original +# c2 value should be changed to GeomFromText('POINT(1 1)'). +select count(*) from bug47777 where c2 =geomfromtext('linestring(1 2,3 4,5 6,7 8,9 10)'); +select count(*) from bug47777 where c2 = GeomFromText('POINT(1 1)'); + +drop table bug47777; diff --git a/mysql-test/suite/innodb/t/innodb_bug48024.test b/mysql-test/suite/innodb/t/innodb_bug48024.test new file mode 100644 index 00000000000..db828aa1cda --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug48024.test @@ -0,0 +1,22 @@ +# Bug #48024 Innodb doesn't work with multi-statements + +--source include/have_innodb.inc + +CREATE TABLE bug48024(a int PRIMARY KEY,b int NOT NULL,KEY(b)) ENGINE=InnoDB; +CREATE TABLE bug48024_b(b int PRIMARY KEY) ENGINE=InnoDB; +# Bug #53644 InnoDB thinks that /*/ starts and ends a comment +ALTER TABLE bug48024 /*/ADD CONSTRAINT FOREIGN KEY(c) REFERENCES(a),/*/ +ADD CONSTRAINT FOREIGN KEY(b) REFERENCES bug48024_b(b); + +DROP TABLE bug48024,bug48024_b; + +# Work around Bug #53750 (failure in mysql-test-run --ps-protocol) +-- disable_ps_protocol +delimiter |; +CREATE TABLE bug48024(a int PRIMARY KEY,b int NOT NULL,KEY(b)) ENGINE=InnoDB; +CREATE TABLE bug48024_b(b int PRIMARY KEY) ENGINE=InnoDB; +ALTER TABLE bug48024 /*/ADD CONSTRAINT FOREIGN KEY(c) REFERENCES(a),/*/ +ADD CONSTRAINT FOREIGN KEY(b) REFERENCES bug48024_b(b)| +delimiter ;| + +DROP TABLE bug48024,bug48024_b; diff --git a/mysql-test/suite/innodb/t/innodb_bug49164.test b/mysql-test/suite/innodb/t/innodb_bug49164.test new file mode 100644 index 00000000000..7f1c9f4ca9c --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug49164.test @@ -0,0 +1,47 @@ +-- source include/have_innodb.inc + +# Bug #49164 READ-COMMITTED reports "matched: 0" on compound PK +# a duplicate of +# Bug #52663 Lost update incrementing column value under READ COMMITTED + +connect (con1,localhost,root,,); +connect (con2,localhost,root,,); + +connection con1; +SET tx_isolation = 'READ-COMMITTED'; + +CREATE TABLE bug49164 (a INT, b BIGINT, c TINYINT, PRIMARY KEY (a, b)) +ENGINE=InnoDB; + +insert into bug49164 values (1,1,1), (2,2,2), (3,3,3); + +begin; +update bug49164 set c=7; +select * from bug49164; +rollback; +select * from bug49164; +begin; +update bug49164 set c=7; + +connection con2; + +SET tx_isolation = 'READ-COMMITTED'; +begin; +select * from bug49164; +commit; +begin; +--send +update bug49164 set c=6 where a=1 and b=1; + +connection con1; +rollback; +select * from bug49164; +connection con2; +reap; +commit; +connection con1; +select * from bug49164; +connection default; +disconnect con1; +disconnect con2; +drop table bug49164; diff --git a/mysql-test/suite/innodb/t/innodb_bug51378.test b/mysql-test/suite/innodb/t/innodb_bug51378.test new file mode 100644 index 00000000000..8f7b0b9605a --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug51378.test @@ -0,0 +1,77 @@ +# This is the test for bug 51378. Unique index created +# through "create index" and "alter table add unique index" +# interfaces should not be treated as primary index if indexed +# columns contain one or more column prefix(es) (only prefix/part of +# the column is indexed) +# On the other hand, if there is a unique index covers all +# columns of a table, and they are non-null columns, and +# full length of the column are indexed, then this index +# will be created as primary index +# Following queries test various scenario, no mismatch +# error message should be printed. +--source include/have_innodb.inc + +# Create a table contains a BLOB column +create table bug51378 ( + col1 int not null, + col2 blob not null, + col3 time not null) engine = innodb; + +# Create following unique indexes on 'col1' and 'col2(31)' +# of the table, the index should not be treated as primary +# key because it indexes only first 31 bytes of col2. +# Thus it contains "column prefix", and will not be +# upgraded to primary index. +# There should not be mismatch message printed in the +# errorlog +create unique index idx on bug51378(col1, col2(31)); + +alter table bug51378 add unique index idx2(col1, col2(31)); + +# Unique index on 'col1' and 'col3' will be created as primary index, +# since the index does not contain column prefix +create unique index idx3 on bug51378(col1, col3); + +# Show create table would show idx3 created as unique index, internally, +# idx3 is treated as primary index both by MySQL and Innodb +SHOW CREATE TABLE bug51378; + +# "GEN_CLUST_INDEX" will be re-created as default primary index +# after idx3 is dropped +drop index idx3 on bug51378; + +SHOW CREATE TABLE bug51378; + +# Or we can add the primary key through alter table interfaces +alter table bug51378 add primary key idx3(col1, col2(31)); + +SHOW CREATE TABLE bug51378; + +drop table bug51378; + +# Or we can create such primary key through create table interfaces +create table bug51378 ( + col1 int not null, + col2 blob not null, + col3 time not null, primary key(col1, col2(31))) engine = innodb; + +# Unique index on one or more column prefix(es) will be created +# as non-cluster index +create unique index idx on bug51378(col1, col2(31)); + +SHOW CREATE TABLE bug51378; + +drop table bug51378; + +# If a table has a NULLABLE column, unique index on it will not +# be treated as primary index. +create table bug51378 ( + col1 int not null, + col2 int ) engine = innodb; + +# This will be created as non-cluster index since col2 is nullable +create unique index idx on bug51378(col1, col2); + +SHOW CREATE TABLE bug51378; + +drop table bug51378; diff --git a/mysql-test/suite/innodb/t/innodb_bug51920.test b/mysql-test/suite/innodb/t/innodb_bug51920.test new file mode 100644 index 00000000000..bc3bb006c1c --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug51920.test @@ -0,0 +1,43 @@ +# +# Bug #51920: InnoDB connections in lock wait ignore KILL until timeout +# +-- source include/not_embedded.inc +-- source include/have_innodb.inc + +CREATE TABLE bug51920 (i INT) ENGINE=InnoDB; +INSERT INTO bug51920 VALUES (1); + +BEGIN; +SELECT * FROM bug51920 FOR UPDATE; + +connect (con1,localhost,root,,); + +connection con1; +--send +UPDATE bug51920 SET i=2; + +connection default; +let $wait_condition = + SELECT COUNT(*)=1 FROM information_schema.processlist + WHERE INFO="UPDATE bug51920 SET i=2"; +-- source include/wait_condition.inc + +SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST +WHERE INFO="UPDATE bug51920 SET i=2" +INTO @thread_id; + +KILL @thread_id; +let $wait_condition = + SELECT COUNT(*)=0 FROM information_schema.processlist WHERE ID=@thread_id; +-- source include/wait_condition.inc + +# +# Bug#19723: kill of active connection yields different error code +# depending on platform. +# +connection con1; +-- error 1317, 2006, 2013 +reap; +connection default; +DROP TABLE bug51920; +-- disconnect con1 diff --git a/mysql-test/suite/innodb/t/innodb_bug52663.test b/mysql-test/suite/innodb/t/innodb_bug52663.test new file mode 100644 index 00000000000..fcf97531e00 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug52663.test @@ -0,0 +1,34 @@ +--source include/have_innodb.inc + +set session transaction isolation level read committed; + +create table innodb_bug52663 (what varchar(5), id integer, count integer, primary key +(what, id)) engine=innodb; +insert into innodb_bug52663 values ('total', 0, 0); +begin; + +connect (addconroot, localhost, root,,); +connection addconroot; +set session transaction isolation level read committed; +begin; + +connection default; +update innodb_bug52663 set count = count + 1 where what = 'total' and id = 0; +select * from innodb_bug52663; + +connection addconroot; +--error ER_LOCK_WAIT_TIMEOUT +update innodb_bug52663 set count = count + 1 where what = 'total' and id = 0; +select * from innodb_bug52663; + +connection default; +commit; + +connection addconroot; +update innodb_bug52663 set count = count + 1 where what = 'total' and id = 0; +commit; +select * from innodb_bug52663; + +connection default; +select * from innodb_bug52663; +drop table innodb_bug52663; diff --git a/mysql-test/suite/innodb/t/innodb_bug52745.test b/mysql-test/suite/innodb/t/innodb_bug52745.test new file mode 100644 index 00000000000..d2de869648b --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug52745.test @@ -0,0 +1,109 @@ +-- source include/have_innodb.inc + +let $file_format=`select @@innodb_file_format`; +let $file_format_check=`select @@innodb_file_format_check`; +let $file_per_table=`select @@innodb_file_per_table`; +SET GLOBAL innodb_file_format='Barracuda'; +SET GLOBAL innodb_file_per_table=on; + +CREATE TABLE bug52745 ( + a2 int(10) unsigned DEFAULT NULL, + col37 time DEFAULT NULL, + col38 char(229) CHARACTER SET utf8 DEFAULT NULL, + col39 text, + col40 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + col41 int(10) unsigned DEFAULT NULL, + col42 varchar(248) CHARACTER SET utf8 DEFAULT NULL, + col43 smallint(5) unsigned zerofill DEFAULT NULL, + col44 varchar(150) CHARACTER SET utf8 DEFAULT NULL, + col45 float unsigned zerofill DEFAULT NULL, + col46 binary(1) DEFAULT NULL, + col47 tinyint(4) DEFAULT NULL, + col48 tinyint(1) DEFAULT NULL, + col49 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + col50 binary(1) DEFAULT NULL, + col51 double unsigned zerofill DEFAULT NULL, + col52 int(10) unsigned DEFAULT NULL, + col53 time DEFAULT NULL, + col54 double unsigned DEFAULT NULL, + col55 time DEFAULT NULL, + col56 mediumtext CHARACTER SET latin2, + col57 blob, + col58 decimal(52,16) unsigned zerofill NOT NULL DEFAULT '000000000000000000000000000000000000.0000000000000000', + col59 binary(1) DEFAULT NULL, + col60 longblob, + col61 time DEFAULT NULL, + col62 longtext CHARACTER SET utf8 COLLATE utf8_persian_ci, + col63 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + col64 int(10) unsigned DEFAULT NULL, + col65 date DEFAULT NULL, + col66 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + col67 binary(1) DEFAULT NULL, + col68 tinyblob, + col69 date DEFAULT NULL, + col70 tinyint(3) unsigned zerofill DEFAULT NULL, + col71 varchar(44) CHARACTER SET utf8 DEFAULT NULL, + col72 datetime DEFAULT NULL, + col73 smallint(5) unsigned zerofill DEFAULT NULL, + col74 longblob, + col75 bit(34) DEFAULT NULL, + col76 float unsigned zerofill DEFAULT NULL, + col77 year(2) DEFAULT NULL, + col78 tinyint(3) unsigned DEFAULT NULL, + col79 set('msfheowh','tbpxbgf','by','wahnrjw','myqfasxz','rsokyumrt') CHARACTER SET latin2 DEFAULT NULL, + col80 datetime DEFAULT NULL, + col81 smallint(6) DEFAULT NULL, + col82 enum('xtaurnqfqz','rifrse','kuzwpbvb','niisabk','zxavro','rbvasv','','uulrfaove','','') DEFAULT NULL, + col83 bigint(20) unsigned zerofill DEFAULT NULL, + col84 float unsigned zerofill DEFAULT NULL, + col85 double DEFAULT NULL, + col86 enum('ylannv','','vlkhycqc','snke','cxifustp','xiaxaswzp','oxl') CHARACTER SET latin1 COLLATE latin1_german2_ci DEFAULT NULL, + col87 varbinary(221) DEFAULT NULL, + col88 double unsigned DEFAULT NULL, + col89 float unsigned zerofill DEFAULT NULL, + col90 tinyblob +) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; + +INSERT INTO bug52745 SET +col40='0000-00-00 00:00:00', +col51=16547, +col53='7711484', +col54=-28604, +col55='7112612', +col56='wakefulness\'', +col57=repeat('absorbefacient\'',106), +col58=11027, +col59='AM09gW7', +col60=repeat('Noelani\'',16), +col61='2520576', +col62='substitutiv', +col63='19950106155112', +col64=-12038, +col65='86238806', +col66='19600719080256', +col68=repeat('Sagittarius\'',54), +col69='38943902', +col70=1232, +col71='Elora\'', +col74=repeat('zipp',11), +col75='0', +col76=23254, +col78=13247, +col79='56219', +col80='20500609035724', +col81=11632, +col82=7, +col84=-23863, +col85=6341, +col87='HZdkf.4 s7t,5Rmq 8so fmr,ruGLUG25TrtI.yQ 2SuHq0ML7rw7.4 b2yf2E5TJxOtBBZImezDnzpj,uPYfznnEUDN1e9aQoO 2DsplB7TFWy oQJ br HLF :F,eQ p4i1oWsr lL3PG,hjCz6hYqN h1QTjLCjrv:QCdSzpYBibJAtZCxLOk3l6Blsh.W', +col88=16894, +col89=6161, +col90=repeat('gale',48); + +SHOW WARNINGS; + +DROP TABLE bug52745; + +EVAL SET GLOBAL innodb_file_format=$file_format; +EVAL SET GLOBAL innodb_file_format_check=$file_format_check; +EVAL SET GLOBAL innodb_file_per_table=$file_per_table; diff --git a/mysql-test/suite/innodb/t/innodb_bug53290.test b/mysql-test/suite/innodb/t/innodb_bug53290.test new file mode 100644 index 00000000000..ea15212fa39 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug53290.test @@ -0,0 +1,22 @@ +-- source include/have_innodb.inc + +create table bug53290 (x bigint) engine=innodb; + +insert into bug53290 () values (),(),(),(),(),(),(),(),(),(),(),(); +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; + +alter table bug53290 add unique index `idx` (x); + +drop table bug53290; diff --git a/mysql-test/suite/innodb/t/innodb_bug53591.test b/mysql-test/suite/innodb/t/innodb_bug53591.test new file mode 100644 index 00000000000..58a7596dff9 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug53591.test @@ -0,0 +1,22 @@ +-- source include/have_innodb.inc + +let $file_format=`select @@innodb_file_format`; +let $file_format_check=`select @@innodb_file_format_check`; +let $file_per_table=`select @@innodb_file_per_table`; + +SET GLOBAL innodb_file_format='Barracuda'; +SET GLOBAL innodb_file_per_table=on; + +set old_alter_table=0; + +CREATE TABLE bug53591(a text charset utf8 not null) +ENGINE=InnoDB KEY_BLOCK_SIZE=1; +-- error 139 +ALTER TABLE bug53591 ADD PRIMARY KEY(a(220)); +SHOW WARNINGS; + +DROP TABLE bug53591; + +EVAL SET GLOBAL innodb_file_format=$file_format; +EVAL SET GLOBAL innodb_file_format_check=$file_format_check; +EVAL SET GLOBAL innodb_file_per_table=$file_per_table; diff --git a/mysql-test/suite/innodb/t/innodb_bug53592.test b/mysql-test/suite/innodb/t/innodb_bug53592.test new file mode 100644 index 00000000000..bc37743f6bf --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug53592.test @@ -0,0 +1,82 @@ +# Testcase for Bug #53592 - "crash replacing duplicates into +# table after fast alter table added unique key". The fix is to make +# sure index number lookup should go through "index translation table". + +--source include/have_innodb.inc + +# Use FIC for index creation +set old_alter_table=0; + +create table bug53592(a int) engine=innodb row_format=compact; + +alter table bug53592 add column b text charset utf8; + +alter table bug53592 add column c blob not null; + +# Create a non-unique nonclustered index +create index bug53592_b on bug53592(b(81)); + +# Create a unique index, this unique index should have smaller +# index number than bug53592_b, since unique index ranks higher +# than regular index does +create unique index bug53592_c on bug53592(c(1)); + +# This will trigger a dup key error and will require fetching +# the index number through a index structure for the error reporting. +# To get the correct index number, the code should go through index +# translation table. Otherwise, it will get the wrong index +# number and later trigger a server crash. +replace into bug53592 values (),(); + +check table bug53592; + +drop table bug53592; + +# Running the same set of test when "old_alter_table" is turned on +set old_alter_table=1; + +create table bug53592(a int) engine=innodb row_format=compact; + +alter table bug53592 add column b text charset utf8; + +alter table bug53592 add column c blob not null; + +# Create a non-unique nonclustered index +create index bug53592_b on bug53592(b(81)); + +# Create a unique index +create unique index bug53592_c on bug53592(c(1)); + +# This will trigger a dup key error and will require fetching +# the index number through a index structure for the error reporting. +# To get the correct index number, the code should go through index +# translation table. Otherwise, it will get the wrong index +# number and later trigger a server crash. +replace into bug53592 values (),(); + +check table bug53592; +drop table bug53592; + +# Test a dup key reported by foreign key constriant. +CREATE TABLE bug53592_1( + col1 int, col2 int, + PRIMARY KEY (col1, col2) +) ENGINE=InnoDB; + +CREATE TABLE bug53592_2 ( + col int PRIMARY KEY, + FOREIGN KEY (col) REFERENCES bug53592_1 (col1) + ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB; + +INSERT INTO bug53592_1 VALUES (1, 2); +INSERT INTO bug53592_1 VALUES (3, 4); + +INSERT INTO bug53592_2 VALUES (1); +INSERT INTO bug53592_2 VALUES (3); + +--error ER_FOREIGN_DUPLICATE_KEY +UPDATE bug53592_1 SET col1 = 3 WHERE col2 = 2; + +drop table bug53592_2; +drop table bug53592_1; diff --git a/mysql-test/suite/innodb/t/innodb_bug53674-master.opt b/mysql-test/suite/innodb/t/innodb_bug53674-master.opt new file mode 100644 index 00000000000..f1cfd7ab6c7 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug53674-master.opt @@ -0,0 +1 @@ +--log-bin --innodb-locks-unsafe-for-binlog --binlog-format=mixed diff --git a/mysql-test/suite/innodb/t/innodb_bug53674.test b/mysql-test/suite/innodb/t/innodb_bug53674.test new file mode 100644 index 00000000000..47f67f109c3 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug53674.test @@ -0,0 +1,8 @@ +-- source include/have_innodb.inc + +create table bug53674(a int)engine=innodb; +insert into bug53674 values (1),(2); +start transaction; +select * from bug53674 for update; +select * from bug53674 where a=(select a from bug53674 where a > 1); +drop table bug53674; diff --git a/mysql-test/suite/innodb/t/innodb_file_format.test b/mysql-test/suite/innodb/t/innodb_file_format.test index 4e11da5f123..5d094cb9dba 100644 --- a/mysql-test/suite/innodb/t/innodb_file_format.test +++ b/mysql-test/suite/innodb/t/innodb_file_format.test @@ -1,10 +1,5 @@ -- source include/have_innodb.inc -call mtr.add_suppression("InnoDB: invalid innodb_file_format_check value"); - -let $format=`select @@innodb_file_format`; -let $innodb_file_format_check_orig=`select @@innodb_file_format_check`; - select @@innodb_file_format; select @@innodb_file_format_check; set global innodb_file_format=antelope; @@ -31,12 +26,4 @@ set global innodb_file_format=on; --error ER_WRONG_VALUE_FOR_VAR set global innodb_file_format=off; select @@innodb_file_format_check; - -# -# restore environment to the state it was before this test execution -# - --- disable_query_log -eval set global innodb_file_format=$format; -eval set global innodb_file_format_check=$innodb_file_format_check_orig; --- enable_query_log +set global innodb_file_format_check=antelope; diff --git a/mysql-test/suite/innodb/t/innodb_information_schema.test b/mysql-test/suite/innodb/t/innodb_information_schema.test index fc1d38d8d14..3dc2a8a40d4 100644 --- a/mysql-test/suite/innodb/t/innodb_information_schema.test +++ b/mysql-test/suite/innodb/t/innodb_information_schema.test @@ -64,6 +64,8 @@ INSERT INTO ```t'\"_str` VALUES INSERT INTO ```t'\"_str` VALUES ('4', 'abc', 0x00616263, 0x61626300, 0x61006263, 0x6100626300, 0x610062630000); +--source include/count_sessions.inc + -- connect (con_lock,localhost,root,,) -- connect (con_min_trylock,localhost,root,,) -- connect (con_max_trylock,localhost,root,,) @@ -147,3 +149,104 @@ SET @@sql_mode=@save_sql_mode; -- disconnect con_verify_innodb_locks DROP TABLE t_min, t_max, ```t'\"_str`; + +--source include/wait_until_count_sessions.inc + +# +# Test that transaction data is correctly "visualized" in +# INFORMATION_SCHEMA.INNODB_TRX +# + +-- enable_result_log +DESCRIBE INFORMATION_SCHEMA.INNODB_TRX; +-- disable_result_log + +-- disable_warnings +DROP TABLE IF EXISTS t1; +-- enable_warnings + +CREATE TABLE t1 ( + c01 INT, + c02 INT, + PRIMARY KEY (c01) +) ENGINE = InnoDB; + +INSERT INTO t1 VALUES +(1,2),(2,4),(3,6),(4,8); + +CREATE TABLE t2 ( + c01 INT, + c02 INT, + PRIMARY KEY (c01), + FOREIGN KEY fk1 (c02) REFERENCES t1 (c01) +) ENGINE = InnoDB; + +INSERT INTO t2 VALUES +(1,1),(2,2),(3,3); + +-- connect (con_trx,localhost,root,,) +-- connect (con_verify_innodb_trx,localhost,root,,) + +-- connection con_trx +SET autocommit=0; +INSERT INTO t1 VALUES (5,10); +SELECT * FROM t1 FOR UPDATE; + +let $wait_condition= + SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_TRX; +--source include/wait_condition.inc +-- disable_query_log + +-- connection con_verify_innodb_trx +-- enable_result_log +SELECT trx_state, trx_weight, trx_tables_in_use, trx_tables_locked, +trx_rows_locked, trx_rows_modified, trx_concurrency_tickets, +trx_isolation_level, trx_unique_checks, trx_foreign_key_checks +FROM INFORMATION_SCHEMA.INNODB_TRX; + +-- connection con_trx +-- disable_result_log +ROLLBACK; +SET FOREIGN_KEY_CHECKS = 0; +SET UNIQUE_CHECKS = 0; +SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; +BEGIN; +INSERT INTO t1 VALUES (6,12); + +let $wait_condition= + SELECT trx_unique_checks = 0 FROM INFORMATION_SCHEMA.INNODB_TRX; +--source include/wait_condition.inc +-- disable_query_log + +-- connection con_verify_innodb_trx +-- enable_result_log +SELECT trx_isolation_level, trx_unique_checks, trx_foreign_key_checks +FROM INFORMATION_SCHEMA.INNODB_TRX; + +-- disable_result_log +-- connection con_trx +ROLLBACK; +SET FOREIGN_KEY_CHECKS = 1; +SET UNIQUE_CHECKS = 1; +BEGIN; +-- error 1452 +INSERT INTO t2 VALUES (4,10); + +let $wait_condition= + SELECT trx_unique_checks = 1 FROM INFORMATION_SCHEMA.INNODB_TRX; +--source include/wait_condition.inc +-- disable_query_log + +-- enable_result_log +-- connection con_verify_innodb_trx +SELECT trx_state, trx_isolation_level, trx_last_foreign_key_error +FROM INFORMATION_SCHEMA.INNODB_TRX; +-- disable_result_log + +-- connection default + +-- disconnect con_trx +-- disconnect con_verify_innodb_trx + +DROP TABLE t2; +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/innodb_multi_update.test b/mysql-test/suite/innodb/t/innodb_multi_update.test new file mode 100644 index 00000000000..7ab17ccf70a --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_multi_update.test @@ -0,0 +1,29 @@ +-- source include/have_innodb.inc + +# +# Test multi update with different join methods +# + +CREATE TABLE bug38999_1 (a int not null primary key, b int not null, key (b)) engine=innodb; +CREATE TABLE bug38999_2 (a int not null primary key, b int not null, key (b)) engine=innodb; +INSERT INTO bug38999_1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10),(11,11),(12,12); +INSERT INTO bug38999_2 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); + +# Full join, without key +update bug38999_1,bug38999_2 set bug38999_1.a=bug38999_1.a+100; +select * from bug38999_1; + +# unique key +update bug38999_1,bug38999_2 set bug38999_1.a=bug38999_1.a+100 where bug38999_1.a=101; +select * from bug38999_1; + +# ref key +update bug38999_1,bug38999_2 set bug38999_1.b=bug38999_1.b+10 where bug38999_1.b=2; +select * from bug38999_1; + +# Range key (in bug38999_1) +update bug38999_1,bug38999_2 set bug38999_1.b=bug38999_1.b+2,bug38999_2.b=bug38999_1.b+10 where bug38999_1.b between 3 and 5 and bug38999_1.a=bug38999_2.a+100; +select * from bug38999_1; +select * from bug38999_2; + +drop table bug38999_1,bug38999_2; diff --git a/mysql-test/suite/innodb/t/innodb_trx_weight.test b/mysql-test/suite/innodb/t/innodb_trx_weight.test new file mode 100644 index 00000000000..b72eaad345f --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_trx_weight.test @@ -0,0 +1,108 @@ +# +# Ensure that the number of locks (SELECT FOR UPDATE for example) is +# added to the number of altered rows when choosing the smallest +# transaction to kill as a victim when a deadlock is detected. +# Also transactions what had edited non-transactional tables should +# be heavier than ones that had not. +# + +-- source include/have_innodb.inc + +SET storage_engine=InnoDB; + +# we do not really care about what gets printed, we are only +# interested in getting the deadlock resolved according to our +# expectations +-- disable_query_log +-- disable_result_log + +# we want to use "-- eval statement1; statement2" which does not work with +# prepared statements. Because this test should not behave differently with +# or without prepared statements we disable them so the test does not fail +# if someone runs ./mysql-test-run.pl --ps-protocol +-- disable_ps_protocol + +-- disable_warnings +DROP TABLE IF EXISTS t1, t2, t3, t4, t5_nontrans; +-- enable_warnings + +# we will create a simple deadlock with t1, t2 and two connections +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (a INT); + +# auxiliary table with a bulk of rows which will be locked by a +# transaction to increase its weight +CREATE TABLE t3 (a INT); + +# auxiliary empty table which will be inserted by a +# transaction to increase its weight +CREATE TABLE t4 (a INT); + +# auxiliary non-transactional table which will be edited by a +# transaction to tremendously increase its weight +CREATE TABLE t5_nontrans (a INT) ENGINE=MyISAM; + +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (1); +# insert a lot of rows in t3 +INSERT INTO t3 VALUES (1); +INSERT INTO t3 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t3; + +# test locking weight + +-- let $con1_extra_sql = +-- let $con1_extra_sql_present = 0 +-- let $con2_extra_sql = SELECT * FROM t3 FOR UPDATE +-- let $con2_extra_sql_present = 1 +-- let $con1_should_be_rolledback = 1 +-- source include/innodb_trx_weight.inc + +-- let $con1_extra_sql = INSERT INTO t4 VALUES (1), (1) +-- let $con1_extra_sql_present = 1 +-- let $con2_extra_sql = SELECT * FROM t3 FOR UPDATE +-- let $con2_extra_sql_present = 1 +-- let $con1_should_be_rolledback = 1 +-- source include/innodb_trx_weight.inc + +-- let $con1_extra_sql = INSERT INTO t4 VALUES (1), (1), (1), (1), (1), (1) +-- let $con1_extra_sql_present = 1 +-- let $con2_extra_sql = SELECT * FROM t3 FOR UPDATE +-- let $con2_extra_sql_present = 1 +-- let $con1_should_be_rolledback = 0 +-- source include/innodb_trx_weight.inc + +# test weight when non-transactional tables are edited + +-- let $con1_extra_sql = INSERT INTO t4 VALUES (1), (1), (1) +-- let $con1_extra_sql_present = 1 +-- let $con2_extra_sql = +-- let $con2_extra_sql_present = 0 +-- let $con1_should_be_rolledback = 0 +-- source include/innodb_trx_weight.inc + +-- let $con1_extra_sql = INSERT INTO t4 VALUES (1), (1), (1) +-- let $con1_extra_sql_present = 1 +-- let $con2_extra_sql = INSERT INTO t5_nontrans VALUES (1) +-- let $con2_extra_sql_present = 1 +-- let $con1_should_be_rolledback = 1 +-- source include/innodb_trx_weight.inc + +-- let $con1_extra_sql = INSERT INTO t4 VALUES (1), (1), (1) +-- let $con1_extra_sql = $con1_extra_sql; INSERT INTO t5_nontrans VALUES (1) +-- let $con1_extra_sql_present = 1 +-- let $con2_extra_sql = INSERT INTO t5_nontrans VALUES (1) +-- let $con2_extra_sql_present = 1 +-- let $con1_should_be_rolledback = 0 +-- source include/innodb_trx_weight.inc + +DROP TABLE t1, t2, t3, t4, t5_nontrans; diff --git a/mysql-test/suite/ndb/r/ndb_binlog_format.result b/mysql-test/suite/ndb/r/ndb_binlog_format.result index baf00186ff3..909d122bfc6 100644 --- a/mysql-test/suite/ndb/r/ndb_binlog_format.result +++ b/mysql-test/suite/ndb/r/ndb_binlog_format.result @@ -9,12 +9,12 @@ INSERT INTO t1 VALUES (1,1), (1,2), (2,1), (2,2); INSERT INTO t2 VALUES (1,1), (1,2), (2,1), (2,2); UPDATE t1, t2 SET m = 2, b = 3 WHERE n = c; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. START TRANSACTION; INSERT INTO t3 VALUES (1,1), (1,2), (2,1), (2,2); UPDATE t1, t3 SET m = 2, e = 3 WHERE n = f; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. UPDATE t3, t2 SET e = 2, b = 3 WHERE f = c; COMMIT; show binlog events from <binlog_start>; diff --git a/mysql-test/suite/parts/r/partition_debug_sync_innodb.result b/mysql-test/suite/parts/r/partition_debug_sync_innodb.result new file mode 100644 index 00000000000..9e72259a150 --- /dev/null +++ b/mysql-test/suite/parts/r/partition_debug_sync_innodb.result @@ -0,0 +1,61 @@ +# +# Bug#50561: ALTER PARTITIONS does not have adequate lock, breaks with +# concurrent I_S query +create table t1 (a int) +engine = innodb +partition by range (a) +(partition p0 values less than MAXVALUE); +insert into t1 values (1), (11), (21), (33); +SELECT * FROM t1; +a +1 +11 +21 +33 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY RANGE (a) +(PARTITION p0 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ +t1#P#p0.ibd +t1.frm +t1.par +SET DEBUG_SYNC='before_open_in_get_all_tables SIGNAL parked WAIT_FOR open'; +SET DEBUG_SYNC='partition_open_error SIGNAL alter WAIT_FOR finish'; +SELECT * FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test'; +SET DEBUG_SYNC = 'now WAIT_FOR parked'; +# When waiting for the name lock in get_all_tables in sql_show.cc +# this will not be concurrent any more, thus the TIMEOUT +SET DEBUG_SYNC = 'before_rename_partitions SIGNAL open WAIT_FOR alter TIMEOUT 1'; +# Needs to be executed twice, since first is this 'SET DEBUG_SYNC ...' +SET DEBUG_SYNC = 'before_close_thread_tables SIGNAL finish EXECUTE 2'; +ALTER TABLE t1 REORGANIZE PARTITION p0 INTO +(PARTITION p0 VALUES LESS THAN (10), +PARTITION p10 VALUES LESS THAN MAXVALUE); +Warnings: +Warning 1639 debug sync point wait timed out +TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME +def test t1 p0 NULL 1 NULL RANGE NULL a NULL 10 1 16384 16384 NULL 0 0 NULL NULL NULL NULL default NULL +def test t1 p10 NULL 2 NULL RANGE NULL a NULL MAXVALUE 3 5461 16384 NULL 0 0 NULL NULL NULL NULL default NULL +t1#P#p0.ibd +t1#P#p10.ibd +t1.frm +t1.par +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY RANGE (a) +(PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, + PARTITION p10 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ +SELECT * FROM t1; +a +1 +11 +21 +33 +drop table t1; +SET DEBUG_SYNC = 'RESET'; diff --git a/mysql-test/suite/parts/t/partition_debug_sync_innodb-master.opt b/mysql-test/suite/parts/t/partition_debug_sync_innodb-master.opt new file mode 100644 index 00000000000..9854fda301d --- /dev/null +++ b/mysql-test/suite/parts/t/partition_debug_sync_innodb-master.opt @@ -0,0 +1 @@ +--innodb_file_per_table=1 diff --git a/mysql-test/suite/parts/t/partition_debug_sync_innodb.test b/mysql-test/suite/parts/t/partition_debug_sync_innodb.test new file mode 100644 index 00000000000..79ef3d537bf --- /dev/null +++ b/mysql-test/suite/parts/t/partition_debug_sync_innodb.test @@ -0,0 +1,44 @@ +--source include/have_innodb.inc +--source include/have_partition.inc +--source include/have_debug_sync.inc + +let $MYSQLD_DATADIR=`SELECT @@datadir`; + +--echo # +--echo # Bug#50561: ALTER PARTITIONS does not have adequate lock, breaks with +--echo # concurrent I_S query +create table t1 (a int) +engine = innodb +partition by range (a) +(partition p0 values less than MAXVALUE); +insert into t1 values (1), (11), (21), (33); +SELECT * FROM t1; +SHOW CREATE TABLE t1; +--list_files $MYSQLD_DATADIR/test + +SET DEBUG_SYNC='before_open_in_get_all_tables SIGNAL parked WAIT_FOR open'; +SET DEBUG_SYNC='partition_open_error SIGNAL alter WAIT_FOR finish'; +send +SELECT * FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test'; + +connect (con1, localhost, root,,); +SET DEBUG_SYNC = 'now WAIT_FOR parked'; +--echo # When waiting for the name lock in get_all_tables in sql_show.cc +--echo # this will not be concurrent any more, thus the TIMEOUT +SET DEBUG_SYNC = 'before_rename_partitions SIGNAL open WAIT_FOR alter TIMEOUT 1'; +--echo # Needs to be executed twice, since first is this 'SET DEBUG_SYNC ...' +SET DEBUG_SYNC = 'before_close_thread_tables SIGNAL finish EXECUTE 2'; +--error 0,ER_TABLE_EXISTS_ERROR +ALTER TABLE t1 REORGANIZE PARTITION p0 INTO +(PARTITION p0 VALUES LESS THAN (10), + PARTITION p10 VALUES LESS THAN MAXVALUE); + +disconnect con1; +connection default; +--reap +--list_files $MYSQLD_DATADIR/test +SHOW CREATE TABLE t1; +SELECT * FROM t1; +drop table t1; +--list_files $MYSQLD_DATADIR/test +SET DEBUG_SYNC = 'RESET'; diff --git a/mysql-test/suite/perfschema/r/dml_setup_instruments.result b/mysql-test/suite/perfschema/r/dml_setup_instruments.result index 448aaa7400f..73dc1178a54 100644 --- a/mysql-test/suite/perfschema/r/dml_setup_instruments.result +++ b/mysql-test/suite/perfschema/r/dml_setup_instruments.result @@ -8,12 +8,12 @@ wait/synch/mutex/sql/Cversion_lock YES YES wait/synch/mutex/sql/Delayed_insert::mutex YES YES wait/synch/mutex/sql/Event_scheduler::LOCK_scheduler_state YES YES wait/synch/mutex/sql/hash_filo::lock YES YES +wait/synch/mutex/sql/HA_DATA_PARTITION::LOCK_auto_inc YES YES wait/synch/mutex/sql/LOCK_active_mi YES YES wait/synch/mutex/sql/LOCK_audit_mask YES YES wait/synch/mutex/sql/LOCK_connection_count YES YES wait/synch/mutex/sql/LOCK_crypt YES YES wait/synch/mutex/sql/LOCK_delayed_create YES YES -wait/synch/mutex/sql/LOCK_delayed_insert YES YES select * from performance_schema.SETUP_INSTRUMENTS where name like 'Wait/Synch/Rwlock/sql/%' and name not in ('wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock') diff --git a/mysql-test/suite/rpl/r/rpl_000015.result b/mysql-test/suite/rpl/r/rpl_000015.result index 007279da96a..1b1249bc979 100644 --- a/mysql-test/suite/rpl/r/rpl_000015.result +++ b/mysql-test/suite/rpl/r/rpl_000015.result @@ -47,7 +47,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 0 -Master_Info_File # start slave; SHOW SLAVE STATUS; Slave_IO_State # @@ -90,7 +89,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # drop table if exists t1; create table t1 (n int, PRIMARY KEY(n)); insert into t1 values (10),(45),(90); diff --git a/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result b/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result index dedfa1e8355..1ed7e0116a2 100644 --- a/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result +++ b/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result @@ -8,7 +8,9 @@ call mtr.add_suppression("Unsafe statement written to the binary log using state call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); SET @@session.binlog_direct_non_transactional_updates= FALSE; DROP DATABASE IF EXISTS db1; +DROP DATABASE IF EXISTS db2; CREATE DATABASE db1; +CREATE DATABASE db2; use db1; CREATE TABLE db1.t1 (a INT) ENGINE=InnoDB; CREATE TABLE db1.t2 (s CHAR(255)) ENGINE=MyISAM; @@ -107,8 +109,72 @@ SELECT * from db1.t2; s before call db1.p1() executed db1.p2() +START SLAVE; +# +# SAVEPOINT and ROLLBACK TO have the same problem in BUG#43263 +# This was reported by BUG#50407 +[on master] +SET SESSION AUTOCOMMIT=0 +BEGIN; +INSERT INTO db1.t1 VALUES(20); +# +# Verify whether this statement is binlogged correctly +/*comment*/ SAVEPOINT has_comment; +USE db1; +INSERT INTO db1.t1 VALUES(30); +INSERT INTO db1.t2 VALUES("in savepoint has_comment"); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. +USE db2; +SavePoint mixed_cases; +USE db1; +INSERT INTO db1.t2 VALUES("in savepoint mixed_cases"); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. +INSERT INTO db1.t1 VALUES(40); +USE db2; +ROLLBACK TO mixed_cases; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +ROLLBACK TO has_comment; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +USE db1; +INSERT INTO db1.t2 VALUES("after rollback to"); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. +INSERT INTO db1.t1 VALUES(50); +USE db2; +COMMIT; +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO db1.t1 VALUES(20) +master-bin.000001 # Query # # SAVEPOINT has_comment +master-bin.000001 # Query # # use `db1`; INSERT INTO db1.t1 VALUES(30) +master-bin.000001 # Query # # use `db1`; INSERT INTO db1.t2 VALUES("in savepoint has_comment") +master-bin.000001 # Query # # SAVEPOINT mixed_cases +master-bin.000001 # Query # # use `db1`; INSERT INTO db1.t2 VALUES("in savepoint mixed_cases") +master-bin.000001 # Query # # use `db1`; INSERT INTO db1.t1 VALUES(40) +master-bin.000001 # Query # # ROLLBACK TO mixed_cases +master-bin.000001 # Query # # ROLLBACK TO has_comment +master-bin.000001 # Query # # use `db1`; INSERT INTO db1.t2 VALUES("after rollback to") +master-bin.000001 # Query # # use `db1`; INSERT INTO db1.t1 VALUES(50) +master-bin.000001 # Xid # # COMMIT /* XID */ +[on slave] +# +# Verify INSERT statements in savepoints are executed, for MyISAM table +# is not effected by ROLLBACK TO +SELECT * FROM db1.t2 WHERE s LIKE '% savepoint %'; +s +in savepoint has_comment +in savepoint mixed_cases +# +# Verify INSERT statements on the Innodb table are rolled back; +SELECT * FROM db1.t1 WHERE a IN (30, 40); +a # # Clean up # DROP DATABASE db1; -DROP DATABASE db1; +DROP DATABASE db2; diff --git a/mysql-test/suite/rpl/r/rpl_bug33931.result b/mysql-test/suite/rpl/r/rpl_bug33931.result index 2978881a72a..256238d35cd 100644 --- a/mysql-test/suite/rpl/r/rpl_bug33931.result +++ b/mysql-test/suite/rpl/r/rpl_bug33931.result @@ -44,5 +44,4 @@ Last_SQL_Errno # Last_SQL_Error Failed during slave thread initialization Replicate_Ignore_Server_Ids Master_Server_Id 0 -Master_Info_File # SET GLOBAL debug=""; diff --git a/mysql-test/suite/rpl/r/rpl_change_master.result b/mysql-test/suite/rpl/r/rpl_change_master.result index f2a4a94a88a..a51ba50475b 100644 --- a/mysql-test/suite/rpl/r/rpl_change_master.result +++ b/mysql-test/suite/rpl/r/rpl_change_master.result @@ -52,7 +52,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # change master to master_user='root'; SHOW SLAVE STATUS; Slave_IO_State # @@ -95,7 +94,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # start slave; select * from t1; n diff --git a/mysql-test/suite/rpl/r/rpl_concurrency_error.result b/mysql-test/suite/rpl/r/rpl_concurrency_error.result index 033783c65b4..013f02c3a86 100644 --- a/mysql-test/suite/rpl/r/rpl_concurrency_error.result +++ b/mysql-test/suite/rpl/r/rpl_concurrency_error.result @@ -22,7 +22,7 @@ SET AUTOCOMMIT = 1; BEGIN; UPDATE t SET f = 'yellow 2' WHERE i = 3; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. SET AUTOCOMMIT = 1; BEGIN; UPDATE t SET f = 'magenta 2' WHERE f = 'red'; @@ -51,7 +51,7 @@ SET AUTOCOMMIT = 1; BEGIN; UPDATE t SET f = 'gray 2' WHERE i = 3; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. SET AUTOCOMMIT = 1; BEGIN; UPDATE t SET f = 'dark blue 2' WHERE f = 'red'; @@ -77,7 +77,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ SET AUTOCOMMIT = 0; UPDATE t SET f = 'yellow 1' WHERE i = 3; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. SET AUTOCOMMIT = 0; UPDATE t SET f = 'magenta 1' WHERE f = 'red'; ERROR HY000: Lock wait timeout exceeded; try restarting transaction @@ -104,7 +104,7 @@ master-bin.000001 # Query # # ROLLBACK SET AUTOCOMMIT = 0; UPDATE t SET f = 'gray 1' WHERE i = 3; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. SET AUTOCOMMIT = 0; UPDATE t SET f = 'dark blue 1' WHERE f = 'red'; ERROR HY000: Lock wait timeout exceeded; try restarting transaction diff --git a/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result b/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result index e8dec72a828..25c31675b53 100644 --- a/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result @@ -91,7 +91,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # *** Test lock wait timeout *** include/stop_slave.inc @@ -156,7 +155,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # *** Test lock wait timeout and purged relay logs *** SET @my_max_relay_log_size= @@global.max_relay_log_size; @@ -226,7 +224,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # *** Clean up *** DROP TABLE t1,t2,t3; diff --git a/mysql-test/suite/rpl/r/rpl_do_grant.result b/mysql-test/suite/rpl/r/rpl_do_grant.result index 9eecc1bab3f..1cea2cfa9ad 100644 --- a/mysql-test/suite/rpl/r/rpl_do_grant.result +++ b/mysql-test/suite/rpl/r/rpl_do_grant.result @@ -246,4 +246,18 @@ GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION DROP TABLE t1; DROP PROCEDURE p1; DROP USER 'user49119'@'localhost'; +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +grant all on *.* to foo@"1.2.3.4"; +revoke all privileges, grant option from "foo"; +ERROR HY000: Can't revoke all privileges for one or more of the requested users +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; grant all on *.* to foo@"1.2.3.4" +master-bin.000001 # Query # # use `test`; revoke all privileges, grant option from "foo" +DROP USER foo@"1.2.3.4"; "End of test" diff --git a/mysql-test/suite/rpl/r/rpl_events.result b/mysql-test/suite/rpl/r/rpl_events.result index 11ebb760e86..7d4e8a208eb 100644 --- a/mysql-test/suite/rpl/r/rpl_events.result +++ b/mysql-test/suite/rpl/r/rpl_events.result @@ -118,8 +118,14 @@ CREATE /*!50000 DEFINER='user44331' */ EVENT event44331_4 ON SCHEDULE AT CURRENT_TIMESTAMP ON COMPLETION PRESERVE DISABLE DO INSERT INTO test.t1 VALUES('event event44331_4 fired - DEFINER=user1'); -Warnings: -Note 1449 The user specified as a definer ('user44331'@'%') does not exist +# Test for bug#50095 Multi-statement including CREATE EVENT causes rotten +# binlog entry +SELECT 'ABC'; +SELECT '123'| +ABC +ABC +123 +123 #on master select EVENT_SCHEMA, EVENT_NAME, DEFINER from information_schema.events where EVENT_NAME='event44331_1'; diff --git a/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result b/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result index 5931be18fb9..6399e384d72 100644 --- a/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result @@ -134,7 +134,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # ***** Testing Altering table def scenario ***** @@ -513,7 +512,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # **************************************** * columns in master at middle of table * @@ -590,7 +588,6 @@ Last_SQL_Errno 1677 Last_SQL_Error Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)' Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -668,7 +665,6 @@ Last_SQL_Errno 1677 Last_SQL_Error Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)' Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -822,7 +818,6 @@ Last_SQL_Errno 1091 Last_SQL_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # STOP SLAVE; RESET SLAVE; @@ -911,7 +906,6 @@ Last_SQL_Errno 1054 Last_SQL_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # STOP SLAVE; RESET SLAVE; @@ -1000,7 +994,6 @@ Last_SQL_Errno 1072 Last_SQL_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # STOP SLAVE; RESET SLAVE; diff --git a/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result b/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result index 41149899f51..f55df71d532 100644 --- a/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result +++ b/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result @@ -134,7 +134,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # ***** Testing Altering table def scenario ***** @@ -513,7 +512,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # **************************************** * columns in master at middle of table * @@ -590,7 +588,6 @@ Last_SQL_Errno 1677 Last_SQL_Error Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)' Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -668,7 +665,6 @@ Last_SQL_Errno 1677 Last_SQL_Error Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)' Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -822,7 +818,6 @@ Last_SQL_Errno 1091 Last_SQL_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # STOP SLAVE; RESET SLAVE; @@ -911,7 +906,6 @@ Last_SQL_Errno 1054 Last_SQL_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # STOP SLAVE; RESET SLAVE; @@ -1000,7 +994,6 @@ Last_SQL_Errno 1072 Last_SQL_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # STOP SLAVE; RESET SLAVE; diff --git a/mysql-test/suite/rpl/r/rpl_flushlog_loop.result b/mysql-test/suite/rpl/r/rpl_flushlog_loop.result index 82e295317ce..5e74a4eb999 100644 --- a/mysql-test/suite/rpl/r/rpl_flushlog_loop.result +++ b/mysql-test/suite/rpl/r/rpl_flushlog_loop.result @@ -62,4 +62,3 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 2 -Master_Info_File # diff --git a/mysql-test/suite/rpl/r/rpl_grant.result b/mysql-test/suite/rpl/r/rpl_grant.result index 4612cf9caea..fc32dcefec7 100644 --- a/mysql-test/suite/rpl/r/rpl_grant.result +++ b/mysql-test/suite/rpl/r/rpl_grant.result @@ -82,4 +82,3 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat.result b/mysql-test/suite/rpl/r/rpl_heartbeat.result index d91713a97ab..44b3964f632 100644 --- a/mysql-test/suite/rpl/r/rpl_heartbeat.result +++ b/mysql-test/suite/rpl/r/rpl_heartbeat.result @@ -93,7 +93,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # SHOW SLAVE STATUS; Slave_IO_State # Master_Host 127.0.0.1 @@ -135,7 +134,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # show status like 'Slave_heartbeat_period';; Variable_name Slave_heartbeat_period Value 0.500 diff --git a/mysql-test/suite/rpl/r/rpl_incident.result b/mysql-test/suite/rpl/r/rpl_incident.result index e6834521f2c..a9b641b243b 100644 --- a/mysql-test/suite/rpl/r/rpl_incident.result +++ b/mysql-test/suite/rpl/r/rpl_incident.result @@ -66,7 +66,6 @@ Last_SQL_Errno 1590 Last_SQL_Error The incident LOST_EVENTS occured on the master. Message: <none> Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE; SELECT * FROM t1; @@ -116,5 +115,4 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # DROP TABLE t1; diff --git a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result index 88fe7bce4f6..579c5489823 100644 --- a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result +++ b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result @@ -996,7 +996,7 @@ master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES (3, 'before master-bin.000001 # Xid 1 # # master-bin.000001 # Query 1 # BEGIN master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES (5, 'before savepoint s2') -master-bin.000001 # Query 1 # use `test_rpl`; SAVEPOINT s2 +master-bin.000001 # Query 1 # SAVEPOINT s2 master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES (6, 'after savepoint s2') master-bin.000001 # Table_map 1 # table_id: # (test_rpl.t1) master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F diff --git a/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result index 97675038481..cc7cfa144ee 100644 --- a/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result +++ b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result @@ -52,7 +52,6 @@ Last_SQL_Errno 1105 Last_SQL_Error Error 'master may suffer from http://bugs.mysql.com/bug.php?id=24432 so slave stops; check error log on slave for more info' on query. Default database: 'test'. Query: 'INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10' Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # SELECT * FROM t1; a b stop slave; @@ -146,7 +145,6 @@ ON DUPLICATE KEY UPDATE t1.field_3 = t2.field_c' Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # SELECT * FROM t1; id field_1 field_2 field_3 drop table t1, t2; diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result b/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result index ffc8f70f628..814b83e39f8 100644 --- a/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result +++ b/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result @@ -47,7 +47,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE t1; SHOW SLAVE STATUS; Slave_IO_State # @@ -90,7 +89,6 @@ Last_SQL_Errno 1593 Last_SQL_Error Fatal error: Not enough memory Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE; DROP TABLE t1; diff --git a/mysql-test/suite/rpl/r/rpl_log_pos.result b/mysql-test/suite/rpl/r/rpl_log_pos.result index d09afe1698b..4da8b4c3a3c 100644 --- a/mysql-test/suite/rpl/r/rpl_log_pos.result +++ b/mysql-test/suite/rpl/r/rpl_log_pos.result @@ -51,7 +51,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # start slave; include/stop_slave.inc SHOW SLAVE STATUS; @@ -95,7 +94,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # show master status; File Position Binlog_Do_DB Binlog_Ignore_DB master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB> diff --git a/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result index fd7df68640e..e7e4e1b8aa4 100644 --- a/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result +++ b/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result @@ -10762,9 +10762,9 @@ COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 4) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B N T S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b- @@ -10774,9 +10774,9 @@ master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VA master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 4) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B N T S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e- @@ -10815,9 +10815,9 @@ COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T N S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b- @@ -10828,9 +10828,9 @@ master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T N S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e- @@ -10869,9 +10869,9 @@ COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T S1 N T R1 C << -b-b-b-b-b-b-b-b-b-b-b- @@ -10882,9 +10882,9 @@ master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T S1 N T R1 C << -e-e-e-e-e-e-e-e-e-e-e- @@ -11852,20 +11852,20 @@ ROLLBACK; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5) master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T S1 T CT R1 R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5) master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T S1 T CT R1 R << -e-e-e-e-e-e-e-e-e-e-e- diff --git a/mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result index fd7df68640e..e7e4e1b8aa4 100644 --- a/mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result +++ b/mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result @@ -10762,9 +10762,9 @@ COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 4) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B N T S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b- @@ -10774,9 +10774,9 @@ master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VA master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 4) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B N T S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e- @@ -10815,9 +10815,9 @@ COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T N S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b- @@ -10828,9 +10828,9 @@ master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T N S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e- @@ -10869,9 +10869,9 @@ COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T S1 N T R1 C << -b-b-b-b-b-b-b-b-b-b-b- @@ -10882,9 +10882,9 @@ master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T S1 N T R1 C << -e-e-e-e-e-e-e-e-e-e-e- @@ -11852,20 +11852,20 @@ ROLLBACK; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5) master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T S1 T CT R1 R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5) master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T S1 T CT R1 R << -e-e-e-e-e-e-e-e-e-e-e- diff --git a/mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result index 366a5342a0e..cde0a9cfa8c 100644 --- a/mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result +++ b/mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result @@ -12240,10 +12240,10 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B N T S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b- @@ -12255,10 +12255,10 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B N T S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e- @@ -12298,10 +12298,10 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T N S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b- @@ -12313,10 +12313,10 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T N S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e- @@ -12356,10 +12356,10 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T S1 N T R1 C << -b-b-b-b-b-b-b-b-b-b-b- @@ -12371,10 +12371,10 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T S1 N T R1 C << -e-e-e-e-e-e-e-e-e-e-e- @@ -13579,10 +13579,10 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T S1 T CT R1 R << -b-b-b-b-b-b-b-b-b-b-b- @@ -13590,10 +13590,10 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T S1 T CT R1 R << -e-e-e-e-e-e-e-e-e-e-e- diff --git a/mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result index 92230b5bfa3..ab02432b0d4 100644 --- a/mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result +++ b/mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result @@ -392,7 +392,7 @@ master-bin.000001 # Query # # COMMIT -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 23, 1, COUNT(*) FROM tt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 23, 1, COUNT(*) FROM tt_1 @@ -408,7 +408,7 @@ master-bin.000001 # Query # # COMMIT -b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 24, 1, COUNT(*) FROM nt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 24, 1, COUNT(*) FROM nt_1 @@ -424,7 +424,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- UPDATE nt_3, tt_3 SET nt_3.info= "new text 25 --> 1", tt_3.info= "new text 25 --> 1" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; UPDATE nt_3, tt_3 SET nt_3.info= "new text 25 --> 1", tt_3.info= "new text 25 --> 1" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1 @@ -439,6 +439,8 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_4(trans_id, stmt_id) VALUES (26, 1); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (26, 1) @@ -453,6 +455,8 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (27, 1, fc_i_tt_5_suc(27, 1)); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (27, 1, fc_i_tt_5_suc(27, 1)) @@ -468,7 +472,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- UPDATE tt_4, nt_4 SET tt_4.info= "new text 28 --> 1", nt_4.info= "new text 28 --> 1" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; UPDATE tt_4, nt_4 SET tt_4.info= "new text 28 --> 1", nt_4.info= "new text 28 --> 1" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1 @@ -483,6 +487,8 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_3(trans_id, stmt_id) VALUES (29, 1); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (29, 1) @@ -497,6 +503,8 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (30, 1, fc_i_nt_5_suc(30, 1)); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (30, 1, fc_i_nt_5_suc(30, 1)) @@ -3637,6 +3645,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id) VALUES (134, 4); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -3755,6 +3765,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id) VALUES (138, 4); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -3877,6 +3889,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id) VALUES (142, 4); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -4001,6 +4015,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id) VALUES (146, 4); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -4261,6 +4277,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id) VALUES (154, 4); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -4387,6 +4405,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id) VALUES (158, 4); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -4517,6 +4537,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id) VALUES (162, 4); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -4649,6 +4671,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id) VALUES (166, 4); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -6053,7 +6077,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 205, 2, COUNT(*) FROM tt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 205, 2, COUNT(*) FROM tt_1 @@ -6087,7 +6111,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 206, 2, COUNT(*) FROM nt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -6117,7 +6141,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- UPDATE nt_3, tt_3 SET nt_3.info= "new text 207 --> 2", tt_3.info= "new text 207 --> 2" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -6146,6 +6170,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_4(trans_id, stmt_id) VALUES (208, 2); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -6174,6 +6200,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (209, 2, fc_i_tt_5_suc(209, 2)); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -6203,7 +6231,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- UPDATE tt_4, nt_4 SET tt_4.info= "new text 210 --> 2", nt_4.info= "new text 210 --> 2" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -6232,6 +6260,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_3(trans_id, stmt_id) VALUES (211, 2); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -6260,6 +6290,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (212, 2, fc_i_nt_5_suc(212, 2)); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -6487,7 +6519,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 219, 2, COUNT(*) FROM tt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 219, 2, COUNT(*) FROM tt_1 @@ -6523,7 +6555,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 220, 2, COUNT(*) FROM nt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -6545,7 +6577,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- UPDATE nt_3, tt_3 SET nt_3.info= "new text 221 --> 2", tt_3.info= "new text 221 --> 2" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -6576,6 +6608,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_4(trans_id, stmt_id) VALUES (222, 2); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -6606,6 +6640,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (223, 2, fc_i_tt_5_suc(223, 2)); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -6637,7 +6673,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- UPDATE tt_4, nt_4 SET tt_4.info= "new text 224 --> 2", nt_4.info= "new text 224 --> 2" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -6668,6 +6704,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_3(trans_id, stmt_id) VALUES (225, 2); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -6698,6 +6736,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (226, 2, fc_i_nt_5_suc(226, 2)); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -6934,7 +6974,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 233, 4, COUNT(*) FROM tt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -6964,7 +7004,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 234, 4, COUNT(*) FROM nt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -6994,7 +7034,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- UPDATE nt_3, tt_3 SET nt_3.info= "new text 235 --> 4", tt_3.info= "new text 235 --> 4" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -7023,6 +7063,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_4(trans_id, stmt_id) VALUES (236, 4); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -7051,6 +7093,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (237, 4, fc_i_tt_5_suc(237, 4)); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -7080,7 +7124,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- UPDATE tt_4, nt_4 SET tt_4.info= "new text 238 --> 4", nt_4.info= "new text 238 --> 4" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -7109,6 +7153,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_3(trans_id, stmt_id) VALUES (239, 4); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -7137,6 +7183,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (240, 4, fc_i_nt_5_suc(240, 4)); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -7358,7 +7406,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 247, 4, COUNT(*) FROM tt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -7390,7 +7438,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 248, 4, COUNT(*) FROM nt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -7412,7 +7460,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- UPDATE nt_3, tt_3 SET nt_3.info= "new text 249 --> 4", tt_3.info= "new text 249 --> 4" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -7443,6 +7491,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_4(trans_id, stmt_id) VALUES (250, 4); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -7473,6 +7523,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (251, 4, fc_i_tt_5_suc(251, 4)); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -7504,7 +7556,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- UPDATE tt_4, nt_4 SET tt_4.info= "new text 252 --> 4", nt_4.info= "new text 252 --> 4" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -7535,6 +7587,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_3(trans_id, stmt_id) VALUES (253, 4); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -7565,6 +7619,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (254, 4, fc_i_nt_5_suc(254, 4)); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -7790,7 +7846,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 261, 2, COUNT(*) FROM tt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 261, 2, COUNT(*) FROM tt_1 @@ -7824,7 +7880,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 262, 2, COUNT(*) FROM nt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- @@ -7856,7 +7912,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- UPDATE nt_3, tt_3 SET nt_3.info= "new text 263 --> 2", tt_3.info= "new text 263 --> 2" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- @@ -7887,6 +7943,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_4(trans_id, stmt_id) VALUES (264, 2); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- @@ -7917,6 +7975,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (265, 2, fc_i_tt_5_suc(265, 2)); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- @@ -7948,7 +8008,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- UPDATE tt_4, nt_4 SET tt_4.info= "new text 266 --> 2", nt_4.info= "new text 266 --> 2" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- @@ -7979,6 +8039,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_3(trans_id, stmt_id) VALUES (267, 2); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- @@ -8009,6 +8071,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (268, 2, fc_i_nt_5_suc(268, 2)); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- @@ -8248,7 +8312,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 275, 2, COUNT(*) FROM tt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 275, 2, COUNT(*) FROM tt_1 @@ -8284,7 +8348,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 276, 2, COUNT(*) FROM nt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- @@ -8318,7 +8382,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- UPDATE nt_3, tt_3 SET nt_3.info= "new text 277 --> 2", tt_3.info= "new text 277 --> 2" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- @@ -8351,6 +8415,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_4(trans_id, stmt_id) VALUES (278, 2); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- @@ -8383,6 +8449,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (279, 2, fc_i_tt_5_suc(279, 2)); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- @@ -8416,7 +8484,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- UPDATE tt_4, nt_4 SET tt_4.info= "new text 280 --> 2", nt_4.info= "new text 280 --> 2" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- @@ -8449,6 +8517,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_3(trans_id, stmt_id) VALUES (281, 2); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- @@ -8481,6 +8551,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (282, 2, fc_i_nt_5_suc(282, 2)); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- @@ -8740,7 +8812,7 @@ master-bin.000001 # Query # # COMMIT -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 289, 4, COUNT(*) FROM tt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 289, 4, COUNT(*) FROM tt_1 @@ -8774,7 +8846,7 @@ master-bin.000001 # Query # # COMMIT -b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 290, 4, COUNT(*) FROM nt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -8808,7 +8880,7 @@ master-bin.000001 # Query # # COMMIT -b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- UPDATE nt_3, tt_3 SET nt_3.info= "new text 291 --> 4", tt_3.info= "new text 291 --> 4" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -8841,6 +8913,8 @@ master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_4(trans_id, stmt_id) VALUES (292, 4); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -8873,6 +8947,8 @@ master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (293, 4, fc_i_tt_5_suc(293, 4)); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -8906,7 +8982,7 @@ master-bin.000001 # Query # # COMMIT -b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- UPDATE tt_4, nt_4 SET tt_4.info= "new text 294 --> 4", nt_4.info= "new text 294 --> 4" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -8939,6 +9015,8 @@ master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_3(trans_id, stmt_id) VALUES (295, 4); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -8971,6 +9049,8 @@ master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (296, 4, fc_i_nt_5_suc(296, 4)); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -9218,7 +9298,7 @@ master-bin.000001 # Query # # COMMIT -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 303, 4, COUNT(*) FROM tt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 303, 4, COUNT(*) FROM tt_1 @@ -9254,7 +9334,7 @@ master-bin.000001 # Query # # COMMIT -b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 304, 4, COUNT(*) FROM nt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -9290,7 +9370,7 @@ master-bin.000001 # Query # # COMMIT -b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- UPDATE nt_3, tt_3 SET nt_3.info= "new text 305 --> 4", tt_3.info= "new text 305 --> 4" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -9325,6 +9405,8 @@ master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_4(trans_id, stmt_id) VALUES (306, 4); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -9359,6 +9441,8 @@ master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (307, 4, fc_i_tt_5_suc(307, 4)); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -9394,7 +9478,7 @@ master-bin.000001 # Query # # COMMIT -b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- UPDATE tt_4, nt_4 SET tt_4.info= "new text 308 --> 4", nt_4.info= "new text 308 --> 4" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -9429,6 +9513,8 @@ master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_3(trans_id, stmt_id) VALUES (309, 4); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -9463,6 +9549,8 @@ master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (310, 4, fc_i_nt_5_suc(310, 4)); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -9770,9 +9858,9 @@ COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 4) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B N T S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b- @@ -9782,9 +9870,9 @@ master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VA master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 4) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B N T S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e- @@ -9822,9 +9910,9 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 2) master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (319, 4) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T N S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b- @@ -9832,9 +9920,9 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 2) master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (319, 4) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T N S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e- @@ -9871,20 +9959,20 @@ COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (320, 5) master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T S1 N T R1 C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (320, 5) master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T S1 N T R1 C << -e-e-e-e-e-e-e-e-e-e-e- @@ -10047,7 +10135,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO tt_xx_7(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM nt_1;; Warnings: 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 that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> IS-T<-N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -10125,7 +10213,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO tt_xx_7(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM nt_1;; Warnings: 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 that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> IS-T<-N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -10389,7 +10477,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1;; Warnings: 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 that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> IS-N<-T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -10469,7 +10557,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1;; Warnings: 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 that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1 @@ -10801,20 +10889,20 @@ ROLLBACK; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5) master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T S1 T CT R1 R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5) master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T S1 T CT R1 R << -e-e-e-e-e-e-e-e-e-e-e- @@ -10879,7 +10967,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 357, 2, COUNT(*) FROM tt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 357, 2, COUNT(*) FROM tt_1 diff --git a/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result b/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result index 07933581ab8..76db52c05b1 100644 --- a/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result +++ b/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result @@ -61,7 +61,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 diff --git a/mysql-test/suite/rpl/r/rpl_replicate_do.result b/mysql-test/suite/rpl/r/rpl_replicate_do.result index e77193ffc27..2fbd283a9c8 100644 --- a/mysql-test/suite/rpl/r/rpl_replicate_do.result +++ b/mysql-test/suite/rpl/r/rpl_replicate_do.result @@ -67,7 +67,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # create table t1 (ts timestamp); set one_shot time_zone='met'; insert into t1 values('2005-08-12 00:00:00'); diff --git a/mysql-test/suite/rpl/r/rpl_rotate_logs.result b/mysql-test/suite/rpl/r/rpl_rotate_logs.result index e17c5cdfe3f..ba269344492 100644 --- a/mysql-test/suite/rpl/r/rpl_rotate_logs.result +++ b/mysql-test/suite/rpl/r/rpl_rotate_logs.result @@ -55,7 +55,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # select * from t1; s Could not break slave @@ -137,7 +136,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # select * from t2; m 34 @@ -207,7 +205,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # lock tables t3 read; select count(*) from t3 where n >= 4; count(*) diff --git a/mysql-test/suite/rpl/r/rpl_row_colSize.result b/mysql-test/suite/rpl/r/rpl_row_colSize.result index 9837c7f6265..1f2b5800228 100644 --- a/mysql-test/suite/rpl/r/rpl_row_colSize.result +++ b/mysql-test/suite/rpl/r/rpl_row_colSize.result @@ -59,7 +59,6 @@ Last_SQL_Errno 1677 Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'decimal(20,10)' to type 'decimal(5,2)' Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -116,7 +115,6 @@ Last_SQL_Errno 1677 Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'decimal(27,18)' to type 'decimal(27,9)' Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -173,7 +171,6 @@ Last_SQL_Errno 1677 Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'decimal(20,10)' to type 'decimal(5,2)' Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -231,7 +228,6 @@ Last_SQL_Errno 1677 Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'double' to type 'float' Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -289,7 +285,6 @@ Last_SQL_Errno 1677 Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'bit(64)' to type 'bit(5)' Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -346,7 +341,6 @@ Last_SQL_Errno 1677 Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'bit(12)' to type 'bit(11)' Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -404,7 +398,6 @@ Last_SQL_Errno 1677 Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'set' to type 'set('4')' Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -462,7 +455,6 @@ Last_SQL_Errno 1677 Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'char(20)' to type 'char(10)' Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -551,7 +543,6 @@ Last_SQL_Errno 1677 Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'enum' to type 'enum('44','54')' Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -609,7 +600,6 @@ Last_SQL_Errno 1677 Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'varchar(2000)' to type 'varchar(100)' Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -666,7 +656,6 @@ Last_SQL_Errno 1677 Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'varchar(200)' to type 'varchar(10)' Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -723,7 +712,6 @@ Last_SQL_Errno 1677 Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'varchar(2000)' to type 'varchar(1000)' Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -781,7 +769,6 @@ Last_SQL_Errno 1677 Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'tinyblob' to type 'tinyblob' Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # SELECT COUNT(*) FROM t1; COUNT(*) 0 diff --git a/mysql-test/suite/rpl/r/rpl_row_log.result b/mysql-test/suite/rpl/r/rpl_row_log.result index 1700dc3f9d6..488ebb92a02 100644 --- a/mysql-test/suite/rpl/r/rpl_row_log.result +++ b/mysql-test/suite/rpl/r/rpl_row_log.result @@ -288,7 +288,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # show binlog events in 'slave-bin.000005' from 4; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log DROP TABLE t1; diff --git a/mysql-test/suite/rpl/r/rpl_row_log_innodb.result b/mysql-test/suite/rpl/r/rpl_row_log_innodb.result index 96730996eda..7a1615c0c7f 100644 --- a/mysql-test/suite/rpl/r/rpl_row_log_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_row_log_innodb.result @@ -288,7 +288,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # show binlog events in 'slave-bin.000005' from 4; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log DROP TABLE t1; diff --git a/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result b/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result index 7c49d9dcfa4..a21bec6ae55 100644 --- a/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result +++ b/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result @@ -64,7 +64,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # # # Test 2 # @@ -115,7 +114,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # # # Test 3: max_relay_log_size = 0 # @@ -166,7 +164,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # # # Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions # @@ -214,7 +211,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # # # Test 5 # @@ -263,7 +259,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # # # Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated # @@ -310,7 +305,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # flush logs; show master status; File Position Binlog_Do_DB Binlog_Ignore_DB diff --git a/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result index 366a5342a0e..cde0a9cfa8c 100644 --- a/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result +++ b/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result @@ -12240,10 +12240,10 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B N T S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b- @@ -12255,10 +12255,10 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B N T S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e- @@ -12298,10 +12298,10 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T N S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b- @@ -12313,10 +12313,10 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T N S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e- @@ -12356,10 +12356,10 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T S1 N T R1 C << -b-b-b-b-b-b-b-b-b-b-b- @@ -12371,10 +12371,10 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T S1 N T R1 C << -e-e-e-e-e-e-e-e-e-e-e- @@ -13579,10 +13579,10 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T S1 T CT R1 R << -b-b-b-b-b-b-b-b-b-b-b- @@ -13590,10 +13590,10 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Table_map # # table_id: # (test.tt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T S1 T CT R1 R << -e-e-e-e-e-e-e-e-e-e-e- diff --git a/mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result b/mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result new file mode 100644 index 00000000000..c461cafbd7c --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result @@ -0,0 +1,46 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +## case #1 - last_null_bit_pos==0 in record_compare without X bit +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 varchar(1) DEFAULT '', c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0, c8 bigint(20) DEFAULT 0) ENGINE=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 ); +INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 ); +UPDATE t1 SET c5 = 'a'; +Comparing tables master:test.t1 and slave:test.t1 +DROP TABLE t1; +## case #1.1 - last_null_bit_pos==0 in record_compare with X bit +## (1 column less and no varchar) +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 bigint(20) DEFAULT 0, c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0) ENGINE=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 ); +INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 ); +UPDATE t1 SET c5 = 'a'; +Comparing tables master:test.t1 and slave:test.t1 +DROP TABLE t1; +## case #2 - X bit is wrongly set. +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +CREATE TABLE t1 (c1 int, c2 varchar(1) default '') ENGINE=InnoDB DEFAULT CHARSET= latin1; +INSERT INTO t1(c1) VALUES (10); +INSERT INTO t1(c1) VALUES (NULL); +UPDATE t1 SET c1= 0; +Comparing tables master:test.t1 and slave:test.t1 +DROP TABLE t1; diff --git a/mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result b/mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result new file mode 100644 index 00000000000..38fbe486d2e --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result @@ -0,0 +1,60 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +## case #1 - last_null_bit_pos==0 in record_compare without X bit +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 varchar(1) DEFAULT '', c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0, c8 bigint(20) DEFAULT 0) ENGINE=MyISAM DEFAULT CHARSET=latin1; +INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 ); +INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 ); +UPDATE t1 SET c5 = 'a'; +Comparing tables master:test.t1 and slave:test.t1 +DROP TABLE t1; +## case #1.1 - last_null_bit_pos==0 in record_compare with X bit +## (1 column less and no varchar) +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 bigint(20) DEFAULT 0, c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0) ENGINE=MyISAM DEFAULT CHARSET=latin1; +INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 ); +INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 ); +UPDATE t1 SET c5 = 'a'; +Comparing tables master:test.t1 and slave:test.t1 +DROP TABLE t1; +## case #2 - X bit is wrongly set. +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +CREATE TABLE t1 (c1 int, c2 varchar(1) default '') ENGINE=MyISAM DEFAULT CHARSET= latin1; +INSERT INTO t1(c1) VALUES (10); +INSERT INTO t1(c1) VALUES (NULL); +UPDATE t1 SET c1= 0; +Comparing tables master:test.t1 and slave:test.t1 +DROP TABLE t1; +## coverage purposes - Field_bits +## 1 X bit + 2 Null bits + 5 bits => last_null_bit_pos==0 +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bit(5)) ENGINE=MyISAM DEFAULT CHARSET=latin1; +INSERT INTO t1(c1,c2) VALUES (10, b'1'); +INSERT INTO t1(c1,c2) VALUES (NULL, b'1'); +UPDATE t1 SET c1= 0; +Comparing tables master:test.t1 and slave:test.t1 +DROP TABLE t1; diff --git a/mysql-test/suite/rpl/r/rpl_row_reset_slave.result b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result index 82e95852830..028b73e6153 100644 --- a/mysql-test/suite/rpl/r/rpl_row_reset_slave.result +++ b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result @@ -45,7 +45,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # stop slave; change master to master_user='test'; SHOW SLAVE STATUS; @@ -89,7 +88,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # reset slave; SHOW SLAVE STATUS; Slave_IO_State # @@ -132,7 +130,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # change master to master_user='root'; start slave; SHOW SLAVE STATUS; @@ -176,7 +173,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # stop slave; reset slave; start slave; diff --git a/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result index 81794c17fda..2974b9ad259 100644 --- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result +++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result @@ -159,7 +159,6 @@ Last_SQL_Errno 0 Last_SQL_Error <Last_SQL_Error> Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File <Master-Info-File> INSERT INTO t9 VALUES (4); INSERT INTO t4 VALUES (4); SHOW SLAVE STATUS; @@ -203,7 +202,6 @@ Last_SQL_Errno 1677 Last_SQL_Error <Last_SQL_Error> Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File <Master-Info-File> SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; INSERT INTO t9 VALUES (5); @@ -249,7 +247,6 @@ Last_SQL_Errno 1677 Last_SQL_Error <Last_SQL_Error> Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File <Master-Info-File> SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; INSERT INTO t9 VALUES (6); @@ -295,7 +292,6 @@ Last_SQL_Errno 1677 Last_SQL_Error <Last_SQL_Error> Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File <Master-Info-File> SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; INSERT INTO t9 VALUES (6); @@ -340,7 +336,6 @@ Last_SQL_Errno 0 Last_SQL_Error <Last_SQL_Error> Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File <Master-Info-File> INSERT INTO t7 VALUES (1),(2),(3); INSERT INTO t8 VALUES (1),(2),(3); SELECT * FROM t7 ORDER BY a; diff --git a/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result index f7db7ac1d1a..04f22a864e1 100644 --- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result +++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result @@ -159,7 +159,6 @@ Last_SQL_Errno 0 Last_SQL_Error <Last_SQL_Error> Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File <Master-Info-File> INSERT INTO t9 VALUES (4); INSERT INTO t4 VALUES (4); SHOW SLAVE STATUS; @@ -203,7 +202,6 @@ Last_SQL_Errno 1677 Last_SQL_Error <Last_SQL_Error> Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File <Master-Info-File> SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; INSERT INTO t9 VALUES (5); @@ -249,7 +247,6 @@ Last_SQL_Errno 1677 Last_SQL_Error <Last_SQL_Error> Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File <Master-Info-File> SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; INSERT INTO t9 VALUES (6); @@ -295,7 +292,6 @@ Last_SQL_Errno 1677 Last_SQL_Error <Last_SQL_Error> Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File <Master-Info-File> SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; INSERT INTO t9 VALUES (6); @@ -340,7 +336,6 @@ Last_SQL_Errno 0 Last_SQL_Error <Last_SQL_Error> Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File <Master-Info-File> INSERT INTO t7 VALUES (1),(2),(3); INSERT INTO t8 VALUES (1),(2),(3); SELECT * FROM t7 ORDER BY a; diff --git a/mysql-test/suite/rpl/r/rpl_row_until.result b/mysql-test/suite/rpl/r/rpl_row_until.result index c7722556bf0..e878456e296 100644 --- a/mysql-test/suite/rpl/r/rpl_row_until.result +++ b/mysql-test/suite/rpl/r/rpl_row_until.result @@ -61,7 +61,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # START SLAVE UNTIL MASTER_LOG_FILE='master-no-such-bin.000001', MASTER_LOG_POS=291; SELECT * FROM t1; n @@ -110,7 +109,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', RELAY_LOG_POS=relay_pos_insert1_t2 SELECT * FROM t2; n @@ -157,7 +155,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # START SLAVE; include/stop_slave.inc START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_create_t2 @@ -202,7 +199,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # START SLAVE UNTIL MASTER_LOG_FILE='master-bin', MASTER_LOG_POS=561; ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=561, RELAY_LOG_POS=12; diff --git a/mysql-test/suite/rpl/r/rpl_show_master_info_file.result b/mysql-test/suite/rpl/r/rpl_show_master_info_file.result deleted file mode 100644 index 15c6dea9bdc..00000000000 --- a/mysql-test/suite/rpl/r/rpl_show_master_info_file.result +++ /dev/null @@ -1,9 +0,0 @@ -stop slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -reset master; -reset slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -start slave; -SELECT "MYSQLTEST_VARDIR/mysqld.2/data/master.info" as Master_Info_File; -Master_Info_File -MYSQLTEST_VARDIR/mysqld.2/data/master.info diff --git a/mysql-test/suite/rpl/r/rpl_skip_error.result b/mysql-test/suite/rpl/r/rpl_skip_error.result index a8a69d27c3e..7b2bd48515d 100644 --- a/mysql-test/suite/rpl/r/rpl_skip_error.result +++ b/mysql-test/suite/rpl/r/rpl_skip_error.result @@ -72,7 +72,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # ==== Clean Up ==== drop table t1; create table t1(a int primary key); @@ -128,7 +127,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # ==== Clean Up ==== drop table t1; ==== Using Innodb ==== diff --git a/mysql-test/suite/rpl/r/rpl_slave_skip.result b/mysql-test/suite/rpl/r/rpl_slave_skip.result index a5efa59ae4f..24000df40d2 100644 --- a/mysql-test/suite/rpl/r/rpl_slave_skip.result +++ b/mysql-test/suite/rpl/r/rpl_slave_skip.result @@ -84,7 +84,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE; SELECT * FROM t1; @@ -153,7 +152,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # **** On Master **** DROP TABLE t1, t2; SET SESSION BINLOG_FORMAT=ROW; diff --git a/mysql-test/suite/rpl/r/rpl_ssl.result b/mysql-test/suite/rpl/r/rpl_ssl.result index 9aeb991e980..c8e9e1a4911 100644 --- a/mysql-test/suite/rpl/r/rpl_ssl.result +++ b/mysql-test/suite/rpl/r/rpl_ssl.result @@ -60,7 +60,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # STOP SLAVE; select * from t1; t @@ -107,7 +106,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # drop user replssl@localhost; drop table t1; End of 5.0 tests diff --git a/mysql-test/suite/rpl/r/rpl_ssl1.result b/mysql-test/suite/rpl/r/rpl_ssl1.result index 036d51e56b1..de255228aff 100644 --- a/mysql-test/suite/rpl/r/rpl_ssl1.result +++ b/mysql-test/suite/rpl/r/rpl_ssl1.result @@ -59,7 +59,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # stop slave; change master to master_user='root',master_password='', master_ssl=0; start slave; @@ -106,7 +105,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # stop slave; change master to master_host="localhost", @@ -163,5 +161,4 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # drop table t1; diff --git a/mysql-test/suite/rpl/r/rpl_stm_log.result b/mysql-test/suite/rpl/r/rpl_stm_log.result index 397ea495a44..17134b1f02f 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_log.result +++ b/mysql-test/suite/rpl/r/rpl_stm_log.result @@ -286,7 +286,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # show binlog events in 'slave-bin.000005' from 4; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log DROP TABLE t1; diff --git a/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result b/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result index 7c49d9dcfa4..a21bec6ae55 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result +++ b/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result @@ -64,7 +64,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # # # Test 2 # @@ -115,7 +114,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # # # Test 3: max_relay_log_size = 0 # @@ -166,7 +164,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # # # Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions # @@ -214,7 +211,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # # # Test 5 # @@ -263,7 +259,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # # # Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated # @@ -310,7 +305,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # flush logs; show master status; File Position Binlog_Do_DB Binlog_Ignore_DB diff --git a/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result index 5cafdf8528d..a5219662881 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result +++ b/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result @@ -392,7 +392,7 @@ master-bin.000001 # Query # # COMMIT -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 23, 1, COUNT(*) FROM tt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 23, 1, COUNT(*) FROM tt_1 @@ -408,7 +408,7 @@ master-bin.000001 # Query # # COMMIT -b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 24, 1, COUNT(*) FROM nt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 24, 1, COUNT(*) FROM nt_1 @@ -424,7 +424,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- UPDATE nt_3, tt_3 SET nt_3.info= "new text 25 --> 1", tt_3.info= "new text 25 --> 1" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; UPDATE nt_3, tt_3 SET nt_3.info= "new text 25 --> 1", tt_3.info= "new text 25 --> 1" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1 @@ -439,6 +439,8 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_4(trans_id, stmt_id) VALUES (26, 1); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (26, 1) @@ -453,6 +455,8 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (27, 1, fc_i_tt_5_suc(27, 1)); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (27, 1, fc_i_tt_5_suc(27, 1)) @@ -468,7 +472,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- UPDATE tt_4, nt_4 SET tt_4.info= "new text 28 --> 1", nt_4.info= "new text 28 --> 1" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; UPDATE tt_4, nt_4 SET tt_4.info= "new text 28 --> 1", nt_4.info= "new text 28 --> 1" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1 @@ -483,6 +487,8 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_3(trans_id, stmt_id) VALUES (29, 1); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (29, 1) @@ -497,6 +503,8 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (30, 1, fc_i_nt_5_suc(30, 1)); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (30, 1, fc_i_nt_5_suc(30, 1)) @@ -3641,6 +3649,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id) VALUES (134, 4); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (134, 4) @@ -3779,6 +3789,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id) VALUES (138, 4); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (138, 4) @@ -3921,6 +3933,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id) VALUES (142, 4); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (142, 4) @@ -4065,6 +4079,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id) VALUES (146, 4); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (146, 4) @@ -4349,6 +4365,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id) VALUES (154, 4); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (154, 4) @@ -4495,6 +4513,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id) VALUES (158, 4); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (158, 4) @@ -4645,6 +4665,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id) VALUES (162, 4); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (162, 4) @@ -4797,6 +4819,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id) VALUES (166, 4); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (166, 4) @@ -6221,7 +6245,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 205, 2, COUNT(*) FROM tt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 205, 2, COUNT(*) FROM tt_1 @@ -6255,7 +6279,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 206, 2, COUNT(*) FROM nt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -6285,7 +6309,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- UPDATE nt_3, tt_3 SET nt_3.info= "new text 207 --> 2", tt_3.info= "new text 207 --> 2" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -6314,6 +6338,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_4(trans_id, stmt_id) VALUES (208, 2); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -6342,6 +6368,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (209, 2, fc_i_tt_5_suc(209, 2)); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -6371,7 +6399,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- UPDATE tt_4, nt_4 SET tt_4.info= "new text 210 --> 2", nt_4.info= "new text 210 --> 2" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -6400,6 +6428,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_3(trans_id, stmt_id) VALUES (211, 2); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -6428,6 +6458,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (212, 2, fc_i_nt_5_suc(212, 2)); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -6655,7 +6687,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 219, 2, COUNT(*) FROM tt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 219, 2, COUNT(*) FROM tt_1 @@ -6691,7 +6723,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 220, 2, COUNT(*) FROM nt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -6713,7 +6745,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- UPDATE nt_3, tt_3 SET nt_3.info= "new text 221 --> 2", tt_3.info= "new text 221 --> 2" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -6744,6 +6776,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_4(trans_id, stmt_id) VALUES (222, 2); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -6774,6 +6808,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (223, 2, fc_i_tt_5_suc(223, 2)); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -6805,7 +6841,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- UPDATE tt_4, nt_4 SET tt_4.info= "new text 224 --> 2", nt_4.info= "new text 224 --> 2" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -6836,6 +6872,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_3(trans_id, stmt_id) VALUES (225, 2); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -6866,6 +6904,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (226, 2, fc_i_nt_5_suc(226, 2)); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -7102,7 +7142,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 233, 4, COUNT(*) FROM tt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 233, 4, COUNT(*) FROM tt_1 @@ -7136,7 +7176,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 234, 4, COUNT(*) FROM nt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -7166,7 +7206,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- UPDATE nt_3, tt_3 SET nt_3.info= "new text 235 --> 4", tt_3.info= "new text 235 --> 4" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -7195,6 +7235,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_4(trans_id, stmt_id) VALUES (236, 4); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -7223,6 +7265,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (237, 4, fc_i_tt_5_suc(237, 4)); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -7252,7 +7296,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- UPDATE tt_4, nt_4 SET tt_4.info= "new text 238 --> 4", nt_4.info= "new text 238 --> 4" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -7281,6 +7325,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_3(trans_id, stmt_id) VALUES (239, 4); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -7309,6 +7355,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (240, 4, fc_i_nt_5_suc(240, 4)); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -7534,7 +7582,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 247, 4, COUNT(*) FROM tt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 247, 4, COUNT(*) FROM tt_1 @@ -7570,7 +7618,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 248, 4, COUNT(*) FROM nt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -7592,7 +7640,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- UPDATE nt_3, tt_3 SET nt_3.info= "new text 249 --> 4", tt_3.info= "new text 249 --> 4" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -7623,6 +7671,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_4(trans_id, stmt_id) VALUES (250, 4); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -7653,6 +7703,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (251, 4, fc_i_tt_5_suc(251, 4)); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -7684,7 +7736,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- UPDATE tt_4, nt_4 SET tt_4.info= "new text 252 --> 4", nt_4.info= "new text 252 --> 4" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -7715,6 +7767,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_3(trans_id, stmt_id) VALUES (253, 4); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -7745,6 +7799,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (254, 4, fc_i_nt_5_suc(254, 4)); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -7974,7 +8030,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 261, 2, COUNT(*) FROM tt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 261, 2, COUNT(*) FROM tt_1 @@ -8008,7 +8064,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 262, 2, COUNT(*) FROM nt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- @@ -8044,7 +8100,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- UPDATE nt_3, tt_3 SET nt_3.info= "new text 263 --> 2", tt_3.info= "new text 263 --> 2" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- @@ -8079,6 +8135,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_4(trans_id, stmt_id) VALUES (264, 2); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- @@ -8113,6 +8171,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (265, 2, fc_i_tt_5_suc(265, 2)); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- @@ -8148,7 +8208,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- UPDATE tt_4, nt_4 SET tt_4.info= "new text 266 --> 2", nt_4.info= "new text 266 --> 2" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- @@ -8183,6 +8243,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_3(trans_id, stmt_id) VALUES (267, 2); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- @@ -8217,6 +8279,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (268, 2, fc_i_nt_5_suc(268, 2)); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- @@ -8476,7 +8540,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 275, 2, COUNT(*) FROM tt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 275, 2, COUNT(*) FROM tt_1 @@ -8512,7 +8576,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 276, 2, COUNT(*) FROM nt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- @@ -8550,7 +8614,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- UPDATE nt_3, tt_3 SET nt_3.info= "new text 277 --> 2", tt_3.info= "new text 277 --> 2" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- @@ -8587,6 +8651,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_4(trans_id, stmt_id) VALUES (278, 2); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- @@ -8623,6 +8689,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (279, 2, fc_i_tt_5_suc(279, 2)); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- @@ -8660,7 +8728,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- UPDATE tt_4, nt_4 SET tt_4.info= "new text 280 --> 2", nt_4.info= "new text 280 --> 2" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- @@ -8697,6 +8765,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_3(trans_id, stmt_id) VALUES (281, 2); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- @@ -8733,6 +8803,8 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (282, 2, fc_i_nt_5_suc(282, 2)); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- @@ -9012,7 +9084,7 @@ master-bin.000001 # Query # # COMMIT -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 289, 4, COUNT(*) FROM tt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 289, 4, COUNT(*) FROM tt_1 @@ -9046,7 +9118,7 @@ master-bin.000001 # Query # # COMMIT -b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 290, 4, COUNT(*) FROM nt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -9080,7 +9152,7 @@ master-bin.000001 # Query # # COMMIT -b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- UPDATE nt_3, tt_3 SET nt_3.info= "new text 291 --> 4", tt_3.info= "new text 291 --> 4" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -9113,6 +9185,8 @@ master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_4(trans_id, stmt_id) VALUES (292, 4); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -9145,6 +9219,8 @@ master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (293, 4, fc_i_tt_5_suc(293, 4)); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -9178,7 +9254,7 @@ master-bin.000001 # Query # # COMMIT -b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- UPDATE tt_4, nt_4 SET tt_4.info= "new text 294 --> 4", nt_4.info= "new text 294 --> 4" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -9211,6 +9287,8 @@ master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_3(trans_id, stmt_id) VALUES (295, 4); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -9243,6 +9321,8 @@ master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (296, 4, fc_i_nt_5_suc(296, 4)); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -9490,7 +9570,7 @@ master-bin.000001 # Query # # COMMIT -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 303, 4, COUNT(*) FROM tt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 303, 4, COUNT(*) FROM tt_1 @@ -9526,7 +9606,7 @@ master-bin.000001 # Query # # COMMIT -b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 304, 4, COUNT(*) FROM nt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -9562,7 +9642,7 @@ master-bin.000001 # Query # # COMMIT -b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- UPDATE nt_3, tt_3 SET nt_3.info= "new text 305 --> 4", tt_3.info= "new text 305 --> 4" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -9597,6 +9677,8 @@ master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_4(trans_id, stmt_id) VALUES (306, 4); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -9631,6 +9713,8 @@ master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (307, 4, fc_i_tt_5_suc(307, 4)); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -9666,7 +9750,7 @@ master-bin.000001 # Query # # COMMIT -b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- UPDATE tt_4, nt_4 SET tt_4.info= "new text 308 --> 4", nt_4.info= "new text 308 --> 4" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -9701,6 +9785,8 @@ master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_3(trans_id, stmt_id) VALUES (309, 4); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -9735,6 +9821,8 @@ master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (310, 4, fc_i_nt_5_suc(310, 4)); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -10042,9 +10130,9 @@ COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 4) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B N T S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b- @@ -10054,9 +10142,9 @@ master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VA master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 4) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B N T S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e- @@ -10096,9 +10184,9 @@ COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T N S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b- @@ -10108,9 +10196,9 @@ master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VA master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T N S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e- @@ -10150,9 +10238,9 @@ COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T S1 N T R1 C << -b-b-b-b-b-b-b-b-b-b-b- @@ -10162,9 +10250,9 @@ master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VA master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7) -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T S1 N T R1 C << -e-e-e-e-e-e-e-e-e-e-e- @@ -10327,7 +10415,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO tt_xx_7(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM nt_1;; Warnings: 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 that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> IS-T<-N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -10405,7 +10493,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO tt_xx_7(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM nt_1;; Warnings: 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 that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> IS-T<-N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -10669,7 +10757,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1;; Warnings: 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 that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1 @@ -10757,7 +10845,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1;; Warnings: 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 that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1 @@ -11097,20 +11185,20 @@ ROLLBACK; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5) master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T S1 T CT R1 R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2) -master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5) master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb -master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK TO s1 master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T S1 T CT R1 R << -e-e-e-e-e-e-e-e-e-e-e- @@ -11175,7 +11263,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 357, 2, COUNT(*) FROM tt_1; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 357, 2, COUNT(*) FROM tt_1 @@ -11314,3 +11402,23 @@ master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_1 ################################################################################### # CLEAN ################################################################################### +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +CREATE TABLE `t1` ( +`c1` int(10) unsigned NOT NULL AUTO_INCREMENT, +`c2` tinyint(1) unsigned DEFAULT NULL, +`c3` varchar(300) DEFAULT NULL, +`c4` int(10) unsigned NOT NULL, +`c5` int(10) unsigned DEFAULT NULL, +PRIMARY KEY (`c1`)) ENGINE=MyISAM DEFAULT CHARSET=latin1; +ALTER TABLE `t1` Engine=InnoDB; +SET AUTOCOMMIT=0; +INSERT INTO t1 (c1,c2,c3,c4,c5) VALUES (1, 1, 'X', 1, NULL); +COMMIT; +ROLLBACK; +SET AUTOCOMMIT=1; +Comparing tables master:test.t1 and slave:test.t1 +DROP TABLE `t1`; diff --git a/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result index 5fd00f74136..94e8a31390d 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result +++ b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result @@ -45,7 +45,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # stop slave; change master to master_user='test'; SHOW SLAVE STATUS; @@ -89,7 +88,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # reset slave; SHOW SLAVE STATUS; Slave_IO_State # @@ -132,7 +130,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # change master to master_user='root'; start slave; SHOW SLAVE STATUS; @@ -176,7 +173,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # stop slave; reset slave; start slave; diff --git a/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result b/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result index e4e98f0bfe5..96829a1b1ec 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result +++ b/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result @@ -53,7 +53,7 @@ set @@global.debug="+d,stop_slave_middle_group"; set @@global.debug="+d,incomplete_group_in_relay_log"; update tm as t1, ti as t2 set t1.a=t1.a * 2, t2.a=t2.a * 2; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. SELECT "Fatal error: ... The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed. If the group consists solely of Row-based events, you can try restarting the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details)." AS Last_SQL_Error, @check as `true`; Last_SQL_Error true Fatal error: ... The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed. If the group consists solely of Row-based events, you can try restarting the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details). 1 diff --git a/mysql-test/suite/rpl/r/rpl_stm_until.result b/mysql-test/suite/rpl/r/rpl_stm_until.result index 098a3c7a158..b131cbc7e63 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_until.result +++ b/mysql-test/suite/rpl/r/rpl_stm_until.result @@ -65,7 +65,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291; select * from t1; n @@ -114,7 +113,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=891; select * from t2; n @@ -161,7 +159,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # start slave; [on master] [on slave] @@ -208,7 +205,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # ==== Test various error conditions ==== start slave until master_log_file='master-bin', master_log_pos=561; ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL diff --git a/mysql-test/suite/rpl/r/rpl_temp_temporary.result b/mysql-test/suite/rpl/r/rpl_temp_temporary.result index 19b36da2800..3911bd8a773 100644 --- a/mysql-test/suite/rpl/r/rpl_temp_temporary.result +++ b/mysql-test/suite/rpl/r/rpl_temp_temporary.result @@ -24,7 +24,7 @@ INSERT INTO t_innodb_temp VALUES(1); BEGIN; INSERT INTO t_myisam SELECT * FROM t_myisam_temp; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. INSERT INTO t_innodb SELECT * FROM t_myisam_temp; INSERT INTO t_innodb SELECT * FROM t_innodb_temp; ROLLBACK; @@ -33,7 +33,7 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back BEGIN; INSERT INTO t_myisam SELECT * FROM t_innodb_temp; Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. INSERT INTO t_innodb SELECT * FROM t_myisam_temp; INSERT INTO t_innodb SELECT * FROM t_innodb_temp; ROLLBACK; @@ -193,8 +193,6 @@ Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. INSERT INTO t_innodb VALUES(1); COMMIT; -DROP TABLE t_myisam; -DROP TABLE t_innodb; show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tmp1(id int) engine= MyIsam @@ -214,8 +212,29 @@ master-bin.000001 # Query # # use `test`; INSERT INTO tmp1 VALUES(1) master-bin.000001 # Query # # use `test`; INSERT INTO t_innodb VALUES(1) master-bin.000001 # Query # # use `test`; INSERT INTO t_innodb VALUES(1) master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # use `test`; DROP TABLE t_myisam -master-bin.000001 # Query # # use `test`; DROP TABLE t_innodb +######################################################################## +# VERIFY ITEM 8 +######################################################################## +SET BINLOG_FORMAT=MIXED; +BEGIN; +CREATE TEMPORARY TABLE tmp2 SELECT * FROM t_innodb; +INSERT INTO t_innodb VALUES(1); +INSERT INTO t_innodb VALUES(1); +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +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`; CREATE TEMPORARY TABLE tmp2 SELECT * FROM t_innodb +master-bin.000001 # Query # # use `test`; INSERT INTO t_innodb VALUES(1) +master-bin.000001 # Query # # use `test`; INSERT INTO t_innodb VALUES(1) +master-bin.000001 # Query # # ROLLBACK ################################################################################### # CHECK CONSISTENCY ################################################################################### +################################################################################### +# CLEAN UP +################################################################################### +DROP TABLE t_myisam; +DROP TABLE t_innodb; diff --git a/mysql-test/suite/rpl/r/rpl_temporary_errors.result b/mysql-test/suite/rpl/r/rpl_temporary_errors.result index 847187fa9a7..8ecbbde65b4 100644 --- a/mysql-test/suite/rpl/r/rpl_temporary_errors.result +++ b/mysql-test/suite/rpl/r/rpl_temporary_errors.result @@ -80,7 +80,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # DROP TABLE t1; **** On Master **** DROP TABLE t1; diff --git a/mysql-test/suite/rpl/t/rpl_begin_commit_rollback-master.opt b/mysql-test/suite/rpl/t/rpl_begin_commit_rollback-master.opt new file mode 100644 index 00000000000..9e6e2b7829a --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_begin_commit_rollback-master.opt @@ -0,0 +1 @@ +--innodb --binlog-ignore-db=db2 diff --git a/mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test b/mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test index 8db4aeccd7a..acb98a0ad88 100644 --- a/mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test +++ b/mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test @@ -12,9 +12,11 @@ SET @@session.binlog_direct_non_transactional_updates= FALSE; disable_warnings; DROP DATABASE IF EXISTS db1; +DROP DATABASE IF EXISTS db2; enable_warnings; CREATE DATABASE db1; +CREATE DATABASE db2; use db1; @@ -124,10 +126,55 @@ eval SELECT $result as 'Must be 0'; SELECT * from db1.t1; SELECT * from db1.t2; +START SLAVE; +source include/wait_for_slave_sql_to_start.inc; + +--echo # +--echo # SAVEPOINT and ROLLBACK TO have the same problem in BUG#43263 +--echo # This was reported by BUG#50407 +connection master; +echo [on master] +SET SESSION AUTOCOMMIT=0; +let $binlog_start=query_get_value(SHOW MASTER STATUS, Position, 1); + +BEGIN; +INSERT INTO db1.t1 VALUES(20); + +--echo # +--echo # Verify whether this statement is binlogged correctly +/*comment*/ SAVEPOINT has_comment; +USE db1; +INSERT INTO db1.t1 VALUES(30); +INSERT INTO db1.t2 VALUES("in savepoint has_comment"); +USE db2; +SavePoint mixed_cases; +USE db1; +INSERT INTO db1.t2 VALUES("in savepoint mixed_cases"); +INSERT INTO db1.t1 VALUES(40); +USE db2; +ROLLBACK TO mixed_cases; +ROLLBACK TO has_comment; +USE db1; +INSERT INTO db1.t2 VALUES("after rollback to"); +INSERT INTO db1.t1 VALUES(50); +USE db2; +COMMIT; +source include/show_binlog_events.inc; +sync_slave_with_master; + +--echo [on slave] +--echo # +--echo # Verify INSERT statements in savepoints are executed, for MyISAM table +--echo # is not effected by ROLLBACK TO +SELECT * FROM db1.t2 WHERE s LIKE '% savepoint %'; +--echo # +--echo # Verify INSERT statements on the Innodb table are rolled back; +SELECT * FROM db1.t1 WHERE a IN (30, 40); + --echo # --echo # Clean up --echo # connection master; DROP DATABASE db1; -connection slave; -DROP DATABASE db1; +DROP DATABASE db2; +source include/master-slave-end.inc; diff --git a/mysql-test/suite/rpl/t/rpl_bug33931.test b/mysql-test/suite/rpl/t/rpl_bug33931.test index e5b119dee40..42d86a7fc1e 100644 --- a/mysql-test/suite/rpl/t/rpl_bug33931.test +++ b/mysql-test/suite/rpl/t/rpl_bug33931.test @@ -40,7 +40,7 @@ connection slave; source include/wait_for_slave_to_stop.inc; --replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 8 # 9 # 19 # 23 # 33 # 37 # 41 # +--replace_column 1 # 8 # 9 # 19 # 23 # 33 # 37 # query_vertical show slave status; # diff --git a/mysql-test/suite/rpl/t/rpl_do_grant.test b/mysql-test/suite/rpl/t/rpl_do_grant.test index e3d7784429e..37358077145 100644 --- a/mysql-test/suite/rpl/t/rpl_do_grant.test +++ b/mysql-test/suite/rpl/t/rpl_do_grant.test @@ -318,4 +318,33 @@ DROP USER 'user49119'@'localhost'; -- sync_slave_with_master +# +# Bug #51987 revoke privileges logs wrong error code +# + +-- connection master +-- source include/master-slave-reset.inc +-- connection master + +grant all on *.* to foo@"1.2.3.4"; +-- error ER_REVOKE_GRANTS +revoke all privileges, grant option from "foo"; + +## assertion: revoke is logged +-- source include/show_binlog_events.inc + +-- sync_slave_with_master + +## assertion: slave replicates revoke and does not fail because master +## logged revoke with correct expected error code +-- let $err= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1) + if ($err) +{ + -- die UNEXPECTED ERROR AT SLAVE: $err +} + +-- connection master +DROP USER foo@"1.2.3.4"; +-- sync_slave_with_master + --echo "End of test" diff --git a/mysql-test/suite/rpl/t/rpl_events.test b/mysql-test/suite/rpl/t/rpl_events.test index 6e5bed8aa21..45ef12862fc 100644 --- a/mysql-test/suite/rpl/t/rpl_events.test +++ b/mysql-test/suite/rpl/t/rpl_events.test @@ -59,10 +59,16 @@ CREATE DEFINER=CURRENT_USER() EVENT event44331_3 ON COMPLETION PRESERVE DISABLE DO INSERT INTO test.t1 VALUES('event event44331_3 fired - DEFINER=CURRENT_USER() function'); +DELIMITER |; CREATE /*!50000 DEFINER='user44331' */ EVENT event44331_4 ON SCHEDULE AT CURRENT_TIMESTAMP ON COMPLETION PRESERVE DISABLE DO INSERT INTO test.t1 VALUES('event event44331_4 fired - DEFINER=user1'); +# Test for bug#50095 Multi-statement including CREATE EVENT causes rotten +# binlog entry + SELECT 'ABC'; + SELECT '123'| +DELIMITER ;| --echo #on master select EVENT_SCHEMA, EVENT_NAME, DEFINER from information_schema.events diff --git a/mysql-test/suite/rpl/t/rpl_flushlog_loop.test b/mysql-test/suite/rpl/t/rpl_flushlog_loop.test index 71749444cbd..a873c1fa3a9 100644 --- a/mysql-test/suite/rpl/t/rpl_flushlog_loop.test +++ b/mysql-test/suite/rpl/t/rpl_flushlog_loop.test @@ -71,7 +71,7 @@ source include/wait_for_slave_param.inc; # Show status of slave # --replace_result $SLAVE_MYPORT SLAVE_PORT $slave_param_value POSITION ---replace_column 1 # 8 # 9 # 16 # 23 # 33 # 34 # 35 # 41 # +--replace_column 1 # 8 # 9 # 16 # 23 # 33 # 34 # 35 # --query_vertical SHOW SLAVE STATUS --disable_query_log diff --git a/mysql-test/suite/rpl/t/rpl_incident.test b/mysql-test/suite/rpl/t/rpl_incident.test index dd9ec702a90..66893ebb93f 100644 --- a/mysql-test/suite/rpl/t/rpl_incident.test +++ b/mysql-test/suite/rpl/t/rpl_incident.test @@ -24,7 +24,7 @@ source include/wait_for_slave_sql_error.inc; SELECT * FROM t1; --replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 6 # 7 # 8 # 9 # 22 # 23 # 33 # 41 # +--replace_column 1 # 6 # 7 # 8 # 9 # 22 # 23 # 33 # --query_vertical SHOW SLAVE STATUS SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; @@ -36,7 +36,7 @@ START SLAVE; SELECT * FROM t1; --replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 6 # 7 # 8 # 9 # 22 # 23 # 33 # 41 # +--replace_column 1 # 6 # 7 # 8 # 9 # 22 # 23 # 33 # --query_vertical SHOW SLAVE STATUS connection master; diff --git a/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test b/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test index 3c50eb3db04..60bccaad0d3 100644 --- a/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test +++ b/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test @@ -27,7 +27,7 @@ SELECT * FROM t1; connection slave; --source include/wait_for_slave_sql_to_stop.inc # show the error message ---replace_column 1 # 4 # 7 # 8 # 9 # 23 # 33 # 41 # +--replace_column 1 # 4 # 7 # 8 # 9 # 23 # 33 # --query_vertical show slave status; # show that it was not replicated SELECT * FROM t1; @@ -83,7 +83,7 @@ SELECT * FROM t1; connection slave; --source include/wait_for_slave_sql_to_stop.inc # show the error message ---replace_column 1 # 4 # 7 # 8 # 9 # 23 # 33 # 41 # +--replace_column 1 # 4 # 7 # 8 # 9 # 23 # 33 # --query_vertical show slave status; # show that it was not replicated SELECT * FROM t1; diff --git a/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test b/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test index 8740b7da7a9..6a9a30fcb0e 100644 --- a/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test +++ b/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test @@ -17,7 +17,7 @@ SHOW BINLOG EVENTS; sync_slave_with_master; --echo **** On Slave **** --replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 34 # 35 # 41 # +--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 34 # 35 # --query_vertical SHOW SLAVE STATUS --replace_result $VERSION VERSION --replace_column 2 # 5 # diff --git a/mysql-test/suite/rpl/t/rpl_replicate_do.test b/mysql-test/suite/rpl/t/rpl_replicate_do.test index 5976a858ac9..3e22984aef8 100644 --- a/mysql-test/suite/rpl/t/rpl_replicate_do.test +++ b/mysql-test/suite/rpl/t/rpl_replicate_do.test @@ -28,7 +28,7 @@ drop table if exists t1,t2,t11; sync_slave_with_master; # show slave status, just to see of it prints replicate-do-table --replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # 41 # +--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # query_vertical SHOW SLAVE STATUS; # diff --git a/mysql-test/suite/rpl/t/rpl_row_rec_comp_innodb.test b/mysql-test/suite/rpl/t/rpl_row_rec_comp_innodb.test new file mode 100644 index 00000000000..67e4c4fb14d --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_rec_comp_innodb.test @@ -0,0 +1,10 @@ +-- source include/have_binlog_format_row.inc +-- source include/master-slave.inc +-- source include/have_innodb.inc + +# +# BUG#52868 Wrong handling of NULL value during update, replication out of sync +# + +-- let $engine= InnoDB +-- source extra/rpl_tests/rpl_record_compare.test diff --git a/mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test b/mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test new file mode 100644 index 00000000000..43fa99a51da --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test @@ -0,0 +1,31 @@ +-- source include/have_binlog_format_row.inc +-- source include/master-slave.inc + +# +# BUG#52868 Wrong handling of NULL value during update, replication out of sync +# + +-- let $engine= MyISAM +-- source extra/rpl_tests/rpl_record_compare.test + +-- echo ## coverage purposes - Field_bits +-- echo ## 1 X bit + 2 Null bits + 5 bits => last_null_bit_pos==0 +## Added here because AFAIK it's only MyISAM and NDB that use Field_bits + +-- source include/master-slave-reset.inc +-- connection master + +-- eval CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bit(5)) ENGINE=$engine DEFAULT CHARSET=latin1 + +INSERT INTO t1(c1,c2) VALUES (10, b'1'); +INSERT INTO t1(c1,c2) VALUES (NULL, b'1'); +UPDATE t1 SET c1= 0; +-- sync_slave_with_master + +-- let $diff_table_1= master:test.t1 +-- let $diff_table_2= slave:test.t1 +-- source include/diff_tables.inc + +-- connection master +DROP TABLE t1; +-- sync_slave_with_master diff --git a/mysql-test/suite/rpl/t/rpl_row_until.test b/mysql-test/suite/rpl/t/rpl_row_until.test index bfc5851a2b7..52e38fa3e57 100644 --- a/mysql-test/suite/rpl/t/rpl_row_until.test +++ b/mysql-test/suite/rpl/t/rpl_row_until.test @@ -57,7 +57,7 @@ eval START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=$mast # Here table should be still not deleted SELECT * FROM t1; --replace_result $master_pos_drop_t1 MASTER_POS_DROP_T1 ---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 23 # 33 # 35 # 36 # 41 # +--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 23 # 33 # 35 # 36 # query_vertical SHOW SLAVE STATUS; # This should fail right after start @@ -66,7 +66,7 @@ START SLAVE UNTIL MASTER_LOG_FILE='master-no-such-bin.000001', MASTER_LOG_POS=29 # again this table should be still not deleted SELECT * FROM t1; --replace_result $master_pos_drop_t1 MASTER_POS_DROP_T1 ---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 23 # 33 # 35 # 36 # 41 # +--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 23 # 33 # 35 # 36 # query_vertical SHOW SLAVE STATUS; # Try replicate all up to and not including the second insert to t2; @@ -77,7 +77,7 @@ eval START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', RELAY_LOG_POS=$r --source include/wait_for_slave_sql_to_stop.inc SELECT * FROM t2; --replace_result $relay_pos_insert1_t2 RELAY_POS_INSERT1_T2 $master_pos_insert1_t2 MASTER_POS_INSERT1_T2 ---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 23 # 33 # 35 # 36 # 41 # +--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 23 # 33 # 35 # 36 # query_vertical SHOW SLAVE STATUS; # clean up @@ -99,7 +99,7 @@ let $slave_param_value= $master_pos_create_t2; # here the sql slave thread should be stopped --replace_result bin.000005 bin.000004 bin.000006 bin.000004 bin.000007 bin.000004 --replace_result $master_pos_create_t2 MASTER_POS_CREATE_T2 $master_pos_drop_t2 MASTER_POS_DROP_T2 ---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 23 # 33 # 35 # 36 # 41 # +--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 23 # 33 # 35 # 36 # query_vertical SHOW SLAVE STATUS; #testing various error conditions diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync.test b/mysql-test/suite/rpl/t/rpl_semi_sync.test index 7610ee68417..1bf4f1a3396 100644 --- a/mysql-test/suite/rpl/t/rpl_semi_sync.test +++ b/mysql-test/suite/rpl/t/rpl_semi_sync.test @@ -602,7 +602,11 @@ source include/stop_slave.inc; UNINSTALL PLUGIN rpl_semi_sync_slave; connection master; +# The dump thread may still be running on the master, and so the following +# UNINSTALL could generate a warning about the plugin is busy. +disable_warnings; UNINSTALL PLUGIN rpl_semi_sync_master; +enable_warnings; connection slave; source include/start_slave.inc; diff --git a/mysql-test/suite/rpl/t/rpl_show_master_info_file-master.opt b/mysql-test/suite/rpl/t/rpl_show_master_info_file-master.opt deleted file mode 100644 index 1a95bfcef8b..00000000000 --- a/mysql-test/suite/rpl/t/rpl_show_master_info_file-master.opt +++ /dev/null @@ -1 +0,0 @@ ---master-info-file=$MYSQLTEST_VARDIR/master.info diff --git a/mysql-test/suite/rpl/t/rpl_show_master_info_file.test b/mysql-test/suite/rpl/t/rpl_show_master_info_file.test deleted file mode 100644 index b8c385aaae5..00000000000 --- a/mysql-test/suite/rpl/t/rpl_show_master_info_file.test +++ /dev/null @@ -1,18 +0,0 @@ -# -# Bug #50316 Add Master_info_file to SHOW SLAVE STATUS -# Testing of matching --master-info-file value to the value of the -# new added SSS' field -# - -source include/master-slave.inc; -source include/have_binlog_format_mixed.inc; - -# test reveals different path separator on windows. -# Leaving out windows because there is nothing more platform specific. -source include/not_windows.inc; - -connection slave; - ---let $master_info_file= query_get_value(SHOW SLAVE STATUS, Master_Info_File, 1) ---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---eval SELECT "$master_info_file" as Master_Info_File diff --git a/mysql-test/suite/rpl/t/rpl_slave_skip.test b/mysql-test/suite/rpl/t/rpl_slave_skip.test index 87b4ebe7abd..587a812d0ae 100644 --- a/mysql-test/suite/rpl/t/rpl_slave_skip.test +++ b/mysql-test/suite/rpl/t/rpl_slave_skip.test @@ -36,7 +36,7 @@ connection slave; START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=762; --source include/wait_for_slave_sql_to_stop.inc --replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 8 # 9 # 23 # 33 # 35 # 36 # 41 # +--replace_column 1 # 8 # 9 # 23 # 33 # 35 # 36 # query_vertical SHOW SLAVE STATUS; # Now we skip *one* table map event. If the execution starts right @@ -74,7 +74,7 @@ START SLAVE; --source include/wait_for_slave_to_start.inc sync_with_master; --replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 8 # 9 # 23 # 33 # 35 # 36 # 41 # +--replace_column 1 # 8 # 9 # 23 # 33 # 35 # 36 # query_vertical SHOW SLAVE STATUS; --echo **** On Master **** diff --git a/mysql-test/suite/rpl/t/rpl_ssl.test b/mysql-test/suite/rpl/t/rpl_ssl.test index f3c4bae751c..fd4897586f6 100644 --- a/mysql-test/suite/rpl/t/rpl_ssl.test +++ b/mysql-test/suite/rpl/t/rpl_ssl.test @@ -31,7 +31,7 @@ select * from t1; # The slave is synced and waiting/reading from master # SHOW SLAVE STATUS will show "Waiting for master to send event" --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT ---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # 41 # +--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # query_vertical show slave status; # Stop the slave, as reported in bug#21871 it would hang @@ -71,7 +71,7 @@ let $master_count= `select count(*) from t1`; sync_slave_with_master; --source include/wait_for_slave_to_start.inc --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT ---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # 41 # +--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # query_vertical show slave status; let $slave_count= `select count(*) from t1`; diff --git a/mysql-test/suite/rpl/t/rpl_ssl1.test b/mysql-test/suite/rpl/t/rpl_ssl1.test index f3a765791da..b28f7b11c03 100644 --- a/mysql-test/suite/rpl/t/rpl_ssl1.test +++ b/mysql-test/suite/rpl/t/rpl_ssl1.test @@ -45,7 +45,7 @@ select * from t1; #checking show slave status --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT ---replace_column 1 # 6 # 7 # 8 # 9 # 10 # 11 # 16 # 22 # 23 # 33 # 35 # 36 # 41 # +--replace_column 1 # 6 # 7 # 8 # 9 # 10 # 11 # 16 # 22 # 23 # 33 # 35 # 36 # query_vertical show slave status; #checking if replication works without ssl also performing clean up @@ -59,7 +59,7 @@ drop user replssl@localhost; drop table t1; sync_slave_with_master; --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT ---replace_column 1 # 6 # 7 # 8 # 9 # 10 # 11 # 16 # 22 # 23 # 33 # 35 # 36 # 41 # +--replace_column 1 # 6 # 7 # 8 # 9 # 10 # 11 # 16 # 22 # 23 # 33 # 35 # 36 # query_vertical show slave status; # End of 4.1 tests @@ -91,7 +91,7 @@ select * from t1; #checking show slave status --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT ---replace_column 1 # 6 # 7 # 8 # 9 # 10 # 11 # 16 # 22 # 23 # 33 # 35 # 36 # 41 # +--replace_column 1 # 6 # 7 # 8 # 9 # 10 # 11 # 16 # 22 # 23 # 33 # 35 # 36 # query_vertical show slave status; connection master; diff --git a/mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test b/mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test index 39a9522bf6c..f32ab1f01f0 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test +++ b/mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test @@ -8,3 +8,41 @@ let $engine_type=Innodb; --source extra/rpl_tests/rpl_mixing_engines.test + +# +# BUG#49522: Replication problem with mixed MyISAM/InnoDB +# + +-- source include/master-slave-reset.inc +-- connection master + +CREATE TABLE `t1` ( + `c1` int(10) unsigned NOT NULL AUTO_INCREMENT, + `c2` tinyint(1) unsigned DEFAULT NULL, + `c3` varchar(300) DEFAULT NULL, + `c4` int(10) unsigned NOT NULL, + `c5` int(10) unsigned DEFAULT NULL, + PRIMARY KEY (`c1`)) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- sync_slave_with_master +ALTER TABLE `t1` Engine=InnoDB; + +-- connection master +SET AUTOCOMMIT=0; + +INSERT INTO t1 (c1,c2,c3,c4,c5) VALUES (1, 1, 'X', 1, NULL); +COMMIT; +ROLLBACK; +SET AUTOCOMMIT=1; + +-- sync_slave_with_master + +-- let $diff_table_1=master:test.t1 +-- let $diff_table_2=slave:test.t1 +-- source include/diff_tables.inc + +-- connection master +DROP TABLE `t1`; +-- sync_slave_with_master + +-- source include/master-slave-end.inc diff --git a/mysql-test/suite/rpl/t/rpl_temp_temporary.test b/mysql-test/suite/rpl/t/rpl_temp_temporary.test index a7234c53655..4eb2d16b91e 100644 --- a/mysql-test/suite/rpl/t/rpl_temp_temporary.test +++ b/mysql-test/suite/rpl/t/rpl_temp_temporary.test @@ -34,10 +34,13 @@ # the CREATE TEMPORARY is not logged and the DROP TEMPORARY is extended with # the IF EXISTS clause. # -# 7 - It also verifies if the CONNECTION_ID along with a non-transactional +# 7 - It verifies if the CONNECTION_ID along with a non-transactional # table is written outside the transaction boundaries and is not classified # as unsafe. See BUG#53075. # +# 8 - It verifies if OPTION_KEEP_LOG is set and thus forcing to write the +# trx-cache to the binary log when an rollback is issued and only trx-tables +# were updated. See BUG#53421. ################################################################################ source include/master-slave.inc; @@ -186,18 +189,40 @@ INSERT INTO t_innodb VALUES(1); INSERT INTO t_myisam VALUES(CONNECTION_ID()); INSERT INTO t_innodb VALUES(1); COMMIT; -DROP TABLE t_myisam; -DROP TABLE t_innodb; +source include/show_binlog_events.inc; + +--echo ######################################################################## +--echo # VERIFY ITEM 8 +--echo ######################################################################## +# +# Before the patch for BUG#53421, nothing were written to the binary log on +# behalf of the transaction presented below: +# +SET BINLOG_FORMAT=MIXED; +let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); +BEGIN; +CREATE TEMPORARY TABLE tmp2 SELECT * FROM t_innodb; +INSERT INTO t_innodb VALUES(1); +INSERT INTO t_innodb VALUES(1); +ROLLBACK; source include/show_binlog_events.inc; --echo ################################################################################### --echo # CHECK CONSISTENCY --echo ################################################################################### -connection master; sync_slave_with_master; +connection master; --exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/test-nmt-master.sql --exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/test-nmt-slave.sql --diff_files $MYSQLTEST_VARDIR/tmp/test-nmt-master.sql $MYSQLTEST_VARDIR/tmp/test-nmt-slave.sql +--echo ################################################################################### +--echo # CLEAN UP +--echo ################################################################################### +connection master; +DROP TABLE t_myisam; +DROP TABLE t_innodb; + +sync_slave_with_master; diff --git a/mysql-test/suite/rpl_ndb/my.cnf b/mysql-test/suite/rpl_ndb/my.cnf index 191683fc9df..0c62988b220 100644 --- a/mysql-test/suite/rpl_ndb/my.cnf +++ b/mysql-test/suite/rpl_ndb/my.cnf @@ -19,6 +19,8 @@ mysqld= ndbcluster # Turn on bin logging log-bin= master-bin +# Cluster only supports row format +binlog-format= row [mysqld.1.1] @@ -32,6 +34,8 @@ log-bin= master-bin log-bin= slave-bin relay-log= slave-relay-bin +# Cluster only supports row format +binlog-format= row init-rpl-role= slave log-slave-updates diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result index 52e5ea72dcc..6680f3fd70f 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result @@ -181,7 +181,6 @@ Last_SQL_Errno <Last_SQL_Errno> Last_SQL_Error <Last_SQL_Error> Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File <Master-Info-File> set GLOBAL slave_transaction_retries=10; include/start_slave.inc select * from t1 order by nid; diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result index ab126026fe4..61f79804c65 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result @@ -45,9 +45,9 @@ a CREATE TRIGGER trig_2 AFTER INSERT ON t_stmt FOR EACH ROW BEGIN INSERT INTO t_row VALUES(1); END; INSERT INTO t_stmt VALUES (1); ERROR HY000: Cannot execute statement: impossible to write to binary log since both row-incapable engines and statement-incapable engines are involved. -DROP trigger trig_2; SELECT * FROM t_stmt /* should be empty */; a +DROP TRIGGER trig_2; * Stmt-only table and binlog_format=row INSERT INTO t_stmt VALUES (1); ERROR HY000: Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-based logging. diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result index f5f1725b517..aeb9e215d15 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result @@ -58,7 +58,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # SELECT * FROM t1 ORDER BY a; a b 1 2 @@ -104,6 +103,5 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 2 -Master_Info_File # STOP SLAVE; DROP TABLE t1; diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result index 646c03db363..8eb7df3f890 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result @@ -55,7 +55,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 2 -Master_Info_File # SELECT * FROM t1 ORDER BY a; a b 1 2 @@ -107,5 +106,4 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # DROP TABLE t1; diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result index 1a11a5cb7b8..2df70ace0c1 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result @@ -32,55 +32,16 @@ SELECT * FROM t1 ORDER BY c3; c1 c2 c3 row3 C 3 row4 D 4 -SHOW SLAVE STATUS;; -Slave_IO_State <Slave_IO_State> -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos <Read_Master_Log_Pos> -Relay_Log_File <Relay_Log_File> -Relay_Log_Pos <Relay_Log_Pos> -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table <Replicate_Ignore_Table> -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos <Exec_Master_Log_Pos> -Relay_Log_Space <Relay_Log_Space> -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master <Seconds_Behind_Master> -Master_SSL_Verify_Server_Cert No -Last_IO_Errno <Last_IO_Errno> -Last_IO_Error <Last_IO_Error> -Last_SQL_Errno 0 -Last_SQL_Error -Replicate_Ignore_Server_Ids -Master_Server_Id 1 -Master_Info_File <Master-Info-File> +SHOW SLAVE STATUS; +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id +<Slave_IO_State> 127.0.0.1 root MASTER_PORT 1 master-bin.000001 <Read_Master_Log_Pos> <Relay_Log_File> <Relay_Log_Pos> master-bin.000001 Yes Yes <Replicate_Ignore_Table> 0 0 <Exec_Master_Log_Pos> <Relay_Log_Space> None 0 No <Seconds_Behind_Master> No <Last_IO_Errno> <Last_IO_Error> 0 1 STOP SLAVE; CHANGE MASTER TO master_log_file = 'master-bin.000001', master_log_pos = <the_pos> ; SHOW SLAVE STATUS; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_Info_File -<Slave_IO_State> 127.0.0.1 root MASTER_PORT 1 master-bin.000001 <Read_Master_Log_Pos> <Relay_Log_File> <Relay_Log_Pos> master-bin.000001 No No <Replicate_Ignore_Table> 0 0 <Exec_Master_Log_Pos> <Relay_Log_Space> None 0 No <Seconds_Behind_Master> No <Last_IO_Errno> <Last_IO_Error> 0 1 <Master-Info-File> +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id +<Slave_IO_State> 127.0.0.1 root MASTER_PORT 1 master-bin.000001 <Read_Master_Log_Pos> <Relay_Log_File> <Relay_Log_Pos> master-bin.000001 No No <Replicate_Ignore_Table> 0 0 <Exec_Master_Log_Pos> <Relay_Log_Space> None 0 No <Seconds_Behind_Master> No <Last_IO_Errno> <Last_IO_Error> 0 1 START SLAVE; SELECT * FROM t1 ORDER BY c3; c1 c2 c3 @@ -106,46 +67,7 @@ COMMIT; SELECT * FROM t1; c1 c2 c3 row2 new on slave 2 -SHOW SLAVE STATUS;; -Slave_IO_State <Slave_IO_State> -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos <Read_Master_Log_Pos> -Relay_Log_File <Relay_Log_File> -Relay_Log_Pos <Relay_Log_Pos> -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table <Replicate_Ignore_Table> -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos <Exec_Master_Log_Pos> -Relay_Log_Space <Relay_Log_Space> -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master <Seconds_Behind_Master> -Master_SSL_Verify_Server_Cert <Last_IO_Errno> -Last_IO_Errno <Last_IO_Error> -Last_IO_Error -Last_SQL_Errno 0 -Last_SQL_Error -Replicate_Ignore_Server_Ids -Master_Server_Id 1 -Master_Info_File <Master-Info-File> +SHOW SLAVE STATUS; +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id +<Slave_IO_State> 127.0.0.1 root MASTER_PORT 1 master-bin.000001 <Read_Master_Log_Pos> <Relay_Log_File> <Relay_Log_Pos> master-bin.000001 Yes Yes <Replicate_Ignore_Table> 0 0 <Exec_Master_Log_Pos> <Relay_Log_Space> None 0 No <Seconds_Behind_Master> <Last_IO_Errno> <Last_IO_Error> 0 1 DROP TABLE IF EXISTS t1; diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result index cb46dd1e76f..67aa0955b71 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result @@ -304,7 +304,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File # show binlog events in 'slave-bin.000005' from 4; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log DROP TABLE t1; diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result index 675a69d17a4..5327bfde7e0 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result @@ -4,6 +4,7 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; +SET binlog_format = STATEMENT; *** Test 1 *** diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result index 678a7f0d785..b61f5550719 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result @@ -109,7 +109,6 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -Master_Info_File <Master-Info-File> SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3; hex(c1) hex(c2) c3 1 1 row1 diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test index 64ac6136cad..04ef7f31b7c 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test @@ -196,7 +196,7 @@ source include/wait_for_slave_sql_to_stop.inc; # Replication should have stopped, since max retries were not enough. # verify with show slave status --replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 19 <Last_Errno> 20 <Last_Error> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master> 35 <Last_IO_Errno> 36 <Last_IO_Error> 37 <Last_SQL_Errno> 38 <Last_SQL_Error> 41 <Master-Info-File> +--replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 19 <Last_Errno> 20 <Last_Error> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master> 35 <Last_IO_Errno> 36 <Last_IO_Error> 37 <Last_SQL_Errno> 38 <Last_SQL_Error> --query_vertical SHOW SLAVE STATUS; # now set max retries high enough to succeed, and start slave again diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test index f6331cd0808..4ba7e643779 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test @@ -100,8 +100,8 @@ SELECT * FROM t /* Should be empty */; --eval CREATE TRIGGER trig_2 AFTER INSERT ON t_stmt FOR EACH ROW BEGIN INSERT INTO t_row VALUES(1); END --error ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE INSERT INTO t_stmt VALUES (1); -DROP trigger trig_2; SELECT * FROM t_stmt /* should be empty */; +DROP TRIGGER trig_2; --echo * Stmt-only table and binlog_format=row --error ER_BINLOG_ROW_MODE_AND_STMT_ENGINE diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test index a69f9d49672..bfa50537430 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test @@ -43,14 +43,14 @@ INSERT INTO t1 VALUES (2,3); SELECT * FROM t1 ORDER BY a; #SELECT * FROM t2 ORDER BY a; # BUG#34654 Last_IO_Errno is not reset - Mask columns 35 and 36 ---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # 41 # +--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # --query_vertical show slave status; # connect to master and ensure data it there. --connection master SELECT * FROM t1 ORDER BY a; #SELECT * FROM t2 ORDER BY a; # BUG#34654 Last_IO_Errno is not reset - Mask columns 35 and 36 ---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # 41 # +--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # --query_vertical show slave status; # stop replication on "master" as not to replicate diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test index 102fefddbb4..92f7aaebcd4 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test @@ -52,7 +52,7 @@ sync_with_master; # Check that there is no error in replication --replace_result $SLAVE_MYPORT SLAVE_PORT ---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # 41 # +--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # query_vertical SHOW SLAVE STATUS; # Check that we have the data on the master @@ -79,7 +79,7 @@ SELECT * FROM t1 ORDER BY a; # Check that there is no error in replication --replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # 41 # +--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # query_vertical SHOW SLAVE STATUS; connection master; diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test index 8543266f545..3133ad34f0c 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test @@ -43,8 +43,8 @@ SELECT * FROM t1 ORDER BY c3; SELECT * FROM t1 ORDER BY c3; --replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master> 35 <Last_IO_Errno> 36 <Last_IO_Error> 41 <Master-Info-File> ---query_vertical SHOW SLAVE STATUS; +--replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master> 35 <Last_IO_Errno> 36 <Last_IO_Error> +SHOW SLAVE STATUS; # stop slave and reset position to before the last changes STOP SLAVE; @@ -54,7 +54,7 @@ eval CHANGE MASTER TO master_log_pos = $the_pos ; --replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master> 35 <Last_IO_Errno> 36 <Last_IO_Error> 41 <Master-Info-File> +--replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master> 35 <Last_IO_Errno> 36 <Last_IO_Error> SHOW SLAVE STATUS; # start the slave again @@ -107,8 +107,8 @@ COMMIT; --connection slave SELECT * FROM t1; --replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master> 34 <Last_IO_Errno> 35 <Last_IO_Error> 41 <Master-Info-File> ---query_vertical SHOW SLAVE STATUS; +--replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master> 34 <Last_IO_Errno> 35 <Last_IO_Error> +SHOW SLAVE STATUS; connection master; DROP TABLE IF EXISTS t1; diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test index 0d915b0aa00..5e54ca38dc1 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test @@ -27,9 +27,11 @@ --disable_query_log --source include/have_ndb.inc --source include/have_innodb.inc ---source include/have_binlog_format_statement.inc --source include/ndb_master-slave.inc --enable_query_log + +# statement format is supported because master uses innodb +SET binlog_format = STATEMENT; let $off_set = 6; let $rpl_format = 'SBR'; disable_query_log; diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test index 1cf91e0e5cd..88572c3e9a2 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test @@ -72,7 +72,7 @@ START SLAVE; --sync_slave_with_master --connection slave --replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master> 35 <Last_IO_Errno> 36 <Last_IO_Error> 41 <Master-Info-File> +--replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master> 35 <Last_IO_Errno> 36 <Last_IO_Error> query_vertical SHOW SLAVE STATUS; SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3; diff --git a/mysql-test/suite/sys_vars/r/innodb_buffer_pool_instances_basic.result b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_instances_basic.result new file mode 100644 index 00000000000..a3c1a7b7bd4 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_instances_basic.result @@ -0,0 +1,53 @@ +'#---------------------BS_STVARS_035_01----------------------#' +SELECT COUNT(@@GLOBAL.innodb_buffer_pool_instances); +COUNT(@@GLOBAL.innodb_buffer_pool_instances) +1 +1 Expected +'#---------------------BS_STVARS_035_02----------------------#' +SET @@GLOBAL.innodb_buffer_pool_instances=1; +ERROR HY000: Variable 'innodb_buffer_pool_instances' is a read only variable +Expected error 'Read only variable' +SELECT COUNT(@@GLOBAL.innodb_buffer_pool_instances); +COUNT(@@GLOBAL.innodb_buffer_pool_instances) +1 +1 Expected +'#---------------------BS_STVARS_035_03----------------------#' +SELECT @@GLOBAL.innodb_buffer_pool_instances = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='innodb_buffer_pool_instances'; +@@GLOBAL.innodb_buffer_pool_instances = VARIABLE_VALUE +1 +1 Expected +SELECT COUNT(@@GLOBAL.innodb_buffer_pool_instances); +COUNT(@@GLOBAL.innodb_buffer_pool_instances) +1 +1 Expected +SELECT COUNT(VARIABLE_VALUE) +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='innodb_buffer_pool_instances'; +COUNT(VARIABLE_VALUE) +1 +1 Expected +'#---------------------BS_STVARS_035_04----------------------#' +SELECT @@innodb_buffer_pool_instances = @@GLOBAL.innodb_buffer_pool_instances; +@@innodb_buffer_pool_instances = @@GLOBAL.innodb_buffer_pool_instances +1 +1 Expected +'#---------------------BS_STVARS_035_05----------------------#' +SELECT COUNT(@@innodb_buffer_pool_instances); +COUNT(@@innodb_buffer_pool_instances) +1 +1 Expected +SELECT COUNT(@@local.innodb_buffer_pool_instances); +ERROR HY000: Variable 'innodb_buffer_pool_instances' is a GLOBAL variable +Expected error 'Variable is a GLOBAL variable' +SELECT COUNT(@@SESSION.innodb_buffer_pool_instances); +ERROR HY000: Variable 'innodb_buffer_pool_instances' is a GLOBAL variable +Expected error 'Variable is a GLOBAL variable' +SELECT COUNT(@@GLOBAL.innodb_buffer_pool_instances); +COUNT(@@GLOBAL.innodb_buffer_pool_instances) +1 +1 Expected +SELECT innodb_buffer_pool_instances = @@SESSION.innodb_buffer_pool_instances; +ERROR 42S22: Unknown column 'innodb_buffer_pool_instances' in 'field list' +Expected error 'Readonly variable' diff --git a/mysql-test/suite/sys_vars/r/innodb_change_buffering_basic.result b/mysql-test/suite/sys_vars/r/innodb_change_buffering_basic.result index 70b0425ce6f..f80ed54100f 100644 --- a/mysql-test/suite/sys_vars/r/innodb_change_buffering_basic.result +++ b/mysql-test/suite/sys_vars/r/innodb_change_buffering_basic.result @@ -1,28 +1,28 @@ SET @start_global_value = @@global.innodb_change_buffering; SELECT @start_global_value; @start_global_value -inserts -Valid values are 'inserts' and 'none' -select @@global.innodb_change_buffering in ('inserts', 'none'); -@@global.innodb_change_buffering in ('inserts', 'none') +all +Valid values are 'all', 'deletes', 'changes', 'inserts', 'none', 'purges' +select @@global.innodb_change_buffering in ('all', 'deletes', 'changes', 'inserts', 'none', 'purges'); +@@global.innodb_change_buffering in ('all', 'deletes', 'changes', 'inserts', 'none', 'purges') 1 select @@global.innodb_change_buffering; @@global.innodb_change_buffering -inserts +all select @@session.innodb_change_buffering; ERROR HY000: Variable 'innodb_change_buffering' is a GLOBAL variable show global variables like 'innodb_change_buffering'; Variable_name Value -innodb_change_buffering inserts +innodb_change_buffering all show session variables like 'innodb_change_buffering'; Variable_name Value -innodb_change_buffering inserts +innodb_change_buffering all select * from information_schema.global_variables where variable_name='innodb_change_buffering'; VARIABLE_NAME VARIABLE_VALUE -INNODB_CHANGE_BUFFERING inserts +INNODB_CHANGE_BUFFERING all select * from information_schema.session_variables where variable_name='innodb_change_buffering'; VARIABLE_NAME VARIABLE_VALUE -INNODB_CHANGE_BUFFERING inserts +INNODB_CHANGE_BUFFERING all set global innodb_change_buffering='none'; select @@global.innodb_change_buffering; @@global.innodb_change_buffering @@ -60,4 +60,4 @@ ERROR 42000: Variable 'innodb_change_buffering' can't be set to the value of 'so SET @@global.innodb_change_buffering = @start_global_value; SELECT @@global.innodb_change_buffering; @@global.innodb_change_buffering -inserts +all diff --git a/mysql-test/suite/sys_vars/r/innodb_purge_batch_size_basic.result b/mysql-test/suite/sys_vars/r/innodb_purge_batch_size_basic.result new file mode 100644 index 00000000000..1ff36237907 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_purge_batch_size_basic.result @@ -0,0 +1,98 @@ +SET @global_start_value = @@global.innodb_purge_batch_size; +SELECT @global_start_value; +@global_start_value +20 +'#--------------------FN_DYNVARS_046_01------------------------#' +SET @@global.innodb_purge_batch_size = 1; +SET @@global.innodb_purge_batch_size = DEFAULT; +SELECT @@global.innodb_purge_batch_size; +@@global.innodb_purge_batch_size +20 +'#---------------------FN_DYNVARS_046_02-------------------------#' +SET innodb_purge_batch_size = 1; +ERROR HY000: Variable 'innodb_purge_batch_size' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@innodb_purge_batch_size; +@@innodb_purge_batch_size +20 +SELECT local.innodb_purge_batch_size; +ERROR 42S02: Unknown table 'local' in field list +SET global innodb_purge_batch_size = 1; +SELECT @@global.innodb_purge_batch_size; +@@global.innodb_purge_batch_size +1 +'#--------------------FN_DYNVARS_046_03------------------------#' +SET @@global.innodb_purge_batch_size = 1; +SELECT @@global.innodb_purge_batch_size; +@@global.innodb_purge_batch_size +1 +SET @@global.innodb_purge_batch_size = 5000; +SELECT @@global.innodb_purge_batch_size; +@@global.innodb_purge_batch_size +5000 +SET @@global.innodb_purge_batch_size = 1000; +SELECT @@global.innodb_purge_batch_size; +@@global.innodb_purge_batch_size +1000 +'#--------------------FN_DYNVARS_046_04-------------------------#' +SET @@global.innodb_purge_batch_size = 0; +Warnings: +Warning 1292 Truncated incorrect innodb_purge_batch_size value: '0' +SELECT @@global.innodb_purge_batch_size; +@@global.innodb_purge_batch_size +1 +SET @@global.innodb_purge_batch_size = "T"; +ERROR 42000: Incorrect argument type to variable 'innodb_purge_batch_size' +SELECT @@global.innodb_purge_batch_size; +@@global.innodb_purge_batch_size +1 +SET @@global.innodb_purge_batch_size = "Y"; +ERROR 42000: Incorrect argument type to variable 'innodb_purge_batch_size' +SELECT @@global.innodb_purge_batch_size; +@@global.innodb_purge_batch_size +1 +SET @@global.innodb_purge_batch_size = 5001; +Warnings: +Warning 1292 Truncated incorrect innodb_purge_batch_size value: '5001' +SELECT @@global.innodb_purge_batch_size; +@@global.innodb_purge_batch_size +5000 +'#----------------------FN_DYNVARS_046_05------------------------#' +SELECT @@global.innodb_purge_batch_size = +VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='innodb_purge_batch_size'; +@@global.innodb_purge_batch_size = +VARIABLE_VALUE +1 +SELECT @@global.innodb_purge_batch_size; +@@global.innodb_purge_batch_size +5000 +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='innodb_purge_batch_size'; +VARIABLE_VALUE +5000 +'#---------------------FN_DYNVARS_046_06-------------------------#' +SET @@global.innodb_purge_batch_size = OFF; +ERROR 42000: Incorrect argument type to variable 'innodb_purge_batch_size' +SELECT @@global.innodb_purge_batch_size; +@@global.innodb_purge_batch_size +5000 +SET @@global.innodb_purge_batch_size = ON; +ERROR 42000: Incorrect argument type to variable 'innodb_purge_batch_size' +SELECT @@global.innodb_purge_batch_size; +@@global.innodb_purge_batch_size +5000 +'#---------------------FN_DYNVARS_046_07----------------------#' +SET @@global.innodb_purge_batch_size = TRUE; +SELECT @@global.innodb_purge_batch_size; +@@global.innodb_purge_batch_size +1 +SET @@global.innodb_purge_batch_size = FALSE; +Warnings: +Warning 1292 Truncated incorrect innodb_purge_batch_size value: '0' +SELECT @@global.innodb_purge_batch_size; +@@global.innodb_purge_batch_size +1 +SET @@global.innodb_purge_batch_size = @global_start_value; +SELECT @@global.innodb_purge_batch_size; +@@global.innodb_purge_batch_size +20 diff --git a/mysql-test/suite/sys_vars/r/innodb_purge_threads_basic.result b/mysql-test/suite/sys_vars/r/innodb_purge_threads_basic.result new file mode 100644 index 00000000000..e3358a14ea2 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_purge_threads_basic.result @@ -0,0 +1,53 @@ +'#---------------------BS_STVARS_035_01----------------------#' +SELECT COUNT(@@GLOBAL.innodb_purge_threads); +COUNT(@@GLOBAL.innodb_purge_threads) +1 +1 Expected +'#---------------------BS_STVARS_035_02----------------------#' +SET @@GLOBAL.innodb_purge_threads=1; +ERROR HY000: Variable 'innodb_purge_threads' is a read only variable +Expected error 'Read only variable' +SELECT COUNT(@@GLOBAL.innodb_purge_threads); +COUNT(@@GLOBAL.innodb_purge_threads) +1 +1 Expected +'#---------------------BS_STVARS_035_03----------------------#' +SELECT @@GLOBAL.innodb_purge_threads = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='innodb_purge_threads'; +@@GLOBAL.innodb_purge_threads = VARIABLE_VALUE +1 +1 Expected +SELECT COUNT(@@GLOBAL.innodb_purge_threads); +COUNT(@@GLOBAL.innodb_purge_threads) +1 +1 Expected +SELECT COUNT(VARIABLE_VALUE) +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='innodb_purge_threads'; +COUNT(VARIABLE_VALUE) +1 +1 Expected +'#---------------------BS_STVARS_035_04----------------------#' +SELECT @@innodb_purge_threads = @@GLOBAL.innodb_purge_threads; +@@innodb_purge_threads = @@GLOBAL.innodb_purge_threads +1 +1 Expected +'#---------------------BS_STVARS_035_05----------------------#' +SELECT COUNT(@@innodb_purge_threads); +COUNT(@@innodb_purge_threads) +1 +1 Expected +SELECT COUNT(@@local.innodb_purge_threads); +ERROR HY000: Variable 'innodb_purge_threads' is a GLOBAL variable +Expected error 'Variable is a GLOBAL variable' +SELECT COUNT(@@SESSION.innodb_purge_threads); +ERROR HY000: Variable 'innodb_purge_threads' is a GLOBAL variable +Expected error 'Variable is a GLOBAL variable' +SELECT COUNT(@@GLOBAL.innodb_purge_threads); +COUNT(@@GLOBAL.innodb_purge_threads) +1 +1 Expected +SELECT innodb_purge_threads = @@SESSION.innodb_purge_threads; +ERROR 42S22: Unknown column 'innodb_purge_threads' in 'field list' +Expected error 'Readonly variable' diff --git a/mysql-test/suite/sys_vars/r/innodb_use_native_aio_basic.result b/mysql-test/suite/sys_vars/r/innodb_use_native_aio_basic.result new file mode 100644 index 00000000000..2e093a9fd2a --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_use_native_aio_basic.result @@ -0,0 +1,53 @@ +'#---------------------BS_STVARS_035_01----------------------#' +SELECT COUNT(@@GLOBAL.innodb_use_native_aio); +COUNT(@@GLOBAL.innodb_use_native_aio) +1 +1 Expected +'#---------------------BS_STVARS_035_02----------------------#' +SET @@GLOBAL.innodb_use_native_aio=1; +ERROR HY000: Variable 'innodb_use_native_aio' is a read only variable +Expected error 'Read only variable' +SELECT COUNT(@@GLOBAL.innodb_use_native_aio); +COUNT(@@GLOBAL.innodb_use_native_aio) +1 +1 Expected +'#---------------------BS_STVARS_035_03----------------------#' +SELECT IF(@@GLOBAL.innodb_use_native_aio, 'ON', 'OFF') = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='innodb_use_native_aio'; +IF(@@GLOBAL.innodb_use_native_aio, 'ON', 'OFF') = VARIABLE_VALUE +1 +1 Expected +SELECT COUNT(@@GLOBAL.innodb_use_native_aio); +COUNT(@@GLOBAL.innodb_use_native_aio) +1 +1 Expected +SELECT COUNT(VARIABLE_VALUE) +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='innodb_use_native_aio'; +COUNT(VARIABLE_VALUE) +1 +1 Expected +'#---------------------BS_STVARS_035_04----------------------#' +SELECT @@innodb_use_native_aio = @@GLOBAL.innodb_use_native_aio; +@@innodb_use_native_aio = @@GLOBAL.innodb_use_native_aio +1 +1 Expected +'#---------------------BS_STVARS_035_05----------------------#' +SELECT COUNT(@@innodb_use_native_aio); +COUNT(@@innodb_use_native_aio) +1 +1 Expected +SELECT COUNT(@@local.innodb_use_native_aio); +ERROR HY000: Variable 'innodb_use_native_aio' is a GLOBAL variable +Expected error 'Variable is a GLOBAL variable' +SELECT COUNT(@@SESSION.innodb_use_native_aio); +ERROR HY000: Variable 'innodb_use_native_aio' is a GLOBAL variable +Expected error 'Variable is a GLOBAL variable' +SELECT COUNT(@@GLOBAL.innodb_use_native_aio); +COUNT(@@GLOBAL.innodb_use_native_aio) +1 +1 Expected +SELECT innodb_use_native_aio = @@SESSION.innodb_use_native_aio; +ERROR 42S22: Unknown column 'innodb_use_native_aio' in 'field list' +Expected error 'Readonly variable' diff --git a/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result b/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result index 5cb52734d21..b9ecef3e8cc 100644 --- a/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result +++ b/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result @@ -8,11 +8,15 @@ SELECT @start_session_value; 8388608 '#--------------------FN_DYNVARS_005_01-------------------------#' SET @@global.myisam_sort_buffer_size = 100; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '100' SET @@global.myisam_sort_buffer_size = DEFAULT; SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size 8388608 SET @@session.myisam_sort_buffer_size = 200; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '200' SET @@session.myisam_sort_buffer_size = DEFAULT; SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size @@ -28,9 +32,11 @@ SELECT @@session.myisam_sort_buffer_size = 8388608; 1 '#--------------------FN_DYNVARS_005_03-------------------------#' SET @@global.myisam_sort_buffer_size = 4; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '4' SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size -4 +4096 SET @@global.myisam_sort_buffer_size = 4294967295; SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size @@ -41,9 +47,11 @@ SELECT @@global.myisam_sort_buffer_size ; 655354 '#--------------------FN_DYNVARS_005_04-------------------------#' SET @@session.myisam_sort_buffer_size = 4; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '4' SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size -4 +4096 SET @@session.myisam_sort_buffer_size = 4294967295; SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size @@ -58,13 +66,13 @@ Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0' SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size -4 +4096 SET @@global.myisam_sort_buffer_size = -1024; Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '-1024' SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size -4 +4096 SET @@global.myisam_sort_buffer_size = 429496729533; Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '429496729533' @@ -101,28 +109,28 @@ Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0' SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size -4 +4096 SET @@session.myisam_sort_buffer_size = -2; Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '-2' SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size -4 +4096 SET @@session.myisam_sort_buffer_size = 65530.34; ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size -4 +4096 SET @@session.myisam_sort_buffer_size = test; ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size -4 +4096 SET @@session.myisam_sort_buffer_size = "test"; ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size -4 +4096 '#------------------FN_DYNVARS_005_06-----------------------#' SELECT @@global.myisam_sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES @@ -141,20 +149,24 @@ Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '1' SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size -4 +4096 SET @@global.myisam_sort_buffer_size = FALSE; Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0' SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size -4 +4096 '#---------------------FN_DYNVARS_001_09----------------------#' SET @@global.myisam_sort_buffer_size = 10; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '10' SELECT @@myisam_sort_buffer_size = @@global.myisam_sort_buffer_size ; @@myisam_sort_buffer_size = @@global.myisam_sort_buffer_size -0 +1 '#---------------------FN_DYNVARS_001_10----------------------#' SET @@myisam_sort_buffer_size = 100; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '100' SELECT @@myisam_sort_buffer_size = @@local.myisam_sort_buffer_size ; @@myisam_sort_buffer_size = @@local.myisam_sort_buffer_size 1 @@ -167,7 +179,7 @@ Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '1' SELECT @@myisam_sort_buffer_size ; @@myisam_sort_buffer_size -4 +4096 SELECT local.myisam_sort_buffer_size ; ERROR 42S02: Unknown table 'local' in field list SELECT session.myisam_sort_buffer_size ; diff --git a/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_64.result b/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_64.result index 2069b32fdcd..e6be3c28251 100644 --- a/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_64.result +++ b/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_64.result @@ -8,11 +8,15 @@ SELECT @start_session_value; 8388608 '#--------------------FN_DYNVARS_005_01-------------------------#' SET @@global.myisam_sort_buffer_size = 100; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '100' SET @@global.myisam_sort_buffer_size = DEFAULT; SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size 8388608 SET @@session.myisam_sort_buffer_size = 200; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '200' SET @@session.myisam_sort_buffer_size = DEFAULT; SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size @@ -28,9 +32,11 @@ SELECT @@session.myisam_sort_buffer_size = 8388608; 1 '#--------------------FN_DYNVARS_005_03-------------------------#' SET @@global.myisam_sort_buffer_size = 4; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '4' SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size -4 +4096 SET @@global.myisam_sort_buffer_size = 4294967295; SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size @@ -41,9 +47,11 @@ SELECT @@global.myisam_sort_buffer_size ; 655354 '#--------------------FN_DYNVARS_005_04-------------------------#' SET @@session.myisam_sort_buffer_size = 4; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '4' SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size -4 +4096 SET @@session.myisam_sort_buffer_size = 4294967295; SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size @@ -58,13 +66,13 @@ Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0' SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size -4 +4096 SET @@global.myisam_sort_buffer_size = -1024; Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '-1024' SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size -4 +4096 SET @@global.myisam_sort_buffer_size = 429496729533; SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size @@ -99,28 +107,28 @@ Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0' SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size -4 +4096 SET @@session.myisam_sort_buffer_size = -2; Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '-2' SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size -4 +4096 SET @@session.myisam_sort_buffer_size = 65530.34; ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size -4 +4096 SET @@session.myisam_sort_buffer_size = test; ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size -4 +4096 SET @@session.myisam_sort_buffer_size = "test"; ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size -4 +4096 '#------------------FN_DYNVARS_005_06-----------------------#' SELECT @@global.myisam_sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES @@ -139,20 +147,24 @@ Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '1' SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size -4 +4096 SET @@global.myisam_sort_buffer_size = FALSE; Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0' SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size -4 +4096 '#---------------------FN_DYNVARS_001_09----------------------#' SET @@global.myisam_sort_buffer_size = 10; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '10' SELECT @@myisam_sort_buffer_size = @@global.myisam_sort_buffer_size ; @@myisam_sort_buffer_size = @@global.myisam_sort_buffer_size -0 +1 '#---------------------FN_DYNVARS_001_10----------------------#' SET @@myisam_sort_buffer_size = 100; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '100' SELECT @@myisam_sort_buffer_size = @@local.myisam_sort_buffer_size ; @@myisam_sort_buffer_size = @@local.myisam_sort_buffer_size 1 @@ -165,7 +177,7 @@ Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '1' SELECT @@myisam_sort_buffer_size ; @@myisam_sort_buffer_size -4 +4096 SELECT local.myisam_sort_buffer_size ; ERROR 42S02: Unknown table 'local' in field list SELECT session.myisam_sort_buffer_size ; diff --git a/mysql-test/suite/sys_vars/r/secure_file_priv.result b/mysql-test/suite/sys_vars/r/secure_file_priv.result new file mode 100644 index 00000000000..eeeb9a58c0f --- /dev/null +++ b/mysql-test/suite/sys_vars/r/secure_file_priv.result @@ -0,0 +1,22 @@ +# +# Bug50373 --secure-file-priv="" +# +CREATE TABLE t1 (c1 VARCHAR(50)); +INSERT INTO t1 VALUES ("one"),("two"),("three"),("four"),("five"); +SHOW VARIABLES LIKE 'secure_file_priv'; +Variable_name Value +secure_file_priv +c1 +one +two +three +four +five +loaded_file +one +two +three +four +five + +DROP TABLE t1; diff --git a/mysql-test/suite/sys_vars/r/skip_name_resolve_basic.result b/mysql-test/suite/sys_vars/r/skip_name_resolve_basic.result new file mode 100644 index 00000000000..d22a39b32a0 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/skip_name_resolve_basic.result @@ -0,0 +1,23 @@ +SHOW VARIABLES LIKE 'skip_name_resolve'; +Variable_name Value +skip_name_resolve ON +SHOW GLOBAL VARIABLES LIKE 'skip_name_resolve'; +Variable_name Value +skip_name_resolve ON +SHOW SESSION VARIABLES LIKE 'skip_name_resolve'; +Variable_name Value +skip_name_resolve ON +SELECT @@skip_name_resolve; +@@skip_name_resolve +1 +SELECT @@LOCAL.skip_name_resolve; +ERROR HY000: Variable 'skip_name_resolve' is a GLOBAL variable +SELECT @@GLOBAL.skip_name_resolve; +@@GLOBAL.skip_name_resolve +1 +SET @@skip_name_resolve=0; +ERROR HY000: Variable 'skip_name_resolve' is a read only variable +SET @@LOCAL.skip_name_resolve=0; +ERROR HY000: Variable 'skip_name_resolve' is a read only variable +SET @@GLOBAL.skip_name_resolve=0; +ERROR HY000: Variable 'skip_name_resolve' is a read only variable diff --git a/mysql-test/suite/sys_vars/r/tx_isolation_func.result b/mysql-test/suite/sys_vars/r/tx_isolation_func.result index 2242525f14b..6b4c990c71c 100644 --- a/mysql-test/suite/sys_vars/r/tx_isolation_func.result +++ b/mysql-test/suite/sys_vars/r/tx_isolation_func.result @@ -95,10 +95,7 @@ a b 22 10 24 10 INSERT INTO t1 VALUES(23, 23); -ERROR HY000: Lock wait timeout exceeded; try restarting transaction INSERT INTO t1 VALUES(25, 25); -ERROR HY000: Lock wait timeout exceeded; try restarting transaction -Bug: Only even rows are being locked, error 1205 should'nt have occured SELECT * FROM t1; a b 2 10 @@ -109,7 +106,9 @@ a b 18 10 20 10 22 10 +23 23 24 10 +25 25 COMMIT; ** Connection con0 ** COMMIT; @@ -144,7 +143,9 @@ a b 18 10 20 10 22 10 +23 23 24 10 +25 25 INSERT INTO t1 VALUES(5, 5); INSERT INTO t1 VALUES(7, 7); SELECT * FROM t1; @@ -159,7 +160,9 @@ a b 18 10 20 10 22 10 +23 23 24 10 +25 25 COMMIT; ** Connection con0 ** COMMIT; @@ -196,7 +199,9 @@ a b 18 11 20 11 22 11 +23 23 24 11 +25 25 INSERT INTO t1 VALUES(9, 9); ERROR HY000: Lock wait timeout exceeded; try restarting transaction INSERT INTO t1 VALUES(13, 13); @@ -214,7 +219,9 @@ a b 18 11 20 11 22 11 +23 23 24 11 +25 25 COMMIT; ** Connection con0 ** COMMIT; @@ -225,6 +232,8 @@ SELECT * FROM t1 WHERE a IN (2,4,6,8,10,12,14,16,18,20,22,24,26) = 0 FOR UPDATE; a b 5 5 7 7 +23 23 +25 25 UPDATE t1 SET b = 13 WHERE a IN (2,4,6,8,10,12,14,16,18,20,22,24,26) = 0; ** Connection con1 ** START TRANSACTION; @@ -240,7 +249,9 @@ a b 18 12 20 12 22 12 +23 23 24 12 +25 25 INSERT INTO t1 VALUES(9, 9); ERROR HY000: Lock wait timeout exceeded; try restarting transaction INSERT INTO t1 VALUES(13, 13); @@ -258,7 +269,9 @@ a b 18 12 20 12 22 12 +23 23 24 12 +25 25 COMMIT; ** Connection con0 ** COMMIT; @@ -273,7 +286,9 @@ a b 18 12 20 12 22 12 +23 13 24 12 +25 13 UPDATE t1 SET b = 14 WHERE a IN (2,4,6,8) = 0; ** Connection con1 ** START TRANSACTION; @@ -289,7 +304,9 @@ a b 18 12 20 12 22 12 +23 13 24 12 +25 13 INSERT INTO t1 VALUES(9, 9); ERROR HY000: Lock wait timeout exceeded; try restarting transaction INSERT INTO t1 VALUES(13, 13); @@ -307,7 +324,9 @@ a b 18 12 20 12 22 12 +23 13 24 12 +25 13 COMMIT; ** Connection con0 ** COMMIT; diff --git a/mysql-test/suite/sys_vars/t/identity_func.test b/mysql-test/suite/sys_vars/t/identity_func.test index ff93607a2cd..6f7b6bac18e 100644 --- a/mysql-test/suite/sys_vars/t/identity_func.test +++ b/mysql-test/suite/sys_vars/t/identity_func.test @@ -1,3 +1,9 @@ +--source include/not_windows_embedded.inc +# remove this when +# Bug#53947 InnoDB: Assertion failure in thread 4224 in file +# .\sync\sync0sync.c line 324 +# is fixed + #################### mysql-test\t\identity_func.test ########################## # # # Variable Name: identity # diff --git a/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_func.test b/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_func.test index 89c1c80a6dc..082507efd07 100644 --- a/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_func.test +++ b/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_func.test @@ -1,3 +1,9 @@ +--source include/not_windows_embedded.inc +# remove this when +# Bug#53947 InnoDB: Assertion failure in thread 4224 in file +# .\sync\sync0sync.c line 324 +# is fixed + ################# mysql-test\t\innodb_autoinc_lock_mode_func.test ############ # # # Variable Name: innodb_autoinc_lock_mode # diff --git a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_instances_basic.test b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_instances_basic.test new file mode 100644 index 00000000000..0960f1fb38b --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_instances_basic.test @@ -0,0 +1,103 @@ + + +################## mysql-test\t\innodb_buffer_pool_instances_basic.test ####### +# # +# Variable Name: innodb_buffer_pool_instances # +# Scope: Global # +# Access Type: Static # +# Data Type: numeric # +# # +# # +# Creation Date: 2008-02-07 # +# Author : Sharique Abdullah # +# # +# # +# Description:Test Cases of Dynamic System Variable # +# innodb_buffer_pool_instances # +# that checks the behavior of this variable in the following ways # +# * Value Check # +# * Scope Check # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +############################################################################### + +--source include/have_innodb.inc + +--echo '#---------------------BS_STVARS_035_01----------------------#' +#################################################################### +# Displaying default value # +#################################################################### +SELECT COUNT(@@GLOBAL.innodb_buffer_pool_instances); +--echo 1 Expected + + +--echo '#---------------------BS_STVARS_035_02----------------------#' +#################################################################### +# Check if Value can set # +#################################################################### + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +SET @@GLOBAL.innodb_buffer_pool_instances=1; +--echo Expected error 'Read only variable' + +SELECT COUNT(@@GLOBAL.innodb_buffer_pool_instances); +--echo 1 Expected + + + + +--echo '#---------------------BS_STVARS_035_03----------------------#' +################################################################# +# Check if the value in GLOBAL Table matches value in variable # +################################################################# + +SELECT @@GLOBAL.innodb_buffer_pool_instances = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='innodb_buffer_pool_instances'; +--echo 1 Expected + +SELECT COUNT(@@GLOBAL.innodb_buffer_pool_instances); +--echo 1 Expected + +SELECT COUNT(VARIABLE_VALUE) +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='innodb_buffer_pool_instances'; +--echo 1 Expected + + + +--echo '#---------------------BS_STVARS_035_04----------------------#' +################################################################################ +# Check if accessing variable with and without GLOBAL point to same variable # +################################################################################ +SELECT @@innodb_buffer_pool_instances = @@GLOBAL.innodb_buffer_pool_instances; +--echo 1 Expected + + + +--echo '#---------------------BS_STVARS_035_05----------------------#' +################################################################################ +# Check if innodb_buffer_pool_instances can be accessed with and without @@ sign # +################################################################################ + +SELECT COUNT(@@innodb_buffer_pool_instances); +--echo 1 Expected + +--Error ER_INCORRECT_GLOBAL_LOCAL_VAR +SELECT COUNT(@@local.innodb_buffer_pool_instances); +--echo Expected error 'Variable is a GLOBAL variable' + +--Error ER_INCORRECT_GLOBAL_LOCAL_VAR +SELECT COUNT(@@SESSION.innodb_buffer_pool_instances); +--echo Expected error 'Variable is a GLOBAL variable' + +SELECT COUNT(@@GLOBAL.innodb_buffer_pool_instances); +--echo 1 Expected + +--Error ER_BAD_FIELD_ERROR +SELECT innodb_buffer_pool_instances = @@SESSION.innodb_buffer_pool_instances; +--echo Expected error 'Readonly variable' + + diff --git a/mysql-test/suite/sys_vars/t/innodb_change_buffering_basic.test b/mysql-test/suite/sys_vars/t/innodb_change_buffering_basic.test index 65e36aa9cb3..abdfddb4c4b 100644 --- a/mysql-test/suite/sys_vars/t/innodb_change_buffering_basic.test +++ b/mysql-test/suite/sys_vars/t/innodb_change_buffering_basic.test @@ -11,8 +11,8 @@ SELECT @start_global_value; # # exists as global only # ---echo Valid values are 'inserts' and 'none' -select @@global.innodb_change_buffering in ('inserts', 'none'); +--echo Valid values are 'all', 'deletes', 'changes', 'inserts', 'none', 'purges' +select @@global.innodb_change_buffering in ('all', 'deletes', 'changes', 'inserts', 'none', 'purges'); select @@global.innodb_change_buffering; --error ER_INCORRECT_GLOBAL_LOCAL_VAR select @@session.innodb_change_buffering; diff --git a/mysql-test/suite/sys_vars/t/innodb_purge_batch_size_basic.test b/mysql-test/suite/sys_vars/t/innodb_purge_batch_size_basic.test new file mode 100644 index 00000000000..88271d26965 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_purge_batch_size_basic.test @@ -0,0 +1,142 @@ +################# mysql-test\t\innodb_purge_batch_size_basic.test ############# +# # +# Variable Name: innodb_purge_batch_size # +# Scope: GLOBAL # +# Access Type: Dynamic # +# Data Type: Numeric # +# Default Value: 20 # +# Range: 0-4294967295 # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Rizwan # +# # +#Description:Test Cases of Dynamic System Variable innodb_purge_batch_size # +# that checks the behavior of this variable in the following ways # +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +############################################################################### + +--source include/have_innodb.inc +--source include/load_sysvars.inc + +######################################################################## +# START OF innodb_purge_batch_size TESTS # +######################################################################## + + +############################################################################ +# Saving initial value of innodb_purge_batch_size in a temporary variable # +############################################################################ + +SET @global_start_value = @@global.innodb_purge_batch_size; +SELECT @global_start_value; + +--echo '#--------------------FN_DYNVARS_046_01------------------------#' +######################################################################## +# Display the DEFAULT value of innodb_purge_batch_size # +######################################################################## + +SET @@global.innodb_purge_batch_size = 1; +SET @@global.innodb_purge_batch_size = DEFAULT; +SELECT @@global.innodb_purge_batch_size; + +--echo '#---------------------FN_DYNVARS_046_02-------------------------#' +############################################################################## +# Check if innodb_purge_batch_size can be accessed with and without @@ sign # +############################################################################## + +--Error ER_GLOBAL_VARIABLE +SET innodb_purge_batch_size = 1; +SELECT @@innodb_purge_batch_size; + +--Error ER_UNKNOWN_TABLE +SELECT local.innodb_purge_batch_size; + +SET global innodb_purge_batch_size = 1; +SELECT @@global.innodb_purge_batch_size; + +--echo '#--------------------FN_DYNVARS_046_03------------------------#' +########################################################################## +# change the value of innodb_purge_batch_size to a valid value # +########################################################################## + +SET @@global.innodb_purge_batch_size = 1; +SELECT @@global.innodb_purge_batch_size; + +SET @@global.innodb_purge_batch_size = 5000; +SELECT @@global.innodb_purge_batch_size; +SET @@global.innodb_purge_batch_size = 1000; +SELECT @@global.innodb_purge_batch_size; + +--echo '#--------------------FN_DYNVARS_046_04-------------------------#' +########################################################################### +# Change the value of innodb_purge_batch_size to invalid value # +########################################################################### + +SET @@global.innodb_purge_batch_size = 0; +SELECT @@global.innodb_purge_batch_size; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.innodb_purge_batch_size = "T"; +SELECT @@global.innodb_purge_batch_size; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.innodb_purge_batch_size = "Y"; +SELECT @@global.innodb_purge_batch_size; + +SET @@global.innodb_purge_batch_size = 5001; +SELECT @@global.innodb_purge_batch_size; + +--echo '#----------------------FN_DYNVARS_046_05------------------------#' +######################################################################### +# Check if the value in GLOBAL Table matches value in variable # +######################################################################### + +SELECT @@global.innodb_purge_batch_size = + VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES + WHERE VARIABLE_NAME='innodb_purge_batch_size'; +SELECT @@global.innodb_purge_batch_size; +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES + WHERE VARIABLE_NAME='innodb_purge_batch_size'; + +--echo '#---------------------FN_DYNVARS_046_06-------------------------#' +################################################################### +# Check if ON and OFF values can be used on variable # +################################################################### + +--ERROR ER_WRONG_TYPE_FOR_VAR +SET @@global.innodb_purge_batch_size = OFF; +SELECT @@global.innodb_purge_batch_size; + +--ERROR ER_WRONG_TYPE_FOR_VAR +SET @@global.innodb_purge_batch_size = ON; +SELECT @@global.innodb_purge_batch_size; + +--echo '#---------------------FN_DYNVARS_046_07----------------------#' +################################################################### +# Check if TRUE and FALSE values can be used on variable # +################################################################### + + +SET @@global.innodb_purge_batch_size = TRUE; +SELECT @@global.innodb_purge_batch_size; +SET @@global.innodb_purge_batch_size = FALSE; +SELECT @@global.innodb_purge_batch_size; + +############################## +# Restore initial value # +############################## + +SET @@global.innodb_purge_batch_size = @global_start_value; +SELECT @@global.innodb_purge_batch_size; + +############################################################### +# END OF innodb_purge_batch_size TESTS # +############################################################### diff --git a/mysql-test/suite/sys_vars/t/innodb_purge_threads_basic.test b/mysql-test/suite/sys_vars/t/innodb_purge_threads_basic.test new file mode 100644 index 00000000000..64d834c6344 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_purge_threads_basic.test @@ -0,0 +1,102 @@ + + +################## mysql-test\t\innodb_log_purge_threads_basic.test ########### +# # +# Variable Name: innodb_purge_threads # +# Scope: Global # +# Access Type: Static # +# Data Type: numeric # +# # +# # +# Creation Date: 2008-02-07 # +# Author : Sharique Abdullah # +# # +# # +# Description:Test Cases of Dynamic System Variable innodb_purge_threads # +# that checks the behavior of this variable in the following ways # +# * Value Check # +# * Scope Check # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +############################################################################### + +--source include/have_innodb.inc + +--echo '#---------------------BS_STVARS_035_01----------------------#' +#################################################################### +# Displaying default value # +#################################################################### +SELECT COUNT(@@GLOBAL.innodb_purge_threads); +--echo 1 Expected + + +--echo '#---------------------BS_STVARS_035_02----------------------#' +#################################################################### +# Check if Value can set # +#################################################################### + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +SET @@GLOBAL.innodb_purge_threads=1; +--echo Expected error 'Read only variable' + +SELECT COUNT(@@GLOBAL.innodb_purge_threads); +--echo 1 Expected + + + + +--echo '#---------------------BS_STVARS_035_03----------------------#' +################################################################# +# Check if the value in GLOBAL Table matches value in variable # +################################################################# + +SELECT @@GLOBAL.innodb_purge_threads = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='innodb_purge_threads'; +--echo 1 Expected + +SELECT COUNT(@@GLOBAL.innodb_purge_threads); +--echo 1 Expected + +SELECT COUNT(VARIABLE_VALUE) +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='innodb_purge_threads'; +--echo 1 Expected + + + +--echo '#---------------------BS_STVARS_035_04----------------------#' +################################################################################ +# Check if accessing variable with and without GLOBAL point to same variable # +################################################################################ +SELECT @@innodb_purge_threads = @@GLOBAL.innodb_purge_threads; +--echo 1 Expected + + + +--echo '#---------------------BS_STVARS_035_05----------------------#' +################################################################################ +# Check if innodb_purge_threads can be accessed with and without @@ sign # +################################################################################ + +SELECT COUNT(@@innodb_purge_threads); +--echo 1 Expected + +--Error ER_INCORRECT_GLOBAL_LOCAL_VAR +SELECT COUNT(@@local.innodb_purge_threads); +--echo Expected error 'Variable is a GLOBAL variable' + +--Error ER_INCORRECT_GLOBAL_LOCAL_VAR +SELECT COUNT(@@SESSION.innodb_purge_threads); +--echo Expected error 'Variable is a GLOBAL variable' + +SELECT COUNT(@@GLOBAL.innodb_purge_threads); +--echo 1 Expected + +--Error ER_BAD_FIELD_ERROR +SELECT innodb_purge_threads = @@SESSION.innodb_purge_threads; +--echo Expected error 'Readonly variable' + + diff --git a/mysql-test/suite/sys_vars/t/innodb_use_native_aio_basic.test b/mysql-test/suite/sys_vars/t/innodb_use_native_aio_basic.test new file mode 100644 index 00000000000..37879530d75 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_use_native_aio_basic.test @@ -0,0 +1,102 @@ + + +################## mysql-test\t\innodb_use_native_aio_basic.test ############## +# # +# Variable Name: innodb_use_native_aio # +# Scope: Global # +# Access Type: Static # +# Data Type: numeric # +# # +# # +# Creation Date: 2008-02-07 # +# Author : Sharique Abdullah # +# # +# # +# Description:Test Cases of Dynamic System Variable innodb_use_native_aio # +# that checks the behavior of this variable in the following ways # +# * Value Check # +# * Scope Check # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +############################################################################### + +--source include/have_innodb.inc + +--echo '#---------------------BS_STVARS_035_01----------------------#' +#################################################################### +# Displaying default value # +#################################################################### +SELECT COUNT(@@GLOBAL.innodb_use_native_aio); +--echo 1 Expected + + +--echo '#---------------------BS_STVARS_035_02----------------------#' +#################################################################### +# Check if Value can set # +#################################################################### + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +SET @@GLOBAL.innodb_use_native_aio=1; +--echo Expected error 'Read only variable' + +SELECT COUNT(@@GLOBAL.innodb_use_native_aio); +--echo 1 Expected + + + + +--echo '#---------------------BS_STVARS_035_03----------------------#' +################################################################# +# Check if the value in GLOBAL Table matches value in variable # +################################################################# + +SELECT IF(@@GLOBAL.innodb_use_native_aio, 'ON', 'OFF') = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='innodb_use_native_aio'; +--echo 1 Expected + +SELECT COUNT(@@GLOBAL.innodb_use_native_aio); +--echo 1 Expected + +SELECT COUNT(VARIABLE_VALUE) +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='innodb_use_native_aio'; +--echo 1 Expected + + + +--echo '#---------------------BS_STVARS_035_04----------------------#' +################################################################################ +# Check if accessing variable with and without GLOBAL point to same variable # +################################################################################ +SELECT @@innodb_use_native_aio = @@GLOBAL.innodb_use_native_aio; +--echo 1 Expected + + + +--echo '#---------------------BS_STVARS_035_05----------------------#' +################################################################################ +# Check if innodb_log_file_size can be accessed with and without @@ sign # +################################################################################ + +SELECT COUNT(@@innodb_use_native_aio); +--echo 1 Expected + +--Error ER_INCORRECT_GLOBAL_LOCAL_VAR +SELECT COUNT(@@local.innodb_use_native_aio); +--echo Expected error 'Variable is a GLOBAL variable' + +--Error ER_INCORRECT_GLOBAL_LOCAL_VAR +SELECT COUNT(@@SESSION.innodb_use_native_aio); +--echo Expected error 'Variable is a GLOBAL variable' + +SELECT COUNT(@@GLOBAL.innodb_use_native_aio); +--echo 1 Expected + +--Error ER_BAD_FIELD_ERROR +SELECT innodb_use_native_aio = @@SESSION.innodb_use_native_aio; +--echo Expected error 'Readonly variable' + + diff --git a/mysql-test/suite/sys_vars/t/last_insert_id_func.test b/mysql-test/suite/sys_vars/t/last_insert_id_func.test index 2309c539bd9..bb3adbc1c64 100644 --- a/mysql-test/suite/sys_vars/t/last_insert_id_func.test +++ b/mysql-test/suite/sys_vars/t/last_insert_id_func.test @@ -1,3 +1,9 @@ +--source include/not_windows_embedded.inc +# remove this when +# Bug#53947 InnoDB: Assertion failure in thread 4224 in file +# .\sync\sync0sync.c line 324 +# is fixed + ################# mysql-test\t\last_insert_id_func.test ####################### # # # Variable Name: last_insert_id # diff --git a/mysql-test/suite/sys_vars/t/secure_file_priv-master.opt b/mysql-test/suite/sys_vars/t/secure_file_priv-master.opt new file mode 100644 index 00000000000..b41d9b04b96 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/secure_file_priv-master.opt @@ -0,0 +1 @@ +--secure_file_priv='' diff --git a/mysql-test/suite/sys_vars/t/secure_file_priv.test b/mysql-test/suite/sys_vars/t/secure_file_priv.test new file mode 100644 index 00000000000..7a534e7d6e4 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/secure_file_priv.test @@ -0,0 +1,21 @@ +--echo # +--echo # Bug50373 --secure-file-priv="" +--echo # +CREATE TABLE t1 (c1 VARCHAR(50)); +INSERT INTO t1 VALUES ("one"),("two"),("three"),("four"),("five"); +SHOW VARIABLES LIKE 'secure_file_priv'; +--disable_query_log +# Atempt to create a file where we normally aren't allowed to create one. +# Doing this in a portable manner is difficult but we should be able to +# count on the depth of the directory hierarchy used. Three steps up from +# the datadir is the 'mysql_test' directory. +--let $PROTECTED_FILE=`SELECT concat(@@datadir,'/../../../bug50373.txt')`; +--eval SELECT * FROM t1 INTO OUTFILE '$PROTECTED_FILE'; +DELETE FROM t1; +--eval LOAD DATA INFILE '$PROTECTED_FILE' INTO TABLE t1; +SELECT * FROM t1; +--eval SELECT load_file('$PROTECTED_FILE') AS loaded_file; +--enable_query_log +remove_file $PROTECTED_FILE; +DROP TABLE t1; + diff --git a/mysql-test/suite/sys_vars/t/secure_file_priv_basic.test b/mysql-test/suite/sys_vars/t/secure_file_priv_basic.test index fee18e441d1..836990cb70e 100644 --- a/mysql-test/suite/sys_vars/t/secure_file_priv_basic.test +++ b/mysql-test/suite/sys_vars/t/secure_file_priv_basic.test @@ -1,3 +1,5 @@ +--source include/not_var_link.inc + # # only global # diff --git a/mysql-test/suite/sys_vars/t/skip_name_resolve_basic-master.opt b/mysql-test/suite/sys_vars/t/skip_name_resolve_basic-master.opt new file mode 100644 index 00000000000..ab6ca1731f5 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/skip_name_resolve_basic-master.opt @@ -0,0 +1 @@ +--skip-name-resolve diff --git a/mysql-test/suite/sys_vars/t/skip_name_resolve_basic.test b/mysql-test/suite/sys_vars/t/skip_name_resolve_basic.test new file mode 100644 index 00000000000..69006a0f2b2 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/skip_name_resolve_basic.test @@ -0,0 +1,15 @@ +SHOW VARIABLES LIKE 'skip_name_resolve'; +SHOW GLOBAL VARIABLES LIKE 'skip_name_resolve'; +SHOW SESSION VARIABLES LIKE 'skip_name_resolve'; + +SELECT @@skip_name_resolve; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +SELECT @@LOCAL.skip_name_resolve; +SELECT @@GLOBAL.skip_name_resolve; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +SET @@skip_name_resolve=0; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +SET @@LOCAL.skip_name_resolve=0; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +SET @@GLOBAL.skip_name_resolve=0; diff --git a/mysql-test/suite/sys_vars/t/storage_engine_basic.test b/mysql-test/suite/sys_vars/t/storage_engine_basic.test index e62390cb384..7ec071e6414 100644 --- a/mysql-test/suite/sys_vars/t/storage_engine_basic.test +++ b/mysql-test/suite/sys_vars/t/storage_engine_basic.test @@ -1,3 +1,9 @@ +--source include/not_windows_embedded.inc +# remove this when +# Bug#53947 InnoDB: Assertion failure in thread 4224 in file +# .\sync\sync0sync.c line 324 +# is fixed + ############## mysql-test\t\storage_engine_basic.test ################## # # # # diff --git a/mysql-test/suite/sys_vars/t/tx_isolation_func.test b/mysql-test/suite/sys_vars/t/tx_isolation_func.test index 1fd2e323db8..3a78d46e527 100644 --- a/mysql-test/suite/sys_vars/t/tx_isolation_func.test +++ b/mysql-test/suite/sys_vars/t/tx_isolation_func.test @@ -1,3 +1,9 @@ +--source include/not_windows_embedded.inc +# remove this when +# Bug#53947 InnoDB: Assertion failure in thread 4224 in file +# .\sync\sync0sync.c line 324 +# is fixed + ############# mysql-test\t\tx_isolation_func.test ####################################### # # # Variable Name: tx_isolation # @@ -134,12 +140,9 @@ START TRANSACTION; SELECT * FROM t1; ---error ER_LOCK_WAIT_TIMEOUT INSERT INTO t1 VALUES(23, 23); ---error ER_LOCK_WAIT_TIMEOUT INSERT INTO t1 VALUES(25, 25); ---echo Bug: Only even rows are being locked, error 1205 should'nt have occured SELECT * FROM t1; |