diff --git a/src/objit/include/objit/common/ob_item_type.h b/src/objit/include/objit/common/ob_item_type.h index 8309cf98a1..5168e960c8 100755 --- a/src/objit/include/objit/common/ob_item_type.h +++ b/src/objit/include/objit/common/ob_item_type.h @@ -2408,6 +2408,7 @@ typedef enum ObItemType T_CANCEL_LS_REPLICA_TASK, T_COALESCE_AGGR, T_NO_COALESCE_AGGR, + T_AUTO_INCREMENT_CACHE_SIZE, T_MAX //Attention: add a new type before T_MAX } ObItemType; diff --git a/src/share/inner_table/ob_inner_table_schema.101_150.cpp b/src/share/inner_table/ob_inner_table_schema.101_150.cpp index 3247d62d84..5423831b62 100644 --- a/src/share/inner_table/ob_inner_table_schema.101_150.cpp +++ b/src/share/inner_table/ob_inner_table_schema.101_150.cpp @@ -6731,6 +6731,25 @@ int ObInnerTableSchema::all_table_history_schema(ObTableSchema &table_schema) column_store_default, column_store_default); //default_value } + + if (OB_SUCC(ret)) { + ObObj auto_increment_cache_size_default; + auto_increment_cache_size_default.set_int(0); + ADD_COLUMN_SCHEMA_T("auto_increment_cache_size", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + true, //is_nullable + false, //is_autoincrement + auto_increment_cache_size_default, + auto_increment_cache_size_default); //default_value + } table_schema.set_index_using_type(USING_BTREE); table_schema.set_row_store_type(ENCODING_ROW_STORE); table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL); diff --git a/src/share/inner_table/ob_inner_table_schema.11001_11050.cpp b/src/share/inner_table/ob_inner_table_schema.11001_11050.cpp index e48e38ebc9..8e11330ea2 100644 --- a/src/share/inner_table/ob_inner_table_schema.11001_11050.cpp +++ b/src/share/inner_table/ob_inner_table_schema.11001_11050.cpp @@ -14374,6 +14374,25 @@ int ObInnerTableSchema::all_virtual_core_all_table_schema(ObTableSchema &table_s column_store_default, column_store_default); //default_value } + + if (OB_SUCC(ret)) { + ObObj auto_increment_cache_size_default; + auto_increment_cache_size_default.set_int(0); + ADD_COLUMN_SCHEMA_T("auto_increment_cache_size", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false, //is_autoincrement + auto_increment_cache_size_default, + auto_increment_cache_size_default); //default_value + } table_schema.set_index_using_type(USING_HASH); table_schema.set_row_store_type(ENCODING_ROW_STORE); table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL); diff --git a/src/share/inner_table/ob_inner_table_schema.12051_12100.cpp b/src/share/inner_table/ob_inner_table_schema.12051_12100.cpp index afa5d95c1f..d19c99698e 100644 --- a/src/share/inner_table/ob_inner_table_schema.12051_12100.cpp +++ b/src/share/inner_table/ob_inner_table_schema.12051_12100.cpp @@ -6679,6 +6679,25 @@ int ObInnerTableSchema::all_virtual_table_schema(ObTableSchema &table_schema) column_store_default, column_store_default); //default_value } + + if (OB_SUCC(ret)) { + ObObj auto_increment_cache_size_default; + auto_increment_cache_size_default.set_int(0); + ADD_COLUMN_SCHEMA_T("auto_increment_cache_size", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false, //is_autoincrement + auto_increment_cache_size_default, + auto_increment_cache_size_default); //default_value + } table_schema.set_index_using_type(USING_BTREE); table_schema.set_row_store_type(ENCODING_ROW_STORE); table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL); @@ -8141,6 +8160,25 @@ int ObInnerTableSchema::all_virtual_table_history_schema(ObTableSchema &table_sc column_store_default, column_store_default); //default_value } + + if (OB_SUCC(ret)) { + ObObj auto_increment_cache_size_default; + auto_increment_cache_size_default.set_int(0); + ADD_COLUMN_SCHEMA_T("auto_increment_cache_size", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + true, //is_nullable + false, //is_autoincrement + auto_increment_cache_size_default, + auto_increment_cache_size_default); //default_value + } table_schema.set_index_using_type(USING_BTREE); table_schema.set_row_store_type(ENCODING_ROW_STORE); table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL); diff --git a/src/share/inner_table/ob_inner_table_schema.15101_15150.cpp b/src/share/inner_table/ob_inner_table_schema.15101_15150.cpp index eb86cc88cd..ed59f94059 100644 --- a/src/share/inner_table/ob_inner_table_schema.15101_15150.cpp +++ b/src/share/inner_table/ob_inner_table_schema.15101_15150.cpp @@ -6398,6 +6398,21 @@ int ObInnerTableSchema::all_virtual_table_real_agent_ora_schema(ObTableSchema &t false); //is_autoincrement } + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("AUTO_INCREMENT_CACHE_SIZE", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false, //is_nullable + false); //is_autoincrement + } + if (OB_SUCC(ret)) { ADD_COLUMN_SCHEMA("GMT_CREATE", //column_name ++column_id, //column_id diff --git a/src/share/inner_table/ob_inner_table_schema.15201_15250.cpp b/src/share/inner_table/ob_inner_table_schema.15201_15250.cpp index 95bb2a0637..c7e9564101 100644 --- a/src/share/inner_table/ob_inner_table_schema.15201_15250.cpp +++ b/src/share/inner_table/ob_inner_table_schema.15201_15250.cpp @@ -6391,6 +6391,21 @@ int ObInnerTableSchema::all_virtual_core_all_table_ora_schema(ObTableSchema &tab false, //is_nullable false); //is_autoincrement } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("AUTO_INCREMENT_CACHE_SIZE", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false, //is_nullable + false); //is_autoincrement + } table_schema.set_index_using_type(USING_HASH); table_schema.set_row_store_type(ENCODING_ROW_STORE); table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL); diff --git a/src/share/inner_table/ob_inner_table_schema.1_50.cpp b/src/share/inner_table/ob_inner_table_schema.1_50.cpp index 347060bb95..982ab1a6f3 100644 --- a/src/share/inner_table/ob_inner_table_schema.1_50.cpp +++ b/src/share/inner_table/ob_inner_table_schema.1_50.cpp @@ -1625,6 +1625,25 @@ int ObInnerTableSchema::all_table_schema(ObTableSchema &table_schema) column_store_default, column_store_default); //default_value } + + if (OB_SUCC(ret)) { + ObObj auto_increment_cache_size_default; + auto_increment_cache_size_default.set_int(0); + ADD_COLUMN_SCHEMA_T("auto_increment_cache_size", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false, //is_autoincrement + auto_increment_cache_size_default, + auto_increment_cache_size_default); //default_value + } table_schema.set_index_using_type(USING_BTREE); table_schema.set_row_store_type(ENCODING_ROW_STORE); table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL); diff --git a/src/share/inner_table/ob_inner_table_schema_def.py b/src/share/inner_table/ob_inner_table_schema_def.py index d886ca2422..d1fac4c505 100644 --- a/src/share/inner_table/ob_inner_table_schema_def.py +++ b/src/share/inner_table/ob_inner_table_schema_def.py @@ -312,6 +312,7 @@ all_table_def = dict( ('lob_inrow_threshold', 'int', 'false', 'OB_DEFAULT_LOB_INROW_THRESHOLD'), ('max_used_column_group_id', 'int', 'false', '1000'), ('column_store', 'int', 'false', '0'), + ('auto_increment_cache_size', 'int', 'false', '0') ], ) diff --git a/src/share/ob_rpc_struct.h b/src/share/ob_rpc_struct.h index c0f5f6845a..946099f232 100755 --- a/src/share/ob_rpc_struct.h +++ b/src/share/ob_rpc_struct.h @@ -2079,6 +2079,7 @@ public: TTL_DEFINITION, KV_ATTRIBUTES, LOB_INROW_THRESHOLD, + INCREMENT_CACHE_SIZE, MAX_OPTION = 1000 }; enum AlterPartitionType diff --git a/src/share/schema/ob_table_schema.cpp b/src/share/schema/ob_table_schema.cpp index 7946505385..ca7c44095c 100644 --- a/src/share/schema/ob_table_schema.cpp +++ b/src/share/schema/ob_table_schema.cpp @@ -1523,6 +1523,7 @@ int ObTableSchema::assign(const ObTableSchema &src_schema) table_flags_ = src_schema.table_flags_; name_generated_type_ = src_schema.name_generated_type_; lob_inrow_threshold_ = src_schema.lob_inrow_threshold_; + auto_increment_cache_size_ = src_schema.auto_increment_cache_size_; is_column_store_supported_ = src_schema.is_column_store_supported_; max_used_column_group_id_ = src_schema.max_used_column_group_id_; mlog_tid_ = src_schema.mlog_tid_; @@ -3337,6 +3338,7 @@ void ObTableSchema::reset() kv_attributes_.reset(); name_generated_type_ = GENERATED_TYPE_UNKNOWN; lob_inrow_threshold_ = OB_DEFAULT_LOB_INROW_THRESHOLD; + auto_increment_cache_size_ = 0; is_column_store_supported_ = false; max_used_column_group_id_ = COLUMN_GROUP_START_ID; @@ -6365,7 +6367,8 @@ int64_t ObTableSchema::to_string(char *buf, const int64_t buf_len) const K_(max_used_column_group_id), K_(column_group_cnt), "column_group_array", ObArrayWrap(column_group_arr_, column_group_cnt_), - K_(mlog_tid)); + K_(mlog_tid), + K_(auto_increment_cache_size)); J_OBJ_END(); return pos; @@ -6645,6 +6648,7 @@ OB_DEF_SERIALIZE(ObTableSchema) }(); OB_UNIS_ENCODE(mlog_tid_); + OB_UNIS_ENCODE(auto_increment_cache_size_); return ret; } @@ -7073,6 +7077,7 @@ OB_DEF_DESERIALIZE(ObTableSchema) }(); OB_UNIS_DECODE(mlog_tid_); + OB_UNIS_DECODE(auto_increment_cache_size_); return ret; } @@ -7222,6 +7227,7 @@ OB_DEF_SERIALIZE_SIZE(ObTableSchema) OB_UNIS_ADD_LEN(is_column_store_supported_); OB_UNIS_ADD_LEN(max_used_column_group_id_); OB_UNIS_ADD_LEN(mlog_tid_); + OB_UNIS_ADD_LEN(auto_increment_cache_size_); return len; } diff --git a/src/share/schema/ob_table_schema.h b/src/share/schema/ob_table_schema.h index 6c3c3c9c88..6dea0c8edc 100644 --- a/src/share/schema/ob_table_schema.h +++ b/src/share/schema/ob_table_schema.h @@ -1125,6 +1125,8 @@ public: int set_ttl_definition(const common::ObString &ttl_definition) { return deep_copy_str(ttl_definition, ttl_definition_); } int set_kv_attributes(const common::ObString &kv_attributes) { return deep_copy_str(kv_attributes, kv_attributes_); } void set_lob_inrow_threshold(const int64_t lob_inrow_threshold) { lob_inrow_threshold_ = lob_inrow_threshold;} + inline void set_auto_increment_cache_size(const int64_t auto_increment_cache_size) + { auto_increment_cache_size_ = auto_increment_cache_size; } //get methods bool is_valid() const; @@ -1215,6 +1217,7 @@ public: inline const common::ObString &get_ttl_definition() const { return ttl_definition_; } inline const common::ObString &get_kv_attributes() const { return kv_attributes_; } inline int64_t get_lob_inrow_threshold() const { return lob_inrow_threshold_; } + inline int64_t get_auto_increment_cache_size() const { return auto_increment_cache_size_; } bool has_check_constraint() const; inline bool has_constraint() const { return cst_cnt_ > 0; } bool is_column_in_check_constraint(const uint64_t col_id) const; @@ -1802,6 +1805,7 @@ protected: ObNameGeneratedType name_generated_type_; int64_t lob_inrow_threshold_; + int64_t auto_increment_cache_size_; // column group bool is_column_store_supported_; diff --git a/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_virtual_table_in_mysql.result b/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_virtual_table_in_mysql.result index cf8b72db3a..a1b2f9d848 100644 --- a/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_virtual_table_in_mysql.result +++ b/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_virtual_table_in_mysql.result @@ -874,6 +874,7 @@ name_generated_type bigint(20) NO 0 lob_inrow_threshold bigint(20) NO 4096 max_used_column_group_id bigint(20) NO 1000 column_store bigint(20) NO 0 +auto_increment_cache_size bigint(20) NO 0 select /*+QUERY_TIMEOUT(60000000)*/ IF(count(*) >= 0, 1, 0) from oceanbase.__all_virtual_core_all_table; IF(count(*) >= 0, 1, 0) 1 @@ -1749,6 +1750,7 @@ name_generated_type bigint(20) NO 0 lob_inrow_threshold bigint(20) NO 4096 max_used_column_group_id bigint(20) NO 1000 column_store bigint(20) NO 0 +auto_increment_cache_size bigint(20) NO 0 select /*+QUERY_TIMEOUT(60000000)*/ IF(count(*) >= 0, 1, 0) from oceanbase.__all_virtual_table; IF(count(*) >= 0, 1, 0) 1 diff --git a/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_virtual_table_in_sys.result b/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_virtual_table_in_sys.result index a2a6b582d5..3a960522e6 100644 --- a/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_virtual_table_in_sys.result +++ b/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_virtual_table_in_sys.result @@ -947,6 +947,7 @@ name_generated_type bigint(20) NO 0 lob_inrow_threshold bigint(20) NO 4096 max_used_column_group_id bigint(20) NO 1000 column_store bigint(20) NO 0 +auto_increment_cache_size bigint(20) NO 0 select /*+QUERY_TIMEOUT(60000000)*/ IF(count(*) >= 0, 1, 0) from oceanbase.__all_virtual_core_all_table; IF(count(*) >= 0, 1, 0) 1 @@ -2666,6 +2667,7 @@ name_generated_type bigint(20) NO 0 lob_inrow_threshold bigint(20) NO 4096 max_used_column_group_id bigint(20) NO 1000 column_store bigint(20) NO 0 +auto_increment_cache_size bigint(20) NO 0 select /*+QUERY_TIMEOUT(60000000)*/ IF(count(*) >= 0, 1, 0) from oceanbase.__all_virtual_table; IF(count(*) >= 0, 1, 0) 1 @@ -2755,6 +2757,7 @@ name_generated_type bigint(20) YES 0 lob_inrow_threshold bigint(20) YES 4096 max_used_column_group_id bigint(20) YES 1000 column_store bigint(20) YES 0 +auto_increment_cache_size bigint(20) YES 0 select /*+QUERY_TIMEOUT(60000000)*/ IF(count(*) >= 0, 1, 0) from oceanbase.__all_virtual_table_history; IF(count(*) >= 0, 1, 0) 1