[MDEV-12947] COLUMN_JSON does not properly encode newlines Created: 2017-05-29 Updated: 2018-05-16 Resolved: 2018-05-16 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Dynamic Columns |
| Affects Version/s: | 10.1, 10.1.23, 10.2 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Minor |
| Reporter: | Anthony Ryan | Assignee: | Oleksandr Byelkin |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Linux |
||
| Issue Links: |
|
||||||||
| Description |
|
The JSON spec wants all newline characters encoded as "\n", COLUMN_JSON fails to encode newline characters properly. Minimal test case:
Current output:
Expected output:
|
| Comments |
| Comment by Elena Stepanova [ 2017-06-02 ] | |||||||||
|
What is the "JSON spec" that you are referring to? Could you please give a link? | |||||||||
| Comment by Anthony Ryan [ 2017-06-02 ] | |||||||||
|
The JSON spec can be found here: http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf Section 9 describes the correct formatting of a string and lists all characters that need special encoding. | |||||||||
| Comment by Elena Stepanova [ 2017-06-02 ] | |||||||||
|
Thanks. Since COLUMN_JSON is supposed to take a string as an argument and return a JSON-formatted object, it seems to be a valid point. Here is an example of a JSON function with string arguments and JSON result in 10.2:
COLUMN_JSON should do the same. | |||||||||
| Comment by Anthony Ryan [ 2018-05-15 ] | |||||||||
|
This issue was resolved by the changes made for |