mirror of
https://github.com/facebook/rocksdb.git
synced 2024-11-25 22:44:05 +00:00
Fix rocksdb->levledb BytewiseComparator and inverted order of error in db/version_set.cc
Summary: This is needed to make existing dbs be able to open and also because BytewiseComparator was not changed since leveldb. The inverted order in the error message caused confusion prebiously Test Plan: make; open existing db Reviewers: leveldb, dhruba Reviewed By: dhruba Differential Revision: https://reviews.facebook.net/D13449
This commit is contained in:
parent
fe3713961e
commit
da2fd001a6
|
@ -1430,9 +1430,9 @@ Status VersionSet::Recover() {
|
|||
if (s.ok()) {
|
||||
if (edit.has_comparator_ &&
|
||||
edit.comparator_ != icmp_.user_comparator()->Name()) {
|
||||
s = Status::InvalidArgument(
|
||||
edit.comparator_ + "does not match existing comparator ",
|
||||
icmp_.user_comparator()->Name());
|
||||
s = Status::InvalidArgument(icmp_.user_comparator()->Name(),
|
||||
"does not match existing comparator " +
|
||||
edit.comparator_);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1548,9 +1548,9 @@ Status VersionSet::DumpManifest(Options& options, std::string& dscname,
|
|||
if (s.ok()) {
|
||||
if (edit.has_comparator_ &&
|
||||
edit.comparator_ != icmp_.user_comparator()->Name()) {
|
||||
s = Status::InvalidArgument(
|
||||
edit.comparator_ + "does not match existing comparator ",
|
||||
icmp_.user_comparator()->Name());
|
||||
s = Status::InvalidArgument(icmp_.user_comparator()->Name(),
|
||||
"does not match existing comparator " +
|
||||
edit.comparator_);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ class BytewiseComparatorImpl : public Comparator {
|
|||
BytewiseComparatorImpl() { }
|
||||
|
||||
virtual const char* Name() const {
|
||||
return "rocksdb.BytewiseComparator";
|
||||
return "leveldb.BytewiseComparator";
|
||||
}
|
||||
|
||||
virtual int Compare(const Slice& a, const Slice& b) const {
|
||||
|
|
Loading…
Reference in a new issue