Skip to content

Commit f7646d8

Browse files
committed
main.alter_table_online_debug: remove explicit innodb
1 parent 23f9e34 commit f7646d8

File tree

2 files changed

+41
-34
lines changed

2 files changed

+41
-34
lines changed

mysql-test/main/alter_table_online_debug.result

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
set global default_storage_engine= innodb;
12
set default_storage_engine= innodb;
23
connect con2, localhost, root,,;
34
connection default;
@@ -289,7 +290,7 @@ set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
289290
alter table t1 add b int NULL, algorithm= copy, lock= none;
290291
connection con2;
291292
insert into t1 values (1),(2),(3),(4),(5),(6);
292-
ERROR 23000: Duplicate entry '5' for key 'PRIMARY'
293+
Got one of the listed errors
293294
select * from t1;
294295
a
295296
1
@@ -496,6 +497,7 @@ a b UNIX_TIMESTAMP(row_start) UNIX_TIMESTAMP(row_end)
496497
6 77 1.000000 2147483647.999999
497498
alter table t1 drop system versioning, algorithm= copy, lock= none;
498499
ERROR 0A000: LOCK=NONE is not supported. Reason: DROP SYSTEM VERSIONING. Try LOCK=SHARED
500+
drop table t1;
499501
#
500502
# Test ROLLBACK TO SAVEPOINT
501503
#
@@ -582,7 +584,7 @@ set debug_sync= 'reset';
582584
drop table t1;
583585
drop table t2;
584586
drop table t3;
585-
create table t1 (a char(6), b int) engine=innodb;
587+
create table t1 (a char(6), b int);
586588
insert t1 values ('abcde1',1),('abcde2',2);
587589
set debug_sync= 'now wait_for downgraded';
588590
connection con2;
@@ -838,7 +840,7 @@ a b
838840
drop table t1;
839841
set debug_sync= 'reset';
840842
## CHECK, UPDATE
841-
create table t1 (a int) engine=innodb;
843+
create table t1 (a int);
842844
insert t1 values (1),(2),(3),(4);
843845
set debug_sync= 'now wait_for downgraded';
844846
connection con2;
@@ -863,7 +865,7 @@ a
863865
14
864866
drop table t1;
865867
## DEFAULT, UPDATE
866-
create table t1 (a int) engine=innodb;
868+
create table t1 (a int);
867869
insert t1 values (1),(2),(3),(4);
868870
set debug_sync= 'now wait_for downgraded';
869871
connection con2;
@@ -892,7 +894,7 @@ a b
892894
drop table t1;
893895
set debug_sync= 'reset';
894896
## VCOL + CHECK
895-
create table t1 (a int) engine=innodb;
897+
create table t1 (a int);
896898
insert t1 values (1),(2),(3),(4);
897899
set debug_sync= 'now wait_for downgraded';
898900
connection con2;
@@ -939,8 +941,8 @@ connection default;
939941
drop table t1;
940942
set debug_sync= reset;
941943
###
942-
create table t1 (a text, unique(a)) engine=innodb;
943-
create table t2 (b text, unique(b)) engine=innodb;
944+
create table t1 (a text, unique(a));
945+
create table t2 (b text, unique(b));
944946
insert into t2 values (null),(null);
945947
set debug_sync= 'now wait_for downgraded';
946948
connection con2;
@@ -958,7 +960,7 @@ set debug_sync= reset;
958960
#
959961
# MDEV-29038 XA assertions failing in binlog_rollback and binlog_commit
960962
#
961-
create table t (a int) engine=innodb;
963+
create table t (a int);
962964
insert into t values (1);
963965
xa begin 'xid';
964966
set debug_sync= 'now wait_for downgraded';
@@ -1303,7 +1305,7 @@ drop table t;
13031305
# Test that correct fields are marked as explicit:
13041306
# Drop a, reorder b, add new column with default.
13051307
#
1306-
create table t (a int primary key, b int) engine=innodb;
1308+
create table t (a int primary key, b int);
13071309
insert into t values (1, 1), (2, 2), (3, 3);
13081310
set debug_sync= "alter_table_copy_end signal copy wait_for goon";
13091311
alter table t drop primary key, drop a,
@@ -1334,7 +1336,7 @@ c x
13341336
3 123456
13351337
drop table t;
13361338
# Test that all the fields are unpacked.
1337-
create table t (a int, b int) engine=innodb;
1339+
create table t (a int, b int);
13381340
insert into t values (NULL, 123), (NULL, 456);
13391341
set debug_sync= "alter_table_copy_end signal copy wait_for goon";
13401342
alter table t drop a, add primary key(b), algorithm=copy;
@@ -1464,7 +1466,7 @@ INSERT iso_levels VALUES (0, "READ UNCOMMITTED"),
14641466
(1, "READ COMMITTED"),
14651467
(2, "REPEATABLE READ"),
14661468
(3, "SERIALIZABLE");
1467-
create table t1 (a int, b int, key(b)) engine=innodb;
1469+
create table t1 (a int, b int, key(b));
14681470
connection con2;
14691471
insert into t1 values (1,1),(null,null),(3,3),(4,null),(null,5);
14701472
connection default;
@@ -1477,7 +1479,7 @@ delete from t1 where b is null;
14771479
set debug_sync= "now signal goalters";
14781480
connection default;
14791481
drop table t1;
1480-
create table t1 (a int, b int, key(b)) engine=innodb;
1482+
create table t1 (a int, b int, key(b));
14811483
connection con2;
14821484
insert into t1 values (1,1),(null,null),(3,3),(4,null),(null,5);
14831485
connection default;
@@ -1490,7 +1492,7 @@ delete from t1 where b is null;
14901492
set debug_sync= "now signal goalters";
14911493
connection default;
14921494
drop table t1;
1493-
create table t1 (a int, b int, key(b)) engine=innodb;
1495+
create table t1 (a int, b int, key(b));
14941496
connection con2;
14951497
insert into t1 values (1,1),(null,null),(3,3),(4,null),(null,5);
14961498
connection default;
@@ -1503,7 +1505,7 @@ delete from t1 where b is null;
15031505
set debug_sync= "now signal goalters";
15041506
connection default;
15051507
drop table t1;
1506-
create table t1 (a int, b int, key(b)) engine=innodb;
1508+
create table t1 (a int, b int, key(b));
15071509
connection con2;
15081510
insert into t1 values (1,1),(null,null),(3,3),(4,null),(null,5);
15091511
connection default;
@@ -1520,8 +1522,8 @@ set debug_sync= reset;
15201522
drop table iso_levels;
15211523
# MDEV-32126 Assertion fails upon online ALTER and binary log enabled
15221524
create temporary table tmp (id int, primary key(id)) engine=innodb;
1523-
create table t1 (a int, b text) engine=innodb;
1524-
create table t2 (a int, b int, c char(8), d text, unique(a)) engine=innodb;
1525+
create table t1 (a int, b text);
1526+
create table t2 (a int, b int, c char(8), d text, unique(a));
15251527
insert into t2 values (1,1,'f','e'),(1000,1000,'c','b');
15261528
connection default;
15271529
set debug_sync= 'alter_table_online_before_lock signal go_trx wait_for go_alter';
@@ -1540,7 +1542,7 @@ truncate t2;
15401542
set @@binlog_format=mixed;
15411543
connection con2;
15421544
start transaction;
1543-
create temporary table tmp (id int, primary key(id)) engine=innodb;
1545+
create temporary table tmp (id int, primary key(id));
15441546
insert into t1 values (1, repeat('x',8000)),(2, repeat('x',8000));
15451547
update t2 set b = null order by b limit 2;
15461548
insert into t1 values (3, repeat('x',8000));
@@ -1564,7 +1566,7 @@ drop table t1, t2;
15641566
set @@binlog_format=default;
15651567
set debug_sync= reset;
15661568
# MDEV-32444 Data from orphaned XA transaction is lost after online alter
1567-
create table t (a int primary key) engine=innodb;
1569+
create table t (a int primary key);
15681570
insert into t values (1);
15691571
# XA commit
15701572
set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for go';
@@ -1673,6 +1675,7 @@ connect con1, localhost, root,,;
16731675
connection default;
16741676
drop table t;
16751677
set debug_sync= reset;
1678+
set global default_storage_engine= MyISAM;
16761679
disconnect con1;
16771680
disconnect con2;
16781681
#

