Skip to content

dolt JSON has different ordering vs MySQL JSON #5711

@PavelSafronov

Description

@PavelSafronov

SQL:

CREATE TABLE json_test (
  id int NOT NULL PRIMARY KEY,
  data_schema json NOT NULL
);

INSERT INTO json_test (id,data_schema) VALUES
(1,'{"properties": {"baz": {"type": "string"}}, "type": "object"}'),
(2,'{"type": "object", "properties": {"baz": {"type": "string"}}}');

select * from json_test;

MySQL response:

+----+---------------------------------------------------------------+
| id | data_schema                                                   |
+----+---------------------------------------------------------------+
|  1 | {"type": "object", "properties": {"baz": {"type": "string"}}} |
|  2 | {"type": "object", "properties": {"baz": {"type": "string"}}} |
+----+---------------------------------------------------------------+

dolt response:

+----+---------------------------------------------------------------+
| id | data_schema                                                   |
+----+---------------------------------------------------------------+
| 1  | {"properties": {"baz": {"type": "string"}}, "type": "object"} |
| 2  | {"properties": {"baz": {"type": "string"}}, "type": "object"} |
+----+---------------------------------------------------------------+

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsqlIssue with SQL

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions