comparison src/main/java/nl/cwi/monetdb/jdbc/MonetDatabaseMetaData.java @ 294:894abb249de1

Corrected 3 MonetDatabaseMetaData methods
author Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
date Wed, 31 Jul 2019 20:07:55 +0200 (2019-07-31)
parents d430f8adbf1b
children 003ae6d881db
comparison
equal deleted inserted replaced
293:60bfe2d0ba2a 294:894abb249de1
492 String match = 492 String match =
493 "('tinyint', 'smallint', 'int', 'bigint', 'hugeint', 'decimal', 'double', 'real') )" + 493 "('tinyint', 'smallint', 'int', 'bigint', 'hugeint', 'decimal', 'double', 'real') )" +
494 " AND \"type\" = 1" + // only scalar functions 494 " AND \"type\" = 1" + // only scalar functions
495 // exclude functions which belong to the 'str' module 495 // exclude functions which belong to the 'str' module
496 " AND \"mod\" <> 'str')" + // to filter out string functions: 'code' and 'space' 496 " AND \"mod\" <> 'str')" + // to filter out string functions: 'code' and 'space'
497 " OR \"name\" IN ('degrees','fuse','ms_round','ms_str','ms_trunc','radians')"; 497 " OR \"name\" IN ('degrees','fuse','pi','ms_round','ms_str','ms_trunc','radians')";
498 return getConcatenatedStringFromQuery(FunctionsSelect + FunctionsWhere + match + OrFunctionsMaxMin + FunctionsOrderBy1); 498 return getConcatenatedStringFromQuery(FunctionsSelect + FunctionsWhere + match + OrFunctionsMaxMin + FunctionsOrderBy1);
499 } 499 }
500 500
501 @Override 501 @Override
502 public String getStringFunctions() { 502 public String getStringFunctions() {
518 "\"id\" NOT IN (SELECT \"func_id\" FROM \"sys\".\"args\" WHERE \"number\" = 1)" + // without any args 518 "\"id\" NOT IN (SELECT \"func_id\" FROM \"sys\".\"args\" WHERE \"number\" = 1)" + // without any args
519 " AND \"id\" IN (SELECT \"function_id\" FROM \"sys\".\"systemfunctions\")" + // only functions marked as system 519 " AND \"id\" IN (SELECT \"function_id\" FROM \"sys\".\"systemfunctions\")" + // only functions marked as system
520 " AND \"type\" = 1" + // only scalar functions 520 " AND \"type\" = 1" + // only scalar functions
521 // exclude functions which belong to the 'mtime' module 521 // exclude functions which belong to the 'mtime' module
522 " AND \"mod\" <> 'mtime'" + 522 " AND \"mod\" <> 'mtime'" +
523 " AND \"name\" NOT IN ('localtime','localtimestamp')" + 523 " AND \"name\" NOT IN ('localtime','localtimestamp','pi','rand')" +
524 // add system functions which are not listed in sys.functions but implemented in the SQL parser (see sql/server/sql_parser.y) 524 // add system functions which are not listed in sys.functions but implemented in the SQL parser (see sql/server/sql_parser.y)
525 " UNION SELECT 'cast'" + 525 " UNION SELECT 'cast'" +
526 " UNION SELECT 'coalesce'" + 526 " UNION SELECT 'coalesce'" +
527 " UNION SELECT 'convert'" + 527 " UNION SELECT 'convert'" +
528 " UNION SELECT 'ifthenelse'" + 528 " UNION SELECT 'ifthenelse'" +
1112 * 1112 *
1113 * @return true if so 1113 * @return true if so
1114 */ 1114 */
1115 @Override 1115 @Override
1116 public boolean supportsSchemasInIndexDefinitions() { 1116 public boolean supportsSchemasInIndexDefinitions() {
1117 return true; 1117 // we currently do NOT support: create index sch.tblidx on sch.tbl(col);
1118 // only: create index tblidx on sch.tbl(col);
1119 return false;
1118 } 1120 }
1119 1121
1120 /** 1122 /**
1121 * Can a schema name be used in a privilege definition statement? 1123 * Can a schema name be used in a privilege definition statement?
1122 * 1124 *