dolt icon indicating copy to clipboard operation
dolt copied to clipboard

Decimals in JSON columns are being improperly coerced into strings when inserted into tables.

Open nicktobey opened this issue 8 months ago • 0 comments

Reproduction steps:

CREATE TABLE test(j json);
INSERT INTO test VALUES (JSON_OBJECT("a", 1.0));
SELECT * FROM test;
SELECT * FROM test WHERE j =JSON_OBJECT("a", 1.0);

MySQL output:

mysql> select * from test;
+------------+
| j          |
+------------+
| {"a": 1.0} |
+------------+

mysql> SELECT * FROM test WHERE j =JSON_OBJECT("a", 1.0);
+------------+
| j          |
+------------+
| {"a": 1.0} |
+------------+

Dolt output:

json> select * from test;
+------------+
| j          |
+------------+
| {"a": "1"} |
+------------+

select * from test where j = JSON_OBJECT("a", 1.0);
Empty set (0.00 sec)

nicktobey avatar Dec 20 '23 18:12 nicktobey