diff options
Diffstat (limited to 'storage/perfschema')
-rw-r--r-- | storage/perfschema/pfs_setup_object.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/storage/perfschema/pfs_setup_object.cc b/storage/perfschema/pfs_setup_object.cc index 9325b84997f..47afd130761 100644 --- a/storage/perfschema/pfs_setup_object.cc +++ b/storage/perfschema/pfs_setup_object.cc @@ -126,12 +126,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]); |