diff options
author | Monty <monty@mariadb.org> | 2020-07-20 19:26:31 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2020-07-23 10:54:33 +0300 |
commit | dbcd3384e0799ee99a966edaff2c0f135ef51a29 (patch) | |
tree | 9beee5052a706dd721c044edf0de971f868d15e3 /mysys/errors.c | |
parent | 46ffd47f422147cd748119eba19ad248bd7356db (diff) | |
download | mariadb-git-dbcd3384e0799ee99a966edaff2c0f135ef51a29.tar.gz |
MDEV-7947 strcmp() takes 0.37% in OLTP RO
This patch ensures that all identical character sets shares the same
cs->csname.
This allows us to replace strcmp() in my_charset_same() with comparisons
of pointers. This fixes a long standing performance issue that could cause
as strcmp() for every item sent trough the protocol class to the end user.
One consequence of this patch is that we don't allow one to add a character
definition in the Index.xml file that changes the csname of an existing
character set. This is by design as changing character set names of existing
ones is extremely dangerous, especially as some storage engines just records
character set numbers.
As we now have a hash over character set's csname, we can in the future
use that for faster access to a specific character set. This could be done
by changing the hash to non unique and use the hash to find the next
character set with same csname.
Diffstat (limited to 'mysys/errors.c')
-rw-r--r-- | mysys/errors.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mysys/errors.c b/mysys/errors.c index a7ccf752c0c..d88540fe277 100644 --- a/mysys/errors.c +++ b/mysys/errors.c @@ -58,7 +58,8 @@ const char *globerrs[GLOBERRS]= "Warning: Can't copy ownership for file '%s' (Errcode: %M)", "Failed to release memory pointer %p, %zu bytes (Errcode: %M)", "Lock Pages in memory access rights required", - "Memcntl %s cmd %s error" + "Memcntl %s cmd %s error", + "Warning: Charset id '%d' csname '%s' trying to replace existing csname '%s'", }; void init_glob_errs(void) @@ -107,6 +108,7 @@ void init_glob_errs() EE(EE_BADMEMORYRELEASE)= "Failed to release memory pointer %p, %zu bytes (Errcode: %M)"; EE(EE_PERM_LOCK_MEMORY)= "Lock Pages in memory access rights required"; EE(EE_MEMCNTL) = "Memcntl %s cmd %s error"; + EE(EE_DUPLICATE_CHARSET)= "Warning: Charset id %d trying to replace csname %s with %s"; } #endif |