Skip to content

Commit 8314278

Browse files
author
Parveez Baig
committed
Bug#27535636:CONTRIBUTION BY FACEBOOK: TEST CASE FOR MAX_BINLOG_CACHE_SIZE AND LOAD DATA ...
Added the scenario in existing rpl test which has the various scenarios to check the max_binlog_cache_size.
1 parent bc56e67 commit 8314278

4 files changed

+87
-4
lines changed

mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test

+48-1
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,54 @@ COMMIT;
358358
--let $diff_tables= master:t1,slave:t1
359359
--source include/diff_tables.inc
360360

361-
--echo ######### 8 - Bug#55375(Regression Bug) Transaction bigger than ##########
361+
--echo ####### 8 - LOAD DATA INFILE INTO TABLE #######
362+
363+
#
364+
# This scenario verifies that load data infile fails when
365+
# binlog cache exceeds max_binlog_cache_size
366+
#
367+
--source include/rpl_connection_master.inc
368+
CREATE TABLE t6 (a varchar(20)) ENGINE=Innodb;
369+
370+
# Save the current binary log position
371+
--let $pos_before= query_get_value(show master status,Position,1)
372+
373+
--disable_query_log
374+
--let $write_var =`SELECT REPEAT('Testing\n', 1000)`
375+
--let $write_to_file = GENERATE
376+
--source include/write_var_to_file.inc
377+
--enable_query_log
378+
379+
# Below transaction generates transaction cache more than
380+
# the max_binlog_cache_size i.e 4096. Hence results in error.
381+
--replace_result $write_to_file temp_file
382+
--error ER_TRANS_CACHE_FULL
383+
eval LOAD DATA INFILE '$write_to_file' INTO TABLE t6;
384+
385+
--exec rm $write_to_file
386+
387+
# Check that the above transaction has not been logged in the binary log
388+
--let $assert_text= assert that the above Event has not been added to binlog
389+
--let $assert_cond= [SHOW MASTER STATUS, Position,1] = $pos_before
390+
--source include/assert.inc
391+
392+
# Check that the table is empty on master
393+
--let $assert_text = Check that the LOAD DATA didn't add any data into the table
394+
--let $assert_cond = [SELECT COUNT(*) FROM t6] = 0
395+
--source include/assert.inc
396+
397+
--source include/sync_slave_sql_with_master.inc
398+
399+
# Check that the table is empty on slave
400+
--let $assert_text = Check that the LOAD DATA didn't add any data into the table
401+
--let $assert_cond = [SELECT COUNT(*) FROM t6] = 0
402+
--source include/assert.inc
403+
404+
--source include/rpl_connection_master.inc
405+
DROP TABLE t6;
406+
--source include/sync_slave_sql_with_master.inc
407+
408+
--echo ######### 9 - Bug#55375(Regression Bug) Transaction bigger than ##########
362409
--echo ######### max_binlog_cache_size crashes slave ##########
363410

364411
--echo # [ On Slave ]

mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result

+13-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,19 @@ BEGIN;
111111
Got one of the listed errors
112112
COMMIT;
113113
include/diff_tables.inc [master:t1,slave:t1]
114-
######### 8 - Bug#55375(Regression Bug) Transaction bigger than ##########
114+
####### 8 - LOAD DATA INFILE INTO TABLE #######
115+
[connection master]
116+
CREATE TABLE t6 (a varchar(20)) ENGINE=Innodb;
117+
LOAD DATA INFILE 'temp_file' INTO TABLE t6;
118+
ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again
119+
include/assert.inc [assert that the above Event has not been added to binlog]
120+
include/assert.inc [Check that the LOAD DATA didn't add any data into the table]
121+
include/sync_slave_sql_with_master.inc
122+
include/assert.inc [Check that the LOAD DATA didn't add any data into the table]
123+
[connection master]
124+
DROP TABLE t6;
125+
include/sync_slave_sql_with_master.inc
126+
######### 9 - Bug#55375(Regression Bug) Transaction bigger than ##########
115127
######### max_binlog_cache_size crashes slave ##########
116128
# [ On Slave ]
117129
SET GLOBAL max_binlog_cache_size = 4096;

mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result

+13-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,19 @@ BEGIN;
112112
Got one of the listed errors
113113
COMMIT;
114114
include/diff_tables.inc [master:t1,slave:t1]
115-
######### 8 - Bug#55375(Regression Bug) Transaction bigger than ##########
115+
####### 8 - LOAD DATA INFILE INTO TABLE #######
116+
[connection master]
117+
CREATE TABLE t6 (a varchar(20)) ENGINE=Innodb;
118+
LOAD DATA INFILE 'temp_file' INTO TABLE t6;
119+
ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again
120+
include/assert.inc [assert that the above Event has not been added to binlog]
121+
include/assert.inc [Check that the LOAD DATA didn't add any data into the table]
122+
include/sync_slave_sql_with_master.inc
123+
include/assert.inc [Check that the LOAD DATA didn't add any data into the table]
124+
[connection master]
125+
DROP TABLE t6;
126+
include/sync_slave_sql_with_master.inc
127+
######### 9 - Bug#55375(Regression Bug) Transaction bigger than ##########
116128
######### max_binlog_cache_size crashes slave ##########
117129
# [ On Slave ]
118130
SET GLOBAL max_binlog_cache_size = 4096;

mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result

+13-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,19 @@ BEGIN;
111111
Got one of the listed errors
112112
COMMIT;
113113
include/diff_tables.inc [master:t1,slave:t1]
114-
######### 8 - Bug#55375(Regression Bug) Transaction bigger than ##########
114+
####### 8 - LOAD DATA INFILE INTO TABLE #######
115+
[connection master]
116+
CREATE TABLE t6 (a varchar(20)) ENGINE=Innodb;
117+
LOAD DATA INFILE 'temp_file' INTO TABLE t6;
118+
ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again
119+
include/assert.inc [assert that the above Event has not been added to binlog]
120+
include/assert.inc [Check that the LOAD DATA didn't add any data into the table]
121+
include/sync_slave_sql_with_master.inc
122+
include/assert.inc [Check that the LOAD DATA didn't add any data into the table]
123+
[connection master]
124+
DROP TABLE t6;
125+
include/sync_slave_sql_with_master.inc
126+
######### 9 - Bug#55375(Regression Bug) Transaction bigger than ##########
115127
######### max_binlog_cache_size crashes slave ##########
116128
# [ On Slave ]
117129
SET GLOBAL max_binlog_cache_size = 4096;

0 commit comments

Comments
 (0)