Skip to content

Commit

Permalink
Do not consider non-deterministic expressions as invariants in pre-fi…
Browse files Browse the repository at this point in the history
…lters (#7853)

* Do not consider non-deterministic expressions as invariants in pre-filters

* Follow Adriano's suggestion

* Allow deterministic uncorrelated subqueries to be considered as invariants
  • Loading branch information
dyemanov committed Nov 16, 2024
1 parent 49804f3 commit 0d72b80
Show file tree
Hide file tree
Showing 7 changed files with 154 additions and 88 deletions.
24 changes: 24 additions & 0 deletions src/dsql/ExprNodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,20 @@ bool ExprNode::sameAs(const ExprNode* other, bool ignoreStreams) const
return true;
}

bool ExprNode::deterministic() const
{
NodeRefsHolder holder;
getChildren(holder, false);

for (auto i : holder.refs)
{
if (*i && !(*i)->deterministic())
return false;
}

return true;
}

bool ExprNode::possiblyUnknown() const
{
NodeRefsHolder holder;
Expand Down Expand Up @@ -12390,6 +12404,11 @@ void SysFuncCallNode::make(DsqlCompilerScratch* dsqlScratch, dsc* desc)
function->makeFunc(&dataTypeUtil, function, desc, argsArray.getCount(), argsArray.begin());
}

bool SysFuncCallNode::deterministic() const
{
return ExprNode::deterministic() && function->deterministic;
}

void SysFuncCallNode::getDesc(thread_db* tdbb, CompilerScratch* csb, dsc* desc)
{
Array<const dsc*> argsArray;
Expand Down Expand Up @@ -13306,6 +13325,11 @@ void UdfCallNode::make(DsqlCompilerScratch* /*dsqlScratch*/, dsc* desc)
desc->setTextType(dsqlFunction->udf_character_set_id);
}

bool UdfCallNode::deterministic() const
{
return ExprNode::deterministic() && function->fun_deterministic;
}

void UdfCallNode::getDesc(thread_db* /*tdbb*/, CompilerScratch* /*csb*/, dsc* desc)
{
// Null value for the function indicates that the function was not
Expand Down
29 changes: 29 additions & 0 deletions src/dsql/ExprNodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,11 @@ class FieldNode final : public TypedNode<ValueExprNode, ExprNode::TYPE_FIELD>
dsqlDesc = desc;
}

virtual bool deterministic() const override
{
return true;
}

