-- source include/have_gb18030.inc

SET NAMES utf8mb4;
SET collation_connection='gb18030_unicode_520_ci';

--disable_warnings
CREATE TABLE t1(C CHAR(10) CHARACTER SET gb18030 COLLATE gb18030_unicode_520_ci, UNIQUE KEY(c));
--enable_warnings

INSERT INTO t1 VALUES(CONVERT(_ucs2 0x0149 USING gb18030));
INSERT INTO t1 VALUES(CONVERT(_ucs2 0x01F0 USING gb18030));
INSERT INTO t1 VALUES(CONVERT(_ucs2 0x0390 USING gb18030));
INSERT INTO t1 VALUES(CONVERT(_ucs2 0x03B0 USING gb18030));
INSERT INTO t1 VALUES(CONVERT(_ucs2 0x0587 USING gb18030));
INSERT INTO t1 VALUES(CONVERT(_ucs2 0x1E96 USING gb18030));
INSERT INTO t1 VALUES(CONVERT(_ucs2 0x1E97 USING gb18030));
INSERT INTO t1 VALUES(CONVERT(_ucs2 0x1E98 USING gb18030));
INSERT INTO t1 VALUES(CONVERT(_ucs2 0x1E99 USING gb18030));
INSERT INTO t1 VALUES(CONVERT(_ucs2 0x1E9A USING gb18030));
INSERT INTO t1 VALUES(CONVERT(_ucs2 0x1FB2 USING gb18030));
INSERT INTO t1 VALUES(CONVERT(_ucs2 0x1FC2 USING gb18030));
INSERT INTO t1 VALUES(CONVERT(_ucs2 0x1FE4 USING gb18030));
INSERT INTO t1 VALUES(CONVERT(_ucs2 0x1FF2 USING gb18030));
INSERT INTO t1 VALUES(CONVERT(_ucs2 0xFB00 USING gb18030));
INSERT INTO t1 VALUES(CONVERT(_ucs2 0xFB01 USING gb18030));
INSERT INTO t1 VALUES(CONVERT(_ucs2 0xFB02 USING gb18030));
INSERT INTO t1 VALUES(CONVERT(_ucs2 0xFB03 USING gb18030));
INSERT INTO t1 VALUES(CONVERT(_ucs2 0xFB04 USING gb18030));
INSERT INTO t1 VALUES(CONVERT(_ucs2 0xFB05 USING gb18030));
INSERT INTO t1 VALUES(CONVERT(_ucs2 0xFB13 USING gb18030));
INSERT INTO t1 VALUES(CONVERT(_ucs2 0xFB14 USING gb18030));
INSERT INTO t1 VALUES(CONVERT(_ucs2 0xFB15 USING gb18030));
INSERT INTO t1 VALUES(CONVERT(_ucs2 0xFB16 USING gb18030));
INSERT INTO t1 VALUES(CONVERT(_ucs2 0xFB17 USING gb18030));
INSERT INTO t1 VALUES(CONVERT(_ucs2 0x00DF USING gb18030));

SELECT * FROM t1;
SELECT COUNT(*) FROM t1;

# Start to insert duplicate keys

#0149
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x02BC USING gb18030), CONVERT(_ucs2 0x004E USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x02BC USING gb18030), CONVERT(_ucs2 0x006E USING gb18030)));

#01F0
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x004A USING gb18030), CONVERT(_ucs2 0x030C USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x006A USING gb18030), CONVERT(_ucs2 0x030C USING gb18030)));

#0390
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0399 USING gb18030), CONVERT(_ucs2 0x0308 USING gb18030), CONVERT(_ucs2 0x0301 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x03B9 USING gb18030), CONVERT(_ucs2 0x0308 USING gb18030), CONVERT(_ucs2 0x0301 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONVERT(_ucs2 0x1FD3 USING gb18030));

#03B0
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x03A5 USING gb18030), CONVERT(_ucs2 0x0308 USING gb18030), CONVERT(_ucs2 0x0301 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x03C5 USING gb18030), CONVERT(_ucs2 0x0308 USING gb18030), CONVERT(_ucs2 0x0301 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONVERT(_ucs2 0x1FE3 USING gb18030));

#0587
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0535 USING gb18030), CONVERT(_ucs2 0x0552 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0565 USING gb18030), CONVERT(_ucs2 0x0552 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0535 USING gb18030), CONVERT(_ucs2 0x0582 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0565 USING gb18030), CONVERT(_ucs2 0x0582 USING gb18030)));

#1E96
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0048 USING gb18030), CONVERT(_ucs2 0x0331 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0068 USING gb18030), CONVERT(_ucs2 0x0331 USING gb18030)));

#1E97
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0054 USING gb18030), CONVERT(_ucs2 0x0308 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0074 USING gb18030), CONVERT(_ucs2 0x0308 USING gb18030)));

#1E98
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0057 USING gb18030), CONVERT(_ucs2 0x030A USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0077 USING gb18030), CONVERT(_ucs2 0x030A USING gb18030)));

#1E99
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0059 USING gb18030), CONVERT(_ucs2 0x030A USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0079 USING gb18030), CONVERT(_ucs2 0x030A USING gb18030)));

#1E9A
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0041 USING gb18030), CONVERT(_ucs2 0x02BE USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0061 USING gb18030), CONVERT(_ucs2 0x02BE USING gb18030)));

#1F50
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x03A5 USING gb18030), CONVERT(_ucs2 0x0313 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x03C5 USING gb18030), CONVERT(_ucs2 0x0313 USING gb18030)));

#1F52
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x03A5 USING gb18030), CONVERT(_ucs2 0x0313 USING gb18030), CONVERT(_ucs2 0x0300 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x03C5 USING gb18030), CONVERT(_ucs2 0x0313 USING gb18030), CONVERT(_ucs2 0x0300 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x1F50 USING gb18030), CONVERT(_ucs2 0x0300 USING gb18030)));

#1F54
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x03A5 USING gb18030), CONVERT(_ucs2 0x0313 USING gb18030), CONVERT(_ucs2 0x0301 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x03C5 USING gb18030), CONVERT(_ucs2 0x0313 USING gb18030), CONVERT(_ucs2 0x0301 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x1F50 USING gb18030), CONVERT(_ucs2 0x0301 USING gb18030)));

#1F56
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x03A5 USING gb18030), CONVERT(_ucs2 0x0313 USING gb18030), CONVERT(_ucs2 0x0342 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x03C5 USING gb18030), CONVERT(_ucs2 0x0313 USING gb18030), CONVERT(_ucs2 0x0342 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x1F50 USING gb18030), CONVERT(_ucs2 0x0342 USING gb18030)));

#1FD2
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0399 USING gb18030), CONVERT(_ucs2 0x0308 USING gb18030), CONVERT(_ucs2 0x0300 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x03B9 USING gb18030), CONVERT(_ucs2 0x0308 USING gb18030), CONVERT(_ucs2 0x0300 USING gb18030)));

#1FD3
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0399 USING gb18030), CONVERT(_ucs2 0x0308 USING gb18030), CONVERT(_ucs2 0x0301 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x03B9 USING gb18030), CONVERT(_ucs2 0x0308 USING gb18030), CONVERT(_ucs2 0x0301 USING gb18030)));

#1FD6
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0399 USING gb18030), CONVERT(_ucs2 0x0342 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x03B9 USING gb18030), CONVERT(_ucs2 0x0342 USING gb18030)));

#1FD7
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0399 USING gb18030), CONVERT(_ucs2 0x0308 USING gb18030), CONVERT(_ucs2 0x0342 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x03B9 USING gb18030), CONVERT(_ucs2 0x0308 USING gb18030), CONVERT(_ucs2 0x0342 USING gb18030)));

#1FE2
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x03A5 USING gb18030), CONVERT(_ucs2 0x0308 USING gb18030), CONVERT(_ucs2 0x0300 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x03C5 USING gb18030), CONVERT(_ucs2 0x0308 USING gb18030), CONVERT(_ucs2 0x0300 USING gb18030)));

#1FE3
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x03A5 USING gb18030), CONVERT(_ucs2 0x0308 USING gb18030), CONVERT(_ucs2 0x0301 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x03C5 USING gb18030), CONVERT(_ucs2 0x0308 USING gb18030), CONVERT(_ucs2 0x0301 USING gb18030)));

#1FE4
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x03A1 USING gb18030), CONVERT(_ucs2 0x0313 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x03C1 USING gb18030), CONVERT(_ucs2 0x0313 USING gb18030)));

#1FE6
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x03A5 USING gb18030), CONVERT(_ucs2 0x0342 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x03C5 USING gb18030), CONVERT(_ucs2 0x0342 USING gb18030)));

#1FE7
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x03A5 USING gb18030), CONVERT(_ucs2 0x0308 USING gb18030), CONVERT(_ucs2 0x0342 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x03C5 USING gb18030), CONVERT(_ucs2 0x0308 USING gb18030), CONVERT(_ucs2 0x0342 USING gb18030)));

#FB00
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0046 USING gb18030), CONVERT(_ucs2 0x0046 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0046 USING gb18030), CONVERT(_ucs2 0x0066 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0066 USING gb18030), CONVERT(_ucs2 0x0046 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0066 USING gb18030), CONVERT(_ucs2 0x0066 USING gb18030)));

