diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2019-10-17 14:08:33 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2019-10-17 17:32:14 +0200 |
commit | de2186dd2f5937a56d799f55c33078a7ad8ebddc (patch) | |
tree | 7b44a00f8fb8dcbea6145a0ae2fecf0cc764ac72 /sql/sp_head.cc | |
parent | 6cdde9ebbf59254a81f04961818577ffd203f9d6 (diff) | |
download | mariadb-git-de2186dd2f5937a56d799f55c33078a7ad8ebddc.tar.gz |
MDEV-20074: Lost connection on update trigger
Instead of checking lex->sql_command which does not corect in case of triggers
mark tables for insert.
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r-- | sql/sp_head.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 458955b2d6b..48166fac4c6 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -4652,6 +4652,7 @@ typedef struct st_sp_table uint lock_count; uint query_lock_count; uint8 trg_event_map; + my_bool for_insert_data; } SP_TABLE; @@ -4747,6 +4748,7 @@ sp_head::merge_table_list(THD *thd, TABLE_LIST *table, LEX *lex_for_tmp_check) if (tab->query_lock_count > tab->lock_count) tab->lock_count++; tab->trg_event_map|= table->trg_event_map; + tab->for_insert_data|= table->for_insert_data; } else { @@ -4770,6 +4772,7 @@ sp_head::merge_table_list(THD *thd, TABLE_LIST *table, LEX *lex_for_tmp_check) tab->lock_type= table->lock_type; tab->lock_count= tab->query_lock_count= 1; tab->trg_event_map= table->trg_event_map; + tab->for_insert_data= table->for_insert_data; if (my_hash_insert(&m_sptabs, (uchar *)tab)) return FALSE; } @@ -4853,7 +4856,8 @@ sp_head::add_used_tables_to_table_list(THD *thd, TABLE_LIST::PRELOCK_ROUTINE, belong_to_view, stab->trg_event_map, - query_tables_last_ptr); + query_tables_last_ptr, + stab->for_insert_data); tab_buff+= ALIGN_SIZE(sizeof(TABLE_LIST)); result= TRUE; } |