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


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new 6a661ee49d4 [Bug](view) fix npe on create view with comment (#28189) 
(#28464)
6a661ee49d4 is described below

commit 6a661ee49d497af5e2c7cd697b10da17c590154b
Author: Pxl <[email protected]>
AuthorDate: Fri Dec 15 18:27:02 2023 +0800

    [Bug](view) fix npe on create view with comment (#28189) (#28464)
    
    fix npe on create view with comment
---
 .../src/main/java/org/apache/doris/analysis/CreateViewStmt.java      | 1 +
 regression-test/suites/query_p0/view/test_view2.groovy               | 5 +++++
 2 files changed, 6 insertions(+)

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 528b882f848..ec0cb3c9c27 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
@@ -74,6 +74,7 @@ public class CreateViewStmt extends BaseViewStmt {
         try {
             if (cols != null) {
                 cloneStmt = viewDefStmt.clone();
+                cloneStmt.forbiddenMVRewrite();
             }
 
             // Analyze view define statement
diff --git a/regression-test/suites/query_p0/view/test_view2.groovy 
b/regression-test/suites/query_p0/view/test_view2.groovy
index 55580faf20d..d28ad7f0ca8 100644
--- a/regression-test/suites/query_p0/view/test_view2.groovy
+++ b/regression-test/suites/query_p0/view/test_view2.groovy
@@ -72,6 +72,11 @@ suite("test_view2") {
     sql """sync"""
 
     sql """ DROP VIEW IF EXISTS rt_view;"""
+    sql """ DROP VIEW IF EXISTS tv;"""
+
+    sql """
+    create view tv (node comment "col node") as select node_name from tableA;
+    """
 
     sql """
     CREATE VIEW rt_view AS


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

Reply via email to