Skip to content

Commit 0d72b80

Browse files
committed
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 49804f3 commit 0d72b80

File tree

7 files changed

+154
-88
lines changed

7 files changed

+154
-88
lines changed

src/dsql/ExprNodes.cpp

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

399+
bool ExprNode::deterministic() const
400+
{
401+
NodeRefsHolder holder;
402+
getChildren(holder, false);
403+
404+
for (auto i : holder.refs)
405+
{
406+
if (*i && !(*i)->deterministic())
407+
return false;
408+
}
409+
410+
return true;
411+
}
412+
399413
bool ExprNode::possiblyUnknown() const
400414
{
401415
NodeRefsHolder holder;
@@ -12390,6 +12404,11 @@ void SysFuncCallNode::make(DsqlCompilerScratch* dsqlScratch, dsc* desc)
1239012404
function->makeFunc(&dataTypeUtil, function, desc, argsArray.getCount(), argsArray.begin());
1239112405
}
1239212406

12407+
bool SysFuncCallNode::deterministic() const
12408+
{
12409+
return ExprNode::deterministic() && function->deterministic;
12410+
}
12411+
1239312412
void SysFuncCallNode::getDesc(thread_db* tdbb, CompilerScratch* csb, dsc* desc)
1239412413
{
1239512414
Array<const dsc*> argsArray;
@@ -13306,6 +13325,11 @@ void UdfCallNode::make(DsqlCompilerScratch* /*dsqlScratch*/, dsc* desc)
1330613325
desc->setTextType(dsqlFunction->udf_character_set_id);
1330713326
}
1330813327

13328+
bool UdfCallNode::deterministic() const
13329+
{
13330+
return ExprNode::deterministic() && function->fun_deterministic;
13331+
}
13332+
1330913333
void UdfCallNode::getDesc(thread_db* /*tdbb*/, CompilerScratch* /*csb*/, dsc* desc)
1331013334
{
1331113335
// 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
@@ -799,6 +799,11 @@ class FieldNode final : public TypedNode<ValueExprNode, ExprNode::TYPE_FIELD>
799799
dsqlDesc = desc;
800800
}
801801

802+
virtual bool deterministic() const override
803+
{
804+
return true;
805+
}
806+
802807
virtual bool possiblyUnknown() const
803808
{
804809
return false;
@@ -875,6 +880,11 @@ class GenIdNode final : public TypedNode<ValueExprNode, ExprNode::TYPE_GEN_ID>
875880
virtual void genBlr(DsqlCompilerScratch* dsqlScratch);
876881
virtual void make(DsqlCompilerScratch* dsqlScratch, dsc* desc);
877882

883+
virtual bool deterministic() const override
884+
{
885+
return false;
886+
}
887+
878888
virtual void getDesc(thread_db* tdbb, CompilerScratch* csb, dsc* desc);
879889
virtual ValueExprNode* copy(thread_db* tdbb, NodeCopier& copier) const;
880890
virtual bool dsqlMatch(DsqlCompilerScratch* dsqlScratch, const ExprNode* other, bool ignoreMapCast) const;
@@ -1634,6 +1644,11 @@ class ParameterNode final : public TypedNode<ValueExprNode, ExprNode::TYPE_PARAM
16341644

16351645
Request* getParamRequest(Request* request) const;
16361646

1647+
virtual bool deterministic() const override
1648+
{
1649+
return true;
1650+
}
1651+
16371652
virtual void getDesc(thread_db* tdbb, CompilerScratch* csb, dsc* desc);
16381653
virtual ParameterNode* copy(thread_db* tdbb, NodeCopier& copier) const;
16391654
virtual ParameterNode* pass1(thread_db* tdbb, CompilerScratch* csb);
@@ -1681,6 +1696,11 @@ class RecordKeyNode final : public TypedNode<ValueExprNode, ExprNode::TYPE_RECOR
16811696
virtual void genBlr(DsqlCompilerScratch* dsqlScratch);
16821697
virtual void make(DsqlCompilerScratch* dsqlScratch, dsc* desc);
16831698

1699+
virtual bool deterministic() const override
1700+
{
1701+
return true;
1702+
}
1703+
16841704
virtual bool possiblyUnknown() const
16851705
{
16861706
return false;
@@ -2083,6 +2103,8 @@ class SysFuncCallNode final : public TypedNode<ValueExprNode, ExprNode::TYPE_SYS
20832103
virtual void genBlr(DsqlCompilerScratch* dsqlScratch);
20842104
virtual void make(DsqlCompilerScratch* dsqlScratch, dsc* desc);
20852105

2106+
virtual bool deterministic() const override;
2107+
20862108
virtual void getDesc(thread_db* tdbb, CompilerScratch* csb, dsc* desc);
20872109
virtual ValueExprNode* copy(thread_db* tdbb, NodeCopier& copier) const;
20882110
virtual bool dsqlMatch(DsqlCompilerScratch* dsqlScratch, const ExprNode* other, bool ignoreMapCast) const;
@@ -2165,6 +2187,8 @@ class UdfCallNode final : public TypedNode<ValueExprNode, ExprNode::TYPE_UDF_CAL
21652187
virtual void genBlr(DsqlCompilerScratch* dsqlScratch);
21662188
virtual void make(DsqlCompilerScratch* dsqlScratch, dsc* desc);
21672189

2190+
virtual bool deterministic() const override;
2191+
21682192
virtual bool possiblyUnknown() const
21692193
{
21702194
return true;
@@ -2265,6 +2289,11 @@ class VariableNode final : public TypedNode<ValueExprNode, ExprNode::TYPE_VARIAB
22652289

22662290
Request* getVarRequest(Request* request) const;
22672291

2292+
virtual bool deterministic() const override
2293+
{
2294+
return false;
2295+
}
2296+
22682297
virtual void getDesc(thread_db* tdbb, CompilerScratch* csb, dsc* desc);
22692298
virtual ValueExprNode* copy(thread_db* tdbb, NodeCopier& copier) const;
22702299
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
@@ -472,6 +472,11 @@ class ProcedureSourceNode final : public TypedNode<RecordSourceNode, RecordSourc
472472
{
473473
}
474474

475+
virtual bool deterministic() const
476+
{
477+
return false;
478+
}
479+
475480
virtual bool computable(CompilerScratch* csb, StreamType stream,
476481
bool allowOnlyCurrentStream, ValueExprNode* value);
477482
virtual void findDependentFromStreams(const CompilerScratch* csb,

src/jrd/SysFunction.cpp

Lines changed: 86 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -6883,90 +6883,92 @@ dsc* evlUnicodeVal(thread_db* tdbb, const SysFunction*, const NestValueArray& ar
68836883

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

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)