summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2018-09-11 11:21:29 +0300
committerJan Lindström <jan.lindstrom@mariadb.com>2018-09-11 11:21:29 +0300
commit89457121565a8ea34d76590313bf57a2470995ef (patch)
tree4879a1f5ce31532f55e465eb8cc1ec380c23402e
parent21829bd743f487280dba918857259b9971a8afbf (diff)
downloadmariadb-git-bb-10.1-MDEV-13743.tar.gz
MDEV-13743: galera_toi_truncate may fail with: query 'reap' succeeded - should have failed with errno 1213bb-10.1-MDEV-13743
Replace sleep with wait condition and increase the size of the insert.
-rw-r--r--mysql-test/suite/galera/r/galera_toi_truncate.result3
-rw-r--r--mysql-test/suite/galera/t/galera_toi_truncate.test13
2 files changed, 12 insertions, 4 deletions
diff --git a/mysql-test/suite/galera/r/galera_toi_truncate.result b/mysql-test/suite/galera/r/galera_toi_truncate.result
index f52316f3cbc..65889dd858a 100644
--- a/mysql-test/suite/galera/r/galera_toi_truncate.result
+++ b/mysql-test/suite/galera/r/galera_toi_truncate.result
@@ -2,7 +2,8 @@ CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
SET SESSION wsrep_retry_autocommit = 0;
-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;;
+INSERT INTO t1(f1) SELECT 1 FROM ten as a1, ten AS a2;
+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;;
TRUNCATE TABLE t1;;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
SELECT COUNT(*) = 0 FROM t1;
diff --git a/mysql-test/suite/galera/t/galera_toi_truncate.test b/mysql-test/suite/galera/t/galera_toi_truncate.test
index 59ef5c2028f..7a7e9255a8a 100644
--- a/mysql-test/suite/galera/t/galera_toi_truncate.test
+++ b/mysql-test/suite/galera/t/galera_toi_truncate.test
@@ -16,14 +16,21 @@ INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
-# Insert 100K rows
+# Insert 1m rows
--connection node_2
+--let $wait_condition = SELECT COUNT(*) = 10 FROM ten;
+--source include/wait_condition.inc
+
# Prevent autocommit retring from masking the deadlock error we expect to get
SET SESSION wsrep_retry_autocommit = 0;
---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;
+INSERT INTO t1(f1) SELECT 1 FROM ten as a1, ten AS a2;
+--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;
--connection node_1
---sleep 1
+# Wait for a above insert to start
+--let $wait_condition = SELECT COUNT(*) >= 100 from t1;
+--source include/wait_condition.inc
+
--send TRUNCATE TABLE t1;
--connection node_1