• S
    WriteBatchWithIndex's Iterator bug of SeekToFirst() and SeekToLast() · 5cc9adf5
    sdong 提交于
    Summary: WriteBatchWithIndex's iterator's SeekToFirst() and SeekToLast() use offset=0 to indicate it is smaller than all the keys, which is wrong. offset=0 will decode a key "" (the header decodes like that). It could be larger than other keys in non-default comparators. Fix it by using a special flag of offset to indicate searching to the beginning of the CF.
    
    Test Plan: Add a unit test that used to fail. Also, add some more tests to related cases, though they don't fail for now.
    
    Reviewers: igor
    
    Reviewed By: igor
    
    Subscribers: rven, yhchiang, ljin, leveldb
    
    Differential Revision: https://reviews.facebook.net/D24873
    5cc9adf5
write_batch_with_index.cc 20.8 KB