Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

return number of rows we changed

  • Loading branch information...
commit 18e008c206899d2092f5a73b4e0337304f02ffda 1 parent bc97240
@ruz ruz authored
Showing with 2 additions and 5 deletions.
  1. +2 −5 lib/DBIx/SearchBuilder/Handle/mysql.pm
View
7 lib/DBIx/SearchBuilder/Handle/mysql.pm
@@ -92,9 +92,6 @@ sub DeleteFromSelect {
$table, $query, @query_binds
) unless $query =~ /\b\Q$table\E\b/i;
- my $sth = $self->SimpleQuery( $query, @query_binds );
- return $sth unless $sth;
-
return $self->SimpleMassChangeFromSelect(
"DELETE FROM $table WHERE id IN ", [],
$query, @query_binds
@@ -122,14 +119,14 @@ sub SimpleMassChangeFromSelect {
my $sth = $self->SimpleQuery( $q, @$update_binds, splice @ids );
return $sth unless $sth;
- $res += @ids;
+ $res += $sth->rows;
}
if ( @ids ) {
my $q = $update_query .'('. join( ',', ('?')x@ids ) .')';
my $sth = $self->SimpleQuery( $q, @$update_binds, splice @ids );
return $sth unless $sth;
- $res += @ids;
+ $res += $sth->rows;
}
return $res == 0? '0E0': $res;
}
Please sign in to comment.
Something went wrong with that request. Please try again.