Commit a3bd38d6 authored by Alexander Barkov's avatar Alexander Barkov

Adding tests for handling 0x5C as the second byte in a multi-byte sequence,

and as a escape character when
SET NAMES xxx, character_set_connection=binary;
for cp932,big5,gbk,sjis
parent 504c6ccc
......@@ -90,5 +90,22 @@ INSERT INTO t1 VALUES ('
SELECT HEX(a) FROM t1;
DROP TABLE t1;
#
# Checking the other way around:
# 0x5C in 0xE05C is treated as the second byte
# when character_set_client=big5,cp932,gbk,sjis
# and character_set_connection=binary
#
SET character_set_client=@@character_set_connection, character_set_results=@@character_set_connection;
SET character_set_connection=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
......@@ -4548,6 +4548,26 @@ HEX(a)
E05B
E05B
DROP TABLE t1;
SET character_set_client=@@character_set_connection, character_set_results=@@character_set_connection;
SET character_set_connection=binary;
SELECT @@character_set_client, @@character_set_connection, @@character_set_results;
@@character_set_client @@character_set_connection @@character_set_results
big5 binary big5
SELECT HEX('\['), HEX('\\[');
HEX('\[') HEX('\\[')
E05C5B E05B
CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varbinary(10) NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('\['),('\\[');
SELECT HEX(a) FROM t1;
HEX(a)
E05C5B
E05B
DROP TABLE t1;
# Start of ctype_E05C.inc
SET NAMES big5;
CREATE TABLE t1 (a ENUM('@') CHARACTER SET big5);
......
......@@ -20237,6 +20237,26 @@ HEX(a)
E05B
E05B
DROP TABLE t1;
SET character_set_client=@@character_set_connection, character_set_results=@@character_set_connection;
SET character_set_connection=binary;
SELECT @@character_set_client, @@character_set_connection, @@character_set_results;
@@character_set_client @@character_set_connection @@character_set_results
cp932 binary cp932
SELECT HEX('à\['), HEX('\à\[');
HEX('à\[') HEX('\à\[')
E05C5B E05B
CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varbinary(10) NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('à\['),('\à\[');
SELECT HEX(a) FROM t1;
HEX(a)
E05C5B
E05B
DROP TABLE t1;
# Start of ctype_E05C.inc
#
# End of 10.0 tests
......
......@@ -4922,6 +4922,26 @@ HEX(a)
E05B
E05B
DROP TABLE t1;
SET character_set_client=@@character_set_connection, character_set_results=@@character_set_connection;
SET character_set_connection=binary;
SELECT @@character_set_client, @@character_set_connection, @@character_set_results;
@@character_set_client @@character_set_connection @@character_set_results
gbk binary gbk
SELECT HEX('\['), HEX('\\[');
HEX('\[') HEX('\\[')
E05C5B E05B
CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varbinary(10) NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('\['),('\\[');
SELECT HEX(a) FROM t1;
HEX(a)
E05C5B
E05B
DROP TABLE t1;
# Start of ctype_E05C.inc
#
# End of 10.0 tests
......
......@@ -18485,6 +18485,26 @@ HEX(a)
E05B
E05B
DROP TABLE t1;
SET character_set_client=@@character_set_connection, character_set_results=@@character_set_connection;
SET character_set_connection=binary;
SELECT @@character_set_client, @@character_set_connection, @@character_set_results;
@@character_set_client @@character_set_connection @@character_set_results
sjis binary sjis
SELECT HEX('\['), HEX('\\[');
HEX('\[') HEX('_\[')
E05C5B E05B
CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varbinary(10) NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('\['),('\\[');
SELECT HEX(a) FROM t1;
HEX(a)
E05C5B
E05B
DROP TABLE t1;
# Start of ctype_E05C.inc
#
# End of 10.0 tests
......
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