Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix bug in &Vend::Data::update_data
I inadvertently introduced this bug in commit fa63936 while optimizing
a loop. The arrayref passed to set_slice is, in some cases, apparently
mutated somewhere down the line, though it worked fine in my tests.

Found by Gert van der Spoel <gert@3edge.com>. Thanks, Gert!
  • Loading branch information
jonjensen committed Apr 3, 2018
1 parent d8d9b66 commit a603f89
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/Vend/Data.pm
Expand Up @@ -2288,9 +2288,8 @@ sub update_data {
|| $function eq 'insert' && $::Pragma->{dml} eq 'preserve';

my $k = $multikey ? undef : $key;
my $args = [$dml, $k];
for (keys %$qd) {
$qret = $qd->{$_}->set_slice($args, $qf->{$_}, $qv->{$_});
$qret = $qd->{$_}->set_slice([$dml, $k], $qf->{$_}, $qv->{$_});
$rows_set[$i] ||= $qret;
}
if($blob && $rows_set[$i]) {
Expand Down

0 comments on commit a603f89

Please sign in to comment.