| 1 |
--source include/have_binlog_format_row.inc |
| 2 |
--source include/have_debug.inc |
| 3 |
--source include/master-slave.inc |
| 4 |
|
| 5 |
--connection master |
| 6 |
# Set minimal cache size so smaller transaction can trigger spill to disk. |
| 7 |
SET @save_binlog_stmt_cache_size= @@GLOBAL.binlog_stmt_cache_size; |
| 8 |
SET GLOBAL binlog_stmt_cache_size= 4096; |
| 9 |
|
| 10 |
CALL mtr.add_suppression('"No space left on device".*An incident event is written to binary log'); |
| 11 |
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(255)) ENGINE=MyISAM; |
| 12 |
|
| 13 |
FLUSH GLOBAL STATUS; |
| 14 |
SHOW STATUS LIKE "binlog_stmt_cache%"; |
| 15 |
INSERT INTO t1 VALUES (0, CONCAT("?", "-", REPEAT("x", 200))); |
| 16 |
INSERT INTO t1 SELECT a+1, CONCAT(a, "-", REPEAT("x", 200)) FROM t1; |
| 17 |
INSERT INTO t1 SELECT a+2, CONCAT(a, "-", REPEAT("x", 200)) FROM t1; |
| 18 |
INSERT INTO t1 SELECT a+4, CONCAT(a, "-", REPEAT("x", 200)) FROM t1; |
| 19 |
INSERT INTO t1 SELECT a+8, CONCAT(a, "-", REPEAT("x", 200)) FROM t1; |
| 20 |
INSERT INTO t1 SELECT a+16, CONCAT(a, "-", REPEAT("x", 200)) FROM t1; |
| 21 |
INSERT INTO t1 SELECT a+32, CONCAT(a, "-", REPEAT("x", 200)) FROM t1; |
| 22 |
INSERT INTO t1 SELECT a+64, CONCAT(a, "-", REPEAT("x", 200)) FROM t1; |
| 23 |
INSERT INTO t1 SELECT a+128, CONCAT(a, "-", REPEAT("x", 200)) FROM t1; |
| 24 |
SHOW STATUS LIKE "binlog_stmt_cache%"; |
| 25 |
|
| 26 |
SET @old_dbug= @@SESSION.debug_dbug; |
| 27 |
SET SESSION debug_dbug="+d,simulate_disk_full_at_flush_pending"; |
| 28 |
--replace_regex /Error writing file '[^']+'/Error writing file '<FILENAME>'/ |
| 29 |
--error 3 |
| 30 |
INSERT INTO t1 SELECT a+256, CONCAT(a, "-", REPEAT("x", 200)) FROM t1; |
| 31 |
SET SESSION debug_dbug= @old_dbug; |
| 32 |
SHOW STATUS LIKE "binlog_stmt_cache%"; |
| 33 |
# The actual number of rows left after the disk full error may change as |
| 34 |
# binlog event sizes are modified. So here we just test that we get partial |
| 35 |
# update from the last INSERT..SELECT that gets disk full error. |
| 36 |
SELECT IF(COUNT(*) > 256 AND COUNT(*) < 512, |
| 37 |
"ok", |
| 38 |
CONCAT("ERROR! Row count ", COUNT(*), " not as expected for partially executed query")) |
| 39 |
AS check_result |
| 40 |
FROM t1; |
| 41 |
|
| 42 |
# A random extra event that helped show the bug that a partial event |
| 43 |
# group was binlogged. |
| 44 |
ALTER TABLE t1 COMMENT '<mumble>'; |
| 45 |
|
| 46 |
--save_master_pos |
| 47 |
|
| 48 |
--connection slave |
| 49 |
--let $slave_sql_errno= 1590 |
| 50 |
--source include/wait_for_slave_sql_error_and_skip.inc |
| 51 |
|
| 52 |
--sync_with_master |
| 53 |
SELECT COUNT(*) FROM t1; |
| 54 |
|
| 55 |
# Cleanup |
| 56 |
|
| 57 |
--connection master |
| 58 |
SET GLOBAL binlog_stmt_cache_size= @save_binlog_stmt_cache_size; |
| 59 |
DROP TABLE t1; |
| 60 |
|
| 61 |
--source include/rpl_end.inc |