summaryrefslogtreecommitdiff
path: root/sql/sql_derived.cc
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2016-11-11 20:55:03 -0800
committerIgor Babaev <igor@askmonty.org>2016-11-11 20:55:25 -0800
commit96b62b55149a9297f32c3aad99ece613cc3f788f (patch)
tree9915cccc75b02ab985fe2ed5d559376c85a2b03a /sql/sql_derived.cc
parent10aee66896a127da599a91f389820937cb4ba832 (diff)
downloadmariadb-git-96b62b55149a9297f32c3aad99ece613cc3f788f.tar.gz
Fixed bug mdev-11161.
The flag TABLE_LIST::fill_me must be reset to false at the prepare phase for any materialized derived table used in the executed query. Otherwise if the optimizer decides to generate a key for such a table it is generated only for the first execution of the query.
Diffstat (limited to 'sql/sql_derived.cc')
-rw-r--r--sql/sql_derived.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc
index c6865a7116e..44395599961 100644
--- a/sql/sql_derived.cc
+++ b/sql/sql_derived.cc
@@ -651,6 +651,8 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *derived)
unit->derived= derived;
+ derived->fill_me= FALSE;
+
if (!(derived->derived_result= new select_union))
DBUG_RETURN(TRUE); // out of memory