summaryrefslogtreecommitdiff
path: root/sql/sys_vars.cc
diff options
context:
space:
mode:
authorVarun Gupta <varun.gupta@mariadb.com>2020-05-29 00:32:08 +0530
committerVarun Gupta <varun.gupta@mariadb.com>2020-06-05 01:11:03 +0530
commitf30ff10c8d02d8385bafa290b8c73367d49aece2 (patch)
tree12fc921da3dddc00b0a47314182b19bd4eb29540 /sql/sys_vars.cc
parent3f019d1771d4e6e21f941b72a83e0663f15b376f (diff)
downloadmariadb-git-f30ff10c8d02d8385bafa290b8c73367d49aece2.tar.gz
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.
Diffstat (limited to 'sql/sys_vars.cc')
-rw-r--r--sql/sys_vars.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index 9f87c846fd0..7dc1d1ab6e8 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -2178,7 +2178,7 @@ static Sys_var_ulong Sys_max_sort_length(
"the first max_sort_length bytes of each value are used; the rest "
"are ignored)",
SESSION_VAR(max_sort_length), CMD_LINE(REQUIRED_ARG),
- VALID_RANGE(4, 8192*1024L), DEFAULT(1024), BLOCK_SIZE(1));
+ VALID_RANGE(8, 8192*1024L), DEFAULT(1024), BLOCK_SIZE(1));
static Sys_var_ulong Sys_max_sp_recursion_depth(
"max_sp_recursion_depth",