Skip to content

Commit 5999a8d

Browse files
committed
MDEV-37408 Assertion `!thd->is_error()' failed in LEX::make_item_func_or_method_call upon SELECT or WITH
Removing a wrong DBUG_ASSERT from LEX::make_item_func_or_method_call(), as this method can be called with an already raised SQL error.
1 parent 2cb0e55 commit 5999a8d

File tree

3 files changed

+49
-1
lines changed

3 files changed

+49
-1
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
SET sql_mode=ORACLE;
2+
#
3+
# MDEV-37408 Assertion `!thd->is_error()' failed in LEX::make_item_func_or_method_call upon SELECT or WITH
4+
#
5+
WITH w AS (SELECT *)
6+
SELECT * FROM t WHERE c HAVING 1 WINDOW t AS ()
7+
ORDER BY 1, 1=ANY(SELECT * LIMIT 1), t.t();
8+
ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
9+
DECLARE
10+
TYPE arr_t IS TABLE OF INT INDEX BY INT;
11+
arr arr_t;
12+
BEGIN
13+
WITH w AS (SELECT *) SELECT * FROM t
14+
WHERE c HAVING 1 WINDOW t AS ()
15+
ORDER BY 1, 1=ANY(SELECT * LIMIT 1), arr.t();
16+
END;
17+
$$
18+
ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
19+
SHOW WARNINGS;
20+
Level Code Message
21+
Error 1235 This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
22+
Error 1305 FUNCTION arr.t does not exist
23+
# End of 12.1 bugs
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
SET sql_mode=ORACLE;
2+
3+
--echo #
4+
--echo # MDEV-37408 Assertion `!thd->is_error()' failed in LEX::make_item_func_or_method_call upon SELECT or WITH
5+
--echo #
6+
7+
--error ER_NOT_SUPPORTED_YET
8+
WITH w AS (SELECT *)
9+
SELECT * FROM t WHERE c HAVING 1 WINDOW t AS ()
10+
ORDER BY 1, 1=ANY(SELECT * LIMIT 1), t.t();
11+
12+
DELIMITER $$;
13+
--error ER_NOT_SUPPORTED_YET
14+
DECLARE
15+
TYPE arr_t IS TABLE OF INT INDEX BY INT;
16+
arr arr_t;
17+
BEGIN
18+
WITH w AS (SELECT *) SELECT * FROM t
19+
WHERE c HAVING 1 WINDOW t AS ()
20+
ORDER BY 1, 1=ANY(SELECT * LIMIT 1), arr.t();
21+
END;
22+
$$
23+
DELIMITER ;$$
24+
SHOW WARNINGS;
25+
26+
--echo # End of 12.1 bugs

sql/sql_lex.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10664,7 +10664,6 @@ Item *LEX::make_item_func_or_method_call(THD *thd,
1066410664
List<Item> *args,
1066510665
const Lex_ident_cli_st &query_fragment)
1066610666
{
10667-
DBUG_ASSERT(!thd->is_error());
1066810667
const Lex_ident_sys sys_a(thd, &ca), sys_b(thd, &cb);
1066910668
if (sys_a.is_null() || sys_b.is_null())
1067010669
return nullptr; // EOM

0 commit comments

Comments
 (0)