Schema validation: incorrect use of schema and catalog filters

Description

When performing the schema validation, if either a schema or a catalog is provided for an entity, the other value filter is assigned the empty string as value.

However, as per [http://docs.oracle.com/javase/7/docs/api/java/sql/DatabaseMetaData.html#getTables(java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String[])], "null" and "empty string" have two different purposes, "null" meaning that the corresponding value should not be used to filter out the result set, while the empty string indicate to use the empty string to filter out the result set.

It used to work on hibernate 3.3.2.

Method to modify: org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.locateTableInNamespace

A workaround is to specify both properties "hibernate.default_catalog" and "hibernate.default_schema".

Environment

Found while migrating to Wildfly 10 CR4 (Hibernate 5.0.1.Final), JDBC driver = jtds 1.2.7

Status

Assignee

Andrea Boriero

Reporter

Dominique Toupin

Fix versions

backPortable

None

Suitable for new contributors

Yes, likely

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

5.0.4
5.0.1

Priority

Major
Configure