Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
e10fb4ff
Commit
e10fb4ff
authored
Aug 29, 2007
by
msvensson@pilot.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge pilot.(none):/data/msvensson/mysql/mysql-5.0-maint
into pilot.(none):/data/msvensson/mysql/mysql-5.1-new-maint
parents
bce2f6bb
044f7a32
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
11 deletions
+71
-11
mysql-test/lib/mtr_misc.pl
mysql-test/lib/mtr_misc.pl
+60
-0
mysql-test/mysql-test-run.pl
mysql-test/mysql-test-run.pl
+10
-10
mysql-test/t/information_schema_chmod.test
mysql-test/t/information_schema_chmod.test
+1
-1
No files found.
mysql-test/lib/mtr_misc.pl
View file @
e10fb4ff
...
...
@@ -19,6 +19,7 @@
# same name.
use
strict
;
use
File::
Find
;
sub
mtr_native_path
($);
sub
mtr_init_args
($);
...
...
@@ -29,6 +30,7 @@ sub mtr_file_exists(@);
sub
mtr_exe_exists
(@);
sub
mtr_exe_maybe_exists
(@);
sub
mtr_copy_dir
($$);
sub
mtr_rmtree
($$);
sub
mtr_same_opts
($$);
sub
mtr_cmp_opts
($$);
...
...
@@ -200,6 +202,64 @@ sub mtr_copy_dir($$) {
}
sub
mtr_rmtree
($)
{
my
(
$dir
)
=
@_
;
my
$need_file_find
=
0
;
mtr_verbose
("
mtr_rmtree:
$dir
");
{
# Try to use File::Path::rmtree. Recent versions
# handles removal of directories and files that don't
# have full permissions, while older versions
# may have a problem with that and we use our own version
local
$SIG
{
__WARN__
}
=
sub
{
$need_file_find
=
1
;
mtr_warning
(
$_
[
0
]);
};
rmtree
(
$dir
);
}
if
(
$need_file_find
)
{
mtr_warning
("
rmtree(
$dir
) failed, trying with File::Find...
");
my
$errors
=
0
;
# chmod
find
(
{
no_chdir
=>
1
,
wanted
=>
sub
{
chmod
(
0777
,
$_
)
or
mtr_warning
("
couldn't chmod(0777,
$_
): $!
")
and
$errors
++
;
}
},
$dir
);
# rm
finddepth
(
{
no_chdir
=>
1
,
wanted
=>
sub
{
my
$file
=
$_
;
# Use special underscore (_) filehandle, caches stat info
if
(
!-
l
$file
and
-
d
_
)
{
rmdir
(
$file
)
or
mtr_warning
("
couldn't rmdir(
$file
): $!
")
and
$errors
++
;
}
else
{
unlink
(
$file
)
or
mtr_warning
("
couldn't unlink(
$file
): $!
")
and
$errors
++
;
}
}
},
$dir
);
mtr_error
("
Failed to remove '
$dir
'
")
if
$errors
;
mtr_report
("
OK, that worked!
");
}
}
sub
mtr_same_opts
($$)
{
my
$l1
=
shift
;
my
$l2
=
shift
;
...
...
mysql-test/mysql-test-run.pl
View file @
e10fb4ff
...
...
@@ -2196,7 +2196,7 @@ sub remove_stale_vardir () {
{
# Remove the directory which the link points at
mtr_verbose
("
Removing
"
.
readlink
(
$opt_vardir
));
rmtree
(
readlink
(
$opt_vardir
));
mtr_
rmtree
(
readlink
(
$opt_vardir
));
# Remove the "var" symlink
mtr_verbose
("
unlink(
$opt_vardir
)
");
...
...
@@ -2224,7 +2224,7 @@ sub remove_stale_vardir () {
foreach
my
$bin
(
glob
("
$opt_vardir
/*
")
)
{
mtr_verbose
("
Removing bin
$bin
");
rmtree
(
$bin
);
mtr_
rmtree
(
$bin
);
}
}
}
...
...
@@ -2232,7 +2232,7 @@ sub remove_stale_vardir () {
{
# Remove the entire "var" dir
mtr_verbose
("
Removing
$opt_vardir
/
");
rmtree
("
$opt_vardir
/
");
mtr_
rmtree
("
$opt_vardir
/
");
}
if
(
$opt_mem
)
...
...
@@ -2241,7 +2241,7 @@ sub remove_stale_vardir () {
# remove the $opt_mem dir to assure the symlink
# won't point at an old directory
mtr_verbose
("
Removing
$opt_mem
");
rmtree
(
$opt_mem
);
mtr_
rmtree
(
$opt_mem
);
}
}
...
...
@@ -2254,11 +2254,11 @@ sub remove_stale_vardir () {
# Remove the var/ dir in mysql-test dir if any
# this could be an old symlink that shouldn't be there
mtr_verbose
("
Removing
$default_vardir
");
rmtree
(
$default_vardir
);
mtr_
rmtree
(
$default_vardir
);
# Remove the "var" dir
mtr_verbose
("
Removing
$opt_vardir
/
");
rmtree
("
$opt_vardir
/
");
mtr_
rmtree
("
$opt_vardir
/
");
}
}
...
...
@@ -3215,7 +3215,7 @@ sub restore_slave_databases ($) {
{
my
$data_dir
=
$slave
->
[
$idx
]
->
{'
path_myddir
'};
my
$name
=
basename
(
$data_dir
);
rmtree
(
$data_dir
);
mtr_
rmtree
(
$data_dir
);
mtr_copy_dir
("
$path_snapshot
/
$name
",
$data_dir
);
}
}
...
...
@@ -3520,7 +3520,7 @@ sub run_testcase ($) {
sub
save_installed_db
()
{
mtr_report
("
Saving snapshot of installed databases
");
rmtree
(
$path_snapshot
);
mtr_
rmtree
(
$path_snapshot
);
foreach
my
$data_dir
(
@data_dir_lst
)
{
...
...
@@ -3567,7 +3567,7 @@ sub restore_installed_db ($) {
{
my
$name
=
basename
(
$data_dir
);
save_files_before_restore
(
$test_name
,
$data_dir
);
rmtree
("
$data_dir
");
mtr_
rmtree
("
$data_dir
");
mtr_copy_dir
("
$path_snapshot
/
$name
",
"
$data_dir
");
}
...
...
@@ -3577,7 +3577,7 @@ sub restore_installed_db ($) {
{
foreach
my
$ndbd
(
@
{
$cluster
->
{'
ndbds
'}})
{
rmtree
("
$ndbd
->{'path_fs'}
"
);
mtr_
rmtree
("
$ndbd
->{'path_fs'}
"
);
}
}
}
...
...
mysql-test/t/information_schema_chmod.test
View file @
e10fb4ff
...
...
@@ -19,5 +19,5 @@ create database mysqltest;
create
table
mysqltest
.
t1
(
a
int
);
chmod
0000
$MYSQLTEST_VARDIR
/
master
-
data
/
mysqltest
;
select
table_schema
from
information_schema
.
tables
where
table_schema
=
'mysqltest'
;
exec
chmod
0777
$MYSQLTEST_VARDIR
/
master
-
data
/
mysqltest
;
chmod
0777
$MYSQLTEST_VARDIR
/
master
-
data
/
mysqltest
;
drop
database
mysqltest
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment