1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

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.
This commit is contained in:
Alexander Barkov
2009-09-30 10:09:28 +05:00
parent a8edd0aabb
commit f02800bd97
11 changed files with 222 additions and 118 deletions

View File

@ -6,7 +6,7 @@
./conf_to_src ../sql/share/charsets/ > FILE
*/
/* Copyright (C) 2000-2007 MySQL AB
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -6804,7 +6804,7 @@ CHARSET_INFO compiled_charsets[] = {
#ifdef HAVE_CHARSET_swe7
{
10,0,0,
MY_CS_COMPILED|MY_CS_PRIMARY,
MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_NONASCII,
"swe7", /* cset name */
"swe7_swedish_ci", /* coll name */
"", /* comment */
@ -8454,7 +8454,7 @@ CHARSET_INFO compiled_charsets[] = {
#ifdef HAVE_CHARSET_swe7
{
82,0,0,
MY_CS_COMPILED|MY_CS_BINSORT,
MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NONASCII,
"swe7", /* cset name */
"swe7_bin", /* coll name */
"", /* comment */
@ -8550,72 +8550,6 @@ CHARSET_INFO compiled_charsets[] = {
}
,
#endif
#ifdef HAVE_CHARSET_geostd8
{
92,0,0,
MY_CS_COMPILED|MY_CS_PRIMARY,
"geostd8", /* cset name */
"geostd8_general_ci", /* coll name */
"", /* comment */
NULL, /* tailoring */
ctype_geostd8_general_ci, /* ctype */
to_lower_geostd8_general_ci, /* lower */
to_upper_geostd8_general_ci, /* upper */
sort_order_geostd8_general_ci, /* sort_order */
NULL, /* contractions */
NULL, /* sort_order_big*/
to_uni_geostd8_general_ci, /* to_uni */
NULL, /* from_uni */
my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
1, /* caseup_multiply*/
1, /* casedn_multiply*/
1, /* mbminlen */
1, /* mbmaxlen */
0, /* min_sort_char */
255, /* max_sort_char */
' ', /* pad_char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_8bit_handler,
&my_collation_8bit_simple_ci_handler,
}
,
#endif
#ifdef HAVE_CHARSET_geostd8
{
93,0,0,
MY_CS_COMPILED|MY_CS_BINSORT,
"geostd8", /* cset name */
"geostd8_bin", /* coll name */
"", /* comment */
NULL, /* tailoring */
ctype_geostd8_bin, /* ctype */
to_lower_geostd8_bin, /* lower */
to_upper_geostd8_bin, /* upper */
NULL, /* sort_order */
NULL, /* contractions */
NULL, /* sort_order_big*/
to_uni_geostd8_bin, /* to_uni */
NULL, /* from_uni */
my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
1, /* caseup_multiply*/
1, /* casedn_multiply*/
1, /* mbminlen */
1, /* mbmaxlen */
0, /* min_sort_char */
255, /* max_sort_char */
' ', /* pad_char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_8bit_handler,
&my_collation_8bit_bin_handler,
}
,
#endif
#ifdef HAVE_CHARSET_latin1
{
94,0,0,