@@ -85,7 +85,7 @@ SELECT 1 FROM (SELECT 1 as a) b WHERE 1 IN (SELECT (SELECT a));
select (SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(1));
ERROR HY000: Incorrect usage of PROCEDURE and subquery
SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE((SELECT 1));
ERROR HY000: Incorrect parameters to procedure 'ANALYSE'
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT 1))' at line 1
SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NULL;
ERROR 42S22: Unknown column 'a' in 'field list'
SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NOT NULL;
...
...
@@ -3594,7 +3594,7 @@ delete from t1 where c <= 1140006215 and (select b from t2 where a = 2) = 1;
drop table t1, t2;
CREATE TABLE t1 (a INT);
CREATE VIEW v1 AS SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1);
ERROR 42S22: Unknown column 'no_such_column' in 'where clause'
ERROR 42S22: Unknown column 'no_such_column' in 'IN/ALL/ANY subquery'
CREATE VIEW v2 AS SELECT * FROM t1 WHERE no_such_column = (SELECT 1);
ERROR 42S22: Unknown column 'no_such_column' in 'where clause'
SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1);
...
...
@@ -7019,6 +7019,72 @@ select exists(select 1 from t1 group by `c` in (select `c` from t1));
exists(select 1 from t1 group by `c` in (select `c` from t1))
0
drop table t1;
#
# MDEV-7565: Server crash with Signal 6 (part 2)
#
Select
(Select Sum(`TestCase`.Revenue) From mysql.slow_log E
Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2)
) As `ControlRev`
From
(Select 3 as Revenue, 4 as TemplateID) As `TestCase`
Group By TestCase.Revenue, TestCase.TemplateID;
ControlRev
NULL
#
# MDEV-7445:Server crash with Signal 6
#
CREATE PROCEDURE procedure2()
BEGIN
Select
(Select Sum(`TestCase`.Revenue) From mysql.slow_log E
Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2)
) As `ControlRev`
From
(Select 3 as Revenue, 4 as TemplateID) As `TestCase`
Group By TestCase.Revenue, TestCase.TemplateID;
END |
call procedure2();
ControlRev
NULL
call procedure2();
ControlRev
NULL
drop procedure procedure2;
SELECT
(SELECT user FROM mysql.user
WHERE h.host in (SELECT host FROM mysql.user)
) AS sq
FROM mysql.host h GROUP BY h.host;
sq
#
# MDEV-7846:Server crashes in Item_subselect::fix
#_fields or fails with Thread stack overrun
#
CREATE TABLE t1 (column1 INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (3),(9);
CREATE TABLE t2 (column2 INT) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1),(4);
CREATE TABLE t3 (column3 INT) ENGINE=MyISAM;
INSERT INTO t3 VALUES (6),(8);
CREATE TABLE t4 (column4 INT) ENGINE=MyISAM;
INSERT INTO t4 VALUES (2),(5);
PREPARE stmt FROM "
SELECT (
SELECT MAX( table1.column1 ) AS field1
FROM t1 AS table1
WHERE table3.column3 IN ( SELECT table2.column2 AS field2 FROM t2 AS table2 )
) AS sq
FROM t3 AS table3, t4 AS table4 GROUP BY sq
";
EXECUTE stmt;
sq
NULL
EXECUTE stmt;
sq
NULL
deallocate prepare stmt;
drop table t1,t2,t3,t4;
set optimizer_switch=default;
select @@optimizer_switch like '%exists_to_in=off%';