Skip to content

Commit

Permalink
🐛 Fix wrong ColumnIDs
Browse files Browse the repository at this point in the history
  • Loading branch information
janetzki committed Aug 14, 2019
1 parent d040b83 commit 7587361
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/lib/logical_query_plan/union_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,7 @@ const std::vector<std::shared_ptr<AbstractExpression>>& UnionNode::column_expres
bool UnionNode::is_column_nullable(const ColumnID column_id) const {
Assert(left_input() && right_input(), "Need both inputs to determine nullability");

const auto left_input_column_count = left_input()->column_expressions().size();
if (static_cast<size_t>(column_id) >= left_input_column_count) {
return left_input()->is_column_nullable(column_id);
} else {
const auto right_column_id =
static_cast<ColumnID>(column_id - static_cast<ColumnID::base_type>(left_input_column_count));
return left_input()->is_column_nullable(right_column_id);
}
return left_input()->is_column_nullable(column_id) || right_input()->is_column_nullable(column_id);
}

std::shared_ptr<AbstractLQPNode> UnionNode::_on_shallow_copy(LQPNodeMapping& node_mapping) const {
Expand Down

0 comments on commit 7587361

Please sign in to comment.