Skip to content

Commit 545a619

Browse files
author
Varun Gupta
committed
MDEV-22187: SIGSEGV in ha_innobase::cmp_ref on DELETE
Added a new test file for tests with delete using INNODB.
1 parent 9160e4a commit 545a619

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

mysql-test/main/delete_innodb.result

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Tests for delete with INNODB
2+
#
3+
# MDEV-22187: SIGSEGV in ha_innobase::cmp_ref on DELETE
4+
#
5+
SET @save_sort_buffer_size= @@sort_buffer_size;
6+
SET sort_buffer_size=1024;
7+
CREATE TABLE t1(c1 CHAR(255) PRIMARY KEY) ENGINE=InnoDB;
8+
INSERT INTO t1 VALUES (0), ('a'), ('b');
9+
ANALYZE TABLE T1 PERSISTENT FOR ALL;
10+
Table Op Msg_type Msg_text
11+
test.t1 analyze status Engine-independent statistics collected
12+
test.t1 analyze status OK
13+
SELECT * FROM t1;
14+
c1
15+
0
16+
a
17+
b
18+
EXPLAIN DELETE b FROM t1 AS a JOIN t1 AS b;
19+
id select_type table type possible_keys key key_len ref rows Extra
20+
1 SIMPLE a index NULL PRIMARY 255 NULL 3 Using index
21+
1 SIMPLE b ALL NULL NULL NULL NULL 3
22+
DELETE b FROM t1 AS a JOIN t1 AS b;
23+
SELECT * FROM t1;
24+
c1
25+
SET sort_buffer_size=@save_sort_buffer_size;
26+
DROP TABLE t1;

mysql-test/main/delete_innodb.test

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
--source include/have_innodb.inc
2+
--source include/have_sequence.inc
3+
4+
--echo # Tests for delete with INNODB
5+
6+
--echo #
7+
--echo # MDEV-22187: SIGSEGV in ha_innobase::cmp_ref on DELETE
8+
--echo #
9+
10+
SET @save_sort_buffer_size= @@sort_buffer_size;
11+
SET sort_buffer_size=1024;
12+
CREATE TABLE t1(c1 CHAR(255) PRIMARY KEY) ENGINE=InnoDB;
13+
14+
INSERT INTO t1 VALUES (0), ('a'), ('b');
15+
ANALYZE TABLE T1 PERSISTENT FOR ALL;
16+
SELECT * FROM t1;
17+
EXPLAIN DELETE b FROM t1 AS a JOIN t1 AS b;
18+
DELETE b FROM t1 AS a JOIN t1 AS b;
19+
SELECT * FROM t1;
20+
21+
SET sort_buffer_size=@save_sort_buffer_size;
22+
DROP TABLE t1;

0 commit comments

Comments
 (0)