diff options
Diffstat (limited to 'storage')
-rw-r--r-- | storage/myisam/mi_key.c | 7 | ||||
-rw-r--r-- | storage/perfschema/pfs_setup_object.cc | 14 |
2 files changed, 15 insertions, 6 deletions
diff --git a/storage/myisam/mi_key.c b/storage/myisam/mi_key.c index c18b832be0f..64eedde5f6d 100644 --- a/storage/myisam/mi_key.c +++ b/storage/myisam/mi_key.c @@ -144,8 +144,11 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key, set_if_smaller(length,tmp_length); FIX_LENGTH(cs, pos, length, char_length); store_key_length_inc(key,char_length); - memcpy(key, pos, char_length); - key+= char_length; + if (char_length) + { + memcpy(key, pos, char_length); + key+= char_length; + } continue; } else if (keyseg->flag & HA_SWAP_KEY) diff --git a/storage/perfschema/pfs_setup_object.cc b/storage/perfschema/pfs_setup_object.cc index f33030e927f..8da9fccc65f 100644 --- a/storage/perfschema/pfs_setup_object.cc +++ b/storage/perfschema/pfs_setup_object.cc @@ -144,12 +144,18 @@ static void set_setup_object_key(PFS_setup_object_key *key, char *ptr= &key->m_hash_key[0]; ptr[0]= (char) object_type; ptr++; - memcpy(ptr, schema, schema_length); - ptr+= schema_length; + if (schema_length) + { + memcpy(ptr, schema, schema_length); + ptr+= schema_length; + } ptr[0]= 0; ptr++; - memcpy(ptr, object, object_length); - ptr+= object_length; + if (object_length) + { + memcpy(ptr, object, object_length); + ptr+= object_length; + } ptr[0]= 0; ptr++; key->m_key_length= (uint)(ptr - &key->m_hash_key[0]); |