summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorSven Sandberg <sven@mysql.com>2008-07-04 11:33:34 +0200
committerSven Sandberg <sven@mysql.com>2008-07-04 11:33:34 +0200
commiteb05cd9e4ff1e0927a148b237667923eea3a39ca (patch)
tree248c9874596778a4ce859f43860ce1b93a1109fb /mysql-test
parent079fa90b8dd2ff59d3a6d4e432226438cec44be7 (diff)
downloadmariadb-git-eb05cd9e4ff1e0927a148b237667923eea3a39ca.tar.gz
BUG#37858: loaddata,rpl_slave_skip,rpl_innodb_mixed_dml fail if datafile not world-readable
Problem 1: main.loaddata tried to trigger an error caused by reading files outside the vardir, by reading itself. However, if loaddata.test is not world-readable (e.g., umask=0077), then another error is triggered. Fix 1: allow the other error too. Problem 2: rpl_slave_skip and rpl_innodb_mixed_dml tried to copy a file from mysql-test/suite/rpl/data to mysql-test/var and then read it. That failed too if umask=0077, since the file would not become world-readable. Fix 2: move the files from mysql-test/suite/rpl/data to mysql-test/std_data and update tests accordingly. Remove the directory mysql-test/suite/rpl/data.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/loaddata.result2
-rw-r--r--mysql-test/std_data/rpl_bug28618.dat (renamed from mysql-test/suite/rpl/data/rpl_bug28618.dat)0
-rw-r--r--mysql-test/std_data/rpl_mixed.dat (renamed from mysql-test/suite/rpl/data/rpl_mixed.dat)0
-rw-r--r--mysql-test/suite/rpl/include/rpl_mixed_dml.inc6
-rw-r--r--mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_skip.result2
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_skip.test5
-rw-r--r--mysql-test/t/loaddata.test2
8 files changed, 10 insertions, 11 deletions
diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result
index 3aef9ef636d..967259013f6 100644
--- a/mysql-test/r/loaddata.result
+++ b/mysql-test/r/loaddata.result
@@ -212,7 +212,7 @@ set @@secure_file_priv= 0;
ERROR HY000: Variable 'secure_file_priv' is a read only variable
truncate table t1;
load data infile 'MYSQL_TEST_DIR/t/loaddata.test' into table t1;
-ERROR HY000: The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
+Got one of the listed errors
select * from t1;
a b c
select load_file("MYSQL_TEST_DIR/t/loaddata.test");
diff --git a/mysql-test/suite/rpl/data/rpl_bug28618.dat b/mysql-test/std_data/rpl_bug28618.dat
index b800c4dd39d..b800c4dd39d 100644
--- a/mysql-test/suite/rpl/data/rpl_bug28618.dat
+++ b/mysql-test/std_data/rpl_bug28618.dat
diff --git a/mysql-test/suite/rpl/data/rpl_mixed.dat b/mysql-test/std_data/rpl_mixed.dat
index 131c57750cc..131c57750cc 100644
--- a/mysql-test/suite/rpl/data/rpl_mixed.dat
+++ b/mysql-test/std_data/rpl_mixed.dat
diff --git a/mysql-test/suite/rpl/include/rpl_mixed_dml.inc b/mysql-test/suite/rpl/include/rpl_mixed_dml.inc
index b76d45c0eb0..e9adb805c99 100644
--- a/mysql-test/suite/rpl/include/rpl_mixed_dml.inc
+++ b/mysql-test/suite/rpl/include/rpl_mixed_dml.inc
@@ -51,9 +51,8 @@ DELETE FROM t2 WHERE a = 2;
--echo
--echo ******************** LOAD DATA INFILE ********************
---copy_file suite/rpl/data/rpl_mixed.dat $MYSQLTEST_VARDIR/tmp/rpl_mixed.dat
-LOAD DATA INFILE '../../tmp/rpl_mixed.dat' INTO TABLE t1 FIELDS TERMINATED BY '|' ;
---remove_file $MYSQLTEST_VARDIR/tmp/rpl_mixed.dat
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data/rpl_mixed.dat' INTO TABLE t1 FIELDS TERMINATED BY '|' ;
SELECT * FROM t1 ORDER BY a;
--source suite/rpl/include/rpl_mixed_check_select.inc
--source suite/rpl/include/rpl_mixed_clear_tables.inc
@@ -329,6 +328,7 @@ DROP VIEW v2;
--echo ******************** SHOW BINLOG EVENTS ********************
--replace_column 2 # 5 #
--replace_regex /Server ver: .+/Server ver: #/ /table_id: [0-9]+/table_id: #/ /COMMIT.+xid=[0-9]+.+/#/ /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
show binlog events from 1;
sync_slave_with_master;
# as we're using UUID we don't SELECT but use "diff" like in rpl_row_UUID
diff --git a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
index 9a6053ecedf..f780cb05599 100644
--- a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
+++ b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
@@ -103,7 +103,7 @@ DELETE FROM t1;
DELETE FROM t2;
******************** LOAD DATA INFILE ********************
-LOAD DATA INFILE '../../tmp/rpl_mixed.dat' INTO TABLE t1 FIELDS TERMINATED BY '|' ;
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/std_data/rpl_mixed.dat' INTO TABLE t1 FIELDS TERMINATED BY '|' ;
SELECT * FROM t1 ORDER BY a;
a b
10 line A
@@ -884,7 +884,7 @@ master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2
master-bin.000001 # Xid 1 # #
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
master-bin.000001 # Begin_load_query 1 # ;file_id=#;block_len=#
-master-bin.000001 # Execute_load_query 1 # use `test_rpl`; LOAD DATA INFILE '../../tmp/rpl_mixed.dat' INTO TABLE t1 FIELDS TERMINATED BY '|' ;file_id=#
+master-bin.000001 # Execute_load_query 1 # use `test_rpl`; LOAD DATA INFILE 'MYSQLTEST_VARDIR/std_data/rpl_mixed.dat' INTO TABLE t1 FIELDS TERMINATED BY '|' ;file_id=#
master-bin.000001 # Xid 1 # #
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1
diff --git a/mysql-test/suite/rpl/r/rpl_slave_skip.result b/mysql-test/suite/rpl/r/rpl_slave_skip.result
index bb03c3b6cca..1f975b7dbcd 100644
--- a/mysql-test/suite/rpl/r/rpl_slave_skip.result
+++ b/mysql-test/suite/rpl/r/rpl_slave_skip.result
@@ -344,7 +344,7 @@ CREATE TABLE t10 (a INT, b VARCHAR(20)) ENGINE=myisam;
STOP SLAVE;
*** On Master ***
SET SESSION BINLOG_FORMAT=STATEMENT;
-LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/rpl_bug28618.dat' INTO TABLE t10 FIELDS TERMINATED BY '|';
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/std_data/rpl_bug28618.dat' INTO TABLE t10 FIELDS TERMINATED BY '|';
SELECT * FROM t10 ORDER BY a;
a b
1 master only
diff --git a/mysql-test/suite/rpl/t/rpl_slave_skip.test b/mysql-test/suite/rpl/t/rpl_slave_skip.test
index 8a5b1ae0ae4..ce308f975aa 100644
--- a/mysql-test/suite/rpl/t/rpl_slave_skip.test
+++ b/mysql-test/suite/rpl/t/rpl_slave_skip.test
@@ -286,10 +286,9 @@ source include/wait_for_slave_to_stop.inc;
--echo *** On Master ***
connection master;
SET SESSION BINLOG_FORMAT=STATEMENT;
-exec cp ./suite/rpl/data/rpl_bug28618.dat $MYSQLTEST_VARDIR/tmp/;
+
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/rpl_bug28618.dat' INTO TABLE t10 FIELDS TERMINATED BY '|';
-remove_file $MYSQLTEST_VARDIR/tmp/rpl_bug28618.dat;
+eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data/rpl_bug28618.dat' INTO TABLE t10 FIELDS TERMINATED BY '|';
SELECT * FROM t10 ORDER BY a;
diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test
index 9d319d4820c..bc35b652f57 100644
--- a/mysql-test/t/loaddata.test
+++ b/mysql-test/t/loaddata.test
@@ -163,7 +163,7 @@ set @@secure_file_priv= 0;
# Test "load data"
truncate table t1;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
---error 1290
+--error ER_OPTION_PREVENTS_STATEMENT, ER_TEXTFILE_NOT_READABLE
eval load data infile '$MYSQL_TEST_DIR/t/loaddata.test' into table t1;
select * from t1;