From: snick at getart dot ru Operating system: Windows 2003 Server PHP version: 4.3.2 PHP Bug Type: MSSQL related Bug description: Only 255 characters returned from varchar field
Description: ------------ Then I try to read value of VARCHAR field I get only 255 characters, but VARCHAR is 8000 bytes long. MSSQL v. 7.0 ntwdblib.dll v. 2000.80.194.0 PHP v. 4.3.2 Apache v. 2.0.43 / IIS 6 Reproduce code: --------------- $myVar = str_repeat("*", 500); mssql_query("DELETE FROM myTable"); mssql_query("INSERT INTO myTable (myField) VALUES ('".$myVar."')"); $query = "SELECT LEN(myField), myField FROM myTable"; list($realLength, $myVar) = mssql_fetch_row(mssql_query($query)); echo "DB length: ".$realLength."; PHP length: ".strlen($myVar); Expected result: ---------------- $myVar must be equal $realLength Actual result: -------------- strlen($myVar) == 255 (always) -- Edit bug report at http://bugs.php.net/?id=25544&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=25544&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=25544&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=25544&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=25544&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=25544&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=25544&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=25544&r=support Expected behavior: http://bugs.php.net/fix.php?id=25544&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=25544&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=25544&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=25544&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25544&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=25544&r=dst IIS Stability: http://bugs.php.net/fix.php?id=25544&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=25544&r=gnused