This is an automated email from the ASF dual-hosted git repository.

kxiao pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git

commit e1dfa47cf507193f0193f844038ca38d39717f33
Author: starocean999 <[email protected]>
AuthorDate: Thu Sep 28 19:59:04 2023 +0800

    [fix](planner) createColumnAndViewDefs method use wrong analyzer (#25005)
---
 .../src/main/java/org/apache/doris/analysis/CreateViewStmt.java     | 2 +-
 regression-test/suites/view_p0/view_p0.groovy                       | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/analysis/CreateViewStmt.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/CreateViewStmt.java
index 936f621fee..528b882f84 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/CreateViewStmt.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/CreateViewStmt.java
@@ -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.
diff --git a/regression-test/suites/view_p0/view_p0.groovy 
b/regression-test/suites/view_p0/view_p0.groovy
index cf55380a71..986fa6688c 100644
--- a/regression-test/suites/view_p0/view_p0.groovy
+++ b/regression-test/suites/view_p0/view_p0.groovy
@@ -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;" 
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to