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