mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
merge 5.1 main -> 5.1-rpl-testfixes
all changes automerged without conflicts
This commit is contained in:
@ -1,17 +1,43 @@
|
|||||||
# Test of binlogging of INSERT_ID with INSERT DELAYED
|
# ==== Purpose ====
|
||||||
|
#
|
||||||
|
# Verify that INSERT DELAYED in mixed or row mode writes events to the
|
||||||
|
# binlog, and that AUTO_INCREMENT works correctly.
|
||||||
|
#
|
||||||
|
# ==== Method ====
|
||||||
|
#
|
||||||
|
# Insert both single and multiple rows into an autoincrement column,
|
||||||
|
# both with specified value and with NULL.
|
||||||
|
#
|
||||||
|
# With INSERT DELAYED, the rows do not show up in the table
|
||||||
|
# immediately, so we must do source include/wait_until_rows_count.inc
|
||||||
|
# between any two INSERT DELAYED statements. Moreover, if mixed or
|
||||||
|
# row-based logging is used, there is also a delay between when rows
|
||||||
|
# show up in the table and when they show up in the binlog. To ensure
|
||||||
|
# that the rows show up in the binlog, we call FLUSH TABLES, which
|
||||||
|
# waits until the delayed_insert thread has finished.
|
||||||
|
#
|
||||||
|
# We cannot read the binlog after executing INSERT DELAYED statements
|
||||||
|
# that insert multiple rows, because that is nondeterministic. More
|
||||||
|
# precisely, rows may be written in batches to the binlog, where each
|
||||||
|
# batch has one Table_map_log_event and one or more
|
||||||
|
# Write_rows_log_event. The number of rows included in each batch is
|
||||||
|
# nondeterministic.
|
||||||
|
#
|
||||||
|
# ==== Related bugs ====
|
||||||
|
#
|
||||||
|
# BUG#20627: INSERT DELAYED does not honour auto_increment_* variables
|
||||||
|
# Bug in this test: BUG#38068: binlog_stm_binlog fails sporadically in pushbuild
|
||||||
|
|
||||||
|
|
||||||
create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
|
create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
|
||||||
# First, avoid BUG#20627:
|
|
||||||
set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
|
|
||||||
# Verify that only one INSERT_ID event is binlogged.
|
|
||||||
# Note, that because of WL#3368 mixed mode binlog records RBR events for the delayed
|
|
||||||
let $table=t1;
|
let $table=t1;
|
||||||
let $rows_inserted=11; # total number of inserted rows in this test
|
let $count=0;
|
||||||
|
|
||||||
insert delayed into t1 values (207);
|
insert delayed into t1 values (207);
|
||||||
let $count=1;
|
inc $count;
|
||||||
|
|
||||||
# use this macro instead of sleeps.
|
|
||||||
|
|
||||||
--source include/wait_until_rows_count.inc
|
--source include/wait_until_rows_count.inc
|
||||||
|
|
||||||
insert delayed into t1 values (null);
|
insert delayed into t1 values (null);
|
||||||
inc $count;
|
inc $count;
|
||||||
--source include/wait_until_rows_count.inc
|
--source include/wait_until_rows_count.inc
|
||||||
@ -20,9 +46,10 @@ insert delayed into t1 values (300);
|
|||||||
inc $count;
|
inc $count;
|
||||||
--source include/wait_until_rows_count.inc
|
--source include/wait_until_rows_count.inc
|
||||||
|
|
||||||
# moving binlog check affront of multi-rows queries which work is indeterministic (extra table_maps)
|
# It is not enough to wait until all rows have been inserted into the
|
||||||
# todo: better check is to substitute SHOW BINLOG with reading from binlog, probably bug#19459 is in
|
# table. FLUSH TABLES ensures that they are in the binlog too. See
|
||||||
# the way
|
# comment above.
|
||||||
|
FLUSH TABLES;
|
||||||
source include/show_binlog_events.inc;
|
source include/show_binlog_events.inc;
|
||||||
|
|
||||||
insert delayed into t1 values (null),(null),(null),(null);
|
insert delayed into t1 values (null),(null),(null),(null);
|
||||||
@ -33,8 +60,5 @@ insert delayed into t1 values (null),(null),(400),(null);
|
|||||||
inc $count; inc $count; inc $count; inc $count;
|
inc $count; inc $count; inc $count; inc $count;
|
||||||
--source include/wait_until_rows_count.inc
|
--source include/wait_until_rows_count.inc
|
||||||
|
|
||||||
#check this assertion about $count calculation
|
|
||||||
--echo $count == $rows_inserted
|
|
||||||
|
|
||||||
select * from t1;
|
select * from t1;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
@ -4,7 +4,7 @@ if (!$binlog_start)
|
|||||||
{
|
{
|
||||||
let $binlog_start=106;
|
let $binlog_start=106;
|
||||||
}
|
}
|
||||||
--replace_result $binlog_start <binlog_start>
|
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR $binlog_start <binlog_start>
|
||||||
--replace_column 2 # 4 # 5 #
|
--replace_column 2 # 4 # 5 #
|
||||||
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /file_id=[0-9]+/file_id=#/
|
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/
|
||||||
--eval show binlog events from $binlog_start
|
--eval show binlog events from $binlog_start
|
||||||
|
@ -18,7 +18,7 @@ load data infile '../std_data_ln/rpl_loaddata.dat' into table t2 /* will be "kil
|
|||||||
ERROR 70100: Query execution was interrupted
|
ERROR 70100: Query execution was interrupted
|
||||||
show binlog events from <binlog_start>;
|
show binlog events from <binlog_start>;
|
||||||
Log_name Pos Event_type Server_id End_log_pos Info
|
Log_name Pos Event_type Server_id End_log_pos Info
|
||||||
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=12
|
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
|
||||||
master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t2 /* will be "killed" in the middle */ ;file_id=#
|
master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t2 /* will be "killed" in the middle */ ;file_id=#
|
||||||
select
|
select
|
||||||
(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
|
(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
|
||||||
|
@ -1141,10 +1141,10 @@ master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F
|
|||||||
master-bin.000001 # Query # # use `mysql`; COMMIT
|
master-bin.000001 # Query # # use `mysql`; COMMIT
|
||||||
drop table t1,t2,t3,tt1;
|
drop table t1,t2,t3,tt1;
|
||||||
create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
|
create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
|
||||||
set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
|
|
||||||
insert delayed into t1 values (207);
|
insert delayed into t1 values (207);
|
||||||
insert delayed into t1 values (null);
|
insert delayed into t1 values (null);
|
||||||
insert delayed into t1 values (300);
|
insert delayed into t1 values (300);
|
||||||
|
FLUSH TABLES;
|
||||||
show binlog events from <binlog_start>;
|
show binlog events from <binlog_start>;
|
||||||
Log_name Pos Event_type Server_id End_log_pos Info
|
Log_name Pos Event_type Server_id End_log_pos Info
|
||||||
master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key)
|
master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key)
|
||||||
@ -1188,9 +1188,9 @@ master-bin.000001 # Query # # use `test`; BEGIN
|
|||||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||||
master-bin.000001 # Query # # use `test`; COMMIT
|
master-bin.000001 # Query # # use `test`; COMMIT
|
||||||
|
master-bin.000001 # Query # # use `test`; FLUSH TABLES
|
||||||
insert delayed into t1 values (null),(null),(null),(null);
|
insert delayed into t1 values (null),(null),(null),(null);
|
||||||
insert delayed into t1 values (null),(null),(400),(null);
|
insert delayed into t1 values (null),(null),(400),(null);
|
||||||
11 == 11
|
|
||||||
select * from t1;
|
select * from t1;
|
||||||
a
|
a
|
||||||
207
|
207
|
||||||
|
@ -926,7 +926,7 @@ Log_name Pos Event_type Server_id End_log_pos Info
|
|||||||
master-bin.000001 # Query # # use `test`; BEGIN
|
master-bin.000001 # Query # # use `test`; BEGIN
|
||||||
master-bin.000001 # Intvar # # INSERT_ID=10
|
master-bin.000001 # Intvar # # INSERT_ID=10
|
||||||
master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
|
master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
|
||||||
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=12
|
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
|
||||||
master-bin.000001 # Intvar # # INSERT_ID=10
|
master-bin.000001 # Intvar # # INSERT_ID=10
|
||||||
master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
|
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_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=#
|
master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=#
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
|
create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
|
||||||
set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
|
|
||||||
insert delayed into t1 values (207);
|
insert delayed into t1 values (207);
|
||||||
insert delayed into t1 values (null);
|
insert delayed into t1 values (null);
|
||||||
insert delayed into t1 values (300);
|
insert delayed into t1 values (300);
|
||||||
|
FLUSH TABLES;
|
||||||
show binlog events from <binlog_start>;
|
show binlog events from <binlog_start>;
|
||||||
Log_name Pos Event_type Server_id End_log_pos Info
|
Log_name Pos Event_type Server_id End_log_pos Info
|
||||||
master-bin.000001 # Query # # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam
|
master-bin.000001 # Query # # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam
|
||||||
@ -10,9 +10,9 @@ master-bin.000001 # Query # # use `test`; insert delayed into t1 values (207)
|
|||||||
master-bin.000001 # Intvar # # INSERT_ID=208
|
master-bin.000001 # Intvar # # INSERT_ID=208
|
||||||
master-bin.000001 # Query # # use `test`; insert delayed into t1 values (null)
|
master-bin.000001 # Query # # use `test`; insert delayed into t1 values (null)
|
||||||
master-bin.000001 # Query # # use `test`; insert delayed into t1 values (300)
|
master-bin.000001 # Query # # use `test`; insert delayed into t1 values (300)
|
||||||
|
master-bin.000001 # Query # # use `test`; FLUSH TABLES
|
||||||
insert delayed into t1 values (null),(null),(null),(null);
|
insert delayed into t1 values (null),(null),(null),(null);
|
||||||
insert delayed into t1 values (null),(null),(400),(null);
|
insert delayed into t1 values (null),(null),(400),(null);
|
||||||
11 == 11
|
|
||||||
select * from t1;
|
select * from t1;
|
||||||
a
|
a
|
||||||
207
|
207
|
||||||
|
@ -629,10 +629,10 @@ master-bin.000001 # Query # # use `mysql`; UPDATE user SET password=password('An
|
|||||||
master-bin.000001 # Query # # use `mysql`; DELETE FROM user WHERE host='localhost' AND user='@#@'
|
master-bin.000001 # Query # # use `mysql`; DELETE FROM user WHERE host='localhost' AND user='@#@'
|
||||||
drop table t1,t2,t3,tt1;
|
drop table t1,t2,t3,tt1;
|
||||||
create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
|
create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
|
||||||
set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
|
|
||||||
insert delayed into t1 values (207);
|
insert delayed into t1 values (207);
|
||||||
insert delayed into t1 values (null);
|
insert delayed into t1 values (null);
|
||||||
insert delayed into t1 values (300);
|
insert delayed into t1 values (300);
|
||||||
|
FLUSH TABLES;
|
||||||
show binlog events from <binlog_start>;
|
show binlog events from <binlog_start>;
|
||||||
Log_name Pos Event_type Server_id End_log_pos Info
|
Log_name Pos Event_type Server_id End_log_pos Info
|
||||||
master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key)
|
master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key)
|
||||||
@ -660,9 +660,9 @@ master-bin.000001 # Query # # use `test`; BEGIN
|
|||||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||||
master-bin.000001 # Query # # use `test`; COMMIT
|
master-bin.000001 # Query # # use `test`; COMMIT
|
||||||
|
master-bin.000001 # Query # # use `test`; FLUSH TABLES
|
||||||
insert delayed into t1 values (null),(null),(null),(null);
|
insert delayed into t1 values (null),(null),(null),(null);
|
||||||
insert delayed into t1 values (null),(null),(400),(null);
|
insert delayed into t1 values (null),(null),(400),(null);
|
||||||
11 == 11
|
|
||||||
select * from t1;
|
select * from t1;
|
||||||
a
|
a
|
||||||
207
|
207
|
||||||
|
@ -623,7 +623,7 @@ show binlog events from <binlog_start>;
|
|||||||
Log_name Pos Event_type Server_id End_log_pos Info
|
Log_name Pos Event_type Server_id End_log_pos Info
|
||||||
master-bin.000001 # Query # # use `test`; BEGIN
|
master-bin.000001 # Query # # use `test`; BEGIN
|
||||||
master-bin.000001 # Intvar # # INSERT_ID=10
|
master-bin.000001 # Intvar # # INSERT_ID=10
|
||||||
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=12
|
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
|
||||||
master-bin.000001 # Intvar # # INSERT_ID=10
|
master-bin.000001 # Intvar # # INSERT_ID=10
|
||||||
master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=#
|
master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=#
|
||||||
master-bin.000001 # Query # # use `test`; ROLLBACK
|
master-bin.000001 # Query # # use `test`; ROLLBACK
|
||||||
@ -858,7 +858,7 @@ Log_name Pos Event_type Server_id End_log_pos Info
|
|||||||
master-bin.000001 # Query # # use `test`; BEGIN
|
master-bin.000001 # Query # # use `test`; BEGIN
|
||||||
master-bin.000001 # Intvar # # INSERT_ID=10
|
master-bin.000001 # Intvar # # INSERT_ID=10
|
||||||
master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
|
master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
|
||||||
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=12
|
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
|
||||||
master-bin.000001 # Intvar # # INSERT_ID=10
|
master-bin.000001 # Intvar # # INSERT_ID=10
|
||||||
master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
|
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_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=#
|
master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=#
|
||||||
|
@ -4,6 +4,8 @@ reset master;
|
|||||||
reset slave;
|
reset slave;
|
||||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||||
start slave;
|
start slave;
|
||||||
|
==== Create a big file ====
|
||||||
|
==== Load our big file into a table ====
|
||||||
create table t2 (id int not null primary key auto_increment);
|
create table t2 (id int not null primary key auto_increment);
|
||||||
select @@session.read_buffer_size - @@session.max_allowed_packet > 0 ;
|
select @@session.read_buffer_size - @@session.max_allowed_packet > 0 ;
|
||||||
@@session.read_buffer_size - @@session.max_allowed_packet > 0
|
@@session.read_buffer_size - @@session.max_allowed_packet > 0
|
||||||
@ -12,15 +14,18 @@ load data infile 'MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' into table t2;
|
|||||||
select count(*) from t2 /* 5 000 */;
|
select count(*) from t2 /* 5 000 */;
|
||||||
count(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
show binlog events in 'master-bin.000002' from <binlog_start>;
|
show binlog events from <binlog_start>;
|
||||||
Log_name Pos Event_type Server_id End_log_pos Info
|
Log_name Pos Event_type Server_id End_log_pos Info
|
||||||
master-bin.000002 # Query # # use `test`; create table t2 (id int not null primary key auto_increment)
|
master-bin.000001 # Query # # use `test`; create table t2 (id int not null primary key auto_increment)
|
||||||
master-bin.000002 # Begin_load_query # # ;file_id=#;block_len=#
|
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
|
||||||
master-bin.000002 # Append_block # # ;file_id=#;block_len=#
|
master-bin.000001 # Append_block # # ;file_id=#;block_len=#
|
||||||
master-bin.000002 # Append_block # # ;file_id=#;block_len=#
|
master-bin.000001 # Append_block # # ;file_id=#;block_len=#
|
||||||
master-bin.000002 # Execute_load_query # # use `test`; load data infile 'MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' into table t2 ;file_id=#
|
master-bin.000001 # Execute_load_query # # use `test`; load data infile 'MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' into table t2 ;file_id=#
|
||||||
|
==== Verify results on slave ====
|
||||||
|
[on slave]
|
||||||
select count(*) from t2 /* 5 000 */;
|
select count(*) from t2 /* 5 000 */;
|
||||||
count(*)
|
count(*)
|
||||||
5000
|
5000
|
||||||
drop table t1, t2;
|
==== Clean up ====
|
||||||
end of the tests
|
[on master]
|
||||||
|
drop table t2;
|
||||||
|
@ -196,7 +196,7 @@ master-bin.000001 # Intvar # # INSERT_ID=1
|
|||||||
master-bin.000001 # Query # # use `test`; insert into t1 values (NULL)
|
master-bin.000001 # Query # # use `test`; insert into t1 values (NULL)
|
||||||
master-bin.000001 # Query # # use `test`; drop table t1
|
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 # # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM
|
||||||
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=581
|
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
|
||||||
master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines ;file_id=#
|
master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines ;file_id=#
|
||||||
master-bin.000001 # Rotate # # master-bin.000002;pos=4
|
master-bin.000001 # Rotate # # master-bin.000002;pos=4
|
||||||
show binlog events in 'master-bin.000002';
|
show binlog events in 'master-bin.000002';
|
||||||
|
@ -45,7 +45,7 @@ RESET SLAVE;
|
|||||||
RESET MASTER;
|
RESET MASTER;
|
||||||
START SLAVE;
|
START SLAVE;
|
||||||
[on slave]
|
[on slave]
|
||||||
SET @@global.init_slave = 'ant';
|
SET @@global.init_slave = 'SELECT 1';
|
||||||
[on master]
|
[on master]
|
||||||
CREATE TABLE tstmt (id INT AUTO_INCREMENT PRIMARY KEY,
|
CREATE TABLE tstmt (id INT AUTO_INCREMENT PRIMARY KEY,
|
||||||
truth BOOLEAN,
|
truth BOOLEAN,
|
||||||
@ -66,9 +66,9 @@ SET @@global.sync_binlog = 2000000;
|
|||||||
INSERT INTO tstmt(num) VALUES (@@global.sync_binlog);
|
INSERT INTO tstmt(num) VALUES (@@global.sync_binlog);
|
||||||
SET @@global.sync_binlog = 3000000;
|
SET @@global.sync_binlog = 3000000;
|
||||||
INSERT INTO tstmt(num) VALUES (@@global.sync_binlog);
|
INSERT INTO tstmt(num) VALUES (@@global.sync_binlog);
|
||||||
SET @@global.init_slave = 'bison';
|
SET @@global.init_slave = 'SELECT 2';
|
||||||
INSERT INTO tstmt(text) VALUES (@@global.init_slave);
|
INSERT INTO tstmt(text) VALUES (@@global.init_slave);
|
||||||
SET @@global.init_slave = 'cat';
|
SET @@global.init_slave = 'SELECT 3';
|
||||||
INSERT INTO tstmt(text) VALUES (@@global.init_slave);
|
INSERT INTO tstmt(text) VALUES (@@global.init_slave);
|
||||||
SET @@global.slave_exec_mode = 'IDEMPOTENT';
|
SET @@global.slave_exec_mode = 'IDEMPOTENT';
|
||||||
INSERT INTO tstmt(text) VALUES (@@global.slave_exec_mode);
|
INSERT INTO tstmt(text) VALUES (@@global.slave_exec_mode);
|
||||||
@ -140,9 +140,9 @@ INSERT INTO tproc(num) VALUES (@@global.sync_binlog);
|
|||||||
SET @@global.sync_binlog = 3000000;
|
SET @@global.sync_binlog = 3000000;
|
||||||
INSERT INTO tproc(num) VALUES (@@global.sync_binlog);
|
INSERT INTO tproc(num) VALUES (@@global.sync_binlog);
|
||||||
# string
|
# string
|
||||||
SET @@global.init_slave = 'bison';
|
SET @@global.init_slave = 'SELECT 2';
|
||||||
INSERT INTO tproc(text) VALUES (@@global.init_slave);
|
INSERT INTO tproc(text) VALUES (@@global.init_slave);
|
||||||
SET @@global.init_slave = 'cat';
|
SET @@global.init_slave = 'SELECT 3';
|
||||||
INSERT INTO tproc(text) VALUES (@@global.init_slave);
|
INSERT INTO tproc(text) VALUES (@@global.init_slave);
|
||||||
# enumeration
|
# enumeration
|
||||||
SET @@global.slave_exec_mode = 'IDEMPOTENT';
|
SET @@global.slave_exec_mode = 'IDEMPOTENT';
|
||||||
@ -226,9 +226,9 @@ INSERT INTO tfunc(num) VALUES (@@global.sync_binlog);
|
|||||||
SET @@global.sync_binlog = 3000000;
|
SET @@global.sync_binlog = 3000000;
|
||||||
INSERT INTO tfunc(num) VALUES (@@global.sync_binlog);
|
INSERT INTO tfunc(num) VALUES (@@global.sync_binlog);
|
||||||
# string
|
# string
|
||||||
SET @@global.init_slave = 'bison';
|
SET @@global.init_slave = 'SELECT 2';
|
||||||
INSERT INTO tfunc(text) VALUES (@@global.init_slave);
|
INSERT INTO tfunc(text) VALUES (@@global.init_slave);
|
||||||
SET @@global.init_slave = 'cat';
|
SET @@global.init_slave = 'SELECT 3';
|
||||||
INSERT INTO tfunc(text) VALUES (@@global.init_slave);
|
INSERT INTO tfunc(text) VALUES (@@global.init_slave);
|
||||||
# enumeration
|
# enumeration
|
||||||
SET @@global.slave_exec_mode = 'IDEMPOTENT';
|
SET @@global.slave_exec_mode = 'IDEMPOTENT';
|
||||||
@ -316,9 +316,9 @@ INSERT INTO ttrig(num) VALUES (@@global.sync_binlog);
|
|||||||
SET @@global.sync_binlog = 3000000;
|
SET @@global.sync_binlog = 3000000;
|
||||||
INSERT INTO ttrig(num) VALUES (@@global.sync_binlog);
|
INSERT INTO ttrig(num) VALUES (@@global.sync_binlog);
|
||||||
# string
|
# string
|
||||||
SET @@global.init_slave = 'bison';
|
SET @@global.init_slave = 'SELECT 2';
|
||||||
INSERT INTO ttrig(text) VALUES (@@global.init_slave);
|
INSERT INTO ttrig(text) VALUES (@@global.init_slave);
|
||||||
SET @@global.init_slave = 'cat';
|
SET @@global.init_slave = 'SELECT 3';
|
||||||
INSERT INTO ttrig(text) VALUES (@@global.init_slave);
|
INSERT INTO ttrig(text) VALUES (@@global.init_slave);
|
||||||
# enumeration
|
# enumeration
|
||||||
SET @@global.slave_exec_mode = 'IDEMPOTENT';
|
SET @@global.slave_exec_mode = 'IDEMPOTENT';
|
||||||
@ -395,9 +395,9 @@ PREPARE p5 FROM 'SET @@global.sync_binlog = 2000000';
|
|||||||
PREPARE p6 FROM 'INSERT INTO tprep(num) VALUES (@@global.sync_binlog)';
|
PREPARE p6 FROM 'INSERT INTO tprep(num) VALUES (@@global.sync_binlog)';
|
||||||
PREPARE p7 FROM 'SET @@global.sync_binlog = 3000000';
|
PREPARE p7 FROM 'SET @@global.sync_binlog = 3000000';
|
||||||
PREPARE p8 FROM 'INSERT INTO tprep(num) VALUES (@@global.sync_binlog)';
|
PREPARE p8 FROM 'INSERT INTO tprep(num) VALUES (@@global.sync_binlog)';
|
||||||
PREPARE p9 FROM 'SET @@global.init_slave = \'bison\'';
|
PREPARE p9 FROM 'SET @@global.init_slave = \'SELECT 2\'';
|
||||||
PREPARE p10 FROM 'INSERT INTO tprep(text) VALUES (@@global.init_slave)';
|
PREPARE p10 FROM 'INSERT INTO tprep(text) VALUES (@@global.init_slave)';
|
||||||
PREPARE p11 FROM 'SET @@global.init_slave = \'cat\'';
|
PREPARE p11 FROM 'SET @@global.init_slave = \'SELECT 3\'';
|
||||||
PREPARE p12 FROM 'INSERT INTO tprep(text) VALUES (@@global.init_slave)';
|
PREPARE p12 FROM 'INSERT INTO tprep(text) VALUES (@@global.init_slave)';
|
||||||
PREPARE p13 FROM 'SET @@global.slave_exec_mode = \'IDEMPOTENT\'';
|
PREPARE p13 FROM 'SET @@global.slave_exec_mode = \'IDEMPOTENT\'';
|
||||||
PREPARE p14 FROM 'INSERT INTO tprep(text) VALUES (@@global.slave_exec_mode)';
|
PREPARE p14 FROM 'INSERT INTO tprep(text) VALUES (@@global.slave_exec_mode)';
|
||||||
@ -522,8 +522,8 @@ id truth num text
|
|||||||
2 0 NULL NULL
|
2 0 NULL NULL
|
||||||
3 NULL 2000000 NULL
|
3 NULL 2000000 NULL
|
||||||
4 NULL 3000000 NULL
|
4 NULL 3000000 NULL
|
||||||
5 NULL NULL bison
|
5 NULL NULL SELECT 2
|
||||||
6 NULL NULL cat
|
6 NULL NULL SELECT 3
|
||||||
7 NULL NULL IDEMPOTENT
|
7 NULL NULL IDEMPOTENT
|
||||||
8 NULL NULL STRICT
|
8 NULL NULL STRICT
|
||||||
9 1 NULL NULL
|
9 1 NULL NULL
|
||||||
|
@ -19,6 +19,37 @@ connection slave;
|
|||||||
# The 4 should not be inserted into the table, since the incident log
|
# The 4 should not be inserted into the table, since the incident log
|
||||||
# event should have stop the slave.
|
# event should have stop the slave.
|
||||||
--echo **** On Slave ****
|
--echo **** On Slave ****
|
||||||
|
#### BEGIN DEBUG INFO ADDED BY SVEN 2008-07-18 -- SEE BUG#38077 ####
|
||||||
|
let $tables= query_get_value(SHOW TABLES, Tables_in_test, 1);
|
||||||
|
if (`SELECT '$tables' != 't1'`)
|
||||||
|
{
|
||||||
|
--echo **** TEST CASE BUG! PRINTING DEBUG INFO! ****
|
||||||
|
--echo **** Dear developer, if you see this in the output of a test
|
||||||
|
--echo **** case run, please add all the information below as a
|
||||||
|
--echo **** comment to BUG#38077. If it's a pushbuild failure, please
|
||||||
|
--echo **** include a link to the push page.
|
||||||
|
--echo **** Thank you! /Sven
|
||||||
|
SHOW BINLOG EVENTS;
|
||||||
|
--echo **** master binlog ****
|
||||||
|
--error 0,1
|
||||||
|
--exec $MYSQL_BINLOG --hexdump $MYSQLTEST_VARDIR/log/master-bin.000001
|
||||||
|
--echo **** slave binlog ****
|
||||||
|
--error 0,1
|
||||||
|
--exec $MYSQL_BINLOG --hexdump $MYSQLTEST_VARDIR/log/slave-bin.000001
|
||||||
|
--echo **** slave status ****
|
||||||
|
query_vertical SHOW SLAVE STATUS;
|
||||||
|
--echo **** slave's master status ****
|
||||||
|
SHOW MASTER STATUS;
|
||||||
|
--echo **** slave binlog events ****
|
||||||
|
--echo [on master]
|
||||||
|
connection master;
|
||||||
|
--echo **** master status ****
|
||||||
|
SHOW MASTER STATUS;
|
||||||
|
--echo **** master binlog events ****
|
||||||
|
SHOW BINLOG EVENTS;
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
#### END DEBUG INFO ####
|
||||||
SELECT * FROM t1;
|
SELECT * FROM t1;
|
||||||
|
|
||||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||||
|
@ -1,7 +1,16 @@
|
|||||||
|
# ==== Purpose ====
|
||||||
#
|
#
|
||||||
# check replication of load data with the server parameters subjected to
|
# check replication of load data with the server parameters subjected to
|
||||||
# read_buffer_size > max_allowed_packet
|
# read_buffer_size > max_allowed_packet
|
||||||
#
|
#
|
||||||
|
# ==== Implementation ====
|
||||||
|
#
|
||||||
|
# Insert many rows into t1, write t1 to file.
|
||||||
|
# Load the file into t2.
|
||||||
|
# See that t2 came out as expected on slave.
|
||||||
|
#
|
||||||
|
# ==== Related Bugs ====
|
||||||
|
#
|
||||||
# BUG#30435 loading large LOAD DATA INFILE breaks slave with
|
# BUG#30435 loading large LOAD DATA INFILE breaks slave with
|
||||||
# read_buffer_size set on master
|
# read_buffer_size set on master
|
||||||
# BUG#33413 show binlog events fails if binlog has event size of close
|
# BUG#33413 show binlog events fails if binlog has event size of close
|
||||||
@ -9,10 +18,17 @@
|
|||||||
|
|
||||||
source include/have_binlog_format_mixed_or_statement.inc;
|
source include/have_binlog_format_mixed_or_statement.inc;
|
||||||
source include/master-slave.inc;
|
source include/master-slave.inc;
|
||||||
source include/have_innodb.inc;
|
|
||||||
source include/have_binlog_format_mixed_or_statement.inc;
|
|
||||||
|
--echo ==== Create a big file ====
|
||||||
|
|
||||||
|
# We turn off binlogging to avoid too much noise in the binlog. t1 is
|
||||||
|
# just an auxiliary construction anyways, it is not needed on the
|
||||||
|
# slave.
|
||||||
|
|
||||||
--disable_query_log
|
--disable_query_log
|
||||||
|
SET @@sql_log_bin= 0;
|
||||||
|
|
||||||
let $rows= 5000;
|
let $rows= 5000;
|
||||||
create table t1 (id int not null primary key auto_increment);
|
create table t1 (id int not null primary key auto_increment);
|
||||||
|
|
||||||
@ -22,10 +38,13 @@ while($rows)
|
|||||||
dec $rows;
|
dec $rows;
|
||||||
}
|
}
|
||||||
eval select * into outfile '$MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' from t1;
|
eval select * into outfile '$MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' from t1;
|
||||||
flush logs;
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
SET @@sql_log_bin= 1;
|
||||||
--enable_query_log
|
--enable_query_log
|
||||||
|
|
||||||
connection master;
|
|
||||||
|
--echo ==== Load our big file into a table ====
|
||||||
create table t2 (id int not null primary key auto_increment);
|
create table t2 (id int not null primary key auto_increment);
|
||||||
|
|
||||||
select @@session.read_buffer_size - @@session.max_allowed_packet > 0 ;
|
select @@session.read_buffer_size - @@session.max_allowed_packet > 0 ;
|
||||||
@ -34,21 +53,21 @@ select @@session.read_buffer_size - @@session.max_allowed_packet > 0 ;
|
|||||||
eval load data infile '$MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' into table t2;
|
eval load data infile '$MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' into table t2;
|
||||||
select count(*) from t2 /* 5 000 */;
|
select count(*) from t2 /* 5 000 */;
|
||||||
|
|
||||||
# the binglog will show fragmented Append_block events
|
# the binlog will show fragmented Append_block events
|
||||||
--let $binlog_start=106
|
source include/show_binlog_events.inc;
|
||||||
--replace_column 2 # 4 # 5 #
|
|
||||||
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/
|
|
||||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR $binlog_start <binlog_start>
|
|
||||||
--eval show binlog events in 'master-bin.000002' from $binlog_start
|
|
||||||
|
|
||||||
|
|
||||||
|
--echo ==== Verify results on slave ====
|
||||||
|
|
||||||
|
--echo [on slave]
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
#connection slave;
|
|
||||||
select count(*) from t2 /* 5 000 */;
|
select count(*) from t2 /* 5 000 */;
|
||||||
|
|
||||||
|
|
||||||
|
--echo ==== Clean up ====
|
||||||
|
|
||||||
|
--echo [on master]
|
||||||
connection master;
|
connection master;
|
||||||
drop table t1, t2;
|
drop table t2;
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
remove_file $MYSQLTEST_VARDIR/tmp/bug30435_5k.txt;
|
remove_file $MYSQLTEST_VARDIR/tmp/bug30435_5k.txt;
|
||||||
|
|
||||||
--echo end of the tests
|
|
||||||
|
@ -1,13 +1,30 @@
|
|||||||
# Requires statement logging
|
# ==== Purpose ====
|
||||||
|
#
|
||||||
|
# Verify that Slave_open_temp_tables is increased when a temporary
|
||||||
|
# table is opened on the slave, and decreased when a temporary table
|
||||||
|
# is closed on the slave, and that it is preserved during 'DELETE FROM
|
||||||
|
# table' and 'TRUNCATE table'.
|
||||||
|
#
|
||||||
|
# ==== Method ====
|
||||||
|
#
|
||||||
|
# Create a temporary table on master, insert rows, and try:
|
||||||
|
# - delete rows from the table
|
||||||
|
# - truncate the table
|
||||||
|
# - drop the table
|
||||||
|
#
|
||||||
|
# ==== Related bugs ====
|
||||||
|
#
|
||||||
|
# BUG#17137 Running "truncate table" on temporary table leaves the table open on a slave
|
||||||
|
#
|
||||||
|
# Bug in this test: BUG#37493: rpl_trunc_temp.test nondeterministic
|
||||||
|
|
||||||
|
|
||||||
|
# Requires statement-based logging since temporary tables are not
|
||||||
|
# logged in row-based logging
|
||||||
-- source include/have_binlog_format_mixed_or_statement.inc
|
-- source include/have_binlog_format_mixed_or_statement.inc
|
||||||
|
|
||||||
source include/master-slave.inc;
|
source include/master-slave.inc;
|
||||||
|
|
||||||
#
|
|
||||||
# Bug#17137 Running "truncate table" on temporary table
|
|
||||||
# leaves the table open on a slave
|
|
||||||
#
|
|
||||||
|
|
||||||
create temporary table t1 (n int);
|
create temporary table t1 (n int);
|
||||||
insert into t1 values(1);
|
insert into t1 values(1);
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
@ -28,13 +45,10 @@ show status like 'Slave_open_temp_tables';
|
|||||||
# Disconnect the master, temp table on slave should dissapear
|
# Disconnect the master, temp table on slave should dissapear
|
||||||
disconnect master;
|
disconnect master;
|
||||||
|
|
||||||
connection master1;
|
connection slave;
|
||||||
# Wait until drop of temp tables appers in binlog
|
|
||||||
|
# Wait until drop of temp tables appers in slave's binlog
|
||||||
let $wait_binlog_event= DROP;
|
let $wait_binlog_event= DROP;
|
||||||
source include/wait_for_binlog_event.inc;
|
source include/wait_for_binlog_event.inc;
|
||||||
|
|
||||||
connection slave;
|
|
||||||
show status like 'Slave_open_temp_tables';
|
show status like 'Slave_open_temp_tables';
|
||||||
|
|
||||||
|
|
||||||
# End of 4.1 tests
|
|
||||||
|
@ -117,7 +117,7 @@ source include/reset_master_and_slave.inc;
|
|||||||
# above, but can't because it affects how the slave works.
|
# above, but can't because it affects how the slave works.
|
||||||
--echo [on slave]
|
--echo [on slave]
|
||||||
connection slave;
|
connection slave;
|
||||||
SET @@global.init_slave = 'ant';
|
SET @@global.init_slave = 'SELECT 1';
|
||||||
|
|
||||||
|
|
||||||
--echo [on master]
|
--echo [on master]
|
||||||
@ -154,9 +154,9 @@ SET @@global.sync_binlog = 3000000;
|
|||||||
INSERT INTO tstmt(num) VALUES (@@global.sync_binlog);
|
INSERT INTO tstmt(num) VALUES (@@global.sync_binlog);
|
||||||
|
|
||||||
# string
|
# string
|
||||||
SET @@global.init_slave = 'bison';
|
SET @@global.init_slave = 'SELECT 2';
|
||||||
INSERT INTO tstmt(text) VALUES (@@global.init_slave);
|
INSERT INTO tstmt(text) VALUES (@@global.init_slave);
|
||||||
SET @@global.init_slave = 'cat';
|
SET @@global.init_slave = 'SELECT 3';
|
||||||
INSERT INTO tstmt(text) VALUES (@@global.init_slave);
|
INSERT INTO tstmt(text) VALUES (@@global.init_slave);
|
||||||
|
|
||||||
# enumeration
|
# enumeration
|
||||||
@ -258,9 +258,9 @@ BEGIN
|
|||||||
INSERT INTO tproc(num) VALUES (@@global.sync_binlog);
|
INSERT INTO tproc(num) VALUES (@@global.sync_binlog);
|
||||||
|
|
||||||
# string
|
# string
|
||||||
SET @@global.init_slave = 'bison';
|
SET @@global.init_slave = 'SELECT 2';
|
||||||
INSERT INTO tproc(text) VALUES (@@global.init_slave);
|
INSERT INTO tproc(text) VALUES (@@global.init_slave);
|
||||||
SET @@global.init_slave = 'cat';
|
SET @@global.init_slave = 'SELECT 3';
|
||||||
INSERT INTO tproc(text) VALUES (@@global.init_slave);
|
INSERT INTO tproc(text) VALUES (@@global.init_slave);
|
||||||
|
|
||||||
# enumeration
|
# enumeration
|
||||||
@ -367,9 +367,9 @@ BEGIN
|
|||||||
INSERT INTO tfunc(num) VALUES (@@global.sync_binlog);
|
INSERT INTO tfunc(num) VALUES (@@global.sync_binlog);
|
||||||
|
|
||||||
# string
|
# string
|
||||||
SET @@global.init_slave = 'bison';
|
SET @@global.init_slave = 'SELECT 2';
|
||||||
INSERT INTO tfunc(text) VALUES (@@global.init_slave);
|
INSERT INTO tfunc(text) VALUES (@@global.init_slave);
|
||||||
SET @@global.init_slave = 'cat';
|
SET @@global.init_slave = 'SELECT 3';
|
||||||
INSERT INTO tfunc(text) VALUES (@@global.init_slave);
|
INSERT INTO tfunc(text) VALUES (@@global.init_slave);
|
||||||
|
|
||||||
# enumeration
|
# enumeration
|
||||||
@ -478,9 +478,9 @@ BEGIN
|
|||||||
INSERT INTO ttrig(num) VALUES (@@global.sync_binlog);
|
INSERT INTO ttrig(num) VALUES (@@global.sync_binlog);
|
||||||
|
|
||||||
# string
|
# string
|
||||||
SET @@global.init_slave = 'bison';
|
SET @@global.init_slave = 'SELECT 2';
|
||||||
INSERT INTO ttrig(text) VALUES (@@global.init_slave);
|
INSERT INTO ttrig(text) VALUES (@@global.init_slave);
|
||||||
SET @@global.init_slave = 'cat';
|
SET @@global.init_slave = 'SELECT 3';
|
||||||
INSERT INTO ttrig(text) VALUES (@@global.init_slave);
|
INSERT INTO ttrig(text) VALUES (@@global.init_slave);
|
||||||
|
|
||||||
# enumeration
|
# enumeration
|
||||||
@ -581,9 +581,9 @@ PREPARE p7 FROM 'SET @@global.sync_binlog = 3000000';
|
|||||||
PREPARE p8 FROM 'INSERT INTO tprep(num) VALUES (@@global.sync_binlog)';
|
PREPARE p8 FROM 'INSERT INTO tprep(num) VALUES (@@global.sync_binlog)';
|
||||||
|
|
||||||
# string
|
# string
|
||||||
PREPARE p9 FROM 'SET @@global.init_slave = \'bison\'';
|
PREPARE p9 FROM 'SET @@global.init_slave = \'SELECT 2\'';
|
||||||
PREPARE p10 FROM 'INSERT INTO tprep(text) VALUES (@@global.init_slave)';
|
PREPARE p10 FROM 'INSERT INTO tprep(text) VALUES (@@global.init_slave)';
|
||||||
PREPARE p11 FROM 'SET @@global.init_slave = \'cat\'';
|
PREPARE p11 FROM 'SET @@global.init_slave = \'SELECT 3\'';
|
||||||
PREPARE p12 FROM 'INSERT INTO tprep(text) VALUES (@@global.init_slave)';
|
PREPARE p12 FROM 'INSERT INTO tprep(text) VALUES (@@global.init_slave)';
|
||||||
|
|
||||||
# enumeration
|
# enumeration
|
||||||
|
Reference in New Issue
Block a user