Details
-
Task
-
Status: Open (View Workflow)
-
Trivial
-
Resolution: Unresolved
-
None
Description
Unlike MySQL, MariaDB allows JSON documents be binary:
10.2 ba7d86a6 |
MariaDB [test]> select json_valid(convert('{"a":"b"}' using binary)); |
+-----------------------------------------------+ |
| json_valid(convert('{"a":"b"}' using binary)) | |
+-----------------------------------------------+ |
| 1 |
|
+-----------------------------------------------+ |
1 row in set (0.001 sec) |
MySQL 8.0.23 |
MySQL [test]> select json_valid(convert('{"a":"b"}' using binary)); |
+-----------------------------------------------+ |
| json_valid(convert('{"a":"b"}' using binary)) | |
+-----------------------------------------------+ |
| 0 |
|
+-----------------------------------------------+ |
1 row in set (0.000 sec) |
The standard mostly talks about JSON texts as being Unicode; but if I interpret it correctly (while reading ISO/IEC TR 19075-6 "3.2 Representations of JSON data"), it allows implementation-specific support of binary formats.
If it is indeed allowed or at least doesn't cause any important discrepancies, supporting it nice, especially when it comes to the use of LOAD_FILE for defining a JSON document. But since it's implementation-specific, I think it needs to be documented.