Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Critical
-
Resolution: Unresolved
-
10.1.45, 10.2.32, 10.3.23, 10.4.13, 10.5.3, 10.2, 10.3, 10.4, 10.5, 10.6
-
None
Description
For multi-table update statements that update views defined using WITH CHECK OPTION clause the clause may be ignored.
The problem can be reproduced with the following test case:
create table t1 (a int) engine=myisam; |
insert into t1 values (0), (3), (1); |
create table t2 (a int) engine=myisam; |
insert into t2 values (1), (0); |
create view v1 as select * from t1 where a < 2 with check option; |
update v1,t2 set v1.a=2 where v1.a=t2.a and t2.a=1; |
select * from t1; |
drop view v1; |
drop table t1,t2; |
We can see that the update statements succeeds and v1 is updated ignoring the condition in WHERE a < 2:
MariaDB [test]> update v1,t2 set v1.a=2 where v1.a=t2.a and t2.a=1;
|
Query OK, 1 row affected (0.001 sec)
|
Rows matched: 1 Changed: 1 Warnings: 0
|
 |
MariaDB [test]> select * from t1;
|
+------+
|
| a |
|
+------+
|
| 0 |
|
| 3 |
|
| 2 |
|
+------+
|
3 rows in set (0.001 sec)
|
Attachments
Issue Links
- relates to
-
MDEV-23340 Incomplete condition is checked when updating a view defined using WITH CHECK OPTION clause
- Open
-
MDEV-23347 Embedded view's check option is not honoured in some cases.
- Open