summaryrefslogtreecommitdiff
path: root/sql/sql_yacc.yy
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2023-02-08 19:24:15 -0800
committerIgor Babaev <igor@askmonty.org>2023-02-09 08:59:23 -0800
commitc63768425b03148737ba62dda7b6948283b04c94 (patch)
tree8ce93944c2db49515cc11a81335ad35bf64c0533 /sql/sql_yacc.yy
parent08c852026ddaa1ae7717aa31950946c9da457f1f (diff)
downloadmariadb-git-c63768425b03148737ba62dda7b6948283b04c94.tar.gz
MDEV-30586 DELETE with aggregation in subquery of WHERE returns bogus error
The parser code for single-table DELETE missed the call of the function LEX::check_main_unit_semantics(). As a result the the field nested level of SELECT_LEX structures remained set 0 for all non-top level selects. This could lead to different kind of problems. In particular this did not allow to determine properly the selects where set functions had to be aggregated when they were used in inner subqueries. Approved by Oleksandr Byelkin <sanja@mariadb.com>
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r--sql/sql_yacc.yy4
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 0221e4ed433..902b7d16022 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -14032,6 +14032,8 @@ delete_part2:
{
Lex->last_table()->vers_conditions= Lex->vers_conditions;
Lex->pop_select(); //main select
+ if (Lex->check_main_unit_semantics())
+ MYSQL_YYABORT;
}
;
@@ -14068,6 +14070,8 @@ single_multi:
if ($3)
Select->order_list= *($3);
Lex->pop_select(); //main select
+ if (Lex->check_main_unit_semantics())
+ MYSQL_YYABORT;
}
| table_wild_list
{