tableExists precondition sometimes does not work on Oracle

Description

I have 237 tables in the Oracle database.
Now ALL_TABLES shows all tables but ALL_TAB_COMMENTS contains only 2 entries (for DATABASECHANGELOG and DATABASECHANGELOGLOCK... but all tables were created via Liquibase)

select count(*) from ALL_TABLES; # returns 237 select count(*) from ALL_TAB_COMMENTS; # returns 2 -- for databasechangelog and databasechangeloglock... but

Since liquibase.snapshot.JdbcDatabaseSnapshot.CachingDatabaseMetaData.getTables(String, String, String, String[]) in its queryOracle does inner join of ALL_TABLES and ALL_TAB_COMMENTS, the <tableExists> precondition returns false for all tables.

proposed solution

Replace join with left outer join.

notes

viewExists is affected too, as it uses the same code path.

Environment

Oracle 11g EE

Activity

Show:

Piotr Findeisen September 30, 2014 at 7:39 AM

The ALL_TAB_COMMENTS view was redefined as a workaround to https://liquibase.jira.com/browse/CORE-1858#icft=CORE-1858 that was observed on this particular database instance. I didn't know about it prior to submitting this bug.
Sorry.

Invalid

Details

Reporter

Affects versions

Priority

Created September 29, 2014 at 2:02 PM
Updated September 30, 2014 at 7:39 AM
Resolved September 30, 2014 at 7:39 AM

Flag notifications