Commit 6a576f1a authored by Alexander Barkov's avatar Alexander Barkov

Adding thorough tests covering what happens with escaped sequences

in the SQL parser.

Various backslash escapes and quote-quote escaped sequences are covered
in combination with single and multi-byte characters.

This is especially important for the character sets that can have 0x5C
as the second byte in a multi-byte character (big5, cp932, gbk, sjis).

swe7 is also a special character set, because in swe7 0x5C is used for
both escape character and for "LATIN CAPITAL LETTER O WITH DIAERESIS".
parent d2ae40ac
#
# Create a table with all byte values
#
CREATE TABLE halfs (a INT);
INSERT INTO halfs VALUES (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07);
INSERT INTO halfs VALUES (0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F);
CREATE TEMPORARY TABLE bytes (a BINARY(1), KEY(a)) ENGINE=MyISAM;
INSERT INTO bytes SELECT CHAR((t1.a << 4) | t2.a USING BINARY) FROM halfs t1, halfs t2;
DROP TABLE halfs;
#
# Create a table with all 2 byte sequence values
#
--source include/bytes.inc
CREATE TABLE halfs (a BINARY(1));
# "bytes" is a temporary table, hence is not allowed in joins
# Create a non-temporary copy.
INSERT INTO halfs SELECT * FROM bytes;
CREATE TEMPORARY TABLE bytes2 (
a BINARY(2),
hi BINARY(1),
lo BINARY(1),
KEY(a),
KEY(lo)
) ENGINE=MyISAM;
INSERT INTO bytes2
SELECT CONCAT(t1.a, t2.a), t1.a, t2.a FROM halfs t1, halfs t2
ORDER BY t1.a, t2.a;
DROP TABLE halfs;
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -169,3 +169,14 @@ set collation_connection=big5_bin;
--echo #
--echo # End of 5.6 tests
--echo #
--echo #
--echo # Start of 10.0 tests
--echo #
let $ctype_unescape_combinations=selected;
--source include/ctype_unescape.inc
--echo #
--echo # End of 10.0 tests
--echo #
......@@ -149,3 +149,14 @@ set collation_connection=gb2312_bin;
--echo #
--echo # End of 5.6 tests
--echo #
--echo #
--echo # Start of 10.0 tests
--echo #
let $ctype_unescape_combinations=selected;
--source include/ctype_unescape.inc
--echo #
--echo # End of 10.0 tests
--echo #
......@@ -187,3 +187,14 @@ set collation_connection=gbk_bin;
--echo #
--echo # End of 5.6 tests
--echo #
--echo #
--echo # Start of 10.0 tests
--echo #
let $ctype_unescape_combinations=selected;
--source include/ctype_unescape.inc
--echo #
--echo # End of 10.0 tests
--echo #
......@@ -202,3 +202,14 @@ set names latin1;
--echo #
--echo # End of 5.6 tests
--echo #
--echo #
--echo # Start of 10.0 tests
--echo #
let $ctype_unescape_combinations=selected;
--source include/ctype_unescape.inc
--echo #
--echo # End of 10.0 tests
--echo #
......@@ -215,3 +215,14 @@ set collation_connection=sjis_bin;
--echo #
--echo # End of 5.6 tests
--echo #
--echo #
--echo # Start of 10.0 tests
--echo #
let $ctype_unescape_combinations=selected;
--source include/ctype_unescape.inc
--echo #
--echo # End of 10.0 tests
--echo #
--echo #
--echo # Start of 10.0 tests
--echo #
let $ctype_unescape_combinations=selected;
--source include/ctype_unescape.inc
--echo #
--echo # End of 10.0 tests
--echo #
......@@ -1738,6 +1738,9 @@ DEALLOCATE PREPARE stmt;
DROP TABLE t1;
let $ctype_unescape_combinations=selected;
--source include/ctype_unescape.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