forked from rust-rocksdb/rust-rocksdb
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from haizhi-tech/v0.21.0-haizhi-event-listener-…
…snapshot-fix fix column family export bug
- Loading branch information
Showing
29 changed files
with
115 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
use haizhi_rocksdb as rocksdb; | ||
use rocksdb::{DB, checkpoint::Checkpoint}; | ||
|
||
fn main() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
error[E0597]: `db` does not live long enough | ||
--> tests/fail/checkpoint_outlive_db.rs:6:25 | ||
--> tests/fail/checkpoint_outlive_db.rs:7:25 | ||
| | ||
4 | let _checkpoint = { | ||
5 | let _checkpoint = { | ||
| ----------- borrow later stored here | ||
5 | let db = DB::open_default("foo").unwrap(); | ||
6 | Checkpoint::new(&db) | ||
6 | let db = DB::open_default("foo").unwrap(); | ||
| -- binding `db` declared here | ||
7 | Checkpoint::new(&db) | ||
| ^^^ borrowed value does not live long enough | ||
7 | }; | ||
8 | }; | ||
| - `db` dropped here while still borrowed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
use haizhi_rocksdb as rocksdb; | ||
use rocksdb::{IteratorMode, DB}; | ||
|
||
fn main() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
error[E0597]: `db` does not live long enough | ||
--> tests/fail/iterator_outlive_db.rs:6:9 | ||
--> tests/fail/iterator_outlive_db.rs:7:9 | ||
| | ||
4 | let _iter = { | ||
5 | let _iter = { | ||
| ----- borrow later stored here | ||
5 | let db = DB::open_default("foo").unwrap(); | ||
6 | db.iterator(IteratorMode::Start) | ||
| ^^ borrowed value does not live long enough | ||
7 | }; | ||
6 | let db = DB::open_default("foo").unwrap(); | ||
| -- binding `db` declared here | ||
7 | db.iterator(IteratorMode::Start) | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ borrowed value does not live long enough | ||
8 | }; | ||
| - `db` dropped here while still borrowed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
use haizhi_rocksdb as rocksdb; | ||
use rocksdb::{SingleThreaded, DBWithThreadMode, Options}; | ||
|
||
fn main() { | ||
|
30 changes: 17 additions & 13 deletions
30
tests/fail/open_with_multiple_refs_as_single_threaded.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
error[E0596]: cannot borrow `*db_ref1` as mutable, as it is behind a `&` reference | ||
--> tests/fail/open_with_multiple_refs_as_single_threaded.rs:8:5 | ||
--> tests/fail/open_with_multiple_refs_as_single_threaded.rs:9:5 | ||
| | ||
9 | db_ref1.create_cf("cf1", &opts).unwrap(); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `db_ref1` is a `&` reference, so the data it refers to cannot be borrowed as mutable | ||
| | ||
help: consider changing this to be a mutable reference | ||
| | ||
5 | let db_ref1 = &db; | ||
| --- help: consider changing this to be a mutable reference: `&mut db` | ||
... | ||
8 | db_ref1.create_cf("cf1", &opts).unwrap(); | ||
| ^^^^^^^ `db_ref1` is a `&` reference, so the data it refers to cannot be borrowed as mutable | ||
6 | let db_ref1 = &mut db; | ||
| ~~~~~~~ | ||
|
||
error[E0596]: cannot borrow `*db_ref2` as mutable, as it is behind a `&` reference | ||
--> tests/fail/open_with_multiple_refs_as_single_threaded.rs:9:5 | ||
| | ||
6 | let db_ref2 = &db; | ||
| --- help: consider changing this to be a mutable reference: `&mut db` | ||
... | ||
9 | db_ref2.create_cf("cf2", &opts).unwrap(); | ||
| ^^^^^^^ `db_ref2` is a `&` reference, so the data it refers to cannot be borrowed as mutable | ||
--> tests/fail/open_with_multiple_refs_as_single_threaded.rs:10:5 | ||
| | ||
10 | db_ref2.create_cf("cf2", &opts).unwrap(); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `db_ref2` is a `&` reference, so the data it refers to cannot be borrowed as mutable | ||
| | ||
help: consider changing this to be a mutable reference | ||
| | ||
7 | let db_ref2 = &mut db; | ||
| ~~~~~~~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
use haizhi_rocksdb as rocksdb; | ||
use rocksdb::DB; | ||
|
||
fn main() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
error[E0597]: `db` does not live long enough | ||
--> tests/fail/snapshot_outlive_db.rs:6:9 | ||
--> tests/fail/snapshot_outlive_db.rs:7:9 | ||
| | ||
4 | let _snapshot = { | ||
5 | let _snapshot = { | ||
| --------- borrow later stored here | ||
5 | let db = DB::open_default("foo").unwrap(); | ||
6 | db.snapshot() | ||
| ^^ borrowed value does not live long enough | ||
7 | }; | ||
6 | let db = DB::open_default("foo").unwrap(); | ||
| -- binding `db` declared here | ||
7 | db.snapshot() | ||
| ^^^^^^^^^^^^^ borrowed value does not live long enough | ||
8 | }; | ||
| - `db` dropped here while still borrowed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
use haizhi_rocksdb as rocksdb; | ||
use rocksdb::{TransactionDB, SingleThreaded}; | ||
|
||
fn main() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
error[E0597]: `txn` does not live long enough | ||
--> tests/fail/snapshot_outlive_transaction.rs:7:9 | ||
--> tests/fail/snapshot_outlive_transaction.rs:8:9 | ||
| | ||
5 | let _snapshot = { | ||
6 | let _snapshot = { | ||
| --------- borrow later stored here | ||
6 | let txn = db.transaction(); | ||
7 | txn.snapshot() | ||
7 | let txn = db.transaction(); | ||
| --- binding `txn` declared here | ||
8 | txn.snapshot() | ||
| ^^^^^^^^^^^^^^ borrowed value does not live long enough | ||
8 | }; | ||
9 | }; | ||
| - `txn` dropped here while still borrowed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
use haizhi_rocksdb as rocksdb; | ||
use rocksdb::{TransactionDB, SingleThreaded}; | ||
|
||
fn main() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
error[E0597]: `db` does not live long enough | ||
--> tests/fail/snapshot_outlive_transaction_db.rs:6:9 | ||
--> tests/fail/snapshot_outlive_transaction_db.rs:7:9 | ||
| | ||
4 | let _snapshot = { | ||
5 | let _snapshot = { | ||
| --------- borrow later stored here | ||
5 | let db = TransactionDB::<SingleThreaded>::open_default("foo").unwrap(); | ||
6 | db.snapshot() | ||
6 | let db = TransactionDB::<SingleThreaded>::open_default("foo").unwrap(); | ||
| -- binding `db` declared here | ||
7 | db.snapshot() | ||
| ^^^^^^^^^^^^^ borrowed value does not live long enough | ||
7 | }; | ||
8 | }; | ||
| - `db` dropped here while still borrowed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
use haizhi_rocksdb as rocksdb; | ||
use rocksdb::{TransactionDB, SingleThreaded}; | ||
|
||
fn main() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
error[E0597]: `db` does not live long enough | ||
--> tests/fail/transaction_outlive_transaction_db.rs:6:9 | ||
--> tests/fail/transaction_outlive_transaction_db.rs:7:9 | ||
| | ||
4 | let _txn = { | ||
5 | let _txn = { | ||
| ---- borrow later stored here | ||
5 | let db = TransactionDB::<SingleThreaded>::open_default("foo").unwrap(); | ||
6 | db.transaction() | ||
6 | let db = TransactionDB::<SingleThreaded>::open_default("foo").unwrap(); | ||
| -- binding `db` declared here | ||
7 | db.transaction() | ||
| ^^^^^^^^^^^^^^^^ borrowed value does not live long enough | ||
7 | }; | ||
8 | }; | ||
| - `db` dropped here while still borrowed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
use haizhi_rocksdb as rocksdb; | ||
|
||
use rocksdb::{Options, DB}; | ||
use std::cmp::Ordering; | ||
use std::iter::FromIterator; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.