Skip to content

Commit ad0f85b

Browse files
committed
MDEV-18838 : galera.galera_toi_truncate: Test failure: mysqltest: query 'reap' succeeded - should have failed with errno 1213
Test cleanup.
1 parent 2c4a2f2 commit ad0f85b

File tree

2 files changed

+18
-28
lines changed

2 files changed

+18
-28
lines changed
Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
11
connection node_1;
2-
CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
2+
CREATE TABLE ten (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB;
33
INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
44
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
55
connection node_2;
66
SET SESSION wsrep_retry_autocommit = 0;
7-
INSERT INTO t1(f1) SELECT 1 FROM ten as a1, ten AS a2;
8-
set debug_sync='ha_commit_trans_after_prepare WAIT_FOR go';
9-
INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6;;
7+
INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6, ten AS a7, ten AS a8;
108
connection node_1;
119
TRUNCATE TABLE t1;;
12-
connection node_1;
1310
connection node_2;
1411
ERROR 40001: Deadlock: wsrep aborted transaction
12+
connection node_1;
1513
connection node_2;
16-
SELECT COUNT(*) = 0 FROM t1;
17-
COUNT(*) = 0
18-
1
14+
SELECT COUNT(*) AS EXPECT_0 FROM t1;
15+
EXPECT_0
16+
0
1917
connection node_1;
20-
SELECT COUNT(*) = 0 FROM t1;
21-
COUNT(*) = 0
22-
1
18+
SELECT COUNT(*) AS EXPECT_0 FROM t1;
19+
EXPECT_0
20+
0
2321
DROP TABLE t1;
2422
DROP TABLE ten;

mysql-test/suite/galera/t/galera_toi_truncate.test

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,50 +4,42 @@
44
#
55

66
--source include/galera_cluster.inc
7-
--source include/have_innodb.inc
87
--source include/have_debug_sync.inc
9-
--source include/not_embedded.inc
8+
--source include/have_debug.inc
109

1110
#
1211
# INSERT and TRUNCATE on different nodes
1312
#
1413

1514
--connection node_1
16-
CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
15+
CREATE TABLE ten (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB;
1716
INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
1817

1918
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
2019

21-
# Insert 1m rows
2220
--connection node_2
2321
--let $wait_condition = SELECT COUNT(*) = 10 FROM ten;
2422
--source include/wait_condition.inc
2523

2624
# Prevent autocommit retring from masking the deadlock error we expect to get
2725
SET SESSION wsrep_retry_autocommit = 0;
28-
INSERT INTO t1(f1) SELECT 1 FROM ten as a1, ten AS a2;
29-
30-
set debug_sync='ha_commit_trans_after_prepare WAIT_FOR go';
31-
--send INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6;
26+
--send INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6, ten AS a7, ten AS a8
3227

3328
--connection node_1
34-
# Wait for a above insert to start
35-
--let $wait_condition = SELECT COUNT(*) >= 100 from t1;
36-
--source include/wait_condition.inc
37-
3829
--send TRUNCATE TABLE t1;
3930

40-
--connection node_1
41-
--reap
42-
4331
--connection node_2
4432
--error ER_LOCK_DEADLOCK
4533
--reap
4634

35+
--connection node_1
36+
--reap
37+
4738
--connection node_2
48-
SELECT COUNT(*) = 0 FROM t1;
39+
SELECT COUNT(*) AS EXPECT_0 FROM t1;
4940

5041
--connection node_1
51-
SELECT COUNT(*) = 0 FROM t1;
42+
SELECT COUNT(*) AS EXPECT_0 FROM t1;
43+
5244
DROP TABLE t1;
5345
DROP TABLE ten;

0 commit comments

Comments
 (0)