diff options
author | unknown <jimw@mysql.com> | 2005-08-31 18:32:15 -0700 |
---|---|---|
committer | unknown <jimw@mysql.com> | 2005-08-31 18:32:15 -0700 |
commit | b33e9493a1e21b240e935788cd07696f237e8e94 (patch) | |
tree | a60bbdc85012c14e9a336099e853fddfb6062bad | |
parent | e6ac9175d13091b8bd7661b5e8ae8d3add81fbb0 (diff) | |
download | mariadb-git-b33e9493a1e21b240e935788cd07696f237e8e94.tar.gz |
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''
-rw-r--r-- | mysql-test/include/windows.inc | 4 | ||||
-rw-r--r-- | mysql-test/r/lowercase_table.result | 6 | ||||
-rw-r--r-- | mysql-test/r/windows.result | 8 | ||||
-rw-r--r-- | mysql-test/t/lowercase_table.test | 10 | ||||
-rw-r--r-- | mysql-test/t/windows.test | 20 | ||||
-rw-r--r-- | mysys/my_access.c | 2 |
6 files changed, 33 insertions, 17 deletions
diff --git a/mysql-test/include/windows.inc b/mysql-test/include/windows.inc new file mode 100644 index 00000000000..05ec7b0e021 --- /dev/null +++ b/mysql-test/include/windows.inc @@ -0,0 +1,4 @@ +--require r/true.require +disable_query_log; +select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") as "TRUE"; +enable_query_log; diff --git a/mysql-test/r/lowercase_table.result b/mysql-test/r/lowercase_table.result index 499f46a237e..ef379cebaa9 100644 --- a/mysql-test/r/lowercase_table.result +++ b/mysql-test/r/lowercase_table.result @@ -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' diff --git a/mysql-test/r/windows.result b/mysql-test/r/windows.result new file mode 100644 index 00000000000..039c5b1476e --- /dev/null +++ b/mysql-test/r/windows.result @@ -0,0 +1,8 @@ +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; diff --git a/mysql-test/t/lowercase_table.test b/mysql-test/t/lowercase_table.test index 4d33c8c1c48..709743ce687 100644 --- a/mysql-test/t/lowercase_table.test +++ b/mysql-test/t/lowercase_table.test @@ -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 diff --git a/mysql-test/t/windows.test b/mysql-test/t/windows.test new file mode 100644 index 00000000000..d6bcfeb8cb3 --- /dev/null +++ b/mysql-test/t/windows.test @@ -0,0 +1,20 @@ +# 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 diff --git a/mysys/my_access.c b/mysys/my_access.c index 8fc83a020cf..237312b5c9b 100644 --- a/mysys/my_access.c +++ b/mysys/my_access.c @@ -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); } |