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
1bdcffb0
Commit
1bdcffb0
authored
Jul 18, 2022
by
Aleksey Midenkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-29025 Refactoring: moved out core_wanted() out of mysql-test-run.pl
parent
e9be5428
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
27 deletions
+39
-27
mysql-test/lib/My/CoreDump.pm
mysql-test/lib/My/CoreDump.pm
+35
-1
mysql-test/mysql-test-run.pl
mysql-test/mysql-test-run.pl
+4
-26
No files found.
mysql-test/lib/My/CoreDump.pm
View file @
1bdcffb0
...
@@ -23,6 +23,8 @@ use Text::Wrap;
...
@@ -23,6 +23,8 @@ use Text::Wrap;
use
Data::
Dumper
;
use
Data::
Dumper
;
use
File::
Temp
qw/ tempfile tempdir /
;
use
File::
Temp
qw/ tempfile tempdir /
;
use
File::
Find
;
use
File::
Basename
;
use
mtr_results
;
use
mtr_results
;
use
mtr_report
;
use
mtr_report
;
...
@@ -489,7 +491,7 @@ sub _auto
...
@@ -489,7 +491,7 @@ sub _auto
sub
show
{
sub
show
{
my
(
$c
lass
,
$c
ore_name
,
$exe_mysqld
,
$parallel
)
=
@_
;
my
(
$core_name
,
$exe_mysqld
,
$parallel
)
=
@_
;
if
(
$config
{
print_core
}
ne
'
no
')
{
if
(
$config
{
print_core
}
ne
'
no
')
{
my
$f
=
$config
{
print_core
};
my
$f
=
$config
{
print_core
};
my
$m
=
$config
{
print_method
};
my
$m
=
$config
{
print_method
};
...
@@ -506,4 +508,36 @@ sub show {
...
@@ -506,4 +508,36 @@ sub show {
}
}
sub
core_wanted
($$$$$)
{
my
(
$num_saved_cores
,
$opt_max_save_core
,
$compress
,
$exe_mysqld
,
$opt_parallel
)
=
@_
;
my
$core_file
=
$
File::Find::
name
;
my
$core_name
=
basename
(
$core_file
);
# Name beginning with core, not ending in .gz
if
((
$core_name
=~
/^core/
and
$core_name
!~
/\.gz$/
)
or
(
IS_WINDOWS
and
$core_name
=~
/\.dmp$/
))
{
# Ending with .dmp
mtr_report
("
- found '
$core_name
'
",
"
($
$num_saved_cores
/
$opt_max_save_core
)
");
show
(
$core_file
,
$exe_mysqld
,
$opt_parallel
);
# Limit number of core files saved
if
(
$$num_saved_cores
>=
$opt_max_save_core
)
{
mtr_report
("
- deleting it, already saved
",
"
$opt_max_save_core
");
unlink
("
$core_file
");
}
else
{
main::
mtr_compress_file
(
$core_file
)
if
$compress
;
++
$$num_saved_cores
;
}
}
}
1
;
1
;
mysql-test/mysql-test-run.pl
View file @
1bdcffb0
...
@@ -801,32 +801,10 @@ sub run_test_server ($$$) {
...
@@ -801,32 +801,10 @@ sub run_test_server ($$$) {
no_chdir
=>
1
,
no_chdir
=>
1
,
wanted
=>
sub
wanted
=>
sub
{
{
my
$core_file
=
$
File::Find::
name
;
My::CoreDump::
core_wanted
(
\
$num_saved_cores
,
my
$core_name
=
basename
(
$core_file
);
$opt_max_save_core
,
@opt_cases
==
0
,
# Name beginning with core, not ending in .gz
$exe_mysqld
,
$opt_parallel
);
if
((
$core_name
=~
/^core/
and
$core_name
!~
/\.gz$/
)
or
(
IS_WINDOWS
and
$core_name
=~
/\.dmp$/
))
{
# Ending with .dmp
mtr_report
("
- found '
$core_name
'
",
"
(
$num_saved_cores
/
$opt_max_save_core
)
");
My::
CoreDump
->
show
(
$core_file
,
$exe_mysqld
,
$opt_parallel
);
# Limit number of core files saved
if
(
$num_saved_cores
>=
$opt_max_save_core
)
{
mtr_report
("
- deleting it, already saved
",
"
$opt_max_save_core
");
unlink
("
$core_file
");
}
else
{
mtr_compress_file
(
$core_file
)
unless
@opt_cases
;
++
$num_saved_cores
;
}
}
}
}
},
},
$worker_savedir
);
$worker_savedir
);
...
...
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