File: binlog_bug23533.test

package info (click to toggle)
mariadb 1%3A11.8.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 772,520 kB
  • sloc: ansic: 2,414,714; cpp: 1,791,394; asm: 381,336; perl: 62,905; sh: 49,647; pascal: 40,897; java: 39,363; python: 20,791; yacc: 20,432; sql: 17,907; xml: 12,344; ruby: 8,544; cs: 6,542; makefile: 6,145; ada: 1,879; lex: 1,193; javascript: 996; objc: 80; tcl: 73; awk: 46; php: 22
file content (50 lines) | stat: -rw-r--r-- 1,610 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#############################################################
#  Bug#23533: CREATE SELECT max_binlog_cache_size test 
#  case needed
#############################################################

--source include/have_innodb.inc
--source include/have_log_bin.inc
--source include/have_binlog_format_row.inc
call mtr.add_suppression("Write to binary log failed: Multi-statement transaction required more than .max_binlog_cache_size.*");
SET AUTOCOMMIT=0;

# Create 1st table
CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b TEXT, PRIMARY KEY(a)) ENGINE=InnoDB;
--disable_query_log
let $i= 1000;
while ($i)
{
  BEGIN;
  eval INSERT INTO t1 VALUES($i, REPEAT('x', 4096));
  COMMIT;
  dec $i;
}
--enable_query_log
SELECT COUNT(*) FROM t1;

# Set small value for max_binlog_cache_size
let $saved_binlog_cache_size= query_get_value(SELECT @@binlog_cache_size AS Value, Value, 1);
let $saved_max_binlog_cache_size= query_get_value(SELECT @@max_binlog_cache_size AS Value, Value, 1);
SET GLOBAL binlog_cache_size=4096;
SET GLOBAL max_binlog_cache_size=4096;

# New value of max_binlog_cache_size will apply to new session
disconnect default;
connect(default,localhost,root,,test);

# Copied data from t1 into t2 large than max_binlog_cache_size
START TRANSACTION;
--error ER_TRANS_CACHE_FULL
CREATE TABLE t2 SELECT * FROM t1;
COMMIT;
SHOW TABLES LIKE 't%';

# 5.1 End of Test
--disable_query_log
eval SET GLOBAL max_binlog_cache_size=$saved_max_binlog_cache_size;
eval SET GLOBAL binlog_cache_size=$saved_binlog_cache_size;
--enable_query_log
DROP TABLE t1;
disconnect default;
connect(default,localhost,root,,test);