PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Database » DB_DataObject » Bug #8736

Generator : auto_increment flag searched in the wrong place with MDB2 mysqli

Details

Submitted2006-09-19 14:17 UTC
Fromgbcreation at free dot fr
Assignedalan_k
StatusClosed
PackageDB_DataObject
PHP Version5.1.6
OSGNU/Linux
Roadmaps(Not assigned)

Comments

[2006-09-19 14:17 UTC] gbcreation at free dot fr

Description:
------------
Database : MySql 4.1.12

Components used :

MDB2 2.2.2
MDB2_Driver_mysqli 1.2.2

The INI file auto built by the createTables.php script
contains the type 'K' for primary keys with auto_increment
flag instead of the type 'N'.

The bug is in the _generateDefinitionsTable() method of
the DB_DataObject_Generator class. Foreach table $t in
$defs (line 378) the auto_increment flag is searched in
the $t->flags property (line 517) instead of the
$t->autoincrement property set by the tableinfo() method
of MDB2.

Patch :

replace line 517 with these lines

if ( preg_match("/(auto_increment|
nextval\()/i",rawurldecode($t->flags)) ||
(isset($t->autoincrement) && $t->autoincrement === TRUE) )
{