Issues

ZF-2231: Zend_Db_Table_Select does not utilise schema for find/fetch methods

Issue Type: Bug Created: 2007-11-24T17:39:31.000+0000 Last Updated: 2008-03-21T16:25:30.000+0000 Status: Resolved Fix version(s): - 1.5.0 (17/Mar/08)

Reporter: Simon Mundy (peptolab) Assignee: Simon Mundy (peptolab) Tags: - Zend_Db_Table

Related issues: Attachments:

Description

Reported by Luiz Vitor:-

I add the incubator library to my inclute path to start testing the Zend_Layout component. After I did this, all my fetchAll() calls stopped.

After digging a little in the code, I realized that Zend_Db_Table_Select::__toString() method was not adding the schema to the query construction.

<pre class="highlight">
Original code:
$fields  = $this->getPart(Zend_Db_Table_Select::COLUMNS);
$primary = $this->_info[Zend_Db_Table_Abstract::NAME];

// If no fields are specified we assume all fields from primary table 
if (!count($fields)) {
    $this->from($primary, '*');
    $fields = $this->getPart(Zend_Db_Table_Select::COLUMNS);
}

New code:
$fields  = $this->getPart(Zend_Db_Table_Select::COLUMNS); 
$primary = $this->_info[Zend_Db_Table_Abstract::NAME];
$schema  = $this->_info[Zend_Db_Table_Abstract::SCHEMA];

// If no fields are specified we assume all fields from primary table
if (!count($fields)) { 
    $this->from($primary, '*', $schema);
    $fields = $this->getPart(Zend_Db_Table_Select::COLUMNS);
}

Comments

Posted by Simon Mundy (peptolab) on 2007-11-24T20:01:07.000+0000

Resolved in incubator (r6923)

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts