-- source include/have_ujis.inc

#
# Tests with the ujis character set
#
--disable_warnings
drop table if exists t1;
--enable_warnings

set names ujis;

#
# Test problem with LEFT()
#

create table t1 (c text character set ujis);
insert into t1 values (0xa4a2),(0xa4a3);
select hex(left(c,1)) from t1 group by c;
drop table t1;

#
#
#
select locate(0xa2a1,0xa1a2a1a3);
select locate(_ujis 0xa2a1,_ujis 0xa1a2a1a3);
select locate(_ujis 0xa2a1,_ujis 0xa1a2a1a3 collate ujis_bin);
select locate('he','hello');
select locate('he','hello',2);
select locate('lo','hello',2);
select locate('HE','hello');
select locate('HE','hello',2);
select locate('LO','hello',2);
select locate('HE','hello' collate ujis_bin);
select locate('HE','hello' collate ujis_bin,2);
select locate('LO','hello' collate ujis_bin,2);
select locate(_ujis 0xa1a3,_ujis 0xa1a2a1a3);

select 0xa1a2a1a3 like concat(_binary'%',0xa2a1,_binary'%');
select _ujis 0xa1a2a1a3 like concat(_ujis'%',_ujis 0xa2a1, _ujis'%');
select _ujis 0xa1a2a1a3 like concat(_ujis'%',_ujis 0xa2a1, _ujis'%') collate ujis_bin;
select 'a' like 'a';
select 'A' like 'a';
select 'A' like 'a' collate ujis_bin;

#
# Bug 3290: Hald-width Katakana conversion problem.
# Check ujis-utf8-ujis round trip.
#
set @ujis1= _ujis     0x8EA18EA28EA38EA48EA58EA68EA78EA88EA98EAA8EAB8EAC8EAD8EAE8EAF;
set @ujis2= _ujis 0x8EB08EB18EB28EB38EB48EB58EB68EB78EB88EB98EBA8EBB8EBC8EBD8EBE8EBF;
set @ujis3= _ujis 0x8EC08EC18EC28EC38EC48EC58EC68EC78EC88EC98ECA8ECB8ECC8ECD8ECE8ECF;
set @ujis4= _ujis 0x8ED08ED18ED28ED38ED48ED58ED68ED78ED88ED98EDA8EDB8EDC8EDD8EDE8EDF;

select hex(@utf81:= CONVERT(@ujis1 USING utf8));
select hex(@utf82:= CONVERT(@ujis2 USING utf8));
select hex(@utf83:= CONVERT(@ujis3 USING utf8));
select hex(@utf84:= CONVERT(@ujis4 USING utf8));

select @ujis1 = CONVERT(@utf81 USING ujis);
select @ujis2 = CONVERT(@utf82 USING ujis);
select @ujis3 = CONVERT(@utf83 USING ujis);
select @ujis4 = CONVERT(@utf84 USING ujis);

#
# Testing with '%' and index (Bug #3438)
#

drop table if exists t1;
create table t1 (c1 varchar(8)) default character set 'ujis';
insert into t1 values (0xA4A2),(0xA2A2),(0xA4A2);
select c1 as 'no index' from t1 where c1 like cast(concat(0xA4A2, '%') as char character set ujis);
create index idx_c1 on t1(c1);
select c1 as 'using index' from t1 where c1 like cast(concat(0xA4A2, '%') as char character set ujis);
select c1 as 'no index' from t1 where c1 like cast(concat('%',0xA4A2, '%') as char character set ujis);
drop table t1;


# Bug 2077
CREATE TABLE t1 (
  a char(1) NOT NULL default '',
  b enum('¤¢','¤¤') default NULL
) CHARACTER SET ujis;
SHOW CREATE TABLE t1;
SHOW COLUMNS FROM t1;
DROP TABLE t1;

#
# Bug #6345 Unexpected behaviour with partial indices
#
--disable_warnings
CREATE TABLE t1
(
  a INTEGER NOT NULL,
  b VARCHAR(50) NOT NULL DEFAULT '',
  PRIMARY KEY  (a),
  KEY b (b(10))
) ENGINE=InnoDB CHARACTER SET 'ujis' COLLATE 'ujis_japanese_ci';
--enable_warnings
INSERT INTO t1 (a, b) VALUES (0, 'aaabbbcccddd');
INSERT INTO t1 (a, b) VALUES (1, 'eeefffggghhh');
INSERT INTO t1 (a, b) VALUES (2, 'iiijjjkkkl');
SELECT t1.* FROM t1 WHERE b='aaabbbcccddd' ORDER BY a;
SELECT t1.* FROM t1 WHERE b='eeefffggghhh' ORDER BY a;
SELECT t1.* FROM t1 WHERE b='iiijjjkkkl'   ORDER BY a;
DROP TABLE t1;
--disable_warnings
CREATE TABLE t1
(
  a INTEGER NOT NULL,
  b VARCHAR(50) NOT NULL DEFAULT '',
  PRIMARY KEY  (a),
  KEY b (b(10))
) ENGINE=MyISAM CHARACTER SET 'ujis' COLLATE 'ujis_japanese_ci';
--enable_warnings
INSERT INTO t1 (a, b) VALUES (0, 'aaabbbcccddd');
INSERT INTO t1 (a, b) VALUES (1, 'eeefffggghhh');
INSERT INTO t1 (a, b) VALUES (2, 'iiijjjkkkl');
SELECT t1.* FROM t1 WHERE b='aaabbbcccddd' ORDER BY a;
SELECT t1.* FROM t1 WHERE b='eeefffggghhh' ORDER BY a;
SELECT t1.* FROM t1 WHERE b='iiijjjkkkl'   ORDER BY a;
DROP TABLE t1;

