summaryrefslogtreecommitdiff
path: root/sql/sp_head.cc
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@mysql.com>2008-09-29 19:11:34 +0500
committerAlexey Botchkov <holyfoot@mysql.com>2008-09-29 19:11:34 +0500
commitce64a16b75746848c8d5a89cfb726a38691c9d6f (patch)
treecdb71d2132a10b7e94fede365fd8f6c5bc4ee92b /sql/sp_head.cc
parent119c5aaeba2b35f201bdbd98c0714be9b6a780fb (diff)
downloadmariadb-git-ce64a16b75746848c8d5a89cfb726a38691c9d6f.tar.gz
Bug#37949 Crash if argument to SP is a subquery that returns more than one row
JOIN for the subselect wasn't cleaned if we came upon an error during sub_select() execution. That leads to the assertion failure in close_thread_tables() part of the 6.0 code backported per-file comments: mysql-test/r/sp-error.result Bug#37949 Crash if argument to SP is a subquery that returns more than one row test result mysql-test/t/sp-error.test Bug#37949 Crash if argument to SP is a subquery that returns more than one row test case sql/sp_head.cc Bug#37949 Crash if argument to SP is a subquery that returns more than one row lex->unit.cleanup() call added if not substatement
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r--sql/sp_head.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index b1bfab40acd..5ce24aecebd 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -1762,7 +1762,11 @@ sp_head::execute_procedure(THD *thd, List<Item> *args)
we'll leave it here.
*/
if (!thd->in_sub_stmt)
- close_thread_tables(thd, 0, 0);
+ {
+ thd->lex->unit.cleanup();
+ close_thread_tables(thd);
+ thd->rollback_item_tree_changes();
+ }
DBUG_PRINT("info",(" %.*s: eval args done", m_name.length, m_name.str));
}