Skip to content

Commit f0b7429

Browse files
authored
Do not consider non-deterministic expressions as invariants in pre-filters (#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
1 parent ae42776 commit f0b7429

File tree

7 files changed

+155
-89
lines changed

7 files changed

+155
-89
lines changed

src/dsql/ExprNodes.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,20 @@ bool ExprNode::sameAs(const ExprNode* other, bool ignoreStreams) const
369369
return true;
370370
}
371371

372+
bool ExprNode::deterministic() const
373+
{
374+
NodeRefsHolder holder;
375+
getChildren(holder, false);
376+
377+
for (auto i : holder.refs)
378+
{
379+
if (*i && !(*i)->deterministic())
380+
return false;
381+
}
382+
383+
return true;
384+
}
385+
372386
bool ExprNode::possiblyUnknown() const
373387
{
374388
NodeRefsHolder holder;
@@ -12333,6 +12347,11 @@ void SysFuncCallNode::make(DsqlCompilerScratch* dsqlScratch, dsc* desc)
1233312347
function->makeFunc(&dataTypeUtil, function, desc, argsArray.getCount(), argsArray.begin());
1233412348
}
1233512349

12350+
bool SysFuncCallNode::deterministic() const
12351+
{
12352+
return ExprNode::deterministic() && function->deterministic;
12353+
}
12354+
1233612355
void SysFuncCallNode::getDesc(thread_db* tdbb, CompilerScratch* csb, dsc* desc)
1233712356
{
1233812357
Array<const dsc*> argsArray;
@@ -12980,6 +12999,11 @@ void UdfCallNode::make(DsqlCompilerScratch* /*dsqlScratch*/, dsc* desc)
1298012999
desc->setTextType(dsqlFunction->udf_character_set_id);
1298113000
}
1298213001

13002+
bool UdfCallNode::deterministic() const
13003+
{
13004+
return ExprNode::deterministic() && function->fun_deterministic;
13005+
}
13006+
1298313007
void UdfCallNode::getDesc(thread_db* /*tdbb*/, CompilerScratch* /*csb*/, dsc* desc)
1298413008
{
1298513009
// Null value for the function indicates that the function was not

src/dsql/ExprNodes.h

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,11 @@ class FieldNode final : public TypedNode<ValueExprNode, ExprNode::TYPE_FIELD>
786786
dsqlDesc = desc;
787787
}
788788

