Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Duplicate
-
10.2.1
Description
When there is a CHECK constraint on a virtual column that allows NULL and the column is not specified in an INSERT, then the constraint is not checked:
CREATE TABLE tv2(c1 int, c2 int AS (c1 + 1) VIRTUAL, CHECK (c2 is null or c2 > 2)); |
The following fails, which is correct:
INSERT INTO tv2 VALUES(1,1); |
The following succeeds, which is also correct:
INSERT INTO tv2 VALUES(2,1); |
The following though is also successful, which is incorrect (c2 will have the value 2):
INSERT INTO tv2(c1) VALUES(1); |
Attachments
Issue Links
- is duplicated by
-
MDEV-10370 Check constraints on virtual columns fails on INSERT when column not specified
- Closed