Skip to content

CRITICAL: Iterator invalidation - deleted tuples returned #149

@poyrazK

Description

@poyrazK

Why is this an issue?

In src/executor/plan.cpp:144-155:

while (current_page_ <= table_.num_pages_) {
    if (table_.get_tuple_at(current_page_, current_slot_, out_tuple)) {
        current_slot_++;
        return true;  // Returns deleted tuple!

get_tuple_at returns false for deleted slots but iterator still advances pages and may return stale data.

What is causing it?

No check for deleted slots before returning tuple.

How can it be solved?

Check slot length > 0 before returning.

Category

  • Small
  • Medium
  • Large
  • Critical

Severity

  • Low
  • Medium
  • High
  • Critical

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions