Skip to content

Commit e1dfa47

Browse files
starocean999xiaokang
authored andcommitted
[fix](planner) createColumnAndViewDefs method use wrong analyzer (#25005)
1 parent 71c69d9 commit e1dfa47

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

fe/fe-core/src/main/java/org/apache/doris/analysis/CreateViewStmt.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public void analyze(Analyzer analyzer) throws UserException {
8181
viewDefStmt.forbiddenMVRewrite();
8282
viewDefStmt.analyze(viewAnalyzer);
8383

84-
createColumnAndViewDefs(analyzer);
84+
createColumnAndViewDefs(viewAnalyzer);
8585
} finally {
8686
// must reset this flag, otherwise, all following query statement in this connection
8787
// will not do constant fold for nondeterministic functions.

regression-test/suites/view_p0/view_p0.groovy

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,10 @@ suite("view_p0") {
130130
qt_sql2 "select * from test_vv1;"
131131

132132
sql "drop view if exists test_vv1;"
133+
134+
sql "drop view if exists test_view_abc;"
135+
136+
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;"""
137+
138+
sql "drop view if exists test_view_abc;"
133139
}

0 commit comments

Comments
 (0)