From:             info at peterke dot tk
Operating system: WinXP (with and without) SP1
PHP version:      4.3.4
PHP Bug Type:     MSSQL related
Bug description:  No MSSQL-functions possible when working with cursors

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.

-- 
Edit bug report at http://bugs.php.net/?id=27594&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=27594&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=27594&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=27594&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=27594&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=27594&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=27594&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=27594&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=27594&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=27594&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=27594&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=27594&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=27594&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27594&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=27594&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=27594&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=27594&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27594&r=float

Reply via email to