Skip to content

Commit

Permalink
throw if min/max used with KvU64
Browse files Browse the repository at this point in the history
  • Loading branch information
losfair committed Dec 15, 2023
1 parent c5b2ff5 commit 16686f6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sqlite/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,11 @@ fn sum_v8(
Ok(SumOperand::Number(current))
}
(SumOperand::KvU64(current), SumOperand::KvU64(operand)) => {
if result_min.is_some() || result_max.is_some() {
return Err(SqliteBackendError::TypeMismatch(
"Cannot use min/max parameters with KvU64 operands".into(),
));
}
Ok(SumOperand::KvU64(current.wrapping_add(*operand)))
}
_ => Err(SqliteBackendError::TypeMismatch(format!(
Expand Down

0 comments on commit 16686f6

Please sign in to comment.