Skip to content

Commit a7b4b74

Browse files
added a fix for the bug with the range
Signed-off-by: limbooverlambda <[email protected]>
1 parent 6b40932 commit a7b4b74

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ prometheus = ["prometheus/push", "prometheus/process"]
1414
# Enable integration tests with a running TiKV and PD instance.
1515
# Use $PD_ADDRS, comma separated, to set the addresses the tests use.
1616
integration-tests = []
17-
protobuf-codec = []
1817

1918
[lib]
2019
name = "tikv_client"

src/raw/client.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ impl<PdC: PdClient> Client<PdC> {
759759
});
760760
}
761761
let backoff = DEFAULT_STORE_BACKOFF;
762-
let range = range.into().encode_keyspace(self.keyspace, KeyMode::Raw);
762+
let mut range = range.into().encode_keyspace(self.keyspace, KeyMode::Raw);
763763
let mut result = Vec::new();
764764
let mut current_limit = limit;
765765
let (start_key, end_key) = range.clone().into_keys();
@@ -788,6 +788,7 @@ impl<PdC: PdClient> Client<PdC> {
788788
break;
789789
} else {
790790
current_key = next_key;
791+
range = BoundRange::new(std::ops::Bound::Included(current_key.clone()), range.to);
791792
}
792793
}
793794

@@ -805,7 +806,6 @@ impl<PdC: PdClient> Client<PdC> {
805806
mut scan_args: ScanInnerArgs,
806807
) -> Result<(Option<RawScanResponse>, Key)> {
807808
let start_key = scan_args.start_key;
808-
809809
loop {
810810
let region = self.rpc.clone().region_for_key(&start_key).await?;
811811
let store = self.rpc.clone().store_for_id(region.id()).await?;

0 commit comments

Comments
 (0)