DROP TABLE IF EXISTS t1;
CREATE TABLE t1(c char(1)) character set ujis;
INSERT INTO t1 VALUES(0xA2AF);
INSERT INTO t1 VALUES(0xA2B0);
INSERT INTO t1 VALUES(0xA2B1);
INSERT INTO t1 VALUES(0xA2B2);
INSERT INTO t1 VALUES(0xA2B3);
INSERT INTO t1 VALUES(0xA2B4);
INSERT INTO t1 VALUES(0xA2B5);
INSERT INTO t1 VALUES(0xA2B6);
INSERT INTO t1 VALUES(0xA2B7);
INSERT INTO t1 VALUES(0xA2B8);
INSERT INTO t1 VALUES(0xA2B9);
INSERT INTO t1 VALUES(0xA2C2);
INSERT INTO t1 VALUES(0xA2C3);
INSERT INTO t1 VALUES(0xA2C4);
INSERT INTO t1 VALUES(0xA2C5);
INSERT INTO t1 VALUES(0xA2C6);
INSERT INTO t1 VALUES(0xA2C7);
INSERT INTO t1 VALUES(0xA2C8);
INSERT INTO t1 VALUES(0xA2C9);
INSERT INTO t1 VALUES(0xA2D1);
INSERT INTO t1 VALUES(0xA2D2);
INSERT INTO t1 VALUES(0xA2D3);
INSERT INTO t1 VALUES(0xA2D4);
INSERT INTO t1 VALUES(0xA2D5);
INSERT INTO t1 VALUES(0xA2D6);
INSERT INTO t1 VALUES(0xA2D7);
INSERT INTO t1 VALUES(0xA2D8);
INSERT INTO t1 VALUES(0xA2D9);
INSERT INTO t1 VALUES(0xA2DA);
INSERT INTO t1 VALUES(0xA2DB);
INSERT INTO t1 VALUES(0xA2EB);
INSERT INTO t1 VALUES(0xA2EC);
INSERT INTO t1 VALUES(0xA2ED);
INSERT INTO t1 VALUES(0xA2EE);
INSERT INTO t1 VALUES(0xA2EF);
INSERT INTO t1 VALUES(0xA2F0);
INSERT INTO t1 VALUES(0xA2F1);
INSERT INTO t1 VALUES(0xA2FA);
INSERT INTO t1 VALUES(0xA2FB);
INSERT INTO t1 VALUES(0xA2FC);
INSERT INTO t1 VALUES(0xA2FD);
INSERT INTO t1 VALUES(0xA3A1);
INSERT INTO t1 VALUES(0xA3A2);
INSERT INTO t1 VALUES(0xA3A3);
INSERT INTO t1 VALUES(0xA3A4);
INSERT INTO t1 VALUES(0xA3A5);
INSERT INTO t1 VALUES(0xA3A6);
INSERT INTO t1 VALUES(0xA3A7);
INSERT INTO t1 VALUES(0xA3A8);
INSERT INTO t1 VALUES(0xA3A9);
INSERT INTO t1 VALUES(0xA3AA);
INSERT INTO t1 VALUES(0xA3AB);
INSERT INTO t1 VALUES(0xA3AC);
INSERT INTO t1 VALUES(0xA3AD);
INSERT INTO t1 VALUES(0xA3AE);
INSERT INTO t1 VALUES(0xA3AF);
INSERT INTO t1 VALUES(0xA3BA);
INSERT INTO t1 VALUES(0xA3BB);
INSERT INTO t1 VALUES(0xA3BC);
INSERT INTO t1 VALUES(0xA3BD);
INSERT INTO t1 VALUES(0xA3BE);
INSERT INTO t1 VALUES(0xA3BF);
INSERT INTO t1 VALUES(0xA3C0);
INSERT INTO t1 VALUES(0xA3DB);
INSERT INTO t1 VALUES(0xA3DC);
INSERT INTO t1 VALUES(0xA3DD);
INSERT INTO t1 VALUES(0xA3DE);
INSERT INTO t1 VALUES(0xA3DF);
INSERT INTO t1 VALUES(0xA3E0);
INSERT INTO t1 VALUES(0xA3FB);
INSERT INTO t1 VALUES(0xA3FC);
INSERT INTO t1 VALUES(0xA3FD);
INSERT INTO t1 VALUES(0xA3FE);
INSERT INTO t1 VALUES(0xA4F4);
INSERT INTO t1 VALUES(0xA4F5);
INSERT INTO t1 VALUES(0xA4F6);
INSERT INTO t1 VALUES(0xA4F7);
INSERT INTO t1 VALUES(0xA4F8);
INSERT INTO t1 VALUES(0xA4F9);
INSERT INTO t1 VALUES(0xA4FA);
INSERT INTO t1 VALUES(0xA4FB);
INSERT INTO t1 VALUES(0xA4FC);
INSERT INTO t1 VALUES(0xA4FD);
INSERT INTO t1 VALUES(0xA4FE);
INSERT INTO t1 VALUES(0xA5F7);
INSERT INTO t1 VALUES(0xA5F8);
INSERT INTO t1 VALUES(0xA5F9);
INSERT INTO t1 VALUES(0xA5FA);
INSERT INTO t1 VALUES(0xA5FB);
INSERT INTO t1 VALUES(0xA5FC);
INSERT INTO t1 VALUES(0xA5FD);
INSERT INTO t1 VALUES(0xA5FE);
INSERT INTO t1 VALUES(0xA6B9);
INSERT INTO t1 VALUES(0xA6BA);
INSERT INTO t1 VALUES(0xA6BB);
INSERT INTO t1 VALUES(0xA6BC);
INSERT INTO t1 VALUES(0xA6BD);
INSERT INTO t1 VALUES(0xA6BE);
INSERT INTO t1 VALUES(0xA6BF);
INSERT INTO t1 VALUES(0xA6C0);
INSERT INTO t1 VALUES(0xA6D9);
INSERT INTO t1 VALUES(0xA6DA);
INSERT INTO t1 VALUES(0xA6DB);
INSERT INTO t1 VALUES(0xA6DC);
INSERT INTO t1 VALUES(0xA6DD);
INSERT INTO t1 VALUES(0xA6DE);
INSERT INTO t1 VALUES(0xA6DF);
INSERT INTO t1 VALUES(0xA6E0);
INSERT INTO t1 VALUES(0xA6E1);
INSERT INTO t1 VALUES(0xA6E2);
INSERT INTO t1 VALUES(0xA6E3);
INSERT INTO t1 VALUES(0xA6E4);
INSERT INTO t1 VALUES(0xA6E5);
INSERT INTO t1 VALUES(0xA6E6);
INSERT INTO t1 VALUES(0xA6E7);
INSERT INTO t1 VALUES(0xA6E8);
INSERT INTO t1 VALUES(0xA6E9);
INSERT INTO t1 VALUES(0xA6EA);
INSERT INTO t1 VALUES(0xA6EB);
INSERT INTO t1 VALUES(0xA6EC);
INSERT INTO t1 VALUES(0xA6ED);
INSERT INTO t1 VALUES(0xA6EE);
INSERT INTO t1 VALUES(0xA6EF);
INSERT INTO t1 VALUES(0xA6F0);
INSERT INTO t1 VALUES(0xA6F1);
INSERT INTO t1 VALUES(0xA6F2);
INSERT INTO t1 VALUES(0xA6F3);
INSERT INTO t1 VALUES(0xA6F4);
INSERT INTO t1 VALUES(0xA6F5);
INSERT INTO t1 VALUES(0xA6F6);
INSERT INTO t1 VALUES(0xA6F7);
INSERT INTO t1 VALUES(0xA6F8);
INSERT INTO t1 VALUES(0xA6F9);
INSERT INTO t1 VALUES(0xA6FA);
INSERT INTO t1 VALUES(0xA6FB);
INSERT INTO t1 VALUES(0xA6FC);
INSERT INTO t1 VALUES(0xA6FD);
INSERT INTO t1 VALUES(0xA6FE);
INSERT INTO t1 VALUES(0xA7C2);
INSERT INTO t1 VALUES(0xA7C3);
INSERT INTO t1 VALUES(0xA7C4);
INSERT INTO t1 VALUES(0xA7C5);
INSERT INTO t1 VALUES(0xA7C6);
INSERT INTO t1 VALUES(0xA7C7);
INSERT INTO t1 VALUES(0xA7C8);
INSERT INTO t1 VALUES(0xA7C9);
INSERT INTO t1 VALUES(0xA7CA);
INSERT INTO t1 VALUES(0xA7CB);
INSERT INTO t1 VALUES(0xA7CC);
INSERT INTO t1 VALUES(0xA7CD);
INSERT INTO t1 VALUES(0xA7CE);
INSERT INTO t1 VALUES(0xA7CF);
INSERT INTO t1 VALUES(0xA7D0);
INSERT INTO t1 VALUES(0xA7F2);
INSERT INTO t1 VALUES(0xA7F3);
INSERT INTO t1 VALUES(0xA7F4);
INSERT INTO t1 VALUES(0xA7F5);
INSERT INTO t1 VALUES(0xA7F6);
INSERT INTO t1 VALUES(0xA7F7);
INSERT INTO t1 VALUES(0xA7F8);
INSERT INTO t1 VALUES(0xA7F9);
INSERT INTO t1 VALUES(0xA7FA);
INSERT INTO t1 VALUES(0xA7FB);
INSERT INTO t1 VALUES(0xA7FC);
INSERT INTO t1 VALUES(0xA7FD);
INSERT INTO t1 VALUES(0xA7FE);
INSERT INTO t1 VALUES(0xA8C1);
INSERT INTO t1 VALUES(0xA8C2);
INSERT INTO t1 VALUES(0xA8C3);
INSERT INTO t1 VALUES(0xA8C4);
INSERT INTO t1 VALUES(0xA8C5);
INSERT INTO t1 VALUES(0xA8C6);
INSERT INTO t1 VALUES(0xA8C7);
INSERT INTO t1 VALUES(0xA8C8);
INSERT INTO t1 VALUES(0xA8C9);
INSERT INTO t1 VALUES(0xA8CA);
INSERT INTO t1 VALUES(0xA8CB);
INSERT INTO t1 VALUES(0xA8CC);
INSERT INTO t1 VALUES(0xA8CD);
INSERT INTO t1 VALUES(0xA8CE);
INSERT INTO t1 VALUES(0xA8CF);
INSERT INTO t1 VALUES(0xA8D0);
INSERT INTO t1 VALUES(0xA8D1);
INSERT INTO t1 VALUES(0xA8D2);
INSERT INTO t1 VALUES(0xA8D3);
INSERT INTO t1 VALUES(0xA8D4);
INSERT INTO t1 VALUES(0xA8D5);
INSERT INTO t1 VALUES(0xA8D6);
INSERT INTO t1 VALUES(0xA8D7);
INSERT INTO t1 VALUES(0xA8D8);
INSERT INTO t1 VALUES(0xA8D9);
INSERT INTO t1 VALUES(0xA8DA);
INSERT INTO t1 VALUES(0xA8DB);
INSERT INTO t1 VALUES(0xA8DC);
INSERT INTO t1 VALUES(0xA8DD);
INSERT INTO t1 VALUES(0xA8DE);
INSERT INTO t1 VALUES(0xA8DF);
INSERT INTO t1 VALUES(0xA8E0);
INSERT INTO t1 VALUES(0xA8E1);
INSERT INTO t1 VALUES(0xA8E2);
INSERT INTO t1 VALUES(0xA8E3);
INSERT INTO t1 VALUES(0xA8E4);
INSERT INTO t1 VALUES(0xA8E5);
INSERT INTO t1 VALUES(0xA8E6);
INSERT INTO t1 VALUES(0xA8E7);
INSERT INTO t1 VALUES(0xA8E8);
INSERT INTO t1 VALUES(0xA8E9);
INSERT INTO t1 VALUES(0xA8EA);
INSERT INTO t1 VALUES(0xA8EB);
INSERT INTO t1 VALUES(0xA8EC);
INSERT INTO t1 VALUES(0xA8ED);
INSERT INTO t1 VALUES(0xA8EE);
INSERT INTO t1 VALUES(0xA8EF);
INSERT INTO t1 VALUES(0xA8F0);
INSERT INTO t1 VALUES(0xA8F1);
INSERT INTO t1 VALUES(0xA8F2);
INSERT INTO t1 VALUES(0xA8F3);
INSERT INTO t1 VALUES(0xA8F4);
INSERT INTO t1 VALUES(0xA8F5);
INSERT INTO t1 VALUES(0xA8F6);
INSERT INTO t1 VALUES(0xA8F7);
INSERT INTO t1 VALUES(0xA8F8);
INSERT INTO t1 VALUES(0xA8F9);
INSERT INTO t1 VALUES(0xA8FA);
INSERT INTO t1 VALUES(0xA8FB);
INSERT INTO t1 VALUES(0xA8FC);
INSERT INTO t1 VALUES(0xA8FD);
INSERT INTO t1 VALUES(0xA8FE);
INSERT INTO t1 VALUES(0xA9A1);
INSERT INTO t1 VALUES(0xA9A2);
INSERT INTO t1 VALUES(0xA9A3);
INSERT INTO t1 VALUES(0xA9A4);
INSERT INTO t1 VALUES(0xA9A5);
INSERT INTO t1 VALUES(0xA9A6);
INSERT INTO t1 VALUES(0xA9A7);
INSERT INTO t1 VALUES(0xA9A8);
INSERT INTO t1 VALUES(0xA9A9);
INSERT INTO t1 VALUES(0xA9AA);
INSERT INTO t1 VALUES(0xA9AB);
INSERT INTO t1 VALUES(0xA9AC);
INSERT INTO t1 VALUES(0xA9AD);
INSERT INTO t1 VALUES(0xA9AE);
INSERT INTO t1 VALUES(0xA9AF);
INSERT INTO t1 VALUES(0xA9B0);
INSERT INTO t1 VALUES(0xA9B1);
INSERT INTO t1 VALUES(0xA9B2);
INSERT INTO t1 VALUES(0xA9B3);
INSERT INTO t1 VALUES(0xA9B4);
INSERT INTO t1 VALUES(0xA9B5);
INSERT INTO t1 VALUES(0xA9B6);
INSERT INTO t1 VALUES(0xA9B7);
INSERT INTO t1 VALUES(0xA9B8);
INSERT INTO t1 VALUES(0xA9B9);
INSERT INTO t1 VALUES(0xA9BA);
INSERT INTO t1 VALUES(0xA9BB);
INSERT INTO t1 VALUES(0xA9BC);
INSERT INTO t1 VALUES(0xA9BD);
INSERT INTO t1 VALUES(0xA9BE);
INSERT INTO t1 VALUES(0xA9BF);
INSERT INTO t1 VALUES(0xA9C0);
INSERT INTO t1 VALUES(0xA9C1);
INSERT INTO t1 VALUES(0xA9C2);
INSERT INTO t1 VALUES(0xA9C3);
INSERT INTO t1 VALUES(0xA9C4);
INSERT INTO t1 VALUES(0xA9C5);
INSERT INTO t1 VALUES(0xA9C6);
INSERT INTO t1 VALUES(0xA9C7);
INSERT INTO t1 VALUES(0xA9C8);
INSERT INTO t1 VALUES(0xA9C9);
INSERT INTO t1 VALUES(0xA9CA);
INSERT INTO t1 VALUES(0xA9CB);
INSERT INTO t1 VALUES(0xA9CC);
INSERT INTO t1 VALUES(0xA9CD);
INSERT INTO t1 VALUES(0xA9CE);
INSERT INTO t1 VALUES(0xA9CF);
INSERT INTO t1 VALUES(0xA9D0);
INSERT INTO t1 VALUES(0xA9D1);
INSERT INTO t1 VALUES(0xA9D2);
INSERT INTO t1 VALUES(0xA9D3);
INSERT INTO t1 VALUES(0xA9D4);
INSERT INTO t1 VALUES(0xA9D5);
INSERT INTO t1 VALUES(0xA9D6);
INSERT INTO t1 VALUES(0xA9D7);
INSERT INTO t1 VALUES(0xA9D8);
INSERT INTO t1 VALUES(0xA9D9);
INSERT INTO t1 VALUES(0xA9DA);
INSERT INTO t1 VALUES(0xA9DB);
INSERT INTO t1 VALUES(0xA9DC);
INSERT INTO t1 VALUES(0xA9DD);
INSERT INTO t1 VALUES(0xA9DE);
INSERT INTO t1 VALUES(0xA9DF);
INSERT INTO t1 VALUES(0xA9E0);
INSERT INTO t1 VALUES(0xA9E1);
INSERT INTO t1 VALUES(0xA9E2);
INSERT INTO t1 VALUES(0xA9E3);
INSERT INTO t1 VALUES(0xA9E4);
INSERT INTO t1 VALUES(0xA9E5);
INSERT INTO t1 VALUES(0xA9E6);
INSERT INTO t1 VALUES(0xA9E7);
INSERT INTO t1 VALUES(0xA9E8);
INSERT INTO t1 VALUES(0xA9E9);
INSERT INTO t1 VALUES(0xA9EA);
INSERT INTO t1 VALUES(0xA9EB);
INSERT INTO t1 VALUES(0xA9EC);
INSERT INTO t1 VALUES(0xA9ED);
INSERT INTO t1 VALUES(0xA9EE);
INSERT INTO t1 VALUES(0xA9EF);
INSERT INTO t1 VALUES(0xA9F0);
INSERT INTO t1 VALUES(0xA9F1);
INSERT INTO t1 VALUES(0xA9F2);
INSERT INTO t1 VALUES(0xA9F3);
INSERT INTO t1 VALUES(0xA9F4);
INSERT INTO t1 VALUES(0xA9F5);
INSERT INTO t1 VALUES(0xA9F6);
INSERT INTO t1 VALUES(0xA9F7);
INSERT INTO t1 VALUES(0xA9F8);
INSERT INTO t1 VALUES(0xA9F9);
INSERT INTO t1 VALUES(0xA9FA);
INSERT INTO t1 VALUES(0xA9FB);
INSERT INTO t1 VALUES(0xA9FC);
INSERT INTO t1 VALUES(0xA9FD);
INSERT INTO t1 VALUES(0xA9FE);
INSERT INTO t1 VALUES(0xAAA1);
INSERT INTO t1 VALUES(0xAAA2);
INSERT INTO t1 VALUES(0xAAA3);
INSERT INTO t1 VALUES(0xAAA4);
INSERT INTO t1 VALUES(0xAAA5);
INSERT INTO t1 VALUES(0xAAA6);
INSERT INTO t1 VALUES(0xAAA7);
INSERT INTO t1 VALUES(0xAAA8);
INSERT INTO t1 VALUES(0xAAA9);
INSERT INTO t1 VALUES(0xAAAA);
INSERT INTO t1 VALUES(0xAAAB);
INSERT INTO t1 VALUES(0xAAAC);
INSERT INTO t1 VALUES(0xAAAD);
INSERT INTO t1 VALUES(0xAAAE);
INSERT INTO t1 VALUES(0xAAAF);
INSERT INTO t1 VALUES(0xAAB0);
INSERT INTO t1 VALUES(0xAAB1);
INSERT INTO t1 VALUES(0xAAB2);
INSERT INTO t1 VALUES(0xAAB3);
INSERT INTO t1 VALUES(0xAAB4);
INSERT INTO t1 VALUES(0xAAB5);
INSERT INTO t1 VALUES(0xAAB6);
INSERT INTO t1 VALUES(0xAAB7);
INSERT INTO t1 VALUES(0xAAB8);
INSERT INTO t1 VALUES(0xAAB9);
INSERT INTO t1 VALUES(0xAABA);
INSERT INTO t1 VALUES(0xAABB);
INSERT INTO t1 VALUES(0xAABC);
INSERT INTO t1 VALUES(0xAABD);
INSERT INTO t1 VALUES(0xAABE);
INSERT INTO t1 VALUES(0xAABF);
INSERT INTO t1 VALUES(0xAAC0);
INSERT INTO t1 VALUES(0xAAC1);
INSERT INTO t1 VALUES(0xAAC2);
INSERT INTO t1 VALUES(0xAAC3);
INSERT INTO t1 VALUES(0xAAC4);
INSERT INTO t1 VALUES(0xAAC5);
INSERT INTO t1 VALUES(0xAAC6);
INSERT INTO t1 VALUES(0xAAC7);
INSERT INTO t1 VALUES(0xAAC8);
INSERT INTO t1 VALUES(0xAAC9);
INSERT INTO t1 VALUES(0xAACA);
INSERT INTO t1 VALUES(0xAACB);
INSERT INTO t1 VALUES(0xAACC);
INSERT INTO t1 VALUES(0xAACD);
INSERT INTO t1 VALUES(0xAACE);
INSERT INTO t1 VALUES(0xAACF);
INSERT INTO t1 VALUES(0xAAD0);
INSERT INTO t1 VALUES(0xAAD1);
INSERT INTO t1 VALUES(0xAAD2);
INSERT INTO t1 VALUES(0xAAD3);
INSERT INTO t1 VALUES(0xAAD4);
INSERT INTO t1 VALUES(0xAAD5);
INSERT INTO t1 VALUES(0xAAD6);
INSERT INTO t1 VALUES(0xAAD7);
INSERT INTO t1 VALUES(0xAAD8);
INSERT INTO t1 VALUES(0xAAD9);
INSERT INTO t1 VALUES(0xAADA);
INSERT INTO t1 VALUES(0xAADB);
INSERT INTO t1 VALUES(0xAADC);
INSERT INTO t1 VALUES(0xAADD);
INSERT INTO t1 VALUES(0xAADE);
INSERT INTO t1 VALUES(0xAADF);
INSERT INTO t1 VALUES(0xAAE0);
INSERT INTO t1 VALUES(0xAAE1);
INSERT INTO t1 VALUES(0xAAE2);
INSERT INTO t1 VALUES(0xAAE3);
INSERT INTO t1 VALUES(0xAAE4);
INSERT INTO t1 VALUES(0xAAE5);
INSERT INTO t1 VALUES(0xAAE6);
INSERT INTO t1 VALUES(0xAAE7);
INSERT INTO t1 VALUES(0xAAE8);
INSERT INTO t1 VALUES(0xAAE9);
INSERT INTO t1 VALUES(0xAAEA);
INSERT INTO t1 VALUES(0xAAEB);
INSERT INTO t1 VALUES(0xAAEC);
INSERT INTO t1 VALUES(0xAAED);
INSERT INTO t1 VALUES(0xAAEE);
INSERT INTO t1 VALUES(0xAAEF);
INSERT INTO t1 VALUES(0xAAF0);
INSERT INTO t1 VALUES(0xAAF1);
INSERT INTO t1 VALUES(0xAAF2);
INSERT INTO t1 VALUES(0xAAF3);
INSERT INTO t1 VALUES(0xAAF4);
INSERT INTO t1 VALUES(0xAAF5);
INSERT INTO t1 VALUES(0xAAF6);
INSERT INTO t1 VALUES(0xAAF7);
INSERT INTO t1 VALUES(0xAAF8);
INSERT INTO t1 VALUES(0xAAF9);
INSERT INTO t1 VALUES(0xAAFA);
INSERT INTO t1 VALUES(0xAAFB);
INSERT INTO t1 VALUES(0xAAFC);
INSERT INTO t1 VALUES(0xAAFD);
INSERT INTO t1 VALUES(0xAAFE);
INSERT INTO t1 VALUES(0xABA1);
INSERT INTO t1 VALUES(0xABA2);
INSERT INTO t1 VALUES(0xABA3);
INSERT INTO t1 VALUES(0xABA4);
INSERT INTO t1 VALUES(0xABA5);
INSERT INTO t1 VALUES(0xABA6);
INSERT INTO t1 VALUES(0xABA7);
INSERT INTO t1 VALUES(0xABA8);
INSERT INTO t1 VALUES(0xABA9);
INSERT INTO t1 VALUES(0xABAA);
INSERT INTO t1 VALUES(0xABAB);
INSERT INTO t1 VALUES(0xABAC);
INSERT INTO t1 VALUES(0xABAD);
INSERT INTO t1 VALUES(0xABAE);
INSERT INTO t1 VALUES(0xABAF);
INSERT INTO t1 VALUES(0xABB0);
INSERT INTO t1 VALUES(0xABB1);
INSERT INTO t1 VALUES(0xABB2);
INSERT INTO t1 VALUES(0xABB3);
INSERT INTO t1 VALUES(0xABB4);
INSERT INTO t1 VALUES(0xABB5);
INSERT INTO t1 VALUES(0xABB6);
INSERT INTO t1 VALUES(0xABB7);
INSERT INTO t1 VALUES(0xABB8);
INSERT INTO t1 VALUES(0xABB9);
INSERT INTO t1 VALUES(0xABBA);
INSERT INTO t1 VALUES(0xABBB);
INSERT INTO t1 VALUES(0xABBC);
INSERT INTO t1 VALUES(0xABBD);
INSERT INTO t1 VALUES(0xABBE);
INSERT INTO t1 VALUES(0xABBF);
INSERT INTO t1 VALUES(0xABC0);
INSERT INTO t1 VALUES(0xABC1);
INSERT INTO t1 VALUES(0xABC2);
INSERT INTO t1 VALUES(0xABC3);
INSERT INTO t1 VALUES(0xABC4);
INSERT INTO t1 VALUES(0xABC5);
INSERT INTO t1 VALUES(0xABC6);
INSERT INTO t1 VALUES(0xABC7);
INSERT INTO t1 VALUES(0xABC8);
INSERT INTO t1 VALUES(0xABC9);
INSERT INTO t1 VALUES(0xABCA);
INSERT INTO t1 VALUES(0xABCB);
INSERT INTO t1 VALUES(0xABCC);
INSERT INTO t1 VALUES(0xABCD);
INSERT INTO t1 VALUES(0xABCE);
INSERT INTO t1 VALUES(0xABCF);
INSERT INTO t1 VALUES(0xABD0);
INSERT INTO t1 VALUES(0xABD1);
INSERT INTO t1 VALUES(0xABD2);
INSERT INTO t1 VALUES(0xABD3);
INSERT INTO t1 VALUES(0xABD4);
INSERT INTO t1 VALUES(0xABD5);
INSERT INTO t1 VALUES(0xABD6);
INSERT INTO t1 VALUES(0xABD7);
INSERT INTO t1 VALUES(0xABD8);
INSERT INTO t1 VALUES(0xABD9);
INSERT INTO t1 VALUES(0xABDA);
INSERT INTO t1 VALUES(0xABDB);
INSERT INTO t1 VALUES(0xABDC);
INSERT INTO t1 VALUES(0xABDD);
INSERT INTO t1 VALUES(0xABDE);
INSERT INTO t1 VALUES(0xABDF);
INSERT INTO t1 VALUES(0xABE0);
INSERT INTO t1 VALUES(0xABE1);
INSERT INTO t1 VALUES(0xABE2);
INSERT INTO t1 VALUES(0xABE3);
INSERT INTO t1 VALUES(0xABE4);
INSERT INTO t1 VALUES(0xABE5);
INSERT INTO t1 VALUES(0xABE6);
INSERT INTO t1 VALUES(0xABE7);
INSERT INTO t1 VALUES(0xABE8);
INSERT INTO t1 VALUES(0xABE9);
INSERT INTO t1 VALUES(0xABEA);
INSERT INTO t1 VALUES(0xABEB);
INSERT INTO t1 VALUES(0xABEC);
INSERT INTO t1 VALUES(0xABED);
INSERT INTO t1 VALUES(0xABEE);
INSERT INTO t1 VALUES(0xABEF);
INSERT INTO t1 VALUES(0xABF0);
INSERT INTO t1 VALUES(0xABF1);
INSERT INTO t1 VALUES(0xABF2);
INSERT INTO t1 VALUES(0xABF3);
INSERT INTO t1 VALUES(0xABF4);
INSERT INTO t1 VALUES(0xABF5);
INSERT INTO t1 VALUES(0xABF6);
INSERT INTO t1 VALUES(0xABF7);
INSERT INTO t1 VALUES(0xABF8);
INSERT INTO t1 VALUES(0xABF9);
INSERT INTO t1 VALUES(0xABFA);
INSERT INTO t1 VALUES(0xABFB);
INSERT INTO t1 VALUES(0xABFC);
INSERT INTO t1 VALUES(0xABFD);
INSERT INTO t1 VALUES(0xABFE);
INSERT INTO t1 VALUES(0xACA1);
INSERT INTO t1 VALUES(0xACA2);
INSERT INTO t1 VALUES(0xACA3);
INSERT INTO t1 VALUES(0xACA4);
INSERT INTO t1 VALUES(0xACA5);
INSERT INTO t1 VALUES(0xACA6);
INSERT INTO t1 VALUES(0xACA7);
INSERT INTO t1 VALUES(0xACA8);
INSERT INTO t1 VALUES(0xACA9);
INSERT INTO t1 VALUES(0xACAA);
INSERT INTO t1 VALUES(0xACAB);
INSERT INTO t1 VALUES(0xACAC);
INSERT INTO t1 VALUES(0xACAD);
INSERT INTO t1 VALUES(0xACAE);
INSERT INTO t1 VALUES(0xACAF);
INSERT INTO t1 VALUES(0xACB0);
INSERT INTO t1 VALUES(0xACB1);
INSERT INTO t1 VALUES(0xACB2);
INSERT INTO t1 VALUES(0xACB3);
INSERT INTO t1 VALUES(0xACB4);
INSERT INTO t1 VALUES(0xACB5);
INSERT INTO t1 VALUES(0xACB6);
INSERT INTO t1 VALUES(0xACB7);
INSERT INTO t1 VALUES(0xACB8);
INSERT INTO t1 VALUES(0xACB9);
INSERT INTO t1 VALUES(0xACBA);
INSERT INTO t1 VALUES(0xACBB);
INSERT INTO t1 VALUES(0xACBC);
INSERT INTO t1 VALUES(0xACBD);
INSERT INTO t1 VALUES(0xACBE);
INSERT INTO t1 VALUES(0xACBF);
INSERT INTO t1 VALUES(0xACC0);
INSERT INTO t1 VALUES(0xACC1);
INSERT INTO t1 VALUES(0xACC2);
INSERT INTO t1 VALUES(0xACC3);
INSERT INTO t1 VALUES(0xACC4);
INSERT INTO t1 VALUES(0xACC5);
INSERT INTO t1 VALUES(0xACC6);
INSERT INTO t1 VALUES(0xACC7);
INSERT INTO t1 VALUES(0xACC8);
INSERT INTO t1 VALUES(0xACC9);
INSERT INTO t1 VALUES(0xACCA);
INSERT INTO t1 VALUES(0xACCB);
INSERT INTO t1 VALUES(0xACCC);
INSERT INTO t1 VALUES(0xACCD);
INSERT INTO t1 VALUES(0xACCE);
INSERT INTO t1 VALUES(0xACCF);
INSERT INTO t1 VALUES(0xACD0);
INSERT INTO t1 VALUES(0xACD1);
INSERT INTO t1 VALUES(0xACD2);
INSERT INTO t1 VALUES(0xACD3);
INSERT INTO t1 VALUES(0xACD4);
INSERT INTO t1 VALUES(0xACD5);
INSERT INTO t1 VALUES(0xACD6);
INSERT INTO t1 VALUES(0xACD7);
INSERT INTO t1 VALUES(0xACD8);
INSERT INTO t1 VALUES(0xACD9);
INSERT INTO t1 VALUES(0xACDA);
INSERT INTO t1 VALUES(0xACDB);
INSERT INTO t1 VALUES(0xACDC);
INSERT INTO t1 VALUES(0xACDD);
INSERT INTO t1 VALUES(0xACDE);
INSERT INTO t1 VALUES(0xACDF);
INSERT INTO t1 VALUES(0xACE0);
INSERT INTO t1 VALUES(0xACE1);
INSERT INTO t1 VALUES(0xACE2);
INSERT INTO t1 VALUES(0xACE3);
INSERT INTO t1 VALUES(0xACE4);
INSERT INTO t1 VALUES(0xACE5);
INSERT INTO t1 VALUES(0xACE6);
INSERT INTO t1 VALUES(0xACE7);
INSERT INTO t1 VALUES(0xACE8);
INSERT INTO t1 VALUES(0xACE9);
INSERT INTO t1 VALUES(0xACEA);
INSERT INTO t1 VALUES(0xACEB);
INSERT INTO t1 VALUES(0xACEC);
INSERT INTO t1 VALUES(0xACED);
INSERT INTO t1 VALUES(0xACEE);
INSERT INTO t1 VALUES(0xACEF);
INSERT INTO t1 VALUES(0xACF0);
INSERT INTO t1 VALUES(0xACF1);
INSERT INTO t1 VALUES(0xACF2);
INSERT INTO t1 VALUES(0xACF3);
INSERT INTO t1 VALUES(0xACF4);
INSERT INTO t1 VALUES(0xACF5);
INSERT INTO t1 VALUES(0xACF6);
INSERT INTO t1 VALUES(0xACF7);
INSERT INTO t1 VALUES(0xACF8);
INSERT INTO t1 VALUES(0xACF9);
INSERT INTO t1 VALUES(0xACFA);
INSERT INTO t1 VALUES(0xACFB);
INSERT INTO t1 VALUES(0xACFC);
INSERT INTO t1 VALUES(0xACFD);
INSERT INTO t1 VALUES(0xACFE);
INSERT INTO t1 VALUES(0xADA1);
INSERT INTO t1 VALUES(0xADA2);
INSERT INTO t1 VALUES(0xADA3);
INSERT INTO t1 VALUES(0xADA4);
INSERT INTO t1 VALUES(0xADA5);
INSERT INTO t1 VALUES(0xADA6);
INSERT INTO t1 VALUES(0xADA7);
INSERT INTO t1 VALUES(0xADA8);
INSERT INTO t1 VALUES(0xADA9);
INSERT INTO t1 VALUES(0xADAA);
INSERT INTO t1 VALUES(0xADAB);
INSERT INTO t1 VALUES(0xADAC);
INSERT INTO t1 VALUES(0xADAD);
INSERT INTO t1 VALUES(0xADAE);
INSERT INTO t1 VALUES(0xADAF);
INSERT INTO t1 VALUES(0xADB0);
INSERT INTO t1 VALUES(0xADB1);
INSERT INTO t1 VALUES(0xADB2);
INSERT INTO t1 VALUES(0xADB3);
INSERT INTO t1 VALUES(0xADB4);
INSERT INTO t1 VALUES(0xADB5);
INSERT INTO t1 VALUES(0xADB6);
INSERT INTO t1 VALUES(0xADB7);
INSERT INTO t1 VALUES(0xADB8);
INSERT INTO t1 VALUES(0xADB9);
INSERT INTO t1 VALUES(0xADBA);
INSERT INTO t1 VALUES(0xADBB);
INSERT INTO t1 VALUES(0xADBC);
INSERT INTO t1 VALUES(0xADBD);
INSERT INTO t1 VALUES(0xADBE);
INSERT INTO t1 VALUES(0xADBF);
INSERT INTO t1 VALUES(0xADC0);
INSERT INTO t1 VALUES(0xADC1);
INSERT INTO t1 VALUES(0xADC2);
INSERT INTO t1 VALUES(0xADC3);
INSERT INTO t1 VALUES(0xADC4);
INSERT INTO t1 VALUES(0xADC5);
INSERT INTO t1 VALUES(0xADC6);
INSERT INTO t1 VALUES(0xADC7);
INSERT INTO t1 VALUES(0xADC8);
INSERT INTO t1 VALUES(0xADC9);
INSERT INTO t1 VALUES(0xADCA);
INSERT INTO t1 VALUES(0xADCB);
INSERT INTO t1 VALUES(0xADCC);
INSERT INTO t1 VALUES(0xADCD);
INSERT INTO t1 VALUES(0xADCE);
INSERT INTO t1 VALUES(0xADCF);
INSERT INTO t1 VALUES(0xADD0);
INSERT INTO t1 VALUES(0xADD1);
INSERT INTO t1 VALUES(0xADD2);
INSERT INTO t1 VALUES(0xADD3);
INSERT INTO t1 VALUES(0xADD4);
INSERT INTO t1 VALUES(0xADD5);
INSERT INTO t1 VALUES(0xADD6);
INSERT INTO t1 VALUES(0xADD7);
INSERT INTO t1 VALUES(0xADD8);
INSERT INTO t1 VALUES(0xADD9);
INSERT INTO t1 VALUES(0xADDA);
INSERT INTO t1 VALUES(0xADDB);
INSERT INTO t1 VALUES(0xADDC);
INSERT INTO t1 VALUES(0xADDD);
INSERT INTO t1 VALUES(0xADDE);
INSERT INTO t1 VALUES(0xADDF);
INSERT INTO t1 VALUES(0xADE0);
INSERT INTO t1 VALUES(0xADE1);
INSERT INTO t1 VALUES(0xADE2);
INSERT INTO t1 VALUES(0xADE3);
INSERT INTO t1 VALUES(0xADE4);
INSERT INTO t1 VALUES(0xADE5);
INSERT INTO t1 VALUES(0xADE6);
INSERT INTO t1 VALUES(0xADE7);
INSERT INTO t1 VALUES(0xADE8);
INSERT INTO t1 VALUES(0xADE9);
INSERT INTO t1 VALUES(0xADEA);
INSERT INTO t1 VALUES(0xADEB);
INSERT INTO t1 VALUES(0xADEC);
INSERT INTO t1 VALUES(0xADED);
INSERT INTO t1 VALUES(0xADEE);
INSERT INTO t1 VALUES(0xADEF);
INSERT INTO t1 VALUES(0xADF0);
INSERT INTO t1 VALUES(0xADF1);
INSERT INTO t1 VALUES(0xADF2);
INSERT INTO t1 VALUES(0xADF3);
INSERT INTO t1 VALUES(0xADF4);
INSERT INTO t1 VALUES(0xADF5);
INSERT INTO t1 VALUES(0xADF6);
INSERT INTO t1 VALUES(0xADF7);
INSERT INTO t1 VALUES(0xADF8);
INSERT INTO t1 VALUES(0xADF9);
INSERT INTO t1 VALUES(0xADFA);
INSERT INTO t1 VALUES(0xADFB);
INSERT INTO t1 VALUES(0xADFC);
INSERT INTO t1 VALUES(0xADFD);
INSERT INTO t1 VALUES(0xADFE);
INSERT INTO t1 VALUES(0xAEA1);
INSERT INTO t1 VALUES(0xAEA2);
INSERT INTO t1 VALUES(0xAEA3);
INSERT INTO t1 VALUES(0xAEA4);
INSERT INTO t1 VALUES(0xAEA5);
INSERT INTO t1 VALUES(0xAEA6);
INSERT INTO t1 VALUES(0xAEA7);
INSERT INTO t1 VALUES(0xAEA8);
INSERT INTO t1 VALUES(0xAEA9);
INSERT INTO t1 VALUES(0xAEAA);
INSERT INTO t1 VALUES(0xAEAB);
INSERT INTO t1 VALUES(0xAEAC);
INSERT INTO t1 VALUES(0xAEAD);
INSERT INTO t1 VALUES(0xAEAE);
INSERT INTO t1 VALUES(0xAEAF);
INSERT INTO t1 VALUES(0xAEB0);
INSERT INTO t1 VALUES(0xAEB1);
INSERT INTO t1 VALUES(0xAEB2);
INSERT INTO t1 VALUES(0xAEB3);
INSERT INTO t1 VALUES(0xAEB4);
INSERT INTO t1 VALUES(0xAEB5);
INSERT INTO t1 VALUES(0xAEB6);
INSERT INTO t1 VALUES(0xAEB7);
INSERT INTO t1 VALUES(0xAEB8);
INSERT INTO t1 VALUES(0xAEB9);
INSERT INTO t1 VALUES(0xAEBA);
INSERT INTO t1 VALUES(0xAEBB);
INSERT INTO t1 VALUES(0xAEBC);
INSERT INTO t1 VALUES(0xAEBD);
INSERT INTO t1 VALUES(0xAEBE);
INSERT INTO t1 VALUES(0xAEBF);
INSERT INTO t1 VALUES(0xAEC0);
INSERT INTO t1 VALUES(0xAEC1);
INSERT INTO t1 VALUES(0xAEC2);
INSERT INTO t1 VALUES(0xAEC3);
INSERT INTO t1 VALUES(0xAEC4);
INSERT INTO t1 VALUES(0xAEC5);
INSERT INTO t1 VALUES(0xAEC6);
INSERT INTO t1 VALUES(0xAEC7);
INSERT INTO t1 VALUES(0xAEC8);
INSERT INTO t1 VALUES(0xAEC9);
INSERT INTO t1 VALUES(0xAECA);
INSERT INTO t1 VALUES(0xAECB);
INSERT INTO t1 VALUES(0xAECC);
INSERT INTO t1 VALUES(0xAECD);
INSERT INTO t1 VALUES(0xAECE);
INSERT INTO t1 VALUES(0xAECF);
INSERT INTO t1 VALUES(0xAED0);
INSERT INTO t1 VALUES(0xAED1);
INSERT INTO t1 VALUES(0xAED2);
INSERT INTO t1 VALUES(0xAED3);
INSERT INTO t1 VALUES(0xAED4);
INSERT INTO t1 VALUES(0xAED5);
INSERT INTO t1 VALUES(0xAED6);
INSERT INTO t1 VALUES(0xAED7);
INSERT INTO t1 VALUES(0xAED8);
INSERT INTO t1 VALUES(0xAED9);
INSERT INTO t1 VALUES(0xAEDA);
INSERT INTO t1 VALUES(0xAEDB);
INSERT INTO t1 VALUES(0xAEDC);
INSERT INTO t1 VALUES(0xAEDD);
INSERT INTO t1 VALUES(0xAEDE);
INSERT INTO t1 VALUES(0xAEDF);
INSERT INTO t1 VALUES(0xAEE0);
INSERT INTO t1 VALUES(0xAEE1);
INSERT INTO t1 VALUES(0xAEE2);
INSERT INTO t1 VALUES(0xAEE3);
INSERT INTO t1 VALUES(0xAEE4);
INSERT INTO t1 VALUES(0xAEE5);
INSERT INTO t1 VALUES(0xAEE6);
INSERT INTO t1 VALUES(0xAEE7);
INSERT INTO t1 VALUES(0xAEE8);
INSERT INTO t1 VALUES(0xAEE9);
INSERT INTO t1 VALUES(0xAEEA);
INSERT INTO t1 VALUES(0xAEEB);
INSERT INTO t1 VALUES(0xAEEC);
INSERT INTO t1 VALUES(0xAEED);
INSERT INTO t1 VALUES(0xAEEE);
INSERT INTO t1 VALUES(0xAEEF);
INSERT INTO t1 VALUES(0xAEF0);
INSERT INTO t1 VALUES(0xAEF1);
INSERT INTO t1 VALUES(0xAEF2);
INSERT INTO t1 VALUES(0xAEF3);
INSERT INTO t1 VALUES(0xAEF4);
INSERT INTO t1 VALUES(0xAEF5);
INSERT INTO t1 VALUES(0xAEF6);
INSERT INTO t1 VALUES(0xAEF7);
INSERT INTO t1 VALUES(0xAEF8);
INSERT INTO t1 VALUES(0xAEF9);
INSERT INTO t1 VALUES(0xAEFA);
INSERT INTO t1 VALUES(0xAEFB);
INSERT INTO t1 VALUES(0xAEFC);
INSERT INTO t1 VALUES(0xAEFD);
INSERT INTO t1 VALUES(0xAEFE);
INSERT INTO t1 VALUES(0xAFA1);
INSERT INTO t1 VALUES(0xAFA2);
INSERT INTO t1 VALUES(0xAFA3);
INSERT INTO t1 VALUES(0xAFA4);
INSERT INTO t1 VALUES(0xAFA5);
INSERT INTO t1 VALUES(0xAFA6);
INSERT INTO t1 VALUES(0xAFA7);
INSERT INTO t1 VALUES(0xAFA8);
INSERT INTO t1 VALUES(0xAFA9);
INSERT INTO t1 VALUES(0xAFAA);
INSERT INTO t1 VALUES(0xAFAB);
INSERT INTO t1 VALUES(0xAFAC);
INSERT INTO t1 VALUES(0xAFAD);
INSERT INTO t1 VALUES(0xAFAE);
INSERT INTO t1 VALUES(0xAFAF);
INSERT INTO t1 VALUES(0xAFB0);
INSERT INTO t1 VALUES(0xAFB1);
INSERT INTO t1 VALUES(0xAFB2);
INSERT INTO t1 VALUES(0xAFB3);
INSERT INTO t1 VALUES(0xAFB4);
INSERT INTO t1 VALUES(0xAFB5);
INSERT INTO t1 VALUES(0xAFB6);
INSERT INTO t1 VALUES(0xAFB7);
INSERT INTO t1 VALUES(0xAFB8);
INSERT INTO t1 VALUES(0xAFB9);
INSERT INTO t1 VALUES(0xAFBA);
INSERT INTO t1 VALUES(0xAFBB);
INSERT INTO t1 VALUES(0xAFBC);
INSERT INTO t1 VALUES(0xAFBD);
INSERT INTO t1 VALUES(0xAFBE);
INSERT INTO t1 VALUES(0xAFBF);
INSERT INTO t1 VALUES(0xAFC0);
INSERT INTO t1 VALUES(0xAFC1);
INSERT INTO t1 VALUES(0xAFC2);
INSERT INTO t1 VALUES(0xAFC3);
INSERT INTO t1 VALUES(0xAFC4);
INSERT INTO t1 VALUES(0xAFC5);
INSERT INTO t1 VALUES(0xAFC6);
INSERT INTO t1 VALUES(0xAFC7);
INSERT INTO t1 VALUES(0xAFC8);
INSERT INTO t1 VALUES(0xAFC9);
INSERT INTO t1 VALUES(0xAFCA);
INSERT INTO t1 VALUES(0xAFCB);
INSERT INTO t1 VALUES(0xAFCC);
INSERT INTO t1 VALUES(0xAFCD);
INSERT INTO t1 VALUES(0xAFCE);
INSERT INTO t1 VALUES(0xAFCF);
INSERT INTO t1 VALUES(0xAFD0);
INSERT INTO t1 VALUES(0xAFD1);
INSERT INTO t1 VALUES(0xAFD2);
INSERT INTO t1 VALUES(0xAFD3);
INSERT INTO t1 VALUES(0xAFD4);
INSERT INTO t1 VALUES(0xAFD5);
INSERT INTO t1 VALUES(0xAFD6);
INSERT INTO t1 VALUES(0xAFD7);
INSERT INTO t1 VALUES(0xAFD8);
INSERT INTO t1 VALUES(0xAFD9);
INSERT INTO t1 VALUES(0xAFDA);
INSERT INTO t1 VALUES(0xAFDB);
INSERT INTO t1 VALUES(0xAFDC);
INSERT INTO t1 VALUES(0xAFDD);
INSERT INTO t1 VALUES(0xAFDE);
INSERT INTO t1 VALUES(0xAFDF);
INSERT INTO t1 VALUES(0xAFE0);
INSERT INTO t1 VALUES(0xAFE1);
INSERT INTO t1 VALUES(0xAFE2);
INSERT INTO t1 VALUES(0xAFE3);
INSERT INTO t1 VALUES(0xAFE4);
INSERT INTO t1 VALUES(0xAFE5);
INSERT INTO t1 VALUES(0xAFE6);
INSERT INTO t1 VALUES(0xAFE7);
INSERT INTO t1 VALUES(0xAFE8);
INSERT INTO t1 VALUES(0xAFE9);
INSERT INTO t1 VALUES(0xAFEA);
INSERT INTO t1 VALUES(0xAFEB);
INSERT INTO t1 VALUES(0xAFEC);
INSERT INTO t1 VALUES(0xAFED);
INSERT INTO t1 VALUES(0xAFEE);
INSERT INTO t1 VALUES(0xAFEF);
INSERT INTO t1 VALUES(0xAFF0);
INSERT INTO t1 VALUES(0xAFF1);
INSERT INTO t1 VALUES(0xAFF2);
INSERT INTO t1 VALUES(0xAFF3);
INSERT INTO t1 VALUES(0xAFF4);
INSERT INTO t1 VALUES(0xAFF5);
INSERT INTO t1 VALUES(0xAFF6);
INSERT INTO t1 VALUES(0xAFF7);
INSERT INTO t1 VALUES(0xAFF8);
INSERT INTO t1 VALUES(0xAFF9);
INSERT INTO t1 VALUES(0xAFFA);
INSERT INTO t1 VALUES(0xAFFB);
INSERT INTO t1 VALUES(0xAFFC);
INSERT INTO t1 VALUES(0xAFFD);
INSERT INTO t1 VALUES(0xAFFE);
INSERT INTO t1 VALUES(0xCFD4);
INSERT INTO t1 VALUES(0xCFD5);
INSERT INTO t1 VALUES(0xCFD6);
INSERT INTO t1 VALUES(0xCFD7);
INSERT INTO t1 VALUES(0xCFD8);
INSERT INTO t1 VALUES(0xCFD9);
INSERT INTO t1 VALUES(0xCFDA);
INSERT INTO t1 VALUES(0xCFDB);
INSERT INTO t1 VALUES(0xCFDC);
INSERT INTO t1 VALUES(0xCFDD);
INSERT INTO t1 VALUES(0xCFDE);
INSERT INTO t1 VALUES(0xCFDF);
INSERT INTO t1 VALUES(0xCFE0);
INSERT INTO t1 VALUES(0xCFE1);
INSERT INTO t1 VALUES(0xCFE2);
INSERT INTO t1 VALUES(0xCFE3);
INSERT INTO t1 VALUES(0xCFE4);
INSERT INTO t1 VALUES(0xCFE5);
INSERT INTO t1 VALUES(0xCFE6);
INSERT INTO t1 VALUES(0xCFE7);
INSERT INTO t1 VALUES(0xCFE8);
INSERT INTO t1 VALUES(0xCFE9);
INSERT INTO t1 VALUES(0xCFEA);
INSERT INTO t1 VALUES(0xCFEB);
INSERT INTO t1 VALUES(0xCFEC);
INSERT INTO t1 VALUES(0xCFED);
INSERT INTO t1 VALUES(0xCFEE);
INSERT INTO t1 VALUES(0xCFEF);
INSERT INTO t1 VALUES(0xCFF0);
INSERT INTO t1 VALUES(0xCFF1);
INSERT INTO t1 VALUES(0xCFF2);
INSERT INTO t1 VALUES(0xCFF3);
INSERT INTO t1 VALUES(0xCFF4);
INSERT INTO t1 VALUES(0xCFF5);
INSERT INTO t1 VALUES(0xCFF6);
INSERT INTO t1 VALUES(0xCFF7);
INSERT INTO t1 VALUES(0xCFF8);
INSERT INTO t1 VALUES(0xCFF9);
INSERT INTO t1 VALUES(0xCFFA);
INSERT INTO t1 VALUES(0xCFFB);
INSERT INTO t1 VALUES(0xCFFC);
INSERT INTO t1 VALUES(0xCFFD);
INSERT INTO t1 VALUES(0xCFFE);
INSERT INTO t1 VALUES(0xF4A7);
INSERT INTO t1 VALUES(0xF4A8);
INSERT INTO t1 VALUES(0xF4A9);
INSERT INTO t1 VALUES(0xF4AA);
INSERT INTO t1 VALUES(0xF4AB);
INSERT INTO t1 VALUES(0xF4AC);
INSERT INTO t1 VALUES(0xF4AD);
INSERT INTO t1 VALUES(0xF4AE);
INSERT INTO t1 VALUES(0xF4AF);
INSERT INTO t1 VALUES(0xF4B0);
INSERT INTO t1 VALUES(0xF4B1);
INSERT INTO t1 VALUES(0xF4B2);
INSERT INTO t1 VALUES(0xF4B3);
INSERT INTO t1 VALUES(0xF4B4);
INSERT INTO t1 VALUES(0xF4B5);
INSERT INTO t1 VALUES(0xF4B6);
INSERT INTO t1 VALUES(0xF4B7);
INSERT INTO t1 VALUES(0xF4B8);
INSERT INTO t1 VALUES(0xF4B9);
INSERT INTO t1 VALUES(0xF4BA);
INSERT INTO t1 VALUES(0xF4BB);
INSERT INTO t1 VALUES(0xF4BC);
INSERT INTO t1 VALUES(0xF4BD);
INSERT INTO t1 VALUES(0xF4BE);
INSERT INTO t1 VALUES(0xF4BF);
INSERT INTO t1 VALUES(0xF4C0);
INSERT INTO t1 VALUES(0xF4C1);
INSERT INTO t1 VALUES(0xF4C2);
INSERT INTO t1 VALUES(0xF4C3);
INSERT INTO t1 VALUES(0xF4C4);
INSERT INTO t1 VALUES(0xF4C5);
INSERT INTO t1 VALUES(0xF4C6);
INSERT INTO t1 VALUES(0xF4C7);
INSERT INTO t1 VALUES(0xF4C8);
INSERT INTO t1 VALUES(0xF4C9);
INSERT INTO t1 VALUES(0xF4CA);
INSERT INTO t1 VALUES(0xF4CB);
INSERT INTO t1 VALUES(0xF4CC);
INSERT INTO t1 VALUES(0xF4CD);
INSERT INTO t1 VALUES(0xF4CE);
INSERT INTO t1 VALUES(0xF4CF);
INSERT INTO t1 VALUES(0xF4D0);
INSERT INTO t1 VALUES(0xF4D1);
INSERT INTO t1 VALUES(0xF4D2);
INSERT INTO t1 VALUES(0xF4D3);
INSERT INTO t1 VALUES(0xF4D4);
INSERT INTO t1 VALUES(0xF4D5);
INSERT INTO t1 VALUES(0xF4D6);
INSERT INTO t1 VALUES(0xF4D7);
INSERT INTO t1 VALUES(0xF4D8);
INSERT INTO t1 VALUES(0xF4D9);
INSERT INTO t1 VALUES(0xF4DA);
INSERT INTO t1 VALUES(0xF4DB);
INSERT INTO t1 VALUES(0xF4DC);
INSERT INTO t1 VALUES(0xF4DD);
INSERT INTO t1 VALUES(0xF4DE);
INSERT INTO t1 VALUES(0xF4DF);
INSERT INTO t1 VALUES(0xF4E0);
INSERT INTO t1 VALUES(0xF4E1);
INSERT INTO t1 VALUES(0xF4E2);
INSERT INTO t1 VALUES(0xF4E3);
INSERT INTO t1 VALUES(0xF4E4);
INSERT INTO t1 VALUES(0xF4E5);
INSERT INTO t1 VALUES(0xF4E6);
INSERT INTO t1 VALUES(0xF4E7);
INSERT INTO t1 VALUES(0xF4E8);
INSERT INTO t1 VALUES(0xF4E9);
INSERT INTO t1 VALUES(0xF4EA);
INSERT INTO t1 VALUES(0xF4EB);
INSERT INTO t1 VALUES(0xF4EC);
INSERT INTO t1 VALUES(0xF4ED);
INSERT INTO t1 VALUES(0xF4EE);
INSERT INTO t1 VALUES(0xF4EF);
INSERT INTO t1 VALUES(0xF4F0);
INSERT INTO t1 VALUES(0xF4F1);
INSERT INTO t1 VALUES(0xF4F2);
INSERT INTO t1 VALUES(0xF4F3);
INSERT INTO t1 VALUES(0xF4F4);
INSERT INTO t1 VALUES(0xF4F5);
INSERT INTO t1 VALUES(0xF4F6);
INSERT INTO t1 VALUES(0xF4F7);
INSERT INTO t1 VALUES(0xF4F8);
INSERT INTO t1 VALUES(0xF4F9);
INSERT INTO t1 VALUES(0xF4FA);
INSERT INTO t1 VALUES(0xF4FB);
INSERT INTO t1 VALUES(0xF4FC);
INSERT INTO t1 VALUES(0xF4FD);
INSERT INTO t1 VALUES(0xF4FE);
SELECT HEX(c) FROM t1 ORDER BY BINARY c;
DROP TABLE t1;


