PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » DB_DataObject » Bug #3302

joinAdd in CVS not calling $obj->_connect()

Details

Submitted2005-01-26 16:30 UTC
Frommcraig at leadehealth dot com
Assignedalan_k
StatusClosed
PackageDB_DataObject
PHP Version4.3.9
OSlinux
Roadmaps(Not assigned)

Comments

[2005-01-26 16:30 UTC] mcraig at leadehealth dot com

Description:
------------
applies to cvs copy 1.321 of DataObject.php

When calling joinAdd with arg[0] as an array of setting so that joinAdd dynamically creates the object ($obj) it seems that $obj->_connect() never gets called.

I got queries like this. "SELECT * FROM table1 INNER JOIN table2 ON .table2.id = maindb.table1.twoid WHERE table1.id=40"
even though table1 and table2 are in the same database.

var_dump($obj) right before line 2844 shows there is no database connection info present.

Reproduce code:
---------------
This code seems to always execute.

// add database prefix if they are different databases if (($obj->_database != $this->_database) && strlen($this->_database )) {
$table = ($quoteIdentifiers ? $DB->quoteIdentifier($this->_database) : $this->_database) . '.' . $table;
}