summaryrefslogtreecommitdiff
path: root/sql/sp_head.cc
diff options
context:
space:
mode:
authorunknown <pem@mysql.com>2003-02-28 15:07:14 +0100
committerunknown <pem@mysql.com>2003-02-28 15:07:14 +0100
commit1ff79b61a056e5b50fc0402680f6f74ca1eb2a57 (patch)
tree1e6844a1e5ea3c286461cf1aedc892b978b5d9fc /sql/sp_head.cc
parentaecc6a21bd1e802d31318cf3e82d03d57b090c5f (diff)
downloadmariadb-git-1ff79b61a056e5b50fc0402680f6f74ca1eb2a57.tar.gz
Closing tables during SP execution the proper way.
mysql-test/r/show_check.result: proc table now shows up in different places. mysql-test/r/status.result: proc table now shows up in different places. sql/sp.cc: Fixed closing of tables. sql/sp_head.cc: Close tables after each sub statement. sql/sql_class.cc: Removed closing of tables in various send_eof() methods again.
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r--sql/sp_head.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index b461f2035ad..9de3ee471f2 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -415,6 +415,11 @@ sp_instr_stmt::execute(THD *thd, uint *nextp)
thd->lex.thd = thd;
res= mysql_execute_command(thd);
+ if (thd->lock || thd->open_tables || thd->derived_tables)
+ {
+ thd->proc_info="closing tables";
+ close_thread_tables(thd); /* Free tables */
+ }
memcpy(&thd->lex, &olex, sizeof(LEX)); // Restore the other lex