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

bugfix: multi-update checked privileges on views incorrectly

it always required UPDATE privilege on views, not being able to detect
when a views was not actually updated in multi-update.

fix: instead of marking all tables as "updating" by default,
only set "updating" on tables that will actually be updated
by multi-update. And mark the view "updating" if any of the
view's tables is.
This commit is contained in:
Sergei Golubchik
2019-04-04 22:41:58 +02:00
parent 822071ca5b
commit 5057d46375
6 changed files with 20 additions and 13 deletions

View File

@ -2065,9 +2065,6 @@ mysql_execute_command(THD *thd)
reset_one_shot_variables(thd);
DBUG_RETURN(0);
}
for (table=all_tables; table; table=table->next_global)
table->updating= TRUE;
}
/*
@ -6541,9 +6538,8 @@ TABLE_LIST *st_select_lex::convert_right_join()
query
*/
void st_select_lex::set_lock_for_tables(thr_lock_type lock_type)
void st_select_lex::set_lock_for_tables(thr_lock_type lock_type, bool for_update)
{
bool for_update= lock_type >= TL_READ_NO_INSERT;
DBUG_ENTER("set_lock_for_tables");
DBUG_PRINT("enter", ("lock_type: %d for_update: %d", lock_type,
for_update));