fix: multi-rows function validity check
This commit is contained in:
parent
d99b682f76
commit
52327cc2fb
|
@ -1058,8 +1058,9 @@ static int32_t translateAggFunc(STranslateContext* pCxt, SFunctionNode* pFunc) {
|
||||||
if (hasInvalidFuncNesting(pFunc->pParameterList)) {
|
if (hasInvalidFuncNesting(pFunc->pParameterList)) {
|
||||||
return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_AGG_FUNC_NESTING);
|
return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_AGG_FUNC_NESTING);
|
||||||
}
|
}
|
||||||
if (!isSelectStmt(pCxt->pCurrStmt) || ((SSelectStmt*)pCxt->pCurrStmt)->hasIndefiniteRowsFunc ||
|
// The auto-generated COUNT function in the DELETE statement is legal
|
||||||
((SSelectStmt*)pCxt->pCurrStmt)->hasMultiRowsFunc) {
|
if (isSelectStmt(pCxt->pCurrStmt) &&
|
||||||
|
(((SSelectStmt*)pCxt->pCurrStmt)->hasIndefiniteRowsFunc || ((SSelectStmt*)pCxt->pCurrStmt)->hasMultiRowsFunc)) {
|
||||||
return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_NOT_ALLOWED_FUNC);
|
return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_NOT_ALLOWED_FUNC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -335,7 +335,7 @@ class TDTestCase:
|
||||||
# tdSql.checkRows(21)
|
# tdSql.checkRows(21)
|
||||||
|
|
||||||
# group by
|
# group by
|
||||||
tdSql.query("select statecount(c1,'GT',1) from ct1 group by c1")
|
tdSql.error("select statecount(c1,'GT',1) from ct1 group by c1")
|
||||||
tdSql.error("select statecount(c1,'GT',1) from ct1 group by tbname")
|
tdSql.error("select statecount(c1,'GT',1) from ct1 group by tbname")
|
||||||
|
|
||||||
# super table
|
# super table
|
||||||
|
|
Loading…
Reference in New Issue