summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChristian Schneider2012-05-10 13:21:26 +0000
committerChristian Schneider2012-05-10 13:21:26 +0000
commit255b45b8900fed7aab59c37b0847e5936bf62e54 (patch)
treefef39228421c7c3b64dfd604b57c1e103643a824 /tests
parent3b876e6feff6b67290e69ec64704468f74c573e3 (diff)
downloaditools-255b45b8900fed7aab59c37b0847e5936bf62e54.tar.gz
itools-255b45b8900fed7aab59c37b0847e5936bf62e54.tar.bz2
itools-255b45b8900fed7aab59c37b0847e5936bf62e54.zip
New update() optimization: Optimize away 42 <=> "42"
Diffstat (limited to 'tests')
-rwxr-xr-xtests/it_dbi.t19
1 files changed, 17 insertions, 2 deletions
diff --git a/tests/it_dbi.t b/tests/it_dbi.t
index 4a58188..ecd40e3 100755
--- a/tests/it_dbi.t
+++ b/tests/it_dbi.t
@@ -151,13 +151,28 @@ isnt(
"update with function"
);
+$record->update(array('foo' => "00"));
$rand = $record->x;
is (
- $record->_set(array('x' => $rand, 'foo' => "bar")),
- "SET `foo`='bar'",
+ $record->_set(array('x' => $rand, 'foo' => "0")),
+ "SET `foo`='0'",
'update: _set optimization'
);
+$record->update(array('foo' => NULL));
+is (
+ $record->_set('foo' => ""),
+ "SET `foo`=''",
+ 'update: _set optimization with NULL => ""'
+);
+$record->update(array('foo' => "bar"));
+$record->update(array('foo' => ""));
+is (
+ $record->_set('foo' => NULL),
+ "SET `foo`=NULL",
+ 'update: _set optimization with "" => NULL'
+);
+
$record->update(array('foo' => "bar"));
$record->select(array('foo' => "bar"));
$record->iterate();