diff --git a/src/engine/planning/query_plan.rs b/src/engine/planning/query_plan.rs index 6bec3816..65d47aba 100644 --- a/src/engine/planning/query_plan.rs +++ b/src/engine/planning/query_plan.rs @@ -912,6 +912,27 @@ fn function2_registry() -> HashMap> { Box::new(|qp, lhs, rhs| qp.less_than_equals(lhs, rhs)), BasicType::String, ), + Function2 { + factory: Box::new(|qp, lhs, rhs| { + // TODO: not strictly correct, casting int to float can lose precision, causing aliased values to compare differently (value might be smaller but compares as equal) + let rhs = int_to_float_cast(qp, rhs).unwrap(); + qp.less_than_equals(lhs, rhs) + }), + type_lhs: BasicType::Float, + type_rhs: BasicType::Integer, + type_out: Type::unencoded(BasicType::Boolean).mutable(), + encoding_invariance: true, + }, + Function2 { + factory: Box::new(|qp, lhs, rhs| { + let lhs = int_to_float_cast(qp, lhs).unwrap(); + qp.less_than_equals(lhs, rhs) + }), + type_lhs: BasicType::Integer, + type_rhs: BasicType::Float, + type_out: Type::unencoded(BasicType::Boolean).mutable(), + encoding_invariance: true, + }, ], ), ( diff --git a/tests/query_tests.rs b/tests/query_tests.rs index d11f0137..6d43a33c 100644 --- a/tests/query_tests.rs +++ b/tests/query_tests.rs @@ -1287,6 +1287,7 @@ fn test_overflow5() { test_query_ec_err("SELECT sum(largenum) FROM default;", QueryError::Overflow); } +// TODO: sometimes flaky, only returning subset of generated data #[test] fn test_gen_table() { use crate::Value::*;