[CP] fix CHAR and CONCAT result length bug
This commit is contained in:
@ -73,11 +73,7 @@ int ObExprChar::calc_result_typeN(ObExprResType &type, ObExprResType *types, int
|
||||
types[i].set_calc_type(ObIntType);
|
||||
}
|
||||
ObExprOperator::calc_result_flagN(type, types, param_num);
|
||||
//set length
|
||||
CK( OB_INVALID_COUNT != type_ctx.get_max_allowed_packet());
|
||||
if (OB_SUCC(ret)) {
|
||||
type.set_length(static_cast<ObLength>(type_ctx.get_max_allowed_packet()));
|
||||
}
|
||||
type.set_length(static_cast<ObLength>(param_num * 4 - 4));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -208,6 +208,9 @@ int ObExprConcat::calc_result_typeN(ObExprResType &type,
|
||||
max_len = OB_MAX_LONGTEXT_LENGTH / 4;
|
||||
} else {
|
||||
max_len = MIN(OB_MAX_VARCHAR_LENGTH, max_len);
|
||||
if (max_len <= 0) {
|
||||
max_len = OB_MAX_VARCHAR_LENGTH;
|
||||
}
|
||||
}
|
||||
type.set_length(max_len);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user