fix not null bug

This commit is contained in:
yongshige
2023-04-26 14:10:43 +00:00
committed by ob-robot
parent fef4b77472
commit 760aebfe3d

View File

@ -362,9 +362,11 @@ int ObTableLoadTransStoreWriter::cast_row(ObArenaAllocator &cast_allocator,
const ObColumnSchemaV2 *column_schema = column_schemas_.at(i);
ObCastCtx cast_ctx(&cast_allocator, &cast_params, CM_NONE, column_schema->get_collation_type());
ObTableLoadCastObjCtx cast_obj_ctx(param_, &time_cvrt_, &cast_ctx, true);
if ((!row.cells_[i].is_null()) &&
OB_FAIL(
ObTableLoadObjCaster::cast_obj(cast_obj_ctx, column_schema, row.cells_[i], out_obj))) {
const bool is_null_autoinc =
(column_schema->is_autoincrement() || column_schema->is_identity_column()) &&
row.cells_[i].is_null();
if (!is_null_autoinc && OB_FAIL(ObTableLoadObjCaster::cast_obj(cast_obj_ctx, column_schema,
row.cells_[i], out_obj))) {
LOG_WARN("fail to cast obj and check", KR(ret), K(i), K(row.cells_[i]));
} else if (OB_FAIL(datum_row.storage_datums_[i].from_obj_enhance(out_obj))) {
LOG_WARN("fail to from obj enhance", KR(ret), K(out_obj));