diff src/main/java/nl/cwi/monetdb/jdbc/MonetDatabaseMetaData.java @ 268:ee4c826e3933

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.
author Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
date Thu, 07 Mar 2019 18:56:55 +0100 (2019-03-07)
parents 43ea6c50483e
children 7d041f5c3fea
line wrap: on
line diff
--- 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'" +