summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/innodb/t/ddl_purge.test
blob: 8f84206c52a9a58389250345272fb7e8a047d41c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
--source innodb_default_row_format.inc
--source include/have_debug.inc
--source include/have_debug_sync.inc

CREATE TABLE t0 (pk INT PRIMARY KEY) ENGINE=InnoDB;
CREATE TABLE t1 (pk INT PRIMARY KEY, b INT) ENGINE=InnoDB;
# MDEV-515 takes X-lock on the table for the first insert.
# So concurrent insert won't happen on the table
INSERT INTO t0 VALUES(100);

INSERT INTO t1 VALUES(100, 100);

--connect (con1,localhost,root,,test)
BEGIN;
INSERT INTO t0 SET pk=1;

--connect (con2,localhost,root,,test)
BEGIN;
INSERT INTO t0 SET pk=2;

--connection default
SET DEBUG_SYNC='alter_table_inplace_after_lock_downgrade SIGNAL prepared WAIT_FOR logged';
send ALTER TABLE t1 FORCE;

--connection con1
SET DEBUG_SYNC='now WAIT_FOR prepared';
INSERT INTO t1 SET pk=1;
COMMIT;
--disconnect con1

--connection con2
UPDATE t1 SET b=1;
DELETE FROM t1;
ROLLBACK;
SET DEBUG_SYNC='now SIGNAL logged';
--disconnect con2

--connection default
reap;
SET DEBUG_SYNC='RESET';
DROP TABLE t0,t1;