From f8aabe317e7a7997594bc124aa17fd4d6442dfd1 Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Thu, 9 Aug 2018 17:36:23 +0200 Subject: iterator should clear dynfields from previous iteration, may be missing in current one --- test/it_dbi.t | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/it_dbi.t') diff --git a/test/it_dbi.t b/test/it_dbi.t index 70d7f6f..89df3b8 100755 --- a/test/it_dbi.t +++ b/test/it_dbi.t @@ -349,6 +349,17 @@ $r->update(['key4' => "val4'"]); is($r->_writes, 0); is($r- $r->update(['key4' => "val4'", 'key5' => "val5'"]); is($r->_writes, 1); is($r->key4, "val4'"); is($r->key5, "val5'"); $r->update(['key4' => "val4'", 'key5' => "val5'"]); is($r->_writes, 1); is($r->key4, "val4'"); is($r->key5, "val5'"); +# Check if iterator clears dynfields left over from previous record +$r->delete(["WHERE 1"]); +$r->replace(['ID' => 1, 'key1' => "a"]); +$r->replace(['ID' => 2, 'key2' => "b"]); +$r->clear(false); +$r->select("WHERE 1 ORDER BY ID"); +$r->iterate(); +is($r->key1, "a"); is($r->key2, null); +$r->iterate(); +is($r->key1, null); is($r->key2, "b"); + # # Test tracked update # -- cgit v1.2.3