diff --git a/deps/oblib/src/lib/ob_define.h b/deps/oblib/src/lib/ob_define.h index 79cdf8693..e6dd4af9f 100644 --- a/deps/oblib/src/lib/ob_define.h +++ b/deps/oblib/src/lib/ob_define.h @@ -109,6 +109,7 @@ const int64_t MAX_LOCK_OP_TYPE_BUF_LENGTH = 32; const int64_t MAX_LOCK_OP_STATUS_BUF_LENGTH = 16; const int64_t MAX_LOCK_OP_EXTRA_INFO_LENGTH = 256; const int64_t MAX_LOCK_DETECT_PARAM_LENGTH = 512; +const int64_t MAX_LOCK_OP_PRIORITY_BUF_LENGTH = 16; const int64_t MAX_SERVICE_TYPE_BUF_LENGTH = 32; const int64_t MAX_CHECKPOINT_TYPE_BUF_LENGTH = 32; const int64_t MAX_FREEZE_CHECKPOINT_LOCATION_BUF_LENGTH = 16; diff --git a/src/observer/virtual_table/ob_all_virtual_obj_lock.cpp b/src/observer/virtual_table/ob_all_virtual_obj_lock.cpp index 446b7164f..2fe958810 100644 --- a/src/observer/virtual_table/ob_all_virtual_obj_lock.cpp +++ b/src/observer/virtual_table/ob_all_virtual_obj_lock.cpp @@ -419,6 +419,12 @@ int ObAllVirtualObjLock::process_curr_tenant(ObNewRow *&row) // TODO: set the column with real data break; } + case PRIORITY: { + break; + } + case WAIT_SEQ: { + break; + } default: ret = OB_ERR_UNEXPECTED; SERVER_LOG(WARN, "invalid col_id", K(ret), K(col_id)); diff --git a/src/observer/virtual_table/ob_all_virtual_obj_lock.h b/src/observer/virtual_table/ob_all_virtual_obj_lock.h index a2587dc33..633a5fffd 100644 --- a/src/observer/virtual_table/ob_all_virtual_obj_lock.h +++ b/src/observer/virtual_table/ob_all_virtual_obj_lock.h @@ -71,6 +71,8 @@ private: OBJ_TYPE, OBJ_ID, OWNER_TYPE, + PRIORITY, + WAIT_SEQ }; private: common::ObAddr addr_; diff --git a/src/share/inner_table/ob_inner_table_schema.12251_12300.cpp b/src/share/inner_table/ob_inner_table_schema.12251_12300.cpp index 178c3253d..8d52bd06f 100644 --- a/src/share/inner_table/ob_inner_table_schema.12251_12300.cpp +++ b/src/share/inner_table/ob_inner_table_schema.12251_12300.cpp @@ -10608,6 +10608,36 @@ int ObInnerTableSchema::all_virtual_obj_lock_schema(ObTableSchema &table_schema) false, //is_nullable false); //is_autoincrement } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("priority", //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_LOCK_OP_PRIORITY_BUF_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("wait_seq", //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 + } 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.15301_15350.cpp b/src/share/inner_table/ob_inner_table_schema.15301_15350.cpp index 7450421a7..744decbdd 100644 --- a/src/share/inner_table/ob_inner_table_schema.15301_15350.cpp +++ b/src/share/inner_table/ob_inner_table_schema.15301_15350.cpp @@ -1113,6 +1113,36 @@ int ObInnerTableSchema::all_virtual_obj_lock_ora_schema(ObTableSchema &table_sch false, //is_nullable false); //is_autoincrement } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("PRIORITY", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + MAX_LOCK_OP_PRIORITY_BUF_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("WAIT_SEQ", //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)) { 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 2610924ee..30696c4ca 100755 --- a/src/share/inner_table/ob_inner_table_schema_def.py +++ b/src/share/inner_table/ob_inner_table_schema_def.py @@ -12812,6 +12812,8 @@ def_table_schema( ('obj_type', 'varchar:MAX_LOCK_OBJ_TYPE_BUF_LENGTH'), ('obj_id', 'int'), ('owner_type', 'int'), + ('priority', 'varchar:MAX_LOCK_OP_PRIORITY_BUF_LENGTH'), + ('wait_seq', 'int') ], 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_mysql.result b/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_virtual_table_in_mysql.result index 012d45135..5baae2b17 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 @@ -2940,6 +2940,8 @@ time_after_create bigint(20) NO NULL obj_type varchar(32) NO NULL obj_id bigint(20) NO NULL owner_type bigint(20) NO NULL +priority varchar(16) NO NULL +wait_seq bigint(20) NO NULL select /*+QUERY_TIMEOUT(60000000)*/ IF(count(*) >= 0, 1, 0) from oceanbase.__all_virtual_obj_lock; 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 067dbc077..0b2272971 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 @@ -6559,6 +6559,8 @@ time_after_create bigint(20) NO NULL obj_type varchar(32) NO NULL obj_id bigint(20) NO NULL owner_type bigint(20) NO NULL +priority varchar(16) NO NULL +wait_seq bigint(20) NO NULL select /*+QUERY_TIMEOUT(60000000)*/ IF(count(*) >= 0, 1, 0) from oceanbase.__all_virtual_obj_lock; IF(count(*) >= 0, 1, 0) 1