1
1
--echo #
2
2
--echo # Bug #31529221 ALTER TABLE FAILS AND REPORTS INCORRECT KEY FILE FOR TABLE T1
3
3
--echo #
4
+
4
5
--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
6
8
--source include/big_test.inc
9
+ --source include/not_embedded.inc
7
10
8
11
SET @old_innodb_online_alter_log_max_size := @@innodb_online_alter_log_max_size;
9
12
SET @old_max_allowed_packet := @@max_allowed_packet;
@@ -14,22 +17,30 @@ create table t1(d1 longblob);
14
17
15
18
--connect (con1,localhost,root,,test,,)
16
19
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';
17
21
--send alter table t1 ADD COLUMN `d2` char(128) not null default '0' after d1;
18
22
19
23
--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
20
27
--disable_query_log
21
- let $ddl_not_finish= 1;
22
- while ($ddl_not_finish)
23
- {
28
+ let $c=3241;
29
+ while($c) {
24
30
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 ;
26
32
}
27
33
--enable_query_log
34
+ SET DEBUG_SYNC= 'now SIGNAL proceed_alter';
28
35
29
36
--connection con1
30
37
--reap
31
38
32
39
--connection default
40
+ disconnect con1;
41
+ disconnect con2;
42
+ SET DEBUG_SYNC= 'RESET';
33
43
drop table t1;
34
44
SET GLOBAL innodb_online_alter_log_max_size = @old_innodb_online_alter_log_max_size;
35
45
set global max_allowed_packet = @old_max_allowed_packet;
46
+
0 commit comments