From cbac1b82c0315e8345f63f9c9bdcfdf1d1c133f0 Mon Sep 17 00:00:00 2001 From: Marco Belladelli Date: Tue, 20 Jun 2023 11:04:01 +0200 Subject: [PATCH] HHH-16773 Fix functional dependency support for TiDB and Cockroach --- .../hibernate/community/dialect/CockroachLegacyDialect.java | 2 +- .../main/java/org/hibernate/dialect/CockroachDialect.java | 2 +- .../src/main/java/org/hibernate/dialect/TiDBDialect.java | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/CockroachLegacyDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/CockroachLegacyDialect.java index c7f8715ba9..2e52440563 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/CockroachLegacyDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/CockroachLegacyDialect.java @@ -1038,7 +1038,7 @@ public class CockroachLegacyDialect extends Dialect { @Override public FunctionalDependencyAnalysisSupport getFunctionalDependencyAnalysisSupport() { - return FunctionalDependencyAnalysisSupportImpl.TABLE_GROUP_AND_CONSTANTS; + return FunctionalDependencyAnalysisSupportImpl.TABLE_REFERENCE; } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/CockroachDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/CockroachDialect.java index bc4d5229bb..86a19bb081 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/CockroachDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/CockroachDialect.java @@ -990,7 +990,7 @@ public class CockroachDialect extends Dialect { @Override public FunctionalDependencyAnalysisSupport getFunctionalDependencyAnalysisSupport() { - return FunctionalDependencyAnalysisSupportImpl.TABLE_GROUP_AND_CONSTANTS; + return FunctionalDependencyAnalysisSupportImpl.TABLE_REFERENCE; } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/TiDBDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/TiDBDialect.java index 87c91ff587..510cab0b0b 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/TiDBDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/TiDBDialect.java @@ -157,4 +157,9 @@ public class TiDBDialect extends MySQLDialect { Duration duration = Duration.ofMillis( timeoutInMilliseconds ); return duration.getSeconds(); } + + @Override + public FunctionalDependencyAnalysisSupport getFunctionalDependencyAnalysisSupport() { + return FunctionalDependencyAnalysisSupportImpl.TABLE_REFERENCE; + } }