Commit 00b17c1c authored by jimw@mysql.com's avatar jimw@mysql.com

Fix handling of filenames that start the same as reserved filenames

on Windows. (Bug #12325)
parent 16e30aaf
--require r/true.require
disable_query_log;
select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") as "TRUE";
enable_query_log;
......@@ -83,9 +83,3 @@ create table t2 like T1;
drop table t1, t2;
show tables;
Tables_in_test
use lpt1;
ERROR 42000: Unknown database 'lpt1'
use com1;
ERROR 42000: Unknown database 'com1'
use prn;
ERROR 42000: Unknown database 'prn'
use lpt1;
ERROR 42000: Unknown database 'lpt1'
use com1;
ERROR 42000: Unknown database 'com1'
use prn;
ERROR 42000: Unknown database 'prn'
create table nu (a int);
drop table nu;
......@@ -83,14 +83,4 @@ drop table t1, t2;
show tables;
#
#Bug 9148: Denial of service
#
--error 1049
use lpt1;
--error 1049
use com1;
--error 1049
use prn;
# End of 4.1 tests
# Windows-specific tests
--source include/windows.inc
#
# Bug 9148: Denial of service
#
--error 1049
use lpt1;
--error 1049
use com1;
--error 1049
use prn;
#
# Bug #12325: Can't create table named 'nu'
#
create table nu (a int);
drop table nu;
# End of 4.1 tests
......@@ -105,7 +105,7 @@ int check_if_legal_filename(const char *path)
{
if (*reserved != my_toupper(&my_charset_latin1, *name))
break;
if (++name == end)
if (++name == end && !reserved[1])
DBUG_RETURN(1); /* Found wrong path */
} while (*++reserved);
}
......
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