Zend Framework

Schema not in select statements

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 0.9.3
  • Fix Version/s: 1.0.0 RC1
  • Component/s: Zend_Db_Table
  • Labels:
    None

Description

schema name not showing up in select statements using Zend_Db_Table_Abstract->fetchAll()

I am using:
PHP 5.2.0
Zend Framework Preview Release 0.9.3-Beta (build 4727)
(PostgreSQL) 8.1.8

Zend/Db/Table/Abstract.php i
n method Zend_Db_Table_Abstract->_fetch
l

$select->from($this->_name, $this->_cols);

should it be

if (is_null($this->_schema)) {
          $select->from($this->_name, $this->_cols);
       }
       else {
        $select->from($this->_schema.'.'.$this->_name, $this->_cols);
       }

I am not sure if this will break other things like mysql, but it fixes
my current issue.

the errors i get:

Fatal error: Uncaught exception 'Zend_Db_Adapter_Exception' with message
'SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "network" does not
exist'
in /home/jmotes/workspace/console/library/Zend/Db/Adapter/Pdo/Abstract.php:177
Stack trace:
#0 /home/jmotes/workspace/console/library/Zend/Db/Table/Abstract.php(1025): Zend_Db_Adapter_Pdo_Abstract->query(Object(Zend_Db_Select))
#1 /home/jmotes/workspace/console/library/Zend/Db/Table/Abstract.php(907): Zend_Db_Table_Abstract->_fetch(NULL, NULL, NULL, NULL)
#2 /home/jmotes/workspace/console/application/controllers/ConsoleController.php(37): Zend_Db_Table_Abstract->fetchAll()
#3 /home/jmotes/workspace/console/library/Zend/Controller/Action.php(438): ConsoleController->showNetworksAction()
#4 /home/jmotes/workspace/console/library/Zend/Controller/Dispatcher/Standard.php(214): Zend_Controller_Action->dispatch('shownetworksAct...')
#5 /home/jmotes/workspace/console/library/Zend/Controller/Front.php(754): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Reque in /home/jmotes/workspace/console/library/Zend/Db/Adapter/Pdo/Abstract.php on line 177

if i put a print $sql line in /Db/Adapter/Pdo/Abstract.php on line 177 i get:
SELECT
"network"."id",
"network"."name"
FROM "network"

if i am using my modified version of /Db/Table/Abstract.php i get:
SELECT
"network"."id",
"network"."name"
FROM "dclk"."network"

and no errors!!

Issue Links

Activity

Hide
Bill Karwin added a comment -

Assigning to Darby.

Show
Bill Karwin added a comment - Assigning to Darby.
Hide
Darby Felton added a comment -

Resolved with SVN r4969.

Show
Darby Felton added a comment - Resolved with SVN r4969.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: