Bug #121424 WITH LOCAL CHECK option on a join view ignores its own ON condition

Submitted: 2 Oct 11:25 Modified: 5 Oct 8:39
Reporter: Laurynas Biveinis (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S2 (Serious)
Version:8.0.46, 8.4.11, 9.7.2, 26.07 OS:Any
Assigned to: CPU Architecture:Any

[2 Oct 11:25] Laurynas Biveinis
Description:
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (a INT);
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
CREATE VIEW v1 AS SELECT a FROM t1;

CREATE VIEW v2 AS SELECT t2.a AS a2, v1.a AS a1
       FROM t2 JOIN v1 ON t2.a = v1.a WITH LOCAL CHECK OPTION;

# Returns 1 1
SELECT * FROM v2;

# Goes through instead of ER_VIEW_CHECK_FAILED
UPDATE v2 SET a1 = 2;

# No rows
SELECT * FROM v2;

How to repeat:
See above
[5 Oct 8:39] Chaithra Marsur Gopala Reddy
Hi Laurynas Biveinis,

Thank you for the test case. Verified as described.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.049 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.