From a66645c8be7f29750e6ed237ba20f8228e0f68fe Mon Sep 17 00:00:00 2001 From: obdev Date: Thu, 8 Feb 2024 12:18:41 +0000 Subject: [PATCH] fix on 4.3: online ddl does not change storage schema, result to 4105. --- deps/oblib/src/common/object/ob_obj_type.cpp | 18 ------------------ src/share/schema/ob_table_schema.cpp | 4 ++++ 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/deps/oblib/src/common/object/ob_obj_type.cpp b/deps/oblib/src/common/object/ob_obj_type.cpp index 299f6a10d..45f773537 100644 --- a/deps/oblib/src/common/object/ob_obj_type.cpp +++ b/deps/oblib/src/common/object/ob_obj_type.cpp @@ -650,24 +650,6 @@ bool is_match_alter_integer_column_online_ddl_rules(const common::ObObjMeta& src || (src_meta.is_unsigned_integer() && dst_meta.is_unsigned_integer())) // both are singed or unsigned integer && src_meta.get_type() <= dst_meta.get_type())) { // (unsigned) integer can be changed into larger by online ddl is_online_ddl = true; - } else if (src_meta.is_unsigned_integer() && dst_meta.is_signed_integer()) { - if (src_meta.is_utinyint()) { - if (dst_meta.get_type() >= ObSmallIntType && dst_meta.get_type() <= ObIntType) { // unsigned tinyint -> smallint mediumint int bigint - is_online_ddl = true; - } - } else if (src_meta.is_usmallint()) { - if (dst_meta.get_type() >= ObMediumIntType && dst_meta.get_type() <= ObIntType) { // unsigned smallint -> mediumint int bigint - is_online_ddl = true; - } - } else if (src_meta.is_umediumint()) { - if (dst_meta.get_type() >= ObInt32Type && dst_meta.get_type() <= ObIntType) { // unsigned mediumint -> int bigint - is_online_ddl = true; - } - } else if (src_meta.is_uint32()) { - if (dst_meta.is_int()) { // unsigned int -> bigint - is_online_ddl = true; - } - } } return is_online_ddl; } diff --git a/src/share/schema/ob_table_schema.cpp b/src/share/schema/ob_table_schema.cpp index e98982dbb..42f87fbdf 100644 --- a/src/share/schema/ob_table_schema.cpp +++ b/src/share/schema/ob_table_schema.cpp @@ -4486,6 +4486,10 @@ int ObTableSchema::check_alter_column_type(const ObColumnSchemaV2 &src_column, is_offline = true; } } + if ((src_meta.is_signed_integer() && dst_meta.is_unsigned_integer()) + || (src_meta.is_unsigned_integer() && dst_meta.is_signed_integer())) { + is_offline = true; + } if (!src_meta.is_lob_storage() && dst_meta.is_lob_storage()) { is_offline = true; }