summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2016-01-26 14:49:25 +0200
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2016-01-26 14:49:25 +0200
commita7f62444ae3ca3048ff69762e6f950f72eaf63ed (patch)
tree1d739cf70f393c1b109c82b41f7c19e38466a102
parente7a89b46d4ece1351cc60d8bafb8bf90ca9d8cc8 (diff)
downloadmariadb-git-bb-10.1-mdev-9304.tar.gz
[MDEV-9304] MariaDB crash with specific querybb-10.1-mdev-9304
A fix making tmp_join not get double freed.
-rw-r--r--sql/sql_union.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index c8350838ee8..6d584e1242e 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -1043,6 +1043,12 @@ bool st_select_lex_unit::cleanup()
join->tables_list= 0;
join->table_count= 0;
join->top_join_tab_count= 0;
+ if (join->tmp_join && join->tmp_join != join)
+ {
+ join->tmp_join->tables_list= 0;
+ join->tmp_join->table_count= 0;
+ join->tmp_join->top_join_tab_count= 0;
+ }
}
error|= fake_select_lex->cleanup();
/*