diff --git a/modules/Bio/EnsEMBL/DBSQL/BaseAdaptor.pm b/modules/Bio/EnsEMBL/DBSQL/BaseAdaptor.pm index e173cf2d41334ea82a90baba1c0fc1c6fb3a2a8c..8b9731bca305ec8291d61542e44d4d4276088ba1 100755 --- a/modules/Bio/EnsEMBL/DBSQL/BaseAdaptor.pm +++ b/modules/Bio/EnsEMBL/DBSQL/BaseAdaptor.pm @@ -703,14 +703,18 @@ sub last_insert_id { my ($self, $field, $attributes, $table) = @_; my $dbc = $self->dbc(); my $dbh = $dbc->db_handle(); + my @args; if($dbc->driver() eq 'mysql') { - return $dbh->last_insert_id(); + @args = (undef,undef,undef,undef); } - $attributes ||= {}; - if(!$table) { - ($table) = $self->_tables(); + else { + if(!$table) { + ($table) = $self->_tables(); + } + @args = (undef, $dbc->dbname(), $table->[0], $field); } - return $dbh->last_insert_id(undef, $dbc->dbname(), $table->[0], $field, $attributes); + $attributes ||= {}; + return $dbh->last_insert_id(@args, $attributes); }