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

Bug #10452 getDeclaration() with custom datatype_map error
Submitted: 2007-03-22 13:45 UTC
From: nilya Assigned: quipo
Status: Closed Package: MDB2 (version 2.4.0)
PHP Version: 5.2.1 OS: win
Roadmaps: (Not assigned)    

 [2007-03-22 13:45 UTC] nilya (Ilya Nazarov)
Description: ------------ Can't create table with MDB2_Manager_Common::createTable() when using custom datatypes, provided DDL SQL are incorrect (see test script). Test script: --------------- $db = MDB2::factory('mysqli://root@localhost/test'); $db->setOption('datatype_map', array('address'=>'text')); $fields = array( 'id' => array('type'=>'integer'), 'company_addr' => array('type'=>'address'), ); echo $db->mgGetFieldDeclarationList($fields); Expected result: ---------------- "id INT DEFAULT NULL, company_addr TEXT DEFAULT NULL" Actual result: -------------- "id INT DEFAULT NULL, company_addr DEFAULT NULL" - field type lost.


 [2007-03-22 14:31 UTC] nilya (Ilya Nazarov)
See patch with one of possible solutions. But probably this not the best solution.
 [2007-03-22 15:53 UTC] quipo (Lorenzo Alberton)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on by the end of next Sunday (CET). If this was a problem with the 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. -- The patch was almost correct, thanks. I added a testcase too.