Skip to content

Commit d8c538e

Browse files
author
Aditya A
committed
Bug #31529221 ALTER TABLE FAILS AND REPORTS INCORRECT KEY FILE FOR TABLE T1
post push fix to make test case more deterministic Reviewed by : Mayank Prasad <mayank.prasad@oracle.com>
1 parent 5594042 commit d8c538e

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

mysql-test/suite/innodb/r/innodb_row_log_read.result

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ set global innodb_online_alter_log_max_size=1342177280000;
77
set global max_allowed_packet=1024*1024*1024;
88
create table t1(d1 longblob);
99
insert into t1(d1) values (repeat(UNHEX('000f'), 1022*1022*88));
10+
SET DEBUG_SYNC= 'alter_table_inplace_after_lock_downgrade SIGNAL proceed_insert WAIT_FOR proceed_alter';
1011
alter table t1 ADD COLUMN `d2` char(128) not null default '0' after d1;;
12+
SET DEBUG_SYNC= 'now WAIT_FOR proceed_insert';
13+
SET DEBUG_SYNC= 'now SIGNAL proceed_alter';
14+
SET DEBUG_SYNC= 'RESET';
1115
drop table t1;
1216
SET GLOBAL innodb_online_alter_log_max_size = @old_innodb_online_alter_log_max_size;
1317
set global max_allowed_packet = @old_max_allowed_packet;
Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
--echo #
22
--echo # Bug #31529221 ALTER TABLE FAILS AND REPORTS INCORRECT KEY FILE FOR TABLE T1
33
--echo #
4+
45
--source include/have_innodb_16k.inc
5-
--source include/not_embedded.inc
6+
--source include/have_debug.inc
7+
--source include/have_debug_sync.inc
68
--source include/big_test.inc
9+
--source include/not_embedded.inc
710

811
SET @old_innodb_online_alter_log_max_size := @@innodb_online_alter_log_max_size;
912
SET @old_max_allowed_packet := @@max_allowed_packet;
@@ -14,22 +17,30 @@ create table t1(d1 longblob);
1417

1518
--connect (con1,localhost,root,,test,,)
1619
insert into t1(d1) values (repeat(UNHEX('000f'), 1022*1022*88));
20+
SET DEBUG_SYNC= 'alter_table_inplace_after_lock_downgrade SIGNAL proceed_insert WAIT_FOR proceed_alter';
1721
--send alter table t1 ADD COLUMN `d2` char(128) not null default '0' after d1;
1822

1923
--connect (con2,localhost,root,,test,,)
24+
SET DEBUG_SYNC= 'now WAIT_FOR proceed_insert';
25+
26+
#insert sufficient records so that the operation gets logged in the temporary file
2027
--disable_query_log
21-
let $ddl_not_finish= 1;
22-
while ($ddl_not_finish)
23-
{
28+
let $c=3241;
29+
while($c) {
2430
insert into t1(d1) values (repeat(UNHEX('000f'), 1022*3));
25-
let $ddl_not_finish= query_get_value("select count(1) as ddl from information_schema.innodb_trx where trx_query like '%alter table%'", ddl, 1);
31+
dec $c;
2632
}
2733
--enable_query_log
34+
SET DEBUG_SYNC= 'now SIGNAL proceed_alter';
2835

2936
--connection con1
3037
--reap
3138

3239
--connection default
40+
disconnect con1;
41+
disconnect con2;
42+
SET DEBUG_SYNC= 'RESET';
3343
drop table t1;
3444
SET GLOBAL innodb_online_alter_log_max_size = @old_innodb_online_alter_log_max_size;
3545
set global max_allowed_packet = @old_max_allowed_packet;
46+

0 commit comments

Comments
 (0)