Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.0b4

Request #11445 Unicode data types in Datatype Module for mssql
Submitted: 2007-06-26 16:10 UTC
From: mkone Assigned: quipo
Status: Closed Package: MDB2_Driver_mssql (version 1.2.1)
PHP Version: 5.2.0 OS: Windows
Roadmaps: (Not assigned)    
Subscription  


 [2007-06-26 16:10 UTC] mkone (Martin Körner)
Description: ------------ The method _mapNativeDatatypes() in PEAR/MDB2/Driver/Datatype/mssql.php does currently not support the unicode datatypes of MS SQL Server: - nchar - nvarchar - ntext Possible solution: Change line 436 and the following from: ... case 'text': case 'varchar': $fixed = false; case 'char': ... to: ... case 'text': case 'ntext': case 'varchar': case 'nvarchar': $fixed = false; case 'char': case 'nchar': ... -------------------------------- Yes, it should be that easy ;) Test script: --------------- Table ------ CREATE TABLE [MyTable] ( [column1] [nvarchar] (50) ) ON [PRIMARY] Script ------ <? $db = MDB2::connect("..."); $db->loadModule('Reverse'); $res = $db->tableInfo('MyTable'); if (PEAR::isError($res)) { echo $res->toString(); } else { echo $res[0]['type']; } ?> Expected result: ---------------- text Actual result: -------------- [mdb2_error: message="MDB2 Error: not supported" code=-6 mode=return level=notice prefix="" info="_mapNativeDatatype: [Error message: unknown database attribute type: nvarchar] [Last executed query: SELECT t.table_name, c.column_name 'name', c.data_type 'type', CASE c.is_nullable WHEN 'YES' THEN 1 ELSE 0 END AS 'is_nullable', c.column_default, c.character_maximum_length 'length', c.numeric_precision, c.numeric_scale, c.character_set_name, c.collation_name FROM INFORMATION_SCHEMA.TABLES t, INFORMATION_SCHEMA.COLUMNS c WHERE t.table_name = c.table_name AND t.table_name = 'MyTable' AND c.column_name = 'MyTable' ORDER BY t.table_name] [Native code: 0] "]

Comments

 [2007-06-26 21:45 UTC] quipo (Lorenzo Alberton)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.