From da8df39c14581f32f9004430336999011c96b33c Mon Sep 17 00:00:00 2001
From: Andrei Elkin <aelkin@mysql.com>
Date: Tue, 27 Jan 2009 13:33:30 +0200
Subject: [PATCH] Bug #31240  	load data infile replication between (4.0 or
 4.1) and 5.1 fails

Fixing pb failures caused by mtr invokes the test with --tmpdir to which
there are  sensitive operations in the test
and setup_fake_relay_log.inc also needed --secure-file-priv for its own separate
directory.

Fixed with removing SELECT INTO OUTFILE and deploying --exec echo instead in the marco.
The test's opt file should contain --secure-file-priv=$MYSQL_TEST_DIR as the test
operations deal with files located in $MYSQL_TEST_DIR.

mysql-test/include/setup_fake_relay_log.inc:
  Refining setup_fake_relay_log.inc to not use --secure-file-priv sensitive feature.
  The latter should remain available for the test.
---
 mysql-test/include/setup_fake_relay_log.inc         | 3 +--
 mysql-test/suite/rpl/t/rpl_cross_version-master.opt | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/mysql-test/include/setup_fake_relay_log.inc b/mysql-test/include/setup_fake_relay_log.inc
index 8113ed6dc1..79ff742946 100644
--- a/mysql-test/include/setup_fake_relay_log.inc
+++ b/mysql-test/include/setup_fake_relay_log.inc
@@ -68,9 +68,8 @@ let $_fake_relay_log_purge= `SELECT @@global.relay_log_purge`;
 
 # Create relay log file.
 copy_file $fake_relay_log $_fake_relay_log;
-
 # Create relay log index.
-eval SELECT '$_fake_relay_log' INTO OUTFILE '$_fake_relay_index';
+--exec echo $_fake_relay_log > $_fake_relay_index
 
 # Setup replication from existing relay log.
 eval CHANGE MASTER TO MASTER_HOST='dummy.localdomain', RELAY_LOG_FILE='$_fake_relay_log', RELAY_LOG_POS=4;
diff --git a/mysql-test/suite/rpl/t/rpl_cross_version-master.opt b/mysql-test/suite/rpl/t/rpl_cross_version-master.opt
index 01987c5c8a..0ea05290c1 100644
--- a/mysql-test/suite/rpl/t/rpl_cross_version-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_cross_version-master.opt
@@ -1 +1 @@
---replicate-same-server-id --relay-log=slave-relay-bin --secure-file-priv=$MYSQLTEST_VARDIR
+--replicate-same-server-id --relay-log=slave-relay-bin --secure-file-priv=$MYSQL_TMP_DIR
-- 
2.30.9