mariadb/mysql-test/suite/jp/t/jp_enum_ujis.test

120 lines
3.7 KiB
Text
Raw Normal View History

Bug#20198490 : LOWER_CASE_TABLE_NAMES=0 ON WINDOWS LEADS TO PROBLEMS Description:- Server variable "--lower_case_tables_names" when set to "0" on windows platform which does not support case sensitive file operations leads to problems. A warning message is printed in the error log while starting the server with "--lower_case_tables_names=0". Also according to the documentation, seting "lower_case_tables_names" to "0" on a case-insensitive filesystem might lead to index corruption. Analysis:- The problem reported in the bug is:- Creating an INNODB table 'a' and executing a query, "INSERT INTO a SELECT a FROM A;" on a server started with "--lower_case_tables_names=0" and running on a case-insensitive filesystem leads innodb to flat spin. Optimizer thinks that "a" and "A" are two different tables as the variable "lower_case_table_names" is set to "0". As a result, optimizer comes up with a plan which does not need a temporary table. If the same table is used in select and insert, a temporary table is needed. This incorrect optimizer plan leads to infinite insertions. Fix:- If the server is started with "--lower_case_tables_names" set to 0 on a case-insensitive filesystem, an error, "The server option 'lower_case_table_names'is configured to use case sensitive table names but the data directory is on a case-insensitive file system which is an unsupported combination. Please consider either using a case sensitive file system for your data directory or switching to a case-insensitive table name mode.", is printed in the server error log and the server exits.
2015-08-21 08:35:42 +05:30
#Server variable option 'lower_case_table_names' sets '0' as default value
#in case sensitive filesystem. Using 'lower_case_table_names=0' in case of
#insensitive filsystem is not allowed.
-- source include/have_case_sensitive_file_system.inc
--source include/have_ujis.inc
--source include/have_innodb.inc
--disable_warnings
drop table if exists `<60>ԣ<EFBFBD>`;
drop table if exists `<60>ԣ<EFBFBD>`;
drop table if exists `<60>ԣ<EFBFBD>`;
drop table if exists `<60>ԣ<EFBFBD>`;
drop table if exists `<60>ԣ<EFBFBD>`;
drop table if exists `<60>ԣ<EFBFBD>`;
drop table if exists `<60>ԣ<EFBFBD>`;
drop table if exists `<60>ԣ<EFBFBD>`;
drop table if exists `<60>ԣ<EFBFBD>`;
--enable_warnings
#
# Test ENUM values with Japanese characters in ujis encoding
#
SET NAMES ujis;
SET character_set_database = ujis;
CREATE TABLE `<60>ԣ<EFBFBD>` (`<60>ã<EFBFBD>` ENUM('<27><>','<27><>','<27><>'), INDEX(`<60>ã<EFBFBD>`)) DEFAULT CHARSET = ujis engine = innodb;
CREATE TABLE `<60>ԣ<EFBFBD>` (`<60>ã<EFBFBD>` ENUM('<27><>','<27><>','<27><>'), INDEX(`<60>ã<EFBFBD>`)) DEFAULT CHARSET = ujis engine = innodb;
CREATE TABLE `<60>ԣ<EFBFBD>` (`<60>ã<EFBFBD>` ENUM('<27><><EFBFBD>','<27><><EFBFBD>','<27><><EFBFBD>'), INDEX(`<60>ã<EFBFBD>`)) DEFAULT CHARSET = ujis engine = innodb;
CREATE TABLE `<60>ԣ<EFBFBD>` (`<60>ã<EFBFBD>` ENUM('<27><>','<27><>','<27><>'), INDEX(`<60>ã<EFBFBD>`)) DEFAULT CHARSET = ujis engine = myisam;
CREATE TABLE `<60>ԣ<EFBFBD>` (`<60>ã<EFBFBD>` ENUM('<27><>','<27><>','<27><>'), INDEX(`<60>ã<EFBFBD>`)) DEFAULT CHARSET = ujis engine = myisam;
CREATE TABLE `<60>ԣ<EFBFBD>` (`<60>ã<EFBFBD>` ENUM('<27><><EFBFBD>','<27><><EFBFBD>','<27><><EFBFBD>'), INDEX(`<60>ã<EFBFBD>`)) DEFAULT CHARSET = ujis engine = myisam;
CREATE TABLE `<60>ԣ<EFBFBD>` (`<60>ã<EFBFBD>` ENUM('<27><>','<27><>','<27><>'), INDEX(`<60>ã<EFBFBD>`)) DEFAULT CHARSET = ujis engine = MEMORY;
CREATE TABLE `<60>ԣ<EFBFBD>` (`<60>ã<EFBFBD>` ENUM('<27><>','<27><>','<27><>'), INDEX(`<60>ã<EFBFBD>`)) DEFAULT CHARSET = ujis engine = MEMORY;
CREATE TABLE `<60>ԣ<EFBFBD>` (`<60>ã<EFBFBD>` ENUM('<27><><EFBFBD>','<27><><EFBFBD>','<27><><EFBFBD>'), INDEX(`<60>ã<EFBFBD>`)) DEFAULT CHARSET = ujis engine = MEMORY;
INSERT INTO `<60>ԣ<EFBFBD>` VALUES ('<27><>'),('<27><>'),('<27><>');
INSERT INTO `<60>ԣ<EFBFBD>` VALUES ('<27><>'),('<27><>'),('<27><>');
INSERT INTO `<60>ԣ<EFBFBD>` VALUES ('<27><><EFBFBD>'),('<27><><EFBFBD>'),('<27><><EFBFBD>');
INSERT INTO `<60>ԣ<EFBFBD>` VALUES ('<27><>'),('<27><>'),('<27><>');
INSERT INTO `<60>ԣ<EFBFBD>` VALUES ('<27><>'),('<27><>'),('<27><>');
INSERT INTO `<60>ԣ<EFBFBD>` VALUES ('<27><><EFBFBD>'),('<27><><EFBFBD>'),('<27><><EFBFBD>');
INSERT INTO `<60>ԣ<EFBFBD>` VALUES ('<27><>'),('<27><>'),('<27><>');
INSERT INTO `<60>ԣ<EFBFBD>` VALUES ('<27><>'),('<27><>'),('<27><>');
INSERT INTO `<60>ԣ<EFBFBD>` VALUES ('<27><><EFBFBD>'),('<27><><EFBFBD>'),('<27><><EFBFBD>');
SELECT * FROM `<60>ԣ<EFBFBD>`;
SELECT * FROM `<60>ԣ<EFBFBD>`;
SELECT * FROM `<60>ԣ<EFBFBD>`;
SELECT * FROM `<60>ԣ<EFBFBD>`;
SELECT * FROM `<60>ԣ<EFBFBD>`;
SELECT * FROM `<60>ԣ<EFBFBD>`;
SELECT * FROM `<60>ԣ<EFBFBD>`;
SELECT * FROM `<60>ԣ<EFBFBD>`;
SELECT * FROM `<60>ԣ<EFBFBD>`;
SHOW CREATE TABLE `<60>ԣ<EFBFBD>`;
SHOW CREATE TABLE `<60>ԣ<EFBFBD>`;
SHOW CREATE TABLE `<60>ԣ<EFBFBD>`;
SHOW CREATE TABLE `<60>ԣ<EFBFBD>`;
SHOW CREATE TABLE `<60>ԣ<EFBFBD>`;
SHOW CREATE TABLE `<60>ԣ<EFBFBD>`;
SHOW CREATE TABLE `<60>ԣ<EFBFBD>`;
SHOW CREATE TABLE `<60>ԣ<EFBFBD>`;
SHOW CREATE TABLE `<60>ԣ<EFBFBD>`;
DESC `<60>ԣ<EFBFBD>`;
DESC `<60>ԣ<EFBFBD>`;
DESC `<60>ԣ<EFBFBD>`;
DESC `<60>ԣ<EFBFBD>`;
DESC `<60>ԣ<EFBFBD>`;
DESC `<60>ԣ<EFBFBD>`;
DESC `<60>ԣ<EFBFBD>`;
DESC `<60>ԣ<EFBFBD>`;
DESC `<60>ԣ<EFBFBD>`;
#
# Test problem with enum values after the colum with NOT NULL restriction
#
ALTER TABLE `<60>ԣ<EFBFBD>` ADD `<60>ã<EFBFBD>` CHAR(1) NOT NULL FIRST;
ALTER TABLE `<60>ԣ<EFBFBD>` ADD `<60>ã<EFBFBD>` CHAR(1) NOT NULL FIRST;
ALTER TABLE `<60>ԣ<EFBFBD>` ADD `<60>ã<EFBFBD>` CHAR(1) NOT NULL FIRST;
ALTER TABLE `<60>ԣ<EFBFBD>` ADD `<60>ã<EFBFBD>` CHAR(1) NOT NULL FIRST;
ALTER TABLE `<60>ԣ<EFBFBD>` ADD `<60>ã<EFBFBD>` CHAR(1) NOT NULL FIRST;
ALTER TABLE `<60>ԣ<EFBFBD>` ADD `<60>ã<EFBFBD>` CHAR(1) NOT NULL FIRST;
ALTER TABLE `<60>ԣ<EFBFBD>` ADD `<60>ã<EFBFBD>` CHAR(1) NOT NULL FIRST;
ALTER TABLE `<60>ԣ<EFBFBD>` ADD `<60>ã<EFBFBD>` CHAR(1) NOT NULL FIRST;
ALTER TABLE `<60>ԣ<EFBFBD>` ADD `<60>ã<EFBFBD>` CHAR(1) NOT NULL FIRST;
SHOW CREATE TABLE `<60>ԣ<EFBFBD>`;
SHOW CREATE TABLE `<60>ԣ<EFBFBD>`;
SHOW CREATE TABLE `<60>ԣ<EFBFBD>`;
SHOW CREATE TABLE `<60>ԣ<EFBFBD>`;
SHOW CREATE TABLE `<60>ԣ<EFBFBD>`;
SHOW CREATE TABLE `<60>ԣ<EFBFBD>`;
SHOW CREATE TABLE `<60>ԣ<EFBFBD>`;
SHOW CREATE TABLE `<60>ԣ<EFBFBD>`;
SHOW CREATE TABLE `<60>ԣ<EFBFBD>`;
DESC `<60>ԣ<EFBFBD>`;
DESC `<60>ԣ<EFBFBD>`;
DESC `<60>ԣ<EFBFBD>`;
DESC `<60>ԣ<EFBFBD>`;
DESC `<60>ԣ<EFBFBD>`;
DESC `<60>ԣ<EFBFBD>`;
DESC `<60>ԣ<EFBFBD>`;
DESC `<60>ԣ<EFBFBD>`;
DESC `<60>ԣ<EFBFBD>`;
DROP TABLE `<60>ԣ<EFBFBD>`;
DROP TABLE `<60>ԣ<EFBFBD>`;
DROP TABLE `<60>ԣ<EFBFBD>`;
DROP TABLE `<60>ԣ<EFBFBD>`;
DROP TABLE `<60>ԣ<EFBFBD>`;
DROP TABLE `<60>ԣ<EFBFBD>`;
DROP TABLE `<60>ԣ<EFBFBD>`;
DROP TABLE `<60>ԣ<EFBFBD>`;
DROP TABLE `<60>ԣ<EFBFBD>`;