[MDEV-28947] JSON_TYPE result is turncated, charset max length should be considered Created: 2022-06-25 Updated: 2023-01-31 Resolved: 2022-06-30 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | JSON |
| Affects Version/s: | 10.8.2, 10.8.3, 10.9.1, 10.10.1 |
| Fix Version/s: | 10.8.4 |
| Type: | Bug | Priority: | Major |
| Reporter: | ziyitan | Assignee: | Rucha Deodhar |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | gsoc22 | ||
| Environment: |
Arch Linux x86_64 |
||
| Attachments: |
|
||||||||||||||||
| Issue Links: |
|
||||||||||||||||
| Description |
|
Hi, I'm gsoc-2022 contributor,I'm working on the MCOL-785.
The charset used by json_type() Field is utf8_mb3. When the copy into the Field buffer takes place there is a copy length calculation that divides the length 12 bytes(strange but this is what it is) by 3(max byte per char length for utf8_mb3).So finally the result return 4 characters. I found here that the max length and collation are set:
So I think the max_length should be set 12*collation.collation->mbmaxlen to make json_type in columnstore behave correctly.
|
| Comments |
| Comment by Nayuta Yanagisawa (Inactive) [ 2022-06-25 ] |
| Comment by Rucha Deodhar [ 2022-06-30 ] |
|
Merged to 10.8: https://github.com/MariaDB/server/commit/ba5b2e7b291a9b4bfb97dcdf3c53ca49fc91a4e7 |