expr repeat/space/lrpad opt for text type

This commit is contained in:
skylhd
2023-06-13 02:12:20 +00:00
committed by ob-robot
parent 48544979bf
commit 05295dd0f6
7 changed files with 149 additions and 36 deletions

View File

@ -46,7 +46,9 @@ int ObExprRepeat::calc_result_type2(ObExprResType &type,
ObExprTypeCtx &type_ctx) const
{
int ret = OB_SUCCESS;
text.set_calc_type(common::ObVarcharType);
if (!text.is_string_type()) {
text.set_calc_type(common::ObVarcharType);
}
count.set_calc_type(common::ObIntType);
// Set cast mode for %count parameter, truncate string to integer.
type_ctx.set_cast_mode(type_ctx.get_cast_mode() | CM_STRING_INTEGER_TRUNC);