This is an automated email from the ASF dual-hosted git repository. morningman pushed a commit to branch branch-1.2-lts in repository https://gitbox.apache.org/repos/asf/doris.git
commit d2b67465865cff517a53bc68610832e5ef17b2f3 Author: Xin Liao <liaoxin...@126.com> AuthorDate: Sat Dec 24 15:27:43 2022 +0800 [fix](scan) fix that be may core dump when the predicates are all false (#15332) --- be/src/vec/exec/scan/vscan_node.cpp | 3 + .../correctness_p0/test_with_false_predicate.out | 8 +++ .../test_with_false_predicate.groovy | 64 ++++++++++++++++++++++ 3 files changed, 75 insertions(+) diff --git a/be/src/vec/exec/scan/vscan_node.cpp b/be/src/vec/exec/scan/vscan_node.cpp index e7953c3703..56f9aec91a 100644 --- a/be/src/vec/exec/scan/vscan_node.cpp +++ b/be/src/vec/exec/scan/vscan_node.cpp @@ -93,6 +93,9 @@ Status VScanNode::open(RuntimeState* state) { RETURN_IF_ERROR(_acquire_runtime_filter()); RETURN_IF_ERROR(_process_conjuncts()); + if (_eos) { + return Status::OK(); + } std::list<VScanner*> scanners; RETURN_IF_ERROR(_init_scanners(&scanners)); diff --git a/regression-test/data/correctness_p0/test_with_false_predicate.out b/regression-test/data/correctness_p0/test_with_false_predicate.out new file mode 100644 index 0000000000..5884eb2e3a --- /dev/null +++ b/regression-test/data/correctness_p0/test_with_false_predicate.out @@ -0,0 +1,8 @@ +-- This file is automatically generated. You should know what you did if you want to edit this +-- !sql -- +1 1 1 1 +2 2 2 2 +3 3 3 3 + +-- !sql -- + diff --git a/regression-test/suites/correctness_p0/test_with_false_predicate.groovy b/regression-test/suites/correctness_p0/test_with_false_predicate.groovy new file mode 100644 index 0000000000..ffa64f99fa --- /dev/null +++ b/regression-test/suites/correctness_p0/test_with_false_predicate.groovy @@ -0,0 +1,64 @@ +// 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("test_with_false_predicate") { + def tableName = "false_predicate_table" + + sql """ + DROP TABLE IF EXISTS $tableName + """ + + sql """ + CREATE TABLE IF NOT EXISTS `$tableName` ( + `k1` int NOT NULL, + `k2` int NOT NULL, + `k3` int NOT NULL, + `v1` int NOT NULL + ) ENGINE=OLAP + DUPLICATE KEY(`k1`, `k2`, `k3`) + COMMENT "OLAP" + DISTRIBUTED BY HASH(`k1`) BUCKETS 1 + PROPERTIES ( + "replication_allocation" = "tag.location.default: 1", + "in_memory" = "false", + "storage_format" = "V2" + ) + """ + + sql """ + INSERT INTO $tableName VALUES (1, 1, 1, 1); + """ + sql """ + INSERT INTO $tableName VALUES (2, 2, 2, 2); + """ + sql """ + INSERT INTO $tableName VALUES (3, 3, 3, 3); + """ + + sql " sync " + + qt_sql """ + select * from $tableName order by k1; + """ + + qt_sql """ + select k1, k2 from $tableName where BITMAP_EMPTY() is NULL order by k1; + """ + + sql " DROP TABLE $tableName " + +} --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org