Skip to content

CRITICAL: BTree key truncation to 7 bytes corrupts index #148

@poyrazK

Description

@poyrazK

Why is this an issue?

In src/storage/btree_index.cpp:71:

size_t len = std::min(s.size(), static_cast<size_t>(7));
std::memcpy(data, s.data(), len);

Text keys truncated to 7 bytes. Different strings compare as equal, causing wrong data returned.

What is causing it?

Fixed 8-byte key storage with silent truncation.

How can it be solved?

Implement variable-length keys.

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