[TABLELOCK] Fix the issue of precision error when the return value of the lock function is divided by other values

This commit is contained in:
YangEfei 2024-12-16 05:48:16 +00:00 committed by ob-robot
parent a6b15d1080
commit c92b3bbf9d

View File

@ -44,7 +44,9 @@ int ObExprLockFunc::calc_result_type0(ObExprResType &type,
ObExprTypeCtx &type_ctx) const
{
int ret = OB_SUCCESS;
const ObAccuracy &res_acc = ObAccuracy::DDL_DEFAULT_ACCURACY[common::ObIntType];
type.set_type(ObIntType);
type.set_accuracy(res_acc);
type_ctx.set_cast_mode(type_ctx.get_cast_mode() | CM_NULL_ON_WARN);
return ret;
}
@ -54,7 +56,9 @@ int ObExprLockFunc::calc_result_type1(ObExprResType &type,
ObExprTypeCtx &type_ctx) const
{
int ret = OB_SUCCESS;
const ObAccuracy &res_acc = ObAccuracy::DDL_DEFAULT_ACCURACY[common::ObIntType];
type.set_type(ObIntType);
type.set_accuracy(res_acc);
type_ctx.set_cast_mode(type_ctx.get_cast_mode() | CM_NULL_ON_WARN);
// lock name
@ -69,7 +73,9 @@ int ObExprLockFunc::calc_result_type2(ObExprResType &type,
ObExprTypeCtx &type_ctx) const
{
int ret = OB_SUCCESS;
const ObAccuracy &res_acc = ObAccuracy::DDL_DEFAULT_ACCURACY[common::ObIntType];
type.set_type(ObIntType);
type.set_accuracy(res_acc);
type_ctx.set_cast_mode(type_ctx.get_cast_mode() | CM_NULL_ON_WARN);
// lock name