summaryrefslogtreecommitdiff
path: root/sql/sql_update.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2019-04-04 22:41:58 +0200
committerSergei Golubchik <serg@mariadb.org>2019-04-24 11:15:38 +0200
commit5057d4637525eadad438d25ee6a4870a4e6b384c (patch)
treea656a8c9f563a10bd9fb4de64f94b0779860f2ce /sql/sql_update.cc
parent822071ca5b6d109e5497f1c15efa44fe47d277c5 (diff)
downloadmariadb-git-5057d4637525eadad438d25ee6a4870a4e6b384c.tar.gz
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.
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r--sql/sql_update.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index fe007d5823d..b23c295a1af 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -1305,6 +1305,9 @@ int mysql_multi_update_prepare(THD *thd)
If table will be updated we should not downgrade lock for it and
leave it as is.
*/
+ tl->updating= 1;
+ if (tl->belong_to_view)
+ tl->belong_to_view->updating= 1;
}
else
{
@@ -1323,7 +1326,6 @@ int mysql_multi_update_prepare(THD *thd)
tl->lock_type= read_lock_type_for_table(thd, lex, tl);
else
tl->set_lock_type(thd, read_lock_type_for_table(thd, lex, tl));
- tl->updating= 0;
}
}
for (tl= table_list; tl; tl= tl->next_local)