summaryrefslogtreecommitdiff
path: root/sql/filesort.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-01-04 10:30:45 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2022-01-04 10:30:45 +0200
commitdaf4fa5238a67fcf47075721d86d4348adab687b (patch)
treefff85b8f2e11607c93d806e787475ad82f5055f6 /sql/filesort.cc
parent756568f26c6a23c537f4d93ff00f485c6291c92e (diff)
parent7dfaded9625e832fade4ef1678bcb21c445dad2b (diff)
downloadmariadb-git-st-10.8-merge.tar.gz
Merge 10.7 into 10.8st-10.8-merge
Diffstat (limited to 'sql/filesort.cc')
-rw-r--r--sql/filesort.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/filesort.cc b/sql/filesort.cc
index 07194cb2e4f..bf5520955c9 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -1390,12 +1390,17 @@ static uint make_sortkey(Sort_param *param, uchar *to, uchar *ref_pos,
else
{
uchar *end= field->pack(to, field->ptr);
- int sz= static_cast<int>(end - to);
+ DBUG_ASSERT(end >= to);
+ uint sz= static_cast<uint>(end - to);
res_len += sz;
if (packed_addon_fields)
to+= sz;
else
+ {
+ if (addonf->length > sz)
+ bzero(end, addonf->length - sz); // Make Valgrind/MSAN happy
to+= addonf->length;
+ }
}
}
if (packed_addon_fields)