1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

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.
This commit is contained in:
Oleksandr Byelkin
2019-10-17 14:08:33 +02:00
parent 6cdde9ebbf
commit de2186dd2f
10 changed files with 305 additions and 17 deletions

View File

@ -1490,6 +1490,7 @@ bool mysql_make_view(THD *thd, TABLE_SHARE *share, TABLE_LIST *table,
privileges of top_view
*/
tbl->grant.want_privilege= SELECT_ACL;
/*
After unfolding the view we lose the list of tables referenced in it
(we will have only a list of underlying tables in case of MERGE
@ -1540,6 +1541,18 @@ bool mysql_make_view(THD *thd, TABLE_SHARE *share, TABLE_LIST *table,
views with subqueries in select list.
*/
view_main_select_tables= lex->select_lex.table_list.first;
/*
Mergeable view can be used for inserting, so we move the flag down
*/
if (table->for_insert_data)
{
for (TABLE_LIST *t= view_main_select_tables;
t;
t= t->next_local)
{
t->for_insert_data= TRUE;
}
}
/*
Let us set proper lock type for tables of the view's main