Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.6, 10.11, 11.4, 11.8, 12.3, 13.1
-
None
Description
Hi,
I found that when creating a table with a JSON column, if there is another CHECK, the INSERT statement can bypass the type check. There is an example:
CREATE TABLE t1 ( |
j JSON CHECK (OCTET_LENGTH(j) > 0) |
);
|
 |
INSERT INTO t1 VALUES ('x'); -- success |
SELECT j, JSON_VALID(j) AS is_valid FROM t1 ORDER BY j; -- x 0 |
If I remove the `CHECK (OCTET_LENGTH(j) > 0)` expression, the INSERT statement will trigger the error `CONSTRAINT `t1.j` failed for `codex_mariadb_json_batch_0321_typecheck`.`t1``
Attachments
Issue Links
- relates to
-
MDEV-13916 Enforce check constraint on JSON type
-
- Closed
-