()
| 2092 | |
| 2093 | #[mz_ore::test] |
| 2094 | fn test_inequality() { |
| 2095 | let arena = RowArena::new(); |
| 2096 | |
| 2097 | let expr = MirScalarExpr::column(0).call_binary( |
| 2098 | MirScalarExpr::CallUnmaterializable(UnmaterializableFunc::MzNow), |
| 2099 | Gte, |
| 2100 | ); |
| 2101 | |
| 2102 | let relation = ReprRelationType::new(vec![ReprScalarType::MzTimestamp.nullable(true)]); |
| 2103 | let mut interpreter = ColumnSpecs::new(&relation, &arena); |
| 2104 | interpreter.push_column( |
| 2105 | 0, |
| 2106 | ResultSpec::value_between( |
| 2107 | Datum::MzTimestamp(1704736444949u64.into()), |
| 2108 | Datum::MzTimestamp(1704736444949u64.into()), |
| 2109 | ) |
| 2110 | .union(ResultSpec::null()), |
| 2111 | ); |
| 2112 | interpreter.push_unmaterializable( |
| 2113 | UnmaterializableFunc::MzNow, |
| 2114 | ResultSpec::value_between( |
| 2115 | Datum::MzTimestamp(1704738791000u64.into()), |
| 2116 | Datum::MzTimestamp(18446744073709551615u64.into()), |
| 2117 | ), |
| 2118 | ); |
| 2119 | |
| 2120 | let range_out = interpreter.expr(&expr).range; |
| 2121 | assert!( |
| 2122 | !range_out.fallible, |
| 2123 | "<= function should not error on non-error input" |
| 2124 | ); |
| 2125 | assert!(!range_out.may_contain(Datum::True)); |
| 2126 | assert!(range_out.may_contain(Datum::False)); |
| 2127 | assert!(range_out.may_contain(Datum::Null)); |
| 2128 | } |
| 2129 | |
| 2130 | /// Regression test for database-issues#9656. |
| 2131 | /// |
nothing calls this directly
no test coverage detected