virtual bool possiblyUnknown() const
{
return false;
Expand Down Expand Up @@ -875,6 +880,11 @@ class GenIdNode final : public TypedNode<ValueExprNode, ExprNode::TYPE_GEN_ID>
virtual void genBlr(DsqlCompilerScratch* dsqlScratch);
virtual void make(DsqlCompilerScratch* dsqlScratch, dsc* desc);

virtual bool deterministic() const override
{
return false;
}

virtual void getDesc(thread_db* tdbb, CompilerScratch* csb, dsc* desc);
virtual ValueExprNode* copy(thread_db* tdbb, NodeCopier& copier) const;
virtual bool dsqlMatch(DsqlCompilerScratch* dsqlScratch, const ExprNode* other, bool ignoreMapCast) const;
Expand Down Expand Up @@ -1634,6 +1644,11 @@ class ParameterNode final : public TypedNode<ValueExprNode, ExprNode::TYPE_PARAM

Request* getParamRequest(Request* request) const;

virtual bool deterministic() const override
{
return true;
}

virtual void getDesc(thread_db* tdbb, CompilerScratch* csb, dsc* desc);
virtual ParameterNode* copy(thread_db* tdbb, NodeCopier& copier) const;
virtual ParameterNode* pass1(thread_db* tdbb, CompilerScratch* csb);
Expand Down Expand Up @@ -1681,6 +1696,11 @@ class RecordKeyNode final : public TypedNode<ValueExprNode, ExprNode::TYPE_RECOR
virtual void genBlr(DsqlCompilerScratch* dsqlScratch);
virtual void make(DsqlCompilerScratch* dsqlScratch, dsc* desc);

virtual bool deterministic() const override
{
return true;
}

virtual bool possiblyUnknown() const
{
return false;
Expand Down Expand Up @@ -2083,6 +2103,8 @@ class SysFuncCallNode final : public TypedNode<ValueExprNode, ExprNode::TYPE_SYS
virtual void genBlr(DsqlCompilerScratch* dsqlScratch);
virtual void make(DsqlCompilerScratch* dsqlScratch, dsc* desc);

virtual bool deterministic() const override;

virtual void getDesc(thread_db* tdbb, CompilerScratch* csb, dsc* desc);
virtual ValueExprNode* copy(thread_db* tdbb, NodeCopier& copier) const;
virtual bool dsqlMatch(DsqlCompilerScratch* dsqlScratch, const ExprNode* other, bool ignoreMapCast) const;
Expand Down Expand Up @@ -2165,6 +2187,8 @@ class UdfCallNode final : public TypedNode<ValueExprNode, ExprNode::TYPE_UDF_CAL
virtual void genBlr(DsqlCompilerScratch* dsqlScratch);
virtual void make(DsqlCompilerScratch* dsqlScratch, dsc* desc);

virtual bool deterministic() const override;

virtual bool possiblyUnknown() const
{
return true;
Expand Down Expand Up @@ -2265,6 +2289,11 @@ class VariableNode final : public TypedNode<ValueExprNode, ExprNode::TYPE_VARIAB

Request* getVarRequest(Request* request) const;

virtual bool deterministic() const override
{
return false;
}

virtual void getDesc(thread_db* tdbb, CompilerScratch* csb, dsc* desc);
virtual ValueExprNode* copy(thread_db* tdbb, NodeCopier& copier) const;
virtual ValueExprNode* pass1(thread_db* tdbb, CompilerScratch* csb);
Expand Down
3 changes: 3 additions & 0 deletions src/dsql/Nodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,9 @@ class ExprNode : public DmlNode
target = node ? node->dsqlFieldRemapper(visitor) : NULL;
}

// Check if expression returns deterministic result
virtual bool deterministic() const;

// Check if expression could return NULL or expression can turn NULL into a true/false.
virtual bool possiblyUnknown() const;

Expand Down
5 changes: 5 additions & 0 deletions src/jrd/RecordSourceNodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,11 @@ class ProcedureSourceNode final : public TypedNode<RecordSourceNode, RecordSourc
{
}

virtual bool deterministic() const
{
return false;
}

virtual bool computable(CompilerScratch* csb, StreamType stream,
bool allowOnlyCurrentStream, ValueExprNode* value);
virtual void findDependentFromStreams(const CompilerScratch* csb,
Expand Down
170 changes: 86 additions & 84 deletions src/jrd/SysFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6883,90 +6883,92 @@ dsc* evlUnicodeVal(thread_db* tdbb, const SysFunction*, const NestValueArray& ar

const SysFunction SysFunction::functions[] =
{
{"ABS", 1, 1, setParamsDblDec, makeAbs, evlAbs, NULL},
{"ACOS", 1, 1, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfAcos},
{"ACOSH", 1, 1, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfAcosh},
{"ASCII_CHAR", 1, 1, setParamsInteger, makeAsciiChar, evlAsciiChar, NULL},
{"ASCII_VAL", 1, 1, setParamsAsciiVal, makeShortResult, evlAsciiVal, NULL},
{"ASIN", 1, 1, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfAsin},
{"ASINH", 1, 1, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfAsinh},
{"ATAN", 1, 1, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfAtan},
{"ATANH", 1, 1, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfAtanh},
{"ATAN2", 2, 2, setParamsDouble, makeDoubleResult, evlAtan2, NULL},
{"BASE64_DECODE", 1, 1, NULL, makeDecode64, evlDecode64, NULL},
{"BASE64_ENCODE", 1, 1, NULL, makeEncode64, evlEncode64, NULL},
{"BIN_AND", 2, -1, setParamsBin, makeBin, evlBin, (void*) funBinAnd},
{"BIN_NOT", 1, 1, setParamsBin, makeBin, evlBin, (void*) funBinNot},
{"BIN_OR", 2, -1, setParamsBin, makeBin, evlBin, (void*) funBinOr},
{"BIN_SHL", 2, 2, setParamsInteger, makeBinShift, evlBinShift, (void*) funBinShl},
{"BIN_SHR", 2, 2, setParamsInteger, makeBinShift, evlBinShift, (void*) funBinShr},
{"BIN_SHL_ROT", 2, 2, setParamsInteger, makeBinShift, evlBinShift, (void*) funBinShlRot},
{"BIN_SHR_ROT", 2, 2, setParamsInteger, makeBinShift, evlBinShift, (void*) funBinShrRot},
{"BIN_XOR", 2, -1, setParamsBin, makeBin, evlBin, (void*) funBinXor},
{"BLOB_APPEND", 2, -1, setParamsBlobAppend, makeBlobAppend, evlBlobAppend, NULL},
{"CEIL", 1, 1, setParamsDblDec, makeCeilFloor, evlCeil, NULL},
{"CEILING", 1, 1, setParamsDblDec, makeCeilFloor, evlCeil, NULL},
{"CHAR_TO_UUID", 1, 1, setParamsCharToUuid, makeUuid, evlCharToUuid, NULL},
{"COMPARE_DECFLOAT", 2, 2, setParamsDecFloat, makeShortResult, evlCompare, (void*) funCmpDec},
{"COS", 1, 1, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfCos},
{"COSH", 1, 1, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfCosh},
{"COT", 1, 1, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfCot},
{"CRYPT_HASH", 2, 2, setParamsHash, makeHash, evlHash, NULL},
{"DATEADD", 3, 3, setParamsDateAdd, makeDateAdd, evlDateAdd, NULL},
{"DATEDIFF", 3, 3, setParamsDateDiff, makeDateDiff, evlDateDiff, NULL},
{"DECRYPT", CRYPT_ARG_MAX, CRYPT_ARG_MAX, setParamsEncrypt, makeCrypt, evlDecrypt, NULL},
{"ENCRYPT", CRYPT_ARG_MAX, CRYPT_ARG_MAX, setParamsEncrypt, makeCrypt, evlEncrypt, NULL},
{"EXP", 1, 1, setParamsDblDec, makeDblDecResult, evlExp, NULL},
{"FIRST_DAY", 2, 2, setParamsFirstLastDay, makeFirstLastDayResult, evlFirstLastDay, (void*) funFirstDay},
{"FLOOR", 1, 1, setParamsDblDec, makeCeilFloor, evlFloor, NULL},
{"GEN_UUID", 0, 1, NULL, makeUuid, evlGenUuid, NULL},
{"HASH", 1, 2, setParamsHash, makeHash, evlHash, NULL},
{"HEX_DECODE", 1, 1, NULL, makeDecodeHex, evlDecodeHex, NULL},
{"HEX_ENCODE", 1, 1, NULL, makeEncodeHex, evlEncodeHex, NULL},
{"LAST_DAY", 2, 2, setParamsFirstLastDay, makeFirstLastDayResult, evlFirstLastDay, (void*) funLastDay},
{"LEFT", 2, 2, setParamsSecondInteger, makeLeftRight, evlLeft, NULL},
{"LN", 1, 1, setParamsDblDec, makeDblDecResult, evlLnLog10, (void*) funLnat},
{"LOG", 2, 2, setParamsDblDec, makeDblDecResult, evlLog, NULL},
{"LOG10", 1, 1, setParamsDblDec, makeDblDecResult, evlLnLog10, (void*) funLog10},
{"LPAD", 2, 3, setParamsSecondInteger, makePad, evlPad, (void*) funLPad},
{"MAKE_DBKEY", 2, 4, setParamsMakeDbkey, makeDbkeyResult, evlMakeDbkey, NULL},
{"MAXVALUE", 1, -1, setParamsFromList, makeFromListResult, evlMaxMinValue, (void*) funMaxValue},
{"MINVALUE", 1, -1, setParamsFromList, makeFromListResult, evlMaxMinValue, (void*) funMinValue},
{"MOD", 2, 2, setParamsFromList, makeMod, evlMod, NULL},
{"NORMALIZE_DECFLOAT", 1, 1, setParamsDecFloat, makeDecFloatResult, evlNormDec, NULL},
{"OVERLAY", 3, 4, setParamsOverlay, makeOverlay, evlOverlay, NULL},
{"PI", 0, 0, NULL, makePi, evlPi, NULL},
{"POSITION", 2, 3, setParamsPosition, makeLongResult, evlPosition, NULL},
{"POWER", 2, 2, setParamsDblDec, makeDblDecResult, evlPower, NULL},
{"QUANTIZE", 2, 2, setParamsDecFloat, makeDecFloatResult, evlQuantize, NULL},
{"RAND", 0, 0, NULL, makeDoubleResult, evlRand, NULL},
{RDB_GET_CONTEXT, 2, 2, setParamsGetSetContext, makeGetSetContext, evlGetContext, NULL},
{"RDB$GET_TRANSACTION_CN", 1, 1, setParamsInt64, makeGetTranCN, evlGetTranCN, NULL},
{"RDB$ROLE_IN_USE", 1, 1, setParamsAsciiVal, makeBooleanResult, evlRoleInUse, NULL},
{RDB_SET_CONTEXT, 3, 3, setParamsGetSetContext, makeGetSetContext, evlSetContext, NULL},
{"RDB$SYSTEM_PRIVILEGE", 1, 1, NULL, makeBooleanResult, evlSystemPrivilege, NULL},
{"REPLACE", 3, 3, setParamsFromList, makeReplace, evlReplace, NULL},
{"REVERSE", 1, 1, NULL, makeReverse, evlReverse, NULL},
{"RIGHT", 2, 2, setParamsSecondInteger, makeLeftRight, evlRight, NULL},
{"ROUND", 1, 2, setParamsRoundTrunc, makeRound, evlRound, NULL},
{"RPAD", 2, 3, setParamsSecondInteger, makePad, evlPad, (void*) funRPad},
{"RSA_DECRYPT", RSA_CRYPT_ARG_MAX, RSA_CRYPT_ARG_MAX, setParamsRsaEncrypt, makeRsaCrypt, evlRsaDecrypt, NULL},
{"RSA_ENCRYPT", RSA_CRYPT_ARG_MAX, RSA_CRYPT_ARG_MAX, setParamsRsaEncrypt, makeRsaCrypt, evlRsaEncrypt, NULL},
{"RSA_PRIVATE", 1, 1, setParamsInteger, makeRsaPrivate, evlRsaPrivate, NULL},
{"RSA_PUBLIC", 1, 1, setParamsRsaPublic, makeRsaPublic, evlRsaPublic, NULL},
{"RSA_SIGN_HASH", RSA_SIGN_ARG_MAX, RSA_SIGN_ARG_MAX, setParamsRsaSign, makeRsaSign, evlRsaSign, NULL},
{"RSA_VERIFY_HASH", RSA_VERIFY_ARG_MAX, RSA_VERIFY_ARG_MAX, setParamsRsaVerify, makeBoolResult, evlRsaVerify, NULL},
{"SIGN", 1, 1, setParamsDblDec, makeShortResult, evlSign, NULL},
{"SIN", 1, 1, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfSin},
{"SINH", 1, 1, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfSinh},
{"SQRT", 1, 1, setParamsDblDec, makeDblDecResult, evlSqrt, NULL},
{"TAN", 1, 1, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfTan},
{"TANH", 1, 1, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfTanh},
{"TOTALORDER", 2, 2, setParamsDecFloat, makeShortResult, evlCompare, (void*) funTotalOrd},
{"TRUNC", 1, 2, setParamsRoundTrunc, makeTrunc, evlTrunc, NULL},
{"UNICODE_CHAR", 1, 1, setParamsInteger, makeUnicodeChar, evlUnicodeChar, NULL},
{"UNICODE_VAL", 1, 1, setParamsUnicodeVal, makeLongResult, evlUnicodeVal, NULL},
{"UUID_TO_CHAR", 1, 1, setParamsUuidToChar, makeUuidToChar, evlUuidToChar, NULL},
// name, minArgCount, maxArgCount, deterministic, setParamsFunc, makeFunc, evlFunc, misc

{"ABS", 1, 1, true, setParamsDblDec, makeAbs, evlAbs, NULL},
{"ACOS", 1, 1, true, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfAcos},
{"ACOSH", 1, 1, true, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfAcosh},
{"ASCII_CHAR", 1, 1, true, setParamsInteger, makeAsciiChar, evlAsciiChar, NULL},
{"ASCII_VAL", 1, 1, true, setParamsAsciiVal, makeShortResult, evlAsciiVal, NULL},
{"ASIN", 1, 1, true, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfAsin},
{"ASINH", 1, 1, true, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfAsinh},
{"ATAN", 1, 1, true, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfAtan},
{"ATANH", 1, 1, true, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfAtanh},
{"ATAN2", 2, 2, true, setParamsDouble, makeDoubleResult, evlAtan2, NULL},
{"BASE64_DECODE", 1, 1, true, NULL, makeDecode64, evlDecode64, NULL},
{"BASE64_ENCODE", 1, 1, true, NULL, makeEncode64, evlEncode64, NULL},
{"BIN_AND", 2, -1, true, setParamsBin, makeBin, evlBin, (void*) funBinAnd},
{"BIN_NOT", 1, 1, true, setParamsBin, makeBin, evlBin, (void*) funBinNot},
{"BIN_OR", 2, -1, true, setParamsBin, makeBin, evlBin, (void*) funBinOr},
{"BIN_SHL", 2, 2, true, setParamsInteger, makeBinShift, evlBinShift, (void*) funBinShl},
{"BIN_SHR", 2, 2, true, setParamsInteger, makeBinShift, evlBinShift, (void*) funBinShr},
{"BIN_SHL_ROT", 2, 2, true, setParamsInteger, makeBinShift, evlBinShift, (void*) funBinShlRot},
{"BIN_SHR_ROT", 2, 2, true, setParamsInteger, makeBinShift, evlBinShift, (void*) funBinShrRot},
{"BIN_XOR", 2, -1, true, setParamsBin, makeBin, evlBin, (void*) funBinXor},
{"BLOB_APPEND", 2, -1, true, setParamsBlobAppend, makeBlobAppend, evlBlobAppend, NULL},
{"CEIL", 1, 1, true, setParamsDblDec, makeCeilFloor, evlCeil, NULL},
{"CEILING", 1, 1, true, setParamsDblDec, makeCeilFloor, evlCeil, NULL},
{"CHAR_TO_UUID", 1, 1, true, setParamsCharToUuid, makeUuid, evlCharToUuid, NULL},
{"COMPARE_DECFLOAT", 2, 2, true, setParamsDecFloat, makeShortResult, evlCompare, (void*) funCmpDec},
{"COS", 1, 1, true, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfCos},
{"COSH", 1, 1, true, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfCosh},
{"COT", 1, 1, true, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfCot},
{"CRYPT_HASH", 2, 2, true, setParamsHash, makeHash, evlHash, NULL},
{"DATEADD", 3, 3, true, setParamsDateAdd, makeDateAdd, evlDateAdd, NULL},
{"DATEDIFF", 3, 3, true, setParamsDateDiff, makeDateDiff, evlDateDiff, NULL},
{"DECRYPT", CRYPT_ARG_MAX, CRYPT_ARG_MAX, true, setParamsEncrypt, makeCrypt, evlDecrypt, NULL},
{"ENCRYPT", CRYPT_ARG_MAX, CRYPT_ARG_MAX, true, setParamsEncrypt, makeCrypt, evlEncrypt, NULL},
{"EXP", 1, 1, true, setParamsDblDec, makeDblDecResult, evlExp, NULL},
{"FIRST_DAY", 2, 2, true, setParamsFirstLastDay, makeFirstLastDayResult, evlFirstLastDay, (void*) funFirstDay},
{"FLOOR", 1, 1, true, setParamsDblDec, makeCeilFloor, evlFloor, NULL},
{"GEN_UUID", 0, 1, false, NULL, makeUuid, evlGenUuid, NULL},
{"HASH", 1, 2, true, setParamsHash, makeHash, evlHash, NULL},
{"HEX_DECODE", 1, 1, true, NULL, makeDecodeHex, evlDecodeHex, NULL},
{"HEX_ENCODE", 1, 1, true, NULL, makeEncodeHex, evlEncodeHex, NULL},
{"LAST_DAY", 2, 2, true, setParamsFirstLastDay, makeFirstLastDayResult, evlFirstLastDay, (void*) funLastDay},
{"LEFT", 2, 2, true, setParamsSecondInteger, makeLeftRight, evlLeft, NULL},
{"LN", 1, 1, true, setParamsDblDec, makeDblDecResult, evlLnLog10, (void*) funLnat},
{"LOG", 2, 2, true, setParamsDblDec, makeDblDecResult, evlLog, NULL},
{"LOG10", 1, 1, true, setParamsDblDec, makeDblDecResult, evlLnLog10, (void*) funLog10},
{"LPAD", 2, 3, true, setParamsSecondInteger, makePad, evlPad, (void*) funLPad},
{"MAKE_DBKEY", 2, 4, true, setParamsMakeDbkey, makeDbkeyResult, evlMakeDbkey, NULL},
{"MAXVALUE", 1, -1, true, setParamsFromList, makeFromListResult, evlMaxMinValue, (void*) funMaxValue},
{"MINVALUE", 1, -1, true, setParamsFromList, makeFromListResult, evlMaxMinValue, (void*) funMinValue},
{"MOD", 2, 2, true, setParamsFromList, makeMod, evlMod, NULL},
{"NORMALIZE_DECFLOAT", 1, 1, true, setParamsDecFloat, makeDecFloatResult, evlNormDec, NULL},
{"OVERLAY", 3, 4, true, setParamsOverlay, makeOverlay, evlOverlay, NULL},
{"PI", 0, 0, true, NULL, makePi, evlPi, NULL},
{"POSITION", 2, 3, true, setParamsPosition, makeLongResult, evlPosition, NULL},
{"POWER", 2, 2, true, setParamsDblDec, makeDblDecResult, evlPower, NULL},
{"QUANTIZE", 2, 2, true, setParamsDecFloat, makeDecFloatResult, evlQuantize, NULL},
{"RAND", 0, 0, false, NULL, makeDoubleResult, evlRand, NULL},
{RDB_GET_CONTEXT, 2, 2, true, setParamsGetSetContext, makeGetSetContext, evlGetContext, NULL},
{"RDB$GET_TRANSACTION_CN", 1, 1, false, setParamsInt64, makeGetTranCN, evlGetTranCN, NULL},
{"RDB$ROLE_IN_USE", 1, 1, true, setParamsAsciiVal, makeBooleanResult, evlRoleInUse, NULL},
{RDB_SET_CONTEXT, 3, 3, false, setParamsGetSetContext, makeGetSetContext, evlSetContext, NULL},
{"RDB$SYSTEM_PRIVILEGE", 1, 1, true, NULL, makeBooleanResult, evlSystemPrivilege, NULL},
{"REPLACE", 3, 3, true, setParamsFromList, makeReplace, evlReplace, NULL},
{"REVERSE", 1, 1, true, NULL, makeReverse, evlReverse, NULL},
{"RIGHT", 2, 2, true, setParamsSecondInteger, makeLeftRight, evlRight, NULL},
{"ROUND", 1, 2, true, setParamsRoundTrunc, makeRound, evlRound, NULL},
{"RPAD", 2, 3, true, setParamsSecondInteger, makePad, evlPad, (void*) funRPad},
{"RSA_DECRYPT", RSA_CRYPT_ARG_MAX, RSA_CRYPT_ARG_MAX, true, setParamsRsaEncrypt, makeRsaCrypt, evlRsaDecrypt, NULL},
{"RSA_ENCRYPT", RSA_CRYPT_ARG_MAX, RSA_CRYPT_ARG_MAX, true, setParamsRsaEncrypt, makeRsaCrypt, evlRsaEncrypt, NULL},
{"RSA_PRIVATE", 1, 1, false, setParamsInteger, makeRsaPrivate, evlRsaPrivate, NULL},
{"RSA_PUBLIC", 1, 1, false, setParamsRsaPublic, makeRsaPublic, evlRsaPublic, NULL},
{"RSA_SIGN_HASH", RSA_SIGN_ARG_MAX, RSA_SIGN_ARG_MAX, true, setParamsRsaSign, makeRsaSign, evlRsaSign, NULL},
{"RSA_VERIFY_HASH", RSA_VERIFY_ARG_MAX, RSA_VERIFY_ARG_MAX, true, setParamsRsaVerify, makeBoolResult, evlRsaVerify, NULL},
{"SIGN", 1, 1, true, setParamsDblDec, makeShortResult, evlSign, NULL},
{"SIN", 1, 1, true, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfSin},
{"SINH", 1, 1, true, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfSinh},
{"SQRT", 1, 1, true, setParamsDblDec, makeDblDecResult, evlSqrt, NULL},
{"TAN", 1, 1, true, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfTan},
{"TANH", 1, 1, true, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfTanh},
{"TOTALORDER", 2, 2, true, setParamsDecFloat, makeShortResult, evlCompare, (void*) funTotalOrd},
{"TRUNC", 1, 2, true, setParamsRoundTrunc, makeTrunc, evlTrunc, NULL},
{"UNICODE_CHAR", 1, 1, true, setParamsInteger, makeUnicodeChar, evlUnicodeChar, NULL},
{"UNICODE_VAL", 1, 1, true, setParamsUnicodeVal, makeLongResult, evlUnicodeVal, NULL},
{"UUID_TO_CHAR", 1, 1, true, setParamsUuidToChar, makeUuidToChar, evlUuidToChar, NULL},
{"", 0, 0, NULL, NULL, NULL, NULL}
};

Expand Down
1 change: 1 addition & 0 deletions src/jrd/SysFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class SysFunction
const char* name;
int minArgCount;
int maxArgCount; // -1 for no limit
bool deterministic;
SetParamsFunc setParamsFunc;
MakeFunc makeFunc;
EvlFunc evlFunc;
Expand Down
Loading

0 comments on commit 0d72b80

Please sign in to comment.