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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
fe542970
Commit
fe542970
authored
Mar 07, 2008
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed external call to md5sum and added
an internal procedure for it. Removed my_which() as unneccessary.
parent
d6a868cc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
36 deletions
+26
-36
storage/maria/unittest/ma_test_recovery.pl
storage/maria/unittest/ma_test_recovery.pl
+26
-36
No files found.
storage/maria/unittest/ma_test_recovery.pl
View file @
fe542970
...
...
@@ -4,9 +4,10 @@ use Getopt::Long;
use
File::
Copy
;
use
File::
Compare
;
use
File::
Basename
;
use
Digest::
MD5
;
$|
=
1
;
$VER
=
"
1.
1
";
$VER
=
"
1.
2
";
$opt_version
=
0
;
$opt_help
=
0
;
...
...
@@ -17,7 +18,6 @@ my $maria_exe_path; # path to executables (ma_test1, maria_chk etc)
my
$tmp
=
"
./tmp
";
my
$my_progname
=
$0
;
my
$suffix
;
my
$md5sum
;
my
$zerofilled_tables
=
0
;
$my_progname
=~
s/.*[\/]//
;
...
...
@@ -64,25 +64,6 @@ sub main
}
}
# Test if we should use md5sum or digest -a md5
if
(
defined
(
my_which
("
md5sum
")))
{
$md5sum
=
"
md5sum
";
}
elsif
(
defined
(
my_which
("
md5
")))
{
$md5sum
=
"
md5
";
}
elsif
(
defined
(
my_which
("
digest
")))
{
$md5sum
=
"
digest -a md5
";
}
else
{
die
"
Can't find either md5sum or digest. Please install one of them
"
}
# test data is always put in the current directory or a tmp subdirectory
# of it
...
...
@@ -329,7 +310,7 @@ sub check_table_is_same
sub apply_log
{
my ($table, $shouldchangelog)= @_;
my ($log_md5);
my ($log_md5
, $log_md5_2
);
# applies log, can verify if applying did write to log or not
...
...
@@ -339,12 +320,17 @@ sub apply_log
{
print MY_LOG "bad argument
'
$shouldchangelog
'
\
n";
return 1;
}
$log_md5= `$md5sum maria_log.*`;
}
foreach (<maria_log.*>)
{
$log_md5.= md5_conv($_);
}
print MY_LOG "applying log
\
n";
`$maria_exe_path/maria_read_log$suffix -a > $tmp/maria_read_log_$table.txt`;
$log_md5_2= `$md5sum maria_log.*`;
foreach (<maria_log.*>)
{
$log_md5_2.= md5_conv($_);
}
if ("$log_md5" ne "$log_md5_2" )
{
if ("$shouldchangelog" eq "shouldnotchangelog")
...
...
@@ -360,23 +346,27 @@ sub apply_log
}
}
####
#### md5_conv
####
sub m
y_which
sub m
d5_conv
{
my ($
command)
= @_;
my (
@paths, $path
);
my ($
file)
= @_;
my (
$md5
);
return $command if (-f $command && -x $command);
@paths = split(
':'
, $ENV{
'
PATH
'
});
foreach $path (@paths)
open(FILE, $file) or die "Can
'
t
open
'
$file
':
$!
\
n
"
;
binmode(FILE);
$md5
= Digest::MD5->new;
while (<FILE>)
{
$path .= "/$command";
return $path if (-f $path && -x $path);
$md5
->add(
$_
);
}
return undef();
close (FILE);
return
$md5
->hexdigest .
"
\
n
"
;
}
####
#### physical_cmp: compares two tables (MAI and MAD) physically;
#### uses zerofill-keep-lsn to reduce irrelevant differences.
...
...
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