ZF-273: MS SQL Server: Zend_Db_Table doesn't correctly quote the table name

Description

Code:

class User extends Zend_Db_Table { function findByUsername($username) { $where = $this->_db->quoteInto('username = ?', $username); $row = $this->fetchRow($where); } };

This fails under MSSQL because the table name ("user" in this case) is a reserved word.

Zend_Db_Table::_fetch() should quote the table name using the DB adapter's quoteIdentifier() function.

Comments

Patch to ensure that the table name is quoted correctly in Zend_Db_Table::_fetch()

It appears that update(), insert() and delete() have the same problem!

zend_db_table_v2.diff fixes these too.

Changing fix version to 0.8.0.

Quoting identifiers is the general solution to this problem.

Recategorize as Zend_Db_Table component.

Duplicate of ZF-1038.

Linking to duplicate.