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
a0b128a9
Commit
a0b128a9
authored
May 10, 2011
by
Leo Gordon
Browse files
unifying change suggested by Andy
parent
67392217
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
6 deletions
+6
-6
modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisDataAdaptor.pm
modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisDataAdaptor.pm
+1
-2
modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisJobAdaptor.pm
modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisJobAdaptor.pm
+1
-1
modules/Bio/EnsEMBL/Hive/DBSQL/BaseAdaptor.pm
modules/Bio/EnsEMBL/Hive/DBSQL/BaseAdaptor.pm
+1
-1
modules/Bio/EnsEMBL/Hive/Queen.pm
modules/Bio/EnsEMBL/Hive/Queen.pm
+1
-1
modules/Bio/EnsEMBL/Hive/RunnableDB/SqlCmd.pm
modules/Bio/EnsEMBL/Hive/RunnableDB/SqlCmd.pm
+2
-1
No files found.
modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisDataAdaptor.pm
View file @
a0b128a9
...
...
@@ -65,13 +65,12 @@ sub fetch_by_dbID {
sub
store
{
my
(
$self
,
$data
)
=
@_
;
my
$data_id
;
return
0
unless
(
$data
);
my
$sth
=
$self
->
prepare
("
INSERT INTO analysis_data (data) VALUES (?)
");
$sth
->
execute
(
$data
);
$data_id
=
(
$self
->
dbc
->
driver
eq
'
sqlite
')
?
$self
->
dbc
->
db_handle
->
func
('
last_insert_
rowid
')
:
$sth
->
{'
mysql_insert
id
'
}
;
my
$data_id
=
$self
->
dbc
->
db_handle
->
last_insert_
id
(
undef
,
undef
,
'
analysis_data
',
'
analysis_data_
id
'
)
;
$sth
->
finish
;
return
$data_id
;
...
...
modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisJobAdaptor.pm
View file @
a0b128a9
...
...
@@ -112,7 +112,7 @@ sub CreateNewJob {
my
$sth
=
$dbc
->
prepare
(
$sql
);
$sth
->
execute
(
$input_id
,
$prev_job_id
,
$analysis
->
dbID
,
$status
,
$semaphore_count
||
0
,
$semaphored_job_id
);
my
$job_id
=
(
$dbc
->
driver
eq
'
sqlite
')
?
$dbc
->
db_handle
->
func
('
last_insert_
rowid
')
:
$sth
->
{'
mysql_insert
id
'
}
;
my
$job_id
=
$dbc
->
db_handle
->
last_insert_
id
(
undef
,
undef
,
'
job
',
'
job_
id
'
)
;
$sth
->
finish
;
$dbc
->
do
("
UPDATE analysis_stats SET
"
.
...
...
modules/Bio/EnsEMBL/Hive/DBSQL/BaseAdaptor.pm
View file @
a0b128a9
...
...
@@ -315,7 +315,7 @@ sub store {
# using $return_code in boolean context allows to skip the value '0E0' ('no rows affected') that Perl treats as zero but regards as true:
or
die
"
Could not perform
\n\t
$sql
\n
with data:
\n\t
(
"
.
join
('
,
',
@$non_autoinc_values
)
.
'
)
';
if
(
$return_code
>
0
)
{
# <--- for the same reason we have to be expliticly numeric here
$self
->
mark_stored
(
$object
,
(
$driver
eq
'
sqlite
')
?
$self
->
dbc
->
db_handle
->
func
('
last_insert_
rowid
')
:
$sth
->
{'
mysql_insertid
'}
);
$self
->
mark_stored
(
$object
,
$self
->
dbc
->
db_handle
->
last_insert_
id
(
undef
,
undef
,
$table_name
,
$autoinc_id
)
);
}
}
}
...
...
modules/Bio/EnsEMBL/Hive/Queen.pm
View file @
a0b128a9
...
...
@@ -186,7 +186,7 @@ sub create_new_worker {
my
$sth
=
$self
->
prepare
(
$sql
);
$sth
->
execute
(
$meadow_type
,
$process_id
,
$exec_host
,
$analysisStats
->
analysis_id
);
my
$worker_id
=
(
$self
->
dbc
->
driver
eq
'
sqlite
')
?
$self
->
dbc
->
db_handle
->
func
('
last_insert_
rowid
')
:
$sth
->
{'
mysql_ins
er
t
id
'
}
;
my
$worker_id
=
$self
->
dbc
->
db_handle
->
last_insert_
id
(
undef
,
undef
,
'
worker
',
'
work
er
_
id
'
)
;
$sth
->
finish
;
my
$worker
=
$self
->
fetch_by_dbID
(
$worker_id
);
...
...
modules/Bio/EnsEMBL/Hive/RunnableDB/SqlCmd.pm
View file @
a0b128a9
...
...
@@ -120,7 +120,8 @@ sub run {
$dbh
->
do
(
$sql
);
my
$insert_id_name
=
'
_insert_id_
'
.
$counter
++
;
my
$insert_id_value
=
(
$dbh
->
driver
eq
'
sqlite
')
?
$dbh
->
func
('
last_insert_rowid
')
:
$dbh
->
{'
mysql_insertid
'};
#my $insert_id_value = ($dbh->driver eq 'sqlite') ? $dbh->func('last_insert_rowid') : $dbh->{'mysql_insertid'}; # <---- this approach worked
my
$insert_id_value
=
$dbh
->
last_insert_rowid
();
# <---- this one should work, but watch out
$output_id
{
$insert_id_name
}
=
$insert_id_value
;
$self
->
param
(
$insert_id_name
,
$insert_id_value
);
# for templates
}
...
...
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