From cf34e21ba9149b156d0e01049edf1807ea8fd56d Mon Sep 17 00:00:00 2001 From: pedrocarlo Date: Sun, 8 Jun 2025 19:01:33 -0300 Subject: [PATCH] fix for bug caught in simulator regarding `exec_if` --- core/vdbe/execute.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/core/vdbe/execute.rs b/core/vdbe/execute.rs index ae0fe12ea..aff53e265 100644 --- a/core/vdbe/execute.rs +++ b/core/vdbe/execute.rs @@ -5521,12 +5521,10 @@ impl Value { // exec_if returns whether you should jump pub fn exec_if(&self, jump_if_null: bool, not: bool) -> bool { - match self { - Value::Integer(0) | Value::Float(0.0) => not, - Value::Integer(_) | Value::Float(_) => !not, - Value::Null => jump_if_null, - _ => false, - } + Numeric::from(self) + .try_into_bool() + .map(|jump| if not { !jump } else { jump }) + .unwrap_or(jump_if_null) } pub fn exec_cast(&self, datatype: &str) -> Value {