1
--source include/have_debug.inc
4
# Bug #37627: Killing query with sum(exists()) or avg(exists()) reproducibly
8
CREATE TABLE t1(id INT);
9
INSERT INTO t1 VALUES (1),(2),(3),(4);
10
INSERT INTO t1 SELECT a.id FROM t1 a,t1 b,t1 c,t1 d;
11
# Setup the mysqld to crash at certain point
12
SET SESSION debug="d,subselect_exec_fail";
13
SELECT SUM(EXISTS(SELECT RAND() FROM t1)) FROM t1;
14
SELECT REVERSE(EXISTS(SELECT RAND() FROM t1));
15
SET SESSION debug=DEFAULT;