local $dbh->{RaiseError} = 1;
local $dbh->{PrintError} = 0;
-# In case of a multi-statement with a select, some DBDs (namely Sybase) require
-# the statement to be exhausted.
- my $fetch = 0;
- if ($self->_exhaust_statements && $sth->{Statement} =~ /(?:\n|;)select/i) {
- $fetch = 1;
- }
-
- foreach (1..$count) {
- $sth->execute;
- $sth->fetchall_arrayref if $fetch;
- }
+ $sth->execute foreach 1..$count;
};
my $exception = $@;
return $count;
}
-# Whether we prefer to exhaust cursors with results, or they can be
-# reused/finished without fetching anything. To be overridden to '1' in storages
-# that need it.
-sub _exhaust_statements { 0 }
-
sub update {
my ($self, $source, @args) = @_;
);
}
- if ($op eq 'insert' && (not $bound_identity_col) && $identity_col) {
+ if ($op eq 'insert' && (not $bound_identity_col) && $identity_col &&
+ (not $self->{insert_bulk})) {
$sql =
"$sql\n" .
$self->_fetch_identity_sql($ident, $identity_col);
$self = $self->_writer_storage;
my $guard = $self->txn_scope_guard;
+ local $self->{insert_bulk} = 1;
$self->next::method(@_);
}
}
-# Sybase is very sensitive to this.
-sub _exhaust_statements { 1 }
-
# Make sure blobs are not bound as placeholders, and return any non-empty ones
# as a hash.
sub _remove_blob_cols {