diff --git a/src/observer/virtual_table/ob_information_query_response_time.cpp b/src/observer/virtual_table/ob_information_query_response_time.cpp index 8db0b779e6..7565b26d31 100644 --- a/src/observer/virtual_table/ob_information_query_response_time.cpp +++ b/src/observer/virtual_table/ob_information_query_response_time.cpp @@ -183,6 +183,12 @@ int ObInfoSchemaQueryResponseTimeTable::process_row_data(ObNewRow *&row, ObObj* cells[cell_idx].set_int(time_collector_->total(utility_iter_)); break; } + case SQL_TYPE: { + // unused + cells[cell_idx].set_varchar(""); + cells[cell_idx].set_collation_type(ObCharset::get_default_collation(ObCharset::get_default_charset())); + break; + } default: { ret = OB_ERR_UNEXPECTED; SERVER_LOG(WARN, "invalid column id", K(ret), K(cell_idx), K(output_column_ids_), K(col_id)); diff --git a/src/observer/virtual_table/ob_information_query_response_time.h b/src/observer/virtual_table/ob_information_query_response_time.h index f2835eb4b6..77446303af 100644 --- a/src/observer/virtual_table/ob_information_query_response_time.h +++ b/src/observer/virtual_table/ob_information_query_response_time.h @@ -59,7 +59,8 @@ private: SVR_PORT, QUERY_RESPPONSE_TIME, COUNT, - TOTAL + TOTAL, + SQL_TYPE }; common::ObAddr* addr_; common::ObString ipstr_; diff --git a/src/share/inner_table/ob_inner_table_schema.12301_12350.cpp b/src/share/inner_table/ob_inner_table_schema.12301_12350.cpp index 002cdb8a42..6707a8cef4 100644 --- a/src/share/inner_table/ob_inner_table_schema.12301_12350.cpp +++ b/src/share/inner_table/ob_inner_table_schema.12301_12350.cpp @@ -7763,7 +7763,7 @@ int ObInnerTableSchema::all_virtual_query_response_time_schema(ObTableSchema &ta ObIntType, //column_type CS_TYPE_INVALID, //column_collation_type sizeof(int64_t), //column_length - 14, //column_precision + 20, //column_precision 0, //column_scale false, //is_nullable false, //is_autoincrement @@ -7782,7 +7782,7 @@ int ObInnerTableSchema::all_virtual_query_response_time_schema(ObTableSchema &ta ObIntType, //column_type CS_TYPE_INVALID, //column_collation_type sizeof(int64_t), //column_length - 14, //column_precision + 20, //column_precision 0, //column_scale false, //is_nullable false, //is_autoincrement @@ -7801,13 +7801,32 @@ int ObInnerTableSchema::all_virtual_query_response_time_schema(ObTableSchema &ta ObIntType, //column_type CS_TYPE_INVALID, //column_collation_type sizeof(int64_t), //column_length - 14, //column_precision + 20, //column_precision 0, //column_scale false, //is_nullable false, //is_autoincrement total_default, total_default); //default_value } + + if (OB_SUCC(ret)) { + ObObj sql_type_default; + sql_type_default.set_varchar(ObString::make_string("")); + ADD_COLUMN_SCHEMA_T("sql_type", //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 + 128, //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false, //is_autoincrement + sql_type_default, + sql_type_default); //default_value + } 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 4fc961d889..12f4420ba5 100644 --- a/src/share/inner_table/ob_inner_table_schema_def.py +++ b/src/share/inner_table/ob_inner_table_schema_def.py @@ -12723,9 +12723,10 @@ def_table_schema( ('tenant_id', 'int', 'false'), ('svr_ip', 'varchar:MAX_IP_ADDR_LENGTH', 'false'), ('svr_port', 'int'), - ('response_time', 'bigint:14', 'false', '0'), - ('count', 'bigint:14', 'false', '0'), - ('total', 'bigint:14', 'false', '0') + ('response_time', 'bigint', 'false', '0'), + ('count', 'bigint', 'false', '0'), + ('total', 'bigint', 'false', '0'), + ('sql_type', 'varchar:128', 'false', '') ], partition_columns=['svr_ip', 'svr_port'], vtable_route_policy = 'distributed', @@ -14795,6 +14796,7 @@ def_table_schema(**no_direct_access(gen_oracle_mapping_virtual_table_def('15451' # 15454: __all_virtual_storage_io_usage # 15455: __all_zone_storage def_table_schema(**no_direct_access(gen_oracle_mapping_virtual_table_def('15456', all_def_keywords['__all_virtual_nic_info']))) +# 15457: __all_virtual_query_response_time # # 余留位置(此行之前占位) # 本区域定义的Oracle表名比较复杂,一般都采用gen_xxx_table_def()方式定义,占位建议采用基表表名占位 @@ -34140,7 +34142,8 @@ def_table_schema( FROM oceanbase.__all_virtual_nic_info """.replace("\n", " ") ) - +# 21587: GV$OB_QUERY_RESPONSE_TIME_HISTOGRAM +# 21588: V$OB_QUERY_RESPONSE_TIME_HISTOGRAM # # 余留位置(此行之前占位) @@ -61666,7 +61669,8 @@ def_table_schema( WHERE SVR_IP = host_ip() AND SVR_PORT = rpc_port() """.replace("\n", " ") ) - +# 28232: GV$OB_QUERY_RESPONSE_TIME_HISTOGRAM +# 23233: V$OB_QUERY_RESPONSE_TIME_HISTOGRAM # # 余留位置(此行之前占位) # 本区域占位建议:采用真实视图名进行占位 diff --git a/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_sys_views_in_mysql.result b/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_sys_views_in_mysql.result index 4054c879f4..cfccb33de6 100644 --- a/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_sys_views_in_mysql.result +++ b/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_sys_views_in_mysql.result @@ -4075,9 +4075,9 @@ cnt 1 desc information_schema.QUERY_RESPONSE_TIME; Field Type Null Key Default Extra -RESPONSE_TIME bigint(14) NO -COUNT bigint(14) NO -TOTAL bigint(14) NO +RESPONSE_TIME bigint(20) NO +COUNT bigint(20) NO +TOTAL bigint(20) NO select /*+QUERY_TIMEOUT(60000000)*/ count(*) as cnt from (select * from information_schema.QUERY_RESPONSE_TIME limit 1); cnt 1 diff --git a/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_sys_views_in_sys.result b/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_sys_views_in_sys.result index 887217373d..f392681715 100644 --- a/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_sys_views_in_sys.result +++ b/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_sys_views_in_sys.result @@ -5637,9 +5637,9 @@ cnt 1 desc information_schema.QUERY_RESPONSE_TIME; Field Type Null Key Default Extra -RESPONSE_TIME bigint(14) NO -COUNT bigint(14) NO -TOTAL bigint(14) NO +RESPONSE_TIME bigint(20) NO +COUNT bigint(20) NO +TOTAL bigint(20) NO select /*+QUERY_TIMEOUT(60000000)*/ count(*) as cnt from (select * from information_schema.QUERY_RESPONSE_TIME limit 1); cnt 1 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 a3b1a76f97..e465778389 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 @@ -3393,9 +3393,10 @@ Field Type Null Key Default Extra tenant_id bigint(20) NO NULL svr_ip varchar(46) NO NULL svr_port bigint(20) NO NULL -response_time bigint(14) NO 0 -count bigint(14) NO 0 -total bigint(14) NO 0 +response_time bigint(20) NO 0 +count bigint(20) NO 0 +total bigint(20) NO 0 +sql_type varchar(128) NO select /*+QUERY_TIMEOUT(60000000)*/ IF(count(*) >= 0, 1, 0) from oceanbase.__all_virtual_query_response_time; 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 ef9f4413a9..2036ee6c7d 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 @@ -7213,9 +7213,10 @@ Field Type Null Key Default Extra tenant_id bigint(20) NO NULL svr_ip varchar(46) NO NULL svr_port bigint(20) NO NULL -response_time bigint(14) NO 0 -count bigint(14) NO 0 -total bigint(14) NO 0 +response_time bigint(20) NO 0 +count bigint(20) NO 0 +total bigint(20) NO 0 +sql_type varchar(128) NO select /*+QUERY_TIMEOUT(60000000)*/ IF(count(*) >= 0, 1, 0) from oceanbase.__all_virtual_query_response_time; IF(count(*) >= 0, 1, 0) 1