Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ensembl-gh-mirror
ensembl-hive
Commits
bd168b22
Commit
bd168b22
authored
Apr 18, 2016
by
Matthieu Muffato
Browse files
bugfix: more accurrate way of detecting that there is nothing to dump
parent
8a945c2c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
modules/Bio/EnsEMBL/Hive/RunnableDB/DatabaseDumper.pm
modules/Bio/EnsEMBL/Hive/RunnableDB/DatabaseDumper.pm
+11
-8
No files found.
modules/Bio/EnsEMBL/Hive/RunnableDB/DatabaseDumper.pm
View file @
bd168b22
...
...
@@ -112,9 +112,6 @@ sub fetch_input {
my
@ignores
=
();
$self
->
param
('
ignores
',
\
@ignores
);
# Would be good to have this from eHive
$self
->
param
('
nb_ehive_tables
',
scalar
(
@ehive_tables
));
# Connection parameters
my
$src_db_conn
=
$self
->
param
('
src_db_conn
');
my
$src_dbc
=
$src_db_conn
?
go_figure_dbc
(
$src_db_conn
)
:
$self
->
data_dbc
;
...
...
@@ -126,11 +123,14 @@ sub fetch_input {
# Get the table list in either "tables" or "ignores"
my
$table_list
=
$self
->
_get_table_list
(
$self
->
param
('
table_list
')
||
'');
print
"
table_list:
",
scalar
(
@$table_list
),
"
",
join
('
/
',
@$table_list
),
"
\n
"
if
$self
->
debug
;
my
$nothing_to_dump
=
0
;
if
(
$self
->
param
('
exclude_list
'))
{
push
@ignores
,
@$table_list
;
$nothing_to_dump
=
1
if
!
$self
->
param
('
table_list
');
}
else
{
push
@tables
,
@$table_list
;
$nothing_to_dump
=
1
if
$self
->
param
('
table_list
')
and
!
@$table_list
;
}
# Would be good to have this from eHive
...
...
@@ -149,12 +149,15 @@ sub fetch_input {
# eHive tables are ignored if exclude_ehive is set
if
(
$self
->
param
('
exclude_ehive
'))
{
push
@ignores
,
@ehive_tables
;
}
elsif
(
scalar
(
@$table_list
)
and
not
$self
->
param
('
exclude_list
'))
{
push
@tables
,
@ehive_tables
;
}
elsif
(
not
scalar
(
@$table_list
)
and
$self
->
param
('
exclude_list
'))
{
push
@tables
,
@ehive_tables
;
}
elsif
(
@ehive_tables
)
{
if
(
@tables
||
$nothing_to_dump
)
{
push
@tables
,
@ehive_tables
;
$nothing_to_dump
=
0
;
}
}
$self
->
param
('
nothing_to_dump
',
$nothing_to_dump
);
# Output file / output database
$self
->
param
('
output_file
')
||
$self
->
param
('
output_db
')
||
die
'
One of the parameters "output_file" and "output_db" is mandatory
';
unless
(
$self
->
param
('
output_file
'))
{
...
...
@@ -198,7 +201,7 @@ sub run {
my
@options
=
qw(--skip-lock-tables)
;
# Without any table names, mysqldump thinks that it should dump
# everything. We need to add special arguments to handle this
if
(
$self
->
param
('
exclude_ehive
')
and
$self
->
param
('
exclude_list
')
and
scalar
(
@$ignores
)
==
$self
->
param
('
nb_ehive_tables
'))
{
if
(
$self
->
param
('
nothing_to_dump
'))
{
print
"
everything is excluded, nothing to dump !
\n
"
if
$self
->
debug
;
push
@options
,
qw(--no-create-info --no-data)
;
$ignores
=
[]
;
# to clean-up the command-line
...
...
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