mysql-test/main/alter_table_online_debug.test

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
--source include/have_innodb.inc
55
--source include/have_sequence.inc
66
--source include/have_partition.inc
7-
set default_storage_engine= innodb;
87

8+
let $default_storage_engine= `select @@global.default_storage_engine`;
9+
set global default_storage_engine= innodb;
10+
set default_storage_engine= innodb;
911
--connect (con2, localhost, root,,)
1012
--connection default
1113

@@ -368,7 +370,7 @@ alter table t1 add b int NULL, algorithm= copy, lock= none;
368370

369371
--connection con2
370372
--reap
371-
--error ER_DUP_ENTRY
373+
--error ER_DUP_ENTRY,ER_DUP_KEY
372374
insert into t1 values (1),(2),(3),(4),(5),(6);
373375
select * from t1;
374376
set debug_sync= 'now SIGNAL end';
@@ -629,6 +631,7 @@ alter table t1 drop system versioning, algorithm= copy, lock= none;
629631
#--reap
630632
#show create table t1;
631633
#select * from t1;
634+
drop table t1;
632635

633636
--echo #
634637
--echo # Test ROLLBACK TO SAVEPOINT
@@ -730,7 +733,7 @@ drop table t3;
730733
#
731734
# Lossy alter, Update_row_log_event cannot find 'abcde2' in the new table
732735
#
733-
create table t1 (a char(6), b int) engine=innodb;
736+
create table t1 (a char(6), b int);
734737
insert t1 values ('abcde1',1),('abcde2',2);
735738
--send set debug_sync= 'now wait_for downgraded'
736739
--connection con2
@@ -1007,7 +1010,7 @@ drop table t1;
10071010
set debug_sync= 'reset';
10081011

