Bug #13933 Path name replacement fails in case-insignificant systems
Submitted: 11 Oct 2005 16:31 Modified: 24 Apr 2006 5:09
Reporter: Joerg Bruehe Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.15 and up OS:MacOS (Mac OS X 10.4)
Assigned to: CPU Architecture:Any

[11 Oct 2005 16:31] Joerg Bruehe
Description:
If the tests are run on a case-insignificant file system, chances are that the directory name is reported by the system in a case which differs from some variable settings used.
As a result, replacement of path names in error logs fails, and (semanticvally) identical test results show differences.

Consider this:
mysqldev@xserve:~> ls -dl xserve
lrwxr-xr-x   1 mysqldev  mysqldev  33 May 31 09:23 xserve -> /Volumes/StripedRAID/Build/xserve
mysqldev@xserve:~> cd /Volumes/StripedRAID/Build/xserve
mysqldev@xserve:/Volumes/StripedRAID/Build/xserve> pwd
/Volumes/StripedRAID/Build/xserve
(all in mixed case on shell level)

and compare it with this message:
ERROR HY000: Can't create table '/volumes/stripedraid/build/xserve/test/mysql-standard-4.1.15-apple-darwin8.2.0-powerpc/mysql-test/test/t2.frm' (errno: 150)
(lower case)

It seems that the variable MYSQL_TEST_DIR contains the mixed spelling when it is used in test case "innodb.test":
   1099 # Test error handling
   1100 --replace_result \\ / $MYSQL_TEST_DIR . /var/master-data/ /
   1101 --error 1005
   1102 create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (        id)) engine = innodb;

However, in the error message generated, small letters are used, and as a result we get this diff:
-------------------------------------------------------
*** r/innodb.result
--- r/innodb.reject
***************
*** 1570,1576
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1
  drop table t2;
  create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb;
! ERROR HY000: Can't create table './test/t2.frm' (errno: 150)
  create table t2 (a int auto_increment primary key, b int, index(b), foreign key (b) references t1(id), unique(b)) engine=innodb;
  show create table t2;
  Table Create Table
--- 1570,1576
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1
  drop table t2;
  create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb;
! ERROR HY000: Can't create table '/volumes/stripedraid/build/xserve/test/mysql-standard-4.1.15-apple-darwin8.2.0-powerpc/mysql-test/test/t2.frm' (errno: 150)
  create table t2 (a int auto_increment primary key, b int, index(b), foreign key (b) references t1(id), unique(b)) engine=innodb;
  show create table t2;
  Table Create Table
-------------------------------------------------------

How to repeat:
Test suite failure.

Suggested fix:
a) Change the config and the variables to use exactly the same spelling as will be contained in error messages
OR
b) Change the replacement function to work case-insignificant (seems risky to me).
[25 Sep 2007 9:04] Lars Thalmann
This will be solved by WL#922.
[25 Sep 2007 9:27] Lars Thalmann
Please disregard previous comment done today Sept 25.  Should be fixed
in test suite.
[25 Sep 2007 9:29] Lars Thalmann
Solution might be to add test command

  --replace_case_insensitive PaTh/MyFiLeNaMe XXX

to the test suite.
[5 Oct 2007 10:59] Magnus BlÄudd
Use existing --replace_result and or --replace_regex to fix this.
[13 Jun 2009 11:53] Bernt Marius Johnsen
This is not a customer issue, it has been around for 4 years, and I would argue that it's a server bug. The error message should contain the native version of the path, not the lowercase version which mysql generates for it's own internal purposes. I would say that this is not a test bug.