ZF-11891: Microsoft SQL Server setupMetaData
Description
When using the createRow and getMetaData methods on a Zend_Db_Table_Abstract model, the schema of the table is not taken into account. From what I can see the Adapter uses the following command to get the meta data:
$sql = "exec sp_columns @table_name = " . $this->quoteIdentifier($tableName, true); $stmt = $this->query($sql); $result = $stmt->fetchAll(Zend_Db::FETCH_NUM);
From the method definition:
public function describeTable($tableName, $schemaName = null)
The schema is passed to the method but never used. In Microsoft SQL Server, the sp_columns command has the following syntax:
sp_columns [ @table_name = ] object [ , [ @table_owner = ] owner ] [ , [ @table_qualifier = ] qualifier ] [ , [ @column_name = ] column ] [ , [ @ODBCVer = ] ODBCVer ]
The @table_owner parameter seems to limit the meta data returned to the correct schema if this is passed into it.
Comments
No comments to display