-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
compatibility-mysql80This is a compatibility issue with MySQL 8.0(but NOT 5.7)This is a compatibility issue with MySQL 8.0(but NOT 5.7)component/jsonsig/executionSIG executionSIG executiontype/compatibilitytype/enhancementThe issue or PR belongs to an enhancement.The issue or PR belongs to an enhancement.
Description
This improves MySQL 8.0 compatibility.
The JSON_SCHEMA_VALID()
function is mostly useful in combination with a CHECK
constraint.
mysql> CREATE TABLE t (
-> id INT PRIMARY KEY AUTO_INCREMENT,
-> j JSON,
-> CHECK(JSON_SCHEMA_VALID('{"type": "array"}', j))
-> );
Query OK, 0 rows affected (0.01 sec)
mysql> INSERT INTO t VALUES (1, '[0,1,2,3,4]');
Query OK, 1 row affected (0.01 sec)
mysql> INSERT INTO t VALUES (1, '{}');
ERROR 3819 (HY000): Check constraint 't_chk_1' is violated.
See also:
Metadata
Metadata
Assignees
Labels
compatibility-mysql80This is a compatibility issue with MySQL 8.0(but NOT 5.7)This is a compatibility issue with MySQL 8.0(but NOT 5.7)component/jsonsig/executionSIG executionSIG executiontype/compatibilitytype/enhancementThe issue or PR belongs to an enhancement.The issue or PR belongs to an enhancement.