pingcap / pingcap/tidb

JSON_SCHEMA_VALID improvements

Open
#54,207 2 comments 0 reactions 1 assignee Claimed by @dveeden View on GitHub
component/json type/enhancement
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Enhancement

Check and update error codes where possible to match MySQL 8.x

```sql
SELECT JSON_SCHEMA_VALID(CONCAT('{"foo": ',repeat('[', 1000),repeat(']', 1000),'}'), json_object());
SELECT JSON_SCHEMA_VALID(CONCAT('{"foo": ',repeat('[', 10000),repeat(']', 10000),'}'), json_object());
SELECT JSON_SCHEMA_VALID('{"properties": {"$ref": "http://example.com"}}','{}');
SELECT JSON_SCHEMA_VALID('{"type": "abcdef"}','{}');
SELECT JSON_SCHEMA_VALID('{{{', '{}');
SELECT JSON_SCHEMA_VALID('{}', '{{{');
SELECT JSON_SCHEMA_VALID('{{{', '{{{');
```

Differences with MySQL:
- As MySQL uses Draft 4 of the JSON Schema specification there is a difference in how `exclusiveMinimum` is handled. (See also https://bugs.mysql.com/bug.php?id=106454 )

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.