summaryrefslogtreecommitdiff
path: root/sql/sql_union.cc
diff options
context:
space:
mode:
authorOystein Grovlen <oystein.grovlen@oracle.com>2010-11-10 15:48:29 +0100
committerOystein Grovlen <oystein.grovlen@oracle.com>2010-11-10 15:48:29 +0100
commitbb356127a3f2095cebec63f50205682bdf765e64 (patch)
tree509d217aa4ebb8bc1464a8352f50ae30468e4e12 /sql/sql_union.cc
parentebed5380e89cfafc04b99c5f452eccd20e7264ed (diff)
downloadmariadb-git-bb356127a3f2095cebec63f50205682bdf765e64.tar.gz
Bug#57704 Cleanup code dies with void TABLE::set_keyread(bool): Assertion `file' failed.
This bug was introduced in this revision: kostja@sun.com-20100727102553-b4n2ojcyfj79l2x7 ("A pre-requisite patch for the fix for Bug#52044.") It happens because close_thread_tables() is now called in open_and_lock_tables upon failure. Hence, table is no longer open when optimizer tries to do cleanup. Fix: Make sure to do cleanup in st_select_lex_unit::prepare() upon failure. This way, cleanup() is called before tables are released. mysql-test/r/subselect.result: Added test case for Bug#57704. mysql-test/t/subselect.test: Added test case for Bug#57704. sql/sql_union.cc: st_select_lex_unit::prepare(): On failure, make sure cleanup() is called.
Diffstat (limited to 'sql/sql_union.cc')
-rw-r--r--sql/sql_union.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index 98f20e09949..1c0c48c0fec 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -434,6 +434,7 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
err:
thd_arg->lex->current_select= lex_select_save;
+ (void) cleanup();
DBUG_RETURN(TRUE);
}