Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.5, 5.5(EOL), 10.0(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL)
Description
This is similar to MDEV-10035, but now FOR UPDATE is used inside a subquery:
I run this script:
DROP TABLE IF EXISTS t1; |
CREATE TABLE t1 (a INT) ENGINE=InnoDB; |
INSERT INTO t1 VALUES (10); |
DROP VIEW IF EXISTS v1; |
CREATE VIEW v1 AS SELECT (SELECT a FROM t1 FOR UPDATE) FROM t1; |
START TRANSACTION; |
SELECT * FROM v1; |
Now I open a new session and run this script:
START TRANSACTION; |
SELECT a FROM t1 FOR UPDATE; |
It immediately returns a result:
+------+
|
| a |
|
+------+
|
| 10 |
|
+------+
|
This is wrong. Subselects with FOR UPDATE should be disallowed in VIEWs.
Attachments
Issue Links
- relates to
-
MDEV-10035 DBUG_ASSERT on CREATE VIEW v1 AS SELECT * FROM t1 FOR UPDATE
- Closed