From 6e11f9593a476597ec0372a5d1f2a7552d6c5acf Mon Sep 17 00:00:00 2001 From: wziebicki Date: Tue, 5 Oct 2021 08:02:27 +0200 Subject: [PATCH] Add table name to OracleDB query The query that is generated when retrieving all keys does not get a table name, while the code that creates the map for the cache gets this name from the query result, which is always null. When reading the cache, the table name is used which results in the cache always returning an empty result. --- .../snapshot/jvm/UniqueConstraintSnapshotGenerator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/liquibase-core/src/main/java/liquibase/snapshot/jvm/UniqueConstraintSnapshotGenerator.java b/liquibase-core/src/main/java/liquibase/snapshot/jvm/UniqueConstraintSnapshotGenerator.java index aee18bacd3b..667bc69781b 100644 --- a/liquibase-core/src/main/java/liquibase/snapshot/jvm/UniqueConstraintSnapshotGenerator.java +++ b/liquibase-core/src/main/java/liquibase/snapshot/jvm/UniqueConstraintSnapshotGenerator.java @@ -226,7 +226,7 @@ protected List listConstraints(Table table, DatabaseSnapshot snapshot "[ic].[key_ordinal]"; } else if (database instanceof OracleDatabase) { - sql = "select ucc.owner as constraint_container, ucc.constraint_name as constraint_name, ucc.column_name, f.validated as constraint_validate " + + sql = "select ucc.owner as constraint_container, ucc.constraint_name as constraint_name, ucc.column_name, f.validated as constraint_validate, ucc.table_name " + "from all_cons_columns ucc " + "INNER JOIN all_constraints f " + "ON ucc.owner = f.owner " +