include/master-slave.inc
Warnings:
Note	####	Sending passwords in plain text without SSL/TLS is extremely insecure.
Note	####	Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
CALL mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.');
CALL mtr.add_suppression('Cannot execute statement because it needs to be written to the binary log as multiple statements');
CALL mtr.add_suppression('DROP DATABASE failed; some tables may have been dropped but the database directory remains.');
CALL mtr.add_suppression("Error dropping database");
CALL mtr.add_suppression("Can't drop database '.*'; database doesn't exist");
CALL mtr.add_suppression("Slave SQL for channel '': ... The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state. .* Error_code: 1756");
==== Case 1: CALL is split on master ====
---- Initialize ----
CREATE TABLE t (a INT);
CREATE PROCEDURE proc ()
BEGIN
INSERT INTO t VALUES (1);
INSERT INTO t VALUES (2);
END|
---- GTID_NEXT=AUTOMATIC ----
include/gtid_step_reset.inc
CALL proc();
include/gtid_step_assert.inc [count=2, only_count=0]
include/assert.inc [Both rows were inserted]
DELETE FROM t;
---- GTID_NEXT=non-automatic ----
include/gtid_step_reset.inc
SET GTID_NEXT = '#';
CALL proc();
ERROR HY000: When @@SESSION.GTID_NEXT is set to a GTID, you must explicitly set it to a different value after a COMMIT or ROLLBACK. Please check GTID_NEXT variable manual page for detailed explanation. Current @@SESSION.GTID_NEXT is 'MASTER_UUID:9'.
SET GTID_NEXT= 'AUTOMATIC';
include/gtid_step_assert.inc [count=1, only_count=0]
include/assert.inc [One row inserted if GTID_MODE=ON, two if GTID_MODE=OFF]
DROP TABLE t;
DROP PROCEDURE proc;
==== Case 2A: DROP TABLE is split on master ====
---- Initialize ----
CREATE PROCEDURE create_tables()
BEGIN
CREATE TABLE base (a INT) ENGINE = InnoDB;
CREATE TEMPORARY TABLE temp_t (a INT) ENGINE = InnoDB;
CREATE TEMPORARY TABLE temp_n (a INT) ENGINE = MyISAM;
END|
CREATE PROCEDURE drop_tables()
BEGIN
DROP TABLE IF EXISTS base;
DROP TABLE IF EXISTS temp_t;
DROP TABLE IF EXISTS temp_n;
END|
include/rpl_sync.inc
---- GTID_MODE=AUTOMATIC ----
CALL create_tables();
include/gtid_step_reset.inc
DROP TABLE base, temp_t;
include/gtid_step_assert.inc [count=2, only_count=0]
include/assert_binlog_events.inc
DROP TABLE temp_n;
include/rpl_sync.inc
include/rpl_reset.inc
CALL create_tables();
include/gtid_step_reset.inc
DROP TABLE base, temp_n;
include/gtid_step_assert.inc [count=2, only_count=0]
include/assert_binlog_events.inc
DROP TABLE temp_t;
include/rpl_sync.inc
include/rpl_reset.inc
CALL create_tables();
include/gtid_step_reset.inc
DROP TABLE temp_t, temp_n;
include/gtid_step_assert.inc [count=2, only_count=0]
include/assert_binlog_events.inc
DROP TABLE base;
include/rpl_sync.inc
include/rpl_reset.inc
CALL create_tables();
include/gtid_step_reset.inc
DROP TABLE base, temp_t, temp_n;
include/gtid_step_assert.inc [count=3, only_count=0]
include/assert_binlog_events.inc
include/rpl_sync.inc
include/rpl_reset.inc
---- GTID_MODE=non-automatic ----
CALL create_tables();
include/gtid_step_reset.inc
SET GTID_NEXT = '#';
DROP TABLE base, temp_t;
ERROR HY000: Cannot execute statement because it needs to be written to the binary log as multiple statements, and this is not allowed when @@SESSION.GTID_NEXT == 'UUID:NUMBER'.
SET GTID_NEXT = 'AUTOMATIC';
include/gtid_step_assert.inc [count=0, only_count=0]
include/assert_binlog_events.inc
DROP TABLE temp_n;
DROP TABLE base, temp_t;
include/rpl_sync.inc
include/rpl_reset.inc
CALL create_tables();
include/gtid_step_reset.inc
SET GTID_NEXT = '#';
DROP TABLE base, temp_n;
ERROR HY000: Cannot execute statement because it needs to be written to the binary log as multiple statements, and this is not allowed when @@SESSION.GTID_NEXT == 'UUID:NUMBER'.
SET GTID_NEXT = 'AUTOMATIC';
include/gtid_step_assert.inc [count=0, only_count=0]
include/assert_binlog_events.inc
DROP TABLE temp_t;
DROP TABLE base, temp_n;
include/rpl_sync.inc
include/rpl_reset.inc
CALL create_tables();
include/gtid_step_reset.inc
SET GTID_NEXT = '#';
DROP TABLE temp_t, temp_n;
ERROR HY000: Cannot execute statement because it needs to be written to the binary log as multiple statements, and this is not allowed when @@SESSION.GTID_NEXT == 'UUID:NUMBER'.
SET GTID_NEXT = 'AUTOMATIC';
include/gtid_step_assert.inc [count=0, only_count=0]
include/assert_binlog_events.inc
DROP TABLE base;
DROP TABLE temp_t, temp_n;
include/rpl_sync.inc
include/rpl_reset.inc
CALL create_tables();
include/gtid_step_reset.inc
SET GTID_NEXT = '#';
DROP TABLE base, temp_t, temp_n;
ERROR HY000: Cannot execute statement because it needs to be written to the binary log as multiple statements, and this is not allowed when @@SESSION.GTID_NEXT == 'UUID:NUMBER'.
SET GTID_NEXT = 'AUTOMATIC';
include/gtid_step_assert.inc [count=0, only_count=0]
include/assert_binlog_events.inc
DROP TABLE base, temp_t, temp_n;
include/rpl_sync.inc
include/rpl_reset.inc
==== Case 2B: DROP TABLE is split on slave ====
---- Initialize ----
CREATE TABLE dummy (a INT);
DROP PROCEDURE create_tables;
CREATE FUNCTION create_tables_func() RETURNS INT
BEGIN
IF @@GLOBAL.SERVER_ID = 2 THEN
CREATE TEMPORARY TABLE temp_t (a INT) ENGINE = InnoDB;
CREATE TEMPORARY TABLE temp_n (a INT) ENGINE = MyISAM;
END IF;
RETURN 0;
END|
CREATE PROCEDURE create_tables()
BEGIN
CREATE TABLE base (a INT);
SET @@SESSION.SQL_LOG_BIN = 0;
CREATE TABLE temp_t (a INT);
CREATE TABLE temp_n (a INT);
SET @@SESSION.SQL_LOG_BIN = 1;
INSERT INTO dummy VALUES (create_tables_func());
END|
include/rpl_sync.inc
---- GTID_MODE=AUTOMATIC ----
CALL create_tables();
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 variable that may have a different value on the slave.
include/gtid_step_reset.inc
DROP TABLE base, temp_t;
include/gtid_step_assert.inc [count=1, only_count=0]
include/assert_binlog_events.inc
include/wait_for_slave_sql_error.inc [errno=1884]
include/include/rpl_skip_to_end_of_relay_log.inc
include/stop_slave.inc
Warnings:
Warning	3022	This operation may not be safe when the slave has temporary tables. The tables will be kept open until the server restarts or until the tables are deleted by any replicated DROP statement. Suggest to wait until slave_open_temp_tables = 0.
RESET SLAVE;
include/start_slave.inc
DROP TABLE base;
DROP TABLE IF EXISTS base, temp_t, temp_n;
Warnings:
Note	1051	Unknown table 'test.base'
Note	1051	Unknown table 'test.temp_t'
include/rpl_sync.inc
include/rpl_reset.inc
CALL create_tables();
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 variable that may have a different value on the slave.
include/gtid_step_reset.inc
DROP TABLE base, temp_n;
include/gtid_step_assert.inc [count=1, only_count=0]
include/assert_binlog_events.inc
include/wait_for_slave_sql_error.inc [errno=1884]
include/include/rpl_skip_to_end_of_relay_log.inc
include/stop_slave.inc
Warnings:
Warning	3022	This operation may not be safe when the slave has temporary tables. The tables will be kept open until the server restarts or until the tables are deleted by any replicated DROP statement. Suggest to wait until slave_open_temp_tables = 0.
RESET SLAVE;
include/start_slave.inc
DROP TABLE base;
DROP TABLE IF EXISTS base, temp_t, temp_n;
Warnings:
Note	1051	Unknown table 'test.base'
Note	1051	Unknown table 'test.temp_n'
include/rpl_sync.inc
include/rpl_reset.inc
CALL create_tables();
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 variable that may have a different value on the slave.
include/gtid_step_reset.inc
DROP TABLE temp_t, temp_n;
include/gtid_step_assert.inc [count=1, only_count=0]
include/assert_binlog_events.inc
include/wait_for_slave_sql_error.inc [errno=1884]
include/include/rpl_skip_to_end_of_relay_log.inc
include/stop_slave.inc
Warnings:
Warning	3022	This operation may not be safe when the slave has temporary tables. The tables will be kept open until the server restarts or until the tables are deleted by any replicated DROP statement. Suggest to wait until slave_open_temp_tables = 0.
RESET SLAVE;
include/start_slave.inc
DROP TABLE IF EXISTS base, temp_t, temp_n;
Warnings:
Note	1051	Unknown table 'test.temp_t'
Note	1051	Unknown table 'test.temp_n'
include/rpl_sync.inc
include/rpl_reset.inc
CALL create_tables();
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 variable that may have a different value on the slave.
include/gtid_step_reset.inc
DROP TABLE base, temp_t, temp_n;
include/gtid_step_assert.inc [count=1, only_count=0]
include/assert_binlog_events.inc
include/wait_for_slave_sql_error.inc [errno=1884]
include/include/rpl_skip_to_end_of_relay_log.inc
include/stop_slave.inc
Warnings:
Warning	3022	This operation may not be safe when the slave has temporary tables. The tables will be kept open until the server restarts or until the tables are deleted by any replicated DROP statement. Suggest to wait until slave_open_temp_tables = 0.
RESET SLAVE;
include/start_slave.inc
DROP TABLE base;
DROP TABLE IF EXISTS base, temp_t, temp_n;
Warnings:
Note	1051	Unknown table 'test.base'
Note	1051	Unknown table 'test.temp_t'
Note	1051	Unknown table 'test.temp_n'
include/rpl_sync.inc
include/rpl_reset.inc
---- Clean up ----
DROP FUNCTION create_tables_func;
DROP PROCEDURE create_tables;
DROP PROCEDURE drop_tables;
DROP TABLE dummy;
==== Case 3: DROP DATABASE ====
---- Initialize ----
# db1, db2, db3: no tables.
CREATE DATABASE db1;
CREATE DATABASE db2;
CREATE DATABASE db3;
include/rpl_sync.inc
# db4, db5, db6: one table.
CREATE DATABASE db4;
CREATE DATABASE db5;
CREATE DATABASE db6;
CREATE TABLE db4.t1 (a INT);
CREATE TABLE db5.t1 (a INT);
CREATE TABLE db6.t1 (a INT);
include/rpl_sync.inc
# db7, db8, db9: many tables with long names.
CREATE DATABASE db7;
CREATE DATABASE db8;
CREATE DATABASE db9;
include/rpl_sync.inc
# db10, db11, db12: not a database, but the directory exists.
# db13, db14, db15: not a database. db15 is a database on master.
include/rpl_sync.inc
---- DROP DATABASE is split on master; GTID_NEXT=AUTOMATIC ----
# db1: no table.
include/save_binlog_position.inc
SET GTID_NEXT = 'AUTOMATIC';
DROP DATABASE db1;
ERROR HY000: Error dropping database (can't rmdir './db1/', errno: 17)
include/assert_binlog_events.inc
# db4: one table.
include/save_binlog_position.inc
SET GTID_NEXT = 'AUTOMATIC';
DROP DATABASE db4;
ERROR HY000: Error dropping database (can't rmdir './db4/', errno: 17)
include/assert_binlog_events.inc
# db7: many tables with long names.
include/save_binlog_position.inc
SET GTID_NEXT = 'AUTOMATIC';
DROP DATABASE db7;
ERROR HY000: Error dropping database (can't rmdir './db7/', errno: 17)
include/assert_binlog_events.inc
# db10: not a database, but directory exists.
include/save_binlog_position.inc
SET GTID_NEXT = 'AUTOMATIC';
DROP DATABASE db10;
ERROR HY000: Error dropping database (can't rmdir './db10/', errno: 17)
include/assert_binlog_events.inc
# db13: not a database.
include/save_binlog_position.inc
SET GTID_NEXT = 'AUTOMATIC';
DROP DATABASE db13;
ERROR HY000: Can't drop database 'db13'; database doesn't exist
include/assert_binlog_events.inc
---- DROP DATABASE is split on master; GTID_NEXT=non-automatic ----
# db2: no table.
include/save_binlog_position.inc
SET GTID_NEXT = '#';
DROP DATABASE db2;
ERROR HY000: DROP DATABASE failed; some tables may have been dropped but the database directory remains. The GTID has not been added to GTID_EXECUTED and the statement was not written to the binary log. Fix this as follows: (1) remove all files from the database directory ./db2/; (2) SET GTID_NEXT='MASTER_UUID:80'; (3) DROP DATABASE `db2`.
include/assert_binlog_events.inc
SET GTID_NEXT = 'AUTOMATIC';
# db5: one table.
include/save_binlog_position.inc
SET GTID_NEXT = '#';
DROP DATABASE db5;
ERROR HY000: DROP DATABASE failed; some tables may have been dropped but the database directory remains. The GTID has not been added to GTID_EXECUTED and the statement was not written to the binary log. Fix this as follows: (1) remove all files from the database directory ./db5/; (2) SET GTID_NEXT='MASTER_UUID:80'; (3) DROP DATABASE `db5`.
include/assert_binlog_events.inc
SET GTID_NEXT = 'AUTOMATIC';
# db8: many tables with long names.
include/save_binlog_position.inc
SET GTID_NEXT = '#';
DROP DATABASE db8;
ERROR HY000: DROP DATABASE failed; some tables may have been dropped but the database directory remains. The GTID has not been added to GTID_EXECUTED and the statement was not written to the binary log. Fix this as follows: (1) remove all files from the database directory ./db8/; (2) SET GTID_NEXT='MASTER_UUID:80'; (3) DROP DATABASE `db8`.
include/assert_binlog_events.inc
SET GTID_NEXT = 'AUTOMATIC';
# db11: not a database, but directory exists.
include/save_binlog_position.inc
SET GTID_NEXT = '#';
DROP DATABASE db11;
ERROR HY000: DROP DATABASE failed; some tables may have been dropped but the database directory remains. The GTID has not been added to GTID_EXECUTED and the statement was not written to the binary log. Fix this as follows: (1) remove all files from the database directory ./db11/; (2) SET GTID_NEXT='MASTER_UUID:80'; (3) DROP DATABASE `db11`.
include/assert_binlog_events.inc
SET GTID_NEXT = 'AUTOMATIC';
# db14: not a database.
include/save_binlog_position.inc
SET GTID_NEXT = '#';
DROP DATABASE db14;
ERROR HY000: Can't drop database 'db14'; database doesn't exist
include/assert_binlog_events.inc
SET GTID_NEXT = 'AUTOMATIC';
---- DROP DATABASE is split on slave ----
SET GTID_NEXT = 'AUTOMATIC';
# db3: no table.
DROP DATABASE db3;
include/sync_slave_io_with_master.inc
include/wait_for_slave_sql_error.inc [errno=3091]
include/include/rpl_skip_to_end_of_relay_log.inc
[connection master]
# db6: one table.
DROP DATABASE db6;
include/sync_slave_io_with_master.inc
include/wait_for_slave_sql_error.inc [errno=3091]
include/include/rpl_skip_to_end_of_relay_log.inc
[connection master]
# db9: many tables with long names.
DROP DATABASE db9;
include/sync_slave_io_with_master.inc
include/wait_for_slave_sql_error.inc [errno=3091]
include/include/rpl_skip_to_end_of_relay_log.inc
[connection master]
# db12: not a database, but directory exists.
DROP DATABASE db12;
include/sync_slave_io_with_master.inc
include/wait_for_slave_sql_error.inc [errno=3091]
include/include/rpl_skip_to_end_of_relay_log.inc
[connection master]
# db15: not a database (on slave).
DROP DATABASE db15;
include/sync_slave_io_with_master.inc
include/wait_for_slave_sql_error.inc [errno=1008]
include/include/rpl_skip_to_end_of_relay_log.inc
[connection master]
---- Clean up ----
DROP DATABASE db1;
DROP DATABASE db2;
DROP DATABASE IF EXISTS db3;
Warnings:
Note	1008	Can't drop database 'db3'; database doesn't exist
DROP DATABASE db4;
DROP DATABASE db5;
DROP DATABASE IF EXISTS db6;
Warnings:
Note	1008	Can't drop database 'db6'; database doesn't exist
DROP DATABASE db7;
DROP DATABASE db8;
DROP DATABASE IF EXISTS db9;
Warnings:
Note	1008	Can't drop database 'db9'; database doesn't exist
DROP DATABASE IF EXISTS db10;
DROP DATABASE IF EXISTS db11;
DROP DATABASE IF EXISTS db12;
Warnings:
Note	1008	Can't drop database 'db12'; database doesn't exist
DROP DATABASE IF EXISTS db15;
Warnings:
Note	1008	Can't drop database 'db15'; database doesn't exist
include/rpl_sync.inc
==== Case 4: CREATE TABLE ... SELECT ====
See rpl_gtid_create_select.test
include/rpl_end.inc
