summaryrefslogtreecommitdiff
path: root/sql/sql_class.h
diff options
context:
space:
mode:
authorunknown <konstantin@mysql.com>2004-10-08 02:22:40 +0400
committerunknown <konstantin@mysql.com>2004-10-08 02:22:40 +0400
commit36b3ed27fbf1290519c4d59591ab49c15400f1d4 (patch)
tree88cc1d9cf48185d70375921a289dcaacd7f445ac /sql/sql_class.h
parentc9465b91584eca59b5bd6ef3e0b4768abb64489b (diff)
parent8fa6f37a2963ad95c985f09ae26e8ed301ea03b9 (diff)
downloadmariadb-git-36b3ed27fbf1290519c4d59591ab49c15400f1d4.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/media/sda1/mysql/mysql-4.1-5748-anew sql/item_cmpfunc.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_parse.cc: Auto merged
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r--sql/sql_class.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 8896b7b658f..8c6634efa50 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -461,6 +461,8 @@ public:
inline bool is_stmt_prepare() const { return (int)state < (int)PREPARED; }
inline bool is_first_stmt_execute() const { return state == PREPARED; }
+ inline bool is_conventional_execution() const
+ { return state == CONVENTIONAL_EXECUTION; }
inline gptr alloc(unsigned int size) { return alloc_root(&mem_root,size); }
inline gptr calloc(unsigned int size)
{
@@ -641,6 +643,17 @@ private:
/*
+ A registry for item tree transformations performed during
+ query optimization. We register only those changes which require
+ a rollback to re-execute a prepared statement or stored procedure
+ yet another time.
+*/
+
+struct Item_change_record;
+typedef I_List<Item_change_record> Item_change_list;
+
+
+/*
For each client connection we create a separate thread with THD serving as
a thread/connection descriptor
*/
@@ -809,6 +822,14 @@ public:
Vio* active_vio;
#endif
/*
+ This is to track items changed during execution of a prepared
+ statement/stored procedure. It's created by
+ register_item_tree_change() in memory root of THD, and freed in
+ rollback_item_tree_changes(). For conventional execution it's always 0.
+ */
+ Item_change_list change_list;
+
+ /*
Current prepared Item_arena if there one, or 0
*/
Item_arena *current_arena;
@@ -1032,6 +1053,16 @@ public:
}
inline CHARSET_INFO *charset() { return variables.character_set_client; }
void update_charset();
+
+ void register_item_tree_change(Item **place, Item *old_value,
+ MEM_ROOT *runtime_memroot)
+ {
+ if (!current_arena->is_conventional_execution())
+ nocheck_register_item_tree_change(place, old_value, runtime_memroot);
+ }
+ void nocheck_register_item_tree_change(Item **place, Item *old_value,
+ MEM_ROOT *runtime_memroot);
+ void rollback_item_tree_changes();
};
/* Flags for the THD::system_thread (bitmap) variable */