Mercurial > hg > monetdb-java
changeset 220:34f9ddd1a4e5
Corrected and extended output of DatabaseMetaData methods getTimeDateFunctions() and getSystemFunctions().
The Date/Time functions (curdate, current_date, current_time, current_timestamp, curtime, local_timezone, localtime, localtimestamp)
were returned by getSystemFunctions() but are now returned by getTimeDateFunctions().
getTimeDateFunctions() now also lists functions: date_to_str, extract, now, str_to_date, str_to_time, str_to_timestamp, time_to_str and timestamp_to_str.
author | Martin van Dinther <martin.van.dinther@monetdbsolutions.com> |
---|---|
date | Thu, 26 Apr 2018 19:13:06 +0200 (2018-04-26) |
parents | 4572f0694fde |
children | d034679a1a00 |
files | ChangeLog src/main/java/nl/cwi/monetdb/jdbc/MonetDatabaseMetaData.java |
diffstat | 2 files changed, 12 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,13 @@ # This file is updated with Maddlog * Thu Apr 26 2018 Martin van Dinther <martin.van.dinther@monetdbsolutions.com> +- Corrected and extended output of DatabaseMetaData methods + getTimeDateFunctions() and getSystemFunctions(). The Date/Time functions + (curdate, current_date, current_time, current_timestamp, curtime, + local_timezone, localtime, localtimestamp) were returned by + getSystemFunctions() but are now returned by getTimeDateFunctions(). + getTimeDateFunctions() now also lists functions: date_to_str, extract, now, + str_to_date, str_to_time, str_to_timestamp, time_to_str and timestamp_to_str. - Improved DatabaseMetaData methods getTablePrivileges() and getColumnPrivileges() by returning also any combination of privileges for the table or column in the PRIVILEGE result column. Previously only
--- a/src/main/java/nl/cwi/monetdb/jdbc/MonetDatabaseMetaData.java +++ b/src/main/java/nl/cwi/monetdb/jdbc/MonetDatabaseMetaData.java @@ -510,6 +510,9 @@ public class MonetDatabaseMetaData exten "WHERE \"id\" NOT IN (SELECT \"func_id\" FROM \"sys\".\"args\" WHERE \"number\" = 1)" + " AND \"id\" IN (SELECT \"function_id\" FROM \"sys\".\"systemfunctions\")" + " AND \"type\" = 1" + // only scalar functions + // exclude functions which belong to the 'mtime' module + " AND \"mod\" <> 'mtime'" + + " AND \"name\" NOT IN ('localtime', 'localtimestamp')" + // add system functions which are not listed in sys.functions but implemented in the SQL parser (see sql/server/sql_parser.y) " UNION SELECT 'cast'" + " UNION SELECT 'convert'" + @@ -523,9 +526,8 @@ public class MonetDatabaseMetaData exten @Override public String getTimeDateFunctions() { - String match = - "('date', 'time', 'timestamp', 'timetz', 'timestamptz', 'sec_interval', 'month_interval') )"; - return getConcatenatedStringFromQuery(FunctionsSelect + FunctionsWhere + match + AddFunctionsMaxMin + FunctionsOrderBy1); + String wherePart = "WHERE \"mod\" = 'mtime' OR \"name\" IN ('localtime', 'localtimestamp') UNION SELECT 'extract' UNION SELECT 'now'"; + return getConcatenatedStringFromQuery(FunctionsSelect + wherePart + AddFunctionsMaxMin + FunctionsOrderBy1); } /**