# HG changeset patch
# User Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
# Date 1569431767 -7200
# Node ID 98018e38994b94d12d5ad250d7687302b83f6ae8
# Parent  55735963f60575e01c6d81e71f844f986f9a9556
Correct getNumericFunctions() which incorrectly returned functions 'code' and 'space' as numeric functions.

diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -34,7 +34,7 @@
 
 * Wed Aug 14 2019 Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
 - Improved MonetDatabaseMetaData methods:
-  - getNumericFunctions(): it now includes functions: code, space and sys.alpha
+  - getNumericFunctions(): it now includes function: sys.alpha
   - getNumericFunctions(): it no longer lists functions: not_uniques and rotate_xor_hash
   - getStringFunctions(): it now includes functions: json.isarray, json.isobject,
       json.isvalid, sys.reverse which accept a string value as argument
diff --git a/ChangeLog-Archive b/ChangeLog-Archive
--- a/ChangeLog-Archive
+++ b/ChangeLog-Archive
@@ -35,7 +35,7 @@
 
 * Wed Aug 14 2019 Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
 - Improved MonetDatabaseMetaData methods:
-  - getNumericFunctions(): it now includes functions: code, space and sys.alpha
+  - getNumericFunctions(): it now includes function: sys.alpha
   - getNumericFunctions(): it no longer lists functions: not_uniques and rotate_xor_hash
   - getStringFunctions(): it now includes functions: json.isarray, json.isobject,
       json.isvalid, sys.reverse which accept a string value as argument
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
@@ -405,9 +405,9 @@ public class MonetDatabaseMetaData
 	public String getNumericFunctions() {
 		final String match =
 			"('tinyint','smallint','int','bigint','hugeint','decimal','double','real'))" +
-			" AND \"type\" = 1" +	// only scalar functions, note that code(int) and space(int) will also be listed as string functions
-			// exclude functions which do not work
-			" AND f.\"name\" NOT IN ('not_uniques','rotate_xor_hash'))" +
+			" AND \"type\" = 1" +	// only scalar functions
+			// exclude functions which do not work or belong to string functions (code(int) and space(int))
+			" AND f.\"name\" NOT IN ('code','not_uniques','rotate_xor_hash','space'))" +
 			// include specific functions which have no 1st arg (pi()) or it is not numeric
 			" OR f.\"name\" IN ('alpha','degrees','fuse','ms_round','ms_str','ms_trunc','pi','radians')";
 		return getConcatenatedStringFromQuery(FunctionsSelect + FunctionsWhere + match + OrFunctionsMaxMin + FunctionsOrderBy1);