Changeset: ee4c826e3933 for monetdb-java
URL: https://dev.monetdb.org/hg/monetdb-java?cmd=changeset;node=ee4c826e3933
Modified Files:
        ChangeLog
        src/main/java/nl/cwi/monetdb/jdbc/MonetDatabaseMetaData.java
Branch: default
Log Message:

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.


diffs (50 lines):

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 <[email protected]>
+- 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 <[email protected]>
 - 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'" +
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to