Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.12.3

Bug #58 ODBC result not freed for UPDATE and INSERT
Submitted: 2003-10-03 09:41 UTC
From: ecarpenter at itex dot co dot za Assigned: danielc
Status: Bogus Package: DB
PHP Version: 4.3.1 OS: Linux
Roadmaps: (Not assigned)    
Subscription  


 [2003-10-03 09:41 UTC] ecarpenter at itex dot co dot za
Description: ------------ No records set are returned from a stored procedure if an UPDATE or an INSERT query was done before calling the SP. Database: Sybase ASA 8.0.2 (4289) Connect type: ODBC Reproduce code: --------------- <?php include "DB.php"; $DBase = DB::connect("odbc://dba:sql@tams"); $Result = $DBase->query("update <your.table.name> set test2='testing' where test1=1"); $Qry = $DBase->query("call TestSP()"); while ($Row = $Qry->fetchrow()) { print_r($Row); } ?> CREATE PROCEDURE DBA."TestSP" () RESULT (Msg varchar(20)) BEGIN DECLARE LOCAL TEMPORARY TABLE TempTable ( MSG varchar(20) ); insert into TempTable values('testing this bug'); select MSG from TempTable; END Expected result: ---------------- 1. The test table is updated 2. The stored procedure returns a 1 row result that should be displayed in the while loop. Actual result: -------------- 1. The test table is updated 2. The stored procedure returns a 1 row result however the while loop is not entered. This problem can be fixed by doing a odbc_free_result on the returning result of the UPDATE instruction. The problem can be solved by added the following code to the start of the simpleQuery function in odbc.php if ($this->manip_result) { @odbc_free_result($this->manip_result); $this->manip_result=0; }//if I do not know what I am breaking with the above code ;)

Comments

 [2004-02-04 08:03 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!