X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI.pm;h=2556ce117efe18ddc31e7598d470fa4993672ab1;hb=d944c5aea7c21750ce97107aacb50db173ff2ddb;hp=1a6d1f99326814b301a87e269ed4fc3ae701aca9;hpb=d92a401520841956d1b5b920ef49d579516dc0a8;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 1a6d1f9..2556ce1 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -830,15 +830,14 @@ sub txn_rollback { # easier to override in NoBindVars without duping the rest. It takes up # all of _execute's args, and emits $sql, @bind. sub _prep_for_execute { - my ($self, $op, $extra_bind, $ident, @args) = @_; + my ($self, $op, $extra_bind, $ident, $args) = @_; - my ($sql, @bind) = $self->sql_maker->$op($ident, @args); + my ($sql, @bind) = $self->sql_maker->$op($ident, @$args); unshift(@bind, map { ref $_ eq 'ARRAY' ? $_ : [ '!!dummy', $_ ] } @$extra_bind) if $extra_bind; - @bind = map { ref $_ ? ''.$_ : $_ } @bind; # stringify args - return ($sql, @bind); + return ($sql, \@bind); } sub _execute { @@ -847,15 +846,12 @@ sub _execute { if( blessed($ident) && $ident->isa("DBIx::Class::ResultSource") ) { $ident = $ident->from(); } - - my ($sql, @bind) = $self->sql_maker->$op($ident, @args); - unshift(@bind, - map { ref $_ eq 'ARRAY' ? $_ : [ '!!dummy', $_ ] } @$extra_bind) - if $extra_bind; + + my ($sql, $bind) = $self->_prep_for_execute($op, $extra_bind, $ident, \@args); if ($self->debug) { my @debug_bind = - map { defined ($_ && $_->[1]) ? qq{'$_->[1]'} : q{'NULL'} } @bind; + map { defined ($_ && $_->[1]) ? qq{'$_->[1]'} : q{'NULL'} } @$bind; $self->debugobj->query_start($sql, @debug_bind); } @@ -865,7 +861,7 @@ sub _execute { my $rv = eval { my $placeholder_index = 1; - foreach my $bound (@bind) { + foreach my $bound (@$bind) { my $attributes = {}; my($column_name, @data) = @$bound; @@ -889,10 +885,10 @@ sub _execute { if ($self->debug) { my @debug_bind = - map { defined ($_ && $_->[1]) ? qq{'$_->[1]'} : q{'NULL'} } @bind; + map { defined ($_ && $_->[1]) ? qq{'$_->[1]'} : q{'NULL'} } @$bind; $self->debugobj->query_end($sql, @debug_bind); } - return (wantarray ? ($rv, $sth, @bind) : $rv); + return (wantarray ? ($rv, $sth, @$bind) : $rv); } sub insert {