diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:00:34 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:00:34 +0000 |
commit | 3f619478f796eddbba6e39502fe941b285dd97b1 (patch) | |
tree | e2c7b5777f728320e5b5542b6213fd3591ba51e2 /mysql-test/suite/jp/t/jp_alter_ucs2.test | |
parent | Initial commit. (diff) | |
download | mariadb-upstream.tar.xz mariadb-upstream.zip |
Adding upstream version 1:10.11.6.upstream/1%10.11.6upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/suite/jp/t/jp_alter_ucs2.test')
-rw-r--r-- | mysql-test/suite/jp/t/jp_alter_ucs2.test | 320 |
1 files changed, 320 insertions, 0 deletions
diff --git a/mysql-test/suite/jp/t/jp_alter_ucs2.test b/mysql-test/suite/jp/t/jp_alter_ucs2.test new file mode 100644 index 00000000..24cfed06 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_alter_ucs2.test @@ -0,0 +1,320 @@ +--source include/have_ucs2.inc +--source include/have_innodb.inc + +--disable_warnings +DROP TABLE IF EXISTS `アアア`; +DROP TABLE IF EXISTS `イイイ`; +DROP TABLE IF EXISTS `あああ`; +DROP TABLE IF EXISTS `いいい`; +DROP TABLE IF EXISTS `龖龖龖`; +DROP TABLE IF EXISTS `龗龗龗`; +--enable_warnings + +# +# Test altering table with Japanese characters in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +# +# Test InnoDB +# +CREATE TABLE `アアア`(`キキキ` char(5)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `イイイ`(`ケケケ` char(5)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `あああ`(`ききき` char(5)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `いいい`(`けけけ` char(5)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `龖龖龖`(`丂丂丂` char(5)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `龗龗龗`(`乚乚乚` char(5)) DEFAULT CHARSET = ucs2 engine=INNODB; + +INSERT INTO `アアア` VALUES ('アアアアア'),('イイイイイ'),('ウウウウウ'); +INSERT INTO `あああ` VALUES ('あああああ'),('いいいいい'),('ううううう'); +INSERT INTO `龖龖龖` VALUES ('丂丂丂丂丂'),('丄丄丄丄丄'),('丅丅丅丅丅'); + +# Test basic alter operation + +ALTER TABLE `アアア` ADD `カカカ` char(1) FIRST; +ALTER TABLE `アアア` ADD `ククク` char(1) AFTER `キキキ`; +ALTER TABLE `アアア` ADD `ケケケ` char(1); +ALTER TABLE `アアア` ADD INDEX (`カカカ`); +ALTER TABLE `アアア` ADD PRIMARY KEY (`キキキ`); +ALTER TABLE `アアア` ADD UNIQUE (`ククク`); +#Multi-byte field name is not allowed for FOREIGN KEY As of 4.1.4 +#ALTER TABLE `アアア` ADD FOREIGN KEY (`ケケケ`) REFERENCES `イイイ`(`ケケケ`); +ALTER TABLE `アアア` CHANGE `カカカ` `カカ` char(1); +ALTER TABLE `アアア` MODIFY `キキキ` char(6); + +SELECT * FROM `アアア`; +DESC `アアア`; +SHOW CREATE TABLE `アアア`; + +ALTER TABLE `アアア` DROP INDEX `カカカ`; +ALTER TABLE `アアア` DROP PRIMARY KEY; +ALTER TABLE `アアア` DROP INDEX `ククク`; +#ALTER TABLE `アアア` DROP FOREIGN KEY `ケケケ`; +ALTER TABLE `アアア` DROP `カカ`; +ALTER TABLE `アアア` DROP `ククク`; +ALTER TABLE `アアア` DROP `ケケケ`; +SELECT * FROM `アアア`; +DESC `アアア`; +SHOW CREATE TABLE `アアア`; + +ALTER TABLE `あああ` ADD `かかか` char(1) FIRST; +ALTER TABLE `あああ` ADD `くくく` char(1) AFTER `ききき`; +ALTER TABLE `あああ` ADD `けけけ` char(1); +ALTER TABLE `あああ` ADD INDEX (`かかか`); +ALTER TABLE `あああ` ADD PRIMARY KEY (`ききき`); +ALTER TABLE `あああ` ADD UNIQUE (`くくく`); +#Multi-byte field name is not allowed for FOREIGN KEY As of 4.1.4 +#ALTER TABLE `あああ` ADD FOREIGN KEY (`けけけ`) REFERENCES `いいい`(`けけけ`); +ALTER TABLE `あああ` CHANGE `かかか` `かか` char(1); +ALTER TABLE `あああ` MODIFY `ききき` char(6); + +SELECT * FROM `あああ`; +DESC `あああ`; +SHOW CREATE TABLE `あああ`; + +ALTER TABLE `あああ` DROP INDEX `かかか`; +ALTER TABLE `あああ` DROP PRIMARY KEY; +ALTER TABLE `あああ` DROP INDEX `くくく`; +#ALTER TABLE `あああ` DROP FOREIGN KEY `けけけ`; +ALTER TABLE `あああ` DROP `かか`; +ALTER TABLE `あああ` DROP `くくく`; +ALTER TABLE `あああ` DROP `けけけ`; + +SELECT * FROM `あああ`; +DESC `あああ`; +SHOW CREATE TABLE `あああ`; + +ALTER TABLE `龖龖龖` ADD `丄丄丄` char(1) FIRST; +ALTER TABLE `龖龖龖` ADD `丅丅丅` char(1) AFTER `丂丂丂`; +ALTER TABLE `龖龖龖` ADD `乚乚乚` char(1); +ALTER TABLE `龖龖龖` ADD INDEX (`丄丄丄`); +ALTER TABLE `龖龖龖` ADD PRIMARY KEY (`丂丂丂`); +ALTER TABLE `龖龖龖` ADD UNIQUE (`丅丅丅`); +#Multi-byte field name is not allowed for FOREIGN KEY As of 4.1.4 +#ALTER TABLE `龖龖龖` ADD FOREIGN KEY (`乚乚乚`) REFERENCES `龗龗龗`(`乚乚乚`); +ALTER TABLE `龖龖龖` CHANGE `丄丄丄` `丄丄` char(1); +ALTER TABLE `龖龖龖` MODIFY `丂丂丂` char(6); + +SELECT * FROM `龖龖龖`; +DESC `龖龖龖`; +SHOW CREATE TABLE `龖龖龖`; + +ALTER TABLE `龖龖龖` DROP INDEX `丄丄丄`; +ALTER TABLE `龖龖龖` DROP PRIMARY KEY; +ALTER TABLE `龖龖龖` DROP INDEX `丅丅丅`; +#ALTER TABLE `龖龖龖` DROP FOREIGN KEY `乚乚乚`; +ALTER TABLE `龖龖龖` DROP `丄丄`; +ALTER TABLE `龖龖龖` DROP `丅丅丅`; +ALTER TABLE `龖龖龖` DROP `乚乚乚`; + +SELECT * FROM `龖龖龖`; +DESC `龖龖龖`; +SHOW CREATE TABLE `龖龖龖`; + +DROP TABLE `アアア`; +DROP TABLE `イイイ`; +DROP TABLE `あああ`; +DROP TABLE `いいい`; +DROP TABLE `龖龖龖`; +DROP TABLE `龗龗龗`; + +# +# Test MyISAM +# + +CREATE TABLE `アアア`(`キキキ` char(5)) DEFAULT CHARSET = ucs2 engine=MYISAM; +CREATE TABLE `イイイ`(`ケケケ` char(5)) DEFAULT CHARSET = ucs2 engine=MYISAM; +CREATE TABLE `あああ`(`ききき` char(5)) DEFAULT CHARSET = ucs2 engine=MYISAM; +CREATE TABLE `いいい`(`けけけ` char(5)) DEFAULT CHARSET = ucs2 engine=MYISAM; +CREATE TABLE `龖龖龖`(`丂丂丂` char(5)) DEFAULT CHARSET = ucs2 engine=MYISAM; +CREATE TABLE `龗龗龗`(`乚乚乚` char(5)) DEFAULT CHARSET = ucs2 engine=MYISAM; + +INSERT INTO `アアア` VALUES ('アアアアア'),('イイイイイ'),('ウウウウウ'); +INSERT INTO `あああ` VALUES ('あああああ'),('いいいいい'),('ううううう'); +INSERT INTO `龖龖龖` VALUES ('丂丂丂丂丂'),('丄丄丄丄丄'),('丅丅丅丅丅'); + +ALTER TABLE `アアア` ADD `カカカ` char(1) FIRST; +ALTER TABLE `アアア` ADD `ククク` char(1) AFTER `キキキ`; +ALTER TABLE `アアア` ADD `ケケケ` char(1); +ALTER TABLE `アアア` ADD INDEX (`カカカ`); +ALTER TABLE `アアア` ADD PRIMARY KEY (`キキキ`); +ALTER TABLE `アアア` ADD UNIQUE (`ククク`); +#ALTER TABLE `アアア` ADD FOREIGN KEY (`ケケケ`) REFERENCES `イイイ`(`ケケケ`); +ALTER TABLE `アアア` CHANGE `カカカ` `カカ` char(1); +ALTER TABLE `アアア` MODIFY `キキキ` char(6); + +SELECT * FROM `アアア`; +DESC `アアア`; +SHOW CREATE TABLE `アアア`; + +ALTER TABLE `アアア` DROP INDEX `カカカ`; +ALTER TABLE `アアア` DROP PRIMARY KEY; +ALTER TABLE `アアア` DROP INDEX `ククク`; +#ALTER TABLE `アアア` DROP FOREIGN KEY `ケケケ`; +ALTER TABLE `アアア` DROP `カカ`; +ALTER TABLE `アアア` DROP `ククク`; +ALTER TABLE `アアア` DROP `ケケケ`; +SELECT * FROM `アアア`; +DESC `アアア`; +SHOW CREATE TABLE `アアア`; + +ALTER TABLE `あああ` ADD `かかか` char(1) FIRST; +ALTER TABLE `あああ` ADD `くくく` char(1) AFTER `ききき`; +ALTER TABLE `あああ` ADD `けけけ` char(1); +ALTER TABLE `あああ` ADD INDEX (`かかか`); +ALTER TABLE `あああ` ADD PRIMARY KEY (`ききき`); +ALTER TABLE `あああ` ADD UNIQUE (`くくく`); +#ALTER TABLE `あああ` ADD FOREIGN KEY (`けけけ`) REFERENCES `いいい`(`けけけ`); +ALTER TABLE `あああ` CHANGE `かかか` `かか` char(1); +ALTER TABLE `あああ` MODIFY `ききき` char(6); + +SELECT * FROM `あああ`; +DESC `あああ`; +SHOW CREATE TABLE `あああ`; + +ALTER TABLE `あああ` DROP INDEX `かかか`; +ALTER TABLE `あああ` DROP PRIMARY KEY; +ALTER TABLE `あああ` DROP INDEX `くくく`; +#ALTER TABLE `あああ` DROP FOREIGN KEY `けけけ`; +ALTER TABLE `あああ` DROP `かか`; +ALTER TABLE `あああ` DROP `くくく`; +ALTER TABLE `あああ` DROP `けけけ`; + +SELECT * FROM `あああ`; +DESC `あああ`; +SHOW CREATE TABLE `あああ`; + +ALTER TABLE `龖龖龖` ADD `丄丄丄` char(1) FIRST; +ALTER TABLE `龖龖龖` ADD `丅丅丅` char(1) AFTER `丂丂丂`; +ALTER TABLE `龖龖龖` ADD `乚乚乚` char(1); +ALTER TABLE `龖龖龖` ADD INDEX (`丄丄丄`); +ALTER TABLE `龖龖龖` ADD PRIMARY KEY (`丂丂丂`); +ALTER TABLE `龖龖龖` ADD UNIQUE (`丅丅丅`); +#ALTER TABLE `龖龖龖` ADD FOREIGN KEY (`乚乚乚`) REFERENCES `龗龗龗`(`乚乚乚`); +ALTER TABLE `龖龖龖` CHANGE `丄丄丄` `丄丄` char(1); +ALTER TABLE `龖龖龖` MODIFY `丂丂丂` char(6); + +SELECT * FROM `龖龖龖`; +DESC `龖龖龖`; +SHOW CREATE TABLE `龖龖龖`; + +ALTER TABLE `龖龖龖` DROP INDEX `丄丄丄`; +ALTER TABLE `龖龖龖` DROP PRIMARY KEY; +ALTER TABLE `龖龖龖` DROP INDEX `丅丅丅`; +#ALTER TABLE `龖龖龖` DROP FOREIGN KEY `乚乚乚`; +ALTER TABLE `龖龖龖` DROP `丄丄`; +ALTER TABLE `龖龖龖` DROP `丅丅丅`; +ALTER TABLE `龖龖龖` DROP `乚乚乚`; + +SELECT * FROM `龖龖龖`; +DESC `龖龖龖`; +SHOW CREATE TABLE `龖龖龖`; + +DROP TABLE `アアア`; +DROP TABLE `イイイ`; +DROP TABLE `あああ`; +DROP TABLE `いいい`; +DROP TABLE `龖龖龖`; +DROP TABLE `龗龗龗`; + +# +# Test MEMORY +# + +CREATE TABLE `アアア`(`キキキ` char(5)) DEFAULT CHARSET = ucs2 engine=MEMORY; +CREATE TABLE `イイイ`(`ケケケ` char(5)) DEFAULT CHARSET = ucs2 engine=MEMORY; +CREATE TABLE `あああ`(`ききき` char(5)) DEFAULT CHARSET = ucs2 engine=MEMORY; +CREATE TABLE `いいい`(`けけけ` char(5)) DEFAULT CHARSET = ucs2 engine=MEMORY; +CREATE TABLE `龖龖龖`(`丂丂丂` char(5)) DEFAULT CHARSET = ucs2 engine=MEMORY; +CREATE TABLE `龗龗龗`(`乚乚乚` char(5)) DEFAULT CHARSET = ucs2 engine=MEMORY; + +INSERT INTO `アアア` VALUES ('アアアアア'),('イイイイイ'),('ウウウウウ'); +INSERT INTO `あああ` VALUES ('あああああ'),('いいいいい'),('ううううう'); +INSERT INTO `龖龖龖` VALUES ('丂丂丂丂丂'),('丄丄丄丄丄'),('丅丅丅丅丅'); + +ALTER TABLE `アアア` ADD `カカカ` char(1) FIRST; +ALTER TABLE `アアア` ADD `ククク` char(1) AFTER `キキキ`; +ALTER TABLE `アアア` ADD `ケケケ` char(1); +ALTER TABLE `アアア` ADD INDEX (`カカカ`); +ALTER TABLE `アアア` ADD PRIMARY KEY (`キキキ`); +ALTER TABLE `アアア` ADD UNIQUE (`ククク`); +#ALTER TABLE `アアア` ADD FOREIGN KEY (`ケケケ`) REFERENCES `イイイ`(`ケケケ`); +ALTER TABLE `アアア` CHANGE `カカカ` `カカ` char(1); +ALTER TABLE `アアア` MODIFY `キキキ` char(6); + +SELECT * FROM `アアア`; +DESC `アアア`; +SHOW CREATE TABLE `アアア`; + +ALTER TABLE `アアア` DROP INDEX `カカカ`; +ALTER TABLE `アアア` DROP PRIMARY KEY; +ALTER TABLE `アアア` DROP INDEX `ククク`; +#ALTER TABLE `アアア` DROP FOREIGN KEY `ケケケ`; +ALTER TABLE `アアア` DROP `カカ`; +ALTER TABLE `アアア` DROP `ククク`; +ALTER TABLE `アアア` DROP `ケケケ`; +SELECT * FROM `アアア`; +DESC `アアア`; +SHOW CREATE TABLE `アアア`; + +ALTER TABLE `あああ` ADD `かかか` char(1) FIRST; +ALTER TABLE `あああ` ADD `くくく` char(1) AFTER `ききき`; +ALTER TABLE `あああ` ADD `けけけ` char(1); +ALTER TABLE `あああ` ADD INDEX (`かかか`); +ALTER TABLE `あああ` ADD PRIMARY KEY (`ききき`); +ALTER TABLE `あああ` ADD UNIQUE (`くくく`); +#ALTER TABLE `あああ` ADD FOREIGN KEY (`けけけ`) REFERENCES `いいい`(`けけけ`); +ALTER TABLE `あああ` CHANGE `かかか` `かか` char(1); +ALTER TABLE `あああ` MODIFY `ききき` char(6); + +SELECT * FROM `あああ`; +DESC `あああ`; +SHOW CREATE TABLE `あああ`; + +ALTER TABLE `あああ` DROP INDEX `かかか`; +ALTER TABLE `あああ` DROP PRIMARY KEY; +ALTER TABLE `あああ` DROP INDEX `くくく`; +#ALTER TABLE `あああ` DROP FOREIGN KEY `けけけ`; +ALTER TABLE `あああ` DROP `かか`; +ALTER TABLE `あああ` DROP `くくく`; +ALTER TABLE `あああ` DROP `けけけ`; + +SELECT * FROM `あああ`; +DESC `あああ`; +SHOW CREATE TABLE `あああ`; + +ALTER TABLE `龖龖龖` ADD `丄丄丄` char(1) FIRST; +ALTER TABLE `龖龖龖` ADD `丅丅丅` char(1) AFTER `丂丂丂`; +ALTER TABLE `龖龖龖` ADD `乚乚乚` char(1); +ALTER TABLE `龖龖龖` ADD INDEX (`丄丄丄`); +ALTER TABLE `龖龖龖` ADD PRIMARY KEY (`丂丂丂`); +ALTER TABLE `龖龖龖` ADD UNIQUE (`丅丅丅`); +#ALTER TABLE `龖龖龖` ADD FOREIGN KEY (`乚乚乚`) REFERENCES `龗龗龗`(`乚乚乚`); +ALTER TABLE `龖龖龖` CHANGE `丄丄丄` `丄丄` char(1); +ALTER TABLE `龖龖龖` MODIFY `丂丂丂` char(6); + +SELECT * FROM `龖龖龖`; +DESC `龖龖龖`; +SHOW CREATE TABLE `龖龖龖`; + +ALTER TABLE `龖龖龖` DROP INDEX `丄丄丄`; +ALTER TABLE `龖龖龖` DROP PRIMARY KEY; +ALTER TABLE `龖龖龖` DROP INDEX `丅丅丅`; +#ALTER TABLE `龖龖龖` DROP FOREIGN KEY `乚乚乚`; +ALTER TABLE `龖龖龖` DROP `丄丄`; +ALTER TABLE `龖龖龖` DROP `丅丅丅`; +ALTER TABLE `龖龖龖` DROP `乚乚乚`; + +SELECT * FROM `龖龖龖`; +DESC `龖龖龖`; +SHOW CREATE TABLE `龖龖龖`; + +DROP TABLE `アアア`; +DROP TABLE `イイイ`; +DROP TABLE `あああ`; +DROP TABLE `いいい`; +DROP TABLE `龖龖龖`; +DROP TABLE `龗龗龗`; |