SQL Server: "Database 'dbo' does not exist" error

Description

In SQL Server 2005-2008 ((JdbcConnection) database.getConnection()).getMetaData().getSchemas() returns parent schema name as TABLE_CATALOG. When ((JdbcDatabaseSnapshot) snapshot).getMetaData().getTables(TABLE_CATALOG, TABLE_SCHEMA ...) is invoked, TABLE_CATALOG is interpreted as database name(and schema name is passed to this parameter) and exception (see exception.log) is thrown. My company does not use database that requires multiple catalogs, therefore I've fixed this issue by removing catalog from SchemaSnapshotGenerator (see attached patch), this issue needs to be addressed to MSSQLDatabase to have consistent database\schema name variables.

Environment

SQL Server 2008, SQL Server 2005

Reporter

Anton Zukovskij

Components

Fix versions

Affects versions

Priority

Major
Configure