Fix default value of ObDecimalIntType

This commit is contained in:
Zach41
2023-12-04 08:11:56 +00:00
committed by ob-robot
parent 2c72a9c9b6
commit f9aa4172eb
7 changed files with 46 additions and 7 deletions

View File

@ -1050,7 +1050,7 @@ bool ObObj::is_zero() const
return ret;
}
int ObObj::build_not_strict_default_value()
int ObObj::build_not_strict_default_value(int16_t precision)
{
int ret = OB_SUCCESS;
const ObObjType &data_type = meta_.get_type();
@ -1190,7 +1190,14 @@ int ObObj::build_not_strict_default_value()
break;
}
case ObDecimalIntType: {
set_decimal_int(0, 0, nullptr);
const ObDecimalInt *decint = nullptr;
int32_t int_bytes = 0;
if (OB_FAIL(wide::ObDecimalIntConstValue::get_zero_value_byte_precision(precision, decint,
int_bytes))) {
_OB_LOG(WARN, "get zero value failed, ret=%u", ret);
} else {
set_decimal_int(int_bytes, 0, const_cast<ObDecimalInt *>(decint));
}
break;
}
default: