From 6c4dd1037e406e844f92d81f9f15aabec72bcd22 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Fri, 15 Oct 2021 16:43:25 +0800 Subject: [PATCH] [TD-10630]add child/normal table join check --- src/client/src/tscSQLParser.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 34603dcaaf..8dfb7f6bb7 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -4893,6 +4893,7 @@ static int32_t validateJoinExpr(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SCondExpr const char* msg1 = "super table join requires tags column"; const char* msg2 = "timestamp join condition missing"; const char* msg3 = "condition missing for join query"; + const char* msg4 = "only ts column join allowed"; if (!QUERY_IS_JOIN_QUERY(pQueryInfo->type)) { if (pQueryInfo->numOfTables == 1) { @@ -4910,6 +4911,8 @@ static int32_t validateJoinExpr(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SCondExpr if (pCondExpr->pJoinExpr == NULL) { return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg1); } + } else if ((!UTIL_TABLE_IS_SUPER_TABLE(pTableMetaInfo)) && pCondExpr->pJoinExpr) { + return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg4); } if (!pCondExpr->tsJoin) { -- GitLab