summaryrefslogtreecommitdiff
path: root/sql/opt_split.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-11-02 15:48:47 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2020-11-02 15:48:47 +0200
commitc7f322c91faf97a9f758c288b38e1385fd89b32d (patch)
treecf2a4cf562acffdf5b4b96d84e34f29c7f428458 /sql/opt_split.cc
parentd5ce7824444b7491f420061076ae5087d4829428 (diff)
parent8036d0a3590dddf4d51ba02bc74ba3a5a96674f7 (diff)
downloadmariadb-git-c7f322c91faf97a9f758c288b38e1385fd89b32d.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'sql/opt_split.cc')
-rw-r--r--sql/opt_split.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/sql/opt_split.cc b/sql/opt_split.cc
index c70fac49930..6807a623b73 100644
--- a/sql/opt_split.cc
+++ b/sql/opt_split.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2017 MariaDB
+ Copyright (c) 2017, 2020, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -751,13 +751,13 @@ void JOIN::add_keyuses_for_splitting()
added_keyuse_count))
goto err;
- memcpy(keyuse.buffer,
- save_qep->keyuse.buffer,
- (size_t) save_qep->keyuse.elements * keyuse.size_of_element);
- keyuse.elements= save_qep->keyuse.elements;
+ idx= keyuse.elements= save_qep->keyuse.elements;
+ if (keyuse.elements)
+ memcpy(keyuse.buffer,
+ save_qep->keyuse.buffer,
+ (size_t) keyuse.elements * keyuse.size_of_element);
keyuse_ext= &ext_keyuses_for_splitting->at(0);
- idx= save_qep->keyuse.elements;
for (i=0; i < added_keyuse_count; i++, keyuse_ext++, idx++)
{
set_dynamic(&keyuse, (KEYUSE *) keyuse_ext, idx);