summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authorunknown <dlenev@mockturtle.local>2006-11-13 11:10:49 +0300
committerunknown <dlenev@mockturtle.local>2006-11-13 11:10:49 +0300
commitfc83f787cbe0d594d7794dc58abcda385567a69d (patch)
tree71738b7c4a161d1c5006a20a38ce18a5f97bcb97 /sql/item_func.cc
parentb9e9a416336839959fc0227743c9db02749b2578 (diff)
downloadmariadb-git-fc83f787cbe0d594d7794dc58abcda385567a69d.tar.gz
Fix for bug bug#23651 "Server crashes when trigger which uses
stored function invoked from different connections". Invocation of trigger which was using stored function from different connections caused server crashes (for non-debug server this happened in highly concurrent environment, but debug server failed on assertion in relatively simple scenario). Item_func_sp was not safe to use in triggers (in other words for re-execution from different threads) as artificial TABLE object pointed by Item_func_sp::dummy_table referenced incorrect THD object. To fix the problem we force re-initialization of this object for each re-execution of statement. mysql-test/r/trigger.result: Added test for bug#23651 "Server crashes when trigger which uses stored function invoked from different connections". mysql-test/t/trigger.test: Added test for bug#23651 "Server crashes when trigger which uses stored function invoked from different connections". sql/item_func.cc: To make Item_func_sp safe for usage in triggers (in other words safe for re-execution in different threads) we need to ensure that artificial TABLE object pointed by Item_func_sp::dummy_table references correct THD object. To achieve this we simply force its re-initialization for each re-execution of statement.
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index a294bbd7a71..fd3d282364a 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -4845,6 +4845,7 @@ Item_func_sp::cleanup()
result_field= NULL;
}
m_sp= NULL;
+ dummy_table->s= NULL;
Item_func::cleanup();
}