[Commits] 17540ad: MDEV-15890 Strange error message if you try to FLUSH TABLES <view> after LOCK TABLES <view>.
revision-id: 17540adc625ff4ac0f00aa10796cb6e763838d18 (mariadb-10.1.35-25-g17540ad) parent(s): 34e026f35a7fbeeaec412547ee207c880944ae68 committer: Alexey Botchkov timestamp: 2018-09-03 16:49:46 +0400 message: MDEV-15890 Strange error message if you try to FLUSH TABLES <view> after LOCK TABLES <view>. LOCK view WRITE shouldn't block FLUSH view. So we set the view's mdl_request type to it's tables. --- mysql-test/r/flush.result | 1 - mysql-test/t/flush.test | 1 - sql/sql_view.cc | 3 +-- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/mysql-test/r/flush.result b/mysql-test/r/flush.result index 2d7b81b..4e4aec4 100644 --- a/mysql-test/r/flush.result +++ b/mysql-test/r/flush.result @@ -508,7 +508,6 @@ ERROR HY000: Table 't1' was locked with a READ lock and can't be updated UNLOCK TABLES; LOCK TABLES v1 WRITE; FLUSH TABLES v1; -ERROR HY000: Table 't1' was locked with a READ lock and can't be updated UNLOCK TABLES; LOCK TABLES v1 READ; FLUSH TABLES t1; diff --git a/mysql-test/t/flush.test b/mysql-test/t/flush.test index 7736574..11a1ac2 100644 --- a/mysql-test/t/flush.test +++ b/mysql-test/t/flush.test @@ -724,7 +724,6 @@ FLUSH TABLES v1; UNLOCK TABLES; LOCK TABLES v1 WRITE; ---error ER_TABLE_NOT_LOCKED_FOR_WRITE FLUSH TABLES v1; UNLOCK TABLES; diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 6bd6b6a..d7a2a6b 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -1534,8 +1534,7 @@ bool mysql_make_view(THD *thd, TABLE_SHARE *share, TABLE_LIST *table, for (tbl= view_main_select_tables; tbl; tbl= tbl->next_local) { tbl->lock_type= table->lock_type; - tbl->mdl_request.set_type((tbl->lock_type >= TL_WRITE_ALLOW_WRITE) ? - MDL_SHARED_WRITE : MDL_SHARED_READ); + tbl->mdl_request.set_type(table->mdl_request.type); } /* If the view is mergeable, we might want to
participants (1)
-
holyfoot@askmonty.org