From: Rafael Kitover Date: Wed, 30 Sep 2009 07:00:59 +0000 (+0000) Subject: factor out subclass-specific _execute_array callback X-Git-Tag: v0.08113~32^2^2~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=936f31c1c8fbfc3a8be746f6624a5fb1d371574e;p=dbsrgits%2FDBIx-Class.git factor out subclass-specific _execute_array callback --- diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 04180f0..a6609f5 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -1391,7 +1391,7 @@ sub insert_bulk { } sub _execute_array { - my ($self, $source, $sth, $bind, $cols, $data, $after_exec_cb) = @_; + my ($self, $source, $sth, $bind, $cols, $data, @extra) = @_; my $guard = $self->txn_scope_guard unless $self->{transaction_depth} != 0; @@ -1420,10 +1420,8 @@ sub _execute_array { $placeholder_index++; } - my $rv; - eval { - $rv = $sth->execute_array({ArrayTupleStatus => $tuple_status}); - $after_exec_cb->() if $after_exec_cb; + my $rv = eval { + $self->_dbh_execute_array($sth, $tuple_status, @extra); }; my $err = $@ || $sth->errstr; @@ -1451,6 +1449,12 @@ sub _execute_array { return $rv; } +sub _dbh_execute_array { + my ($self, $sth, $tuple_status, @extra) = @_; + + return $sth->execute_array({ArrayTupleStatus => $tuple_status}); +} + sub _execute_array_empty { my ($self, $sth, $count) = @_; diff --git a/lib/DBIx/Class/Storage/DBI/Sybase.pm b/lib/DBIx/Class/Storage/DBI/Sybase.pm index 3a8531d..b6352e0 100644 --- a/lib/DBIx/Class/Storage/DBI/Sybase.pm +++ b/lib/DBIx/Class/Storage/DBI/Sybase.pm @@ -664,6 +664,15 @@ EOF } } +sub _dbh_execute_array { + my ($self, $sth, $tuple_status, $cb) = @_; + + my $rv = $self->next::method($sth, $tuple_status); + $cb->() if $cb; + + return $rv; +} + # Make sure blobs are not bound as placeholders, and return any non-empty ones # as a hash. sub _remove_blob_cols {