Skip to content

Commit c519aa3

Browse files
author
Jan Lindström
committed
MDEV-24143 : Galera nodes "randomly" crashing in Item_func_release_lock::val_int
Fixed on MDEV-27713. Added additional test case.
1 parent 507030c commit c519aa3

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
connection node_2;
2+
connection node_1;
3+
CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 BINARY (10), c3 DATETIME);
4+
SELECT get_lock ('test2', 0);
5+
get_lock ('test2', 0)
6+
1
7+
DROP TABLE t1;
8+
CREATE TABLE t1 (c1 SMALLINT NOT NULL AUTO_INCREMENT PRIMARY KEY);
9+
INSERT INTO t1 VALUES (1);
10+
SET SESSION wsrep_trx_fragment_size=10;
11+
SET SESSION autocommit=0;
12+
SELECT * FROM t1 WHERE c1 <=0 ORDER BY c1 DESC;
13+
c1
14+
INSERT INTO t1 VALUES (4),(3),(1),(2);
15+
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
16+
CREATE TABLE t1 (pk INT PRIMARY KEY, b INT) ENGINE=SEQUENCE;
17+
ERROR 42S01: Table 't1' already exists
18+
ALTER TABLE t1 DROP COLUMN c2;
19+
ERROR 42000: Can't DROP COLUMN `c2`; check that it exists
20+
SELECT get_lock ('test', 1.5);
21+
get_lock ('test', 1.5)
22+
1
23+
DROP TABLE t1;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--source include/galera_cluster.inc
2+
--source include/have_sequence.inc
3+
4+
CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 BINARY (10), c3 DATETIME);
5+
SELECT get_lock ('test2', 0);
6+
DROP TABLE t1;
7+
CREATE TABLE t1 (c1 SMALLINT NOT NULL AUTO_INCREMENT PRIMARY KEY);
8+
INSERT INTO t1 VALUES (1);
9+
SET SESSION wsrep_trx_fragment_size=10;
10+
SET SESSION autocommit=0;
11+
SELECT * FROM t1 WHERE c1 <=0 ORDER BY c1 DESC;
12+
--error ER_LOCK_DEADLOCK
13+
INSERT INTO t1 VALUES (4),(3),(1),(2);
14+
--error ER_TABLE_EXISTS_ERROR
15+
CREATE TABLE t1 (pk INT PRIMARY KEY, b INT) ENGINE=SEQUENCE;
16+
--error ER_CANT_DROP_FIELD_OR_KEY
17+
ALTER TABLE t1 DROP COLUMN c2;
18+
SELECT get_lock ('test', 1.5);
19+
DROP TABLE t1;
20+

0 commit comments

Comments
 (0)