1--echo # 2--echo # Bug #31529221 ALTER TABLE FAILS AND REPORTS INCORRECT KEY FILE FOR TABLE T1 3--echo # 4 5--source include/have_innodb_16k.inc 6--source include/have_debug.inc 7--source include/have_debug_sync.inc 8--source include/big_test.inc 9--source include/not_embedded.inc 10 11SET @old_innodb_online_alter_log_max_size := @@innodb_online_alter_log_max_size; 12SET @old_max_allowed_packet := @@max_allowed_packet; 13set global innodb_online_alter_log_max_size=1342177280000; 14set global max_allowed_packet=1024*1024*1024; 15 16create table t1(d1 longblob); 17 18--connect (con1,localhost,root,,test,,) 19insert into t1(d1) values (repeat(UNHEX('000f'), 1022*1022*88)); 20SET DEBUG_SYNC= 'alter_table_inplace_after_lock_downgrade SIGNAL proceed_insert WAIT_FOR proceed_alter'; 21--send alter table t1 ADD COLUMN `d2` char(128) not null default '0' after d1; 22 23--connect (con2,localhost,root,,test,,) 24SET DEBUG_SYNC= 'now WAIT_FOR proceed_insert'; 25 26#insert sufficient records so that the operation gets logged in the temporary file 27--disable_query_log 28let $c=3241; 29while($c) { 30 insert into t1(d1) values (repeat(UNHEX('000f'), 1022*3)); 31 dec $c; 32} 33--enable_query_log 34SET DEBUG_SYNC= 'now SIGNAL proceed_alter'; 35 36--connection con1 37--reap 38 39--connection default 40disconnect con1; 41disconnect con2; 42SET DEBUG_SYNC= 'RESET'; 43drop table t1; 44SET GLOBAL innodb_online_alter_log_max_size = @old_innodb_online_alter_log_max_size; 45set global max_allowed_packet = @old_max_allowed_packet; 46 47