#42054 [Opn->Fbk]: odbc_result() crashes with NULL values
ID: 42054
Updated by: jani@php.net
Reported By: battisti at actgate dot com
-Status: Open
+Status: Feedback
Bug Type: ODBC related
Operating System: Red Hat Enterprise Linux WS rele
PHP Version: 4.4.7
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows (zip):
http://snaps.php.net/win32/php5.2-win32-latest.zip
For Windows (installer):
http://snaps.php.net/win32/php5.2-win32-installer-latest.msi
And I also suggest using the PDO ODBC driver instead..
Previous Comments:
------------------------------------------------------------------------
[2007-07-20 16:42:15] battisti at actgate dot com
Description:
------------
The odbc_result() function crashes if the value requested is a NULL
value in the DB.
Tested on: RHEL 4 WS 64 bit
Architecture: x86_64
PHP version: 4.3.9
DB: PostgreSQL 8.2.4
unixODBC: 2.2.9
$field_value = odbc_result($this->Query_ID, $i );
where $i is an index of a NULL value in the DB.
Reproduce code:
---------------
$field_value = odbc_result($this->Query_ID, $i );
where $i is an index of a NULL value in the DB.
Expected result:
----------------
$field_value == "" or "NULL" or ERROR, but I do not expect a crash :)
Actual result:
--------------
Simply a crash!
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42054&edit=1
Thread (4 messages)