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 #8115

DB_DataObject with generator_no_ini = yes wrong sequenceKey

Details

Submitted2006-07-04 15:00 UTC
Fromlistsdg at yahoo dot fr
StatusNo Feedback
PackageDB_DataObject
PHP Version5.1.4
Roadmaps(Not assigned)

Comments

[2006-07-04 15:00 UTC] listsdg at yahoo dot fr

Description:
------------
I'm using DB_DataObject with generator_no_ini=yes

The generated sequenceKey() method is wrong because it always use the primary key name of the first database's table.

Test script:
---------------
CREATE TABLE `liveuser_users` (
`auth_user_id` varchar(32) NOT NULL default '',
`handle` varchar(32) default NULL,
`passwd` varchar(32) default NULL,
`owner_user_id` int(11) default NULL,
`owner_group_id` int(11) default NULL,
`lastlogin` datetime default NULL,
`is_active` char(1) default NULL,
`company_id` int(10) default NULL,
`ao_maitreouvrage_id` int(11) default NULL,
`title` varchar(10) NOT NULL default '',
`first_name` varchar(255) NOT NULL default '',
`last_name` varchar(255) NOT NULL default '',
`fonction` varchar(45) NOT NULL default '',
`phone` varchar(20) NOT NULL default '',
`gsm` varchar(20) default NULL,
`fax` varchar(20) NOT NULL default '',
`email` varchar(45) NOT NULL default '',
PRIMARY KEY (`auth_user_id`),
UNIQUE KEY `handle_unique` (`handle`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

Auto generated methods :

function keys()
{
return array('auth_user_id');
}

function sequenceKey() // keyname, use native, native name
{
return array('id', true, false);
}

The primary key of the table is (for example) a "auth_user_id" column (used in a liveuser install), and there is no "id" column in the table.

(By the way, the sequence is stored in an other table (according with the liveUser schema).)