Use hexadecimal u8 values when altering datastore keys

This commit is contained in:
Tobie Morgan Hitchcock 2022-03-16 17:01:25 +00:00
parent 336b2b92fc
commit 60c05ee082
3 changed files with 6 additions and 6 deletions

View file

@ -135,7 +135,7 @@ impl Table {
txn.clone().lock().await.scan(min..max, 1000).await? txn.clone().lock().await.scan(min..max, 1000).await?
} }
Some(ref mut beg) => { Some(ref mut beg) => {
beg.push(0); beg.push(0x00);
let min = beg.clone(); let min = beg.clone();
let max = end.encode()?; let max = end.encode()?;
txn.clone().lock().await.scan(min..max, 1000).await? txn.clone().lock().await.scan(min..max, 1000).await?

View file

@ -138,7 +138,7 @@ impl Table {
txn.clone().lock().await.scan(min..max, 1000).await? txn.clone().lock().await.scan(min..max, 1000).await?
} }
Some(ref mut beg) => { Some(ref mut beg) => {
beg.push(0); beg.push(0x00);
let min = beg.clone(); let min = beg.clone();
let max = end.encode()?; let max = end.encode()?;
txn.clone().lock().await.scan(min..max, 1000).await? txn.clone().lock().await.scan(min..max, 1000).await?

View file

@ -183,7 +183,7 @@ impl Transaction {
self.scan(min..max, num).await? self.scan(min..max, num).await?
} }
Some(ref mut beg) => { Some(ref mut beg) => {
beg.push(0); beg.push(0x00);
let min = beg.clone(); let min = beg.clone();
let max = end.clone(); let max = end.clone();
let num = std::cmp::min(1000, num); let num = std::cmp::min(1000, num);
@ -226,7 +226,7 @@ impl Transaction {
self.scan(min..max, num).await? self.scan(min..max, num).await?
} }
Some(ref mut beg) => { Some(ref mut beg) => {
beg.push(0); beg.push(0x00);
let min = beg.clone(); let min = beg.clone();
let max = end.clone(); let max = end.clone();
let num = std::cmp::min(1000, num); let num = std::cmp::min(1000, num);
@ -255,7 +255,7 @@ impl Transaction {
K: Into<Key>, K: Into<Key>,
{ {
let beg: Key = key.into(); let beg: Key = key.into();
let end: Key = beg.clone().add(255); let end: Key = beg.clone().add(0xff);
let mut nxt: Option<Key> = None; let mut nxt: Option<Key> = None;
let mut num = limit; let mut num = limit;
let mut out: Vec<(Key, Val)> = vec![]; let mut out: Vec<(Key, Val)> = vec![];
@ -299,7 +299,7 @@ impl Transaction {
K: Into<Key>, K: Into<Key>,
{ {
let beg: Key = key.into(); let beg: Key = key.into();
let end: Key = beg.clone().add(255); let end: Key = beg.clone().add(0xff);
let mut nxt: Option<Key> = None; let mut nxt: Option<Key> = None;
let mut num = limit; let mut num = limit;
// Start processing // Start processing