diff options
author | Alexander Barkov <bar@mysql.com> | 2009-09-30 10:09:28 +0500 |
---|---|---|
committer | Alexander Barkov <bar@mysql.com> | 2009-09-30 10:09:28 +0500 |
commit | f02800bd9733efbdc1328f866ad0ef2779939f7c (patch) | |
tree | 0b2f97100efd6c5566704a4bcd828c90c91da331 /include | |
parent | a8edd0aabb5059935b99076fbcc92403079535df (diff) | |
download | mariadb-git-f02800bd9733efbdc1328f866ad0ef2779939f7c.tar.gz |
Backporting WL#3759 Optimize identifier conversion in client-server protocol
This patch provides performance improvements:
- send_fields() when character_set_results = latin1
is now about twice faster for column/table/database
names, consisting on ASCII characters.
Changes:
- Protocol doesn't use "convert" temporary buffer anymore,
and converts strings directly to "packet".
- General conversion optimization: quick conversion
of ASCII strings was added.
modified files:
include/m_ctype.h
- Adding a new flag.
- Adding a new function prototype
libmysqld/lib_sql.cc
- Adding quick conversion method for embedded library:
conversion is now done directly to result buffer,
without using a temporary buffer.
mysys/charset.c
- Mark all dynamic ucs2 character sets as non-ASCII
- Mark some dymamic 7bit and 8bit charsets as non-ASCII
(for example swe7 is not fully ASCII compatible).
sql/protocol.cc
- Adding quick method to convert a string directly
into protocol buffer, without using a temporary buffer.
sql/protocol.h
- Adding a new method prototype
sql/sql_string.cc
Optimization for conversion between two ASCII-compatible charsets:
- quickly convert ASCII strings,
switch to mc_wc->wc_mb method only when a non-ASCII character is met.
- copy four ASCII characters at once on i386
strings/conf_to_src.c
- Marking non-ASCII character sets with a flag.
strings/ctype-extra.c
- Regenerating ctype-extra.c by running "conf_to_src".
strings/ctype-uca.c
- Marking UCS2 character set as non-ASCII.
strings/ctype-ucs2.c
- Marking UCS2 character set as non-ASCII.
strings/ctype.c
- A new function to detect if a 7bit or 8bit character set
is ascii compatible.
Diffstat (limited to 'include')
-rw-r--r-- | include/m_ctype.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/m_ctype.h b/include/m_ctype.h index 451c8db549b..f6503a54935 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -87,6 +87,7 @@ extern MY_UNI_CTYPE my_uni_ctype[256]; #define MY_CS_CSSORT 1024 /* if case sensitive sort order */ #define MY_CS_HIDDEN 2048 /* don't display in SHOW */ #define MY_CS_PUREASCII 4096 /* if a charset is pure ascii */ +#define MY_CS_NONASCII 8192 /* if not ASCII-compatible */ #define MY_CHARSET_UNDEFINED 0 /* Character repertoire flags */ @@ -474,6 +475,7 @@ my_bool my_charset_is_ascii_based(CHARSET_INFO *cs); my_bool my_charset_is_8bit_pure_ascii(CHARSET_INFO *cs); uint my_charset_repertoire(CHARSET_INFO *cs); +my_bool my_charset_is_ascii_compatible(CHARSET_INFO *cs); #define _MY_U 01 /* Upper case */ #define _MY_L 02 /* Lower case */ |