ID: 44278
Updated by: jani@php.net
Reported By: ethan dot nelson at ltd dot org
-Status: Open
+Status: Feedback
Bug Type: PDO related
Operating System: win2k3
PHP Version: 5.2.5
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
Previous Comments:
------------------------------------------------------------------------
[2008-02-28 00:51:28] ethan dot nelson at ltd dot org
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 this bug report at http://bugs.php.net/?id=44278&edit=1