[MDEV-11856] json_search doesn't search for values with double quotes character (") Created: 2017-01-20 Updated: 2017-03-15 Resolved: 2017-03-14 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | JSON |
| Affects Version/s: | 10.2 |
| Fix Version/s: | 10.2.5 |
| Type: | Bug | Priority: | Major |
| Reporter: | Andrii Nikitin (Inactive) | Assignee: | Alexey Botchkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Sprint: | 10.2.5-1 |
| Description |
|
E.g. while searching for values with single quote character - everything works as expected:
But "the same" search for double quotes returns no result:
In MySQL 5.7:
|
| Comments |
| Comment by Andrii Nikitin (Inactive) [ 2017-01-21 ] | ||||||||||||
|
Another example for similar problem with JSON_EXTRACT :
| ||||||||||||
| Comment by Andrii Nikitin (Inactive) [ 2017-01-21 ] | ||||||||||||
|
Actually extra-escaping of search string in first example looks helping, but it doesn't sound correct as we pass string value to sql function, not json-string ?
And removing quotes in second example helps as well! (MySQL 5.7 shows error "Invalid JSON path expression" though on it).
This still doesn't sound logically correct. Both functions should either expect valid SQL string (probably with extra escaping for JSON) or just valid JSON string. It looks that currently JSON_search() requires JSON string according to diagram at http://json.org/ , just without wrapping quotes. And JSON_EXTRACT() expects kind of SQL string. | ||||||||||||
| Comment by Alexey Botchkov [ 2017-03-14 ] | ||||||||||||
|
http://lists.askmonty.org/pipermail/commits/2017-March/010855.html |