Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ensembl-hive
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
7
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
ensembl-hive
Commits
8a48338b
Commit
8a48338b
authored
11 years ago
by
Leo Gordon
Browse files
Options
Downloads
Patches
Plain Diff
cosmetic: direct the debug output of BaseAdaptor to STDERR instead of STDOUT
parent
8f66fcc1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/Bio/EnsEMBL/Hive/DBSQL/BaseAdaptor.pm
+11
-11
11 additions, 11 deletions
modules/Bio/EnsEMBL/Hive/DBSQL/BaseAdaptor.pm
with
11 additions
and
11 deletions
modules/Bio/EnsEMBL/Hive/DBSQL/BaseAdaptor.pm
+
11
−
11
View file @
8a48338b
...
@@ -338,9 +338,9 @@ sub update { # update (some or all) non_primary columns from the primary
...
@@ -338,9 +338,9 @@ sub update { # update (some or all) non_primary columns from the primary
}
}
my
$sql
=
"
UPDATE
$table_name
SET
"
.
join
('
,
',
map
{
"
$_
=?
"
}
@$columns_to_update
)
.
"
WHERE
$primary_key_constraint
";
my
$sql
=
"
UPDATE
$table_name
SET
"
.
join
('
,
',
map
{
"
$_
=?
"
}
@$columns_to_update
)
.
"
WHERE
$primary_key_constraint
";
#
print
"SQL: $sql\n";
#
warn
"SQL: $sql\n";
my
$sth
=
$self
->
prepare
(
$sql
);
my
$sth
=
$self
->
prepare
(
$sql
);
#
print
"VALUES_TO_UPDATE: ".join(', ', map { "'$_'" } @$values_to_update)."\n";
#
warn
"VALUES_TO_UPDATE: ".join(', ', map { "'$_'" } @$values_to_update)."\n";
$sth
->
execute
(
@$values_to_update
);
$sth
->
execute
(
@$values_to_update
);
$sth
->
finish
();
$sth
->
finish
();
...
@@ -400,7 +400,7 @@ sub store {
...
@@ -400,7 +400,7 @@ sub store {
$self
->
mark_stored
(
$object
,
$present
);
$self
->
mark_stored
(
$object
,
$present
);
}
else
{
}
else
{
my
(
$columns_being_stored
,
$column_key
)
=
(
ref
(
$object
)
eq
'
HASH
')
?
$self
->
keys_to_columns
(
$object
)
:
(
$all_storable_columns
,
'
*all*
');
my
(
$columns_being_stored
,
$column_key
)
=
(
ref
(
$object
)
eq
'
HASH
')
?
$self
->
keys_to_columns
(
$object
)
:
(
$all_storable_columns
,
'
*all*
');
#
print
"COLUMN_KEY='$column_key'\n";
#
warn
"COLUMN_KEY='$column_key'\n";
my
$this_sth
;
my
$this_sth
;
...
@@ -408,13 +408,13 @@ sub store {
...
@@ -408,13 +408,13 @@ sub store {
unless
(
$this_sth
=
$hashed_sth
{
$column_key
})
{
unless
(
$this_sth
=
$hashed_sth
{
$column_key
})
{
# By using question marks we can insert true NULLs by setting corresponding values to undefs:
# By using question marks we can insert true NULLs by setting corresponding values to undefs:
my
$sql
=
"
$insertion_method
INTO
$table_name
(
"
.
join
('
,
',
@$columns_being_stored
)
.
'
) VALUES (
'
.
join
('
,
',
(('
?
')
x
scalar
(
@$columns_being_stored
)))
.
'
)
';
my
$sql
=
"
$insertion_method
INTO
$table_name
(
"
.
join
('
,
',
@$columns_being_stored
)
.
'
) VALUES (
'
.
join
('
,
',
(('
?
')
x
scalar
(
@$columns_being_stored
)))
.
'
)
';
#
print
"STORE: $sql\n";
#
warn
"STORE: $sql\n";
$this_sth
=
$hashed_sth
{
$column_key
}
=
$self
->
prepare
(
$sql
)
or
die
"
Could not prepare statement:
$sql
";
$this_sth
=
$hashed_sth
{
$column_key
}
=
$self
->
prepare
(
$sql
)
or
die
"
Could not prepare statement:
$sql
";
}
}
#
print
"STORED_COLUMNS: ".join(', ', map { "`$_`" } @$columns_being_stored)."\n";
#
warn
"STORED_COLUMNS: ".join(', ', map { "`$_`" } @$columns_being_stored)."\n";
my
$values_being_stored
=
$self
->
slicer
(
$object
,
$columns_being_stored
);
my
$values_being_stored
=
$self
->
slicer
(
$object
,
$columns_being_stored
);
#
print
"STORED_VALUES: ".join(', ', map { "'$_'" } @$values_being_stored)."\n";
#
warn
"STORED_VALUES: ".join(', ', map { "'$_'" } @$values_being_stored)."\n";
my
$return_code
=
$this_sth
->
execute
(
@$values_being_stored
)
my
$return_code
=
$this_sth
->
execute
(
@$values_being_stored
)
# using $return_code in boolean context allows to skip the value '0E0' ('no rows affected') that Perl treats as zero but regards as true:
# using $return_code in boolean context allows to skip the value '0E0' ('no rows affected') that Perl treats as zero but regards as true:
...
@@ -465,7 +465,7 @@ sub AUTOLOAD {
...
@@ -465,7 +465,7 @@ sub AUTOLOAD {
die
"
unknown column '
$value_column
'
";
die
"
unknown column '
$value_column
'
";
}
}
#
print
"Setting up '$AUTOLOAD' method\n";
#
warn
"Setting up '$AUTOLOAD' method\n";
*$AUTOLOAD
=
sub
{
*$AUTOLOAD
=
sub
{
my
$self
=
shift
@_
;
my
$self
=
shift
@_
;
return
$self
->
fetch_all
(
return
$self
->
fetch_all
(
...
@@ -490,7 +490,7 @@ sub AUTOLOAD {
...
@@ -490,7 +490,7 @@ sub AUTOLOAD {
}
}
}
}
#
print
"Setting up '$AUTOLOAD' method\n";
#
warn
"Setting up '$AUTOLOAD' method\n";
*$AUTOLOAD
=
sub
{
*$AUTOLOAD
=
sub
{
my
$self
=
shift
@_
;
my
$self
=
shift
@_
;
return
$self
->
count_all
(
return
$self
->
count_all
(
...
@@ -506,7 +506,7 @@ sub AUTOLOAD {
...
@@ -506,7 +506,7 @@ sub AUTOLOAD {
my
$column_set
=
$self
->
column_set
();
my
$column_set
=
$self
->
column_set
();
if
(
$column_set
->
{
$filter_name
})
{
if
(
$column_set
->
{
$filter_name
})
{
#
print
"Setting up '$AUTOLOAD' method\n";
#
warn
"Setting up '$AUTOLOAD' method\n";
*$AUTOLOAD
=
sub
{
my
(
$self
,
$filter_value
)
=
@_
;
return
$self
->
remove_all
("
$filter_name
='
$filter_value
'
");
};
*$AUTOLOAD
=
sub
{
my
(
$self
,
$filter_value
)
=
@_
;
return
$self
->
remove_all
("
$filter_name
='
$filter_value
'
");
};
goto
&$AUTOLOAD
;
# restart the new method
goto
&$AUTOLOAD
;
# restart the new method
}
else
{
}
else
{
...
@@ -514,11 +514,11 @@ sub AUTOLOAD {
...
@@ -514,11 +514,11 @@ sub AUTOLOAD {
}
}
}
elsif
(
$AUTOLOAD
=~
/::update_(\w+)$/
)
{
}
elsif
(
$AUTOLOAD
=~
/::update_(\w+)$/
)
{
my
@columns_to_update
=
split
(
/_AND_/i
,
$
1
);
my
@columns_to_update
=
split
(
/_AND_/i
,
$
1
);
#
print
"Setting up '$AUTOLOAD' method\n";
#
warn
"Setting up '$AUTOLOAD' method\n";
*$AUTOLOAD
=
sub
{
my
(
$self
,
$object
)
=
@_
;
return
$self
->
update
(
$object
,
@columns_to_update
);
};
*$AUTOLOAD
=
sub
{
my
(
$self
,
$object
)
=
@_
;
return
$self
->
update
(
$object
,
@columns_to_update
);
};
goto
&$AUTOLOAD
;
# restart the new method
goto
&$AUTOLOAD
;
# restart the new method
}
else
{
}
else
{
print
"
sub '
$AUTOLOAD
' not implemented
";
warn
"
sub '
$AUTOLOAD
' not implemented
";
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment