tableExists precondition sometimes does not work on Oracle
Description
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.
I have 237 tables in the Oracle database.
Now
ALL_TABLES
shows all tables butALL_TAB_COMMENTS
contains only 2 entries (forDATABASECHANGELOG
andDATABASECHANGELOGLOCK
... 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 itsqueryOracle
does inner join ofALL_TABLES
andALL_TAB_COMMENTS
, the<tableExists>
precondition returns false for all tables.proposed solution
Replace
join
withleft outer join
.notes
viewExists
is affected too, as it uses the same code path.