php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27594 No MSSQL-functions possible when working with cursors
Submitted: 2004-03-14 06:37 UTC Modified: 2004-03-15 14:33 UTC
From: info at peterke dot tk Assigned:
Status: Closed Package: MSSQL related
PHP Version: 4CVS-2004-03-15 OS: WinXP (with and without) SP1
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: info at peterke dot tk
New email:
PHP Version: OS:

 

 [2004-03-14 06:37 UTC] info at peterke dot tk
Description:
------------
PHP seems to crash Apache 2 webserver when working with MSSQL-functions and a MSSQL-CURSOR (I tried it without a MSSQL-function and that worked perfect, I tried working with MSSQL-functions without a CURSOR, and that worked perfect too). There are no traces of the crashing, only a windows dialogbox and an error in the apache error.log

changes in php.ini: 
error_reporting  =  E_ALL
display_startup_errors = On
log_errors = On
error_log = D:/www/error.log
doc_root = d:/www
extension=php_mssql.dll
mssql.datetimeconvert = Off

(php runs as a module)

Reproduce code:
---------------
$Link = mssql_connect("localhost","user","password");
mssql_select_db("database", $Link);

$Query = "DECLARE tmpCursor CURSOR SCROLL FOR SELECT CAST(myField AS VARCHAR) FROM myTable
          OPEN tmpCursor
          FETCH LAST FROM tmpCursor
          CLOSE tmpCursor
          DEALLOCATE tmpCursor";

$Result = mssql_query($Query, $Link);
while (mssql_next_result($Result) == TRUE)
{
  $row = mssql_fetch_row($Result);
  print_r($row);
}
mssql_free_result($Result);
mssql_close($Link);


Expected result:
----------------
the last element from a cursor (in this case casted to a varchar, but other functions like 'ROUND()' don't seem to work either)

Actual result:
--------------
Apache crashes with 'The instruction on 0x006f7e9e points to memory on 0x00000000. The read or write-instruction ("read") on the memory failed.' in a windows dialog box. In the error.log (apache) is stated:
[Sun Mar 14 11:42:31 2004] [notice] Parent: child process exited with status 3221225477 -- Restarting.
[Sun Mar 14 11:42:31 2004] [notice] Parent: Created child process 1640
[Sun Mar 14 11:42:31 2004] [notice] Child 1640: Child process is running
[Sun Mar 14 11:42:31 2004] [notice] Child 1640: Acquired the start mutex.
[Sun Mar 14 11:42:32 2004] [notice] Child 1640: Starting 250 worker threads.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-03-15 13:09 UTC] info at peterke dot tk
That doesn't work either on a WinXP SP1. 
I tried it on a W2k-platform too (SP4) (first situation), same result.
I connect with a MSSQL 2K.
 [2004-03-15 14:33 UTC] fmk@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Computed columns does not retuen a column source
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jan 15 06:01:30 2025 UTC