From a9a2df49402e4badffae104574bc29330bcc02f9 Mon Sep 17 00:00:00 2001 From: Jung-Sang Ahn Date: Tue, 5 Nov 2024 16:29:35 -0800 Subject: [PATCH] Fix to bug in `setSingle` * `readInternalMeta` should use the raw meta (from `doc`). --- include/libjungle/sized_buf.h | 1 + src/generic_bitmap.h | 1 + src/table_file.cc | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/libjungle/sized_buf.h b/include/libjungle/sized_buf.h index 6d15558..d849ba4 100644 --- a/include/libjungle/sized_buf.h +++ b/include/libjungle/sized_buf.h @@ -16,6 +16,7 @@ limitations under the License. #pragma once +#include #include #include #include diff --git a/src/generic_bitmap.h b/src/generic_bitmap.h index 0b277bf..4a0fbfa 100644 --- a/src/generic_bitmap.h +++ b/src/generic_bitmap.h @@ -20,6 +20,7 @@ limitations under the License. #pragma once +#include #include #include diff --git a/src/table_file.cc b/src/table_file.cc index 26231c9..e35f832 100644 --- a/src/table_file.cc +++ b/src/table_file.cc @@ -903,7 +903,7 @@ Status TableFile::setSingle(uint32_t key_hash_val, // Immediate purging option, // only for the bottom-most non-zero level. InternalMeta i_meta_from_rec; - readInternalMeta(rec.meta, i_meta_from_rec); + readInternalMeta(SizedBuf(doc.metalen, doc.meta), i_meta_from_rec); if (i_meta_from_rec.isTombstone || force_delete) { fs = fdb_del(kvs_db, &doc); deletion_executed = true;