From: agnerm at aloc dot dk
Operating system: Windows 2000
PHP version: 4.3.4
PHP Bug Type: MSSQL related
Bug description: Query only gets the first 4096 bytes
Description:
------------
When trying to get a IMAGE-field from a MSSQL database I only get the
first 4096.
Reproduce code:
---------------
function SQL($sqlStatement)
{
global $sqlConnection,$sqlDB;
mssql_select_db($sqlDB,$sqlConnection) or die("fejl ved \"connection\"
til databasen ($sqlDB)");
$rs = mssql_query($sqlStatement,$sqlConnection) or die("Fejl i
Sql-".nl2br($sqlStatement));
return $rs;
}
function SQL2D($sqlStatement,$antal=-1)
{
global $sqlConnection,$sqlDB;
$dataArray="";
$rs=SQL($sqlStatement,$sqlDB);
if (mssql_num_rows($rs)==0) return null;
if ($antal==-1) $antal=mssql_num_rows($rs);
for ($y=0;(($y<mssql_num_rows($rs))&&($y<$antal));$y++)
{
$row = mssql_fetch_row($rs);
for($i=0;$i<count($row);$i++)
{
$dataArray[$y][mssql_field_name($rs,$i)]=$row[$i];
}
}
return $dataArray;
}
SQL("SET TEXTSIZE 512000");
SQL2D_out("SELECT @@TEXTSIZE");
$fil=SQL2D("SELECT len= DATALENGTH(dbo.nyheder.fil),dbo.nyheder.fil from
dbo.nyheder where nyhederid=9");
echo $fil[0]["len"];
echo "\n<br>";
echo strlen ($fil[0]["fil"]);
Expected result:
----------------
<table border=1>
<tr>
<td>computed</td>
</tr>
<tr>
<td>512000</td>
</tr>
</table>
34510
<br>34510
Actual result:
--------------
<table border=1>
<tr>
<td>computed</td>
</tr>
<tr>
<td>512000</td>
</tr>
</table>
34510
<br>4096
--
Edit bug report at http://bugs.php.net/?id=26876&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=26876&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=26876&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=26876&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=26876&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=26876&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=26876&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=26876&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=26876&r=support
Expected behavior: http://bugs.php.net/fix.php?id=26876&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=26876&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=26876&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=26876&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26876&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=26876&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=26876&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=26876&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26876&r=float