1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

MDEV-15890 Strange error message if you try to FLUSH TABLES <view> after LOCK TABLES <view>.

Check if the argument of the FLUSH TABLE is a VIEW and handle it
accordingly.
This commit is contained in:
Alexey Botchkov
2018-09-02 09:24:33 +04:00
parent 288212f489
commit 63ad6a9e1a
8 changed files with 159 additions and 61 deletions

View File

@ -288,9 +288,18 @@ bool reload_acl_and_cache(THD *thd, unsigned long long options,
*/
if (tables)
{
int err;
for (TABLE_LIST *t= tables; t; t= t->next_local)
if (!find_table_for_mdl_upgrade(thd, t->db, t->table_name, false))
return 1;
if (!find_table_for_mdl_upgrade(thd, t->db, t->table_name, &err))
{
if (is_locked_view(thd, t))
t->next_local= t->next_global;
else
{
my_error(err, MYF(0), t->table_name);
return 1;
}
}
}
else
{