Skip to content

Commit

Permalink
[Bug](fix) fix coredump case in (not null, null) execpt (not null, no…
Browse files Browse the repository at this point in the history
…t null) case (#38760)
  • Loading branch information
HappenLee authored Aug 2, 2024
1 parent f317ccf commit a69f451
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 4 additions & 2 deletions be/src/vec/exec/vset_operation_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -597,8 +597,10 @@ Status VSetOperationNode<is_intersect>::extract_build_column(Block& block,
block.get_by_position(result_col_id).column =
block.get_by_position(result_col_id).column->convert_to_full_column_if_const();
if (_build_not_ignore_null[i]) {
block.get_by_position(result_col_id).column =
make_nullable(block.get_by_position(result_col_id).column);
auto column_ptr = make_nullable(block.get_by_position(result_col_id).column, false);
block.insert(
{column_ptr, make_nullable(block.get_by_position(result_col_id).type), ""});
result_col_id = block.columns() - 1;
}
raw_ptrs[i] = block.get_by_position(result_col_id).column.get();
DCHECK_GE(result_col_id, 0);
Expand Down
2 changes: 2 additions & 0 deletions regression-test/data/query_p0/except/test_query_except.out
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@
14
15

-- !select_except2 --

Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@ suite("test_query_except") {
SELECT * FROM (SELECT k1 FROM test_query_db.baseall
EXCEPT SELECT k1 FROM test_query_db.test) a ORDER BY k1
"""
qt_select_except2 """
select not_null_k1, not_null_k1 from (SELECT non_nullable(k1) as not_null_k1 FROM test_query_db.baseall where k1 is not null) b1 except select non_nullable(k1), k1 from test_query_db.baseall where k1 is not null order by 1, 2;
"""
}

0 comments on commit a69f451

Please sign in to comment.