ZF-3744: Zend_Session_SaveHandler_DbTable throwing errors in version 1.6 RC1


When the Zend_Session_SaveHandler_DbTable is used as the save handler for sessions it throws an error as follows:

PHP Fatal error: Uncaught exception 'Zend_Session_Exception' with message 'Zend_Session::start() - Undefined variable: alias' in /usr/share/pear/Zend/Session.php:430 Stack trace:

0 /var/www/html/misc/db_session.php(28): Zend_Session::start()

1 {main}

thrown in /usr/share/pear/Zend/Session.php on line 430

Here is the test script I'm using:

<?php require_once 'Zend/Session.php'; require_once 'Zend/Db.php'; require_once 'Zend/Session/SaveHandler/DbTable.php'; require_once 'Zend/Db/Table/Abstract.php'; require_once 'Zend/Session/Namespace.php'; $db = Zend_Db::factory('Oracle', array( 'host' =>'*******', 'username' => '*******', 'password' => '*******', 'dbname' => '*******' )); Zend_Db_Table_Abstract::setDefaultAdapter($db); $config = array( 'name' => 'SESSIONS', 'primary' => 'ID', 'modifiedColumn' => 'MODIFIED', 'dataColumn' => 'DATA', 'lifetimeColumn' => 'LIFETIME' ); Zend_Session::setSaveHandler( new Zend_Session_SaveHandler_DbTable($config) ); Zend_Session::start(); echo "foobar"; ?>


I have found the cause of this issue. The quoteTableAs function for the Oracle database adapter is missing a default value for the variable alias on line 190. Once the default value is added all functionality works as expected.