--source include/not_embedded.inc --source include/not_valgrind.inc --source include/not_crashrep.inc --source include/have_debug.inc --source include/have_innodb.inc SET GLOBAL max_allowed_packet = 100*1024*1024; connect(big_packets,localhost,root,,); connection big_packets; CREATE TABLE t1 (a BIGINT PRIMARY KEY, b LONGBLOB) ENGINE=InnoDB; # This is actually two bugs in one. Without this sleep, the redo log for # the table creation itself will get overwritten, and this will cause # an assert during crash recovery. With the sleep, we'll get the table # creation checkpointed correctly, allowing the other bug to be seen. SELECT SLEEP(10); # Insert a few rows (it doesn't really matter how many). These transactions # are committed once they are acked, so they should not be lost. INSERT INTO t1 (a, b) VALUES (1, "1"); INSERT INTO t1 (a, b) VALUES (2, "2"); INSERT INTO t1 (a, b) VALUES (3, "3"); INSERT INTO t1 (a, b) VALUES (4, "4"); INSERT INTO t1 (a, b) VALUES (5, "5"); # Crash before commit of this BLOB insert. SET SESSION debug="d,crash_commit_before"; # The BLOB insert will fail, and should disappear. However all data committed # up to this point should not be lost. --error 2013 INSERT INTO t1 (a, b) VALUES (6, REPEAT('a', 20*1024*1024)); # We expect a restart. --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect # Wait for the server to come back up, and reconnect. --enable_reconnect --source include/wait_until_connected_again.inc # We should see (1,2,3,4,5) here, but, alas, they are gone. SELECT a FROM t1; # Clean up. DROP TABLE t1;