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

Bug #13303 SQLite Manager doesn't return PRIMARY key (autoincrement field)
Submitted: 2008-03-04 05:13 UTC
From: ifeghali Assigned: quipo
Status: Closed Package: MDB2_Driver_sqlite
PHP Version: 5.2.5 OS: Mac OS 10.5
Roadmaps: (Not assigned)    
Subscription  


 [2008-03-04 05:13 UTC] ifeghali (Igor Feghali)
Description: ------------ The SQLite manager is not returning the primary key with listTableConstraints() Test script: --------------- <? require_once 'MDB2.php'; $sql = 'CREATE TABLE "People" ("id" INTEGER UNSIGNED NOT NULL PRIMARY KEY, "name" VARCHAR(128) DEFAULT \'unknown\' NOT NULL, "age" INTEGER UNSIGNED DEFAULT NULL, "birthdate" DATE, "occupation" VARCHAR(128), "updated" DATETIME, "aux" DOUBLE)'; $options = array( 'log_line_break' => '<br>', 'idxname_format' => '%s', 'debug' => true, 'quote_identifier' => true, 'portability' => false, 'disable_query' => false ); $dsn = "sqlite://localhost/tmp"; $db =& MDB2::connect($dsn, $options); $db->loadModule('Manager'); $db->loadModule('Reverse'); $db->exec($sql); print_r($db->manager->listTableConstraints('People')); print_r($db->reverse->getTableFieldDefinition('People', 'id')); $db->disconnect(); $dsn = "mysql://root@localhost/tmp"; $db =& MDB2::connect($dsn, $options); $db->loadModule('Manager'); $db->loadModule('Reverse'); $db->exec($sql); print_r($db->manager->listTableConstraints('People')); print_r($db->reverse->getTableFieldDefinition('People', 'id')); ?> Expected result: ---------------- same output for both drivers. Actual result: -------------- Array ( ) Array ( [0] => Array ( [notnull] => 1 [nativetype] => integer [length] => 4 [unsigned] => 0 [type] => integer [mdb2type] => integer ) ) Array ( [0] => PRIMARY ) Array ( [0] => Array ( [notnull] => 1 [nativetype] => int [length] => 4 [unsigned] => 1 [default] => [autoincrement] => 1 [type] => integer [mdb2type] => integer ) )

Comments

 [2008-03-05 11:08 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.