summaryrefslogtreecommitdiffstats
path: root/sql/sql_derived.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:39:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:39:13 +0000
commit86fbb58c3ac0865482819c10a3e81f2eea001c36 (patch)
tree28c9e526ea739c6f9b89e36115e1e2698bddf981 /sql/sql_derived.cc
parentReleasing progress-linux version 1:10.11.6-2~progress7.99u1. (diff)
downloadmariadb-86fbb58c3ac0865482819c10a3e81f2eea001c36.tar.xz
mariadb-86fbb58c3ac0865482819c10a3e81f2eea001c36.zip
Merging upstream version 1:10.11.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sql/sql_derived.cc')
-rw-r--r--sql/sql_derived.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc
index 4e42bcd3..afcbb7f8 100644
--- a/sql/sql_derived.cc
+++ b/sql/sql_derived.cc
@@ -1243,6 +1243,9 @@ bool mysql_derived_fill(THD *thd, LEX *lex, TABLE_LIST *derived)
goto err;
JOIN *join= unit->first_select()->join;
join->first_record= false;
+ if (join->zero_result_cause)
+ goto err;
+
for (uint i= join->top_join_tab_count;
i < join->top_join_tab_count + join->aggr_tables;
i++)
@@ -1351,6 +1354,10 @@ bool mysql_derived_reinit(THD *thd, LEX *lex, TABLE_LIST *derived)
derived->get_unit()));
st_select_lex_unit *unit= derived->get_unit();
+ // reset item names to that saved after wildcard expansion in JOIN::prepare
+ for(st_select_lex *sl= unit->first_select(); sl; sl= sl->next_select())
+ sl->restore_item_list_names();
+
derived->merged_for_insert= FALSE;
unit->unclean();
unit->types.empty();