Merge with master and update changelog

master
Oleksandr Anyshchenko 5 years ago
parent 165178989f
commit a05151f6ae
  1. 1
      CHANGELOG.md
  2. 12
      src/db.rs
  3. 1
      src/lib.rs
  4. 2
      tests/test_db.rs
  5. 14
      tests/test_multithreaded.rs

@ -10,6 +10,7 @@
* Added `Sync` and `Send` implementations to `Snapshot` (pavel-mukhanov)
* Added `raw_iterator_cf_opt` to the DB API (rnarubin)
* Added `DB::latest_sequence_number` method (vitvakatu)
* Changed column families storing (aleksuss)
## 0.12.2 (2019-05-03)

@ -1825,13 +1825,11 @@ impl ReadOptions {
/// that this [`ReadOptions`] value does not leave the scope too early (e.g. `DB::iterator_cf_opt`).
pub unsafe fn set_iterate_upper_bound<K: AsRef<[u8]>>(&mut self, key: K) {
let key = key.as_ref();
unsafe {
ffi::rocksdb_readoptions_set_iterate_upper_bound(
self.inner,
key.as_ptr() as *const c_char,
key.len() as size_t,
);
}
ffi::rocksdb_readoptions_set_iterate_upper_bound(
self.inner,
key.as_ptr() as *const c_char,
key.len() as size_t,
);
}
pub fn set_prefix_same_as_start(&mut self, v: bool) {

@ -330,5 +330,4 @@ mod test {
is_sync::<PlainTableFactoryOptions>();
is_sync::<ColumnFamilyDescriptor>();
}
}

@ -247,7 +247,7 @@ fn test_sequence_number() {
{
let db = DB::open_default(&path).unwrap();
assert_eq!(db.latest_sequence_number(), 0);
db.put(b"key", b"value");
let _ = db.put(b"key", b"value");
assert_eq!(db.latest_sequence_number(), 1);
}
}

@ -48,19 +48,19 @@ pub fn test_multithreaded() {
let db3 = db.clone();
let j3 = thread::spawn(move || {
for _ in 1..N {
match db3.get(b"key") {
let result = match db3.get(b"key") {
Ok(Some(v)) => {
if &v[..] != b"value1" && &v[..] != b"value2" {
assert!(false);
false
} else {
true
}
}
_ => {
assert!(false);
}
}
_ => false,
};
assert!(result);
}
});
j1.join().unwrap();
j2.join().unwrap();
j3.join().unwrap();

Loading…
Cancel
Save