summaryrefslogtreecommitdiff
path: root/sql/mysql_priv.h
diff options
context:
space:
mode:
authorkonstantin@mysql.com <>2004-08-21 02:02:46 +0400
committerkonstantin@mysql.com <>2004-08-21 02:02:46 +0400
commit568c6e8526bded952225a9f4d2b262582091ae78 (patch)
tree687b98d21d388c1958d7cabd22c8c450eecca73e /sql/mysql_priv.h
parentb9dbef8e239b0ad70d0e4da376736611164bf96d (diff)
downloadmariadb-git-568c6e8526bded952225a9f4d2b262582091ae78.tar.gz
Fix for bug#4912 "mysqld crashs in case a statement is executed
a second time". The bug was caused by incompatibility of negations elimination algorithm and PS: during first statement execute a subtree with negation was replaced with equivalent subtree without NOTs. The problem was that although this transformation was permanent, items of the new subtree were created in execute-local memory. The patch adds means to check if it is the first execute of a prepared statement, and if this is the case, to allocate items in memory of the prepared statement. The implementation: - backports Item_arena from 5.0 - adds Item_arena::is_stmt_prepare(), Item_arena::is_first_stmt_execute(). - deletes THD::allocate_temporary_pool_for_ps_preparing(), THD::free_temporary_pool_for_ps_preparing(); they were redundant. and adds a few invariants: - thd->free_list never contains junk (= freed items) - thd->current_arena is never null. If there is no prepared statement, it points at the thd. The rest of the patch contains mainly mechanical changes and cleanups.
Diffstat (limited to 'sql/mysql_priv.h')
-rw-r--r--sql/mysql_priv.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index 9ada2fba164..b7c19ad2c06 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -295,7 +295,7 @@ void debug_sync_point(const char* lock_name, uint lock_timeout);
struct st_table;
class THD;
-class Statement;
+class Item_arena;
/* Struct to handle simple linked lists */