[MDEV-16869] String functions don't respect character set of JSON_VALUE Created: 2018-07-31 Updated: 2020-08-25 Resolved: 2018-08-05 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Character Sets, JSON |
| Affects Version/s: | 10.2.16, 10.2, 10.3 |
| Fix Version/s: | 10.2.17 |
| Type: | Bug | Priority: | Major |
| Reporter: | Geoff Montee (Inactive) | Assignee: | Alexey Botchkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Let's say that we have the following table:
We can get the value of key1 by executing the following:
And this works fine:
But if we combine this with string functions, then the character set gets messed up. For example, run the following queries instead:
And we get something unexpected:
We can workaround this problem by explicitly converting the JSON_VALUE return value to a given character set:
|
| Comments |
| Comment by Elena Stepanova [ 2018-07-31 ] | ||||||||||||||||
|
JSON_EXTRACT, for example, works okay. | ||||||||||||||||
| Comment by Alexander Barkov [ 2018-08-03 ] | ||||||||||||||||
|
This script demonstrates the problem:
Note, if I change the character set of the column to utf8mb4, it returns the expected value:
| ||||||||||||||||
| Comment by Alexey Botchkov [ 2018-08-05 ] | ||||||||||||||||
|
http://lists.askmonty.org/pipermail/commits/2018-August/012774.html |