[MDEV-25147] Document support for binary representation of JSON documents Created: 2021-03-15  Updated: 2021-04-01

Status: Open
Project: MariaDB Server
Component/s: Documentation, JSON
Fix Version/s: N/A

Type: Task Priority: Trivial
Reporter: Elena Stepanova Assignee: Ian Gilfillan
Resolution: Unresolved Votes: 0
Labels: 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.



 Comments   
Comment by Sergei Golubchik [ 2021-04-01 ]

I think it's ok

Generated at Thu Feb 08 09:35:30 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.