summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorUrban Müller2018-08-09 17:36:23 +0200
committerUrban Müller2018-08-09 17:36:23 +0200
commitf8aabe317e7a7997594bc124aa17fd4d6442dfd1 (patch)
treeed7d384ba76443d86a5ab2bf87471d082d63b90f /test
parent8c399fb12571ae5950a1e3fe186e999abdc0b504 (diff)
downloaditools-f8aabe317e7a7997594bc124aa17fd4d6442dfd1.tar.gz
itools-f8aabe317e7a7997594bc124aa17fd4d6442dfd1.tar.bz2
itools-f8aabe317e7a7997594bc124aa17fd4d6442dfd1.zip
iterator should clear dynfields from previous iteration, may be missing in current one
Diffstat (limited to 'test')
-rwxr-xr-xtest/it_dbi.t11
1 files changed, 11 insertions, 0 deletions
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
#