ID: 33309
Updated by: [EMAIL PROTECTED]
Reported By: alexander dot merz at gmail dot com
-Status: Open
+Status: Feedback
Bug Type: MSSQL related
Operating System: Windows XP Home
PHP Version: 5.0.4
Previous Comments:
------------------------------------------------------------------------
[2005-06-11 20:12:00] 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-11 17:29:32] [EMAIL PROTECTED]
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 15:25:05] [EMAIL PROTECTED]
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 14:14:06] 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 :(
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33309&edit=1