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

Merge pull request #8304 from taosdata/hotfix/TD-10630-2

[td-10630]add normaol/sub talbe join check
......@@ -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) {
......
......@@ -518,7 +518,7 @@ public class SQLTest {
@Test
public void testCase050() {
String sql = "select * from restful_test.t1, restful_test.t3 where t1.ts = t3.ts and t1.location = t3.location";
String sql = "select * from restful_test.t1, restful_test.t3 where t1.ts = t3.ts";
// when
ResultSet rs = executeQuery(connection, sql);
// then
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册