From caf79dacfe90766b43f39c89b4111696a18e15ad Mon Sep 17 00:00:00 2001 From: "tomas@poseidon.(none)" <> Date: Fri, 3 Sep 2004 15:11:09 +0000 Subject: renamed ha_recovery_logging to ha_enable_transaction added tests to alter table for "large" alter tables and truncates in ndbcluster added debug printout in restart() in ndbcluster added flag THD::transaction.on to enable/disable transaction --- sql/sql_class.h | 1 + 1 file changed, 1 insertion(+) (limited to 'sql/sql_class.h') diff --git a/sql/sql_class.h b/sql/sql_class.h index a8035cffd96..5e221b394df 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -768,6 +768,7 @@ public: #ifdef HAVE_NDBCLUSTER_DB void* ndb; #endif + bool on; /* Tables changed in transaction (that must be invalidated in query cache). List contain only transactional tables, that not invalidated in query -- cgit v1.2.1 From 99444c3311ff822fed4146102ad54bec9a6ce44c Mon Sep 17 00:00:00 2001 From: "guilhem@mysql.com" <> Date: Mon, 6 Sep 2004 22:47:26 +0200 Subject: Replacing class Disable_binlog by macros. Patch already approved by Monty. --- sql/sql_class.h | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'sql/sql_class.h') diff --git a/sql/sql_class.h b/sql/sql_class.h index 30947041b7d..d362a90b7df 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -638,27 +638,6 @@ public: #define SYSTEM_THREAD_SLAVE_IO 2 #define SYSTEM_THREAD_SLAVE_SQL 4 -/* - Disables binary logging for one thread, and resets it back to what it was - before being disabled. - Some functions (like the internal mysql_create_table() when it's called by - mysql_alter_table()) must NOT write to the binlog (binlogging is done at the - at a later stage of the command already, and must be, for locking reasons); - so we internally disable it temporarily by creating the Disable_binlog - object and reset the state by destroying the object (don't forget that! or - write code so that the object gets automatically destroyed when leaving a - block, see example in sql_table.cc). -*/ -class Disable_binlog { -private: - THD *thd; - ulong save_options; - ulong save_master_access; -public: - Disable_binlog(THD *thd_arg); - ~Disable_binlog(); -}; - /* Used to hold information about file and file structure in exchainge via non-DB file (...INTO OUTFILE..., ...LOAD DATA...) -- cgit v1.2.1 From 21a4b1b4e60ae67304197c9030d11c33d7ebbde7 Mon Sep 17 00:00:00 2001 From: "tomas@poseidon.(none)" <> Date: Tue, 14 Sep 2004 08:52:21 +0000 Subject: moved all ndb thread specific data into new placeholder new methods to keep "records" up to date unset flag HA_NOT_EXACT_COUNT to make handler read "records" field, for count() optim and join optimization new methods to keep "records" up to datecorrect record field in ndbcluster handler new method for ndbcluster handler to store/retrieve table and thread specific data changed local hash to store new table_info object, with placeholders for local data, instead of TableImpl hanged deleteKey to return ponter to deleted object moved heavy global cache fetch from inline to separate method --- sql/sql_class.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'sql/sql_class.h') diff --git a/sql/sql_class.h b/sql/sql_class.h index 5a5b0fa81ce..387bba43cad 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -764,9 +764,8 @@ public: THD_TRANS all; // Trans since BEGIN WORK THD_TRANS stmt; // Trans for current statement uint bdb_lock_count; - uint ndb_lock_count; #ifdef HAVE_NDBCLUSTER_DB - void* ndb; + void* thd_ndb; #endif bool on; /* -- cgit v1.2.1 From 36548b10ca2d796c46436ab445569f6e0476ecaf Mon Sep 17 00:00:00 2001 From: "konstantin@mysql.com" <> Date: Wed, 22 Sep 2004 15:50:07 +0400 Subject: A fix and test case for Bug#5315 "mysql_change_user() doesn't free prepared statements." --- sql/sql_class.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'sql/sql_class.h') diff --git a/sql/sql_class.h b/sql/sql_class.h index 387bba43cad..09b44568f90 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -566,7 +566,7 @@ public: assignment in Statement::Statement) Non-empty statement names are unique too: attempt to insert a new statement with duplicate name causes older statement to be deleted - + Statements are auto-deleted when they are removed from the map and when the map is deleted. */ @@ -575,7 +575,7 @@ class Statement_map { public: Statement_map(); - + int insert(Statement *statement); Statement *find_by_name(LEX_STRING *name) @@ -608,11 +608,18 @@ public: } hash_delete(&st_hash, (byte *) statement); } + /* Erase all statements (calls Statement destructor) */ + void reset() + { + hash_reset(&names_hash); + hash_reset(&st_hash); + last_found_statement= 0; + } ~Statement_map() { - hash_free(&st_hash); hash_free(&names_hash); + hash_free(&st_hash); } private: HASH st_hash; -- cgit v1.2.1 From f5d1b711c626e880d480295bb19f8d34345ea240 Mon Sep 17 00:00:00 2001 From: "dlenev@brandersnatch.localdomain" <> Date: Thu, 23 Sep 2004 13:48:17 +0400 Subject: Implementation of Monty's idea about clear_alloc_root() optimization and cleanup of work with memory roots in THD/Statement/Item_arena. Added assertions preventing memory allocation on bzero'ed MEM_ROOT since it is worked by pure luck and was very ineffective. --- sql/sql_class.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'sql/sql_class.h') diff --git a/sql/sql_class.h b/sql/sql_class.h index 387bba43cad..89bf2dde12e 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -441,11 +441,23 @@ public: STATEMENT, PREPARED_STATEMENT, STORED_PROCEDURE }; + /* + This constructor is used only when Item_arena is created as + backup storage for another instance of Item_arena. + */ + Item_arena() {}; + /* + Create arena for already constructed THD using its variables as + parameters for memory root initialization. + */ Item_arena(THD *thd); - Item_arena(); + /* + Create arena and optionally init memory root with minimal values. + Particularly used if Item_arena is part of Statement. + */ Item_arena(bool init_mem_root); virtual Type type() const; - virtual ~Item_arena(); + virtual ~Item_arena() {}; inline bool is_stmt_prepare() const { return (int)state < (int)PREPARED; } inline bool is_first_stmt_execute() const { return state == PREPARED; } -- cgit v1.2.1 From e47decfa7f2e984558d3dc48d19dd94d8ec0b956 Mon Sep 17 00:00:00 2001 From: "ingo@mysql.com" <> Date: Fri, 24 Sep 2004 18:39:25 +0200 Subject: BUG#4286 - HANDLER tables are closed by FLUSH TABLE(S). BUG#4335 - one name can be handler open'ed many times. Reworked the HANDLER functions and interface. Using a HASH to store information on open tables that survives FLUSH TABLE. HANDLER tables alias names must now be unique, though it is allowed in 4.0 to qualify them with the database name of the base table. --- sql/sql_class.h | 1 + 1 file changed, 1 insertion(+) (limited to 'sql/sql_class.h') diff --git a/sql/sql_class.h b/sql/sql_class.h index 30947041b7d..d84a5ba88ff 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -421,6 +421,7 @@ public: and are still in use by this thread */ TABLE *open_tables,*temporary_tables, *handler_tables; + HASH handler_tables_hash; // TODO: document the variables below MYSQL_LOCK *lock,*locked_tables; ULL *ull; -- cgit v1.2.1 From 0cadd78db725a65bb6360f579ef6401261833f33 Mon Sep 17 00:00:00 2001 From: "konstantin@mysql.com" <> Date: Mon, 4 Oct 2004 14:14:30 +0400 Subject: A couple of typos fixed. --- sql/sql_class.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'sql/sql_class.h') diff --git a/sql/sql_class.h b/sql/sql_class.h index 68d187168d3..fbbb7fc7383 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1264,8 +1264,6 @@ public: bool send_fields(List &list, uint flag) { return 0; }; bool send_data(List &items)=0; bool send_eof() { return 0; }; - - friend class Ttem_subselect; }; /* Single value subselect interface class */ -- cgit v1.2.1 From 2aa7ec0d9da32c9fe0ea8bea6e21b9905fbdb487 Mon Sep 17 00:00:00 2001 From: "konstantin@mysql.com" <> Date: Fri, 8 Oct 2004 02:21:19 +0400 Subject: A fix for Bug#5748 "Prepared statement with BETWEEN and bigint values crashes mysqld": implementation for a generic item tree modifications registry. Every item tree modification which should be rolled back for subsequent execution of a prepared statement or stored procedure should be saved in the registry. All such modifications are rolled back at once during cleanup stage of PS. Actual fix for the bug just adds a call to register modifications to convert_constant_item. Post review fixes implemented. --- sql/sql_class.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'sql/sql_class.h') diff --git a/sql/sql_class.h b/sql/sql_class.h index fbbb7fc7383..fa9c1511ed0 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) { @@ -640,6 +642,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_list; + + /* For each client connection we create a separate thread with THD serving as a thread/connection descriptor @@ -807,6 +820,14 @@ public: #ifdef SIGNAL_WITH_VIO_CLOSE 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 */ @@ -1031,6 +1052,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 */ -- cgit v1.2.1 From 703e396b6ebb6ee156987abe7fa31c7853afafe9 Mon Sep 17 00:00:00 2001 From: "konstantin@mysql.com" <> Date: Sun, 10 Oct 2004 03:10:00 +0400 Subject: A small simplification: perform two actions at once, register a change, and perform it (the new Item changes registry). --- sql/sql_class.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'sql/sql_class.h') diff --git a/sql/sql_class.h b/sql/sql_class.h index 8c6634efa50..1e314bb0cb8 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1054,14 +1054,15 @@ 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) + void change_item_tree(Item **place, Item *new_value) { + /* TODO: check for OOM condition here */ if (!current_arena->is_conventional_execution()) - nocheck_register_item_tree_change(place, old_value, runtime_memroot); + nocheck_register_item_tree_change(place, *place, &mem_root); + *place= new_value; } void nocheck_register_item_tree_change(Item **place, Item *old_value, - MEM_ROOT *runtime_memroot); + MEM_ROOT *runtime_memroot); void rollback_item_tree_changes(); }; -- cgit v1.2.1 From 5f857a7a82c29dc34bdb8d1cd49585c687dd1b97 Mon Sep 17 00:00:00 2001 From: "ram@gw.mysql.r18.ru" <> Date: Sun, 10 Oct 2004 12:10:53 +0500 Subject: Blob support for the group_concat() function. (Bug #4315: GROUP_CONCAT with ORDER BY returns strange results for TEXT fields Bug #5564: Strange behaviour with group_concat and distinct Bug #5970: group_concat doesn't print warnings) --- sql/sql_class.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sql/sql_class.h') diff --git a/sql/sql_class.h b/sql/sql_class.h index 8896b7b658f..ce4cddbeb0b 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1218,10 +1218,12 @@ public: uint group_parts,group_length,group_null_parts; uint quick_group; bool using_indirect_summary_function; + /* If >0 convert all blob fields to varchar(convert_blob_length) */ + uint convert_blob_length; TMP_TABLE_PARAM() :copy_funcs_it(copy_funcs), copy_field(0), group_parts(0), - group_length(0), group_null_parts(0) + group_length(0), group_null_parts(0), convert_blob_length(0) {} ~TMP_TABLE_PARAM() { -- cgit v1.2.1 From 1ac41c928518b2d3cc6d5b60f74e7a684f647dfa Mon Sep 17 00:00:00 2001 From: "konstantin@mysql.com" <> Date: Wed, 13 Oct 2004 00:17:37 +0400 Subject: Move Heikki's comment about thd->query comment to proper place (bad merge from 4.0) --- sql/sql_class.h | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) (limited to 'sql/sql_class.h') diff --git a/sql/sql_class.h b/sql/sql_class.h index aaa81fbe165..50b0c566c89 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -544,6 +544,23 @@ public: Points to the query associated with this statement. It's const, but we need to declare it char * because all table handlers are written in C and need to point to it. + + Note that (A) if we set query = NULL, we must at the same time set + query_length = 0, and protect the whole operation with the + LOCK_thread_count mutex. And (B) we are ONLY allowed to set query to a + non-NULL value if its previous value is NULL. We do not need to protect + operation (B) with any mutex. To avoid crashes in races, if we do not + know that thd->query cannot change at the moment, one should print + thd->query like this: + (1) reserve the LOCK_thread_count mutex; + (2) check if thd->query is NULL; + (3) if not NULL, then print at most thd->query_length characters from + it. We will see the query_length field as either 0, or the right value + for it. + Assuming that the write and read of an n-bit memory field in an n-bit + computer is atomic, we can avoid races in the above way. + This printing is needed at least in SHOW PROCESSLIST and SHOW INNODB + STATUS. */ char *query; uint32 query_length; // current query length @@ -684,24 +701,6 @@ public: struct rand_struct rand; // used for authentication struct system_variables variables; // Changeable local variables pthread_mutex_t LOCK_delete; // Locked before thd is deleted - /* - Note that (A) if we set query = NULL, we must at the same time set - query_length = 0, and protect the whole operation with the - LOCK_thread_count mutex. And (B) we are ONLY allowed to set query to a - non-NULL value if its previous value is NULL. We do not need to protect - operation (B) with any mutex. To avoid crashes in races, if we do not - know that thd->query cannot change at the moment, one should print - thd->query like this: - (1) reserve the LOCK_thread_count mutex; - (2) check if thd->query is NULL; - (3) if not NULL, then print at most thd->query_length characters from - it. We will see the query_length field as either 0, or the right value - for it. - Assuming that the write and read of an n-bit memory field in an n-bit - computer is atomic, we can avoid races in the above way. - This printing is needed at least in SHOW PROCESSLIST and SHOW INNODB - STATUS. - */ /* all prepared statements and cursors of this connection */ Statement_map stmt_map; /* -- cgit v1.2.1 From edb93ca441df3257bccc320496a765b93779ce66 Mon Sep 17 00:00:00 2001 From: "marko@hundin.mysql.fi" <> Date: Wed, 13 Oct 2004 22:54:21 +0300 Subject: Added startup option and settable session variable innodb_table_locks_old_behavior: do not acquire an InnoDB table lock for LOCK TABLES, as in mysql-4.0.18 and earlier. --- sql/sql_class.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sql/sql_class.h') diff --git a/sql/sql_class.h b/sql/sql_class.h index af53574eeaf..8c383d5848d 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -338,6 +338,9 @@ struct system_variables my_bool low_priority_updates; my_bool new_mode; my_bool query_cache_wlock_invalidate; +#ifdef HAVE_INNOBASE_DB + my_bool innodb_table_locks_old_behavior; +#endif /* HAVE_INNOBASE_DB */ CONVERT *convert_set; }; -- cgit v1.2.1 From 5abc3de22bbef2e9818a890a61f840fb5daaf1b7 Mon Sep 17 00:00:00 2001 From: "konstantin@mysql.com" <> Date: Thu, 14 Oct 2004 02:53:59 +0400 Subject: A fix and test case for Bug#5985 ""prepare stmt from "select rand(?)" crashes server." The fix makes Item_func_rand prepared-statements aware plus it fixes the case when RAND is used in prepared statements and replication is on (as well as several similar issues). Until now we did not reset THD before every execution of a prepared statement, so if some execution had set thd->time_zone_used or thd->rand_used they would not be reset until next mysql_parse. Some of post-review fixes done. --- sql/sql_class.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'sql/sql_class.h') diff --git a/sql/sql_class.h b/sql/sql_class.h index aaa81fbe165..f25689aa512 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -565,12 +565,6 @@ public: void restore_backup_statement(Statement *stmt, Statement *backup); /* return class type */ virtual Type type() const; - - /* - Cleanup statement parse state (parse tree, lex) after execution of - a non-prepared SQL statement. - */ - void end_statement(); }; @@ -1064,6 +1058,12 @@ public: void nocheck_register_item_tree_change(Item **place, Item *old_value, MEM_ROOT *runtime_memroot); void rollback_item_tree_changes(); + + /* + Cleanup statement parse state (parse tree, lex) and execution + state after execution of a non-prepared SQL statement. + */ + void end_statement(); }; /* Flags for the THD::system_thread (bitmap) variable */ -- cgit v1.2.1 From 1f8b3d0f22070d450226ef4f6e0e31c8ef8cd401 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Wed, 20 Oct 2004 11:24:08 +0300 Subject: Code cleanups (done during review of new code) Rename innodb_table_locks_old_behavior -> innodb_table_locks Set innodb_table_locks to off by default to get same behaviour as in MySQL 4.0.20 (This means that Innodb ignore table locks by default, which makes it easier to combine MyISAM and InnoDB to simulate a transaction) --- sql/sql_class.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/sql_class.h') diff --git a/sql/sql_class.h b/sql/sql_class.h index 8c383d5848d..4250ebdd568 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -339,7 +339,7 @@ struct system_variables my_bool new_mode; my_bool query_cache_wlock_invalidate; #ifdef HAVE_INNOBASE_DB - my_bool innodb_table_locks_old_behavior; + my_bool innodb_table_locks; #endif /* HAVE_INNOBASE_DB */ CONVERT *convert_set; -- cgit v1.2.1 From 49a58fc64ee811fd71a974f493540c19d98ada73 Mon Sep 17 00:00:00 2001 From: "konstantin@mysql.com" <> Date: Thu, 21 Oct 2004 18:33:53 +0400 Subject: A fix and test case for bug#6059 "mysql_stmt_field_count returns positive numbers when no resultset is available": when sending result set metadata we need to use virtual select_result::send_fields, and not address protocol directly, because select_result descendents may intercept result set (it's the case for example for SELECT INTO OUTFILE). --- sql/sql_class.h | 45 ++++++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 17 deletions(-) (limited to 'sql/sql_class.h') diff --git a/sql/sql_class.h b/sql/sql_class.h index aea31f7db54..58514abb7b0 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1109,6 +1109,13 @@ public: unit= u; return 0; } + /* + Because of peculiarities of prepared statements protocol + we need to know number of columns in the result set (if + there is a result set) apart from sending columns metadata. + */ + virtual uint field_count(List &fields) const + { return fields.elements; } virtual bool send_fields(List &list,uint flag)=0; virtual bool send_data(List &items)=0; virtual bool initialize_tables (JOIN *join=0) { return 0; } @@ -1123,6 +1130,20 @@ public: }; +/* + Base class for select_result descendands which intercept and + transform result set rows. As the rows are not sent to the client, + sending of result set metadata should be suppressed as well. +*/ + +class select_result_interceptor: public select_result +{ +public: + uint field_count(List &fields) const { return 0; } + bool send_fields(List &fields, uint flag) { return FALSE; } +}; + + class select_send :public select_result { public: select_send() {} @@ -1132,7 +1153,7 @@ public: }; -class select_to_file :public select_result { +class select_to_file :public select_result_interceptor { protected: sql_exchange *exchange; File file; @@ -1144,7 +1165,6 @@ public: select_to_file(sql_exchange *ex) :exchange(ex), file(-1),row_count(0L) { path[0]=0; } ~select_to_file(); - bool send_fields(List &list, uint flag) { return 0; } void send_error(uint errcode,const char *err); bool send_eof(); void cleanup(); @@ -1171,7 +1191,7 @@ public: }; -class select_insert :public select_result { +class select_insert :public select_result_interceptor { public: TABLE *table; List *fields; @@ -1187,8 +1207,6 @@ class select_insert :public select_result { } ~select_insert(); int prepare(List &list, SELECT_LEX_UNIT *u); - bool send_fields(List &list, uint flag) - { return 0; } bool send_data(List &items); void send_error(uint errcode,const char *err); bool send_eof(); @@ -1271,7 +1289,7 @@ public: } }; -class select_union :public select_result { +class select_union :public select_result_interceptor { public: TABLE *table; COPY_INFO info; @@ -1280,8 +1298,6 @@ class select_union :public select_result { select_union(TABLE *table_par); ~select_union(); int prepare(List &list, SELECT_LEX_UNIT *u); - bool send_fields(List &list, uint flag) - { return 0; } bool send_data(List &items); bool send_eof(); bool flush(); @@ -1289,13 +1305,12 @@ class select_union :public select_result { }; /* Base subselect interface class */ -class select_subselect :public select_result +class select_subselect :public select_result_interceptor { protected: Item_subselect *item; public: select_subselect(Item_subselect *item); - bool send_fields(List &list, uint flag) { return 0; }; bool send_data(List &items)=0; bool send_eof() { return 0; }; }; @@ -1432,7 +1447,7 @@ public: }; -class multi_delete :public select_result +class multi_delete :public select_result_interceptor { TABLE_LIST *delete_tables, *table_being_deleted; Unique **tempfiles; @@ -1445,8 +1460,6 @@ public: multi_delete(THD *thd, TABLE_LIST *dt, uint num_of_tables); ~multi_delete(); int prepare(List &list, SELECT_LEX_UNIT *u); - bool send_fields(List &list, - uint flag) { return 0; } bool send_data(List &items); bool initialize_tables (JOIN *join); void send_error(uint errcode,const char *err); @@ -1455,7 +1468,7 @@ public: }; -class multi_update :public select_result +class multi_update :public select_result_interceptor { TABLE_LIST *all_tables, *update_tables, *table_being_updated; THD *thd; @@ -1474,7 +1487,6 @@ public: List *values, enum_duplicates handle_duplicates); ~multi_update(); int prepare(List &list, SELECT_LEX_UNIT *u); - bool send_fields(List &list, uint flag) { return 0; } bool send_data(List &items); bool initialize_tables (JOIN *join); void send_error(uint errcode,const char *err); @@ -1483,7 +1495,7 @@ public: }; -class select_dumpvar :public select_result { +class select_dumpvar :public select_result_interceptor { ha_rows row_count; public: List var_list; @@ -1491,7 +1503,6 @@ public: select_dumpvar(void) { var_list.empty(); vars.empty(); row_count=0;} ~select_dumpvar() {} int prepare(List &list, SELECT_LEX_UNIT *u); - bool send_fields(List &list, uint flag) {return 0;} bool send_data(List &items); bool send_eof(); void cleanup(); -- cgit v1.2.1 From a7c52d755bab03d134637947d29d5c1b0531660e Mon Sep 17 00:00:00 2001 From: "konstantin@mysql.com" <> Date: Fri, 22 Oct 2004 14:47:35 +0400 Subject: A fix and test case for Bug#6050 "EXECUTE stmt reports ambiguous field names with ident. tables fr. diff. schemata": revise all uses of Item_field and make them prepared-statements friendly when necessary. --- sql/sql_class.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sql/sql_class.h') diff --git a/sql/sql_class.h b/sql/sql_class.h index c30e1c321b0..3769ccddec8 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -464,6 +464,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_stmt_execute() const + { return state == PREPARED || state == EXECUTED; } inline bool is_conventional_execution() const { return state == CONVENTIONAL_EXECUTION; } inline gptr alloc(unsigned int size) { return alloc_root(&mem_root,size); } -- cgit v1.2.1