Fix the interface of special-key-space, only keys in (\xff\xff, \xff\xff\xff) are valid

This commit is contained in:
chaoguang 2020-04-28 16:33:10 -07:00
parent b011efa8df
commit 562456028c
1 changed files with 2 additions and 2 deletions

View File

@ -1230,7 +1230,7 @@ Future< Optional<Value> > ReadYourWritesTransaction::get( const Key& key, bool s
}
// special key space are only allowed to query if both begin and end start with \xff\xff
if (key.startsWith(specialKeys.begin))
if (specialKeys.contains(key))
return getDatabase()->specialKeySpace->get(Reference<ReadYourWritesTransaction>::addRef(this), key);
if(checkUsedDuringCommit()) {
@ -1285,7 +1285,7 @@ Future< Standalone<RangeResultRef> > ReadYourWritesTransaction::getRange(
}
// special key space are only allowed to query if both begin and end start with \xff\xff
if (begin.getKey().startsWith(specialKeys.begin) && end.getKey().startsWith(specialKeys.begin))
if (specialKeys.contains(begin.getKey()) && specialKeys.contains(end.getKey()))
return getDatabase()->specialKeySpace->getRange(Reference<ReadYourWritesTransaction>::addRef(this), begin, end,
limits, reverse);