Skip to content

Commit 660dd14

Browse files
committed
fix: offset 0 will throw InvalidType
1 parent 25fcaa1 commit 660dd14

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[package]
44
name = "kite_sql"
5-
version = "0.1.0"
5+
version = "0.1.1"
66
edition = "2021"
77
authors = ["Kould <kould2333@gmail.com>", "Xwg <loloxwg@gmail.com>"]
88
description = "SQL as a Function for Rust"

src/binder/select.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -711,8 +711,8 @@ impl<'a: 'b, 'b, T: Transaction, A: AsRef<[(&'static str, DataValue)]>> Binder<'
711711
let expr = self.bind_expr(&expr.value)?;
712712
match expr {
713713
ScalarExpression::Constant(dv) => match &dv {
714-
DataValue::Int32(v) if *v > 0 => offset = Some(*v as usize),
715-
DataValue::Int64(v) if *v > 0 => offset = Some(*v as usize),
714+
DataValue::Int32(v) if *v >= 0 => offset = Some(*v as usize),
715+
DataValue::Int64(v) if *v >= 0 => offset = Some(*v as usize),
716716
_ => return Err(DatabaseError::InvalidType),
717717
},
718718
_ => {

0 commit comments

Comments
 (0)