diff --git a/src/sqllogictest/src/runner.rs b/src/sqllogictest/src/runner.rs index 0e2012b69514a..8f35272cae4a3 100644 --- a/src/sqllogictest/src/runner.rs +++ b/src/sqllogictest/src/runner.rs @@ -426,8 +426,8 @@ fn format_datum(d: Slt, typ: &Type, mode: Mode, col: usize) -> String { (Type::Integer, Value::Int4(i)) => i.to_string(), (Type::Integer, Value::Int8(i)) => i.to_string(), (Type::Integer, Value::Numeric(d)) => format!("{:.0}", d), - (Type::Integer, Value::Float4(f)) => format!("{:.0}", f.trunc()), - (Type::Integer, Value::Float8(f)) => format!("{:.0}", f.trunc()), + (Type::Integer, Value::Float4(f)) => format!("{}", f as i64), + (Type::Integer, Value::Float8(f)) => format!("{}", f as i64), // This is so wrong, but sqlite needs it. (Type::Integer, Value::Text(_)) => "0".to_string(), (Type::Integer, Value::Bool(b)) => i8::from(b).to_string(), diff --git a/test/sqllogictest/arithmetic.slt b/test/sqllogictest/arithmetic.slt index 7d089df66d46c..5b59886e66191 100644 --- a/test/sqllogictest/arithmetic.slt +++ b/test/sqllogictest/arithmetic.slt @@ -259,7 +259,7 @@ SELECT 1 + CAST ('5' AS double precision) ---- 6 -query II +query TT SELECT CAST ('+Inf' AS double precision), CAST ('inf' AS double precision) ---- inf inf