SET collation_connection='ujis_japanese_ci';
-- source include/ctype_filesort.inc
-- source include/ctype_innodb_like.inc
-- source include/ctype_like_escape.inc
-- source include/ctype_like_range_f1f2.inc
SET collation_connection='ujis_bin';
-- source include/ctype_filesort.inc
-- source include/ctype_innodb_like.inc
-- source include/ctype_like_escape.inc
-- source include/ctype_like_range_f1f2.inc

#
# Bugs#15375: Unassigned multibyte codes are broken
# into parts when converting to Unicode.
# This query should return 0x003F0041. I.e. it should
# scan unassigned double-byte character 0xA5FE, convert
# it as QUESTION MARK 0x003F and then scan the next
# character, which is a single byte character 0x41.
#
select hex(convert(_ujis 0xA5FE41 using ucs2));
# This one should return 0x003F0041:
# scan unassigned three-byte character 0x8FABF8,
# convert it as QUESTION MARK 0x003F and then scan
# the next character, which is a single byte character 0x41.
select hex(convert(_ujis 0x8FABF841 using ucs2));

# End of 4.1 tests
--disable_warnings
DROP TABLE IF EXISTS t1, t2;
DROP PROCEDURE IF EXISTS sp1;
--enable_warnings

set names ujis;
set character_set_database = ujis;
set character_set_server = ujis;

CREATE TABLE t1(c1 char(2)) default charset = ujis;
CREATE TABLE t2(c2 char(2)) default charset = ujis;

INSERT INTO t1 VALUES(_ujis 0xA4A2);

DELIMITER |;
CREATE PROCEDURE sp1()
BEGIN
  DECLARE a CHAR(2) CHARSET ujis;
  DECLARE cur1 CURSOR FOR SELECT c1 FROM t1;
  OPEN cur1;
  FETCH cur1 INTO a;
  INSERT INTO t2 VALUES (a);
  CLOSE cur1;
END|
DELIMITER ;|
CALL sp1();

#The data in t1 and t2 should be the same but different
SELECT c1,c2 FROM t1,t2;

#Since the result of hex(convert(_latin1 0xA4A2 using ujis))
#equals to hex(c2), it seems that the value which was inserted 
#by using cursor is interpreted as latin1 character set
SELECT hex(convert(_latin1 0xA4A2 using ujis)),hex(c2) FROM t1,t2;

DROP PROCEDURE sp1;
DROP TABLE t1;
DROP TABLE t2;

--echo #
--echo # Bug#57257 Replace(ExtractValue(...)) causes MySQL crash
--echo #
SET NAMES utf8;
SELECT CONVERT(REPLACE(EXPORT_SET('a','a','a','','a'),'00','') USING ujis);


set names default;
set character_set_database=default;
set character_set_server=default;

--echo End of 5.1 tests

--echo #
--echo # Start of 5.5 tests
--echo #

--echo #
--echo # Testing WL#4583 Case conversion in Asian character sets 
--echo #
#
# Populate t1 with all hex digits
#
SET NAMES utf8;
SET collation_connection=ujis_japanese_ci;
CREATE TABLE t1 (b VARCHAR(2));
INSERT INTO t1 VALUES ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7');
INSERT INTO t1 VALUES ('8'),('9'),('A'),('B'),('C'),('D'),('E'),('F');
#
# Populate tables head and tail with values '00'-'FF'
#
CREATE TEMPORARY TABLE head AS SELECT concat(b1.b, b2.b) AS head FROM t1 b1, t1 b2;
CREATE TEMPORARY TABLE tail AS SELECT concat(b1.b, b2.b) AS tail FROM t1 b1, t1 b2;
DROP TABLE t1;
#
# Populate table t1 with all ujis codes.
# 
#
CREATE TABLE t1 AS SELECT 'XXXXXX' AS code, ' ' AS a LIMIT 0;
#
# Pupulate JIS-X-0201 range (Half Width Kana)
# Valid characters: [8E][A1-DF]
#
INSERT INTO t1 (code) SELECT concat('8E', head) FROM head
WHERE (head BETWEEN 'A1' AND 'DF') ORDER BY head;
#
# Populate JIS-X-0208 range
# Expected valid range: [A1..FE][A1..FE]
#
INSERT INTO t1 (code) SELECT concat(head, tail)
FROM head, tail
WHERE (head BETWEEN '80' AND 'FF') AND (head NOT BETWEEN '8E' AND '8F')
AND   (tail BETWEEN '20' AND 'FF')
ORDER BY head, tail;
#
# Populate JIS-X-0212 range
# Expected valid range: [8F][A1..FE][A1..FE]
#
INSERT INTO t1 (code) SELECT concat('8F', head, tail)
FROM head, tail
WHERE (head BETWEEN '80' AND 'FF') AND (tail BETWEEN '80' AND 'FF')
ORDER BY head, tail;
DROP TEMPORARY TABLE head, tail;
SHOW CREATE TABLE t1;

UPDATE t1 SET a=unhex(code) ORDER BY code;
SELECT COUNT(*) FROM t1;
SELECT COUNT(*) FROM t1 WHERE a<>'';
SELECT COUNT(*) FROM t1 WHERE a<>'' AND OCTET_LENGTH(a)=2;
SELECT COUNT(*) FROM t1 WHERE a<>'' AND OCTET_LENGTH(a)=3;
#
# Display all characters that have upper or lower case mapping.
#
SELECT code, hex(upper(a)), hex(lower(a)),a, upper(a), lower(a) FROM t1 WHERE hex(a)<>hex(upper(a)) OR hex(a)<>hex(lower(a)) ORDER BY code;
#
# Make sure all possible conversion happened
#
# Expect U+0122 LATIN CAPITAL LETTER G WITH CEDILLA
#
SELECT * FROM t1
WHERE HEX(CAST(LOWER(a) AS CHAR CHARACTER SET utf8)) <>
      HEX(LOWER(CAST(a AS CHAR CHARACTER SET utf8))) ORDER BY code;
#
# U+00F0 LATIN SMALL LETTER ETH
# U+01F5 LATIN SMALL LETTER G WITH ACUTE
#
SELECT * FROM t1
WHERE HEX(CAST(UPPER(a) AS CHAR CHARACTER SET utf8)) <>
      HEX(UPPER(CAST(a AS CHAR CHARACTER SET utf8))) ORDER BY code;

