diff options
author | konstantin@mysql.com <> | 2005-10-13 11:53:00 +0400 |
---|---|---|
committer | konstantin@mysql.com <> | 2005-10-13 11:53:00 +0400 |
commit | b2ff38202d2ba6020ce6b5f3bfb8e2c939d0189c (patch) | |
tree | 1b8bb03febfb001c7548f0c3e434fa74bc71c9da /sql/sql_union.cc | |
parent | 2c7505b2638d13511db6eb27fc84dc1c37d6efde (diff) | |
download | mariadb-git-b2ff38202d2ba6020ce6b5f3bfb8e2c939d0189c.tar.gz |
A fix and a test case for Bug#12736 "Server crash during a select".
The bug was in JOIN::join_free which was wrongly determining that
all joins have been already executed and therefore all used tables
can be closed.
Diffstat (limited to 'sql/sql_union.cc')
-rw-r--r-- | sql/sql_union.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 951248e8cd8..dee88af7d83 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -720,3 +720,17 @@ bool st_select_lex::cleanup() DBUG_RETURN(error); } + +void st_select_lex::cleanup_all_joins(bool full) +{ + SELECT_LEX_UNIT *unit; + SELECT_LEX *sl; + + if (join) + join->cleanup(full); + + for (unit= first_inner_unit(); unit; unit= unit->next_unit()) + for (sl= unit->first_select(); sl; sl= sl->next_select()) + sl->cleanup_all_joins(full); +} + |