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

lihaopeng 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 7bd3b7be00b [fix](set) fix coredump caused by intersect of nullable 
and not nullable children (#36765)
7bd3b7be00b is described below

commit 7bd3b7be00b2004d007f5644e945dc2f090d0dc5
Author: TengJianPing <[email protected]>
AuthorDate: Tue Jun 25 14:16:24 2024 +0800

    [fix](set) fix coredump caused by intersect of nullable and not nullable 
children (#36765)
---
 be/src/vec/exec/vset_operation_node.cpp            |  1 +
 .../sql/intersect_nullable_not_nullable.out        | 12 +++
 .../sql/intersect_nullable_not_nullable.groovy     | 85 +++++++++++++++++++---
 3 files changed, 86 insertions(+), 12 deletions(-)

diff --git a/be/src/vec/exec/vset_operation_node.cpp 
b/be/src/vec/exec/vset_operation_node.cpp
index 8e30a3eb5f8..0db5ce4050d 100644
--- a/be/src/vec/exec/vset_operation_node.cpp
+++ b/be/src/vec/exec/vset_operation_node.cpp
@@ -242,6 +242,7 @@ Status VSetOperationNode<is_intersect>::open(RuntimeState* 
state) {
         RETURN_IF_ERROR(child(i)->open(state));
         eos = false;
 
+        _probe_block.clear();
         while (!eos) {
             release_block_memory(_probe_block, i);
             RETURN_IF_CANCELLED(state);
diff --git 
a/regression-test/data/query_p0/set_operations/sql/intersect_nullable_not_nullable.out
 
b/regression-test/data/query_p0/set_operations/sql/intersect_nullable_not_nullable.out
index 33e6f39096c..8728992c789 100644
--- 
a/regression-test/data/query_p0/set_operations/sql/intersect_nullable_not_nullable.out
+++ 
b/regression-test/data/query_p0/set_operations/sql/intersect_nullable_not_nullable.out
@@ -5,3 +5,15 @@ c
 -- !intersect_nullable_not_nullable_2 --
 c
 
+-- !intersect_nullable_not_nullable_3 --
+a
+
+-- !intersect_nullable_not_nullable_4 --
+a
+
+-- !intersect_nullable_not_nullable_5 --
+a
+
+-- !intersect_nullable_not_nullable_6 --
+a
+
diff --git 
a/regression-test/suites/query_p0/set_operations/sql/intersect_nullable_not_nullable.groovy
 
b/regression-test/suites/query_p0/set_operations/sql/intersect_nullable_not_nullable.groovy
index 2b355db1c13..80d088ff168 100644
--- 
a/regression-test/suites/query_p0/set_operations/sql/intersect_nullable_not_nullable.groovy
+++ 
b/regression-test/suites/query_p0/set_operations/sql/intersect_nullable_not_nullable.groovy
@@ -29,28 +29,28 @@ suite("intersect_nullable_not_nullable") {
     drop table if exists intersect_nullable_not_nullable_t4; 
     """
     sql """
-    create table intersect_nullable_not_nullable_t1 (k1 char(16) not null) 
distributed by hash(k1) properties("replication_num"="1");
+    create table intersect_nullable_not_nullable_t1 (k1 char(255) not null) 
distributed by hash(k1) properties("replication_num"="1");
     """
     sql """
     insert into intersect_nullable_not_nullable_t1 values("a"), ("b"), ("c"), 
("d"), ("e");
     """
     
     sql """
-    create table intersect_nullable_not_nullable_t2 (kk0 int, kk1 char(16) not 
null) distributed by hash(kk0) properties("replication_num"="1");
+    create table intersect_nullable_not_nullable_t2 (kk0 int, kk1 char(100) 
not null) distributed by hash(kk0) properties("replication_num"="1");
     """
     sql """
     insert into intersect_nullable_not_nullable_t2 values(1, "b"), (2, "c"), 
(3, "d"), (4, "e");
     """
     
     sql """
-    create table intersect_nullable_not_nullable_t3 (kkk1 char(16) ) 
distributed by hash(kkk1) properties("replication_num"="1");
+    create table intersect_nullable_not_nullable_t3 (kkk0 int, kkk1 char(100) 
) distributed by hash(kkk0) properties("replication_num"="1");
     """
     sql """
-    insert into intersect_nullable_not_nullable_t3 values("c"), ("d"), ("e");
+    insert into intersect_nullable_not_nullable_t3 values(1, "c"), (2, "d"), 
(3, "e");
     """
     
     sql """
-    create table intersect_nullable_not_nullable_t4 (kkkk1 char(16) ) 
distributed by hash(kkkk1) properties("replication_num"="1");
+    create table intersect_nullable_not_nullable_t4 (kkkk1 char(100) ) 
distributed by hash(kkkk1) properties("replication_num"="1");
     """
     sql """
     insert into intersect_nullable_not_nullable_t4 values("d"), ("e");
@@ -58,7 +58,7 @@ suite("intersect_nullable_not_nullable") {
     
     order_qt_intersect_nullable_not_nullable_1 """
         (
-            select * from intersect_nullable_not_nullable_t1
+            select k1 from intersect_nullable_not_nullable_t1
         )
         intersect
         (
@@ -67,27 +67,27 @@ suite("intersect_nullable_not_nullable") {
         intersect
         (
             (
-                select * from intersect_nullable_not_nullable_t3
+                select kkk1 from intersect_nullable_not_nullable_t3
             )
             except
             (
-                select * from intersect_nullable_not_nullable_t4
+                select kkkk1 from intersect_nullable_not_nullable_t4
             )
         );
     """
     
     order_qt_intersect_nullable_not_nullable_2 """
         (
-            select * from intersect_nullable_not_nullable_t1
+            select k1 from intersect_nullable_not_nullable_t1
         )
         intersect
         (
             (
-                select * from intersect_nullable_not_nullable_t3
+                select kkk1 from intersect_nullable_not_nullable_t3
             )
             except
             (
-                select * from intersect_nullable_not_nullable_t4
+                select kkkk1 from intersect_nullable_not_nullable_t4
             )
         )
         intersect
@@ -95,4 +95,65 @@ suite("intersect_nullable_not_nullable") {
             select distinct kk1 from intersect_nullable_not_nullable_t2
         );
     """
-}
+
+    sql """
+    set experimental_enable_pipeline_engine = true;
+    """
+    order_qt_intersect_nullable_not_nullable_3 """
+        (
+            select * from intersect_nullable_not_nullable_t1
+        )
+        except
+        (
+            select distinct kk1 from intersect_nullable_not_nullable_t2
+        )
+        except
+        (
+            select distinct kkk1 from intersect_nullable_not_nullable_t3
+        );
+    """
+    order_qt_intersect_nullable_not_nullable_4 """
+        (
+            select * from intersect_nullable_not_nullable_t1
+        )
+        except
+        (
+            select distinct kkk1 from intersect_nullable_not_nullable_t3
+        )
+        except
+        (
+            select distinct kk1 from intersect_nullable_not_nullable_t2
+        );
+    """
+
+    sql """
+    set experimental_enable_pipeline_engine = false;
+    """
+    order_qt_intersect_nullable_not_nullable_5 """
+        (
+            select * from intersect_nullable_not_nullable_t1
+        )
+        except
+        (
+            select distinct kk1 from intersect_nullable_not_nullable_t2
+        )
+        except
+        (
+            select distinct kkk1 from intersect_nullable_not_nullable_t3
+        );
+    """
+    order_qt_intersect_nullable_not_nullable_6 """
+        (
+            select * from intersect_nullable_not_nullable_t1
+        )
+        except
+        (
+            select distinct kkk1 from intersect_nullable_not_nullable_t3
+        )
+        except
+        (
+            select distinct kk1 from intersect_nullable_not_nullable_t2
+        );
+    """
+
+}
\ No newline at end of file


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

Reply via email to