2008-07-07 11:43:56 +03:00
|
|
|
--source include/have_debug.inc
|
|
|
|
|
|
|
|
#
|
|
|
|
# Bug #37627: Killing query with sum(exists()) or avg(exists()) reproducibly
|
|
|
|
# crashes server
|
|
|
|
#
|
|
|
|
|
|
|
|
CREATE TABLE t1(id INT);
|
|
|
|
INSERT INTO t1 VALUES (1),(2),(3),(4);
|
|
|
|
INSERT INTO t1 SELECT a.id FROM t1 a,t1 b,t1 c,t1 d;
|
|
|
|
# Setup the mysqld to crash at certain point
|
2008-10-12 13:09:52 +03:00
|
|
|
SET @orig_debug=@@debug;
|
2011-12-15 22:07:58 +01:00
|
|
|
SET GLOBAL debug_dbug="d,subselect_exec_fail";
|
2008-07-07 11:43:56 +03:00
|
|
|
SELECT SUM(EXISTS(SELECT RAND() FROM t1)) FROM t1;
|
|
|
|
SELECT REVERSE(EXISTS(SELECT RAND() FROM t1));
|
2011-12-15 22:07:58 +01:00
|
|
|
SET GLOBAL debug_dbug=@orig_debug;
|
2008-07-07 11:43:56 +03:00
|
|
|
DROP TABLE t1;
|
2013-11-13 12:43:39 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# MDEV-5284 Assertion `!(*expr)->fixed' fails in replace_where_subcondition with IN suquery
|
|
|
|
#
|
|
|
|
|
|
|
|
create table t1 (i int);
|
|
|
|
insert into t1 values (1),(2);
|
|
|
|
select * from t1 where (i < 200 or i = 300) and i in (select i from t1);
|
|
|
|
drop table t1;
|
|
|
|
|