From: andreybl at matrix dot co dot il
Operating system: RedHat 3.0 ES
PHP version: 4.3.8
PHP Bug Type: Informix related
Bug description: ifx_getsqlca fails when DB-error occurs
Description:
------------
In case when ifx_query() fails it returns FALSE as result id.
When ifx_getsqlca gets false as result id, it complains:
<b>Warning</b>: ifx_getsqlca(): supplied resource is not a valid Informix
Result resource in <b>
This is actually a BUG, since when the sql-query fails, it is stll
neccessary sometimes, to get the sqlca structure. E.g. to get the ISAM
error.
Reproduce code:
---------------
sleep(20);
$db->begin_transaction();
$sql = "update tb set recordingdate = '2005-01-12 11:33:57.597' where
id = 138";
if (!($resid = ifx_query($sql, $db->connid)))
{
echo "Failed to open:\n$sql\n".ifx_error()."\n";
$db->rollback_transaction();
$sqlca = ifx_getsqlca($resind);
var_dump($sqlca);
die();
}
else
{
echo "Open successfull\n";
ifx_free_result($resid);
$db->commit_transaction();
}
Expected result:
----------------
ifx_getsqlca should get me the sqlca structure and not an error.
Actual result:
--------------
ifx_getsqlca fails, the following message appears:
<b>Warning</b>: ifx_getsqlca(): supplied argument is not a valid Informix
Result resource in <b>
--
Edit bug report at http://bugs.php.net/?id=31592&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=31592&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=31592&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=31592&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=31592&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=31592&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=31592&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=31592&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=31592&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=31592&r=support
Expected behavior: http://bugs.php.net/fix.php?id=31592&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=31592&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=31592&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=31592&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=31592&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=31592&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=31592&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=31592&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=31592&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=31592&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=31592&r=mysqlcfg