From 60c05ee08280bd2260c4e493d3a3ce37be8d2a04 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Wed, 16 Mar 2022 17:01:25 +0000 Subject: [PATCH] Use hexadecimal u8 values when altering datastore keys --- lib/src/dbs/channel.rs | 2 +- lib/src/dbs/iterate.rs | 2 +- lib/src/kvs/tx.rs | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/src/dbs/channel.rs b/lib/src/dbs/channel.rs index ad64fc94..1fffff2f 100644 --- a/lib/src/dbs/channel.rs +++ b/lib/src/dbs/channel.rs @@ -135,7 +135,7 @@ impl Table { txn.clone().lock().await.scan(min..max, 1000).await? } Some(ref mut beg) => { - beg.push(0); + beg.push(0x00); let min = beg.clone(); let max = end.encode()?; txn.clone().lock().await.scan(min..max, 1000).await? diff --git a/lib/src/dbs/iterate.rs b/lib/src/dbs/iterate.rs index 37a51de9..86f23b43 100644 --- a/lib/src/dbs/iterate.rs +++ b/lib/src/dbs/iterate.rs @@ -138,7 +138,7 @@ impl Table { txn.clone().lock().await.scan(min..max, 1000).await? } Some(ref mut beg) => { - beg.push(0); + beg.push(0x00); let min = beg.clone(); let max = end.encode()?; txn.clone().lock().await.scan(min..max, 1000).await? diff --git a/lib/src/kvs/tx.rs b/lib/src/kvs/tx.rs index 99bfdb33..0569c620 100644 --- a/lib/src/kvs/tx.rs +++ b/lib/src/kvs/tx.rs @@ -183,7 +183,7 @@ impl Transaction { self.scan(min..max, num).await? } Some(ref mut beg) => { - beg.push(0); + beg.push(0x00); let min = beg.clone(); let max = end.clone(); let num = std::cmp::min(1000, num); @@ -226,7 +226,7 @@ impl Transaction { self.scan(min..max, num).await? } Some(ref mut beg) => { - beg.push(0); + beg.push(0x00); let min = beg.clone(); let max = end.clone(); let num = std::cmp::min(1000, num); @@ -255,7 +255,7 @@ impl Transaction { K: Into, { let beg: Key = key.into(); - let end: Key = beg.clone().add(255); + let end: Key = beg.clone().add(0xff); let mut nxt: Option = None; let mut num = limit; let mut out: Vec<(Key, Val)> = vec![]; @@ -299,7 +299,7 @@ impl Transaction { K: Into, { let beg: Key = key.into(); - let end: Key = beg.clone().add(255); + let end: Key = beg.clone().add(0xff); let mut nxt: Option = None; let mut num = limit; // Start processing