10091012
--echo ## CHECK, UPDATE
1010-
create table t1 (a int) engine=innodb;
1013+
create table t1 (a int);
10111014
insert t1 values (1),(2),(3),(4);
10121015
--send set debug_sync= 'now wait_for downgraded'
10131016
--connection con2
@@ -1026,7 +1029,7 @@ select * from t1;
10261029
drop table t1;
10271030

10281031
--echo ## DEFAULT, UPDATE
1029-
create table t1 (a int) engine=innodb;
1032+
create table t1 (a int);
10301033
insert t1 values (1),(2),(3),(4);
10311034
--send set debug_sync= 'now wait_for downgraded'
10321035
--connection con2
@@ -1048,7 +1051,7 @@ drop table t1;
10481051
set debug_sync= 'reset';
10491052

10501053
--echo ## VCOL + CHECK
1051-
create table t1 (a int) engine=innodb;
1054+
create table t1 (a int);
10521055
insert t1 values (1),(2),(3),(4);
10531056
--send set debug_sync= 'now wait_for downgraded'
10541057
--connection con2
@@ -1097,8 +1100,8 @@ set debug_sync= reset;
10971100

10981101
--echo ###
10991102

1100-
create table t1 (a text, unique(a)) engine=innodb;
1101-
create table t2 (b text, unique(b)) engine=innodb;
1103+
create table t1 (a text, unique(a));
1104+
create table t2 (b text, unique(b));
11021105
insert into t2 values (null),(null);
11031106
--send
11041107
set debug_sync= 'now wait_for downgraded';
@@ -1126,7 +1129,7 @@ set debug_sync= reset;
11261129
--echo #
11271130
--echo # MDEV-29038 XA assertions failing in binlog_rollback and binlog_commit
11281131
--echo #
1129-
create table t (a int) engine=innodb;
1132+
create table t (a int);
11301133
insert into t values (1);
11311134
xa begin 'xid';
11321135
--send
@@ -1513,7 +1516,7 @@ drop table t;
15131516
--echo # Test that correct fields are marked as explicit:
15141517
--echo # Drop a, reorder b, add new column with default.
15151518
--echo #
1516-
create table t (a int primary key, b int) engine=innodb;
1519+
create table t (a int primary key, b int);
15171520
insert into t values (1, 1), (2, 2), (3, 3);
15181521

15191522
set debug_sync= "alter_table_copy_end signal copy wait_for goon";
@@ -1539,7 +1542,7 @@ select * from t;
15391542
drop table t;
15401543

15411544
--echo # Test that all the fields are unpacked.
1542-
create table t (a int, b int) engine=innodb;
1545+
create table t (a int, b int);
15431546
insert into t values (NULL, 123), (NULL, 456);
15441547

15451548
set debug_sync= "alter_table_copy_end signal copy wait_for goon";
@@ -1711,7 +1714,7 @@ while($tx_iso_id) {
17111714
dec $tx_iso_id;
17121715
let tx_iso= `select level from iso_levels where id = $tx_iso_id`;
17131716

1714-
create table t1 (a int, b int, key(b)) engine=innodb;
1717+
create table t1 (a int, b int, key(b));
17151718

17161719
--connection con2
17171720
insert into t1 values (1,1),(null,null),(3,3),(4,null),(null,5);
@@ -1738,8 +1741,8 @@ drop table iso_levels;
17381741

17391742
--echo # MDEV-32126 Assertion fails upon online ALTER and binary log enabled
17401743
create temporary table tmp (id int, primary key(id)) engine=innodb;
1741-
create table t1 (a int, b text) engine=innodb;
1742-
create table t2 (a int, b int, c char(8), d text, unique(a)) engine=innodb;
1744+
create table t1 (a int, b text);
1745+
create table t2 (a int, b int, c char(8), d text, unique(a));
17431746
insert into t2 values (1,1,'f','e'),(1000,1000,'c','b');
17441747
--connection default
17451748
set debug_sync= 'alter_table_online_before_lock signal go_trx wait_for go_alter';
@@ -1760,7 +1763,7 @@ truncate t2;
17601763
set @@binlog_format=mixed;
17611764
--connection con2
17621765
start transaction;
1763-
create temporary table tmp (id int, primary key(id)) engine=innodb;
1766+
create temporary table tmp (id int, primary key(id));
17641767
insert into t1 values (1, repeat('x',8000)),(2, repeat('x',8000));
17651768
update t2 set b = null order by b limit 2;
17661769
insert into t1 values (3, repeat('x',8000));
@@ -1793,7 +1796,7 @@ set debug_sync= reset;
17931796

17941797
--echo # MDEV-32444 Data from orphaned XA transaction is lost after online alter
17951798

1796-
create table t (a int primary key) engine=innodb;
1799+
create table t (a int primary key);
17971800
insert into t values (1);
17981801

17991802
--echo # XA commit
@@ -1919,6 +1922,7 @@ select * from t;
19191922
--connection default
19201923
drop table t;
19211924
set debug_sync= reset;
1925+
eval set global default_storage_engine= $default_storage_engine;
19221926

19231927
--disconnect con1
19241928
--disconnect con2

0 commit comments

Comments
 (0)