
|
If you were logged in you would be able to see more operations.
|
|
|
|
Issue Links:
|
Reference
|
|
This issue relates to:
|
|
|
DERBY-591 Several builtin functions are incorrectly exposed through the JDBC escaped function syntax {fn <function_call>}
|
|
|
|
|
DERBY-1548
Document builtin functions - ACOS, ASIN, ATAN, COS, SIN, TAN, PI, DEGREES, RADIANS, EXP, LN, LOG, LOG10, CEIL, CEILING, FLOOR
|
|
|
|
|
|
dependent
|
|
|
|
This issue is depended upon by:
|
|
DERBY-3063
Extend the system function mechanism to support functions with multiple arguments
|
|
|
|
|
|
|
| Resolution Date: |
03/Feb/06 04:55 AM
|
|
Add a mechanism for system functions to be easily added. Resolution of functions will check SYSFUN.<name> for a function call in SQL when the function is not qualified by a schema. If the current schema does not have a function matching the name, then an additional resolution is made using SYSFUN.<name>.
Add a table driven mechanism for simple single argument functions (could be expanded in the future).
Add these functions
/*
** SYSFUN functions
*[0] = FUNCTION name
*[1] = RETURNS type
*[2] = Java class
*[3] = method name
*[4] = parameter type (single parameter)
*
*/
private static final String[][] SYSFUN_FUNCTIONS = {
{"ACOS", "DOUBLE", "java.lang.Math", "acos", "DOUBLE"},
{"ASIN", "DOUBLE", "java.lang.Math", "asin", "DOUBLE"},
{"ATAN", "DOUBLE", "java.lang.Math", "atan", "DOUBLE"},
{"COS", "DOUBLE", "java.lang.Math", "cos", "DOUBLE"},
{"SIN", "DOUBLE", "java.lang.Math", "sin", "DOUBLE"},
{"TAN", "DOUBLE", "java.lang.Math", "tan", "DOUBLE"},
{"DEGREES", "DOUBLE", "java.lang.Math", "toDegrees", "DOUBLE"},
{"RADIANS", "DOUBLE", "java.lang.Math", "toRadians", "DOUBLE"},
{"LN", "DOUBLE", "java.lang.Math", "log", "DOUBLE"},
{"EXP", "DOUBLE", "java.lang.Math", "exp", "DOUBLE"},
{"CEIL", "DOUBLE", "java.lang.Math", "ceil", "DOUBLE"},
{"CEILING", "DOUBLE", "java.lang.Math", "ceil", "DOUBLE"},
{"FLOOR", "DOUBLE", "java.lang.Math", "floor", "DOUBLE"},
};
|
|
Description
|
Add a mechanism for system functions to be easily added. Resolution of functions will check SYSFUN.<name> for a function call in SQL when the function is not qualified by a schema. If the current schema does not have a function matching the name, then an additional resolution is made using SYSFUN.<name>.
Add a table driven mechanism for simple single argument functions (could be expanded in the future).
Add these functions
/*
** SYSFUN functions
*[0] = FUNCTION name
*[1] = RETURNS type
*[2] = Java class
*[3] = method name
*[4] = parameter type (single parameter)
*
*/
private static final String[][] SYSFUN_FUNCTIONS = {
{"ACOS", "DOUBLE", "java.lang.Math", "acos", "DOUBLE"},
{"ASIN", "DOUBLE", "java.lang.Math", "asin", "DOUBLE"},
{"ATAN", "DOUBLE", "java.lang.Math", "atan", "DOUBLE"},
{"COS", "DOUBLE", "java.lang.Math", "cos", "DOUBLE"},
{"SIN", "DOUBLE", "java.lang.Math", "sin", "DOUBLE"},
{"TAN", "DOUBLE", "java.lang.Math", "tan", "DOUBLE"},
{"DEGREES", "DOUBLE", "java.lang.Math", "toDegrees", "DOUBLE"},
{"RADIANS", "DOUBLE", "java.lang.Math", "toRadians", "DOUBLE"},
{"LN", "DOUBLE", "java.lang.Math", "log", "DOUBLE"},
{"EXP", "DOUBLE", "java.lang.Math", "exp", "DOUBLE"},
{"CEIL", "DOUBLE", "java.lang.Math", "ceil", "DOUBLE"},
{"CEILING", "DOUBLE", "java.lang.Math", "ceil", "DOUBLE"},
{"FLOOR", "DOUBLE", "java.lang.Math", "floor", "DOUBLE"},
}; |
Show » |
|
Table added to DataDictionaryImpl with the set of functions above and tests in functions.sql.
Other single argument functions can be easily added through this mechanism.