提交 61140d31 编写于 作者: G Ganlin Zhao

fix parameter check

上级 84765ff6
...@@ -878,12 +878,7 @@ SOperatorInfo* createTableScanOperatorInfo(STableScanPhysiNode* pTableScanNode, ...@@ -878,12 +878,7 @@ SOperatorInfo* createTableScanOperatorInfo(STableScanPhysiNode* pTableScanNode,
} }
pInfo->scanInfo = (SScanInfo){.numOfAsc = pTableScanNode->scanSeq[0], .numOfDesc = pTableScanNode->scanSeq[1]}; pInfo->scanInfo = (SScanInfo){.numOfAsc = pTableScanNode->scanSeq[0], .numOfDesc = pTableScanNode->scanSeq[1]};
pInfo->base.scanFlag = (pInfo->scanInfo.numOfAsc > 1) ? PRE_SCAN : MAIN_SCAN;
if (pInfo->scanInfo.numOfAsc > 1) {
pInfo->base.scanFlag = PRE_SCAN;
} else {
pInfo->base.scanFlag = MAIN_SCAN;
}
pInfo->base.pdInfo.interval = extractIntervalInfo(pTableScanNode); pInfo->base.pdInfo.interval = extractIntervalInfo(pTableScanNode);
pInfo->base.readHandle = *readHandle; pInfo->base.readHandle = *readHandle;
......
...@@ -513,13 +513,21 @@ static int32_t translatePercentile(SFunctionNode* pFunc, char* pErrBuf, int32_t ...@@ -513,13 +513,21 @@ static int32_t translatePercentile(SFunctionNode* pFunc, char* pErrBuf, int32_t
SValueNode* pValue = (SValueNode*)nodesListGetNode(pFunc->pParameterList, i); SValueNode* pValue = (SValueNode*)nodesListGetNode(pFunc->pParameterList, i);
pValue->notReserved = true; pValue->notReserved = true;
if (pValue->datum.i < 0 || pValue->datum.i > 100) {
return invaildFuncParaValueErrMsg(pErrBuf, len, pFunc->functionName);
}
uint8_t paraType = ((SExprNode*)nodesListGetNode(pFunc->pParameterList, i))->resType.type; uint8_t paraType = ((SExprNode*)nodesListGetNode(pFunc->pParameterList, i))->resType.type;
if (!IS_NUMERIC_TYPE(paraType)) { if (!IS_NUMERIC_TYPE(paraType)) {
return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName);
} }
double v = 0;
if (IS_INTEGER_TYPE(paraType)) {
v = (double)pValue->datum.i;
} else {
v = pValue->datum.d;
}
if (v < 0 || v > 100) {
return invaildFuncParaValueErrMsg(pErrBuf, len, pFunc->functionName);
}
} }
// set result type // set result type
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册