copr: (non-)vectorized locate_2_args_utf8 & locate_3_args_utf8
@@ -90,6 +90,22 @@ fn map_like_sig(ret_field_type: &FieldType) -> Result<RpnFnMeta> {
})
}
+fn map_locate_2_args_utf8_sig(ret_field_type: &FieldType) -> Result<RpnFnMeta> {
+ Ok(match_template_collator! {
+ TT, match ret_field_type.as_accessor().collation().map_err(tidb_query_datatype::codec::Error::from)? {
+ Collation::TT => locate_2_args_utf8_fn_meta::<TT>()
+ }
+ })
+}
+
+fn map_locate_3_args_utf8_sig(ret_field_type: &FieldType) -> Result<RpnFnMeta> {
+ Ok(match_template_collator! {
+ TT, match ret_field_type.as_accessor().collation().map_err(tidb_query_datatype::codec::Error::from)? {
+ Collation::TT => locate_3_args_utf8_fn_meta::<TT>()
+ }
+ })
+}
+
fn map_int_sig<F>(value: ScalarFuncSig, children: &[Expr], mapper: F) -> Result<RpnFnMeta>
where
F: Fn(bool, bool) -> RpnFnMeta,
@@ -532,6 +548,8 @@ fn map_expr_node_to_rpn_func(expr: &Expr) -> Result<RpnFnMeta> {
ScalarFuncSig::Bin => bin_fn_meta(),
ScalarFuncSig::Length => length_fn_meta(),
ScalarFuncSig::UnHex => unhex_fn_meta(),
+ ScalarFuncSig::Locate2ArgsUtf8 => map_locate_2_args_utf8_sig(ft)?,
+ ScalarFuncSig::Locate3ArgsUtf8 => map_locate_3_args_utf8_sig(ft)?,
ScalarFuncSig::BitLength => bit_length_fn_meta(),
ScalarFuncSig::Ord => ord_fn_meta(),
ScalarFuncSig::Concat => concat_fn_meta(),
