1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Clumsy but working fix for bug #11973 "SELECT .. INTO var_name; in trigger

cause crash on update".

Let us update "thd" pointer in LEX, all its units and in LEX::result before
executing statement in trigger body, since triggers are associated with TABLE
object and because of this can be used in different threads.
This commit is contained in:
dlenev@mysql.com
2005-08-10 00:23:56 +04:00
parent 26e4741dc3
commit 60511c3df2
10 changed files with 70 additions and 13 deletions

View File

@ -1560,6 +1560,7 @@ public:
statement/stored procedure.
*/
virtual void cleanup();
void set_thd(THD *thd_arg) { thd= thd_arg; }
};
@ -1915,14 +1916,13 @@ class multi_delete :public select_result_interceptor
{
TABLE_LIST *delete_tables, *table_being_deleted;
Unique **tempfiles;
THD *thd;
ha_rows deleted, found;
uint num_of_tables;
int error;
bool do_delete, transactional_tables, normal_tables, delete_while_scanning;
public:
multi_delete(THD *thd, TABLE_LIST *dt, uint num_of_tables);
multi_delete(TABLE_LIST *dt, uint num_of_tables);
~multi_delete();
int prepare(List<Item> &list, SELECT_LEX_UNIT *u);
bool send_data(List<Item> &items);
@ -1938,7 +1938,6 @@ class multi_update :public select_result_interceptor
TABLE_LIST *all_tables; /* query/update command tables */
TABLE_LIST *leaves; /* list of leves of join table tree */
TABLE_LIST *update_tables, *table_being_updated;
THD *thd;
TABLE **tmp_tables, *main_table, *table_to_update;
TMP_TABLE_PARAM *tmp_table_param;
ha_rows updated, found;
@ -1950,7 +1949,7 @@ class multi_update :public select_result_interceptor
bool do_update, trans_safe, transactional_tables, ignore;
public:
multi_update(THD *thd_arg, TABLE_LIST *ut, TABLE_LIST *leaves_list,
multi_update(TABLE_LIST *ut, TABLE_LIST *leaves_list,
List<Item> *fields, List<Item> *values,
enum_duplicates handle_duplicates, bool ignore);
~multi_update();