diff --git a/be/src/vec/exec/join/vhash_join_node.cpp b/be/src/vec/exec/join/vhash_join_node.cpp index aaa591c110..65615d4e62 100644 --- a/be/src/vec/exec/join/vhash_join_node.cpp +++ b/be/src/vec/exec/join/vhash_join_node.cpp @@ -367,7 +367,7 @@ Status HashJoinNode::pull(doris::RuntimeState* state, vectorized::Block* output_ (_join_op != TJoinOp::LEFT_ANTI_JOIN) && i < _right_output_slot_flags.size(); ++i) { auto type = remove_nullable(_right_table_data_types[i]); auto column = type->create_column(); - column->resize(block_rows); + column->insert_many_defaults(block_rows); auto null_map_column = ColumnVector::create(block_rows, 1); auto nullable_column = ColumnNullable::create(std::move(column), std::move(null_map_column)); diff --git a/regression-test/data/datatype_p0/decimalv3/fix-overflow.out b/regression-test/data/datatype_p0/decimalv3/fix-overflow.out new file mode 100644 index 0000000000..4bd52d46e4 --- /dev/null +++ b/regression-test/data/datatype_p0/decimalv3/fix-overflow.out @@ -0,0 +1,4 @@ +-- This file is automatically generated. You should know what you did if you want to edit this +-- !sql -- +1.1 \N \N + diff --git a/regression-test/suites/datatype_p0/decimalv3/fix-overflow.groovy b/regression-test/suites/datatype_p0/decimalv3/fix-overflow.groovy new file mode 100644 index 0000000000..7b8ef17007 --- /dev/null +++ b/regression-test/suites/datatype_p0/decimalv3/fix-overflow.groovy @@ -0,0 +1,34 @@ +// 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("fix-overflow") { + sql "set check_overflow_for_decimal=true;" + sql "drop table if exists fix_overflow_l;" + sql """ + create table fix_overflow_l(k1 decimalv3(38,1)) distributed by hash(k1) properties("replication_num"="1"); + """ + sql "drop table if exists fix_overflow_r;" + sql """ + create table fix_overflow_r(k1 decimalv3(38,1)) distributed by hash(k1) properties("replication_num"="1"); + """ + sql """ + insert into fix_overflow_l values(1.1); + """ + qt_sql """ + select l.k1, r.k1, l.k1 * r.k1 from fix_overflow_l l left join fix_overflow_r r on l.k1=r.k1; + """ +} diff --git a/regression-test/suites/datatype_p0/decimalv3/test_arithmetic_expressions.groovy b/regression-test/suites/datatype_p0/decimalv3/test_arithmetic_expressions.groovy index daf81e5e5f..5936cf29b4 100644 --- a/regression-test/suites/datatype_p0/decimalv3/test_arithmetic_expressions.groovy +++ b/regression-test/suites/datatype_p0/decimalv3/test_arithmetic_expressions.groovy @@ -17,6 +17,7 @@ suite("test_arithmetic_expressions") { + sql "set check_overflow_for_decimal=true;" sql "set enable_decimal256 = false;" sql "drop table if exists test_arithmetic_expressions"