fix parameter check
This commit is contained in:
parent
84765ff670
commit
61140d3143
|
@ -878,12 +878,7 @@ SOperatorInfo* createTableScanOperatorInfo(STableScanPhysiNode* pTableScanNode,
|
|||
}
|
||||
|
||||
pInfo->scanInfo = (SScanInfo){.numOfAsc = pTableScanNode->scanSeq[0], .numOfDesc = pTableScanNode->scanSeq[1]};
|
||||
|
||||
if (pInfo->scanInfo.numOfAsc > 1) {
|
||||
pInfo->base.scanFlag = PRE_SCAN;
|
||||
} else {
|
||||
pInfo->base.scanFlag = MAIN_SCAN;
|
||||
}
|
||||
pInfo->base.scanFlag = (pInfo->scanInfo.numOfAsc > 1) ? PRE_SCAN : MAIN_SCAN;
|
||||
|
||||
pInfo->base.pdInfo.interval = extractIntervalInfo(pTableScanNode);
|
||||
pInfo->base.readHandle = *readHandle;
|
||||
|
|
|
@ -513,13 +513,21 @@ static int32_t translatePercentile(SFunctionNode* pFunc, char* pErrBuf, int32_t
|
|||
SValueNode* pValue = (SValueNode*)nodesListGetNode(pFunc->pParameterList, i);
|
||||
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;
|
||||
if (!IS_NUMERIC_TYPE(paraType)) {
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue