Bug #14720 Test "connect" fails if "tmpdir" is set
Submitted: 7 Nov 2005 20:37 Modified: 8 Nov 2005 18:17
Reporter: Joerg Bruehe Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0 + 5.1 OS:Any (All)
Assigned to: Joerg Bruehe CPU Architecture:Any

[7 Nov 2005 20:37] Joerg Bruehe
Description:
(Category "test suite" not possible any more)

Noted in build of 5.1, but same will happen in 5.0.

Test "connect.test" contains lines like these (quoted from 5.1):
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_PORT
--error 1045
connect (fail_con,localhost,root,z,test2);

This should give this contents in "connect.result":
connect(localhost,root,z,test2,MASTER_PORT,MYSQL_TEST_DIR/var/tmp/master.sock);
ERROR 28000: Access denied for user 'root'@'localhost' (using password: YES)

However, it fails with "connect.reject" containing platform-specific text:
connect(localhost,root,z,test2,MASTER_PORT,/tmp/my_build-opnsrv6c/master.sock);
ERROR 28000: Access denied for user 'root'@'localhost' (using password: YES)

After search, I found that in release builds the test suite is run using the "--tmpdir=" parameter, setting it to some host-specific value.
The sockets are then created in that "tmpdir", so the "--replace_result" does not find "$MYSQL_TEST_DIR", and the varying directory is not replaced by constant text.

How to repeat:
Run the test suite, using the "--tmpdir=" parameter.

Suggested fix:
1) Expand "mysql-test-run.pl" to also export the "--tmpdir" value as an environment variable, called "TMPDIR".

2) Change "connect.test" by expanding the strings to replace:
--replace_result ... $TMPDIR MYSQL_TEST_DIR/var/tmp
[7 Nov 2005 21:31] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/32057
[8 Nov 2005 18:17] Joerg Bruehe
No need to go via "TMPDIR", as "MASTER_MYSOCK" is a perfect fit.
Done this way, pushed to 5.0.16 and 5.1.2.
No need for documentation.