ID: 25817
Comment by: rkumar at bombay dot imrglobal dot com
Reported By: fjortiz at comunet dot es
Status: Closed
Bug Type: MSSQL related
Operating System: Windows
PHP Version: 4.3.4RC2-dev
Assigned To: fmk
New Comment:
Hi All,
I had the same problem about recordset and output value both not
getting returned. I have made the modifications to PHP_MSSQL.dll and
compiled it successfully and incase anyone wants the binary just drop a
mail and I will be glad to send you the compiled DLL file. The new DLL
file has been tested in my application and will help all other fellow
developers as they wont have to recompile the file again. This will be
my small contribution to the Open Source World.
Regards,
Rajesh Kumar
Previous Comments:
------------------------------------------------------------------------
[2003-11-17 15:55:01] [EMAIL PROTECTED]
The code was changed to handle multiple results with or without a
return value.
MS SQL Server will not make the return value available until all
results have been fetched from the server.
I have changed the code so it checks after each batch fetched. This
should fix your problem and the problem you would get if data is
divided into smaler batches.
------------------------------------------------------------------------
[2003-10-10 04:24:58] fjortiz at comunet dot es
Description:
------------
I helped create the mssql_execute function, and I see a bug has been
introduced since 4.1.1 (last time I saw the code)
If you craft a stored procedure returning BOTH a recordset and output
variables, you'll only get the recordset, not the output variables.
This worked fine in 4.1.1
Here is the problem:
php_mssql.c, line 2110
if ((num_fields = dbnumcols(mssql_ptr->link)) > 0) {
// then get recordset...
}
else { // get output variables
_mssql_get_sp_result(mssql_ptr, statement TSRMLS_CC);
}
this is wrong. You can get both of them. This is it:
if ((num_fields = dbnumcols(mssql_ptr->link)) > 0) {
// then get recordset...
}
// and ALWAYS get the output variables
_mssql_get_sp_result(mssql_ptr, statement TSRMLS_CC);
I recompiled 4.3.3 php_mssql.dll with this and it works as expected
(and as it was back in 4.1.1)
BTW it's in 4.3.4rc1 too.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25817&edit=1