fix identity bug
This commit is contained in:
@ -361,7 +361,7 @@ int ObTableLoadObjCaster::cast_obj_check(ObTableLoadCastObjCtx &cast_obj_ctx,
|
||||
bool is_fast_number = cast_obj_ctx.number_fast_ctx_.is_fast_number_;
|
||||
bool not_null_validate = (!column_schema->is_nullable() && lib::is_mysql_mode()) ||
|
||||
(column_schema->is_not_null_enable_column() && lib::is_oracle_mode());
|
||||
if (obj.is_null() && not_null_validate) {
|
||||
if (obj.is_null() && not_null_validate && !column_schema->is_identity_column()) {
|
||||
const ObString &column_name = column_schema->get_column_name();
|
||||
ret = OB_BAD_NULL_ERROR;
|
||||
LOG_USER_ERROR(OB_BAD_NULL_ERROR, column_name.length(), column_name.ptr());
|
||||
|
||||
@ -226,7 +226,7 @@ int ObTableLoadPartitionCalc::get_row(ObTableLoadPartitionCalcContext &ctx, cons
|
||||
ObObj *rowkey_objs = static_cast<ObObj *>(allocator.alloc(sizeof(ObObj) * rowkey_obj_count));
|
||||
ObDataTypeCastParams cast_params(&tz_info_);
|
||||
ObCastCtx cast_ctx(&allocator, &cast_params, CM_NONE, ObCharset::get_system_collation());
|
||||
ObTableLoadCastObjCtx cast_obj_ctx(ctx.param_, &time_cvrt_, &cast_ctx, false);
|
||||
ObTableLoadCastObjCtx cast_obj_ctx(ctx.param_, &time_cvrt_, &cast_ctx, true);
|
||||
if (OB_ISNULL(rowkey_objs)) {
|
||||
ret = OB_ALLOCATE_MEMORY_FAILED;
|
||||
LOG_WARN("fail to alloc memory", KR(ret));
|
||||
|
||||
@ -208,7 +208,7 @@ int ObTableLoadTransBucketWriter::handle_partition_with_autoinc_identity(
|
||||
ObCastCtx cast_ctx(&autoinc_allocator, &cast_params, CM_NONE,
|
||||
ObCharset::get_system_collation());
|
||||
ObTableLoadCastObjCtx cast_obj_ctx(param_, &(coordinator_ctx_->partition_calc_.time_cvrt_), &cast_ctx,
|
||||
false);
|
||||
true);
|
||||
ObObj out_obj;
|
||||
for (int64_t j = 0; OB_SUCC(ret) && j < row_count; ++j) {
|
||||
ObStorageDatum storage_datum;
|
||||
|
||||
@ -365,8 +365,7 @@ 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() ||
|
||||
(!column_schema->is_autoincrement() && !column_schema->is_identity_column())) &&
|
||||
if ((!row.cells_[i].is_null()) &&
|
||||
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]));
|
||||
|
||||
Reference in New Issue
Block a user