#FB01
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0046 USING gb18030), CONVERT(_ucs2 0x0049 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0046 USING gb18030), CONVERT(_ucs2 0x0069 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0066 USING gb18030), CONVERT(_ucs2 0x0049 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0066 USING gb18030), CONVERT(_ucs2 0x0069 USING gb18030)));

#FB02
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0046 USING gb18030), CONVERT(_ucs2 0x004C USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0046 USING gb18030), CONVERT(_ucs2 0x006C USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0066 USING gb18030), CONVERT(_ucs2 0x004C USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0066 USING gb18030), CONVERT(_ucs2 0x006C USING gb18030)));

#FB03
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0046 USING gb18030), CONVERT(_ucs2 0x0046 USING gb18030), CONVERT(_ucs2 0x0049 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0046 USING gb18030), CONVERT(_ucs2 0x0066 USING gb18030), CONVERT(_ucs2 0x0049 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0066 USING gb18030), CONVERT(_ucs2 0x0046 USING gb18030), CONVERT(_ucs2 0x0049 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0066 USING gb18030), CONVERT(_ucs2 0x0066 USING gb18030), CONVERT(_ucs2 0x0049 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0xFB00 USING gb18030), CONVERT(_ucs2 0x0049 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0046 USING gb18030), CONVERT(_ucs2 0x0046 USING gb18030), CONVERT(_ucs2 0x0069 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0046 USING gb18030), CONVERT(_ucs2 0x0066 USING gb18030), CONVERT(_ucs2 0x0069 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0066 USING gb18030), CONVERT(_ucs2 0x0046 USING gb18030), CONVERT(_ucs2 0x0069 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0066 USING gb18030), CONVERT(_ucs2 0x0066 USING gb18030), CONVERT(_ucs2 0x0069 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0xFB00 USING gb18030), CONVERT(_ucs2 0x0069 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0046 USING gb18030), CONVERT(_ucs2 0xFB01 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0066 USING gb18030), CONVERT(_ucs2 0xFB01 USING gb18030)));


#FB04
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0046 USING gb18030), CONVERT(_ucs2 0x0046 USING gb18030), CONVERT(_ucs2 0x004C USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0046 USING gb18030), CONVERT(_ucs2 0x0066 USING gb18030), CONVERT(_ucs2 0x004C USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0066 USING gb18030), CONVERT(_ucs2 0x0046 USING gb18030), CONVERT(_ucs2 0x004C USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0066 USING gb18030), CONVERT(_ucs2 0x0066 USING gb18030), CONVERT(_ucs2 0x004C USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0xFB00 USING gb18030), CONVERT(_ucs2 0x004C USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0046 USING gb18030), CONVERT(_ucs2 0x0046 USING gb18030), CONVERT(_ucs2 0x006C USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0046 USING gb18030), CONVERT(_ucs2 0x0066 USING gb18030), CONVERT(_ucs2 0x006C USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0066 USING gb18030), CONVERT(_ucs2 0x0046 USING gb18030), CONVERT(_ucs2 0x006C USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0066 USING gb18030), CONVERT(_ucs2 0x0066 USING gb18030), CONVERT(_ucs2 0x006C USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0xFB00 USING gb18030), CONVERT(_ucs2 0x006C USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0046 USING gb18030), CONVERT(_ucs2 0xFB02 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0066 USING gb18030), CONVERT(_ucs2 0xFB02 USING gb18030)));

#FB05
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0053 USING gb18030), CONVERT(_ucs2 0x0054 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0053 USING gb18030), CONVERT(_ucs2 0x0074 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0073 USING gb18030), CONVERT(_ucs2 0x0054 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0073 USING gb18030), CONVERT(_ucs2 0x0074 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONVERT(_ucs2 0xFB06 USING gb18030));

#FB13
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0544 USING gb18030), CONVERT(_ucs2 0x0546 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0544 USING gb18030), CONVERT(_ucs2 0x0576 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0574 USING gb18030), CONVERT(_ucs2 0x0546 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0574 USING gb18030), CONVERT(_ucs2 0x0576 USING gb18030)));

#FB14
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0544 USING gb18030), CONVERT(_ucs2 0x0535 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0544 USING gb18030), CONVERT(_ucs2 0x0565 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0574 USING gb18030), CONVERT(_ucs2 0x0535 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0574 USING gb18030), CONVERT(_ucs2 0x0565 USING gb18030)));

#FB15
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0544 USING gb18030), CONVERT(_ucs2 0x053B USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0544 USING gb18030), CONVERT(_ucs2 0x056B USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0574 USING gb18030), CONVERT(_ucs2 0x053B USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0574 USING gb18030), CONVERT(_ucs2 0x056B USING gb18030)));

