From b80db00ef31f7f57d618bd1399c8743a101d11e7 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Dec 2004 16:28:25 +0100 Subject: [PATCH] A fix for a crash in sp.test with -debug-max. When the joins were not cleaned up before the tables were closed, a JOIN_TAB still held a pointer to a meanwhile closed table and tried to close it again during item cleanup... --- sql/sp_head.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 114ff0d451a..31c6075b590 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -681,6 +681,8 @@ sp_head::execute_procedure(THD *thd, List *args) nctx->set_oindex(i, static_cast(it)->get_offset()); } } + // Clean up the joins before closing the tables. + thd->lex->unit.cleanup(); // Close tables opened for subselect in argument list close_thread_tables(thd);