Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.5.0RC1
-
Fix Version/s: 1.9.0
-
Component/s: Zend_Db_Table
-
Labels:None
-
Fix Version Priority:Must Have
Description
Joining tables with setIntegrityCheck(false) doesn't work without specifying the primary table with $select->from($table). If from is not specified, join acts exactly the same as from and doesn't use it's required parameters at all.
More info about this: http://framework.zend.com/manual/en/zend.db.table.html#zend.db.table.qry.rows.set.integrity.example
Issue Links
| This issue depends on: | ||||
| ZF-2546 | Zend_Db_Table_Select should include its own table in the FROM section |
|
|
|
Steps to reproduce:
1. Create a table class for a database table that extends Zend_Db_Table_Abstract
2. Create an accessor function that uses:
$select = $this->select()
->setIntegrityCheck(false)
->joinLeft('tableB', 'tableA.id=tableB.id');
echo $select->__toString();
reveals that the first table (the one for which the table class was extended) is not part of the query.
(ugly workaround, add another join to force the original table back into the query)
$select = $this->select()
->setIntegrityCheck(false)
->joinLeft('tableA', 'tableA.id=tableB.id')
->joinLeft('tableB', 'tableA.id=tableB.id');