leveldb icon indicating copy to clipboard operation
leveldb copied to clipboard

Incorrect comments about key length in MemTable

Open Xuecmbm opened this issue 4 months ago • 2 comments

  1. ​​Incorrect comment in MemTable::Get​​
// entry format is:
//    klength  varint32
//    userkey  char[klength]   // ← Problem here
//    tag      uint64
//    vlength  varint32
//    value    char[vlength]

Fix: userkey char[klength - 8].

  1. ​​Incorrect comment in MemTable::Add​​
  // Format of an entry is concatenation of:
  //  key_size     : varint32 of internal_key.size()
  //  key bytes    : char[internal_key.size()]   // ← Problem here
  //  tag          : uint64((sequence << 8) | type)
  //  value_size   : varint32 of value.size()
  //  value bytes  : char[value.size()]

Fix: key bytes : char[key.size()] .

Xuecmbm avatar Aug 19 '25 11:08 Xuecmbm

Hi, I'd like to work on this issue. Can you please assign it to me?

iamryuzaki7 avatar Sep 27 '25 02:09 iamryuzaki7