提交 864530a1 编写于 作者: S shenglian zhou

limit nested levels to 16 and add test case

上级 7bf7dcdf
......@@ -1951,8 +1951,8 @@ static int32_t handleSQLExprItem(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t
return code;
}
if (height >= 16) {
return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), "the max height of expression must be less than 16");
if (height > 16) {
return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), "the max expression nested levels must be equal or less than 16");
}
if (sqlExprType == SQLEXPR_TYPE_SCALAR) {
......
......@@ -225,6 +225,7 @@ if $data90 != @-0.911130262@ then
return -1
endi
print ============== invalid expressions
$stb = st0
sql_error select agg(c1)+c2 from $stb
sql_error select agg(c1+2) from $stb
sql_error select agg(ceil(c1))+c2 from $stb
......@@ -235,8 +236,10 @@ sql_error select asin(c1) from $stb session_window(ts, 1s)
sql_error select cos(c1) from $stb state_window(f1)
sql_error select pow(c2,2) from $stb interval(1s) sliding(500a)
sql_error select pow(c2,2) from $stb state_window(f1)
sql_error select tan(f1) from $stb from d.st slimit 1
sql_error select f1+2, tbname from $stb group by tbname
sql_error select tan(c1) from $stb from d.st slimit 1
sql_error select c1+2, tbname from $stb group by tbname
sql select sin(sin(sin(sin(sin(sin(sin(sin(sin(sin(sin(sin(sin(sin(sin(sin(c1)))))))))))))))) from $stb
sql_error select sin(sin(sin(sin(sin(sin(sin(sin(sin(sin(sin(sin(sin(sin(sin(sin(sin(c1))))))))))))))))) from $stb
print =============== clear
sql drop database $db
sql show databases
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册