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-08-04 17:26:30 +0300
commitcc9f10c99a9f4cc6d6839ff84521ee8d81ef9415 (patch)
tree68add496a106beab9e0056a4204d547feec8d4f3
parent93d5cdf03f22df5cc6e071edd623a00f82b0e6e7 (diff)
downloadmariadb-git-bb-5.5-mdev-9304.tar.gz
MDEV-9304: MariaDB crash with specific querybb-5.5-mdev-9304
tmp_join may get its tables freed twice during JOIN cleanup. Set them to NULL when the tmp_join is different than the current join.
-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 87d3e86b2c7..95ce1c9b940 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -887,6 +887,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();
/*