#31592 [NoF->Opn]: ifx_getsqlca fails when DB-error occurs

From: Date: Wed, 04 May 2005 15:07:16 +0000
Subject: #31592 [NoF->Opn]: ifx_getsqlca fails when DB-error occurs
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-78610@lists.php.net to get a copy of this message
ID: 31592 User updated by: andreybl at matrix dot co dot il Reported By: andreybl at matrix dot co dot il -Status: No Feedback +Status: Open Bug Type: Informix related Operating System: RedHat 3.0 ES -PHP Version: 4.3.8 +PHP Version: 4.3.11 New Comment: Tried on version 4.3.11. No change. I.e. it is impossible to use ifx_getsqlca in case when some SQL error occurred. Previous Comments: ------------------------------------------------------------------------ [2005-02-21 19:58:24] sniper@php.net No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Open". Thank you. ------------------------------------------------------------------------ [2005-02-03 05:18:41] sniper@php.net Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip ------------------------------------------------------------------------ [2005-01-18 09:26:17] andreybl at matrix dot co dot il 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 this bug report at http://bugs.php.net/?id=31592&edit=1

« previous php.bugs (#78610) next »