提交 7e975ba2 编写于 作者: S shenglian zhou

set colid to result colid

上级 dfedc1c9
...@@ -1887,20 +1887,11 @@ static int32_t handleScalarTypeExpr(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32 ...@@ -1887,20 +1887,11 @@ static int32_t handleScalarTypeExpr(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32
return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg2); return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg2);
} }
//set the columnIndex to first column Index so that column Id
SColumnIndex index = {.tableIndex = tableIndex}; SColumnIndex index = {.tableIndex = tableIndex};
size_t numOfCols = taosArrayGetSize(colList);
if (numOfCols > 0) {
SColIndex* pIndex = taosArrayGet(colList, 0);
index.columnIndex = pIndex->colIndex;
}
SExprInfo* pExpr = tscExprAppend(pQueryInfo, TSDB_FUNC_SCALAR_EXPR, &index, pNode->resultType, pNode->resultBytes, SExprInfo* pExpr = tscExprAppend(pQueryInfo, TSDB_FUNC_SCALAR_EXPR, &index, pNode->resultType, pNode->resultBytes,
getNewResColId(pCmd), 0, false); getNewResColId(pCmd), 0, false);
// if there are no columns, set the colId to the result column id // set the colId to the result column id
if (numOfCols == 0) {
pExpr->base.colInfo.colId = pExpr->base.resColId; pExpr->base.colInfo.colId = pExpr->base.resColId;
}
char* name = (pItem->aliasName != NULL)? pItem->aliasName:pItem->pNode->exprToken.z; char* name = (pItem->aliasName != NULL)? pItem->aliasName:pItem->pNode->exprToken.z;
size_t len = MIN(sizeof(pExpr->base.aliasName), pItem->pNode->exprToken.n + 1); size_t len = MIN(sizeof(pExpr->base.aliasName), pItem->pNode->exprToken.n + 1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册