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