Bug #63623 Test case partition_binlog_stmt creates a file in an improper location.
Submitted: 6 Dec 2011 10:27 Modified: 28 Jan 2012 13:11
Reporter: Davi Arnaut (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Tests Severity:S3 (Non-critical)
Version:5.5.20 OS:Any
Assigned to: CPU Architecture:Any
Tags: Contribution

[6 Dec 2011 10:27] Davi Arnaut
Description:
Test case partition_binlog_stmt creates a file in the source code/root mysql-test directory, which is an improper location because mysqltest might not have write permission to the root mysql-test directory, or because it might conflict with other test runs in case of out-of-source builds.

How to repeat:
touch /mysql-server/5.5/mysql-test/init_file.txt
./mtr partition_binlog_stmt

Suggested fix:
Create the file in the mysqltest temporary directory.

--- a/mysql-test/t/partition_binlog_stmt.test
+++ b/mysql-test/t/partition_binlog_stmt.test
@@ -8,7 +8,7 @@ DROP TABLE IF EXISTS t1;
 --echo #
 --echo # Bug#51851: Server with SBR locks mutex twice on LOAD DATA into
 --echo #            partitioned MyISAM table
---write_file init_file.txt
+--write_file $MYSQLTEST_VARDIR/tmp/init_file.txt
 abcd
 EOF
 
@@ -19,8 +19,9 @@ CREATE TABLE t1
  INDEX namelocs (name(255))) ENGINE = MyISAM
 PARTITION BY HASH(id) PARTITIONS 2;
 
-LOAD DATA LOCAL INFILE 'init_file.txt'
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval LOAD DATA LOCAL INFILE '$MYSQLTEST_VARDIR/tmp/init_file.txt'
 INTO TABLE t1 (name);
 
---remove_file init_file.txt
+--remove_file $MYSQLTEST_VARDIR/tmp/init_file.txt
[6 Dec 2011 12:00] Valeriy Kravchuk
Thank you for the problem report and fix contributed.
[28 Jan 2012 13:11] Jon Stephens
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release.

If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html
[28 Jan 2012 13:12] Jon Stephens
Fixed in 5.5+. Testing only, no changelog entry required. Closed.