Skip to content

Commit

Permalink
more valgrind fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lnkuiper committed Jul 11, 2024
1 parent b387767 commit 45c176e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
6 changes: 4 additions & 2 deletions src/common/types/row/tuple_data_scatter_gather.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void TupleDataCollection::ComputeHeapSizes(TupleDataChunkState &chunk_state, con
ResetCombinedListData(chunk_state.vector_data);

auto heap_sizes = FlatVector::GetData<idx_t>(chunk_state.heap_sizes);
std::fill_n(heap_sizes, new_chunk.size(), 0);
std::fill_n(heap_sizes, append_count, 0);

for (idx_t col_idx = 0; col_idx < new_chunk.ColumnCount(); col_idx++) {
auto &source_v = new_chunk.data[col_idx];
Expand Down Expand Up @@ -596,7 +596,9 @@ void TupleDataCollection::Scatter(TupleDataChunkState &chunk_state, const DataCh
const auto heap_sizes = FlatVector::GetData<idx_t>(chunk_state.heap_sizes);
const auto offset_heap_locations = FlatVector::GetData<data_ptr_t>(chunk_state.heap_locations);
for (idx_t i = 0; i < append_count; i++) {
D_ASSERT(offset_heap_locations[i] == original_heap_locations[i] + heap_sizes[i]);
if (heap_sizes[i] != 0) {
D_ASSERT(offset_heap_locations[i] == original_heap_locations[i] + heap_sizes[i]);
}
}
}
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/execution/expression_executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ static inline idx_t DefaultSelectLoop(const SelectionVector *bsel, const uint8_t
for (idx_t i = 0; i < count; i++) {
auto bidx = bsel->get_index(i);
auto result_idx = sel->get_index(i);
if (bdata[bidx] > 0 && (NO_NULL || mask.RowIsValid(bidx))) {
if ((NO_NULL || mask.RowIsValid(bidx)) && bdata[bidx] > 0) {
if (HAS_TRUE_SEL) {
true_sel->set_index(true_count++, result_idx);
}
Expand Down
7 changes: 2 additions & 5 deletions src/parallel/executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,6 @@ void Executor::VerifyScheduledEvents(const ScheduleEventData &event_data) {
void Executor::VerifyScheduledEventsInternal(const idx_t vertex, const vector<reference<Event>> &vertices,
vector<bool> &visited, vector<bool> &recursion_stack) {
D_ASSERT(!recursion_stack[vertex]); // this vertex is in the recursion stack: circular dependency!
if (recursion_stack[vertex]) {
throw InternalException("oops");
}
if (visited[vertex]) {
return; // early out: we already visited this vertex
}
Expand Down Expand Up @@ -678,8 +675,8 @@ bool Executor::GetPipelinesProgress(double &current_progress, uint64_t &current_
total_cardinality = 0;
current_cardinality = 0;
for (auto &pipeline : pipelines) {
double child_percentage = 0;
idx_t child_cardinality = 0;
double child_percentage;
idx_t child_cardinality;

if (!pipeline->GetProgress(child_percentage, child_cardinality)) {
return false;
Expand Down

0 comments on commit 45c176e

Please sign in to comment.