#FB16
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x054E USING gb18030), CONVERT(_ucs2 0x0546 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x054E USING gb18030), CONVERT(_ucs2 0x0576 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x057E USING gb18030), CONVERT(_ucs2 0x0546 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x057E USING gb18030), CONVERT(_ucs2 0x0576 USING gb18030)));

#FB17
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0544 USING gb18030), CONVERT(_ucs2 0x053D USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0544 USING gb18030), CONVERT(_ucs2 0x056D USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0574 USING gb18030), CONVERT(_ucs2 0x053D USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0574 USING gb18030), CONVERT(_ucs2 0x056D USING gb18030)));

#00DF
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0053 USING gb18030), CONVERT(_ucs2 0x0053 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0053 USING gb18030), CONVERT(_ucs2 0x0073 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0073 USING gb18030), CONVERT(_ucs2 0x0053 USING gb18030)));
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0073 USING gb18030), CONVERT(_ucs2 0x0073 USING gb18030)));

SELECT COUNT(*) FROM t1;

DROP TABLE t1;

CREATE TABLE t1 (c1 CHAR(20), c2 CHAR(20)) CHARACTER SET gb18030 COLLATE gb18030_unicode_520_ci;
INSERT INTO t1 VALUES(CONVERT(_ucs2 0x005300DF00DF00DF00DF00DF00DF USING gb18030), CONVERT(_ucs2 0x00DF00DF00DF00DF00DF00DF0053 USING gb18030));
SELECT * FROM t1 WHERE c1 = c2;
DROP TABLE t1;

# Test for comparison and like

CREATE TABLE t1 (c CHAR(10), KEY(c)) CHARACTER SET gb18030 COLLATE gb18030_unicode_520_ci;

INSERT INTO t1 VALUES(CONVERT(_ucs2 0xFB00 USING gb18030));
INSERT INTO t1 VALUES(CONVERT(_ucs2 0xFB01 USING gb18030));
INSERT INTO t1 VALUES(CONVERT(_ucs2 0xFB02 USING gb18030));
INSERT INTO t1 VALUES(CONVERT(_ucs2 0xFB03 USING gb18030));
INSERT INTO t1 VALUES(CONVERT(_ucs2 0xFB04 USING gb18030));
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0066 USING gb18030), CONVERT(_ucs2 0x0046 USING gb18030)));
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0066 USING gb18030), CONVERT(_ucs2 0x0066 USING gb18030)));
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0046 USING gb18030), CONVERT(_ucs2 0x0069 USING gb18030)));
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0066 USING gb18030), CONVERT(_ucs2 0x0049 USING gb18030)));
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0066 USING gb18030), CONVERT(_ucs2 0x0066 USING gb18030), CONVERT(_ucs2 0x0069 USING gb18030)));
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0xFB00 USING gb18030), CONVERT(_ucs2 0x0069 USING gb18030)));
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0046 USING gb18030), CONVERT(_ucs2 0xFB01 USING gb18030)));
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0066 USING gb18030), CONVERT(_ucs2 0xFB01 USING gb18030)));
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0046 USING gb18030), CONVERT(_ucs2 0x0046 USING gb18030), CONVERT(_ucs2 0x0049 USING gb18030)));
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0046 USING gb18030), CONVERT(_ucs2 0x0066 USING gb18030), CONVERT(_ucs2 0x0049 USING gb18030)));
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0066 USING gb18030), CONVERT(_ucs2 0x0066 USING gb18030), CONVERT(_ucs2 0x006C USING gb18030)));
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0xFB00 USING gb18030), CONVERT(_ucs2 0x006C USING gb18030)));
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0046 USING gb18030), CONVERT(_ucs2 0xFB02 USING gb18030)));
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0046 USING gb18030), CONVERT(_ucs2 0x0046 USING gb18030), CONVERT(_ucs2 0x004C USING gb18030)));
INSERT INTO t1 VALUES(CONCAT(CONVERT(_ucs2 0x0046 USING gb18030), CONVERT(_ucs2 0x0066 USING gb18030), CONVERT(_ucs2 0x004C USING gb18030)));

SELECT c, hex(c) FROM t1 ORDER BY c ASC;
SELECT c, hex(c) FROM t1 ORDER BY c DESC;

SELECT c, hex(c) FROM t1 WHERE c = 'FFI';
SELECT c, hex(c) FROM t1 WHERE c > 'FFI';
SELECT c, hex(c) FROM t1 WHERE c > 'FF';
SELECT c, hex(c) FROM t1 WHERE c <= 'FFL' AND c > 'FF';
SELECT c, hex(c) FROM t1 WHERE c LIKE 'FF%';
SELECT c, hex(c) FROM t1 WHERE c LIKE '%L';

DROP TABLE t1;

