(
&self,
(lower, upper, flags_datum): Self::Input<'a>,
temp_storage: &'a RowArena,
)
| 571 | type Output<'a> = Result<Datum<'a>, EvalError>; |
| 572 | |
| 573 | fn call<'a>( |
| 574 | &self, |
| 575 | (lower, upper, flags_datum): Self::Input<'a>, |
| 576 | temp_storage: &'a RowArena, |
| 577 | ) -> Self::Output<'a> { |
| 578 | let flags = match flags_datum { |
| 579 | Datum::Null => { |
| 580 | return Err(EvalError::InvalidRange( |
| 581 | InvalidRangeError::NullRangeBoundFlags, |
| 582 | )); |
| 583 | } |
| 584 | o => o.unwrap_str(), |
| 585 | }; |
| 586 | |
| 587 | let (lower_inclusive, upper_inclusive) = parse_range_bound_flags(flags)?; |
| 588 | |
| 589 | let mut range = Range::new(Some(( |
| 590 | RangeBound::new(lower, lower_inclusive), |
| 591 | RangeBound::new(upper, upper_inclusive), |
| 592 | ))); |
| 593 | |
| 594 | range.canonicalize()?; |
| 595 | |
| 596 | Ok(temp_storage.make_datum(|row| { |
| 597 | row.push_range(range).expect("errors already handled"); |
| 598 | })) |
| 599 | } |
| 600 | |
| 601 | fn output_type(&self, _input_types: &[SqlColumnType]) -> SqlColumnType { |
| 602 | SqlScalarType::Range { |
no test coverage detected