revision-id: 89457121565a8ea34d76590313bf57a2470995ef (mariadb-10.1.35-46-g89457121565) parent(s): 21829bd743f487280dba918857259b9971a8afbf author: Jan Lindström committer: Jan Lindström timestamp: 2018-09-11 11:21:29 +0300 message: MDEV-13743: galera_toi_truncate may fail with: query 'reap' succeeded - should have failed with errno 1213 Replace sleep with wait condition and increase the size of the insert. --- mysql-test/suite/galera/r/galera_toi_truncate.result | 3 ++- mysql-test/suite/galera/t/galera_toi_truncate.test | 13 ++++++++++--- 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