Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
N/A
-
None
Description
bb-10.5-hf 6dfb3fab2 |
MariaDB [test]> select * from json_table('{"a":"foo"}', '$' columns (f char(1) exists path '$.a')) as jt; |
+------+ |
| f |
|
+------+ |
| |
|
+------+ |
1 row in set (0.002 sec) |
MySQL 8.0.19 |
MySQL [test]> select * from json_table('{"a":"foo"}', '$' columns (f char(1) exists path '$.a')) as jt; |
+------+ |
| f |
|
+------+ |
| 1 |
|
+------+ |
1 row in set (0.001 sec) |
I couldn't find specification of EXISTS PATH in the standard, but MySQL documentation explicitly says "type can be any valid MySQL data type" (even if it should be integer). And integer normally casts to char well, so it shouldn't be a problem.
Float is also wrong:
=bb-10.5-hf 6dfb3fab2 |
MariaDB [test]> select * from json_table('{"a":"foo"}', '$' columns (f float exists path '$.a')) as jt; |
+------+ |
| f |
|
+------+ |
| 0 |
|
+------+ |
1 row in set (0.002 sec) |
MySQL 8.0.19 |
MySQL [test]> select * from json_table('{"a":"foo"}', '$' columns (f float exists path '$.a')) as jt; |
+------+ |
| f |
|
+------+ |
| 1 |
|
+------+ |
1 row in set (0.001 sec) |
Attachments
Issue Links
- relates to
-
MDEV-22293 JSON_TABLE: Values for regular columns are truncated for no reason
- Closed
-
MDEV-17399 Add support for JSON_TABLE
- Closed