mirror of
https://github.com/MariaDB/server.git
synced 2026-04-30 12:15:32 +02:00
Bug#19741 segfault with cp1250 charset + like + primary key + 64bit os
LIKE craashed with a pattern having letters in the range 128..255 (e.g. A WITH ACUTE or C WITH CARON) because of wrong cast from signed char to unsigned int. mysql-test/r/ctype_cp1250_ch.result: Adding test case mysql-test/t/ctype_cp1250_ch.test: Adding test case strings/ctype-win1250ch.c: Fixing wrong cast from "signed char" -> "uint" to "signed char" -> "unsigned char" -> uint, to properly handle bytes 128..255.
This commit is contained in:
parent
c939a8d7e5
commit
2347325117
3 changed files with 20 additions and 2 deletions
|
|
@ -634,11 +634,11 @@ my_like_range_win1250ch(CHARSET_INFO *cs __attribute__((unused)),
|
|||
ptr++; /* Skip escape */
|
||||
else if (*ptr == w_one || *ptr == w_many) /* '_' or '%' in SQL */
|
||||
break;
|
||||
*min_str = like_range_prefix_min_win1250ch[(uint)(*ptr)];
|
||||
*min_str = like_range_prefix_min_win1250ch[(uint) (uchar) (*ptr)];
|
||||
if (*min_str != min_sort_char)
|
||||
only_min_found= 0;
|
||||
min_str++;
|
||||
*max_str++ = like_range_prefix_max_win1250ch[(uint)(*ptr)];
|
||||
*max_str++ = like_range_prefix_max_win1250ch[(uint) (uchar) (*ptr)];
|
||||
}
|
||||
|
||||
*min_length = (uint) (min_str - min_org);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue