--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 `龗龗龗`;