php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33309 mssql_query crashes php
Submitted: 2005-06-11 14:14 UTC Modified: 2005-11-14 01:00 UTC
From: alexander dot merz at gmail dot com Assigned: fmk (profile)
Status: No Feedback Package: MSSQL related
PHP Version: 5.0.4 OS: Windows XP Home
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: alexander dot merz at gmail dot com
New email:
PHP Version: OS:

 

 [2005-06-11 14:14 UTC] alexander dot merz at gmail dot com
Description:
------------
Running the current PEAR::MDB2 testsuite in CVS against MS SQLServer 2005 Beta causes a crash of php.

The source causing the crash reduced to a minimum is given in the "Reproduced code" section.

The crash does also happend if you list the field names directly:
'SELECT user_name, user_password, subscribed, user_id, quota, weight, access_date, access_time, approved  FROM users'

It does crash too, if the statment above contains only the first two fields (user_name, user_password) and *one* of the others, ie:
'SELECT user_name, user_password, subscribed FROM users'

It *works*, if the field list does NOT contain the user_password field, independed of length of the field list, ie:
'SELECT user_name, subscribed, user_id, quota, weight, access_date, access_time, approved  FROM users'

user_password is of the type 'text'.

The table is empty, and the statement works like a charm in the SQL Query console of Server Management Studio.

Reproduce code:
---------------
 $c = mssql_connect("ALEX", "amerz", "amerz");
 mssql_select_db("driver_test", $c);
 mssql_query('SELECT *  FROM users');
 mssql_close($c);

Expected result:
----------------
No crash :)

Actual result:
--------------
a crash :(

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-06-11 15:25 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip


 [2005-06-11 17:29 UTC] fmk@php.net
The same code works fine with previous versions of MS SQL Server.
MS SQL Server 2005 Beta is not a stable target to test against.

 [2005-06-11 20:12 UTC] alexander dot merz at gmail dot com
I would agree, but a much more complex java app works perfectly on the beta using a jdbc driver older then the beta version!

I will test it with a newer version of php next monday.

But, this seems to be definitly a bug in the php extension, especialy how it fetches the result set. I made some further tests.

I create a test table containing one record and run the small script again:
 $c = mssql_connect("ALEX", "amerz", "amerz");
 mssql_select_db("text_test", $c);
 var_dump(mssql_query('SELECT text1, text2  FROM texttable', $c));
 mssql_close($c);

The result: It prints
resource(5) of type (mssql result)

and then php crashes...
 [2005-06-13 13:17 UTC] alexander dot merz at gmail dot com
The latest php version (5.1.0) crashes also.
 [2005-11-06 23:57 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip


 [2005-11-14 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Nov 05 02:01:31 2024 UTC