Commit b33e9493 authored by unknown's avatar unknown

Fix handling of filenames that start the same as reserved filenames

on Windows. (Bug #12325)


mysql-test/r/lowercase_table.result:
  Update results
mysql-test/t/lowercase_table.test:
  Move test to new windows.test, since it is Windows-specific
mysys/my_access.c:
  Check that we've matched the whole forbidden name.
mysql-test/include/windows.inc:
  New BitKeeper file ``mysql-test/include/windows.inc''
mysql-test/r/windows.result:
  New BitKeeper file ``mysql-test/r/windows.result''
mysql-test/t/windows.test:
  New BitKeeper file ``mysql-test/t/windows.test''
parent e6ac9175
--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; ...@@ -83,9 +83,3 @@ create table t2 like T1;
drop table t1, t2; drop table t1, t2;
show tables; show tables;
Tables_in_test 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; ...@@ -83,14 +83,4 @@ drop table t1, t2;
show tables; show tables;
#
#Bug 9148: Denial of service
#
--error 1049
use lpt1;
--error 1049
use com1;
--error 1049
use prn;
# End of 4.1 tests # 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) ...@@ -105,7 +105,7 @@ int check_if_legal_filename(const char *path)
{ {
if (*reserved != my_toupper(&my_charset_latin1, *name)) if (*reserved != my_toupper(&my_charset_latin1, *name))
break; break;
if (++name == end) if (++name == end && !reserved[1])
DBUG_RETURN(1); /* Found wrong path */ DBUG_RETURN(1); /* Found wrong path */
} while (*++reserved); } 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