summaryrefslogtreecommitdiff
path: root/storage/perfschema/pfs_setup_object.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 /storage/perfschema/pfs_setup_object.cc
parent09a1f0075a8d5752dd7b2940a20d86a040af1741 (diff)
parent1418439d3823fe059b41092af72ab32d5e7cd7ab (diff)
downloadmariadb-git-10.6-vatu.tar.gz
Diffstat (limited to 'storage/perfschema/pfs_setup_object.cc')
-rw-r--r--storage/perfschema/pfs_setup_object.cc14
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]);