Fix compressed cache

main
Igor Canadi 10 years ago
parent d916593ead
commit 1614284eff
  1. 3
      table/block_based_table_builder.cc

@ -622,8 +622,9 @@ Status BlockBasedTableBuilder::InsertBlockInCache(const Slice& block_contents,
Cache::Handle* cache_handle = nullptr;
size_t size = block_contents.size();
char* ubuf = new char[size]; // make a new copy
char* ubuf = new char[size + 1]; // make a new copy
memcpy(ubuf, block_contents.data(), size);
ubuf[size] = type;
BlockContents results;
Slice sl(ubuf, size);

Loading…
Cancel
Save