mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-22715: SIGSEGV in radixsort_for_str_ptr and in native_compare/my_qsort2 (optimized builds)
For DECIMAL[(M[,D])] datatype max_sort_length was not being honoured which was leading to buffer overflow while making the sort key. The fix to this problem would be to create sort keys for decimals with atmost max_sort_key bytes Important: The minimum value of max_sort_length has been raised to 8 (previously was 4), so fixed size datatypes like DOUBLE and BIGINIT are not truncated for lower values of max_sort_length.
This commit is contained in:
@ -3295,10 +3295,9 @@ int Field_new_decimal::cmp(const uchar *a,const uchar*b)
|
||||
}
|
||||
|
||||
|
||||
void Field_new_decimal::sort_string(uchar *buff,
|
||||
uint length __attribute__((unused)))
|
||||
void Field_new_decimal::sort_string(uchar *buff, uint length)
|
||||
{
|
||||
memcpy(buff, ptr, bin_size);
|
||||
memcpy(buff, ptr, length);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user