summaryrefslogtreecommitdiff
path: root/sql/sql_reload.cc
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2018-09-02 09:24:33 +0400
committerAlexey Botchkov <holyfoot@askmonty.org>2018-09-02 09:24:33 +0400
commit63ad6a9e1a33ddd5547767b2894e09ae66196f69 (patch)
tree046cba04ab96a8bc29086a9aba1b59588b0b6e01 /sql/sql_reload.cc
parent288212f489c8cd88c4cc98f8aecc3366c85a90be (diff)
downloadmariadb-git-63ad6a9e1a33ddd5547767b2894e09ae66196f69.tar.gz
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.
Diffstat (limited to 'sql/sql_reload.cc')
-rw-r--r--sql/sql_reload.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/sql/sql_reload.cc b/sql/sql_reload.cc
index 73dd9679ed7..ab9e7c33a92 100644
--- a/sql/sql_reload.cc
+++ b/sql/sql_reload.cc
@@ -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
{