Skip to content

Commit

Permalink
fix: offset 0 will throw InvalidType
Browse files Browse the repository at this point in the history
  • Loading branch information
KKould committed Feb 12, 2025
1 parent 25fcaa1 commit 660dd14
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[package]
name = "kite_sql"
version = "0.1.0"
version = "0.1.1"
edition = "2021"
authors = ["Kould <kould2333@gmail.com>", "Xwg <loloxwg@gmail.com>"]
description = "SQL as a Function for Rust"
Expand Down
4 changes: 2 additions & 2 deletions src/binder/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -711,8 +711,8 @@ impl<'a: 'b, 'b, T: Transaction, A: AsRef<[(&'static str, DataValue)]>> Binder<'
let expr = self.bind_expr(&expr.value)?;
match expr {
ScalarExpression::Constant(dv) => match &dv {
DataValue::Int32(v) if *v > 0 => offset = Some(*v as usize),
DataValue::Int64(v) if *v > 0 => offset = Some(*v as usize),
DataValue::Int32(v) if *v >= 0 => offset = Some(*v as usize),
DataValue::Int64(v) if *v >= 0 => offset = Some(*v as usize),
_ => return Err(DatabaseError::InvalidType),
},
_ => {
Expand Down

0 comments on commit 660dd14

Please sign in to comment.