fix: keepColumnName parameter changes the user alias
This commit is contained in:
parent
d39e34ce7c
commit
e62315c244
|
@ -51,6 +51,7 @@ typedef struct SExprNode {
|
|||
char userAlias[TSDB_COL_NAME_LEN];
|
||||
SArray* pAssociation;
|
||||
bool orderAlias;
|
||||
bool asAlias;
|
||||
} SExprNode;
|
||||
|
||||
typedef enum EColumnType {
|
||||
|
|
|
@ -680,6 +680,7 @@ SNode* setProjectionAlias(SAstCreateContext* pCxt, SNode* pNode, SToken* pAlias)
|
|||
pExpr->aliasName[len] = '\0';
|
||||
strncpy(pExpr->userAlias, pAlias->z, len);
|
||||
pExpr->userAlias[len] = '\0';
|
||||
pExpr->asAlias = true;
|
||||
return pNode;
|
||||
}
|
||||
|
||||
|
|
|
@ -1579,7 +1579,7 @@ static int32_t translateMultiResFunc(STranslateContext* pCxt, SFunctionNode* pFu
|
|||
"%s(*) is only supported in SELECTed list", pFunc->functionName);
|
||||
}
|
||||
}
|
||||
if (tsKeepColumnName && 1 == LIST_LENGTH(pFunc->pParameterList)) {
|
||||
if (tsKeepColumnName && 1 == LIST_LENGTH(pFunc->pParameterList) && !pFunc->node.asAlias) {
|
||||
strcpy(pFunc->node.userAlias, ((SExprNode*)nodesListGetNode(pFunc->pParameterList, 0))->userAlias);
|
||||
}
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
|
Loading…
Reference in New Issue