Commit 50e67fe3 authored by Alexander Barkov's avatar Alexander Barkov

- Adding big5, cp932, gbk, sjis tests covering characters that can

have 0x5C as the second byte in a multi-byte character.
- Adding big5 tests covering an unassigned character 0xC840
  being stored into char/varchar/text/enum columns.
parent 86957d41
--echo # Start of ctype_E05C.inc
#
# A shared test for character sets big5, cp932, gbk, sjis
# They all can have 0x5C as the second byte in a multi-byte character.
# 0xE05C is one of such characters.
#
# Checking that the character 0xE05C correctly understands 5C as the second byte
# rather than a stand-alone backslash, including the strings that also
# have real backslash escapes and/or separator escapes.
SELECT HEX('\'),HEX('\t');
SELECT HEX('\\\'),HEX('\\\t'),HEX('\\\t\t');
SELECT HEX('''\'),HEX('\''');
SELECT HEX('\\''\'),HEX('\''\\');
SELECT HEX(BINARY('\')),HEX(BINARY('\t'));
SELECT HEX(BINARY('\\\')),HEX(BINARY('\\\t')),HEX(BINARY('\\\t\t'));
SELECT HEX(BINARY('''\')),HEX(BINARY('\'''));
SELECT HEX(BINARY('\\''\')),HEX(BINARY('\''\\'));
SELECT HEX(_BINARY'\'),HEX(_BINARY'\t');
SELECT HEX(_BINARY'\\\'),HEX(_BINARY'\\\t'),HEX(_BINARY'\\\t\t');
SELECT HEX(_BINARY'''\'),HEX(_BINARY'\''');
SELECT HEX(_BINARY'\\''\'),HEX(_BINARY'\''\\');
CREATE TABLE t1 AS SELECT REPEAT(' ',10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES ('\'),('\t');
INSERT INTO t1 VALUES ('\\\'),('\\\t'),('\\\t\t');
INSERT INTO t1 VALUES ('''\'),('\''');
INSERT INTO t1 VALUES ('\\''\'),('\''\\');
SELECT a, HEX(a) FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (a BLOB);
INSERT INTO t1 VALUES ('\'),('\t');
INSERT INTO t1 VALUES ('\\\'),('\\\t'),('\\\t\t');
INSERT INTO t1 VALUES ('''\'),('\''');
INSERT INTO t1 VALUES ('\\''\'),('\''\\');
SELECT a, HEX(a) FROM t1;
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES (BINARY('\')),(BINARY('\t'));
INSERT INTO t1 VALUES (BINARY('\\\')),(BINARY('\\\t')),(BINARY('\\\t\t'));
INSERT INTO t1 VALUES (BINARY('''\')),(BINARY('\'''));
INSERT INTO t1 VALUES (BINARY('\\''\')),(BINARY('\''\\'));
SELECT a, HEX(a) FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (a BLOB);
INSERT INTO t1 VALUES (BINARY('\')),(BINARY('\t'));
INSERT INTO t1 VALUES (BINARY('\\\')),(BINARY('\\\t')),(BINARY('\\\t\t'));
INSERT INTO t1 VALUES (BINARY('''\')),(BINARY('\'''));
INSERT INTO t1 VALUES (BINARY('\\''\')),(BINARY('\''\\'));
SELECT a, HEX(a) FROM t1;
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES (_BINARY'\'),(_BINARY'\t');
INSERT INTO t1 VALUES (_BINARY'\\\'),(_BINARY'\\\t'),(_BINARY'\\\t\t');
INSERT INTO t1 VALUES (_BINARY'''\'),(_BINARY'\''');
INSERT INTO t1 VALUES (_BINARY'\\''\'),(_BINARY'\''\\');
SELECT a, HEX(a) FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (a BLOB);
INSERT INTO t1 VALUES (_BINARY'\'),(_BINARY'\t');
INSERT INTO t1 VALUES (_BINARY'\\\'),(_BINARY'\\\t'),(_BINARY'\\\t\t');
INSERT INTO t1 VALUES (_BINARY'''\'),(_BINARY'\''');
INSERT INTO t1 VALUES (_BINARY'\\''\'),(_BINARY'\''\\');
SELECT a, HEX(a) FROM t1;
DROP TABLE t1;
# Checking that with character_set_client=binary 0x5C in 0xE05C
# is treated as escape rather than the second byte of a multi-byte character,
# even if character_set_connection is big5/cp932/gbk/sjis.
# Note, the other 0x5C which is before 0xE05C is also treated as escape.
#
SET character_set_client=binary, character_set_results=binary;
SELECT @@character_set_client, @@character_set_connection, @@character_set_results;
SELECT HEX('\['), HEX('\\[');
CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES ('\['),('\\[');
SELECT HEX(a) FROM t1;
DROP TABLE t1;
--echo # Start of ctype_E05C.inc
......@@ -4374,6 +4374,253 @@ DROP FUNCTION mysql_real_escape_string_generated;
DROP FUNCTION iswellformed;
DROP TABLE allbytes;
# End of ctype_backslash.inc
SET NAMES big5;
# Start of ctype_E05C.inc
SELECT HEX('\'),HEX('\t');
HEX('\') HEX('\t')
E05C E05C74
SELECT HEX('\\\'),HEX('\\\t'),HEX('\\\t\t');
HEX('\\\') HEX('\\\t') HEX('\\\t\t')
5CE05C 5CE05C74 5CE05C7409
SELECT HEX('''\'),HEX('\''');
HEX('''\') HEX('\''')
27E05C E05C27
SELECT HEX('\\''\'),HEX('\''\\');
HEX('\\''\') HEX('\''\\')
5C27E05C E05C275C
SELECT HEX(BINARY('\')),HEX(BINARY('\t'));
HEX(BINARY('\')) HEX(BINARY('\t'))
E05C E05C74
SELECT HEX(BINARY('\\\')),HEX(BINARY('\\\t')),HEX(BINARY('\\\t\t'));
HEX(BINARY('\\\')) HEX(BINARY('\\\t')) HEX(BINARY('\\\t\t'))
5CE05C 5CE05C74 5CE05C7409
SELECT HEX(BINARY('''\')),HEX(BINARY('\'''));
HEX(BINARY('''\')) HEX(BINARY('\'''))
27E05C E05C27
SELECT HEX(BINARY('\\''\')),HEX(BINARY('\''\\'));
HEX(BINARY('\\''\')) HEX(BINARY('\''\\'))
5C27E05C E05C275C
SELECT HEX(_BINARY'\'),HEX(_BINARY'\t');
HEX(_BINARY'\') HEX(_BINARY'\t')
E05C E05C74
SELECT HEX(_BINARY'\\\'),HEX(_BINARY'\\\t'),HEX(_BINARY'\\\t\t');
HEX(_BINARY'\\\') HEX(_BINARY'\\\t') HEX(_BINARY'\\\t\t')
5CE05C 5CE05C74 5CE05C7409
SELECT HEX(_BINARY'''\'),HEX(_BINARY'\''');
HEX(_BINARY'''\') HEX(_BINARY'\''')
27E05C E05C27
SELECT HEX(_BINARY'\\''\'),HEX(_BINARY'\''\\');
HEX(_BINARY'\\''\') HEX(_BINARY'\''\\')
5C27E05C E05C275C
CREATE TABLE t1 AS SELECT REPEAT(' ',10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET big5 NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('\'),('\t');
INSERT INTO t1 VALUES ('\\\'),('\\\t'),('\\\t\t');
INSERT INTO t1 VALUES ('''\'),('\''');
INSERT INTO t1 VALUES ('\\''\'),('\''\\');
SELECT a, HEX(a) FROM t1;
a HEX(a)
\ E05C
\t E05C74
\\ 5CE05C
\\t 5CE05C74
\\t 5CE05C7409
'\ 27E05C
\' E05C27
\'\ 5C27E05C
\'\ E05C275C
DROP TABLE t1;
CREATE TABLE t1 (a BLOB);
INSERT INTO t1 VALUES ('\'),('\t');
INSERT INTO t1 VALUES ('\\\'),('\\\t'),('\\\t\t');
INSERT INTO t1 VALUES ('''\'),('\''');
INSERT INTO t1 VALUES ('\\''\'),('\''\\');
SELECT a, HEX(a) FROM t1;
a HEX(a)
\ E05C
\t E05C74
\\ 5CE05C
\\t 5CE05C74
\\t 5CE05C7409
'\ 27E05C
\' E05C27
\'\ 5C27E05C
\'\ E05C275C
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET big5 NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (BINARY('\')),(BINARY('\t'));
INSERT INTO t1 VALUES (BINARY('\\\')),(BINARY('\\\t')),(BINARY('\\\t\t'));
INSERT INTO t1 VALUES (BINARY('''\')),(BINARY('\'''));
INSERT INTO t1 VALUES (BINARY('\\''\')),(BINARY('\''\\'));
SELECT a, HEX(a) FROM t1;
a HEX(a)
\ E05C
\t E05C74
\\ 5CE05C
\\t 5CE05C74
\\t 5CE05C7409
'\ 27E05C
\' E05C27
\'\ 5C27E05C
\'\ E05C275C
DROP TABLE t1;
CREATE TABLE t1 (a BLOB);
INSERT INTO t1 VALUES (BINARY('\')),(BINARY('\t'));
INSERT INTO t1 VALUES (BINARY('\\\')),(BINARY('\\\t')),(BINARY('\\\t\t'));
INSERT INTO t1 VALUES (BINARY('''\')),(BINARY('\'''));
INSERT INTO t1 VALUES (BINARY('\\''\')),(BINARY('\''\\'));
SELECT a, HEX(a) FROM t1;
a HEX(a)
\ E05C
\t E05C74
\\ 5CE05C
\\t 5CE05C74
\\t 5CE05C7409
'\ 27E05C
\' E05C27
\'\ 5C27E05C
\'\ E05C275C
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET big5 NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (_BINARY'\'),(_BINARY'\t');
INSERT INTO t1 VALUES (_BINARY'\\\'),(_BINARY'\\\t'),(_BINARY'\\\t\t');
INSERT INTO t1 VALUES (_BINARY'''\'),(_BINARY'\''');
INSERT INTO t1 VALUES (_BINARY'\\''\'),(_BINARY'\''\\');
SELECT a, HEX(a) FROM t1;
a HEX(a)
\ E05C
\t E05C74
\\ 5CE05C
\\t 5CE05C74
\\t 5CE05C7409
'\ 27E05C
\' E05C27
\'\ 5C27E05C
\'\ E05C275C
DROP TABLE t1;
CREATE TABLE t1 (a BLOB);
INSERT INTO t1 VALUES (_BINARY'\'),(_BINARY'\t');
INSERT INTO t1 VALUES (_BINARY'\\\'),(_BINARY'\\\t'),(_BINARY'\\\t\t');
INSERT INTO t1 VALUES (_BINARY'''\'),(_BINARY'\''');
INSERT INTO t1 VALUES (_BINARY'\\''\'),(_BINARY'\''\\');
SELECT a, HEX(a) FROM t1;
a HEX(a)
\ E05C
\t E05C74
\\ 5CE05C
\\t 5CE05C74
\\t 5CE05C7409
'\ 27E05C
\' E05C27
\'\ 5C27E05C
\'\ E05C275C
DROP TABLE t1;
SET character_set_client=binary, character_set_results=binary;
SELECT @@character_set_client, @@character_set_connection, @@character_set_results;
@@character_set_client @@character_set_connection @@character_set_results
binary big5 binary
SELECT HEX('\['), HEX('\\[');
HEX('\[') HEX('\\[')
E05B E05B
CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET big5 NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('\['),('\\[');
SELECT HEX(a) FROM t1;
HEX(a)
E05B
E05B
DROP TABLE t1;
# Start of ctype_E05C.inc
SET NAMES big5;
CREATE TABLE t1 (a ENUM('@') CHARACTER SET big5);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` enum('?') CHARACTER SET big5 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('@');
INSERT INTO t1 VALUES (_big5 0xC840);
INSERT INTO t1 VALUES (0xC840);
SELECT HEX(a),a FROM t1;
HEX(a) a
C840 @
C840 @
C840 @
DROP TABLE t1;
SET NAMES binary;
CREATE TABLE t1 (a ENUM('@') CHARACTER SET big5);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` enum('?') CHARACTER SET big5 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('@');
INSERT INTO t1 VALUES (_big5 0xC840);
INSERT INTO t1 VALUES (0xC840);
SELECT HEX(a),a FROM t1;
HEX(a) a
C840 @
C840 @
C840 @
DROP TABLE t1;
SET NAMES big5;
CREATE TABLE t1 (
c1 CHAR(10) CHARACTER SET big5,
c2 VARCHAR(10) CHARACTER SET big5,
c3 TEXT CHARACTER SET big5
);
INSERT INTO t1 VALUES ('@','@','@');
INSERT INTO t1 VALUES (_big5 0xC840,_big5 0xC840,_big5 0xC840);
INSERT INTO t1 VALUES (0xC840,0xC840,0xC840);
SELECT HEX(c1),HEX(c2),HEX(c3) FROM t1;
HEX(c1) HEX(c2) HEX(c3)
C840 C840 C840
C840 C840 C840
C840 C840 C840
DROP TABLE t1;
SET NAMES binary;
CREATE TABLE t1 (
c1 CHAR(10) CHARACTER SET big5,
c2 VARCHAR(10) CHARACTER SET big5,
c3 TEXT CHARACTER SET big5
);
INSERT INTO t1 VALUES ('@','@','@');
INSERT INTO t1 VALUES (_big5 0xC840,_big5 0xC840,_big5 0xC840);
INSERT INTO t1 VALUES (0xC840,0xC840,0xC840);
SELECT HEX(c1),HEX(c2),HEX(c3) FROM t1;
HEX(c1) HEX(c2) HEX(c3)
C840 C840 C840
C840 C840 C840
C840 C840 C840
DROP TABLE t1;
SET NAMES binary;
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET big5, KEY(a));
INSERT INTO t1 VALUES (0xC840),(0xC841),(0xC842);
SELECT HEX(a) FROM t1 WHERE a='@';
HEX(a)
C840
SELECT HEX(a) FROM t1 IGNORE KEY(a) WHERE a='@';
HEX(a)
C840
DROP TABLE t1;
#
# End of 10.0 tests
#
......@@ -20060,3 +20060,184 @@ hex(weight_string(cast(0x814081408140 as char),25, 4, 0xC0))
#
# End of 5.6 tests
#
#
# Start of 10.0 tests
#
SET NAMES cp932;
# Start of ctype_E05C.inc
SELECT HEX('à\'),HEX('à\t');
HEX('à\') HEX('à\t')
E05C E05C74
SELECT HEX('\\à\'),HEX('\\à\t'),HEX('\\à\t\t');
HEX('\\à\') HEX('\\à\t') HEX('\\à\t\t')
5CE05C 5CE05C74 5CE05C7409
SELECT HEX('''à\'),HEX('à\''');
HEX('''à\') HEX('à\''')
27E05C E05C27
SELECT HEX('\\''à\'),HEX('à\''\\');
HEX('\\''à\') HEX('à\''\\')
5C27E05C E05C275C
SELECT HEX(BINARY('à\')),HEX(BINARY('à\t'));
HEX(BINARY('à\')) HEX(BINARY('à\t'))
E05C E05C74
SELECT HEX(BINARY('\\à\')),HEX(BINARY('\\à\t')),HEX(BINARY('\\à\t\t'));
HEX(BINARY('\\à\')) HEX(BINARY('\\à\t')) HEX(BINARY('\\à\t\t'))
5CE05C 5CE05C74 5CE05C7409
SELECT HEX(BINARY('''à\')),HEX(BINARY('à\'''));
HEX(BINARY('''à\')) HEX(BINARY('à\'''))
27E05C E05C27
SELECT HEX(BINARY('\\''à\')),HEX(BINARY('à\''\\'));
HEX(BINARY('\\''à\')) HEX(BINARY('à\''\\'))
5C27E05C E05C275C
SELECT HEX(_BINARY'à\'),HEX(_BINARY'à\t');
HEX(_BINARY'à\') HEX(_BINARY'à\t')
E05C E05C74
SELECT HEX(_BINARY'\\à\'),HEX(_BINARY'\\à\t'),HEX(_BINARY'\\à\t\t');
HEX(_BINARY'\\à\') HEX(_BINARY'\\à\t') HEX(_BINARY'\\à\t\t')
5CE05C 5CE05C74 5CE05C7409
SELECT HEX(_BINARY'''à\'),HEX(_BINARY'à\''');
HEX(_BINARY'''à\') HEX(_BINARY'à\''')
27E05C E05C27
SELECT HEX(_BINARY'\\''à\'),HEX(_BINARY'à\''\\');
HEX(_BINARY'\\''à\') HEX(_BINARY'à\''\\')
5C27E05C E05C275C
CREATE TABLE t1 AS SELECT REPEAT(' ',10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET cp932 NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('à\'),('à\t');
INSERT INTO t1 VALUES ('\\à\'),('\\à\t'),('\\à\t\t');
INSERT INTO t1 VALUES ('''à\'),('à\''');
INSERT INTO t1 VALUES ('\\''à\'),('à\''\\');
SELECT a, HEX(a) FROM t1;
a HEX(a)
à\ E05C
à\t E05C74
\à\ 5CE05C
\à\t 5CE05C74
\à\t 5CE05C7409
'à\ 27E05C
à\' E05C27
\'à\ 5C27E05C
à\'\ E05C275C
DROP TABLE t1;
CREATE TABLE t1 (a BLOB);
INSERT INTO t1 VALUES ('à\'),('à\t');
INSERT INTO t1 VALUES ('\\à\'),('\\à\t'),('\\à\t\t');
INSERT INTO t1 VALUES ('''à\'),('à\''');
INSERT INTO t1 VALUES ('\\''à\'),('à\''\\');
SELECT a, HEX(a) FROM t1;
a HEX(a)
à\ E05C
à\t E05C74
\à\ 5CE05C
\à\t 5CE05C74
\à\t 5CE05C7409
'à\ 27E05C
à\' E05C27
\'à\ 5C27E05C
à\'\ E05C275C
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET cp932 NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (BINARY('à\')),(BINARY('à\t'));
INSERT INTO t1 VALUES (BINARY('\\à\')),(BINARY('\\à\t')),(BINARY('\\à\t\t'));
INSERT INTO t1 VALUES (BINARY('''à\')),(BINARY('à\'''));
INSERT INTO t1 VALUES (BINARY('\\''à\')),(BINARY('à\''\\'));
SELECT a, HEX(a) FROM t1;
a HEX(a)
à\ E05C
à\t E05C74
\à\ 5CE05C
\à\t 5CE05C74
\à\t 5CE05C7409
'à\ 27E05C
à\' E05C27
\'à\ 5C27E05C
à\'\ E05C275C
DROP TABLE t1;
CREATE TABLE t1 (a BLOB);
INSERT INTO t1 VALUES (BINARY('à\')),(BINARY('à\t'));
INSERT INTO t1 VALUES (BINARY('\\à\')),(BINARY('\\à\t')),(BINARY('\\à\t\t'));
INSERT INTO t1 VALUES (BINARY('''à\')),(BINARY('à\'''));
INSERT INTO t1 VALUES (BINARY('\\''à\')),(BINARY('à\''\\'));
SELECT a, HEX(a) FROM t1;
a HEX(a)
à\ E05C
à\t E05C74
\à\ 5CE05C
\à\t 5CE05C74
\à\t 5CE05C7409
'à\ 27E05C
à\' E05C27
\'à\ 5C27E05C
à\'\ E05C275C
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET cp932 NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (_BINARY'à\'),(_BINARY'à\t');
INSERT INTO t1 VALUES (_BINARY'\\à\'),(_BINARY'\\à\t'),(_BINARY'\\à\t\t');
INSERT INTO t1 VALUES (_BINARY'''à\'),(_BINARY'à\''');
INSERT INTO t1 VALUES (_BINARY'\\''à\'),(_BINARY'à\''\\');
SELECT a, HEX(a) FROM t1;
a HEX(a)
à\ E05C
à\t E05C74
\à\ 5CE05C
\à\t 5CE05C74
\à\t 5CE05C7409
'à\ 27E05C
à\' E05C27
\'à\ 5C27E05C
à\'\ E05C275C
DROP TABLE t1;
CREATE TABLE t1 (a BLOB);
INSERT INTO t1 VALUES (_BINARY'à\'),(_BINARY'à\t');
INSERT INTO t1 VALUES (_BINARY'\\à\'),(_BINARY'\\à\t'),(_BINARY'\\à\t\t');
INSERT INTO t1 VALUES (_BINARY'''à\'),(_BINARY'à\''');
INSERT INTO t1 VALUES (_BINARY'\\''à\'),(_BINARY'à\''\\');
SELECT a, HEX(a) FROM t1;
a HEX(a)
à\ E05C
à\t E05C74
\à\ 5CE05C
\à\t 5CE05C74
\à\t 5CE05C7409
'à\ 27E05C
à\' E05C27
\'à\ 5C27E05C
à\'\ E05C275C
DROP TABLE t1;
SET character_set_client=binary, character_set_results=binary;
SELECT @@character_set_client, @@character_set_connection, @@character_set_results;
@@character_set_client @@character_set_connection @@character_set_results
binary cp932 binary
SELECT HEX('à\['), HEX('\à\[');
HEX('à\[') HEX('\à\[')
E05B E05B
CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET cp932 NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('à\['),('\à\[');
SELECT HEX(a) FROM t1;
HEX(a)
E05B
E05B
DROP TABLE t1;
# Start of ctype_E05C.inc
#
# End of 10.0 tests
#
......@@ -4748,6 +4748,181 @@ DROP FUNCTION mysql_real_escape_string_generated;
DROP FUNCTION iswellformed;
DROP TABLE allbytes;
# End of ctype_backslash.inc
SET NAMES gbk;
# Start of ctype_E05C.inc
SELECT HEX('\'),HEX('\t');
HEX('\') HEX('\t')
E05C E05C74
SELECT HEX('\\\'),HEX('\\\t'),HEX('\\\t\t');
HEX('\\\') HEX('\\\t') HEX('\\\t\t')
5CE05C 5CE05C74 5CE05C7409
SELECT HEX('''\'),HEX('\''');
HEX('''\') HEX('\''')
27E05C E05C27
SELECT HEX('\\''\'),HEX('\''\\');
HEX('\\''\') HEX('\''\\')
5C27E05C E05C275C
SELECT HEX(BINARY('\')),HEX(BINARY('\t'));
HEX(BINARY('\')) HEX(BINARY('\t'))
E05C E05C74
SELECT HEX(BINARY('\\\')),HEX(BINARY('\\\t')),HEX(BINARY('\\\t\t'));
HEX(BINARY('\\\')) HEX(BINARY('\\\t')) HEX(BINARY('\\\t\t'))
5CE05C 5CE05C74 5CE05C7409
SELECT HEX(BINARY('''\')),HEX(BINARY('\'''));
HEX(BINARY('''\')) HEX(BINARY('\'''))
27E05C E05C27
SELECT HEX(BINARY('\\''\')),HEX(BINARY('\''\\'));
HEX(BINARY('\\''\')) HEX(BINARY('\''\\'))
5C27E05C E05C275C
SELECT HEX(_BINARY'\'),HEX(_BINARY'\t');
HEX(_BINARY'\') HEX(_BINARY'\t')
E05C E05C74
SELECT HEX(_BINARY'\\\'),HEX(_BINARY'\\\t'),HEX(_BINARY'\\\t\t');
HEX(_BINARY'\\\') HEX(_BINARY'\\\t') HEX(_BINARY'\\\t\t')
5CE05C 5CE05C74 5CE05C7409
SELECT HEX(_BINARY'''\'),HEX(_BINARY'\''');
HEX(_BINARY'''\') HEX(_BINARY'\''')
27E05C E05C27
SELECT HEX(_BINARY'\\''\'),HEX(_BINARY'\''\\');
HEX(_BINARY'\\''\') HEX(_BINARY'\''\\')
5C27E05C E05C275C
CREATE TABLE t1 AS SELECT REPEAT(' ',10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET gbk NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('\'),('\t');
INSERT INTO t1 VALUES ('\\\'),('\\\t'),('\\\t\t');
INSERT INTO t1 VALUES ('''\'),('\''');
INSERT INTO t1 VALUES ('\\''\'),('\''\\');
SELECT a, HEX(a) FROM t1;
a HEX(a)
\ E05C
\t E05C74
\\ 5CE05C
\\t 5CE05C74
\\t 5CE05C7409
'\ 27E05C
\' E05C27
\'\ 5C27E05C
\'\ E05C275C
DROP TABLE t1;
CREATE TABLE t1 (a BLOB);
INSERT INTO t1 VALUES ('\'),('\t');
INSERT INTO t1 VALUES ('\\\'),('\\\t'),('\\\t\t');
INSERT INTO t1 VALUES ('''\'),('\''');
INSERT INTO t1 VALUES ('\\''\'),('\''\\');
SELECT a, HEX(a) FROM t1;
a HEX(a)
\ E05C
\t E05C74
\\ 5CE05C
\\t 5CE05C74
\\t 5CE05C7409
'\ 27E05C
\' E05C27
\'\ 5C27E05C
\'\ E05C275C
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET gbk NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (BINARY('\')),(BINARY('\t'));
INSERT INTO t1 VALUES (BINARY('\\\')),(BINARY('\\\t')),(BINARY('\\\t\t'));
INSERT INTO t1 VALUES (BINARY('''\')),(BINARY('\'''));
INSERT INTO t1 VALUES (BINARY('\\''\')),(BINARY('\''\\'));
SELECT a, HEX(a) FROM t1;
a HEX(a)
\ E05C
\t E05C74
\\ 5CE05C
\\t 5CE05C74
\\t 5CE05C7409
'\ 27E05C
\' E05C27
\'\ 5C27E05C
\'\ E05C275C
DROP TABLE t1;
CREATE TABLE t1 (a BLOB);
INSERT INTO t1 VALUES (BINARY('\')),(BINARY('\t'));
INSERT INTO t1 VALUES (BINARY('\\\')),(BINARY('\\\t')),(BINARY('\\\t\t'));
INSERT INTO t1 VALUES (BINARY('''\')),(BINARY('\'''));
INSERT INTO t1 VALUES (BINARY('\\''\')),(BINARY('\''\\'));
SELECT a, HEX(a) FROM t1;
a HEX(a)
\ E05C
\t E05C74
\\ 5CE05C
\\t 5CE05C74
\\t 5CE05C7409
'\ 27E05C
\' E05C27
\'\ 5C27E05C
\'\ E05C275C
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET gbk NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (_BINARY'\'),(_BINARY'\t');
INSERT INTO t1 VALUES (_BINARY'\\\'),(_BINARY'\\\t'),(_BINARY'\\\t\t');
INSERT INTO t1 VALUES (_BINARY'''\'),(_BINARY'\''');
INSERT INTO t1 VALUES (_BINARY'\\''\'),(_BINARY'\''\\');
SELECT a, HEX(a) FROM t1;
a HEX(a)
\ E05C
\t E05C74
\\ 5CE05C
\\t 5CE05C74
\\t 5CE05C7409
'\ 27E05C
\' E05C27
\'\ 5C27E05C
\'\ E05C275C
DROP TABLE t1;
CREATE TABLE t1 (a BLOB);
INSERT INTO t1 VALUES (_BINARY'\'),(_BINARY'\t');
INSERT INTO t1 VALUES (_BINARY'\\\'),(_BINARY'\\\t'),(_BINARY'\\\t\t');
INSERT INTO t1 VALUES (_BINARY'''\'),(_BINARY'\''');
INSERT INTO t1 VALUES (_BINARY'\\''\'),(_BINARY'\''\\');
SELECT a, HEX(a) FROM t1;
a HEX(a)
\ E05C
\t E05C74
\\ 5CE05C
\\t 5CE05C74
\\t 5CE05C7409
'\ 27E05C
\' E05C27
\'\ 5C27E05C
\'\ E05C275C
DROP TABLE t1;
SET character_set_client=binary, character_set_results=binary;
SELECT @@character_set_client, @@character_set_connection, @@character_set_results;
@@character_set_client @@character_set_connection @@character_set_results
binary gbk binary
SELECT HEX('\['), HEX('\\[');
HEX('\[') HEX('\\[')
E05B E05B
CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET gbk NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('\['),('\\[');
SELECT HEX(a) FROM t1;
HEX(a)
E05B
E05B
DROP TABLE t1;
# Start of ctype_E05C.inc
#
# End of 10.0 tests
#
......@@ -18311,6 +18311,181 @@ DROP FUNCTION mysql_real_escape_string_generated;
DROP FUNCTION iswellformed;
DROP TABLE allbytes;
# End of ctype_backslash.inc
SET NAMES sjis;
# Start of ctype_E05C.inc
SELECT HEX('\'),HEX('\t');
HEX('\') HEX('\t')
E05C E05C74
SELECT HEX('\\\'),HEX('\\\t'),HEX('\\\t\t');
HEX('__\') HEX('__\t') HEX('__\t_t')
5CE05C 5CE05C74 5CE05C7409
SELECT HEX('''\'),HEX('\''');
HEX('''\') HEX('\''')
27E05C E05C27
SELECT HEX('\\''\'),HEX('\''\\');
HEX('__''\') HEX('\''__')
5C27E05C E05C275C
SELECT HEX(BINARY('\')),HEX(BINARY('\t'));
HEX(BINARY('\')) HEX(BINARY('\t'))
E05C E05C74
SELECT HEX(BINARY('\\\')),HEX(BINARY('\\\t')),HEX(BINARY('\\\t\t'));
HEX(BINARY('__\')) HEX(BINARY('__\t')) HEX(BINARY('__\t_t'))
5CE05C 5CE05C74 5CE05C7409
SELECT HEX(BINARY('''\')),HEX(BINARY('\'''));
HEX(BINARY('''\')) HEX(BINARY('\'''))
27E05C E05C27
SELECT HEX(BINARY('\\''\')),HEX(BINARY('\''\\'));
HEX(BINARY('__''\')) HEX(BINARY('\''__'))
5C27E05C E05C275C
SELECT HEX(_BINARY'\'),HEX(_BINARY'\t');
HEX(_BINARY'\') HEX(_BINARY'\t')
E05C E05C74
SELECT HEX(_BINARY'\\\'),HEX(_BINARY'\\\t'),HEX(_BINARY'\\\t\t');
HEX(_BINARY'__\') HEX(_BINARY'__\t') HEX(_BINARY'__\t_t')
5CE05C 5CE05C74 5CE05C7409
SELECT HEX(_BINARY'''\'),HEX(_BINARY'\''');
HEX(_BINARY'''\') HEX(_BINARY'\''')
27E05C E05C27
SELECT HEX(_BINARY'\\''\'),HEX(_BINARY'\''\\');
HEX(_BINARY'__''\') HEX(_BINARY'\''__')
5C27E05C E05C275C
CREATE TABLE t1 AS SELECT REPEAT(' ',10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET sjis NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('\'),('\t');
INSERT INTO t1 VALUES ('\\\'),('\\\t'),('\\\t\t');
INSERT INTO t1 VALUES ('''\'),('\''');
INSERT INTO t1 VALUES ('\\''\'),('\''\\');
SELECT a, HEX(a) FROM t1;
a HEX(a)
\ E05C
\t E05C74
\\ 5CE05C
\\t 5CE05C74
\\t 5CE05C7409
'\ 27E05C
\' E05C27
\'\ 5C27E05C
\'\ E05C275C
DROP TABLE t1;
CREATE TABLE t1 (a BLOB);
INSERT INTO t1 VALUES ('\'),('\t');
INSERT INTO t1 VALUES ('\\\'),('\\\t'),('\\\t\t');
INSERT INTO t1 VALUES ('''\'),('\''');
INSERT INTO t1 VALUES ('\\''\'),('\''\\');
SELECT a, HEX(a) FROM t1;
a HEX(a)
\ E05C
\t E05C74
\\ 5CE05C
\\t 5CE05C74
\\t 5CE05C7409
'\ 27E05C
\' E05C27
\'\ 5C27E05C
\'\ E05C275C
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET sjis NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (BINARY('\')),(BINARY('\t'));
INSERT INTO t1 VALUES (BINARY('\\\')),(BINARY('\\\t')),(BINARY('\\\t\t'));
INSERT INTO t1 VALUES (BINARY('''\')),(BINARY('\'''));
INSERT INTO t1 VALUES (BINARY('\\''\')),(BINARY('\''\\'));
SELECT a, HEX(a) FROM t1;
a HEX(a)
\ E05C
\t E05C74
\\ 5CE05C
\\t 5CE05C74
\\t 5CE05C7409
'\ 27E05C
\' E05C27
\'\ 5C27E05C
\'\ E05C275C
DROP TABLE t1;
CREATE TABLE t1 (a BLOB);
INSERT INTO t1 VALUES (BINARY('\')),(BINARY('\t'));
INSERT INTO t1 VALUES (BINARY('\\\')),(BINARY('\\\t')),(BINARY('\\\t\t'));
INSERT INTO t1 VALUES (BINARY('''\')),(BINARY('\'''));
INSERT INTO t1 VALUES (BINARY('\\''\')),(BINARY('\''\\'));
SELECT a, HEX(a) FROM t1;
a HEX(a)
\ E05C
\t E05C74
\\ 5CE05C
\\t 5CE05C74
\\t 5CE05C7409
'\ 27E05C
\' E05C27
\'\ 5C27E05C
\'\ E05C275C
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET sjis NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (_BINARY'\'),(_BINARY'\t');
INSERT INTO t1 VALUES (_BINARY'\\\'),(_BINARY'\\\t'),(_BINARY'\\\t\t');
INSERT INTO t1 VALUES (_BINARY'''\'),(_BINARY'\''');
INSERT INTO t1 VALUES (_BINARY'\\''\'),(_BINARY'\''\\');
SELECT a, HEX(a) FROM t1;
a HEX(a)
\ E05C
\t E05C74
\\ 5CE05C
\\t 5CE05C74
\\t 5CE05C7409
'\ 27E05C
\' E05C27
\'\ 5C27E05C
\'\ E05C275C
DROP TABLE t1;
CREATE TABLE t1 (a BLOB);
INSERT INTO t1 VALUES (_BINARY'\'),(_BINARY'\t');
INSERT INTO t1 VALUES (_BINARY'\\\'),(_BINARY'\\\t'),(_BINARY'\\\t\t');
INSERT INTO t1 VALUES (_BINARY'''\'),(_BINARY'\''');
INSERT INTO t1 VALUES (_BINARY'\\''\'),(_BINARY'\''\\');
SELECT a, HEX(a) FROM t1;
a HEX(a)
\ E05C
\t E05C74
\\ 5CE05C
\\t 5CE05C74
\\t 5CE05C7409
'\ 27E05C
\' E05C27
\'\ 5C27E05C
\'\ E05C275C
DROP TABLE t1;
SET character_set_client=binary, character_set_results=binary;
SELECT @@character_set_client, @@character_set_connection, @@character_set_results;
@@character_set_client @@character_set_connection @@character_set_results
binary sjis binary
SELECT HEX('\['), HEX('\\[');
HEX('\[') HEX('\\[')
E05B E05B
CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET sjis NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('\['),('\\[');
SELECT HEX(a) FROM t1;
HEX(a)
E05B
E05B
DROP TABLE t1;
# Start of ctype_E05C.inc
#
# End of 10.0 tests
#
......@@ -177,6 +177,73 @@ set collation_connection=big5_bin;
let $ctype_unescape_combinations=selected;
--source include/ctype_unescape.inc
--character_set big5
SET NAMES big5;
--source include/ctype_E05C.inc
#
# Checking unassigned character 0xC840 in an ENUM
#
SET NAMES big5;
CREATE TABLE t1 (a ENUM('@') CHARACTER SET big5);
SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES ('@');
INSERT INTO t1 VALUES (_big5 0xC840);
INSERT INTO t1 VALUES (0xC840);
SELECT HEX(a),a FROM t1;
DROP TABLE t1;
SET NAMES binary;
CREATE TABLE t1 (a ENUM('@') CHARACTER SET big5);
SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES ('@');
INSERT INTO t1 VALUES (_big5 0xC840);
INSERT INTO t1 VALUES (0xC840);
SELECT HEX(a),a FROM t1;
DROP TABLE t1;
#
# Checking unassigned character in CHAR, VARCHAR, TEXT
#
SET NAMES big5;
CREATE TABLE t1 (
c1 CHAR(10) CHARACTER SET big5,
c2 VARCHAR(10) CHARACTER SET big5,
c3 TEXT CHARACTER SET big5
);
INSERT INTO t1 VALUES ('@','@','@');
INSERT INTO t1 VALUES (_big5 0xC840,_big5 0xC840,_big5 0xC840);
INSERT INTO t1 VALUES (0xC840,0xC840,0xC840);
SELECT HEX(c1),HEX(c2),HEX(c3) FROM t1;
DROP TABLE t1;
SET NAMES binary;
CREATE TABLE t1 (
c1 CHAR(10) CHARACTER SET big5,
c2 VARCHAR(10) CHARACTER SET big5,
c3 TEXT CHARACTER SET big5
);
INSERT INTO t1 VALUES ('@','@','@');
INSERT INTO t1 VALUES (_big5 0xC840,_big5 0xC840,_big5 0xC840);
INSERT INTO t1 VALUES (0xC840,0xC840,0xC840);
SELECT HEX(c1),HEX(c2),HEX(c3) FROM t1;
DROP TABLE t1;
#
# Checking binary->big5 conversion of an unassigned character 0xC840 in optimizer
#
SET NAMES binary;
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET big5, KEY(a));
INSERT INTO t1 VALUES (0xC840),(0xC841),(0xC842);
SELECT HEX(a) FROM t1 WHERE a='@';
SELECT HEX(a) FROM t1 IGNORE KEY(a) WHERE a='@';
DROP TABLE t1;
--echo #
--echo # End of 10.0 tests
--echo #
......@@ -185,3 +185,14 @@ set collation_connection=cp932_bin;
--echo #
--echo # End of 5.6 tests
--echo #
--echo #
--echo # Start of 10.0 tests
--echo #
SET NAMES cp932;
--source include/ctype_E05C.inc
--echo #
--echo # End of 10.0 tests
--echo #
......@@ -195,6 +195,11 @@ set collation_connection=gbk_bin;
let $ctype_unescape_combinations=selected;
--source include/ctype_unescape.inc
--character_set gbk
SET NAMES gbk;
--source include/ctype_E05C.inc
--echo #
--echo # End of 10.0 tests
--echo #
......@@ -223,6 +223,11 @@ set collation_connection=sjis_bin;
let $ctype_unescape_combinations=selected;
--source include/ctype_unescape.inc
--character_set sjis
SET NAMES sjis;
--source include/ctype_E05C.inc
--echo #
--echo # End of 10.0 tests
--echo #
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment