From: larry_li at contractor dot amat dot com
Operating system: W2K Server
PHP version: 4.3.2
PHP Bug Type: MSSQL related
Bug description: SQL Query is pending there, no any result back.
Description:
------------
I have a table likes:
plant char(4),
partID char(18),
movementType char(3),
txnDate char(8),
quantity int,
price smallmoney
I got php.exe freezing while I was trying to query this table by php. I
checked process info on SQL management window and found query was not
closed. I must kill this process id. Sometimes wait type is sleeping,
sometimes is NETWORKIO. First, I just suspend server has not enough socket
memoy space and sql server can't write result back. Finally I found it's
maybe php's fault.
When I change price's type to float from smallmoney, I fixed this rpoblem.
No any query jam happens. I guess maybe php treats smallmoney's byte
length different as SQL server do. Even though SQL server return
everything back, php.exe still think serveral bytes will be coming. Just
my 2 cents. P.S. SQL server is running on the simplify chinese w2k server.
Reproduce code:
---------------
$date1=date("Ymd",strtotime($date1));
$date2=date("Ymd",strtotime($date2));
$query = "select * from sapinout where txnDate>='$date1' and
txnDate<='$date2'";
$queryResult = $AMC_DB->query($query);
$header="Date\t";
$header.="Plant\t";
$header.="Part ID\t";
$header.="Movement Type\t";
$header.="Quantity\t";
$header.="Price";
$data="";
while ( $row = mssql_fetch_array($queryResult) )
{
$line="";
$value = '"' . $row[txnDate] . '"' . "\t"; $line .= $value;
$value = '"' . $row[plant] . '"' . "\t"; $line .= $value;
$value = '"' . $row[partID] . '"' . "\t"; $line .= $value;
$value = '"' . $row[movementType] . '"' . "\t"; $line .= $value;
$value = '"' . $row[quantity] . '"' . "\t"; $line .= $value;
$value = '"' . $row[price] . '"' . "\t"; $line .= $value;
$data .= trim($line)."\n";
}
Expected result:
----------------
Will return result immedately!
Actual result:
--------------
No any return from web server.
--
Edit bug report at http://bugs.php.net/?id=25283&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=25283&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=25283&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=25283&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=25283&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=25283&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=25283&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=25283&r=support
Expected behavior: http://bugs.php.net/fix.php?id=25283&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=25283&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=25283&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=25283&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25283&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=25283&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=25283&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=25283&r=gnused