Bug #23683 | SHOW DATABASES doesn't filter invalid directory names | ||
---|---|---|---|
Submitted: | 26 Oct 2006 19:33 | Modified: | 17 Jan 2014 15:28 |
Reporter: | Jose Luis Martinez | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Charsets | Severity: | S3 (Non-critical) |
Version: | 5.0.20 | OS: | Linux (Linux) |
Assigned to: | Assigned Account | CPU Architecture: | Any |
Tags: | Contribution, show databases dot name backslash |
[26 Oct 2006 19:33]
Jose Luis Martinez
[26 Oct 2006 20:08]
MySQL Verification Team
Thank you for the bug report.
[10 May 2007 19:02]
Holman Romero
Simple fix by calling check_db_name() patch can be found at: http://noslave.net/holman/devel/mysql/patches/show_databases_5_0_41.patch or attached
[10 May 2007 19:04]
Holman Romero
it applies against 5.0.41
Attachment: show_databases_5_0_41.patch (application/octet-stream, text), 399 bytes.
[25 Jul 2007 4:36]
Anatoly Pidruchny
Hi everybody, I want to add a comment to this bug report. If lower_case_table_names system variable is set to 1 and a sub-directory is created in the data directory with the name that is not all lowercase, then this name is also should be treated as invalid and should be filtered out. For example, go to the data directory, and create the sub-directory FOO: $ mkdir FOO Then run SHOW DATABASES: mysql> SHOW DATABASES; +--------------------+ | Database | +--------------------+ | information_schema | | FOO | | mysql | | test | +--------------------+ 4 rows in set (0.00 sec) The name FOO shows up in the list. But an error happens if you try to "use" it: mysql> use FOO; ERROR 1049 (42000): Unknown database 'foo' Regards, Anatoly Pidruchny.
[3 Apr 2008 9:06]
Sergei Glukhov
The problem with invalid symbols in db|table name is fixed in 5.1. Example: create database `test.one`; create database `test\\two`; show databases; Database information_schema mysql test test.one test\\two use `test.one`; select database(); database() test.one use `test\\two`; select database(); database() test\\two The problem with lower_case_table_names and upper case db names will be fixed later(WL#922 Case-Sensitive Delimited Identifiers)