From: ethan dot nelson at ltd dot org Operating system: win2k3 PHP version: 5.2.5 PHP Bug Type: PDO related Bug description: nvarchar(max) mangled
Description: ------------ I'm using PDO and the ODBC extension. Also I've installed the latest version of the SQL 2005 client tools so that I could create a System DSN using the SQLNative driver. That in place, I've run into trouble when selecting data out of nvarchar(max) fields. nvarchar works fine, nvarchar(max) fails. Additionally, it appears that I can insert data into these columns without issue. Try something simple... Reproduce code: --------------- $pdo = new PDO("odbc:systemdsn"); $query = "SELECT CAST('asdfasdfasdf' AS nvarchar) AS good, CAST('asdfasdfasdf' AS nvarchar(max)) AS garbled"; $poo = $pdo->prepare($query); $poo->execute(); $row = $poo->fetch(PDO::FETCH_ASSOC); print_r($row); Expected result: ---------------- Array ( [good] => asdfasdfasdf [garbled] => asdfasdfasdf ) Actual result: -------------- Array ( [good] => asdfasdfasdf [garbled] => ��L �L��� ) -- Edit bug report at http://bugs.php.net/?id=44278&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=44278&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=44278&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=44278&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=44278&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=44278&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=44278&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=44278&r=needscript Try newer version: http://bugs.php.net/fix.php?id=44278&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=44278&r=support Expected behavior: http://bugs.php.net/fix.php?id=44278&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=44278&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=44278&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=44278&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=44278&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=44278&r=dst IIS Stability: http://bugs.php.net/fix.php?id=44278&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=44278&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=44278&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=44278&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=44278&r=mysqlcfg