Commit 51256b60 authored by Sergei Golubchik's avatar Sergei Golubchik

fixes for lower_case_table_names=2

parent c9801135
...@@ -613,7 +613,7 @@ DROP TABLE t1; ...@@ -613,7 +613,7 @@ DROP TABLE t1;
# Test Case from MDEV-21067 # Test Case from MDEV-21067
# #
CREATE DATABASE world; CREATE DATABASE world;
CREATE TABLE world.City ( CREATE TABLE world.city (
ID INT AUTO_INCREMENT PRIMARY KEY, ID INT AUTO_INCREMENT PRIMARY KEY,
Name VARCHAR(64), Name VARCHAR(64),
CountryCode VARCHAR(64), CountryCode VARCHAR(64),
...@@ -625,35 +625,35 @@ ID INT AUTO_INCREMENT PRIMARY KEY, ...@@ -625,35 +625,35 @@ ID INT AUTO_INCREMENT PRIMARY KEY,
REC VARCHAR(64), REC VARCHAR(64),
ts TIMESTAMP ts TIMESTAMP
) ENGINE=InnoDB; ) ENGINE=InnoDB;
INSERT INTO world.City VALUES (NULL, 'Davenport', 'USA', 'Iowa', 100); INSERT INTO world.city VALUES (NULL, 'Davenport', 'USA', 'Iowa', 100);
INSERT INTO world.City VALUES (NULL, 'Boulder', 'USA', 'Colorado', 1000); INSERT INTO world.city VALUES (NULL, 'Boulder', 'USA', 'Colorado', 1000);
INSERT INTO world.City VALUES (NULL, 'Gweru', 'ZWE', 'Midlands', 10000); INSERT INTO world.city VALUES (NULL, 'Gweru', 'ZWE', 'Midlands', 10000);
RESET MASTER; RESET MASTER;
CHECKSUM TABLE world.City; CHECKSUM TABLE world.city;
Table Checksum Table Checksum
world.City 563256876 world.city 563256876
INSERT INTO test.test VALUES (NULL, 'Good record 1', CURRENT_TIMESTAMP()); INSERT INTO test.test VALUES (NULL, 'Good record 1', CURRENT_TIMESTAMP());
INSERT INTO world.City VALUES (NULL, 'Wrong value 1', '000', 'Wrong', 0); INSERT INTO world.city VALUES (NULL, 'Wrong value 1', '000', 'Wrong', 0);
INSERT INTO world.City VALUES (NULL, 'Wrong value 2', '000', 'Wrong', 0) , (NULL, 'Wrong value 3', '000', 'Wrong', 0); INSERT INTO world.city VALUES (NULL, 'Wrong value 2', '000', 'Wrong', 0) , (NULL, 'Wrong value 3', '000', 'Wrong', 0);
INSERT INTO test.test VALUES (NULL, 'Good record 2', CURRENT_TIMESTAMP()); INSERT INTO test.test VALUES (NULL, 'Good record 2', CURRENT_TIMESTAMP());
UPDATE world.City SET Population = 99999999 WHERE ID IN (1, 2, 3); UPDATE world.city SET Population = 99999999 WHERE ID IN (1, 2, 3);
INSERT INTO test.test VALUES (NULL, 'Good record 3', CURRENT_TIMESTAMP()); INSERT INTO test.test VALUES (NULL, 'Good record 3', CURRENT_TIMESTAMP());
DELETE FROM world.City WHERE ID BETWEEN 1 AND 2; DELETE FROM world.city WHERE ID BETWEEN 1 AND 2;
INSERT INTO test.test VALUES (NULL, 'Good record 5', CURRENT_TIMESTAMP()); INSERT INTO test.test VALUES (NULL, 'Good record 5', CURRENT_TIMESTAMP());
REPLACE INTO world.City VALUES (4074, 'Wrong value 4', '000', 'Wrong', 0); REPLACE INTO world.city VALUES (4074, 'Wrong value 4', '000', 'Wrong', 0);
REPLACE INTO world.City VALUES (4078, 'Wrong value 5', '000', 'Wrong', 0), (NULL, 'Wrong value 6', '000', 'Wrong', 0); REPLACE INTO world.city VALUES (4078, 'Wrong value 5', '000', 'Wrong', 0), (NULL, 'Wrong value 6', '000', 'Wrong', 0);
INSERT INTO test.test VALUES (NULL, 'Good record 6', CURRENT_TIMESTAMP()); INSERT INTO test.test VALUES (NULL, 'Good record 6', CURRENT_TIMESTAMP());
INSERT INTO world.City INSERT INTO world.city
SELECT NULL, Name, CountryCode, District, Population FROM world.City WHERE ID BETWEEN 2 AND 10; SELECT NULL, Name, CountryCode, District, Population FROM world.city WHERE ID BETWEEN 2 AND 10;
INSERT INTO test.test VALUES (NULL, 'Good record 7', CURRENT_TIMESTAMP()); INSERT INTO test.test VALUES (NULL, 'Good record 7', CURRENT_TIMESTAMP());
INSERT INTO test.test VALUES (NULL, 'Good record 8', CURRENT_TIMESTAMP()); INSERT INTO test.test VALUES (NULL, 'Good record 8', CURRENT_TIMESTAMP());
DELETE FROM world.City; DELETE FROM world.city;
INSERT INTO test.test VALUES (NULL, 'Good record 9', CURRENT_TIMESTAMP()); INSERT INTO test.test VALUES (NULL, 'Good record 9', CURRENT_TIMESTAMP());
FLUSH LOGS; FLUSH LOGS;
# < CASE 6 > # < CASE 6 >
# Flashback & Check the result # Flashback & Check the result
# #
SELECT * FROM world.City; SELECT * FROM world.city;
ID Name CountryCode District Population ID Name CountryCode District Population
1 Davenport USA Iowa 100 1 Davenport USA Iowa 100
2 Boulder USA Colorado 1000 2 Boulder USA Colorado 1000
...@@ -668,11 +668,11 @@ ID REC ts ...@@ -668,11 +668,11 @@ ID REC ts
6 Good record 7 2001-09-09 09:46:40 6 Good record 7 2001-09-09 09:46:40
7 Good record 8 2001-09-09 09:46:40 7 Good record 8 2001-09-09 09:46:40
8 Good record 9 2001-09-09 09:46:40 8 Good record 9 2001-09-09 09:46:40
CHECKSUM TABLE world.City; CHECKSUM TABLE world.city;
Table Checksum Table Checksum
world.City 563256876 world.city 563256876
DROP TABLE test.test; DROP TABLE test.test;
DROP TABLE world.City; DROP TABLE world.city;
DROP DATABASE world; DROP DATABASE world;
SET binlog_format=statement; SET binlog_format=statement;
Warnings: Warnings:
......
...@@ -260,7 +260,7 @@ DROP TABLE t1; ...@@ -260,7 +260,7 @@ DROP TABLE t1;
# Init Structure # Init Structure
CREATE DATABASE world; CREATE DATABASE world;
CREATE TABLE world.City ( CREATE TABLE world.city (
ID INT AUTO_INCREMENT PRIMARY KEY, ID INT AUTO_INCREMENT PRIMARY KEY,
Name VARCHAR(64), Name VARCHAR(64),
CountryCode VARCHAR(64), CountryCode VARCHAR(64),
...@@ -273,43 +273,43 @@ CREATE TABLE test.test ( ...@@ -273,43 +273,43 @@ CREATE TABLE test.test (
ts TIMESTAMP ts TIMESTAMP
) ENGINE=InnoDB; ) ENGINE=InnoDB;
INSERT INTO world.City VALUES (NULL, 'Davenport', 'USA', 'Iowa', 100); INSERT INTO world.city VALUES (NULL, 'Davenport', 'USA', 'Iowa', 100);
INSERT INTO world.City VALUES (NULL, 'Boulder', 'USA', 'Colorado', 1000); INSERT INTO world.city VALUES (NULL, 'Boulder', 'USA', 'Colorado', 1000);
INSERT INTO world.City VALUES (NULL, 'Gweru', 'ZWE', 'Midlands', 10000); INSERT INTO world.city VALUES (NULL, 'Gweru', 'ZWE', 'Midlands', 10000);
RESET MASTER; RESET MASTER;
CHECKSUM TABLE world.City; CHECKSUM TABLE world.city;
# Insert test data # Insert test data
INSERT INTO test.test VALUES (NULL, 'Good record 1', CURRENT_TIMESTAMP()); INSERT INTO test.test VALUES (NULL, 'Good record 1', CURRENT_TIMESTAMP());
INSERT INTO world.City VALUES (NULL, 'Wrong value 1', '000', 'Wrong', 0); INSERT INTO world.city VALUES (NULL, 'Wrong value 1', '000', 'Wrong', 0);
INSERT INTO world.City VALUES (NULL, 'Wrong value 2', '000', 'Wrong', 0) , (NULL, 'Wrong value 3', '000', 'Wrong', 0); INSERT INTO world.city VALUES (NULL, 'Wrong value 2', '000', 'Wrong', 0) , (NULL, 'Wrong value 3', '000', 'Wrong', 0);
INSERT INTO test.test VALUES (NULL, 'Good record 2', CURRENT_TIMESTAMP()); INSERT INTO test.test VALUES (NULL, 'Good record 2', CURRENT_TIMESTAMP());
UPDATE world.City SET Population = 99999999 WHERE ID IN (1, 2, 3); UPDATE world.city SET Population = 99999999 WHERE ID IN (1, 2, 3);
INSERT INTO test.test VALUES (NULL, 'Good record 3', CURRENT_TIMESTAMP()); INSERT INTO test.test VALUES (NULL, 'Good record 3', CURRENT_TIMESTAMP());
DELETE FROM world.City WHERE ID BETWEEN 1 AND 2; DELETE FROM world.city WHERE ID BETWEEN 1 AND 2;
INSERT INTO test.test VALUES (NULL, 'Good record 5', CURRENT_TIMESTAMP()); INSERT INTO test.test VALUES (NULL, 'Good record 5', CURRENT_TIMESTAMP());
REPLACE INTO world.City VALUES (4074, 'Wrong value 4', '000', 'Wrong', 0); REPLACE INTO world.city VALUES (4074, 'Wrong value 4', '000', 'Wrong', 0);
REPLACE INTO world.City VALUES (4078, 'Wrong value 5', '000', 'Wrong', 0), (NULL, 'Wrong value 6', '000', 'Wrong', 0); REPLACE INTO world.city VALUES (4078, 'Wrong value 5', '000', 'Wrong', 0), (NULL, 'Wrong value 6', '000', 'Wrong', 0);
INSERT INTO test.test VALUES (NULL, 'Good record 6', CURRENT_TIMESTAMP()); INSERT INTO test.test VALUES (NULL, 'Good record 6', CURRENT_TIMESTAMP());
INSERT INTO world.City INSERT INTO world.city
SELECT NULL, Name, CountryCode, District, Population FROM world.City WHERE ID BETWEEN 2 AND 10; SELECT NULL, Name, CountryCode, District, Population FROM world.city WHERE ID BETWEEN 2 AND 10;
INSERT INTO test.test VALUES (NULL, 'Good record 7', CURRENT_TIMESTAMP()); INSERT INTO test.test VALUES (NULL, 'Good record 7', CURRENT_TIMESTAMP());
INSERT INTO test.test VALUES (NULL, 'Good record 8', CURRENT_TIMESTAMP()); INSERT INTO test.test VALUES (NULL, 'Good record 8', CURRENT_TIMESTAMP());
DELETE FROM world.City; DELETE FROM world.city;
INSERT INTO test.test VALUES (NULL, 'Good record 9', CURRENT_TIMESTAMP()); INSERT INTO test.test VALUES (NULL, 'Good record 9', CURRENT_TIMESTAMP());
...@@ -321,18 +321,18 @@ FLUSH LOGS; ...@@ -321,18 +321,18 @@ FLUSH LOGS;
let $MYSQLD_DATADIR= `select @@datadir`; let $MYSQLD_DATADIR= `select @@datadir`;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--exec $MYSQL_BINLOG --database=world --table=City -vv $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_row_flashback_original_6.sql --exec $MYSQL_BINLOG --database=world --table=city -vv $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_row_flashback_original_6.sql
--exec $MYSQL_BINLOG --database=world --table=City -B $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_row_flashback_6.sql --exec $MYSQL_BINLOG --database=world --table=city -B $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_row_flashback_6.sql
--exec $MYSQL -e "SET binlog_format= ROW; source $MYSQLTEST_VARDIR/tmp/mysqlbinlog_row_flashback_6.sql;" --exec $MYSQL -e "SET binlog_format= ROW; source $MYSQLTEST_VARDIR/tmp/mysqlbinlog_row_flashback_6.sql;"
SELECT * FROM world.City; SELECT * FROM world.city;
SELECT * FROM test.test; SELECT * FROM test.test;
CHECKSUM TABLE world.City; CHECKSUM TABLE world.city;
DROP TABLE test.test; DROP TABLE test.test;
DROP TABLE world.City; DROP TABLE world.city;
DROP DATABASE world; DROP DATABASE world;
## Clear ## Clear
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment