Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-gh-mirror
ensembl
Commits
bc29554c
Commit
bc29554c
authored
Nov 10, 2010
by
Ian Longden
Browse files
check for null values for into_type nad info_text
parent
a847d059
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
10 deletions
+29
-10
modules/Bio/EnsEMBL/DBSQL/DBEntryAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/DBEntryAdaptor.pm
+29
-10
No files found.
modules/Bio/EnsEMBL/DBSQL/DBEntryAdaptor.pm
View file @
bc29554c
...
...
@@ -624,22 +624,41 @@ sub store {
#
# Check for the existance of the external reference, add it if not present
#
my
$sth
=
$self
->
prepare
(
"
SELECT xref_id
FROM xref
WHERE external_db_id = ?
AND dbprimary_acc = ?
AND version = ?
AND info_type = ?
AND info_text = ?
"
);
my
$sql
=
"
SELECT xref_id FROM xref
WHERE external_db_id = ?
AND dbprimary_acc = ?
AND version = ?
";
if
(
defined
$exObj
->
info_type
){
$sql
.=
"
AND info_type = ?
";
}
else
{
$sql
.=
"
AND info_type is null
";
}
if
(
defined
$exObj
->
info_text
){
$sql
.=
"
AND info_text = ?
";
}
else
{
$sql
.=
"
AND info_text is null
";
}
my
$sth
=
$self
->
prepare
(
$sql
);
$sth
->
bind_param
(
1
,
$dbRef
,
SQL_INTEGER
);
$sth
->
bind_param
(
2
,
$exObj
->
primary_id
,
SQL_VARCHAR
);
$sth
->
bind_param
(
3
,
$exObj
->
version
,
SQL_VARCHAR
);
$sth
->
bind_param
(
4
,
$exObj
->
info_type
,
SQL_VARCHAR
);
$sth
->
bind_param
(
5
,
$exObj
->
info_text
,
SQL_VARCHAR
);
my
$i
=
4
;
if
(
defined
$exObj
->
info_type
){
$sth
->
bind_param
(
$i
++
,
$exObj
->
info_type
,
SQL_VARCHAR
);
}
if
(
defined
$exObj
->
info_text
){
$sth
->
bind_param
(
$i
++
,
$exObj
->
info_text
,
SQL_VARCHAR
);
}
$sth
->
execute
();
my
(
$dbX
)
=
$sth
->
fetchrow_array
();
$sth
->
finish
();
...
...
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