Bug #90503 | JSON_SET returns malformed JSON when it includes binary data | ||
---|---|---|---|
Submitted: | 18 Apr 2018 20:15 | Modified: | 17 Aug 2018 16:25 |
Reporter: | Horacio Nicodemo | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: JSON | Severity: | S1 (Critical) |
Version: | 5.7.21 | OS: | CentOS (6.0) |
Assigned to: | CPU Architecture: | x86 | |
Tags: | JSON JSON_SET BLOB BINARY |
[18 Apr 2018 20:15]
Horacio Nicodemo
[19 Apr 2018 7:15]
Knut Anders Hatlen
Thanks for the bug report, Horacio. The JSON specification states that newlines must be escaped, so it is a bug that the base64-encoded string is broken up by unescaped newline characters.
[17 Aug 2018 16:25]
Jon Stephens
Documented fix in the MySQL 8.0.13 changelog as follows: When a JSON document which contained binary data was converted to base-64 encoded text for display, newline characters in the encoded string were not properly escaped, so that the text representation could not be parsed as JSON, and was thus truncated, corrupted, or both. Now MySQL makes sure that any newline characters in the encoded string are escaped. Closed.