mirror of
https://github.com/MariaDB/server.git
synced 2025-10-21 08:47:42 +03:00
Automerge from mysql-next-mr.
This commit is contained in:
@@ -20,7 +20,7 @@ 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 # Begin_load_query # # ;file_id=#;block_len=#
|
||||
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t2` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (a, b) ;file_id=#
|
||||
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t2` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, `b`) ;file_id=#
|
||||
master-bin.000001 # Query # # COMMIT
|
||||
select
|
||||
(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
|
||||
|
@@ -33,9 +33,11 @@ mysqld-bin.000001 # Query # # BEGIN
|
||||
mysqld-bin.000001 # Query # # use `test`; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c
|
||||
mysqld-bin.000001 # Query # # COMMIT
|
||||
mysqld-bin.000001 # Query # # BEGIN
|
||||
mysqld-bin.000001 # Query # # use `test`; UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c
|
||||
mysqld-bin.000001 # Query # # COMMIT
|
||||
mysqld-bin.000001 # Query # # BEGIN
|
||||
mysqld-bin.000001 # Query # # use `test`; INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2)
|
||||
mysqld-bin.000001 # Query # # use `test`; UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f
|
||||
mysqld-bin.000001 # Query # # use `test`; UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c
|
||||
mysqld-bin.000001 # Query # # COMMIT
|
||||
mysqld-bin.000001 # Query # # BEGIN
|
||||
mysqld-bin.000001 # Table_map # # table_id: # (test.t1n)
|
||||
|
@@ -128,7 +128,7 @@ master-bin.000001 # Query # # COMMIT
|
||||
master-bin.000001 # Query # # use `test`; create table t2 (a varchar(200)) engine=blackhole
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=581
|
||||
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE `t2` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (a) ;file_id=#
|
||||
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE `t2` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`) ;file_id=#
|
||||
master-bin.000001 # Query # # COMMIT
|
||||
master-bin.000001 # Query # # use `test`; alter table t1 add b int
|
||||
master-bin.000001 # Query # # use `test`; alter table t1 drop b
|
||||
|
@@ -701,7 +701,7 @@ master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Intvar # # INSERT_ID=10
|
||||
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
|
||||
master-bin.000001 # Intvar # # INSERT_ID=10
|
||||
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (a, @b) SET b=((@b) + `bug27417`(2)) ;file_id=#
|
||||
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @b) SET `b`=((@b) + `bug27417`(2)) ;file_id=#
|
||||
master-bin.000001 # Query # # ROLLBACK
|
||||
/* the output must denote there is the query */;
|
||||
drop trigger trg_del_t2;
|
||||
@@ -959,7 +959,7 @@ master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
|
||||
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
|
||||
master-bin.000001 # Intvar # # INSERT_ID=10
|
||||
master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
|
||||
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (a, @b) SET b=((@b) + `bug27417`(2)) ;file_id=#
|
||||
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @b) SET `b`=((@b) + `bug27417`(2)) ;file_id=#
|
||||
master-bin.000001 # Query # # ROLLBACK
|
||||
drop trigger trg_del_t2;
|
||||
drop table t1,t2,t3,t4,t5;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
set @save_binlog_format= @@global.binlog_format;
|
||||
set @save_binlog_dirct= @@global.binlog_direct_non_transactional_updates;
|
||||
create table t1 (a int) engine= myisam;
|
||||
create table t2 (a int) engine= innodb;
|
||||
SELECT @@session.binlog_format;
|
||||
@@ -8,19 +9,27 @@ SET AUTOCOMMIT=1;
|
||||
# Test that the session variable 'binlog_format'
|
||||
# is writable outside a transaction.
|
||||
set @@session.binlog_format= statement;
|
||||
set @@session.binlog_direct_non_transactional_updates= TRUE;
|
||||
SELECT @@session.binlog_format;
|
||||
@@session.binlog_format
|
||||
STATEMENT
|
||||
SELECT @@session.binlog_direct_non_transactional_updates;
|
||||
@@session.binlog_direct_non_transactional_updates
|
||||
1
|
||||
begin;
|
||||
# Test that the session variable 'binlog_format' is read-only
|
||||
# inside a transaction with no preceding updates.
|
||||
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
|
||||
insert into t2 values (1);
|
||||
# Test that the session variable 'binlog_format' is read-only
|
||||
# inside a transaction with preceding transactional updates.
|
||||
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
|
||||
commit;
|
||||
begin;
|
||||
insert into t1 values (2);
|
||||
@@ -28,31 +37,47 @@ insert into t1 values (2);
|
||||
# inside a transaction with preceding non-transactional updates.
|
||||
set @@session.binlog_format= statement;
|
||||
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
|
||||
commit;
|
||||
# Test that the session variable 'binlog_format' is writable
|
||||
# when AUTOCOMMIT=0, before a transaction has started.
|
||||
set AUTOCOMMIT=0;
|
||||
set @@session.binlog_format= row;
|
||||
set @@session.binlog_direct_non_transactional_updates= FALSE;
|
||||
SELECT @@session.binlog_format;
|
||||
@@session.binlog_format
|
||||
ROW
|
||||
SELECT @@session.binlog_direct_non_transactional_updates;
|
||||
@@session.binlog_direct_non_transactional_updates
|
||||
0
|
||||
insert into t1 values (4);
|
||||
# Test that the session variable 'binlog_format' is read-only inside an
|
||||
# AUTOCOMMIT=0 transaction with preceding non-transactional updates.
|
||||
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
|
||||
SELECT @@session.binlog_format;
|
||||
@@session.binlog_format
|
||||
ROW
|
||||
SELECT @@session.binlog_direct_non_transactional_updates;
|
||||
@@session.binlog_direct_non_transactional_updates
|
||||
0
|
||||
commit;
|
||||
insert into t2 values (5);
|
||||
# Test that the session variable 'binlog_format' is read-only inside an
|
||||
# AUTOCOMMIT=0 transaction with preceding transactional updates.
|
||||
set @@session.binlog_format= row;
|
||||
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
|
||||
SELECT @@session.binlog_format;
|
||||
@@session.binlog_format
|
||||
ROW
|
||||
SELECT @@session.binlog_direct_non_transactional_updates;
|
||||
@@session.binlog_direct_non_transactional_updates
|
||||
0
|
||||
commit;
|
||||
begin;
|
||||
insert into t2 values (6);
|
||||
@@ -62,15 +87,20 @@ SELECT @@global.binlog_format;
|
||||
@@global.binlog_format
|
||||
ROW
|
||||
set @@global.binlog_format= statement;
|
||||
set @@global.binlog_direct_non_transactional_updates= TRUE;
|
||||
SELECT @@global.binlog_format;
|
||||
@@global.binlog_format
|
||||
STATEMENT
|
||||
SELECT @@global.binlog_direct_non_transactional_updates;
|
||||
@@global.binlog_direct_non_transactional_updates
|
||||
1
|
||||
commit;
|
||||
set @@global.binlog_format= @save_binlog_format;
|
||||
set @@global.binlog_direct_non_transactional_updates= @save_binlog_dirct;
|
||||
create table t3(a int, b int) engine= innodb;
|
||||
create table t4(a int) engine= innodb;
|
||||
create table t5(a int) engine= innodb;
|
||||
create trigger tr2 after insert on t3 for each row begin
|
||||
create trigger tr1 after insert on t3 for each row begin
|
||||
insert into t4(a) values(1);
|
||||
set @@session.binlog_format= statement;
|
||||
insert into t4(a) values(2);
|
||||
@@ -83,8 +113,27 @@ ERROR HY000: Cannot change the binary logging format inside a stored function or
|
||||
SELECT @@session.binlog_format;
|
||||
@@session.binlog_format
|
||||
ROW
|
||||
create table t6(a int, b int) engine= innodb;
|
||||
create table t7(a int) engine= innodb;
|
||||
create table t8(a int) engine= innodb;
|
||||
create trigger tr2 after insert on t6 for each row begin
|
||||
insert into t7(a) values(1);
|
||||
set @@global.binlog_direct_non_transactional_updates= FALSE;
|
||||
insert into t7(a) values(2);
|
||||
insert into t8(a) values(3);
|
||||
end |
|
||||
# Test that the session variable 'binlog_format' is read-only
|
||||
# in sub-statements.
|
||||
insert into t6(a,b) values(1,1);
|
||||
ERROR HY000: Cannot change the binlog direct flag inside a stored function or trigger
|
||||
SELECT @@session.binlog_direct_non_transactional_updates;
|
||||
@@session.binlog_direct_non_transactional_updates
|
||||
0
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
drop table t3;
|
||||
drop table t4;
|
||||
drop table t5;
|
||||
drop table t6;
|
||||
drop table t7;
|
||||
drop table t8;
|
@@ -3240,7 +3240,10 @@ Warnings:
|
||||
Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave.
|
||||
INSERT INTO t1 VALUES (VERSION());
|
||||
Warnings:
|
||||
Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave.
|
||||
Note 1592 Statement may not be safe to log in statement format.
|
||||
INSERT INTO t1 VALUES (RAND());
|
||||
Warnings:
|
||||
Note 1592 Statement may not be safe to log in statement format.
|
||||
DELETE FROM t1;
|
||||
SET TIMESTAMP=1000000;
|
||||
INSERT INTO t1 VALUES
|
||||
|
@@ -1 +1 @@
|
||||
--innodb_lock_wait_timeout=2
|
||||
--innodb_lock_wait_timeout=2 --binlog-direct-non-transactional-updates=FALSE
|
||||
|
@@ -8,6 +8,7 @@ source include/have_innodb.inc;
|
||||
source include/have_binlog_format_row.inc;
|
||||
|
||||
set @save_binlog_format= @@global.binlog_format;
|
||||
set @save_binlog_dirct= @@global.binlog_direct_non_transactional_updates;
|
||||
create table t1 (a int) engine= myisam;
|
||||
create table t2 (a int) engine= innodb;
|
||||
|
||||
@@ -16,19 +17,25 @@ SET AUTOCOMMIT=1;
|
||||
--echo # Test that the session variable 'binlog_format'
|
||||
--echo # is writable outside a transaction.
|
||||
set @@session.binlog_format= statement;
|
||||
set @@session.binlog_direct_non_transactional_updates= TRUE;
|
||||
SELECT @@session.binlog_format;
|
||||
SELECT @@session.binlog_direct_non_transactional_updates;
|
||||
|
||||
begin;
|
||||
--echo # Test that the session variable 'binlog_format' is read-only
|
||||
--echo # inside a transaction with no preceding updates.
|
||||
--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;
|
||||
|
||||
insert into t2 values (1);
|
||||
--echo # Test that the session variable 'binlog_format' is read-only
|
||||
--echo # inside a transaction with preceding transactional updates.
|
||||
--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;
|
||||
commit;
|
||||
|
||||
begin;
|
||||
@@ -37,20 +44,27 @@ begin;
|
||||
--echo # inside a transaction with preceding non-transactional updates.
|
||||
--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= FALSE;
|
||||
commit;
|
||||
|
||||
--echo # Test that the session variable 'binlog_format' is writable
|
||||
--echo # when AUTOCOMMIT=0, before a transaction has started.
|
||||
set AUTOCOMMIT=0;
|
||||
set @@session.binlog_format= row;
|
||||
set @@session.binlog_direct_non_transactional_updates= FALSE;
|
||||
SELECT @@session.binlog_format;
|
||||
SELECT @@session.binlog_direct_non_transactional_updates;
|
||||
|
||||
insert into t1 values (4);
|
||||
--echo # Test that the session variable 'binlog_format' is read-only inside an
|
||||
--echo # AUTOCOMMIT=0 transaction with preceding non-transactional updates.
|
||||
--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;
|
||||
SELECT @@session.binlog_format;
|
||||
SELECT @@session.binlog_direct_non_transactional_updates;
|
||||
commit;
|
||||
|
||||
insert into t2 values (5);
|
||||
@@ -58,7 +72,10 @@ insert into t2 values (5);
|
||||
--echo # AUTOCOMMIT=0 transaction with preceding transactional updates.
|
||||
--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= TRUE;
|
||||
SELECT @@session.binlog_format;
|
||||
SELECT @@session.binlog_direct_non_transactional_updates;
|
||||
commit;
|
||||
|
||||
begin;
|
||||
@@ -67,16 +84,19 @@ begin;
|
||||
--echo # inside a transaction.
|
||||
SELECT @@global.binlog_format;
|
||||
set @@global.binlog_format= statement;
|
||||
set @@global.binlog_direct_non_transactional_updates= TRUE;
|
||||
SELECT @@global.binlog_format;
|
||||
SELECT @@global.binlog_direct_non_transactional_updates;
|
||||
commit;
|
||||
|
||||
set @@global.binlog_format= @save_binlog_format;
|
||||
set @@global.binlog_direct_non_transactional_updates= @save_binlog_dirct;
|
||||
|
||||
create table t3(a int, b int) engine= innodb;
|
||||
create table t4(a int) engine= innodb;
|
||||
create table t5(a int) engine= innodb;
|
||||
delimiter |;
|
||||
eval create trigger tr2 after insert on t3 for each row begin
|
||||
eval create trigger tr1 after insert on t3 for each row begin
|
||||
insert into t4(a) values(1);
|
||||
set @@session.binlog_format= statement;
|
||||
insert into t4(a) values(2);
|
||||
@@ -90,9 +110,29 @@ delimiter ;|
|
||||
insert into t3(a,b) values(1,1);
|
||||
SELECT @@session.binlog_format;
|
||||
|
||||
create table t6(a int, b int) engine= innodb;
|
||||
create table t7(a int) engine= innodb;
|
||||
create table t8(a int) engine= innodb;
|
||||
delimiter |;
|
||||
eval create trigger tr2 after insert on t6 for each row begin
|
||||
insert into t7(a) values(1);
|
||||
set @@global.binlog_direct_non_transactional_updates= FALSE;
|
||||
insert into t7(a) values(2);
|
||||
insert into t8(a) values(3);
|
||||
end |
|
||||
delimiter ;|
|
||||
|
||||
--echo # Test that the session variable 'binlog_format' is read-only
|
||||
--echo # in sub-statements.
|
||||
--error ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT
|
||||
insert into t6(a,b) values(1,1);
|
||||
SELECT @@session.binlog_direct_non_transactional_updates;
|
||||
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
drop table t3;
|
||||
drop table t4;
|
||||
drop table t5;
|
||||
|
||||
drop table t6;
|
||||
drop table t7;
|
||||
drop table t8;
|
@@ -77,7 +77,8 @@
|
||||
# BUG#42640: mysqld crashes when unsafe statements are executed (STRICT_TRANS_TABLES mode)
|
||||
# BUG#45825: INSERT DELAYED is not unsafe: logged in statement format
|
||||
# BUG#45785: LIMIT in SP does not cause RBL if binlog_format=MIXED
|
||||
#
|
||||
# BUG#47995: Mark user functions as unsafe
|
||||
# BUG#49222: Mare RAND() unsafe
|
||||
#
|
||||
# ==== Related test cases ====
|
||||
#
|
||||
@@ -646,6 +647,7 @@ DROP TABLE t1,t2,t3;
|
||||
|
||||
#
|
||||
# BUG#47995: Mark user functions as unsafe
|
||||
# BUG#49222: Mare RAND() unsafe
|
||||
#
|
||||
# Test that the system functions that are supposed to be marked unsafe
|
||||
# generate a warning. Each INSERT statement below should generate a
|
||||
@@ -656,27 +658,28 @@ SET SESSION binlog_format = STATEMENT;
|
||||
CREATE TABLE t1 (a VARCHAR(1000));
|
||||
INSERT INTO t1 VALUES (CURRENT_USER()); #marked unsafe before BUG#47995
|
||||
INSERT INTO t1 VALUES (FOUND_ROWS()); #marked unsafe before BUG#47995
|
||||
INSERT INTO t1 VALUES (GET_LOCK('tmp', 1));
|
||||
INSERT INTO t1 VALUES (IS_FREE_LOCK('tmp'));
|
||||
INSERT INTO t1 VALUES (IS_USED_LOCK('tmp'));
|
||||
INSERT INTO t1 VALUES (LOAD_FILE('../../std_data/words2.dat')); #marked unsafe before BUG#47995
|
||||
INSERT INTO t1 VALUES (GET_LOCK('tmp', 1)); #marked unsafe in BUG#47995
|
||||
INSERT INTO t1 VALUES (IS_FREE_LOCK('tmp')); #marked unsafe in BUG#47995
|
||||
INSERT INTO t1 VALUES (IS_USED_LOCK('tmp')); #marked unsafe in BUG#47995
|
||||
INSERT INTO t1 VALUES (LOAD_FILE('../../std_data/words2.dat')); #marked unsafe in BUG#39701
|
||||
INSERT INTO t1 VALUES (MASTER_POS_WAIT('dummy arg', 4711, 1));
|
||||
INSERT INTO t1 VALUES (RELEASE_LOCK('tmp'));
|
||||
INSERT INTO t1 VALUES (RELEASE_LOCK('tmp')); #marked unsafe in BUG#47995
|
||||
INSERT INTO t1 VALUES (ROW_COUNT()); #marked unsafe before BUG#47995
|
||||
INSERT INTO t1 VALUES (SESSION_USER()); #marked unsafe before BUG#47995
|
||||
INSERT INTO t1 VALUES (SLEEP(1));
|
||||
INSERT INTO t1 VALUES (SYSDATE());
|
||||
INSERT INTO t1 VALUES (SLEEP(1)); #marked unsafe in BUG#47995
|
||||
INSERT INTO t1 VALUES (SYSDATE()); #marked unsafe in BUG#47995
|
||||
INSERT INTO t1 VALUES (SYSTEM_USER()); #marked unsafe before BUG#47995
|
||||
INSERT INTO t1 VALUES (USER()); #marked unsafe before BUG#47995
|
||||
INSERT INTO t1 VALUES (UUID()); #marked unsafe before BUG#47995
|
||||
INSERT INTO t1 VALUES (UUID_SHORT()); #marked unsafe before BUG#47995
|
||||
INSERT INTO t1 VALUES (VERSION());
|
||||
INSERT INTO t1 VALUES (VERSION()); #marked unsafe in BUG#47995
|
||||
INSERT INTO t1 VALUES (RAND()); #marked unsafe in BUG#49222
|
||||
DELETE FROM t1;
|
||||
|
||||
# Since we replicate the TIMESTAMP variable, functions affected by the
|
||||
# TIMESTAMP variable are safe to replicate. So we check that the
|
||||
# following following functions depend on the TIMESTAMP variable and
|
||||
# don't generate a warning.
|
||||
# following following functions that depend on the TIMESTAMP variable
|
||||
# are not unsafe and don't generate a warning.
|
||||
|
||||
SET TIMESTAMP=1000000;
|
||||
INSERT INTO t1 VALUES
|
||||
|
@@ -29,9 +29,11 @@ mysqld-bin.000001 # Query # # BEGIN
|
||||
mysqld-bin.000001 # Query # # use `test`; UPDATE t1, t2 SET m = 2, b = 3 WHERE n = c
|
||||
mysqld-bin.000001 # Query # # COMMIT
|
||||
mysqld-bin.000001 # Query # # BEGIN
|
||||
mysqld-bin.000001 # Query # # use `test`; UPDATE t3, t2 SET e = 2, b = 3 WHERE f = c
|
||||
mysqld-bin.000001 # Query # # COMMIT
|
||||
mysqld-bin.000001 # Query # # BEGIN
|
||||
mysqld-bin.000001 # Query # # use `test`; INSERT INTO t3 VALUES (1,1), (1,2), (2,1), (2,2)
|
||||
mysqld-bin.000001 # Query # # use `test`; UPDATE t1, t3 SET m = 2, e = 3 WHERE n = f
|
||||
mysqld-bin.000001 # Query # # use `test`; UPDATE t3, t2 SET e = 2, b = 3 WHERE f = c
|
||||
mysqld-bin.000001 # Query # # COMMIT
|
||||
mysqld-bin.000001 # Query # # BEGIN
|
||||
mysqld-bin.000001 # Table_map # # table_id: # (test.t3)
|
||||
|
90
mysql-test/suite/ndb/r/ndb_tmp_table_and_DDL.result
Normal file
90
mysql-test/suite/ndb/r/ndb_tmp_table_and_DDL.result
Normal file
@@ -0,0 +1,90 @@
|
||||
CREATE TEMPORARY TABLE t1 (a INT);
|
||||
CREATE TABLE t2 (a INT, b INT) ENGINE= NDB;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
CREATE EVENT e1 ON SCHEDULE EVERY 10 HOUR DO SELECT 1;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
ALTER EVENT e1 ON SCHEDULE EVERY 20 HOUR DO SELECT 1;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
DROP EVENT IF EXISTS e1;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
CREATE PROCEDURE p1() SELECT 1;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
ALTER PROCEDURE p1 SQL SECURITY INVOKER;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
CREATE FUNCTION f1() RETURNS INT RETURN 123;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
ALTER FUNCTION f1 SQL SECURITY INVOKER;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
CREATE DATABASE mysqltest1;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
DROP DATABASE mysqltest1;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
CREATE USER test_1@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
GRANT SELECT ON t2 TO test_1@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
GRANT ALL ON f1 TO test_1@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
GRANT ALL ON p1 TO test_1@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
GRANT USAGE ON *.* TO test_1@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
REVOKE ALL PRIVILEGES ON f1 FROM test_1@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
REVOKE ALL PRIVILEGES ON p1 FROM test_1@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
REVOKE ALL PRIVILEGES ON t2 FROM test_1@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
REVOKE USAGE ON *.* FROM test_1@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
RENAME USER test_1@localhost TO test_2@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
DROP USER test_2@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
CREATE PROCEDURE p2()
|
||||
BEGIN
|
||||
# CREATE USER when a temporary table is open.
|
||||
CREATE TEMPORARY TABLE t3 (a INT);
|
||||
CREATE USER test_2@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
# GRANT select on table to user when a temporary table is open.
|
||||
GRANT SELECT ON t2 TO test_2@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
# GRANT all on function to user when a temporary table is open.
|
||||
GRANT ALL ON f1 TO test_2@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
# GRANT all on procedure to user when a temporary table is open.
|
||||
GRANT ALL ON p1 TO test_2@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
# GRANT usage on *.* to user when a temporary table is open.
|
||||
GRANT USAGE ON *.* TO test_2@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
# REVOKE ALL PRIVILEGES on function to user when a temporary table is open.
|
||||
REVOKE ALL PRIVILEGES ON f1 FROM test_2@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
# REVOKE ALL PRIVILEGES on procedure to user when a temporary table is open.
|
||||
REVOKE ALL PRIVILEGES ON p1 FROM test_2@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
# REVOKE ALL PRIVILEGES on table to user when a temporary table is open.
|
||||
REVOKE ALL PRIVILEGES ON t2 FROM test_2@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
# REVOKE usage on *.* from user when a temporary table is open.
|
||||
REVOKE USAGE ON *.* FROM test_2@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
# RENAME USER when a temporary table is open.
|
||||
RENAME USER test_2@localhost TO test_3@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
# DROP USER when a temporary table is open.
|
||||
DROP USER test_3@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
DROP TEMPORARY TABLE t3;
|
||||
END |
|
||||
DROP PROCEDURE p1;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
DROP PROCEDURE p2;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
DROP FUNCTION f1;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
DROP TABLE t2;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
DROP TEMPORARY TABLE t1;
|
11
mysql-test/suite/ndb/t/ndb_tmp_table_and_DDL.test
Normal file
11
mysql-test/suite/ndb/t/ndb_tmp_table_and_DDL.test
Normal file
@@ -0,0 +1,11 @@
|
||||
#
|
||||
# Bug#49132
|
||||
# This test verifies if executing DDL statement before trying to manipulate
|
||||
# a temporary table causes row-based replication to break with error 'table
|
||||
# does not exist' base on ndb engine.
|
||||
#
|
||||
|
||||
source include/have_ndb.inc;
|
||||
|
||||
LET $ENGINE_TYPE= NDB;
|
||||
source extra/rpl_tests/rpl_tmp_table_and_DDL.test;
|
@@ -9,11 +9,11 @@ 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/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
|
||||
wait/synch/mutex/sql/LOCK_delayed_status YES YES
|
||||
select * from performance_schema.SETUP_INSTRUMENTS
|
||||
where name like 'Wait/Synch/Rwlock/sql/%'
|
||||
order by name limit 10;
|
||||
|
@@ -6,6 +6,7 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT");
|
||||
call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT");
|
||||
SET @@session.binlog_direct_non_transactional_updates= FALSE;
|
||||
DROP DATABASE IF EXISTS db1;
|
||||
CREATE DATABASE db1;
|
||||
use db1;
|
||||
|
@@ -17,15 +17,16 @@ show grants for x@y;
|
||||
Grants for x@y
|
||||
GRANT USAGE ON *.* TO 'x'@'y'
|
||||
GRANT SELECT ON `d1`.`t` TO 'x'@'y'
|
||||
show binlog events from <binlog_start>;
|
||||
show binlog events;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # drop database if exists d1
|
||||
master-bin.000001 # Query # # create database d1
|
||||
master-bin.000001 # Query # # use `d1`; create table t (s1 int) engine=innodb
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Query # # use `d1`; insert into t values (1)
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `d1`; grant select on t to x@y
|
||||
master-bin.000001 4 Format_desc 1 107 Server ver: VERSION, Binlog ver: 4
|
||||
master-bin.000001 107 Query 1 194 drop database if exists d1
|
||||
master-bin.000001 194 Query 1 273 create database d1
|
||||
master-bin.000001 273 Query 1 371 use `d1`; create table t (s1 int) engine=innodb
|
||||
master-bin.000001 371 Query 1 437 BEGIN
|
||||
master-bin.000001 437 Query 1 522 use `d1`; insert into t values (1)
|
||||
master-bin.000001 522 Xid 1 549 COMMIT /* XID */
|
||||
master-bin.000001 549 Query 1 634 use `d1`; grant select on t to x@y
|
||||
start transaction;
|
||||
insert into t values (2);
|
||||
revoke select on t from x@y;
|
||||
@@ -37,18 +38,19 @@ s1
|
||||
show grants for x@y;
|
||||
Grants for x@y
|
||||
GRANT USAGE ON *.* TO 'x'@'y'
|
||||
show binlog events from <binlog_start>;
|
||||
show binlog events;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # drop database if exists d1
|
||||
master-bin.000001 # Query # # create database d1
|
||||
master-bin.000001 # Query # # use `d1`; create table t (s1 int) engine=innodb
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Query # # use `d1`; insert into t values (1)
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `d1`; grant select on t to x@y
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Query # # use `d1`; insert into t values (2)
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `d1`; revoke select on t from x@y
|
||||
master-bin.000001 4 Format_desc 1 107 Server ver: VERSION, Binlog ver: 4
|
||||
master-bin.000001 107 Query 1 194 drop database if exists d1
|
||||
master-bin.000001 194 Query 1 273 create database d1
|
||||
master-bin.000001 273 Query 1 371 use `d1`; create table t (s1 int) engine=innodb
|
||||
master-bin.000001 371 Query 1 437 BEGIN
|
||||
master-bin.000001 437 Query 1 522 use `d1`; insert into t values (1)
|
||||
master-bin.000001 522 Xid 1 549 COMMIT /* XID */
|
||||
master-bin.000001 549 Query 1 634 use `d1`; grant select on t to x@y
|
||||
master-bin.000001 634 Query 1 700 BEGIN
|
||||
master-bin.000001 700 Query 1 785 use `d1`; insert into t values (2)
|
||||
master-bin.000001 785 Xid 1 812 COMMIT /* XID */
|
||||
master-bin.000001 812 Query 1 900 use `d1`; revoke select on t from x@y
|
||||
drop user x@y;
|
||||
drop database d1;
|
||||
|
@@ -38,12 +38,14 @@ 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`; INSERT INTO n VALUES (now(),"brown")
|
||||
master-bin.000001 # Query # # COMMIT
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Query # # use `test`; UPDATE t SET f = 'yellow 2' WHERE i = 3
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Query # # use `test`; UPDATE t SET f = 'magenta 2' WHERE f = 'red'
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t VALUES (5 + (2 * 10),"brown")
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO n VALUES (now(),"brown")
|
||||
master-bin.000001 # Query # # ROLLBACK
|
||||
SET AUTOCOMMIT = 1;
|
||||
BEGIN;
|
||||
@@ -63,12 +65,14 @@ 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 n VALUES (now(),"brown")
|
||||
master-bin.000001 # Query # # COMMIT
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Query # # use `test`; UPDATE t SET f = 'gray 2' WHERE i = 3
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Query # # use `test`; UPDATE t SET f = 'dark blue 2' WHERE f = 'red'
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t VALUES (6 + (2 * 10),"brown")
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO n VALUES (now(),"brown")
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
SET AUTOCOMMIT = 0;
|
||||
UPDATE t SET f = 'yellow 1' WHERE i = 3;
|
||||
@@ -88,12 +92,14 @@ 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`; INSERT INTO n VALUES (now(),"brown")
|
||||
master-bin.000001 # Query # # COMMIT
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Query # # use `test`; UPDATE t SET f = 'yellow 1' WHERE i = 3
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Query # # use `test`; UPDATE t SET f = 'magenta 1' WHERE f = 'red'
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t VALUES (5 + (1 * 10),"brown")
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO n VALUES (now(),"brown")
|
||||
master-bin.000001 # Query # # ROLLBACK
|
||||
SET AUTOCOMMIT = 0;
|
||||
UPDATE t SET f = 'gray 1' WHERE i = 3;
|
||||
@@ -111,12 +117,14 @@ 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 n VALUES (now(),"brown")
|
||||
master-bin.000001 # Query # # COMMIT
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Query # # use `test`; UPDATE t SET f = 'gray 1' WHERE i = 3
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Query # # use `test`; UPDATE t SET f = 'dark blue 1' WHERE f = 'red'
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t VALUES (6 + (1 * 10),"brown")
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO n VALUES (now(),"brown")
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
source include/diff_master_slave.inc;
|
||||
source include/diff_master_slave.inc;
|
||||
|
@@ -31,3 +31,37 @@ SHOW EVENTS in mysqltest;
|
||||
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
|
||||
mysqltest e root@localhost SYSTEM ONE TIME # NULL NULL NULL NULL SLAVESIDE_DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
DROP DATABASE IF EXISTS mysqltest;
|
||||
-------------BUG#47418-------------
|
||||
USE test;
|
||||
DROP TABLE IF EXISTS t3;
|
||||
CREATE TABLE t3(c1 INTEGER);
|
||||
INSERT INTO t3 VALUES(33);
|
||||
CREATE TEMPORARY TABLE t1(c1 INTEGER);
|
||||
CREATE TEMPORARY TABLE t2(c1 INTEGER);
|
||||
INSERT INTO t1 VALUES(1);
|
||||
INSERT INTO t2 VALUES(1);
|
||||
CREATE TABLE IF NOT EXISTS t1(c1 INTEGER) SELECT c1 FROM t3;
|
||||
CREATE TABLE t2(c1 INTEGER) SELECT c1 FROM t3;
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
1
|
||||
SELECT * FROM t2;
|
||||
c1
|
||||
1
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
33
|
||||
SELECT * FROM t2;
|
||||
c1
|
||||
33
|
||||
DROP TEMPORARY TABLE t1;
|
||||
DROP TEMPORARY TABLE t2;
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
33
|
||||
SELECT * FROM t2;
|
||||
c1
|
||||
33
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t3;
|
||||
|
@@ -12,3 +12,17 @@ show status like 'Slave_open_temp_tables';
|
||||
Variable_name Value
|
||||
Slave_open_temp_tables 0
|
||||
drop database mysqltest;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp1;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 'tmp1'
|
||||
CREATE TEMPORARY TABLE t1 ( a int );
|
||||
DROP TEMPORARY TABLE t1, t2;
|
||||
ERROR 42S02: Unknown table 't2'
|
||||
DROP TEMPORARY TABLE tmp2;
|
||||
ERROR 42S02: Unknown table 'tmp2'
|
||||
stop slave;
|
||||
**** On Master ****
|
||||
CREATE TEMPORARY TABLE tmp3 (a int);
|
||||
DROP TEMPORARY TABLE tmp3;
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
|
||||
START SLAVE;
|
||||
|
18
mysql-test/suite/rpl/r/rpl_geometry.result
Normal file
18
mysql-test/suite/rpl/r/rpl_geometry.result
Normal file
@@ -0,0 +1,18 @@
|
||||
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(a varchar(100),
|
||||
b multipoint not null,
|
||||
c varchar(256));
|
||||
insert into t1 set
|
||||
a='hello',
|
||||
b=geomfromtext('multipoint(1 1)'),
|
||||
c='geometry';
|
||||
create table t2 (a int(11) not null auto_increment primary key,
|
||||
b geometrycollection default null,
|
||||
c decimal(10,0));
|
||||
insert into t2(c) values (null);
|
||||
drop table t1, t2;
|
@@ -4,11 +4,10 @@ reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
call mtr.add_suppression("Slave I/O: Master command COM_REGISTER_SLAVE failed: .*");
|
||||
call mtr.add_suppression("Slave I/O: .* failed with error: Lost connection to MySQL server at 'reading initial communication packet'");
|
||||
call mtr.add_suppression("Slave I/O: Master command COM_REGISTER_SLAVE failed: failed registering on master, reconnecting to try again");
|
||||
call mtr.add_suppression("Get master clock failed with error: ");
|
||||
call mtr.add_suppression("Get master SERVER_ID failed with error: ");
|
||||
call mtr.add_suppression("Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; .*");
|
||||
call mtr.add_suppression("Slave I/O thread .* register on master");
|
||||
SELECT IS_FREE_LOCK("debug_lock.before_get_UNIX_TIMESTAMP");
|
||||
IS_FREE_LOCK("debug_lock.before_get_UNIX_TIMESTAMP")
|
||||
1
|
||||
|
@@ -266,16 +266,18 @@ Reload master
|
||||
Heartbeat event received
|
||||
|
||||
*** Circular replication ***
|
||||
RESET MASTER;
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10));
|
||||
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;
|
||||
include/stop_slave.inc
|
||||
RESET MASTER;
|
||||
RESET SLAVE;
|
||||
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1, MASTER_LOG_FILE='MASTER_BINLOG';
|
||||
RESET SLAVE;
|
||||
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=SLAVE_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=1, MASTER_LOG_FILE='SLAVE_BINLOG';
|
||||
include/start_slave.inc
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10));
|
||||
INSERT INTO t1 VALUES(1, 'on master');
|
||||
CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD=0.1;
|
||||
include/start_slave.inc
|
||||
INSERT INTO t1 VALUES(2, 'on slave');
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
|
@@ -885,7 +885,7 @@ master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # BEGIN
|
||||
master-bin.000001 # Begin_load_query 1 # ;file_id=#;block_len=#
|
||||
master-bin.000001 # Execute_load_query 1 # use `test_rpl`; LOAD DATA INFILE 'MYSQLTEST_VARDIR/std_data/rpl_mixed.dat' INTO TABLE `t1` FIELDS TERMINATED BY '|' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (a, b) ;file_id=#
|
||||
master-bin.000001 # Execute_load_query 1 # use `test_rpl`; LOAD DATA INFILE 'MYSQLTEST_VARDIR/std_data/rpl_mixed.dat' INTO TABLE `t1` FIELDS TERMINATED BY '|' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, `b`) ;file_id=#
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1
|
||||
|
@@ -115,3 +115,20 @@ use b48297_db1;
|
||||
Comparing tables master:b48297_db1.t1 and slave:b48297_db1.t1
|
||||
DROP DATABASE b48297_db1;
|
||||
DROP DATABASE b42897_db2;
|
||||
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;
|
||||
use test;
|
||||
CREATE TABLE t1 (`key` TEXT, `text` TEXT);
|
||||
LOAD DATA INFILE '../../std_data/loaddata2.dat' REPLACE INTO TABLE `t1` FIELDS TERMINATED BY ',';
|
||||
SELECT * FROM t1;
|
||||
key text
|
||||
Field A 'Field B'
|
||||
Field 1 'Field 2'
|
||||
Field 3 'Field 4'
|
||||
'Field 5' 'Field 6'
|
||||
Field 6 'Field 7'
|
||||
DROP TABLE t1;
|
||||
|
@@ -21,7 +21,7 @@ master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
|
||||
master-bin.000001 # Append_block # # ;file_id=#;block_len=#
|
||||
master-bin.000001 # Append_block # # ;file_id=#;block_len=#
|
||||
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' INTO TABLE `t2` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (id) ;file_id=#
|
||||
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' INTO TABLE `t2` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`id`) ;file_id=#
|
||||
master-bin.000001 # Query # # COMMIT
|
||||
==== Verify results on slave ====
|
||||
[on slave]
|
||||
|
25
mysql-test/suite/rpl/r/rpl_manual_change_index_file.result
Normal file
25
mysql-test/suite/rpl/r/rpl_manual_change_index_file.result
Normal file
@@ -0,0 +1,25 @@
|
||||
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;
|
||||
FLUSH LOGS;
|
||||
CREATE TABLE t1(c1 INT);
|
||||
FLUSH LOGS;
|
||||
call mtr.add_suppression('Got fatal error 1236 from master when reading data from binary log: .*could not find next log');
|
||||
Last_IO_Error
|
||||
Got fatal error 1236 from master when reading data from binary log: 'could not find next log'
|
||||
CREATE TABLE t2(c1 INT);
|
||||
FLUSH LOGS;
|
||||
CREATE TABLE t3(c1 INT);
|
||||
FLUSH LOGS;
|
||||
CREATE TABLE t4(c1 INT);
|
||||
START SLAVE IO_THREAD;
|
||||
SHOW TABLES;
|
||||
Tables_in_test
|
||||
t1
|
||||
t2
|
||||
t3
|
||||
t4
|
||||
DROP TABLE t1, t2, t3, t4;
|
@@ -4,6 +4,7 @@ reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
CALL mtr.add_suppression('Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT');
|
||||
create table t1(id int, i int, r1 int, r2 int, p varchar(100));
|
||||
insert into t1 values(1, connection_id(), 0, 0, "");
|
||||
insert into t1 values(2, 0, rand()*1000, rand()*1000, "");
|
||||
|
@@ -393,8 +393,10 @@ CREATE TEMPORARY TABLE tt_xx (a int);
|
||||
-b-b-b-b-b-b-b-b-b-b-b- >> << -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(ddl_case) VALUES (11)
|
||||
master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx (a int)
|
||||
master-bin.000001 # Query # # COMMIT
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (11)
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
|
||||
|
||||
|
@@ -11868,6 +11868,9 @@ Log_name Pos Event_type Server_id End_log_pos Info
|
||||
-b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b-
|
||||
CREATE TEMPORARY TABLE tt_xx_11 (a int) engine=Innodb;;
|
||||
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 tt_xx_11 (a int) engine=Innodb
|
||||
master-bin.000001 # Query # # COMMIT
|
||||
-e-e-e-e-e-e-e-e-e-e-e- >> CT << -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-
|
||||
ROLLBACK;
|
||||
@@ -11875,6 +11878,9 @@ Log_name Pos Event_type Server_id End_log_pos Info
|
||||
-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 CT 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`; CREATE TEMPORARY TABLE tt_xx_11 (a int) engine=Innodb
|
||||
master-bin.000001 # Query # # COMMIT
|
||||
-e-e-e-e-e-e-e-e-e-e-e- >> B T CT R << -e-e-e-e-e-e-e-e-e-e-e-
|
||||
|
||||
-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
|
||||
@@ -11906,6 +11912,9 @@ Log_name Pos Event_type Server_id End_log_pos Info
|
||||
-b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b-
|
||||
CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb;;
|
||||
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 tt_xx_12 (a int) engine=Innodb
|
||||
master-bin.000001 # Query # # COMMIT
|
||||
-e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e-
|
||||
-b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b-
|
||||
ROLLBACK TO s1;
|
||||
@@ -11919,6 +11928,9 @@ Log_name Pos Event_type Server_id End_log_pos Info
|
||||
-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`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb
|
||||
master-bin.000001 # Query # # COMMIT
|
||||
-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-
|
||||
|
||||
-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
|
||||
@@ -11942,6 +11954,9 @@ Log_name Pos Event_type Server_id End_log_pos Info
|
||||
-b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b-
|
||||
CREATE TEMPORARY TABLE tt_xx_13 (a int) engine=Innodb;;
|
||||
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 tt_xx_13 (a int) engine=Innodb
|
||||
master-bin.000001 # Query # # COMMIT
|
||||
-e-e-e-e-e-e-e-e-e-e-e- >> CT << -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-
|
||||
INSERT INTO tt_1(trans_id, stmt_id) VALUES (355, 5);
|
||||
@@ -11953,6 +11968,9 @@ Log_name Pos Event_type Server_id End_log_pos Info
|
||||
-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 CT T 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`; CREATE TEMPORARY TABLE tt_xx_13 (a int) engine=Innodb
|
||||
master-bin.000001 # Query # # COMMIT
|
||||
-e-e-e-e-e-e-e-e-e-e-e- >> B T CT T R << -e-e-e-e-e-e-e-e-e-e-e-
|
||||
|
||||
-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
|
||||
|
@@ -4,6 +4,7 @@ reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
CALL mtr.add_suppression('Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT');
|
||||
CREATE TABLE t1 (a VARCHAR(1000));
|
||||
INSERT INTO t1 VALUES (CONNECTION_ID());
|
||||
INSERT INTO t1 VALUES (CONNECTION_ID());
|
||||
|
@@ -4,6 +4,7 @@ reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
CALL mtr.add_suppression('Statement may not be safe to log in statement format.');
|
||||
DROP FUNCTION IF EXISTS test.f1;
|
||||
DROP TABLE IF EXISTS test.t1;
|
||||
CREATE TABLE test.t1 (a INT NOT NULL AUTO_INCREMENT, c CHAR(16),PRIMARY KEY(a))ENGINE=INNODB;
|
||||
|
@@ -129,3 +129,20 @@ use b48297_db1;
|
||||
Comparing tables master:b48297_db1.t1 and slave:b48297_db1.t1
|
||||
DROP DATABASE b48297_db1;
|
||||
DROP DATABASE b42897_db2;
|
||||
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;
|
||||
use test;
|
||||
CREATE TABLE t1 (`key` TEXT, `text` TEXT);
|
||||
LOAD DATA INFILE '../../std_data/loaddata2.dat' REPLACE INTO TABLE `t1` FIELDS TERMINATED BY ',';
|
||||
SELECT * FROM t1;
|
||||
key text
|
||||
Field A 'Field B'
|
||||
Field 1 'Field 2'
|
||||
Field 3 'Field 4'
|
||||
'Field 5' 'Field 6'
|
||||
Field 6 'Field 7'
|
||||
DROP TABLE t1;
|
||||
|
@@ -1,5 +1,11 @@
|
||||
RESET MASTER;
|
||||
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;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
### TABLE with field_metadata_size == 290
|
||||
CREATE TABLE `t1` (
|
||||
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`c2` varchar(30) NOT NULL,
|
||||
@@ -150,7 +156,51 @@ CREATE TABLE `t1` (
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=InnoDB;
|
||||
LOCK TABLES `t1` WRITE;
|
||||
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','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','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','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1');
|
||||
DROP TABLE `t1`;
|
||||
INSERT INTO `t1`(c2) VALUES ('1');
|
||||
FLUSH LOGS;
|
||||
### assertion: the slave replicated event successfully and tables match
|
||||
Comparing tables master:test.t1 and slave:test.t1
|
||||
DROP TABLE `t1`;
|
||||
=== Using mysqlbinlog to detect failure. Before the patch mysqlbinlog would find a corrupted event, thence would fail.
|
||||
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;
|
||||
### action: generating several tables with different metadata
|
||||
### sizes (resorting to perl)
|
||||
### testing table with 249 field metadata size.
|
||||
### testing table with 250 field metadata size.
|
||||
### testing table with 251 field metadata size.
|
||||
### testing table with 252 field metadata size.
|
||||
### testing table with 253 field metadata size.
|
||||
### testing table with 254 field metadata size.
|
||||
### testing table with 255 field metadata size.
|
||||
### testing table with 256 field metadata size.
|
||||
### testing table with 257 field metadata size.
|
||||
### testing table with 258 field metadata size.
|
||||
FLUSH LOGS;
|
||||
### assertion: the slave replicated event successfully and tables match for t10
|
||||
Comparing tables master:test.t10 and slave:test.t10
|
||||
### assertion: the slave replicated event successfully and tables match for t9
|
||||
Comparing tables master:test.t9 and slave:test.t9
|
||||
### assertion: the slave replicated event successfully and tables match for t8
|
||||
Comparing tables master:test.t8 and slave:test.t8
|
||||
### assertion: the slave replicated event successfully and tables match for t7
|
||||
Comparing tables master:test.t7 and slave:test.t7
|
||||
### assertion: the slave replicated event successfully and tables match for t6
|
||||
Comparing tables master:test.t6 and slave:test.t6
|
||||
### assertion: the slave replicated event successfully and tables match for t5
|
||||
Comparing tables master:test.t5 and slave:test.t5
|
||||
### assertion: the slave replicated event successfully and tables match for t4
|
||||
Comparing tables master:test.t4 and slave:test.t4
|
||||
### assertion: the slave replicated event successfully and tables match for t3
|
||||
Comparing tables master:test.t3 and slave:test.t3
|
||||
### assertion: the slave replicated event successfully and tables match for t2
|
||||
Comparing tables master:test.t2 and slave:test.t2
|
||||
### assertion: the slave replicated event successfully and tables match for t1
|
||||
Comparing tables master:test.t1 and slave:test.t1
|
||||
### assertion: check that binlog is not corrupt. Using mysqlbinlog to
|
||||
### detect failure. Before the patch mysqlbinlog would find
|
||||
### a corrupted event, thence would fail.
|
35
mysql-test/suite/rpl/r/rpl_set_null_innodb.result
Normal file
35
mysql-test/suite/rpl/r/rpl_set_null_innodb.result
Normal file
@@ -0,0 +1,35 @@
|
||||
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;
|
||||
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 BIT, c2 INT) Engine=InnoDB;
|
||||
INSERT INTO `t1` VALUES ( 1, 1 );
|
||||
UPDATE t1 SET c1=NULL where c2=1;
|
||||
Comparing tables master:test.t1 and slave:test.t1
|
||||
DELETE FROM t1 WHERE c2=1 LIMIT 1;
|
||||
Comparing tables master:test.t1 and slave:test.t1
|
||||
DROP TABLE t1;
|
||||
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 CHAR) Engine=InnoDB;
|
||||
INSERT INTO t1 ( c1 ) VALUES ( 'w' ) ;
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
w
|
||||
UPDATE t1 SET c1=NULL WHERE c1='w';
|
||||
Comparing tables master:test.t1 and slave:test.t1
|
||||
DELETE FROM t1 LIMIT 2;
|
||||
Comparing tables master:test.t1 and slave:test.t1
|
||||
DROP TABLE t1;
|
35
mysql-test/suite/rpl/r/rpl_set_null_myisam.result
Normal file
35
mysql-test/suite/rpl/r/rpl_set_null_myisam.result
Normal file
@@ -0,0 +1,35 @@
|
||||
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;
|
||||
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 BIT, c2 INT) Engine=MyISAM;
|
||||
INSERT INTO `t1` VALUES ( 1, 1 );
|
||||
UPDATE t1 SET c1=NULL where c2=1;
|
||||
Comparing tables master:test.t1 and slave:test.t1
|
||||
DELETE FROM t1 WHERE c2=1 LIMIT 1;
|
||||
Comparing tables master:test.t1 and slave:test.t1
|
||||
DROP TABLE t1;
|
||||
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 CHAR) Engine=MyISAM;
|
||||
INSERT INTO t1 ( c1 ) VALUES ( 'w' ) ;
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
w
|
||||
UPDATE t1 SET c1=NULL WHERE c1='w';
|
||||
Comparing tables master:test.t1 and slave:test.t1
|
||||
DELETE FROM t1 LIMIT 2;
|
||||
Comparing tables master:test.t1 and slave:test.t1
|
||||
DROP TABLE t1;
|
@@ -130,8 +130,8 @@ Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = S
|
||||
Got one of the listed errors
|
||||
Got one of the listed errors
|
||||
Got one of the listed errors
|
||||
Got one of the listed errors
|
||||
Got one of the listed errors
|
||||
Warnings:
|
||||
Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction.
|
||||
Warnings:
|
||||
Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction.
|
||||
COMMIT;
|
||||
@@ -139,10 +139,7 @@ BEGIN;
|
||||
Warnings:
|
||||
Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction.
|
||||
Got one of the listed errors
|
||||
Got one of the listed errors
|
||||
COMMIT;
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
|
||||
START SLAVE SQL_THREAD;
|
||||
source include/diff_master_slave.inc;
|
||||
########################################################################################
|
||||
# CLEAN
|
||||
|
@@ -213,7 +213,7 @@ 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(ddl_case) VALUES (26)
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; ALTER EVENT evt COMMENT 'evt'
|
||||
master-bin.000001 # Query # # use `test`; ALTER DEFINER=`root`@`localhost` EVENT evt COMMENT 'evt'
|
||||
-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
|
||||
|
||||
-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
|
||||
@@ -393,8 +393,10 @@ CREATE TEMPORARY TABLE tt_xx (a int);
|
||||
-b-b-b-b-b-b-b-b-b-b-b- >> << -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(ddl_case) VALUES (11)
|
||||
master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx (a int)
|
||||
master-bin.000001 # Query # # COMMIT
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (11)
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
|
||||
|
||||
@@ -429,8 +431,10 @@ DROP TEMPORARY TABLE IF EXISTS new_tt_xx;
|
||||
-b-b-b-b-b-b-b-b-b-b-b- >> << -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(ddl_case) VALUES (8)
|
||||
master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS new_tt_xx
|
||||
master-bin.000001 # Query # # COMMIT
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (8)
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
|
||||
|
||||
|
@@ -7,11 +7,11 @@ Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (c1 char(50))
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
|
||||
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (c1) ;file_id=#
|
||||
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`c1`) ;file_id=#
|
||||
master-bin.000001 # Query # # COMMIT
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
|
||||
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA CONCURRENT INFILE '../../std_data/words.dat' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (c1) ;file_id=#
|
||||
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA CONCURRENT INFILE '../../std_data/words.dat' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`c1`) ;file_id=#
|
||||
master-bin.000001 # Query # # COMMIT
|
||||
DROP TABLE t1;
|
||||
stop slave;
|
||||
@@ -131,3 +131,20 @@ use b48297_db1;
|
||||
Comparing tables master:b48297_db1.t1 and slave:b48297_db1.t1
|
||||
DROP DATABASE b48297_db1;
|
||||
DROP DATABASE b42897_db2;
|
||||
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;
|
||||
use test;
|
||||
CREATE TABLE t1 (`key` TEXT, `text` TEXT);
|
||||
LOAD DATA INFILE '../../std_data/loaddata2.dat' REPLACE INTO TABLE `t1` FIELDS TERMINATED BY ',';
|
||||
SELECT * FROM t1;
|
||||
key text
|
||||
Field A 'Field B'
|
||||
Field 1 'Field 2'
|
||||
Field 3 'Field 4'
|
||||
'Field 5' 'Field 6'
|
||||
Field 6 'Field 7'
|
||||
DROP TABLE t1;
|
||||
|
@@ -28,7 +28,7 @@ master-bin.000001 # Query 1 # use `test`; drop table t1
|
||||
master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM
|
||||
master-bin.000001 # Query 1 # BEGIN
|
||||
master-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=581
|
||||
master-bin.000001 # Execute_load_query 1 # use `test`; LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' IGNORE 1 LINES (word) ;file_id=1
|
||||
master-bin.000001 # Execute_load_query 1 # use `test`; LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' IGNORE 1 LINES (`word`) ;file_id=1
|
||||
master-bin.000001 # Query 1 # COMMIT
|
||||
show binlog events from 107 limit 1;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
@@ -203,7 +203,7 @@ master-bin.000001 # Query # # use `test`; drop table t1
|
||||
master-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
|
||||
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' IGNORE 1 LINES (word) ;file_id=#
|
||||
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' IGNORE 1 LINES (`word`) ;file_id=#
|
||||
master-bin.000001 # Query # # COMMIT
|
||||
master-bin.000001 # Rotate # # master-bin.000002;pos=4
|
||||
show binlog events in 'master-bin.000002';
|
||||
@@ -234,7 +234,7 @@ slave-bin.000001 # Query 1 # use `test`; drop table t1
|
||||
slave-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM
|
||||
slave-bin.000001 # Query 1 # BEGIN
|
||||
slave-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=581
|
||||
slave-bin.000001 # Execute_load_query 1 # use `test`; LOAD DATA INFILE '../../tmp/SQL_LOAD-2-1-1.data' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' IGNORE 1 LINES (word) ;file_id=1
|
||||
slave-bin.000001 # Execute_load_query 1 # use `test`; LOAD DATA INFILE '../../tmp/SQL_LOAD-2-1-1.data' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' IGNORE 1 LINES (`word`) ;file_id=1
|
||||
slave-bin.000001 # Query 1 # COMMIT
|
||||
slave-bin.000001 # Query 1 # use `test`; create table t3 (a int)ENGINE=MyISAM
|
||||
slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -4,6 +4,7 @@ reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
SET @@session.binlog_direct_non_transactional_updates= FALSE;
|
||||
call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT");
|
||||
call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT");
|
||||
create table t1(n int);
|
||||
|
@@ -4,6 +4,7 @@ reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
SET @@session.binlog_direct_non_transactional_updates= FALSE;
|
||||
call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT");
|
||||
create table tm (a int auto_increment primary key) engine=myisam;
|
||||
create table ti (a int auto_increment primary key) engine=innodb;
|
||||
|
@@ -248,3 +248,23 @@ one
|
||||
1
|
||||
drop table t1;
|
||||
start slave;
|
||||
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;
|
||||
drop table if exists t1;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't1'
|
||||
flush logs;
|
||||
stop slave;
|
||||
reset slave;
|
||||
start slave until master_log_file='master-bin.000001', master_log_pos=294 /* to stop right before DROP */;
|
||||
show tables /* t1 must exist */;
|
||||
Tables_in_test
|
||||
t1
|
||||
drop table t1;
|
||||
stop slave;
|
||||
reset slave;
|
||||
reset master;
|
||||
|
96
mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result
Normal file
96
mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result
Normal file
@@ -0,0 +1,96 @@
|
||||
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 TEMPORARY TABLE t1 (a INT);
|
||||
CREATE TABLE t2 (a INT, b INT) ENGINE= MyISAM;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
CREATE EVENT e1 ON SCHEDULE EVERY 10 HOUR DO SELECT 1;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
ALTER EVENT e1 ON SCHEDULE EVERY 20 HOUR DO SELECT 1;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
DROP EVENT IF EXISTS e1;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
CREATE PROCEDURE p1() SELECT 1;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
ALTER PROCEDURE p1 SQL SECURITY INVOKER;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
CREATE FUNCTION f1() RETURNS INT RETURN 123;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
ALTER FUNCTION f1 SQL SECURITY INVOKER;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
CREATE DATABASE mysqltest1;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
DROP DATABASE mysqltest1;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
CREATE USER test_1@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
GRANT SELECT ON t2 TO test_1@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
GRANT ALL ON f1 TO test_1@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
GRANT ALL ON p1 TO test_1@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
GRANT USAGE ON *.* TO test_1@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
REVOKE ALL PRIVILEGES ON f1 FROM test_1@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
REVOKE ALL PRIVILEGES ON p1 FROM test_1@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
REVOKE ALL PRIVILEGES ON t2 FROM test_1@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
REVOKE USAGE ON *.* FROM test_1@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
RENAME USER test_1@localhost TO test_2@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
DROP USER test_2@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
CREATE PROCEDURE p2()
|
||||
BEGIN
|
||||
# CREATE USER when a temporary table is open.
|
||||
CREATE TEMPORARY TABLE t3 (a INT);
|
||||
CREATE USER test_2@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
# GRANT select on table to user when a temporary table is open.
|
||||
GRANT SELECT ON t2 TO test_2@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
# GRANT all on function to user when a temporary table is open.
|
||||
GRANT ALL ON f1 TO test_2@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
# GRANT all on procedure to user when a temporary table is open.
|
||||
GRANT ALL ON p1 TO test_2@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
# GRANT usage on *.* to user when a temporary table is open.
|
||||
GRANT USAGE ON *.* TO test_2@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
# REVOKE ALL PRIVILEGES on function to user when a temporary table is open.
|
||||
REVOKE ALL PRIVILEGES ON f1 FROM test_2@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
# REVOKE ALL PRIVILEGES on procedure to user when a temporary table is open.
|
||||
REVOKE ALL PRIVILEGES ON p1 FROM test_2@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
# REVOKE ALL PRIVILEGES on table to user when a temporary table is open.
|
||||
REVOKE ALL PRIVILEGES ON t2 FROM test_2@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
# REVOKE usage on *.* from user when a temporary table is open.
|
||||
REVOKE USAGE ON *.* FROM test_2@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
# RENAME USER when a temporary table is open.
|
||||
RENAME USER test_2@localhost TO test_3@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
# DROP USER when a temporary table is open.
|
||||
DROP USER test_3@localhost;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
DROP TEMPORARY TABLE t3;
|
||||
END |
|
||||
DROP PROCEDURE p1;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
DROP PROCEDURE p2;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
DROP FUNCTION f1;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
DROP TABLE t2;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
DROP TEMPORARY TABLE t1;
|
@@ -8,6 +8,8 @@ call mtr.add_suppression("Unsafe statement binlogged in statement format since B
|
||||
connection master;
|
||||
call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT");
|
||||
|
||||
SET @@session.binlog_direct_non_transactional_updates= FALSE;
|
||||
|
||||
disable_warnings;
|
||||
DROP DATABASE IF EXISTS db1;
|
||||
enable_warnings;
|
||||
|
@@ -25,7 +25,9 @@ grant select on t to x@y;
|
||||
#
|
||||
rollback;
|
||||
show grants for x@y;
|
||||
source include/show_binlog_events.inc;
|
||||
--replace_result $VERSION VERSION
|
||||
--replace_regex /\/\* xid=.* \*\//\/* XID *\//
|
||||
show binlog events;
|
||||
start transaction;
|
||||
insert into t values (2);
|
||||
revoke select on t from x@y;
|
||||
@@ -35,7 +37,9 @@ revoke select on t from x@y;
|
||||
commit;
|
||||
select * from t;
|
||||
show grants for x@y;
|
||||
source include/show_binlog_events.inc;
|
||||
--replace_result $VERSION VERSION
|
||||
--replace_regex /\/\* xid=.* \*\//\/* XID *\//
|
||||
show binlog events;
|
||||
drop user x@y;
|
||||
drop database d1;
|
||||
--sync_slave_with_master
|
||||
|
@@ -67,4 +67,57 @@ SHOW EVENTS in mysqltest;
|
||||
|
||||
connection master;
|
||||
DROP DATABASE IF EXISTS mysqltest;
|
||||
|
||||
#
|
||||
# BUG#47418 RBR fails, failure with mixup of base/temporary/view TABLE DDL
|
||||
#
|
||||
# Before the patch for this bug, 'CREATE TABLE IF NOT EXIST ... SELECT'
|
||||
# statement was binlogged as a TEMPORARY table if the object existed as
|
||||
# a temporary table. This was caused by that the temporary table was opened
|
||||
# and the results of the 'SELECT' was inserted into the temporary table if
|
||||
# a temporary table existed with the same name.
|
||||
#
|
||||
# After the patch for this bug, the base table is created and the results of
|
||||
# the 'SELECT' are inserted into it, even though a temporary table exists with
|
||||
# the same name, and the statement is still binlogged as a base table.
|
||||
#
|
||||
|
||||
echo -------------BUG#47418-------------;
|
||||
connection master;
|
||||
USE test;
|
||||
DROP TABLE IF EXISTS t3;
|
||||
--enable_warnings
|
||||
CREATE TABLE t3(c1 INTEGER);
|
||||
INSERT INTO t3 VALUES(33);
|
||||
|
||||
CREATE TEMPORARY TABLE t1(c1 INTEGER);
|
||||
CREATE TEMPORARY TABLE t2(c1 INTEGER);
|
||||
INSERT INTO t1 VALUES(1);
|
||||
INSERT INTO t2 VALUES(1);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS t1(c1 INTEGER) SELECT c1 FROM t3;
|
||||
CREATE TABLE t2(c1 INTEGER) SELECT c1 FROM t3;
|
||||
|
||||
# In these two statements, t1 and t2 are the temporary table. there is only
|
||||
# value '1' in them. The records of t2 are not inserted into them.
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t2;
|
||||
sync_slave_with_master;
|
||||
|
||||
# In these two statements, t1 and t2 are the base table. The recoreds of t2
|
||||
# are inserted into it when CREATE TABLE ... SELECT was executed.
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t2;
|
||||
|
||||
connection master;
|
||||
DROP TEMPORARY TABLE t1;
|
||||
DROP TEMPORARY TABLE t2;
|
||||
#In these two statements, t1 and t2 are the base table.
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t2;
|
||||
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t3;
|
||||
|
||||
source include/master-slave-end.inc;
|
||||
|
@@ -34,4 +34,36 @@ connection master;
|
||||
drop database mysqltest;
|
||||
sync_slave_with_master;
|
||||
|
||||
#
|
||||
# Bug#49137
|
||||
# This test verifies if DROP MULTI TEMPORARY TABLE
|
||||
# will cause different errors on master and slave,
|
||||
# when one or more of these tables do not exist.
|
||||
#
|
||||
|
||||
connection master;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp1;
|
||||
CREATE TEMPORARY TABLE t1 ( a int );
|
||||
--error 1051
|
||||
DROP TEMPORARY TABLE t1, t2;
|
||||
--error 1051
|
||||
DROP TEMPORARY TABLE tmp2;
|
||||
sync_slave_with_master;
|
||||
|
||||
connection slave;
|
||||
stop slave;
|
||||
wait_for_slave_to_stop;
|
||||
|
||||
--echo **** On Master ****
|
||||
connection master;
|
||||
CREATE TEMPORARY TABLE tmp3 (a int);
|
||||
DROP TEMPORARY TABLE tmp3;
|
||||
|
||||
connection slave;
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
|
||||
START SLAVE;
|
||||
|
||||
connection master;
|
||||
sync_slave_with_master;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
26
mysql-test/suite/rpl/t/rpl_geometry.test
Normal file
26
mysql-test/suite/rpl/t/rpl_geometry.test
Normal file
@@ -0,0 +1,26 @@
|
||||
source include/master-slave.inc;
|
||||
source include/have_binlog_format_row.inc;
|
||||
|
||||
#
|
||||
# Bug#48776, Bug#43784
|
||||
#
|
||||
create table t1(a varchar(100),
|
||||
b multipoint not null,
|
||||
c varchar(256));
|
||||
|
||||
insert into t1 set
|
||||
a='hello',
|
||||
b=geomfromtext('multipoint(1 1)'),
|
||||
c='geometry';
|
||||
|
||||
create table t2 (a int(11) not null auto_increment primary key,
|
||||
b geometrycollection default null,
|
||||
c decimal(10,0));
|
||||
|
||||
insert into t2(c) values (null);
|
||||
|
||||
sync_slave_with_master;
|
||||
|
||||
connection master;
|
||||
drop table t1, t2;
|
||||
source include/master-slave-end.inc;
|
@@ -17,14 +17,13 @@
|
||||
source include/master-slave.inc;
|
||||
source include/have_debug.inc;
|
||||
|
||||
connection slave;
|
||||
call mtr.add_suppression("Slave I/O: Master command COM_REGISTER_SLAVE failed: .*");
|
||||
call mtr.add_suppression("Slave I/O: .* failed with error: Lost connection to MySQL server at 'reading initial communication packet'");
|
||||
call mtr.add_suppression("Slave I/O: Master command COM_REGISTER_SLAVE failed: failed registering on master, reconnecting to try again");
|
||||
call mtr.add_suppression("Get master clock failed with error: ");
|
||||
call mtr.add_suppression("Get master SERVER_ID failed with error: ");
|
||||
call mtr.add_suppression("Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; .*");
|
||||
call mtr.add_suppression("Slave I/O thread .* register on master");
|
||||
|
||||
#Test case 1: Try to get the value of the UNIX_TIMESTAMP from master under network disconnection
|
||||
connection slave;
|
||||
let $debug_saved= `select @@global.debug`;
|
||||
|
||||
let $debug_lock= "debug_lock.before_get_UNIX_TIMESTAMP";
|
||||
|
@@ -473,26 +473,22 @@ let $status_var_comparsion= >;
|
||||
# Circular replication
|
||||
--echo *** Circular replication ***
|
||||
# Configure circular replication
|
||||
--connection master
|
||||
RESET MASTER;
|
||||
let $master_binlog= query_get_value(SHOW MASTER STATUS, File, 1);
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10));
|
||||
--sync_slave_with_master
|
||||
--source include/master-slave-reset.inc
|
||||
--connection slave
|
||||
--source include/stop_slave.inc
|
||||
RESET MASTER;
|
||||
let $slave_binlog= query_get_value(SHOW MASTER STATUS, File, 1);
|
||||
RESET SLAVE;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT $master_binlog MASTER_BINLOG
|
||||
eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1, MASTER_LOG_FILE='$master_binlog';
|
||||
--connection master
|
||||
RESET SLAVE;
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT $slave_binlog SLAVE_BINLOG
|
||||
eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$SLAVE_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=1, MASTER_LOG_FILE='$slave_binlog';
|
||||
--source include/start_slave.inc
|
||||
|
||||
# Insert data on master and on slave and make sure that it replicated for both directions
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10));
|
||||
INSERT INTO t1 VALUES(1, 'on master');
|
||||
--save_master_pos
|
||||
--connection slave
|
||||
## set slave period 1/10 of master's
|
||||
CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD=0.1;
|
||||
--source include/start_slave.inc
|
||||
--sync_with_master
|
||||
INSERT INTO t1 VALUES(2, 'on slave');
|
||||
|
@@ -158,8 +158,7 @@ source include/kill_query_and_diff_master_slave.inc;
|
||||
|
||||
######## EVENT ########
|
||||
|
||||
let $diff_statement= SELECT event_name, event_body, execute_at
|
||||
FROM information_schema.events where event_name like 'e%';
|
||||
let $diff_statement= SELECT event_name, event_body, execute_at FROM information_schema.events where event_name like 'e%';
|
||||
|
||||
send CREATE EVENT e2
|
||||
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 DAY
|
||||
|
106
mysql-test/suite/rpl/t/rpl_manual_change_index_file.test
Normal file
106
mysql-test/suite/rpl/t/rpl_manual_change_index_file.test
Normal file
@@ -0,0 +1,106 @@
|
||||
source include/master-slave.inc;
|
||||
|
||||
#
|
||||
# BUG#28421 Infinite loop on slave relay logs
|
||||
#
|
||||
# That, manually deleteing one or more entries from 'master-bin.index', will
|
||||
# cause master infinitely loop to send one binlog file.
|
||||
#
|
||||
# Manually changing index file is a illegal action, so when this happen, we
|
||||
# send a fatal error to slave and close the dump session.
|
||||
|
||||
FLUSH LOGS;
|
||||
# Now, 2 entries in index file.
|
||||
# ./master-bin.000001
|
||||
# ./master-bin.000002
|
||||
|
||||
CREATE TABLE t1(c1 INT);
|
||||
# Now, the current dump file(master-bin.000002) is the second line of index
|
||||
# file
|
||||
sync_slave_with_master;
|
||||
# Now, all events has been replicate to slave. As current dump file
|
||||
# (master-bin.000002) is the last binlog file, so master is waiting for new
|
||||
# events.
|
||||
|
||||
connection master;
|
||||
# Delete './master-bin.000001' from index file.
|
||||
let $MYSQLD_DATADIR= `SELECT @@DATADIR`;
|
||||
let $file= $MYSQLD_DATADIR/master-bin.index;
|
||||
source include/truncate_file.inc;
|
||||
|
||||
if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) NOT IN ('Win32', 'Win64', 'Windows')`)
|
||||
{
|
||||
append_file $MYSQLD_DATADIR/master-bin.index;
|
||||
./master-bin.000002
|
||||
EOF
|
||||
sleep 0.00000001;
|
||||
}
|
||||
|
||||
if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) IN ('Win32', 'Win64', 'Windows')`)
|
||||
{
|
||||
append_file $MYSQLD_DATADIR/master-bin.index;
|
||||
.\master-bin.000002
|
||||
EOF
|
||||
sleep 0.00000001;
|
||||
}
|
||||
|
||||
# Now, only 1 entry in index file. ./master-bin.000002
|
||||
|
||||
# Generate master-bin.000003, but it is in the second line.
|
||||
FLUSH LOGS;
|
||||
# Now, 2 entries in index file.
|
||||
# ./master-bin.000002
|
||||
# ./master-bin.000003
|
||||
|
||||
# Now, master know that new binlog file(master-bin.000003) has been generated.
|
||||
# It expects that the new binlog file is in third line of index file, but
|
||||
# there is no third line in index file. It is so strange that master sends an
|
||||
# error to slave.
|
||||
call mtr.add_suppression('Got fatal error 1236 from master when reading data from binary log: .*could not find next log');
|
||||
connection slave;
|
||||
source include/wait_for_slave_io_to_stop.inc;
|
||||
let $last_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Error, 1);
|
||||
echo Last_IO_Error;
|
||||
echo $last_error;
|
||||
|
||||
connection master;
|
||||
|
||||
source include/truncate_file.inc;
|
||||
|
||||
if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) NOT IN ('Win32', 'Win64', 'Windows')`)
|
||||
{
|
||||
append_file $MYSQLD_DATADIR/master-bin.index;
|
||||
./master-bin.000001
|
||||
./master-bin.000002
|
||||
./master-bin.000003
|
||||
EOF
|
||||
sleep 0.00000001;
|
||||
}
|
||||
|
||||
if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) IN ('Win32', 'Win64', 'Windows')`)
|
||||
{
|
||||
append_file $MYSQLD_DATADIR/master-bin.index;
|
||||
.\master-bin.000001
|
||||
.\master-bin.000002
|
||||
.\master-bin.000003
|
||||
EOF
|
||||
sleep 0.00000001;
|
||||
}
|
||||
|
||||
CREATE TABLE t2(c1 INT);
|
||||
FLUSH LOGS;
|
||||
CREATE TABLE t3(c1 INT);
|
||||
FLUSH LOGS;
|
||||
CREATE TABLE t4(c1 INT);
|
||||
|
||||
connection slave;
|
||||
START SLAVE IO_THREAD;
|
||||
source include/wait_for_slave_io_to_start.inc;
|
||||
|
||||
connection master;
|
||||
sync_slave_with_master;
|
||||
SHOW TABLES;
|
||||
|
||||
connection master;
|
||||
DROP TABLE t1, t2, t3, t4;
|
||||
source include/master-slave-end.inc;
|
@@ -3,12 +3,16 @@
|
||||
#
|
||||
source include/master-slave.inc;
|
||||
|
||||
CALL mtr.add_suppression('Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT');
|
||||
|
||||
create table t1(id int, i int, r1 int, r2 int, p varchar(100));
|
||||
insert into t1 values(1, connection_id(), 0, 0, "");
|
||||
# don't put rand and password in the same query, to see if they replicate
|
||||
# independently
|
||||
# Pure rand test
|
||||
--disable_warnings
|
||||
insert into t1 values(2, 0, rand()*1000, rand()*1000, "");
|
||||
--enable_warnings
|
||||
# change the rand suite on the master (we do this because otherwise password()
|
||||
# benefits from the fact that the above rand() is well replicated :
|
||||
# it picks the same sequence element, which hides a possible bug in password() replication.
|
||||
@@ -19,7 +23,9 @@ set sql_log_bin=1;
|
||||
# Pure password test
|
||||
insert into t1 values(3, 0, 0, 0, password('does_this_work?'));
|
||||
# "altogether now"
|
||||
--disable_warnings
|
||||
insert into t1 values(4, connection_id(), rand()*1000, rand()*1000, password('does_this_still_work?'));
|
||||
--enable_warnings
|
||||
select * into outfile 'rpl_misc_functions.outfile' from t1;
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
sync_slave_with_master;
|
||||
@@ -73,11 +79,13 @@ DELIMITER ;|
|
||||
|
||||
# Exercise the functions and procedures then compare the results on
|
||||
# the master to those on the slave.
|
||||
--disable_warnings
|
||||
CALL test_replication_sp1();
|
||||
CALL test_replication_sp2();
|
||||
INSERT INTO t1 (col_a) VALUES (test_replication_sf());
|
||||
INSERT INTO t1 (col_a) VALUES (test_replication_sf());
|
||||
INSERT INTO t1 (col_a) VALUES (test_replication_sf());
|
||||
--enable_warnings
|
||||
|
||||
--sync_slave_with_master
|
||||
|
||||
|
@@ -17,6 +17,8 @@
|
||||
|
||||
--source include/master-slave.inc
|
||||
|
||||
CALL mtr.add_suppression('Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT');
|
||||
|
||||
CREATE TABLE t1 (a VARCHAR(1000));
|
||||
|
||||
# We replicate the connection_id in the query_log_event
|
||||
@@ -41,7 +43,9 @@ INSERT INTO t1 VALUES
|
||||
(UTC_TIMESTAMP());
|
||||
|
||||
# We replicate the random seed in a rand_log_event
|
||||
--disable_warnings
|
||||
INSERT INTO t1 VALUES (RAND());
|
||||
--enable_warnings
|
||||
# We replicate the last_insert_id in an intvar_log_event
|
||||
INSERT INTO t1 VALUES (LAST_INSERT_ID());
|
||||
|
||||
|
@@ -15,6 +15,7 @@
|
||||
|
||||
disable_query_log;
|
||||
call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT");
|
||||
CALL mtr.add_suppression('Statement may not be safe to log in statement format.');
|
||||
enable_query_log;
|
||||
|
||||
create table t1 (a int not null auto_increment primary key, b int, key(b));
|
||||
@@ -34,8 +35,8 @@ INSERT INTO t1 (a) SELECT null FROM t1;
|
||||
INSERT INTO t1 (a) SELECT null FROM t1;
|
||||
save_master_pos;
|
||||
# a few updates to force OPTIMIZE to do something
|
||||
update t1 set b=(a/2*rand());
|
||||
--disable_warnings
|
||||
update t1 set b=(a/2*rand());
|
||||
delete from t1 order by b limit 10000;
|
||||
--enable_warnings
|
||||
|
||||
|
@@ -2,38 +2,39 @@
|
||||
# BUG#42749: infinite loop writing to row based binlog - processlist shows
|
||||
# "freeing items"
|
||||
#
|
||||
#
|
||||
# WHY
|
||||
# ===
|
||||
#
|
||||
# This bug would make table map event to report data_written one byte less
|
||||
# than what would actually be written in its body. This would cause one byte shorter
|
||||
# event end_log_pos. The ultimate impact was that it would make fixing the
|
||||
# position in MYSQL_BIN_LOG::write_cache bogus or end up in an infinite loop.
|
||||
#
|
||||
# This bug would make table map event to report data_written one
|
||||
# byte less than what would actually be written in its body. This
|
||||
# would cause one byte shorter event end_log_pos. The ultimate
|
||||
# impact was that it would make fixing the position in
|
||||
# MYSQL_BIN_LOG::write_cache bogus or end up in an infinite loop.
|
||||
#
|
||||
# HOW
|
||||
# ===
|
||||
#
|
||||
# Checking that the patch fixes the problem is done as follows:
|
||||
# i) a table with several fields is created;
|
||||
#
|
||||
# i) one table with m_field_metadata sized at 290
|
||||
# ii) an insert is performed;
|
||||
# iii) the logs are flushed;
|
||||
# iv) mysqlbinlog is used to check if it succeeds.
|
||||
#
|
||||
# In step iv), before the bug was fixed, the test case would fail with
|
||||
# mysqlbinlog reporting that it was unable to succeed in reading the event.
|
||||
#
|
||||
# In step iv), before the bug was fixed, the test case would fail
|
||||
# with mysqlbinlog reporting that it was unable to succeed in
|
||||
# reading the event.
|
||||
|
||||
-- source include/have_log_bin.inc
|
||||
-- source include/master-slave.inc
|
||||
-- source include/have_innodb.inc
|
||||
-- source include/have_binlog_format_row.inc
|
||||
-- connection default
|
||||
|
||||
RESET MASTER;
|
||||
|
||||
-- disable_warnings
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
-- enable_warnings
|
||||
|
||||
-- echo ### TABLE with field_metadata_size == 290
|
||||
CREATE TABLE `t1` (
|
||||
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`c2` varchar(30) NOT NULL,
|
||||
@@ -185,15 +186,155 @@ CREATE TABLE `t1` (
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
LOCK TABLES `t1` WRITE;
|
||||
INSERT INTO `t1`(c2) VALUES ('1');
|
||||
FLUSH LOGS;
|
||||
|
||||
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','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','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','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1');
|
||||
-- sync_slave_with_master
|
||||
-- connection master
|
||||
|
||||
-- echo ### assertion: the slave replicated event successfully and tables match
|
||||
-- let $diff_table_1=master:test.t1
|
||||
-- let $diff_table_2=slave:test.t1
|
||||
-- source include/diff_tables.inc
|
||||
|
||||
DROP TABLE `t1`;
|
||||
|
||||
FLUSH LOGS;
|
||||
-- connection master
|
||||
-- sync_slave_with_master
|
||||
-- connection master
|
||||
|
||||
-- echo === Using mysqlbinlog to detect failure. Before the patch mysqlbinlog would find a corrupted event, thence would fail.
|
||||
|
||||
-- let $MYSQLD_DATADIR= `SELECT @@datadir`;
|
||||
-- exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug42749.binlog
|
||||
-- remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug42749.binlog
|
||||
|
||||
#############################################################
|
||||
# BUG#50018: binlog corruption when table has many columns
|
||||
#
|
||||
# Same test from BUG#42749, but now we generate some SQL which
|
||||
# creates and inserts into tables with metadata size from 249
|
||||
# to 258.
|
||||
#
|
||||
# The test works as follows:
|
||||
# 1. SQL for several CREATE TABLE and INSERTS are generated
|
||||
# into a file.
|
||||
# 2. This file is then "sourced"
|
||||
# 3. The slave is synchronized with the master
|
||||
# 4. FLUSH LOGS on master
|
||||
# 5. Compare tables on master and slave.
|
||||
# 6. run mysqlbinlog on master's binary log
|
||||
#
|
||||
# Steps #5 and #6 assert that binary log is not corrupted
|
||||
# in both cases: when slave is replaying events and when
|
||||
# mysqlbinlog is used to read the binary log
|
||||
|
||||
-- source include/master-slave-reset.inc
|
||||
-- connection master
|
||||
|
||||
# Create several tables with field_metadata_size ranging
|
||||
# from 249 to 258 (so that we cover 251 and 255 range).
|
||||
# This should exercise the switch between using 1 or 3
|
||||
# bytes to pack m_field_metadata_size.
|
||||
#
|
||||
# Each varchar field takes up to 2 metadata bytes, see:
|
||||
#
|
||||
# Field_varstring::do_save_field_metadata (field.cc)
|
||||
#
|
||||
# The float field takes 1 byte, see:
|
||||
#
|
||||
# Field_float::do_save_field_metadata (field.cc)
|
||||
#
|
||||
|
||||
-- let $generated_sql= $MYSQLTEST_VARDIR/tmp/b50018.sql
|
||||
-- let B50018_FILE= $generated_sql
|
||||
|
||||
-- echo ### action: generating several tables with different metadata
|
||||
-- echo ### sizes (resorting to perl)
|
||||
-- perl
|
||||
my $file= $ENV{'B50018_FILE'};
|
||||
open(FILE, ">", "$file") or die "Unable to open bug 50018 generated SQL file: $!" ;
|
||||
|
||||
my $tables= "";
|
||||
my $ntables= 10;
|
||||
my $base_ncols= 124;
|
||||
|
||||
for my $i (1..$ntables)
|
||||
{
|
||||
my $ncols= $base_ncols + $i;
|
||||
my $metadata_size= $ncols_variable * 2 + 1;
|
||||
|
||||
print FILE "-- echo ### testing table with " . ($base_ncols*2 + $i) . " field metadata size.\n";
|
||||
print FILE "CREATE TABLE t$i (\n";
|
||||
for my $n (1..$base_ncols)
|
||||
{
|
||||
print FILE "c$n VARCHAR(30) NOT NULL DEFAULT 'BUG#50018',\n";
|
||||
}
|
||||
|
||||
for my $n (1..$i)
|
||||
{
|
||||
print FILE "c" . ($base_ncols+$n) . " FLOAT NOT NULL DEFAULT 0";
|
||||
if ($n < $i)
|
||||
{
|
||||
print FILE ",\n";
|
||||
}
|
||||
}
|
||||
|
||||
print FILE ") Engine=InnoDB;\n";
|
||||
|
||||
$tables.= " t$i WRITE";
|
||||
if ($i < $ntables)
|
||||
{
|
||||
$tables .=",";
|
||||
}
|
||||
|
||||
print FILE "LOCK TABLES t$i WRITE;\n";
|
||||
print FILE "INSERT INTO t$i(c". ($base_ncols+1) . ") VALUES (50018);\n";
|
||||
print FILE "UNLOCK TABLES;";
|
||||
}
|
||||
|
||||
close(FILE);
|
||||
|
||||
EOF
|
||||
|
||||
## we don't need this in the result file
|
||||
## however, for debugging purposes you
|
||||
## may want to reactivate query logging
|
||||
-- disable_query_log
|
||||
-- source $generated_sql
|
||||
-- enable_query_log
|
||||
|
||||
-- sync_slave_with_master
|
||||
-- connection master
|
||||
|
||||
FLUSH LOGS;
|
||||
|
||||
-- let $ntables=10
|
||||
while($ntables)
|
||||
{
|
||||
-- echo ### assertion: the slave replicated event successfully and tables match for t$ntables
|
||||
-- let $diff_table_1=master:test.t$ntables
|
||||
-- let $diff_table_2=slave:test.t$ntables
|
||||
-- source include/diff_tables.inc
|
||||
|
||||
-- connection master
|
||||
-- disable_query_log
|
||||
-- eval DROP TABLE t$ntables
|
||||
-- enable_query_log
|
||||
-- sync_slave_with_master
|
||||
-- connection master
|
||||
|
||||
-- dec $ntables
|
||||
}
|
||||
|
||||
-- echo ### assertion: check that binlog is not corrupt. Using mysqlbinlog to
|
||||
-- echo ### detect failure. Before the patch mysqlbinlog would find
|
||||
-- echo ### a corrupted event, thence would fail.
|
||||
-- let $MYSQLD_DATADIR= `SELECT @@datadir`;
|
||||
-- exec $MYSQL_BINLOG -v --hex $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug50018.binlog
|
||||
|
||||
## clean up
|
||||
## For debugging purposes you might want not to remove these
|
||||
-- remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug50018.binlog
|
||||
-- remove_file $generated_sql
|
||||
-- source include/master-slave-end.inc
|
6
mysql-test/suite/rpl/t/rpl_set_null_innodb.test
Normal file
6
mysql-test/suite/rpl/t/rpl_set_null_innodb.test
Normal file
@@ -0,0 +1,6 @@
|
||||
-- source include/have_binlog_format_mixed_or_row.inc
|
||||
-- source include/master-slave.inc
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
-- let $engine= InnoDB
|
||||
-- source extra/rpl_tests/rpl_set_null.test
|
5
mysql-test/suite/rpl/t/rpl_set_null_myisam.test
Normal file
5
mysql-test/suite/rpl/t/rpl_set_null_myisam.test
Normal file
@@ -0,0 +1,5 @@
|
||||
-- source include/have_binlog_format_mixed_or_row.inc
|
||||
-- source include/master-slave.inc
|
||||
|
||||
-- let $engine= MyISAM
|
||||
-- source extra/rpl_tests/rpl_set_null.test
|
1
mysql-test/suite/rpl/t/rpl_stm_binlog_direct-master.opt
Normal file
1
mysql-test/suite/rpl/t/rpl_stm_binlog_direct-master.opt
Normal file
@@ -0,0 +1 @@
|
||||
--binlog-direct-non-transactional-updates
|
@@ -5,4 +5,5 @@
|
||||
--source include/have_binlog_format_statement.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
SET @@session.binlog_direct_non_transactional_updates= FALSE;
|
||||
--source ./extra/rpl_tests/rpl_start_stop_slave.test
|
||||
|
@@ -6,4 +6,5 @@
|
||||
-- source include/have_innodb.inc
|
||||
-- source include/have_binlog_format_statement.inc
|
||||
|
||||
SET @@session.binlog_direct_non_transactional_updates= FALSE;
|
||||
-- source extra/rpl_tests/rpl_stop_middle_group.test
|
||||
|
@@ -164,4 +164,39 @@ connection slave;
|
||||
start slave;
|
||||
sync_with_master;
|
||||
|
||||
# Bug #47142 "slave start until" stops 1 event too late in 4.1 to 5.0 replication
|
||||
#
|
||||
# testing fixes that refine the start position of prior-5.0 master's event
|
||||
# and by that provide correct execution of
|
||||
# START SLAVE UNTIL ... master_log_pos= x;
|
||||
# Keep the test at the end of the file because it manipulates with binlog files
|
||||
# to substitute the genuine one with a prepared on 4.1 server.
|
||||
#
|
||||
|
||||
--source include/master-slave-reset.inc
|
||||
|
||||
connection master;
|
||||
drop table if exists t1; # there is create table t1 in bug47142_master-bin.000001
|
||||
flush logs;
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
--remove_file $MYSQLD_DATADIR/master-bin.000001
|
||||
--copy_file $MYSQL_TEST_DIR/std_data/bug47142_master-bin.000001 $MYSQLD_DATADIR/master-bin.000001
|
||||
|
||||
connection slave;
|
||||
stop slave;
|
||||
reset slave;
|
||||
start slave until master_log_file='master-bin.000001', master_log_pos=294 /* to stop right before DROP */;
|
||||
--source include/wait_for_slave_sql_to_stop.inc
|
||||
|
||||
show tables /* t1 must exist */;
|
||||
|
||||
# clean-up of Bug #47142 testing
|
||||
|
||||
drop table t1; # drop on slave only, master does not have t1.
|
||||
stop slave;
|
||||
reset slave;
|
||||
|
||||
connection master;
|
||||
reset master;
|
||||
|
||||
# End of tests
|
||||
|
13
mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test
Normal file
13
mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test
Normal file
@@ -0,0 +1,13 @@
|
||||
#
|
||||
# Bug#49132
|
||||
# This test verifies if executing DDL statement before trying to manipulate
|
||||
# a temporary table causes row-based replication to break with error 'table
|
||||
# does not exist' base on myisam engine.
|
||||
#
|
||||
|
||||
source include/master-slave.inc;
|
||||
source include/have_binlog_format_row.inc;
|
||||
|
||||
LET $ENGINE_TYPE= MyISAM;
|
||||
source extra/rpl_tests/rpl_tmp_table_and_DDL.test;
|
||||
|
@@ -524,7 +524,7 @@ id hex(b1) vc bc d f total y t
|
||||
--- Check Update on slave ---
|
||||
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
|
||||
id hex(b1) vc bc d f total y t
|
||||
412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
|
||||
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
|
||||
--- Remove a record from t1 on master ---
|
||||
DELETE FROM t1 WHERE id = 42;
|
||||
--- Show current count on master for t1 ---
|
||||
|
@@ -4,6 +4,7 @@ reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
CALL mtr.add_suppression('Statement may not be safe to log in statement format.');
|
||||
DROP FUNCTION IF EXISTS test.f1;
|
||||
DROP TABLE IF EXISTS test.t1;
|
||||
CREATE TABLE test.t1 (a INT NOT NULL AUTO_INCREMENT, c CHAR(16),PRIMARY KEY(a))ENGINE=NDB;
|
||||
|
35
mysql-test/suite/rpl_ndb/r/rpl_ndb_set_null.result
Normal file
35
mysql-test/suite/rpl_ndb/r/rpl_ndb_set_null.result
Normal file
@@ -0,0 +1,35 @@
|
||||
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;
|
||||
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 BIT, c2 INT) Engine=NDB;
|
||||
INSERT INTO `t1` VALUES ( 1, 1 );
|
||||
UPDATE t1 SET c1=NULL where c2=1;
|
||||
Comparing tables master:test.t1 and slave:test.t1
|
||||
DELETE FROM t1 WHERE c2=1 LIMIT 1;
|
||||
Comparing tables master:test.t1 and slave:test.t1
|
||||
DROP TABLE t1;
|
||||
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 CHAR) Engine=NDB;
|
||||
INSERT INTO t1 ( c1 ) VALUES ( 'w' ) ;
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
w
|
||||
UPDATE t1 SET c1=NULL WHERE c1='w';
|
||||
Comparing tables master:test.t1 and slave:test.t1
|
||||
DELETE FROM t1 LIMIT 2;
|
||||
Comparing tables master:test.t1 and slave:test.t1
|
||||
DROP TABLE t1;
|
6
mysql-test/suite/rpl_ndb/t/rpl_ndb_set_null.test
Normal file
6
mysql-test/suite/rpl_ndb/t/rpl_ndb_set_null.test
Normal file
@@ -0,0 +1,6 @@
|
||||
-- source include/have_ndb.inc
|
||||
-- source include/have_binlog_format_mixed_or_row.inc
|
||||
-- source include/ndb_master-slave.inc
|
||||
|
||||
-- let $engine= NDB
|
||||
-- source extra/rpl_tests/rpl_set_null.test
|
@@ -0,0 +1,76 @@
|
||||
SELECT @@GLOBAL.binlog_direct_non_transactional_updates;
|
||||
@@GLOBAL.binlog_direct_non_transactional_updates
|
||||
1
|
||||
'#---------------------BS_STVARS_002_01----------------------#'
|
||||
SET @start_value= @@global.binlog_direct_non_transactional_updates;
|
||||
SELECT COUNT(@@GLOBAL.binlog_direct_non_transactional_updates);
|
||||
COUNT(@@GLOBAL.binlog_direct_non_transactional_updates)
|
||||
1
|
||||
1 Expected
|
||||
SELECT COUNT(@@SESSION.binlog_direct_non_transactional_updates);
|
||||
COUNT(@@SESSION.binlog_direct_non_transactional_updates)
|
||||
1
|
||||
1 Expected
|
||||
'#---------------------BS_STVARS_002_02----------------------#'
|
||||
SET @@GLOBAL.binlog_direct_non_transactional_updates=TRUE;
|
||||
SELECT @@GLOBAL.binlog_direct_non_transactional_updates;
|
||||
@@GLOBAL.binlog_direct_non_transactional_updates
|
||||
1
|
||||
SET @@SESSION.binlog_direct_non_transactional_updates=TRUE;
|
||||
SELECT @@SESSION.binlog_direct_non_transactional_updates;
|
||||
@@SESSION.binlog_direct_non_transactional_updates
|
||||
1
|
||||
'#---------------------BS_STVARS_002_03----------------------#'
|
||||
SELECT
|
||||
IF(@@GLOBAL.binlog_direct_non_transactional_updates, "ON", "OFF") = VARIABLE_VALUE
|
||||
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
|
||||
WHERE VARIABLE_NAME='binlog_direct_non_transactional_updates';
|
||||
IF(@@GLOBAL.binlog_direct_non_transactional_updates, "ON", "OFF") = VARIABLE_VALUE
|
||||
1
|
||||
1 Expected
|
||||
SELECT COUNT(@@GLOBAL.binlog_direct_non_transactional_updates);
|
||||
COUNT(@@GLOBAL.binlog_direct_non_transactional_updates)
|
||||
1
|
||||
1 Expected
|
||||
SELECT COUNT(VARIABLE_VALUE)
|
||||
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
|
||||
WHERE VARIABLE_NAME='binlog_direct_non_transactional_updates';
|
||||
COUNT(VARIABLE_VALUE)
|
||||
1
|
||||
1 Expected
|
||||
'#---------------------BS_STVARS_002_04----------------------#'
|
||||
SELECT
|
||||
IF(@@SESSION.binlog_direct_non_transactional_updates, "ON", "OFF") = VARIABLE_VALUE
|
||||
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
|
||||
WHERE VARIABLE_NAME='binlog_direct_non_transactional_updates';
|
||||
IF(@@SESSION.binlog_direct_non_transactional_updates, "ON", "OFF") = VARIABLE_VALUE
|
||||
1
|
||||
1 Expected
|
||||
SELECT COUNT(@@SESSION.binlog_direct_non_transactional_updates);
|
||||
COUNT(@@SESSION.binlog_direct_non_transactional_updates)
|
||||
1
|
||||
1 Expected
|
||||
SELECT COUNT(VARIABLE_VALUE)
|
||||
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
|
||||
WHERE VARIABLE_NAME='binlog_direct_non_transactional_updates';
|
||||
COUNT(VARIABLE_VALUE)
|
||||
1
|
||||
1 Expected
|
||||
'#---------------------BS_STVARS_002_05----------------------#'
|
||||
SELECT COUNT(@@binlog_direct_non_transactional_updates);
|
||||
COUNT(@@binlog_direct_non_transactional_updates)
|
||||
1
|
||||
1 Expected
|
||||
SELECT COUNT(@@local.binlog_direct_non_transactional_updates);
|
||||
COUNT(@@local.binlog_direct_non_transactional_updates)
|
||||
1
|
||||
1 Expected
|
||||
SELECT COUNT(@@SESSION.binlog_direct_non_transactional_updates);
|
||||
COUNT(@@SESSION.binlog_direct_non_transactional_updates)
|
||||
1
|
||||
1 Expected
|
||||
SELECT COUNT(@@GLOBAL.binlog_direct_non_transactional_updates);
|
||||
COUNT(@@GLOBAL.binlog_direct_non_transactional_updates)
|
||||
1
|
||||
1 Expected
|
||||
SET @@global.binlog_direct_non_transactional_updates= @start_value;
|
@@ -22,13 +22,13 @@ VARIABLE_NAME VARIABLE_VALUE
|
||||
SQL_LOG_UPDATE ON
|
||||
set global sql_log_update=1;
|
||||
Warnings:
|
||||
Note 1315 The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored
|
||||
Note 1315 The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored. This option will be removed in MySQL 5.6.
|
||||
select @@global.sql_log_update;
|
||||
@@global.sql_log_update
|
||||
1
|
||||
set session sql_log_update=ON;
|
||||
Warnings:
|
||||
Note 1315 The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored
|
||||
Note 1315 The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored. This option will be removed in MySQL 5.6.
|
||||
select @@session.sql_log_update;
|
||||
@@session.sql_log_update
|
||||
1
|
||||
@@ -40,7 +40,7 @@ set global sql_log_update="foo";
|
||||
ERROR 42000: Variable 'sql_log_update' can't be set to the value of 'foo'
|
||||
SET @@global.sql_log_update = @start_global_value;
|
||||
Warnings:
|
||||
Note 1315 The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored
|
||||
Note 1315 The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored. This option will be removed in MySQL 5.6.
|
||||
SELECT @@global.sql_log_update;
|
||||
@@global.sql_log_update
|
||||
1
|
||||
|
@@ -0,0 +1,97 @@
|
||||
######### mysql-test\t\binlog_direct_non_transactional_updates.test ###########
|
||||
# #
|
||||
# Variable Name: binlog_direct_non_transactional_updates #
|
||||
# Scope: Global & Session #
|
||||
# Access Type: Static #
|
||||
# Data Type: bool #
|
||||
# #
|
||||
# Description:Test Cases of Dynamic System Variable #
|
||||
# binlog_direct_non_transactional_updates #
|
||||
# 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 #
|
||||
# #
|
||||
###############################################################################
|
||||
|
||||
SELECT @@GLOBAL.binlog_direct_non_transactional_updates;
|
||||
|
||||
--echo '#---------------------BS_STVARS_002_01----------------------#'
|
||||
####################################################################
|
||||
# Displaying default value #
|
||||
####################################################################
|
||||
SET @start_value= @@global.binlog_direct_non_transactional_updates;
|
||||
|
||||
SELECT COUNT(@@GLOBAL.binlog_direct_non_transactional_updates);
|
||||
--echo 1 Expected
|
||||
|
||||
SELECT COUNT(@@SESSION.binlog_direct_non_transactional_updates);
|
||||
--echo 1 Expected
|
||||
|
||||
--echo '#---------------------BS_STVARS_002_02----------------------#'
|
||||
####################################################################
|
||||
# Check if Value can set #
|
||||
####################################################################
|
||||
SET @@GLOBAL.binlog_direct_non_transactional_updates=TRUE;
|
||||
SELECT @@GLOBAL.binlog_direct_non_transactional_updates;
|
||||
|
||||
SET @@SESSION.binlog_direct_non_transactional_updates=TRUE;
|
||||
SELECT @@SESSION.binlog_direct_non_transactional_updates;
|
||||
|
||||
--echo '#---------------------BS_STVARS_002_03----------------------#'
|
||||
#################################################################
|
||||
# Check if the value in GLOBAL Table matches value in variable #
|
||||
#################################################################
|
||||
|
||||
SELECT
|
||||
IF(@@GLOBAL.binlog_direct_non_transactional_updates, "ON", "OFF") = VARIABLE_VALUE
|
||||
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
|
||||
WHERE VARIABLE_NAME='binlog_direct_non_transactional_updates';
|
||||
--echo 1 Expected
|
||||
|
||||
SELECT COUNT(@@GLOBAL.binlog_direct_non_transactional_updates);
|
||||
--echo 1 Expected
|
||||
|
||||
SELECT COUNT(VARIABLE_VALUE)
|
||||
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
|
||||
WHERE VARIABLE_NAME='binlog_direct_non_transactional_updates';
|
||||
--echo 1 Expected
|
||||
|
||||
|
||||
--echo '#---------------------BS_STVARS_002_04----------------------#'
|
||||
#################################################################
|
||||
# Check if the value in SESSION Table matches value in variable #
|
||||
#################################################################
|
||||
|
||||
SELECT
|
||||
IF(@@SESSION.binlog_direct_non_transactional_updates, "ON", "OFF") = VARIABLE_VALUE
|
||||
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
|
||||
WHERE VARIABLE_NAME='binlog_direct_non_transactional_updates';
|
||||
--echo 1 Expected
|
||||
|
||||
SELECT COUNT(@@SESSION.binlog_direct_non_transactional_updates);
|
||||
--echo 1 Expected
|
||||
|
||||
SELECT COUNT(VARIABLE_VALUE)
|
||||
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
|
||||
WHERE VARIABLE_NAME='binlog_direct_non_transactional_updates';
|
||||
--echo 1 Expected
|
||||
|
||||
|
||||
--echo '#---------------------BS_STVARS_002_05----------------------#'
|
||||
################################################################################
|
||||
# Check if binlog_format can be accessed with and without @@ sign #
|
||||
################################################################################
|
||||
|
||||
SELECT COUNT(@@binlog_direct_non_transactional_updates);
|
||||
--echo 1 Expected
|
||||
SELECT COUNT(@@local.binlog_direct_non_transactional_updates);
|
||||
--echo 1 Expected
|
||||
SELECT COUNT(@@SESSION.binlog_direct_non_transactional_updates);
|
||||
--echo 1 Expected
|
||||
SELECT COUNT(@@GLOBAL.binlog_direct_non_transactional_updates);
|
||||
--echo 1 Expected
|
||||
|
||||
SET @@global.binlog_direct_non_transactional_updates= @start_value;
|
Reference in New Issue
Block a user