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
Posted by Rob Allen (rob) on 2006-07-19T17:55:58.000+0000
Patch to ensure that the table name is quoted correctly in Zend_Db_Table::_fetch()
Posted by Rob Allen (rob) on 2006-07-24T09:25:08.000+0000
It appears that update(), insert() and delete() have the same problem!
zend_db_table_v2.diff fixes these too.
Posted by Bill Karwin (bkarwin) on 2006-11-13T15:14:33.000+0000
Changing fix version to 0.8.0.
Posted by Bill Karwin (bkarwin) on 2007-01-02T18:25:30.000+0000
Quoting identifiers is the general solution to this problem.
Posted by Bill Karwin (bkarwin) on 2007-01-05T17:06:25.000+0000
Recategorize as Zend_Db_Table component.
Posted by Bill Karwin (bkarwin) on 2007-03-16T01:11:50.000+0000
Duplicate of ZF-1038.
Posted by Bill Karwin (bkarwin) on 2007-03-16T01:12:06.000+0000
Linking to duplicate.