summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-11-03 19:11:36 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2020-11-03 19:11:36 +0200
commitc498250888ec126fddda2867d1239b2a7734482f (patch)
treee308174c977c0981d8e36f6f9b791b1b266d0cb0 /sql/sql_select.cc
parent09a1f0075a8d5752dd7b2940a20d86a040af1741 (diff)
parent1418439d3823fe059b41092af72ab32d5e7cd7ab (diff)
downloadmariadb-git-c498250888ec126fddda2867d1239b2a7734482f.tar.gz
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 74b9b4dc393..bb9d82a7039 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -27960,10 +27960,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. */