summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-06-06 18:07:04 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-06-06 18:07:04 +0300
commit0df01ccb667b23a0af33f76a43632900f0bd7744 (patch)
tree1247afcb1ac5f216de3fd32cdb16503979ff685d /sql
parent1bd5b75c733840813ea1fe18c5908422a707e677 (diff)
parentf30ff10c8d02d8385bafa290b8c73367d49aece2 (diff)
downloadmariadb-git-0df01ccb667b23a0af33f76a43632900f0bd7744.tar.gz
Merge 10.1 into 10.2
Diffstat (limited to 'sql')
-rw-r--r--sql/field.cc5
-rw-r--r--sql/field.h7
-rw-r--r--sql/sys_vars.cc2
3 files changed, 10 insertions, 4 deletions
diff --git a/sql/field.cc b/sql/field.cc
index d1bd5860f06..1ea7b30f85d 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -3507,10 +3507,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);
}
diff --git a/sql/field.h b/sql/field.h
index 3007e666ba7..d5e2cb25788 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -1218,6 +1218,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() {}
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index 8eb75e49d8e..2d40943827f 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -2224,7 +2224,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",