mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
a29b1d7151
In cp932, '\' character can be the second byte in a multi-byte character stream. This makes it difficult to use mysql_escape_string. Added flag to indicate which languages allow '\' as second byte of multibyte sequence so that when putting a prepared statement into the binlog we can decide at runtime whether hex encoding is really needed. include/m_ctype.h: Added bool to indicate character sets which allow '\' as the second byte of a multibyte character set (currently only cp932). For these character sets, escaping with '\' is dangerous and leads to corruption in replication. include/my_sys.h: Add function to enocde a string as hex with no prefix (bare) mysys/charset.c: Add function to encode string as hex with no prefix (bare). sql/item.cc: Check the connection character set to see if escape_string_for_mysql is safe, or if character set requires unambiguous (hex) encoding sql/item.h: Pass thd to query_val_str for access to charset() sql/sql_prepare.cc: Pass thd to query_val_str. strings/ctype-big5.c: Add escape_with_backslash_is_dangerous flag. strings/ctype-bin.c: Add escape_with_backslash_is_dangerous flag strings/ctype-cp932.c: Add escape_with_backslash_is_dangerous flag. strings/ctype-czech.c: Add escape_with_backslash_is_dangerous flag. strings/ctype-euc_kr.c: Add escape_with_backslash_is_dangerous flag. strings/ctype-extra.c: Add escape_with_backslash_is_dangerous flag. strings/ctype-gb2312.c: Add escape_with_backslash_is_dangerous flag. strings/ctype-gbk.c: Added escape_with_backslash_is_dangerous flag. strings/ctype-latin1.c: Added escape_with_backslash_is_dangerous flag. strings/ctype-sjis.c: Added escape_with_backslash_is_dangerous flag. strings/ctype-tis620.c: Added esacpe_with_backslash_character_is_dangerous flag. strings/ctype-uca.c: Added escape_with_backslash_is_dangerous flag. strings/ctype-ucs2.c: Added escape_with_backslash_is_dangerous. strings/ctype-ujis.c: Added escape_with_backslash_is_dangerous flag. strings/ctype-utf8.c: Added escape_with_backslash_is_dangerous. strings/ctype-win1250ch.c: Added escape_with_backslash_is_dangerous.
47 lines
1.5 KiB
C
47 lines
1.5 KiB
C
/* Copyright (C) 2000 MySQL AB
|
|
|
|
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
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
|
|
|
#include <my_global.h>
|
|
#include <m_ctype.h>
|
|
|
|
CHARSET_INFO compiled_charsets[] = {
|
|
{
|
|
0,0,0, /* end-of-list marker */
|
|
0, /* state */
|
|
NullS, /* cs name */
|
|
NullS, /* name */
|
|
NullS, /* comment */
|
|
NULL, /* tailoring */
|
|
NULL, /* ctype */
|
|
NULL, /* to_lower */
|
|
NULL, /* to_upper */
|
|
NULL, /* sort_order */
|
|
NULL, /* contractions */
|
|
NULL, /* sort_order_big*/
|
|
NULL, /* tab_to_uni */
|
|
NULL, /* tab_from_uni */
|
|
NULL, /* state_map */
|
|
NULL, /* ident_map */
|
|
0, /* strxfrm_mul */
|
|
0, /* mbminlen */
|
|
0, /* mbmaxlen */
|
|
0, /* min_sort_ord */
|
|
0, /* max_sort_ord */
|
|
0, /* escape_with_backslash_is_dangerous */
|
|
NULL, /* cset handler */
|
|
NULL /* coll handler */
|
|
}
|
|
};
|