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

51 lines
1.4 KiB
Text
Raw Normal View History

#############################################################
# 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
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)
{
2011-04-18 23:59:15 +04:00
BEGIN;
eval INSERT INTO t1 VALUES($i, REPEAT('x', 4096));
2011-04-18 23:59:15 +04:00
COMMIT;
dec $i;
}
--enable_query_log
SELECT COUNT(*) FROM t1;
# Set small value for max_binlog_cache_size
2011-04-25 23:49:56 +04:00
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);
2011-04-18 23:59:15 +04:00
SET GLOBAL binlog_cache_size=4096;
SET GLOBAL max_binlog_cache_size=4096;
2011-04-25 23:49:56 +04:00
# 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;
2011-05-09 23:26:41 +04:00
--error ER_TRANS_CACHE_FULL
CREATE TABLE t2 SELECT * FROM t1;
COMMIT;
SHOW TABLES LIKE 't%';
# 5.1 End of Test
2011-04-25 23:49:56 +04:00
--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;
2011-04-25 23:49:56 +04:00
disconnect default;
connect(default,localhost,root,,test);