changeset 913:a8ca336e7f1a

supportsIntegrityEnhancementFacility() should return true when connected to Aug2024 (11.51) or higher servers.
author Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
date Thu, 18 Jul 2024 19:45:23 +0200 (8 months ago)
parents e85dcb3ea4a6
children e0120c7052bb
files src/main/java/org/monetdb/jdbc/MonetDatabaseMetaData.java
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/org/monetdb/jdbc/MonetDatabaseMetaData.java
+++ b/src/main/java/org/monetdb/jdbc/MonetDatabaseMetaData.java
@@ -938,13 +938,16 @@ public final class MonetDatabaseMetaData
 	 * inter-column constraints to be maintained by the database system.
 	 * Default clauses provide optional default values for missing data.
 	 *
-	 * We currently do not supprt CHECK constraints (see bug 3568) nor deferrable FK constraints.
-	 *
 	 * @return true if so
 	 */
 	@Override
 	public boolean supportsIntegrityEnhancementFacility() {
-		return false;
+		// Starting with release Aug2024 (11.51.1) MonetDB now also supports CHECK constraints (ref issue 3335, 3568).
+		try {
+			if ((con.getDatabaseMajorVersion() == 11) && (con.getDatabaseMinorVersion() >= 51))
+				return true;
+		} catch (SQLException e) { /* ignore */	}
+		return false;	// for older servers
 	}
 
 	/**