This is an automated email from the ASF dual-hosted git repository. lihaopeng pushed a commit to branch branch-2.1 in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.1 by this push: new 25fb30c723b [fix](intersect) fix coredump caused by intersect of nullable and not nullable children #36401 (#36441) 25fb30c723b is described below commit 25fb30c723b1ad4255a2262752d95b80db2d7667 Author: TengJianPing <18241664+jackte...@users.noreply.github.com> AuthorDate: Wed Jun 26 17:45:21 2024 +0800 [fix](intersect) fix coredump caused by intersect of nullable and not nullable children #36401 (#36441) ## Proposed changes Pick #36765 --- be/src/vec/exec/vset_operation_node.cpp | 1 + .../sql/intersect_nullable_not_nullable.out | 19 +++ .../sql/intersect_nullable_not_nullable.groovy | 171 +++++++++++++++++++++ 3 files changed, 191 insertions(+) diff --git a/be/src/vec/exec/vset_operation_node.cpp b/be/src/vec/exec/vset_operation_node.cpp index 294ac58482a..afc3273f459 100644 --- a/be/src/vec/exec/vset_operation_node.cpp +++ b/be/src/vec/exec/vset_operation_node.cpp @@ -121,6 +121,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 new file mode 100644 index 00000000000..8728992c789 --- /dev/null +++ b/regression-test/data/query_p0/set_operations/sql/intersect_nullable_not_nullable.out @@ -0,0 +1,19 @@ +-- This file is automatically generated. You should know what you did if you want to edit this +-- !intersect_nullable_not_nullable_1 -- +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 new file mode 100644 index 00000000000..dbec73f3c4e --- /dev/null +++ b/regression-test/suites/query_p0/set_operations/sql/intersect_nullable_not_nullable.groovy @@ -0,0 +1,171 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +suite("intersect_nullable_not_nullable") { + sql """ + set experimental_enable_pipeline_x_engine = false; + """ + sql """ + set experimental_enable_pipeline_engine = false; + """ + sql """ + drop table if exists intersect_nullable_not_nullable_t1; + """ + sql """ + drop table if exists intersect_nullable_not_nullable_t2; + """ + sql """ + drop table if exists intersect_nullable_not_nullable_t3; + """ + sql """ + drop table if exists intersect_nullable_not_nullable_t4; + """ + sql """ + 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(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 (kkk0 int, kkk1 char(100) ) distributed by hash(kkk0) properties("replication_num"="1"); + """ + sql """ + insert into intersect_nullable_not_nullable_t3 values(1, "c"), (2, "d"), (3, "e"); + """ + + sql """ + 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"); + """ + + order_qt_intersect_nullable_not_nullable_1 """ + ( + select k1 from intersect_nullable_not_nullable_t1 + ) + intersect + ( + select distinct kk1 from intersect_nullable_not_nullable_t2 + ) + intersect + ( + ( + select kkk1 from intersect_nullable_not_nullable_t3 + ) + except + ( + select kkkk1 from intersect_nullable_not_nullable_t4 + ) + ); + """ + + order_qt_intersect_nullable_not_nullable_2 """ + ( + select k1 from intersect_nullable_not_nullable_t1 + ) + intersect + ( + ( + select kkk1 from intersect_nullable_not_nullable_t3 + ) + except + ( + select kkkk1 from intersect_nullable_not_nullable_t4 + ) + ) + intersect + ( + select distinct kk1 from intersect_nullable_not_nullable_t2 + ); + """ + + sql """ + set experimental_enable_pipeline_engine = true; + """ + sql """ + set experimental_enable_pipeline_x_engine = false; + """ + 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; + """ + sql """ + set experimental_enable_pipeline_x_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: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org