Debian Codegraph @

mysql-test/suite/binlog/t/binlog_bug23533.test

raw
1 #############################################################
2 # Bug#23533: CREATE SELECT max_binlog_cache_size test
3 # case needed
4 #############################################################
5
6 --source include/have_innodb.inc
7 --source include/have_log_bin.inc
8 --source include/have_binlog_format_row.inc
9 call mtr.add_suppression("Write to binary log failed: Multi-statement transaction required more than .max_binlog_cache_size.*");
10 if ($MTR_COMBINATION_POOL) {
11 --source include/have_pool_of_threads.inc
12 }
13 SET AUTOCOMMIT=0;
14
15 # Create 1st table
16 CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b TEXT, PRIMARY KEY(a)) ENGINE=InnoDB;
17 --disable_query_log
18 let $i= 1000;
19 while ($i)
20 {
21 BEGIN;
22 eval INSERT INTO t1 VALUES($i, REPEAT('x', 4096));
23 COMMIT;
24 dec $i;
25 }
26 --enable_query_log
27 SELECT COUNT(*) FROM t1;
28
29 # Set small value for max_binlog_cache_size
30 let $saved_binlog_cache_size= query_get_value(SELECT @@binlog_cache_size AS Value, Value, 1);
31 let $saved_max_binlog_cache_size= query_get_value(SELECT @@max_binlog_cache_size AS Value, Value, 1);
32 SET GLOBAL binlog_cache_size=4096;
33 SET GLOBAL max_binlog_cache_size=4096;
34
35 # New value of max_binlog_cache_size will apply to new session
36 disconnect default;
37 connect(default,localhost,root,,test);
38
39 # Copied data from t1 into t2 large than max_binlog_cache_size
40 START TRANSACTION;
41 --error ER_TRANS_CACHE_FULL
42 CREATE TABLE t2 SELECT * FROM t1;
43 COMMIT;
44 SHOW TABLES LIKE 't%';
45
46 # 5.1 End of Test
47 --disable_query_log
48 eval SET GLOBAL max_binlog_cache_size=$saved_max_binlog_cache_size;
49 eval SET GLOBAL binlog_cache_size=$saved_binlog_cache_size;
50 --enable_query_log
51 DROP TABLE t1;
52 disconnect default;
53 connect(default,localhost,root,,test);