Commit fdd66544 authored by Magnus Svensson's avatar Magnus Svensson

Bug#41480 Tests that do LOAD DATA INFILE fail when run locally

parent 1fe215a7
...@@ -92,9 +92,16 @@ sub mkpath { ...@@ -92,9 +92,16 @@ sub mkpath {
sub copytree { sub copytree {
my ($from_dir, $to_dir) = @_; my ($from_dir, $to_dir, $use_umask) = @_;
die "Usage: copytree(<fromdir>, <todir>" unless @_ == 2; die "Usage: copytree(<fromdir>, <todir>, [<umask>])"
unless @_ == 2 or @_ == 3;
my $orig_umask;
if ($use_umask){
# Set new umask and remember the original
$orig_umask= umask(oct($use_umask));
}
mkpath("$to_dir"); mkpath("$to_dir");
opendir(DIR, "$from_dir") opendir(DIR, "$from_dir")
...@@ -114,6 +121,11 @@ sub copytree { ...@@ -114,6 +121,11 @@ sub copytree {
copy("$from_dir/$_", "$to_dir/$_"); copy("$from_dir/$_", "$to_dir/$_");
} }
closedir(DIR); closedir(DIR);
if ($orig_umask){
# Set the original umask
umask($orig_umask);
}
} }
1; 1;
...@@ -1981,8 +1981,8 @@ sub setup_vardir() { ...@@ -1981,8 +1981,8 @@ sub setup_vardir() {
} }
# copy all files from std_data into var/std_data # copy all files from std_data into var/std_data
# and make them writable # and make them world readable
copytree("$glob_mysql_test_dir/std_data", "$opt_vardir/std_data"); copytree("$glob_mysql_test_dir/std_data", "$opt_vardir/std_data", "0022");
# Remove old log files # Remove old log files
foreach my $name (glob("r/*.progress r/*.log r/*.warnings")) foreach my $name (glob("r/*.progress r/*.log r/*.warnings"))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment