mariadb/mysql-test/suite/jp/t/jp_enum_sjis.test
Arun Kuruvila f4ff086abe 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

130 lines
3.9 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#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_sjis.inc
--source include/have_innodb.inc
--character_set sjis
--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 ``;
drop table if exists ``;
drop table if exists ``;
drop table if exists ``;
drop table if exists t1;
--enable_warnings
#
# Test ENUM values with Japanese characters in sjis encoding
#
SET NAMES sjis;
SET character_set_database = sjis;
CREATE TABLE `` (`` ENUM('ア','イ','ウ'), INDEX(``)) DEFAULT CHARSET = sjis engine = innodb;
CREATE TABLE `` (`` ENUM('あ','い','う'), INDEX(``)) DEFAULT CHARSET = sjis engine = innodb;
CREATE TABLE `` (`` ENUM('ソ','十','表'), INDEX(``)) DEFAULT CHARSET = sjis engine = innodb;
CREATE TABLE `` (`` ENUM('ア','イ','ウ'), INDEX(``)) DEFAULT CHARSET = sjis engine = myisam;
CREATE TABLE `` (`` ENUM('あ','い','う'), INDEX(``)) DEFAULT CHARSET = sjis engine = myisam;
CREATE TABLE `` (`` ENUM('ソ','十','表'), INDEX(``)) DEFAULT CHARSET = sjis engine = myisam;
CREATE TABLE `` (`` ENUM('ア','イ','ウ'), INDEX(``)) DEFAULT CHARSET = sjis engine = MEMORY;
CREATE TABLE `` (`` ENUM('あ','い','う'), INDEX(``)) DEFAULT CHARSET = sjis engine = MEMORY;
CREATE TABLE `` (`` ENUM('ソ','十','表'), INDEX(``)) DEFAULT CHARSET = sjis engine = MEMORY;
INSERT INTO `` VALUES ('ア'),('イ'),('ウ');
INSERT INTO `` VALUES ('あ'),('い'),('う');
INSERT INTO `` VALUES ('ソ'),('十'),('表');
INSERT INTO `` VALUES ('ア'),('イ'),('ウ');
INSERT INTO `` VALUES ('あ'),('い'),('う');
INSERT INTO `` VALUES ('ソ'),('十'),('表');
INSERT INTO `` VALUES ('ア'),('イ'),('ウ');
INSERT INTO `` VALUES ('あ'),('い'),('う');
INSERT INTO `` VALUES ('ソ'),('十'),('表');
SELECT * FROM ``;
SELECT * FROM ``;
SELECT * FROM ``;
SELECT * FROM ``;
SELECT * FROM ``;
SELECT * FROM ``;
SELECT * FROM ``;
SELECT * FROM ``;
SELECT * FROM ``;
SHOW CREATE TABLE ``;
SHOW CREATE TABLE ``;
SHOW CREATE TABLE ``;
SHOW CREATE TABLE ``;
SHOW CREATE TABLE ``;
SHOW CREATE TABLE ``;
SHOW CREATE TABLE ``;
SHOW CREATE TABLE ``;
SHOW CREATE TABLE ``;
DESC ``;
DESC ``;
DESC ``;
DESC ``;
DESC ``;
DESC ``;
DESC ``;
DESC ``;
DESC ``;
#
# Test problem with enum values after the colum with NOT NULL restriction
#
ALTER TABLE `` ADD `` CHAR(1) NOT NULL FIRST;
ALTER TABLE `` ADD `` CHAR(1) NOT NULL FIRST;
ALTER TABLE `` ADD `` CHAR(1) NOT NULL FIRST;
ALTER TABLE `` ADD `` CHAR(1) NOT NULL FIRST;
ALTER TABLE `` ADD `` CHAR(1) NOT NULL FIRST;
ALTER TABLE `` ADD `` CHAR(1) NOT NULL FIRST;
ALTER TABLE `` ADD `` CHAR(1) NOT NULL FIRST;
ALTER TABLE `` ADD `` CHAR(1) NOT NULL FIRST;
ALTER TABLE `` ADD `` CHAR(1) NOT NULL FIRST;
SHOW CREATE TABLE ``;
SHOW CREATE TABLE ``;
SHOW CREATE TABLE ``;
SHOW CREATE TABLE ``;
SHOW CREATE TABLE ``;
SHOW CREATE TABLE ``;
SHOW CREATE TABLE ``;
SHOW CREATE TABLE ``;
SHOW CREATE TABLE ``;
#
# Test to distinguish 0x9353 and 0x9373
# Bug#6206 ENUMs are not case sensitive even if declared BINARY
#
CREATE TABLE t1(c1 enum('鉄','都')) default character set = sjis;
INSERT INTO t1 VALUES('鉄'),('都');
SELECT * FROM t1 WHERE c1 LIKE '鉄';
DROP TABLE t1;
DESC ``;
DESC ``;
DESC ``;
DESC ``;
DESC ``;
DESC ``;
DESC ``;
DESC ``;
DESC ``;
DROP TABLE ``;
DROP TABLE ``;
DROP TABLE ``;
DROP TABLE ``;
DROP TABLE ``;
DROP TABLE ``;
DROP TABLE ``;
DROP TABLE ``;
DROP TABLE ``;