Home » Database » DB_DataObject » Bug #8736
Generator : auto_increment flag searched in the wrong place with MDB2 mysqli
Details
| Submitted | 2006-09-19 14:17 UTC |
|---|---|
| From | gbcreation at free dot fr |
| Assigned | alan_k |
| Status | Closed |
| Package | DB_DataObject |
| PHP Version | 5.1.6 |
| OS | GNU/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) )
{