789+
virtual bool deterministic() const override
790+
{
791+
return true;
792+
}
793+
789794
virtual bool possiblyUnknown() const
790795
{
791796
return false;
@@ -862,6 +867,11 @@ class GenIdNode final : public TypedNode<ValueExprNode, ExprNode::TYPE_GEN_ID>
862867
virtual void genBlr(DsqlCompilerScratch* dsqlScratch);
863868
virtual void make(DsqlCompilerScratch* dsqlScratch, dsc* desc);
864869

870+
virtual bool deterministic() const override
871+
{
872+
return false;
873+
}
874+
865875
virtual void getDesc(thread_db* tdbb, CompilerScratch* csb, dsc* desc);
866876
virtual ValueExprNode* copy(thread_db* tdbb, NodeCopier& copier) const;
867877
virtual bool dsqlMatch(DsqlCompilerScratch* dsqlScratch, const ExprNode* other, bool ignoreMapCast) const;
@@ -1618,6 +1628,11 @@ class ParameterNode final : public TypedNode<ValueExprNode, ExprNode::TYPE_PARAM
16181628

16191629
Request* getParamRequest(Request* request) const;
16201630

1631+
virtual bool deterministic() const override
1632+
{
1633+
return true;
1634+
}
1635+
16211636
virtual void getDesc(thread_db* tdbb, CompilerScratch* csb, dsc* desc);
16221637
virtual ParameterNode* copy(thread_db* tdbb, NodeCopier& copier) const;
16231638
virtual ParameterNode* pass1(thread_db* tdbb, CompilerScratch* csb);
@@ -1665,6 +1680,11 @@ class RecordKeyNode final : public TypedNode<ValueExprNode, ExprNode::TYPE_RECOR
16651680
virtual void genBlr(DsqlCompilerScratch* dsqlScratch);
16661681
virtual void make(DsqlCompilerScratch* dsqlScratch, dsc* desc);
16671682

1683+
virtual bool deterministic() const override
1684+
{
1685+
return true;
1686+
}
1687+
16681688
virtual bool possiblyUnknown() const
16691689
{
16701690
return false;
@@ -2067,6 +2087,8 @@ class SysFuncCallNode final : public TypedNode<ValueExprNode, ExprNode::TYPE_SYS
20672087
virtual void genBlr(DsqlCompilerScratch* dsqlScratch);
20682088
virtual void make(DsqlCompilerScratch* dsqlScratch, dsc* desc);
20692089

2090+
virtual bool deterministic() const override;
2091+
20702092
virtual void getDesc(thread_db* tdbb, CompilerScratch* csb, dsc* desc);
20712093
virtual ValueExprNode* copy(thread_db* tdbb, NodeCopier& copier) const;
20722094
virtual bool dsqlMatch(DsqlCompilerScratch* dsqlScratch, const ExprNode* other, bool ignoreMapCast) const;
@@ -2147,6 +2169,8 @@ class UdfCallNode final : public TypedNode<ValueExprNode, ExprNode::TYPE_UDF_CAL
21472169
virtual void genBlr(DsqlCompilerScratch* dsqlScratch);
21482170
virtual void make(DsqlCompilerScratch* dsqlScratch, dsc* desc);
21492171

2172+
virtual bool deterministic() const override;
2173+
21502174
virtual bool possiblyUnknown() const
21512175
{
21522176
return true;
@@ -2245,6 +2269,11 @@ class VariableNode final : public TypedNode<ValueExprNode, ExprNode::TYPE_VARIAB
22452269

22462270
Request* getVarRequest(Request* request) const;
22472271

2272+
virtual bool deterministic() const override
2273+
{
2274+
return false;
2275+
}
2276+
22482277
virtual void getDesc(thread_db* tdbb, CompilerScratch* csb, dsc* desc);
22492278
virtual ValueExprNode* copy(thread_db* tdbb, NodeCopier& copier) const;
22502279
virtual ValueExprNode* pass1(thread_db* tdbb, CompilerScratch* csb);

src/dsql/Nodes.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,9 @@ class ExprNode : public DmlNode
658658
target = node ? node->dsqlFieldRemapper(visitor) : NULL;
659659
}
660660

661+
// Check if expression returns deterministic result
662+
virtual bool deterministic() const;
663+
661664
// Check if expression could return NULL or expression can turn NULL into a true/false.
662665
virtual bool possiblyUnknown() const;
663666

src/jrd/RecordSourceNodes.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,11 @@ class ProcedureSourceNode final : public TypedNode<RecordSourceNode, RecordSourc
479479
{
480480
}
481481

482+
virtual bool deterministic() const
483+
{
484+
return false;
485+
}
486+
482487
virtual bool computable(CompilerScratch* csb, StreamType stream,
483488
bool allowOnlyCurrentStream, ValueExprNode* value);
484489
virtual void findDependentFromStreams(const CompilerScratch* csb,

src/jrd/SysFunction.cpp

Lines changed: 87 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -6855,91 +6855,93 @@ dsc* evlUnicodeVal(thread_db* tdbb, const SysFunction*, const NestValueArray& ar
68556855

68566856
const SysFunction SysFunction::functions[] =
68576857
{
6858-
{"ABS", 1, 1, setParamsDblDec, makeAbs, evlAbs, NULL},
6859-
{"ACOS", 1, 1, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfAcos},
6860-
{"ACOSH", 1, 1, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfAcosh},
6861-
{"ASCII_CHAR", 1, 1, setParamsInteger, makeAsciiChar, evlAsciiChar, NULL},
6862-
{"ASCII_VAL", 1, 1, setParamsAsciiVal, makeShortResult, evlAsciiVal, NULL},
6863-
{"ASIN", 1, 1, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfAsin},
6864-
{"ASINH", 1, 1, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfAsinh},
6865-
{"ATAN", 1, 1, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfAtan},
6866-
{"ATANH", 1, 1, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfAtanh},
6867-
{"ATAN2", 2, 2, setParamsDouble, makeDoubleResult, evlAtan2, NULL},
6868-
{"BASE64_DECODE", 1, 1, NULL, makeDecode64, evlDecode64, NULL},
6869-
{"BASE64_ENCODE", 1, 1, NULL, makeEncode64, evlEncode64, NULL},
6870-
{"BIN_AND", 2, -1, setParamsBin, makeBin, evlBin, (void*) funBinAnd},
6871-
{"BIN_NOT", 1, 1, setParamsBin, makeBin, evlBin, (void*) funBinNot},
6872-
{"BIN_OR", 2, -1, setParamsBin, makeBin, evlBin, (void*) funBinOr},
6873-
{"BIN_SHL", 2, 2, setParamsInteger, makeBinShift, evlBinShift, (void*) funBinShl},
6874-
{"BIN_SHR", 2, 2, setParamsInteger, makeBinShift, evlBinShift, (void*) funBinShr},
6875-
{"BIN_SHL_ROT", 2, 2, setParamsInteger, makeBinShift, evlBinShift, (void*) funBinShlRot},
6876-
{"BIN_SHR_ROT", 2, 2, setParamsInteger, makeBinShift, evlBinShift, (void*) funBinShrRot},
6877-
{"BIN_XOR", 2, -1, setParamsBin, makeBin, evlBin, (void*) funBinXor},
6878-
{"BLOB_APPEND", 2, -1, setParamsBlobAppend, makeBlobAppend, evlBlobAppend, NULL},
6879-
{"CEIL", 1, 1, setParamsDblDec, makeCeilFloor, evlCeil, NULL},
6880-
{"CEILING", 1, 1, setParamsDblDec, makeCeilFloor, evlCeil, NULL},
6881-
{"CHAR_TO_UUID", 1, 1, setParamsCharToUuid, makeUuid, evlCharToUuid, NULL},
6882-
{"COMPARE_DECFLOAT", 2, 2, setParamsDecFloat, makeShortResult, evlCompare, (void*) funCmpDec},
6883-
{"COS", 1, 1, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfCos},
6884-
{"COSH", 1, 1, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfCosh},
6885-
{"COT", 1, 1, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfCot},
6886-
{"CRYPT_HASH", 2, 2, setParamsHash, makeHash, evlHash, NULL},
6887-
{"DATEADD", 3, 3, setParamsDateAdd, makeDateAdd, evlDateAdd, NULL},
6888-
{"DATEDIFF", 3, 3, setParamsDateDiff, makeDateDiff, evlDateDiff, NULL},
6889-
{"DECRYPT", CRYPT_ARG_MAX, CRYPT_ARG_MAX, setParamsEncrypt, makeCrypt, evlDecrypt, NULL},
6890-
{"ENCRYPT", CRYPT_ARG_MAX, CRYPT_ARG_MAX, setParamsEncrypt, makeCrypt, evlEncrypt, NULL},
6891-
{"EXP", 1, 1, setParamsDblDec, makeDblDecResult, evlExp, NULL},
6892-
{"FIRST_DAY", 2, 2, setParamsFirstLastDay, makeFirstLastDayResult, evlFirstLastDay, (void*) funFirstDay},
6893-
{"FLOOR", 1, 1, setParamsDblDec, makeCeilFloor, evlFloor, NULL},
6894-
{"GEN_UUID", 0, 0, NULL, makeUuid, evlGenUuid, NULL},
6895-
{"HASH", 1, 2, setParamsHash, makeHash, evlHash, NULL},
6896-
{"HEX_DECODE", 1, 1, NULL, makeDecodeHex, evlDecodeHex, NULL},
6897-
{"HEX_ENCODE", 1, 1, NULL, makeEncodeHex, evlEncodeHex, NULL},
6898-
{"LAST_DAY", 2, 2, setParamsFirstLastDay, makeFirstLastDayResult, evlFirstLastDay, (void*) funLastDay},
6899-
{"LEFT", 2, 2, setParamsSecondInteger, makeLeftRight, evlLeft, NULL},
6900-
{"LN", 1, 1, setParamsDblDec, makeDblDecResult, evlLnLog10, (void*) funLnat},
6901-
{"LOG", 2, 2, setParamsDblDec, makeDblDecResult, evlLog, NULL},
6902-
{"LOG10", 1, 1, setParamsDblDec, makeDblDecResult, evlLnLog10, (void*) funLog10},
6903-
{"LPAD", 2, 3, setParamsSecondInteger, makePad, evlPad, (void*) funLPad},
6904-
{"MAKE_DBKEY", 2, 4, setParamsMakeDbkey, makeDbkeyResult, evlMakeDbkey, NULL},
6905-
{"MAXVALUE", 1, -1, setParamsFromList, makeFromListResult, evlMaxMinValue, (void*) funMaxValue},
6906-
{"MINVALUE", 1, -1, setParamsFromList, makeFromListResult, evlMaxMinValue, (void*) funMinValue},
6907-
{"MOD", 2, 2, setParamsFromList, makeMod, evlMod, NULL},
6908-
{"NORMALIZE_DECFLOAT", 1, 1, setParamsDecFloat, makeDecFloatResult, evlNormDec, NULL},
6909-
{"OVERLAY", 3, 4, setParamsOverlay, makeOverlay, evlOverlay, NULL},
6910-
{"PI", 0, 0, NULL, makePi, evlPi, NULL},
6911-
{"POSITION", 2, 3, setParamsPosition, makeLongResult, evlPosition, NULL},
6912-
{"POWER", 2, 2, setParamsDblDec, makeDblDecResult, evlPower, NULL},
6913-
{"QUANTIZE", 2, 2, setParamsDecFloat, makeDecFloatResult, evlQuantize, NULL},
6914-
{"RAND", 0, 0, NULL, makeDoubleResult, evlRand, NULL},
6915-
{RDB_GET_CONTEXT, 2, 2, setParamsGetSetContext, makeGetSetContext, evlGetContext, NULL},
6916-
{"RDB$GET_TRANSACTION_CN", 1, 1, setParamsInt64, makeGetTranCN, evlGetTranCN, NULL},
6917-
{"RDB$ROLE_IN_USE", 1, 1, setParamsAsciiVal, makeBooleanResult, evlRoleInUse, NULL},
6918-
{RDB_SET_CONTEXT, 3, 3, setParamsGetSetContext, makeGetSetContext, evlSetContext, NULL},
6919-
{"RDB$SYSTEM_PRIVILEGE", 1, 1, NULL, makeBooleanResult, evlSystemPrivilege, NULL},
6920-
{"REPLACE", 3, 3, setParamsFromList, makeReplace, evlReplace, NULL},
6921-
{"REVERSE", 1, 1, NULL, makeReverse, evlReverse, NULL},
6922-
{"RIGHT", 2, 2, setParamsSecondInteger, makeLeftRight, evlRight, NULL},
6923-
{"ROUND", 1, 2, setParamsRoundTrunc, makeRound, evlRound, NULL},
6924-
{"RPAD", 2, 3, setParamsSecondInteger, makePad, evlPad, (void*) funRPad},
6925-
{"RSA_DECRYPT", RSA_CRYPT_ARG_MAX, RSA_CRYPT_ARG_MAX, setParamsRsaEncrypt, makeRsaCrypt, evlRsaDecrypt, NULL},
6926-
{"RSA_ENCRYPT", RSA_CRYPT_ARG_MAX, RSA_CRYPT_ARG_MAX, setParamsRsaEncrypt, makeRsaCrypt, evlRsaEncrypt, NULL},
6927-
{"RSA_PRIVATE", 1, 1, setParamsInteger, makeRsaPrivate, evlRsaPrivate, NULL},
6928-
{"RSA_PUBLIC", 1, 1, setParamsRsaPublic, makeRsaPublic, evlRsaPublic, NULL},
6929-
{"RSA_SIGN_HASH", RSA_SIGN_ARG_MAX, RSA_SIGN_ARG_MAX, setParamsRsaSign, makeRsaSign, evlRsaSign, NULL},
6930-
{"RSA_VERIFY_HASH", RSA_VERIFY_ARG_MAX, RSA_VERIFY_ARG_MAX, setParamsRsaVerify, makeBoolResult, evlRsaVerify, NULL},
6931-
{"SIGN", 1, 1, setParamsDblDec, makeShortResult, evlSign, NULL},
6932-
{"SIN", 1, 1, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfSin},
6933-
{"SINH", 1, 1, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfSinh},
6934-
{"SQRT", 1, 1, setParamsDblDec, makeDblDecResult, evlSqrt, NULL},
6935-
{"TAN", 1, 1, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfTan},
6936-
{"TANH", 1, 1, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfTanh},
6937-
{"TOTALORDER", 2, 2, setParamsDecFloat, makeShortResult, evlCompare, (void*) funTotalOrd},
6938-
{"TRUNC", 1, 2, setParamsRoundTrunc, makeTrunc, evlTrunc, NULL},
6939-
{"UNICODE_CHAR", 1, 1, setParamsInteger, makeUnicodeChar, evlUnicodeChar, NULL},
6940-
{"UNICODE_VAL", 1, 1, setParamsUnicodeVal, makeLongResult, evlUnicodeVal, NULL},
6941-
{"UUID_TO_CHAR", 1, 1, setParamsUuidToChar, makeUuidToChar, evlUuidToChar, NULL},
6942-
{"", 0, 0, NULL, NULL, NULL, NULL}
6858+
// name, minArgCount, maxArgCount, deterministic, setParamsFunc, makeFunc, evlFunc, misc
6859+
6860+
{"ABS", 1, 1, true, setParamsDblDec, makeAbs, evlAbs, NULL},
6861+
{"ACOS", 1, 1, true, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfAcos},
6862+
{"ACOSH", 1, 1, true, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfAcosh},
6863+
{"ASCII_CHAR", 1, 1, true, setParamsInteger, makeAsciiChar, evlAsciiChar, NULL},
6864+
{"ASCII_VAL", 1, 1, true, setParamsAsciiVal, makeShortResult, evlAsciiVal, NULL},
6865+
{"ASIN", 1, 1, true, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfAsin},
6866+
{"ASINH", 1, 1, true, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfAsinh},
6867+
{"ATAN", 1, 1, true, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfAtan},
6868+
{"ATANH", 1, 1, true, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfAtanh},
6869+
{"ATAN2", 2, 2, true, setParamsDouble, makeDoubleResult, evlAtan2, NULL},
6870+
{"BASE64_DECODE", 1, 1, true, NULL, makeDecode64, evlDecode64, NULL},
6871+
{"BASE64_ENCODE", 1, 1, true, NULL, makeEncode64, evlEncode64, NULL},
6872+
{"BIN_AND", 2, -1, true, setParamsBin, makeBin, evlBin, (void*) funBinAnd},
6873+
{"BIN_NOT", 1, 1, true, setParamsBin, makeBin, evlBin, (void*) funBinNot},
6874+
{"BIN_OR", 2, -1, true, setParamsBin, makeBin, evlBin, (void*) funBinOr},
6875+
{"BIN_SHL", 2, 2, true, setParamsInteger, makeBinShift, evlBinShift, (void*) funBinShl},
6876+
{"BIN_SHR", 2, 2, true, setParamsInteger, makeBinShift, evlBinShift, (void*) funBinShr},
6877+
{"BIN_SHL_ROT", 2, 2, true, setParamsInteger, makeBinShift, evlBinShift, (void*) funBinShlRot},
6878+
{"BIN_SHR_ROT", 2, 2, true, setParamsInteger, makeBinShift, evlBinShift, (void*) funBinShrRot},
6879+
{"BIN_XOR", 2, -1, true, setParamsBin, makeBin, evlBin, (void*) funBinXor},
6880+
{"BLOB_APPEND", 2, -1, true, setParamsBlobAppend, makeBlobAppend, evlBlobAppend, NULL},
6881+
{"CEIL", 1, 1, true, setParamsDblDec, makeCeilFloor, evlCeil, NULL},
6882+
{"CEILING", 1, 1, true, setParamsDblDec, makeCeilFloor, evlCeil, NULL},
6883+
{"CHAR_TO_UUID", 1, 1, true, setParamsCharToUuid, makeUuid, evlCharToUuid, NULL},
6884+
{"COMPARE_DECFLOAT", 2, 2, true, setParamsDecFloat, makeShortResult, evlCompare, (void*) funCmpDec},
6885+
{"COS", 1, 1, true, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfCos},
6886+
{"COSH", 1, 1, true, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfCosh},
6887+
{"COT", 1, 1, true, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfCot},
6888+
{"CRYPT_HASH", 2, 2, true, setParamsHash, makeHash, evlHash, NULL},
6889+
{"DATEADD", 3, 3, true, setParamsDateAdd, makeDateAdd, evlDateAdd, NULL},
6890+
{"DATEDIFF", 3, 3, true, setParamsDateDiff, makeDateDiff, evlDateDiff, NULL},
6891+
{"DECRYPT", CRYPT_ARG_MAX, CRYPT_ARG_MAX, true, setParamsEncrypt, makeCrypt, evlDecrypt, NULL},
6892+
{"ENCRYPT", CRYPT_ARG_MAX, CRYPT_ARG_MAX, true, setParamsEncrypt, makeCrypt, evlEncrypt, NULL},
6893+
{"EXP", 1, 1, true, setParamsDblDec, makeDblDecResult, evlExp, NULL},
6894+
{"FIRST_DAY", 2, 2, true, setParamsFirstLastDay, makeFirstLastDayResult, evlFirstLastDay, (void*) funFirstDay},
6895+
{"FLOOR", 1, 1, true, setParamsDblDec, makeCeilFloor, evlFloor, NULL},
6896+
{"GEN_UUID", 0, 0, false, NULL, makeUuid, evlGenUuid, NULL},
6897+
{"HASH", 1, 2, true, setParamsHash, makeHash, evlHash, NULL},
6898+
{"HEX_DECODE", 1, 1, true, NULL, makeDecodeHex, evlDecodeHex, NULL},
6899+
{"HEX_ENCODE", 1, 1, true, NULL, makeEncodeHex, evlEncodeHex, NULL},
6900+
{"LAST_DAY", 2, 2, true, setParamsFirstLastDay, makeFirstLastDayResult, evlFirstLastDay, (void*) funLastDay},
6901+
{"LEFT", 2, 2, true, setParamsSecondInteger, makeLeftRight, evlLeft, NULL},
6902+
{"LN", 1, 1, true, setParamsDblDec, makeDblDecResult, evlLnLog10, (void*) funLnat},
6903+
{"LOG", 2, 2, true, setParamsDblDec, makeDblDecResult, evlLog, NULL},
6904+
{"LOG10", 1, 1, true, setParamsDblDec, makeDblDecResult, evlLnLog10, (void*) funLog10},
6905+
{"LPAD", 2, 3, true, setParamsSecondInteger, makePad, evlPad, (void*) funLPad},
6906+
{"MAKE_DBKEY", 2, 4, true, setParamsMakeDbkey, makeDbkeyResult, evlMakeDbkey, NULL},
6907+
{"MAXVALUE", 1, -1, true, setParamsFromList, makeFromListResult, evlMaxMinValue, (void*) funMaxValue},
6908+
{"MINVALUE", 1, -1, true, setParamsFromList, makeFromListResult, evlMaxMinValue, (void*) funMinValue},
6909+
{"MOD", 2, 2, true, setParamsFromList, makeMod, evlMod, NULL},
6910+
{"NORMALIZE_DECFLOAT", 1, 1, true, setParamsDecFloat, makeDecFloatResult, evlNormDec, NULL},
6911+
{"OVERLAY", 3, 4, true, setParamsOverlay, makeOverlay, evlOverlay, NULL},
6912+
{"PI", 0, 0, true, NULL, makePi, evlPi, NULL},
6913+
{"POSITION", 2, 3, true, setParamsPosition, makeLongResult, evlPosition, NULL},
6914+
{"POWER", 2, 2, true, setParamsDblDec, makeDblDecResult, evlPower, NULL},
6915+
{"QUANTIZE", 2, 2, true, setParamsDecFloat, makeDecFloatResult, evlQuantize, NULL},
6916+
{"RAND", 0, 0, false, NULL, makeDoubleResult, evlRand, NULL},
6917+
{RDB_GET_CONTEXT, 2, 2, true, setParamsGetSetContext, makeGetSetContext, evlGetContext, NULL},
6918+
{"RDB$GET_TRANSACTION_CN", 1, 1, false, setParamsInt64, makeGetTranCN, evlGetTranCN, NULL},
6919+
{"RDB$ROLE_IN_USE", 1, 1, true, setParamsAsciiVal, makeBooleanResult, evlRoleInUse, NULL},
6920+
{RDB_SET_CONTEXT, 3, 3, false, setParamsGetSetContext, makeGetSetContext, evlSetContext, NULL},
6921+
{"RDB$SYSTEM_PRIVILEGE", 1, 1, true, NULL, makeBooleanResult, evlSystemPrivilege, NULL},
6922+
{"REPLACE", 3, 3, true, setParamsFromList, makeReplace, evlReplace, NULL},
6923+
{"REVERSE", 1, 1, true, NULL, makeReverse, evlReverse, NULL},
6924+
{"RIGHT", 2, 2, true, setParamsSecondInteger, makeLeftRight, evlRight, NULL},
6925+
{"ROUND", 1, 2, true, setParamsRoundTrunc, makeRound, evlRound, NULL},
6926+
{"RPAD", 2, 3, true, setParamsSecondInteger, makePad, evlPad, (void*) funRPad},
6927+
{"RSA_DECRYPT", RSA_CRYPT_ARG_MAX, RSA_CRYPT_ARG_MAX, true, setParamsRsaEncrypt, makeRsaCrypt, evlRsaDecrypt, NULL},
6928+
{"RSA_ENCRYPT", RSA_CRYPT_ARG_MAX, RSA_CRYPT_ARG_MAX, true, setParamsRsaEncrypt, makeRsaCrypt, evlRsaEncrypt, NULL},
6929+
{"RSA_PRIVATE", 1, 1, false, setParamsInteger, makeRsaPrivate, evlRsaPrivate, NULL},
6930+
{"RSA_PUBLIC", 1, 1, false, setParamsRsaPublic, makeRsaPublic, evlRsaPublic, NULL},
6931+
{"RSA_SIGN_HASH", RSA_SIGN_ARG_MAX, RSA_SIGN_ARG_MAX, true, setParamsRsaSign, makeRsaSign, evlRsaSign, NULL},
6932+
{"RSA_VERIFY_HASH", RSA_VERIFY_ARG_MAX, RSA_VERIFY_ARG_MAX, true, setParamsRsaVerify, makeBoolResult, evlRsaVerify, NULL},
6933+
{"SIGN", 1, 1, true, setParamsDblDec, makeShortResult, evlSign, NULL},
6934+
{"SIN", 1, 1, true, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfSin},
6935+
{"SINH", 1, 1, true, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfSinh},
6936+
{"SQRT", 1, 1, true, setParamsDblDec, makeDblDecResult, evlSqrt, NULL},
6937+
{"TAN", 1, 1, true, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfTan},
6938+
{"TANH", 1, 1, true, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfTanh},
6939+
{"TOTALORDER", 2, 2, true, setParamsDecFloat, makeShortResult, evlCompare, (void*) funTotalOrd},
6940+
{"TRUNC", 1, 2, true, setParamsRoundTrunc, makeTrunc, evlTrunc, NULL},
6941+
{"UNICODE_CHAR", 1, 1, true, setParamsInteger, makeUnicodeChar, evlUnicodeChar, NULL},
6942+
{"UNICODE_VAL", 1, 1, true, setParamsUnicodeVal, makeLongResult, evlUnicodeVal, NULL},
6943+
{"UUID_TO_CHAR", 1, 1, true, setParamsUuidToChar, makeUuidToChar, evlUuidToChar, NULL},
6944+
{"", 0, 0, false, NULL, NULL, NULL, NULL}
69436945
};
69446946

69456947

src/jrd/SysFunction.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class SysFunction
5454
const char* name;
5555
int minArgCount;
5656
int maxArgCount; // -1 for no limit
57+
bool deterministic;
5758
SetParamsFunc setParamsFunc;
5859
MakeFunc makeFunc;
5960
EvlFunc evlFunc;

0 commit comments

Comments
 (0)