fix: error in determining whether last(t.*) is a selection function
This commit is contained in:
parent
518a1e6ece
commit
c1452851e3
|
@ -1634,13 +1634,15 @@ static bool isTableStar(SNode* pNode) {
|
|||
(0 == strcmp(((SColumnNode*)pNode)->colName, "*"));
|
||||
}
|
||||
|
||||
static bool isStarParam(SNode* pNode) { return isStar(pNode) || isTableStar(pNode); }
|
||||
|
||||
static int32_t translateMultiResFunc(STranslateContext* pCxt, SFunctionNode* pFunc) {
|
||||
if (!fmIsMultiResFunc(pFunc->funcId)) {
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
if (SQL_CLAUSE_SELECT != pCxt->currClause) {
|
||||
SNode* pPara = nodesListGetNode(pFunc->pParameterList, 0);
|
||||
if (isStar(pPara) || isTableStar(pPara)) {
|
||||
if (isStarParam(pPara)) {
|
||||
return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_NOT_ALLOWED_FUNC,
|
||||
"%s(*) is only supported in SELECTed list", pFunc->functionName);
|
||||
}
|
||||
|
@ -1654,7 +1656,7 @@ static int32_t translateMultiResFunc(STranslateContext* pCxt, SFunctionNode* pFu
|
|||
|
||||
static int32_t getMultiResFuncNum(SNodeList* pParameterList) {
|
||||
if (1 == LIST_LENGTH(pParameterList)) {
|
||||
return isStar(nodesListGetNode(pParameterList, 0)) ? 2 : 1;
|
||||
return isStarParam(nodesListGetNode(pParameterList, 0)) ? 2 : 1;
|
||||
}
|
||||
return LIST_LENGTH(pParameterList);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue