1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-23187: Assorted assertion failures in json_find_path with certain

collations

Fix by Alexey Botchkov

The 'value_len' is calculated wrong for the multibyte charsets. In the
read_strn() function we get the length of the string with the final ' " '
character. So have to subtract it's length from the value_len. And the
length of '1' isn't correct for the ucs2 charset (must be 2).
This commit is contained in:
Rucha Deodhar
2023-04-13 16:43:30 +05:30
parent 996b040f93
commit b7b8a9ee43
4 changed files with 14 additions and 10 deletions

View File

@ -401,7 +401,7 @@ static int read_strn(json_engine_t *j)
return 1;
j->state= j->stack[j->stack_p];
j->value_len= (int)(j->s.c_str - j->value) - 1;
j->value_len= (int)(j->s.c_str - j->value) - j->s.c_next_len;
return 0;
}