--echo #
--echo # WL#3090 Japanese Character Set adjustments
--echo # Test sjis->Unicode conversion
--echo #
SELECT HEX(a), HEX(CONVERT(a USING utf8)) as b FROM t1
WHERE a<>'' HAVING b<>'3F' ORDER BY code;

DROP TABLE t1;


--echo #
--echo # WL#3090 Japanese Character Set adjustments
--echo # Test Unicode->sjis conversion
--echo #
--source include/ctype_utf8_table.inc
SELECT HEX(a), HEX(CONVERT(a using sjis)) as b FROM t1 HAVING b<>'3F' ORDER BY BINARY a;
DROP TABLE t1;



--echo #
--echo # End of 5.5 tests
--echo #


--echo #
--echo # Start of 5.6 tests
--echo #

--echo #
--echo # WL#3664 WEIGHT_STRING
--echo #

set names ujis;
--source include/weight_string.inc
--source include/weight_string_l1.inc
--source include/weight_string_A1A1.inc
--source include/weight_string_8EA1.inc
--source include/weight_string_8FA2C3.inc

set collation_connection=ujis_bin;
--source include/weight_string.inc
--source include/weight_string_l1.inc
--source include/weight_string_A1A1.inc
--source include/weight_string_8EA1.inc
--source include/weight_string_8FA2C3.inc

--echo #
--echo # Bugs#12635232: VALGRIND WARNINGS: IS_IPV6, IS_IPV4, INET6_ATON,
--echo # INET6_NTOA + MULTIBYTE CHARSET.
--echo #

SET NAMES ujis;
--source include/ctype_inet.inc

--echo #
--echo # End of 5.6 tests
--echo #
