[BUG?] Use of dbName.tableName format in ActiveRecord and MSSQL

I was trying to use ‘dbName.tableName’ syntax in the tableName() method of an ActiveRecord that gets data from a MSSQL server. It was not working.

Openned CMssqlSchema.php and started debbuging it.

I found out that at line 227:


"FROM INFORMATION_SCHEMA.COLUMNS WHERE ".join(' AND ',$where);

it is missing the database name (or catalog). So I changed it to:


"FROM {$table->catalogName}.INFORMATION_SCHEMA.COLUMNS WHERE ".join(' AND ',$where);

and used the syntax ‘dbName.dbo.tableName’ and now it works great.

My MSSQL server version is 2000, in a windows server 2000.

Yii version 1.1.5 running in linux ubuntu.