From ee2645c688d47040f05cd1996af24d44466b52cc Mon Sep 17 00:00:00 2001 From: obdev Date: Mon, 4 Mar 2024 12:14:37 +0000 Subject: [PATCH] add tx_op column for __all_virtual_tx_data --- deps/oblib/src/lib/ob_define.h | 1 + .../ob_inner_table_schema.12001_12050.cpp | 2 +- .../ob_inner_table_schema.12351_12400.cpp | 15 +++++++++++++++ .../inner_table/ob_inner_table_schema_def.py | 1 + .../r/mysql/desc_virtual_table_in_sys.result | 1 + 5 files changed, 19 insertions(+), 1 deletion(-) diff --git a/deps/oblib/src/lib/ob_define.h b/deps/oblib/src/lib/ob_define.h index 5bd392752c..2c5b5d5524 100644 --- a/deps/oblib/src/lib/ob_define.h +++ b/deps/oblib/src/lib/ob_define.h @@ -1891,6 +1891,7 @@ const int64_t MAX_MEMSTORE_CNT_IN_STORAGE = MAX_FROZEN_MEMSTORE_CNT_IN_STORAGE + const int64_t MAX_TX_DATA_TABLE_STATE_LENGTH = 20; const int64_t MAX_TX_DATA_STATE_LENGTH = 16; const int64_t MAX_UNDO_LIST_CHAR_LENGTH = 4096; +const int64_t MAX_TX_OP_CHAR_LENGTH = 4096; const int64_t MAX_TABLE_CNT_IN_STORAGE = MAX_SSTABLE_CNT_IN_STORAGE + MAX_MEMSTORE_CNT; const int64_t OB_MAX_PARTITION_NUM_MYSQL = 8192; const int64_t OB_MAX_PARTITION_NUM_ORACLE = 65536; diff --git a/src/share/inner_table/ob_inner_table_schema.12001_12050.cpp b/src/share/inner_table/ob_inner_table_schema.12001_12050.cpp index 1b5b518796..0d0d7bd281 100644 --- a/src/share/inner_table/ob_inner_table_schema.12001_12050.cpp +++ b/src/share/inner_table/ob_inner_table_schema.12001_12050.cpp @@ -2632,7 +2632,7 @@ int ObInnerTableSchema::all_virtual_tenant_memstore_allocator_info_schema(ObTabl 0, //part_key_pos ObVarcharType, //column_type CS_TYPE_INVALID, //column_collation_type - 32, //column_length + OB_MAX_POINTER_ADDR_LEN, //column_length -1, //column_precision -1, //column_scale false, //is_nullable diff --git a/src/share/inner_table/ob_inner_table_schema.12351_12400.cpp b/src/share/inner_table/ob_inner_table_schema.12351_12400.cpp index a69afb40c1..23c0c0b101 100644 --- a/src/share/inner_table/ob_inner_table_schema.12351_12400.cpp +++ b/src/share/inner_table/ob_inner_table_schema.12351_12400.cpp @@ -5275,6 +5275,21 @@ int ObInnerTableSchema::all_virtual_tx_data_schema(ObTableSchema &table_schema) false, //is_nullable false); //is_autoincrement } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tx_op", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + MAX_TX_OP_CHAR_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false); //is_autoincrement + } if (OB_SUCC(ret)) { table_schema.get_part_option().set_part_num(1); table_schema.set_part_level(PARTITION_LEVEL_ONE); 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 3ace45fa27..821661b3a4 100644 --- a/src/share/inner_table/ob_inner_table_schema_def.py +++ b/src/share/inner_table/ob_inner_table_schema_def.py @@ -13150,6 +13150,7 @@ def_table_schema( ('end_scn', 'uint'), ('commit_version', 'uint'), ('undo_status', 'varchar:MAX_UNDO_LIST_CHAR_LENGTH'), + ('tx_op', 'varchar:MAX_TX_OP_CHAR_LENGTH'), ], partition_columns = ['svr_ip', 'svr_port'], vtable_route_policy = 'distributed', 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 1ed7960712..b205e7c652 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 @@ -7992,6 +7992,7 @@ start_scn bigint(20) unsigned NO NULL end_scn bigint(20) unsigned NO NULL commit_version bigint(20) unsigned NO NULL undo_status varchar(4096) NO NULL +tx_op varchar(4096) NO NULL desc oceanbase.__all_virtual_task_opt_stat_gather_history; Field Type Null Key Default Extra tenant_id bigint(20) NO PRI NULL