summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-11-03 16:24:47 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2020-11-03 16:24:47 +0200
commit133b4b46fefde402542214d8226262534dc3601a (patch)
tree51bbdc0ee35a4af61e5af6d97948963ae9354f39 /sql/sql_select.cc
parent44836bcd12e3974e79c928be747955bfb3b73910 (diff)
parent533a13af069d8c9e6c5f4e1a72851497185ade03 (diff)
downloadmariadb-git-133b4b46fefde402542214d8226262534dc3601a.tar.gz
Merge 10.4 into 10.5
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 2a856a0d51f..6071fe10929 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -27984,10 +27984,10 @@ JOIN::reoptimize(Item *added_where, table_map join_tables,
if (save_to)
{
DBUG_ASSERT(!keyuse.elements);
- memcpy(keyuse.buffer,
- save_to->keyuse.buffer,
- (size_t) save_to->keyuse.elements * keyuse.size_of_element);
keyuse.elements= save_to->keyuse.elements;
+ if (size_t e= keyuse.elements)
+ memcpy(keyuse.buffer,
+ save_to->keyuse.buffer, e * keyuse.size_of_element);
}
/* Add the new access methods to the keyuse array. */