未验证 提交 ff9345cd 编写于 作者: D dapan1121 提交者: GitHub

Merge pull request #19204 from taosdata/fix/TS-2334-2.6

fix: forbid input tbname in scalar expression if not nested query
...@@ -1941,7 +1941,9 @@ static int32_t handleScalarTypeExpr(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32 ...@@ -1941,7 +1941,9 @@ static int32_t handleScalarTypeExpr(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32
size_t numOfNode = taosArrayGetSize(colList); size_t numOfNode = taosArrayGetSize(colList);
for(int32_t k = 0; k < numOfNode; ++k) { for(int32_t k = 0; k < numOfNode; ++k) {
SColIndex* pIndex = taosArrayGet(colList, k); SColIndex* pIndex = taosArrayGet(colList, k);
if (TSDB_COL_IS_TAG(pIndex->flag)) {
if (TSDB_COL_IS_TAG(pIndex->flag) || (strcasecmp(pIndex->name, TSQL_TBNAME_L) == 0 && pQueryInfo->pUpstream &&
taosArrayGetSize(pQueryInfo->pUpstream) == 0)) {
tExprTreeDestroy(pNode, NULL); tExprTreeDestroy(pNode, NULL);
taosArrayDestroy(&colList); taosArrayDestroy(&colList);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册