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

Bug #12242 missing charset infos in the reverse module
Submitted: 2007-10-13 15:32 UTC
From: cwiedmann Assigned: cwiedmann
Status: Closed Package: MDB2_Driver_mysqli (version 1.4.1)
PHP Version: Irrelevant OS: Irrelevant
Roadmaps: (Not assigned)    
Subscription  


 [2007-10-13 15:32 UTC] cwiedmann (Carsten Wiedmann)
Description: ------------ Hello, a) if you make a: | $mdb2->loadModule('Reverse', null, true); | $tableInfo = $mdb2->tableInfo('foo'); you have no information about the columns charset/collation in the resulting array. This can be neccesarry if you want to recreate the table (with manager module) with this information. In the attached patch I have added these infos for each column. But at the moment I have no idea how to store the table charset/collation in this array . b) In addition to Bug #10488, I think there is another problem. If you have a TIMESTAMP column in MySQL the resulting array looks like: | array(8) { | ["notnull"]=> | bool(true) | ["nativetype"]=> | string(9) "timestamp" | ["default"]=> | string(17) "CURRENT_TIMESTAMP" | ["type"]=> | string(9) "timestamp" | ["mdb2type"]=> | string(9) "timestamp" | ["name"]=> | string(3) "foo" | ["table"]=> | string(3) "bar" | ["flags"]=> | string(35) " not_null default_CURRENT_TIMESTAMP" But you can also not recreate this column with the manager module. Because a DEFAULT CURRENT_TIMESTAMP is illegal for a DATETIME column in MySQL, which the manager create instead of a TIMESTAMP. And yes: it's really a difference between a DATETIME and a TIMESTAMP. And if there was a TIMESTAMP, I want to have a TIMESTAMP ;-) BTW: On this manual page [1] you can read, that MDB is creating a TIMESTAMP in MySQL, and not a DATETIME. Regards, Carsten [1] http://pear.php.net/manual/en/package.database.mdb2.datatypes.php#AEN38081

Comments

 [2007-10-22 22:26 UTC] quipo (Lorenzo Alberton)
Patch committed, thanks. Can you open another bug report for issue (b), please? If I don't ask too much, with a simple reproducing script? Thanks a lot!