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>.

LOCK view WRITE shouldn't block FLUSH view.
So we set the view's mdl_request type to it's tables.
This commit is contained in:
Alexey Botchkov
2018-11-03 14:24:15 +04:00
parent 1a89356382
commit 6472c5c015
13 changed files with 33 additions and 49 deletions

View File

@ -276,15 +276,14 @@ DROP VIEW IF EXISTS v1;
#
# Test 1: LOCK TABLES v1 WRITE, t1 READ;
#
# Thanks to the fact that we no longer allow DDL on tables
# which are locked for write implicitly, the exact scenario
# in which assert was failing is no longer repeatable.
CREATE TABLE t1 ( f1 integer );
CREATE VIEW v1 AS SELECT f1 FROM t1 ;
# Connection 2
LOCK TABLES v1 WRITE, t1 READ;
FLUSH TABLE t1;
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
UNLOCK TABLES;
# Connection 1
LOCK TABLES t1 WRITE;
FLUSH TABLE t1;
DROP TABLE t1;
DROP VIEW v1;
#