diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2021-07-29 13:51:02 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2021-07-29 13:51:02 +0200 |
commit | 83d7e4faf6967ddd16b7dde6a89d65729c41b98d (patch) | |
tree | 3663b62237d9250b83d094166823b20c6c8f92a1 /sql/sql_yacc_ora.yy | |
parent | 6152ab7b42c18d62030ef9c23e9abb3817c73f39 (diff) | |
parent | fb8be6a631e68c57d36c1a0637033f6827105366 (diff) | |
download | mariadb-git-83d7e4faf6967ddd16b7dde6a89d65729c41b98d.tar.gz |
Merge branch '10.2' into 10.3
Diffstat (limited to 'sql/sql_yacc_ora.yy')
-rw-r--r-- | sql/sql_yacc_ora.yy | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sql/sql_yacc_ora.yy b/sql/sql_yacc_ora.yy index 3e292fe7ea4..e7d28eeb365 100644 --- a/sql/sql_yacc_ora.yy +++ b/sql/sql_yacc_ora.yy @@ -12793,10 +12793,13 @@ order_clause: created yet. */ SELECT_LEX *first_sl= unit->first_select(); - if (unlikely(!unit->is_unit_op() && - (first_sl->order_list.elements || - first_sl->select_limit) && + if (unlikely(!first_sl->next_select() && first_sl->tvc && unit->add_fake_select_lex(thd))) + MYSQL_YYABORT; + else if (unlikely(!unit->is_unit_op() && + (first_sl->order_list.elements || + first_sl->select_limit) && + unit->add_fake_select_lex(thd))) MYSQL_YYABORT; } if (sel->master_unit()->is_unit_op() && !sel->braces) @@ -12845,7 +12848,8 @@ limit_clause_init: LIMIT { SELECT_LEX *sel= Select; - if (sel->master_unit()->is_unit_op() && !sel->braces) + if (sel->master_unit()->is_unit_op() && !sel->braces && + sel->master_unit()->fake_select_lex) { /* Move LIMIT that belongs to UNION to fake_select_lex */ Lex->current_select= sel->master_unit()->fake_select_lex; |