Skip to content

Copr: do not change expression type for Lower #16009

@gengliqi

Description

@gengliqi

Development Task

fn map_lower_sig(value: ScalarFuncSig, children: &[Expr]) -> Result<RpnFnMeta> {
if children.len() != 1 {
return Err(other_err!(
"ScalarFunction {:?} (params = {}) is not supported in batch mode",
value,
children.len()
));
}
if children[0].get_field_type().is_binary_string_like() {
Ok(lower_fn_meta())
} else {
let ret_field_type = children[0].get_field_type();
Ok(match_template_charset! {
TT, match Charset::from_name(ret_field_type.get_charset()).map_err(tidb_query_datatype::codec::Error::from)? {
Charset::TT => lower_utf8_fn_meta::<TT>(),
}
})
}
}

The code above may change the function from Lower to LowerUtf8 if the field type is not binary. It's not good because TiKV should respect the expression type received from TiDB.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/enhancementThe issue or PR belongs to an enhancement.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions