ZF-10605: allow use of database.schema.table in Zend_Db_Select
Description
Using database.schema.table (often needed in MSSQL) results in the SQL string outputting "database"."schema". It doesn't recognize the 3 part name. In this case, it seems to be an easy fix, just limit the explode to 2 parts. I'm probably missing the 'correct' way to do this, but I didn't see anything for the select statement builder relating to this.
`
protected function _join($type, $name, $cond, $cols, $schema = null) { ... // Schema from table name overrides schema argument if (!is_object($tableName) && false !== strpos($tableName, '.')) { - list($schema, $tableName) = explode('.', $tableName); + list($schema, $tableName) = explode('.', $tableName, 2); } ... } ```
Comments
Posted by Ralph Schindler (ralph) on 2011-04-01T19:19:05.000+0000
Postponing. To be not an issue in ZF2.
Posted by Andrew Keller (akeller) on 2012-01-29T04:44:47.000+0000
I had this problem as well and used the $schema parameter to work around it.
This is working for me on version 1.11.11 of the Zend Framework. But I agree it would be great for Zend_Db_Select to accept the database.schema.table syntax in the first parameter.