STATUS
------
Patch approved pending the requests are satisfied.
REQUESTS
--------
Add new test attached (per developer's request) to the patch prior to
pushing.
DETAILS
-------
> Bug#39063 - Online Backup: Backup behavior changes with the case used for the
> database name
>
> Before, the database list for BACKUP was case sensitive. This caused problems
> in case insensitive servers because database 'X' and 'x' is considered the same database
> while backup would fail if the wrong case was used.
>
> With this patch, the database names are converted to lower case when BACKUP is
> executed on a case insensitive server.
...
Chuck
#
# This test is designed to ensure the backup can successfully
# backup and retore databases with upper case names when the
# --lower_case_table_names = 2 on the Windows platform.
#
--source include/not_embedded.inc
--source include/windows.inc
let $MYSQLD_BACKUPDIR= `select @@backupdir`;
--echo #
--echo # Create a database and some data using an upper
--echo # case database name.
--echo #
CREATE DATABASE YYZ;
CREATE TABLE YYZ.t1 (a int) ENGINE=MEMORY;
INSERT INTO YYZ.t1 values (1), (2), (3);
--echo #
--echo # Run the backup.
--echo #
--replace_column 1 #
BACKUP DATABASE YYZ to 'upper.bak';
--echo #
--echo # Show the list of databases. YYZ should appear.
--echo #
SHOW DATABASES;
DROP TABLE YYZ.t1;
DROP DATABASE YYZ;
--echo #
--echo # Run the restore.
--echo #
--replace_column 1 #
RESTORE FROM 'upper.bak' OVERWRITE;
--echo #
--echo # Show the list of databases. YYZ should appear.
--echo #
SHOW DATABASES;
--echo #
--echo # Create a database and some data using a lower
--echo # case database name.
--echo #
CREATE DATABASE diy;
CREATE TABLE diy.t1 (a int) ENGINE=MEMORY;
--echo #
--echo # Run the backup.
--echo #
--replace_column 1 #
BACKUP DATABASE diy to 'lower.bak';
--echo #
--echo # Show the list of databases. diy should appear.
--echo #
SHOW DATABASES;
DROP TABLE diy.t1;
DROP DATABASE diy;
--echo #
--echo # Run the restore.
--echo #
--replace_column 1 #
RESTORE FROM 'lower.bak' OVERWRITE;
--echo #
--echo # Show the list of databases. diy should appear.
--echo #
SHOW DATABASES;
--echo #
--echo # Cleanup
--echo #
DROP TABLE YYZ.t1;
DROP DATABASE YYZ;
DROP TABLE diy.t1;
DROP DATABASE diy;
--remove_file $MYSQLD_BACKUPDIR/upper.bak
--remove_file $MYSQLD_BACKUPDIR/lower.bak
--lower_case_table_names=2
#
# Create a database and some data using an upper
# case database name.
#
CREATE DATABASE YYZ;
CREATE TABLE YYZ.t1 (a int) ENGINE=MEMORY;
INSERT INTO YYZ.t1 values (1), (2), (3);
#
# Run the backup.
#
BACKUP DATABASE YYZ to 'upper.bak';
backup_id
#
#
# Show the list of databases. YYZ should appear.
#
SHOW DATABASES;
Database
information_schema
YYZ
mtr
mysql
test
DROP TABLE YYZ.t1;
DROP DATABASE YYZ;
#
# Run the restore.
#
RESTORE FROM 'upper.bak' OVERWRITE;
backup_id
#
#
# Show the list of databases. YYZ should appear.
#
SHOW DATABASES;
Database
information_schema
YYZ
mtr
mysql
test
#
# Create a database and some data using a lower
# case database name.
#
CREATE DATABASE diy;
CREATE TABLE diy.t1 (a int) ENGINE=MEMORY;
#
# Run the backup.
#
BACKUP DATABASE diy to 'lower.bak';
backup_id
#
#
# Show the list of databases. diy should appear.
#
SHOW DATABASES;
Database
information_schema
YYZ
diy
mtr
mysql
test
DROP TABLE diy.t1;
DROP DATABASE diy;
#
# Run the restore.
#
RESTORE FROM 'lower.bak' OVERWRITE;
backup_id
#
#
# Show the list of databases. diy should appear.
#
SHOW DATABASES;
Database
information_schema
YYZ
diy
mtr
mysql
test
#
# Cleanup
#
DROP TABLE YYZ.t1;
DROP DATABASE YYZ;
DROP TABLE diy.t1;
DROP DATABASE diy;