[fix](planner) createColumnAndViewDefs method use wrong analyzer (#25005)

This commit is contained in:
starocean999
2023-09-28 19:59:04 +08:00
committed by GitHub
parent 864a0f9bcb
commit 5dd70b8a25
2 changed files with 7 additions and 1 deletions

View File

@ -81,7 +81,7 @@ public class CreateViewStmt extends BaseViewStmt {
viewDefStmt.forbiddenMVRewrite();
viewDefStmt.analyze(viewAnalyzer);
createColumnAndViewDefs(analyzer);
createColumnAndViewDefs(viewAnalyzer);
} finally {
// must reset this flag, otherwise, all following query statement in this connection
// will not do constant fold for nondeterministic functions.

View File

@ -130,4 +130,10 @@ suite("view_p0") {
qt_sql2 "select * from test_vv1;"
sql "drop view if exists test_vv1;"
sql "drop view if exists test_view_abc;"
sql """CREATE VIEW IF NOT EXISTS `test_view_abc`(`a`) AS WITH T1 AS (SELECT 1 AS 'a'), T2 AS (SELECT 2 AS 'a') SELECT T1.a FROM T1 UNION ALL SELECT T2.a FROM T2;"""
sql "drop view if exists test_view_abc;"
}