[fix](update) Fix where clause is not reanalyzed after rewrite (#11723)

This commit is contained in:
Zhengguo Yang
2022-08-15 13:24:57 +08:00
committed by GitHub
parent 805c13aaa1
commit 910d51c76f
3 changed files with 8 additions and 0 deletions

View File

@ -200,6 +200,8 @@ public class UpdateStmt extends DdlStmt {
}
whereExpr.analyze(analyzer);
whereExpr = analyzer.getExprRewriter().rewrite(whereExpr, analyzer, ExprRewriter.ClauseType.WHERE_CLAUSE);
whereExpr.reset();
whereExpr.analyze(analyzer);
if (!whereExpr.getType().equals(Type.BOOLEAN)) {
throw new AnalysisException("Where clause is not a valid statement return bool");
}