Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Duplicate
-
None
-
None
-
Not for Release Notes
Description
A JSON number is handed to the column in its textual form, so column types whose numeric and string conversions differ get the string semantics:
Reproduced on 10.11.19 (debug build):
SELECT b + 0 FROM JSON_TABLE('[1]', '$[*]' COLUMNS(b BIT(8) PATH '$')) t; -- 49 |
SELECT y FROM JSON_TABLE('[0]', '$[*]' COLUMNS(y YEAR PATH '$')) t; -- 2000 |
 |
CREATE TABLE ref (n BIT(8), y YEAR); |
INSERT INTO ref VALUES (1, 0); |
SELECT n + 0, y FROM ref; -- 1, 0000 |
49 is the character '1'. Expected: the JSON number 1 is stored as 1 and the JSON number 0 as 0000, as a plain INSERT of the numbers does. INT columns are unaffected because the two conversions agree there.
Attachments
Issue Links
- duplicates
-
MDEV-39253 Incorrect data type handling in JSON_TABLE
-
- Open
-