# HG changeset patch
# User Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
# Date 1551981415 -3600
# Node ID ee4c826e39335c4325072556a66959e8c35c4e39
# Parent  43ea6c50483e2c26143d4ac65e13d44f9806111b
Extended method getNumericFunctions() by also returning functions: degrees, fuse, ms_round, ms_str, ms_trunc and radians.
Extended method getStringFunctions() by also returning function: position.
Updated ChangeLog.

diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,12 @@
 # ChangeLog file for monetdb-java
 # This file is updated with Maddlog
 
+* Thu Mar  7 2019 Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
+- Improved MonetDatabaseMetaData methods:
+  - getNumericFunctions(): it now includes functions: degrees, fuse, ms_round, ms_str, ms_trunc and radians.
+  - getStringFunctions(): it now includes function: position.
+  - supportsIntegrityEnhancementFacility() now returns false, as we do not enforce CHECK constraints yet.
+
 * Thu Feb  7 2019 Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
 - Improved MonetDatabaseMetaData methods:
   - getNumericFunctions(): it no longer lists aggregate functions: avg, prod and sum
diff --git a/src/main/java/nl/cwi/monetdb/jdbc/MonetDatabaseMetaData.java b/src/main/java/nl/cwi/monetdb/jdbc/MonetDatabaseMetaData.java
--- a/src/main/java/nl/cwi/monetdb/jdbc/MonetDatabaseMetaData.java
+++ b/src/main/java/nl/cwi/monetdb/jdbc/MonetDatabaseMetaData.java
@@ -493,7 +493,8 @@ public class MonetDatabaseMetaData exten
 			"('tinyint', 'smallint', 'int', 'bigint', 'hugeint', 'decimal', 'double', 'real') )" +
 			" AND \"type\" = 1" +	// only scalar functions
 			// exclude functions which belong to the 'str' module
-			" AND \"mod\" <> 'str')";	// to filter out string functions: 'code' and 'space'
+			" AND \"mod\" <> 'str')" +	// to filter out string functions: 'code' and 'space'
+			" OR \"name\" IN ('degrees','fuse','ms_round','ms_str','ms_trunc','radians')";
 		return getConcatenatedStringFromQuery(FunctionsSelect + FunctionsWhere + match + OrFunctionsMaxMin + FunctionsOrderBy1);
 	}
 
@@ -503,7 +504,10 @@ public class MonetDatabaseMetaData exten
 			"('char', 'varchar', 'clob', 'json') )" +
 			// include functions which belong to the 'str' module
 			" OR \"mod\" = 'str')";
-		return getConcatenatedStringFromQuery(FunctionsSelect + FunctionsWhere + match + OrFunctionsMaxMin + FunctionsOrderBy1);
+		String unionPart =
+			// add system functions which are not listed in sys.functions but implemented in the SQL parser (see sql/server/sql_parser.y)
+			" UNION SELECT 'position'";
+		return getConcatenatedStringFromQuery(FunctionsSelect + FunctionsWhere + match + OrFunctionsMaxMin + unionPart + FunctionsOrderBy1);
 	}
 
 	@Override
@@ -528,7 +532,7 @@ public class MonetDatabaseMetaData exten
 	@Override
 	public String getTimeDateFunctions() {
 		String wherePart =
-			 "\"mod\" = 'mtime' OR \"name\" IN ('epoch','localtime','localtimestamp')";
+			 "\"mod\" IN ('mtime','timestamp') OR \"name\" IN ('localtime','localtimestamp')";
 		String unionPart =
 			// add time date functions which are not listed in sys.functions but implemented in the SQL parser (see sql/server/sql_parser.y)
 			" UNION SELECT 'extract'" +