1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +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:
Varun Gupta
2020-05-29 00:32:08 +05:30
parent 3f019d1771
commit f30ff10c8d
23 changed files with 135 additions and 47 deletions

View File

@ -1099,6 +1099,13 @@ public:
void make_sort_key(uchar *buff, uint length);
virtual void make_field(Send_field *);
/*
Some implementations actually may write up to 8 bytes regardless of what
size was requested. This is due to the minimum value of the system variable
max_sort_length.
*/
virtual void sort_string(uchar *buff,uint length)=0;
virtual bool optimize_range(uint idx, uint part);
virtual void free() {}