[interchange] Fix bug in &Vend::Data::update_data

Jon Jensen interchange-cvs at icdevgroup.org
Tue Apr 3 21:02:52 UTC 2018


commit a603f8914031e8611d5cb4b2b3029d6dbc84d463
Author: Jon Jensen <jon at endpoint.com>
Date:   Tue Apr 3 14:56:07 2018 -0600

    Fix bug in &Vend::Data::update_data
    
    I inadvertently introduced this bug in commit fa639368 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 at 3edge.com>. Thanks, Gert!

 lib/Vend/Data.pm |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/lib/Vend/Data.pm b/lib/Vend/Data.pm
index 98e485c..1244a59 100644
--- a/lib/Vend/Data.pm
+++ b/lib/Vend/Data.pm
@@ -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]) {



More information about the interchange-cvs mailing list