php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15192 MSSQL functions crashing PHP
Submitted: 2002-01-23 19:55 UTC Modified: 2002-10-25 01:00 UTC
Votes:3
Avg. Score:3.7 ± 1.9
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:1 (50.0%)
From: sean at castlerock dot com Assigned:
Status: No Feedback Package: MSSQL related
PHP Version: 4.0.6 OS: Windows 2000
Private report: No CVE-ID: None
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
39 - 3 = ?
Subscribe to this entry?

 
 [2002-01-23 19:55 UTC] sean at castlerock dot com
This bug happens when requesting a lot (1000+) rows from an MSSQL database 
or less lines if you've executed a bunch of other code first.  My test case 
was with a table called "data" with three fields: 

     "pt_index(int)","pt_time(datetime)","pt_data(real)"
 
I set the index to 22 for each row, pt_time to each minute of the day, and
pt_data to random values.  My code was working fine under 4.0.5, but with 
4.1.0 and 4.1.1 it generates an application error in php.exe - trying to 
reference a null pointer.  Interestingly, it works fine if I didn't supply
the date ranges.  Anyways, I searched through the code and saw I was 
getting the exception in the memory allocation function which means the 
heap is being corrupted somewhere else.  Any ideas on what was added?  

<?php
$link = mssql_connect ("127.0.0.1","","") or die (mssql_get_last_message());
mssql_select_db("TestDB");

$req = "select * from data where pt_index=22 and ".
	"pt_time >= '2001-12-3' and pt_time < '2001-12-4'";

$data=mssql_query($req, $link) or die (mssql_get_last_message());

while ($row=mssql_fetch_array($data)){
	print_r($row);
	echo "<br>";
}
?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-23 19:57 UTC] sean at castlerock dot com
Tried it under 4.0.6 and it crashes as well, switch back to 4.0.5, works just fine.
 [2002-10-09 11:36 UTC] iliaa@php.net
Please try using this CVS snapshot:

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


 [2002-10-25 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over 2 weeks, 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: Sat Oct 12 13:01:27 2024 UTC