Skip to content

Add Snappy support for windows #11

@mikhail-khalizev

Description

@mikhail-khalizev

Native library leveldb compiled without Snappy.
As result when you open existence leveldb database, which is used Snappy, corrupted compressed block contents error occurs.
So my suggestion to add Snappy support!

format.cc:

    case kSnappyCompression: {
      size_t ulength = 0;
      if (!port::Snappy_GetUncompressedLength(data, n, &ulength)) {          
        delete[] buf;
        return Status::Corruption("corrupted compressed block contents");   // <--- Always error
      }

port_win.h:

inline bool Snappy_GetUncompressedLength(const char* input, size_t length,
                                         size_t* result) {
#ifdef SNAPPY
  return snappy::GetUncompressedLength(input, length, result);
#else
  return false;     // <-- always false
#endif
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions