提交 ee41fe56 编写于 作者: S shenglian zhou

modify the tSqlExpr node type to expr for jsontag->key

上级 04527c32
......@@ -2196,7 +2196,7 @@ int32_t validateSelectNodeList(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SArray* pS
}
int32_t type = pItem->pNode->type;
if (type == SQL_NODE_EXPR) {
if (type == SQL_NODE_EXPR && pItem->pNode->tokenId != TK_ARROW) {
int32_t code = handleSQLExprItem(pCmd, pQueryInfo, i, pItem);
if (code != TSDB_CODE_SUCCESS) {
return code;
......@@ -2236,7 +2236,8 @@ int32_t validateSelectNodeList(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SArray* pS
return TSDB_CODE_TSC_INVALID_OPERATION;
}
}
} else if (type == SQL_NODE_TABLE_COLUMN || type == SQL_NODE_VALUE) {
} else if (type == SQL_NODE_TABLE_COLUMN || type == SQL_NODE_VALUE ||
(type == SQL_NODE_EXPR && pItem->pNode->tokenId == TK_ARROW)) {
// use the dynamic array list to decide if the function is valid or not
// select table_name1.field_name1, table_name2.field_name2 from table_name1, table_name2
if (addProjectionExprAndResultField(pCmd, pQueryInfo, pItem, outerQuery) != TSDB_CODE_SUCCESS) {
......@@ -4671,10 +4672,6 @@ static int32_t validateSQLExprItem(SSqlCmd* pCmd, tSqlExpr* pExpr,
} else if (pExpr->type == SQL_NODE_TABLE_COLUMN) {
SColumnIndex index = COLUMN_INDEX_INITIALIZER;
if (pExpr->tokenId == TK_ARROW) {
pExpr = pExpr->pLeft;
}
if (getColumnIndexByName(&pExpr->columnName, pQueryInfo, &index, tscGetErrorMsgPayload(pCmd)) !=
TSDB_CODE_SUCCESS) {
return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg1);
......
......@@ -418,7 +418,7 @@ tSqlExpr *tSqlExprCreate(tSqlExpr *pLeft, tSqlExpr *pRight, int32_t optrType) {
pExpr->tokenId = optrType;
pExpr->pLeft = pLeft;
pExpr->pRight = pRight;
pExpr->type = SQL_NODE_TABLE_COLUMN;
pExpr->type = SQL_NODE_EXPR;
} else {
pExpr->tokenId = optrType;
pExpr->pLeft = pLeft;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册