Debian Codegraph @

mysql-test/suite/galera_sr/t/GCF-585.test

raw
1 #
2 # GCF-585 SR: Assertion `total_length + wsrep_get_fragment_base(thd) == saved_pos' failed in wsrep_write_cache_once after SQL error
3 #
4
5 --source include/galera_cluster.inc
6
7 # Test case #1
8
9 create table t1 (f1 integer primary key) engine=innodb;
10 set autocommit=off;
11 set session wsrep_trx_fragment_size=1;
12 start transaction;
13 insert into t1 values (1);
14 # If we try to INSERT a duplicate key, ER_LOCK_DEADLOCK is the only possible
15 # outcome at this point. Notice that ER_DUP_ENTRY is NOT an option here
16 # because we were forced to rollback the whole transaction (not just the
17 # statement)
18 --error ER_LOCK_DEADLOCK
19 insert into t1 values (2),(1);
20 alter table t1 drop primary key;
21 drop table t1;
22
23 # Test case #2
24
25 CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
26 INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
27
28 SET SESSION wsrep_trx_fragment_size=1;
29 SET AUTOCOMMIT=OFF;
30 START TRANSACTION;
31 update t1 set f1 = 100 where f1 = 10;
32
33 --connection node_2
34 INSERT INTO t1 VALUES (11),(12),(13),(14),(15),(16),(17),(18),(19),(20);
35 SET SESSION wsrep_trx_fragment_size=1;
36 SET SESSION innodb_lock_wait_timeout=1;
37 SET AUTOCOMMIT=OFF;
38 START TRANSACTION;
39 --error ER_LOCK_DEADLOCK
40 delete from t1 where f1 > 10;
41 --error ER_LOCK_DEADLOCK
42 delete from t1 where f1 > 10 and f1 < 100;
43
44 DROP TABLE t1;