binlog_bug23533.test 989 Bytes
Newer Older
1 2 3 4 5 6
#############################################################
#  Bug#23533: CREATE SELECT max_binlog_cache_size test 
#  case needed
#############################################################

--source include/have_innodb.inc
7
--source include/have_log_bin.inc
8 9 10 11
--source include/have_binlog_format_row.inc

SET AUTOCOMMIT=0;

12
# Create 1st table
13 14 15 16 17 18 19 20 21 22 23
CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b TEXT, PRIMARY KEY(a)) ENGINE=InnoDB;
--disable_query_log
let $i= 1000;
while ($i)
{
  eval INSERT INTO t1 VALUES($i, REPEAT('x', 4096));
  dec $i;
}
--enable_query_log
SELECT COUNT(*) FROM t1;

24 25 26 27
# Set small value for max_binlog_cache_size
SET @saved_max_binlog_cache_size=@@max_binlog_cache_size;
SET GLOBAL max_binlog_cache_size=4096;

28 29
# Copied data from t1 into t2 large than max_binlog_cache_size
START TRANSACTION;
30
--error 1197
31 32 33 34 35
CREATE TABLE t2 SELECT * FROM t1;
COMMIT;
SHOW TABLES LIKE 't%';

# 5.1 End of Test
36 37
SET GLOBAL max_binlog_cache_size=@saved_max_binlog_cache_size;
DROP TABLE t1;