Bug #69314 ignore-db-dir option doesn't work for databases with an * in the name
Submitted: 24 May 2013 21:33 Modified: 25 May 2013 7:55
Reporter: Daniël van Eeden (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Options Severity:S3 (Non-critical)
Version:5.7.1 OS:Any
Assigned to: CPU Architecture:Any

[24 May 2013 21:33] Daniël van Eeden
Description:
The ignore-db-dir can hide databases with 'normal' names, but it doesn't work for a database named 'a*'.

How to repeat:
See attached test case

https://bazaar.launchpad.net/~dveeden/mysql-server/ignore-db-bug/revision/5217

Suggested fix:
Also consider databases with * in the name.
[24 May 2013 21:34] Daniël van Eeden
Test case

Attachment: ignore-db-dirs-test.patch (application/stream, text), 1.21 KiB.

[25 May 2013 7:55] MySQL Verification Team
Hello Daniel,

Thank you for the report and contribution.

Thanks,
Umesh
[25 May 2013 7:56] MySQL Verification Team
[ushastry@ushastry mysql-test]$ cat t/ignore-db-dirs.test 

select @@ignore_db_dirs;

--disable_warnings
DROP DATABASE IF EXISTS `a*`;
DROP DATABASE IF EXISTS `b*`;
DROP DATABASE IF EXISTS `cc`;
DROP DATABASE IF EXISTS `dd`;

--enable_warnings
 
CREATE DATABASE `a*`;
CREATE DATABASE `b*`;
CREATE DATABASE `cc`;
CREATE DATABASE `dd`;
SHOW DATABASES;
select schema_name from information_schema.schemata;
select @@ignore_db_dirs;

--echo # Cleanup.

DROP DATABASE IF EXISTS `a*`;
DROP DATABASE IF EXISTS `b*`;
DROP DATABASE IF EXISTS `cc`;
DROP DATABASE IF EXISTS `dd`;
[ushastry@ushastry mysql-test]$ ./mysql-test-run --mysqld=--ignore-db-dir='a*' --mysqld=--ignore-db-dir='cc' ignore-db-dirs
Logging: ./mysql-test-run  --mysqld=--ignore-db-dir=a* --mysqld=--ignore-db-dir=cc ignore-db-dirs
2013-05-25 13:23:38 0 [Warning] Changed limits: max_open_files: 1024  max_connections: 151  table_cache: 431
2013-05-25 13:23:38 1501 [Note] Plugin 'FEDERATED' is disabled.
2013-05-25 13:23:38 1501 [Note] Binlog end
2013-05-25 13:23:38 1501 [Note] Shutting down plugin 'CSV'
2013-05-25 13:23:38 1501 [Note] Shutting down plugin 'MyISAM'
MySQL Version 5.7.1
Checking supported features...
 - SSL connections supported
 - binaries are debug compiled
Collecting tests...
Checking leftover processes...
Removing old var directory...
Creating var directory '/home/ushastry/mybuilds/mysql-5.7.1/mysql-test/var'...
Installing system database...
Using server port 55254

==============================================================================

TEST                                      RESULT   TIME (ms) or COMMENT
--------------------------------------------------------------------------

worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 13000..13009
select @@ignore_db_dirs;
@@ignore_db_dirs
a*,cc
DROP DATABASE IF EXISTS `a*`;
DROP DATABASE IF EXISTS `b*`;
DROP DATABASE IF EXISTS `cc`;
DROP DATABASE IF EXISTS `dd`;
CREATE DATABASE `a*`;
CREATE DATABASE `b*`;
CREATE DATABASE `cc`;
CREATE DATABASE `dd`;
SHOW DATABASES;
Database
information_schema
a*
b*
dd
mtr
mysql
performance_schema
test
select schema_name from information_schema.schemata;
schema_name
information_schema
a*
b*
dd
mtr
mysql
performance_schema
test
select @@ignore_db_dirs;
@@ignore_db_dirs
a*,cc
# Cleanup.
DROP DATABASE IF EXISTS `a*`;
DROP DATABASE IF EXISTS `b*`;
DROP DATABASE IF EXISTS `cc`;
DROP DATABASE IF EXISTS `dd`;
main.ignore-db-dirs                      [ pass ]     17
--------------------------------------------------------------------------
The servers were restarted 0 times
Spent 0.017 of 9 seconds executing testcases

Completed: All 1 tests were successful.