diff options
author | Christian Schneider | 2008-04-06 19:48:51 +0000 |
---|---|---|
committer | Christian Schneider | 2008-04-06 19:48:51 +0000 |
commit | 673d81f2d40dcc09c716c25f7e71ddc46e97060f (patch) | |
tree | b2c9073f29a7d2848e5f4603bfdb96262ccc79d0 | |
parent | 66eb60ccf927e04a4a5bfb9a04d219b5d7b5a3a8 (diff) | |
download | itools-673d81f2d40dcc09c716c25f7e71ddc46e97060f.tar.gz itools-673d81f2d40dcc09c716c25f7e71ddc46e97060f.tar.bz2 itools-673d81f2d40dcc09c716c25f7e71ddc46e97060f.zip |
Fixed bogus conversion of NULL to 0 for integer fields
-rw-r--r-- | it_dbi.class | 2 | ||||
-rwxr-xr-x | tests/it_dbi.t | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/it_dbi.class b/it_dbi.class index be5f19c..2033d02 100644 --- a/it_dbi.class +++ b/it_dbi.class @@ -507,7 +507,7 @@ function iterate() if ($this->_data = mysql_fetch_assoc($this->_result)) { foreach ($this->_data as $field => $value) - $this->$field = $this->_isint[$field] ? ($this->_data[$field] = intval($value)) : $value; + $this->$field = isset($value) && $this->_isint[$field] ? ($this->_data[$field] = intval($value)) : $value; if (!empty($this->_p['keyfield'])) $this->_key = $this->_data[$this->_p['keyfield']]; diff --git a/tests/it_dbi.t b/tests/it_dbi.t index afffbae..63c7413 100755 --- a/tests/it_dbi.t +++ b/tests/it_dbi.t @@ -106,8 +106,8 @@ $record->update(array('foo' => "quux")); $record->read(2); is( - array($record->_key, $record->x, $record->foo), - array(2, null, "qux"), + array($record->_key, isset($record->x), $record->foo), + array(2, false, "qux"), "iterate update record 2" ); |