summaryrefslogtreecommitdiff
path: root/sql/key.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2020-07-24 17:43:10 +0200
committerSergei Golubchik <serg@mariadb.org>2020-07-29 14:56:24 +0200
commit0b5b2f864153bf236a844e225ed6f04d79c757d8 (patch)
tree775b7ba966f61c99fa569cf95879ef98ea63c80f /sql/key.cc
parentd5970779fac361a9ba56fccf0e9ed5b492b17d7e (diff)
downloadmariadb-git-0b5b2f864153bf236a844e225ed6f04d79c757d8.tar.gz
Bug #25207522: INCORRECT ORDER-BY BEHAVIOR ON A PARTITIONED TABLE WITH A COMPOSITE PREFIX INDEX
Fix prefix key comparison in partitioning. Comparions must take into account no more than prefix_len characters. It used to compare prefix_len*mbmaxlen bytes.
Diffstat (limited to 'sql/key.cc')
-rw-r--r--sql/key.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/key.cc b/sql/key.cc
index 013733db62a..9b09387885b 100644
--- a/sql/key.cc
+++ b/sql/key.cc
@@ -623,8 +623,8 @@ int key_rec_cmp(void *key_p, uchar *first_rec, uchar *second_rec)
max length. The exceptions are the BLOB and VARCHAR field types
that take the max length into account.
*/
- if ((result= field->cmp_max(field->ptr+first_diff, field->ptr+sec_diff,
- key_part->length)))
+ if ((result= field->cmp_prefix(field->ptr+first_diff, field->ptr+sec_diff,
+ key_part->length)))
DBUG_RETURN(result);
next_loop:
key_part++;