Bug #18769 Tests using "chmod" cannot work on Windows
Submitted: 4 Apr 2006 9:40 Modified: 2 Oct 2008 10:05
Reporter: Joerg Bruehe Email Updates:
Status: Closed Impact on me:
None 
Category:Tests: Server Severity:S3 (Non-critical)
Version:any OS:Microsoft Windows (Windows)
Assigned to: [ name withheld ] CPU Architecture:Any

[4 Apr 2006 9:40] Joerg Bruehe
Description:
This bug report is "for reference", so that test failures can refer to this.

Some tests use "chmod" to change access rights to directories or files which will be accessed by the server, to check that the server reacts in some specified way.
This approach is bound to fail on platforms not supporting "chmod" in the same way it works on Unix.

Example in 5.0.20:
-------------------------------------------------------
--- r/information_schema.result
+++ r/information_schema.reject 2006-04-04 05:01:53.506500000 +0300
@@ -1095,6 +1095,7 @@
 create table mysqltest.t1(a int);
 select table_schema from information_schema.tables where table_schema='mysqltest';
 table_schema
+mysqltest
 drop database mysqltest;
 select column_type, group_concat(table_schema, '.', table_name), count(*) as num
 from information_schema.columns where
-------------------------------------------------------

Reason:
----- Extract of "information_schema.test" -----
#
# Bug #15851 Unlistable directories yield no info from information_schema
#
create database mysqltest;
create table mysqltest.t1(a int);
--exec chmod -r $MYSQLTEST_VARDIR/master-data/mysqltest
select table_schema from information_schema.tables where table_schema='mysqltest';
--exec chmod +r $MYSQLTEST_VARDIR/master-data/mysqltest
drop database mysqltest;
----- end of quote -----
"--exec chmod" takes effect on Unix platforms, so there is no output produced,
but it has no effect on Windows.

How to repeat:
Test on Windows.

Suggested fix:
Move this part to a test which will be skipped on Windows,
or use some way to change access rights which also works on Windows.
[2 Oct 2008 10:05] Joerg Bruehe
Re-examination shows that the problematic part has been moved to a separate test
"information_schema_chmod"
which will not be attempted on Windows.

For further comments, check that test file.
[7 Oct 2008 16:05] Magnus BlÄudd
There is support for chmod(using mysys) builtin to latest mysqltest. Any testcase should be modified to use that function instead of "--exec chmod".

Of course the underlying filesystem in Windows does not support as many "bits" as on a Unix system so some care must still be taken when designing the test case.