diff --git a/deps/oblib/src/lib/ob_name_def.h b/deps/oblib/src/lib/ob_name_def.h index 46f60e1ad6..8bf841fe54 100644 --- a/deps/oblib/src/lib/ob_name_def.h +++ b/deps/oblib/src/lib/ob_name_def.h @@ -1143,6 +1143,10 @@ #define N_ST_SYMDIFFERENCE "st_symdifference" #define N_PRIV_ST_ASMVTGEOM "_st_asmvtgeom" #define N_PRIV_ST_MAKEVALID "_st_makevalid" +#define N_GTID_SUBSET "gtid_subset" +#define N_GTID_SUBTRACT "gtid_subtract" +#define N_WAIT_FOR_EXECUTED_GTID_SET "wait_for_executed_gtid_set" +#define N_WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS "wait_until_sql_thread_after_gtids" #define N_DECODE_TRACE_ID "decode_trace_id" #define N_PRIV_ST_GEOHASH "_st_geohash" #define N_PRIV_ST_MAKEPOINT "_st_makepoint" diff --git a/src/objit/include/objit/common/ob_item_type.h b/src/objit/include/objit/common/ob_item_type.h index 5e7c1c9518..864f094e88 100644 --- a/src/objit/include/objit/common/ob_item_type.h +++ b/src/objit/include/objit/common/ob_item_type.h @@ -898,14 +898,12 @@ typedef enum ObItemType T_FUN_SYS_END = 2000, T_FUN_SYS_ALIGN_DATE4CMP = 2010, T_FUN_SYS_INNER_ROW_CMP_VALUE = 2011, - T_FUN_SYS_GTID_SUBSET = 2012, T_FUN_SYS_GTID_SUBTRACT = 2013, T_FUN_SYS_WAIT_FOR_EXECUTED_GTID_SET = 2014, T_FUN_SYS_WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS = 2015, T_FUN_SYS_LAST_REFRESH_SCN = 2016, T_FUN_SUM_OPNSIZE = 2017, - T_FUN_SYS_GET_LOCK = 2018, T_FUN_SYS_IS_FREE_LOCK = 2019, T_FUN_SYS_IS_USED_LOCK = 2020, diff --git a/src/share/inner_table/ob_inner_table_schema.21551_21600.cpp b/src/share/inner_table/ob_inner_table_schema.21551_21600.cpp index 6a13050340..5da41a2b9b 100644 --- a/src/share/inner_table/ob_inner_table_schema.21551_21600.cpp +++ b/src/share/inner_table/ob_inner_table_schema.21551_21600.cpp @@ -229,6 +229,210 @@ int ObInnerTableSchema::v_ob_tenant_resource_limit_detail_schema(ObTableSchema & return ret; } +int ObInnerTableSchema::innodb_lock_waits_schema(ObTableSchema &table_schema) +{ + int ret = OB_SUCCESS; + uint64_t column_id = OB_APP_MIN_COLUMN_ID - 1; + + //generated fields: + table_schema.set_tenant_id(OB_SYS_TENANT_ID); + table_schema.set_tablegroup_id(OB_INVALID_ID); + table_schema.set_database_id(OB_INFORMATION_SCHEMA_ID); + table_schema.set_table_id(OB_INNODB_LOCK_WAITS_TID); + table_schema.set_rowkey_split_pos(0); + table_schema.set_is_use_bloomfilter(false); + table_schema.set_progressive_merge_num(0); + table_schema.set_rowkey_column_num(0); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(SYSTEM_VIEW); + table_schema.set_index_type(INDEX_TYPE_IS_NOT); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_INNODB_LOCK_WAITS_TNAME))) { + LOG_ERROR("fail to set table_name", K(ret)); + } + } + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_compress_func_name(OB_DEFAULT_COMPRESS_FUNC_NAME))) { + LOG_ERROR("fail to set compress_func_name", K(ret)); + } + } + table_schema.set_part_level(PARTITION_LEVEL_ZERO); + table_schema.set_charset_type(ObCharset::get_default_charset()); + table_schema.set_collation_type(ObCharset::get_default_collation(ObCharset::get_default_charset())); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_view_definition(R"__( SELECT '0' as REQUESTING_TRX_ID, '0' as REQUESTED_LOCK_ID, '0' as BLOCKING_TRX_ID, '0' as BLOCKING_LOCK_ID )__"))) { + LOG_ERROR("fail to set view_definition", K(ret)); + } + } + 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); + table_schema.set_progressive_merge_round(1); + table_schema.set_storage_format_version(3); + table_schema.set_tablet_id(0); + table_schema.set_micro_index_clustered(false); + + table_schema.set_max_used_column_id(column_id); + return ret; +} + +int ObInnerTableSchema::innodb_locks_schema(ObTableSchema &table_schema) +{ + int ret = OB_SUCCESS; + uint64_t column_id = OB_APP_MIN_COLUMN_ID - 1; + + //generated fields: + table_schema.set_tenant_id(OB_SYS_TENANT_ID); + table_schema.set_tablegroup_id(OB_INVALID_ID); + table_schema.set_database_id(OB_INFORMATION_SCHEMA_ID); + table_schema.set_table_id(OB_INNODB_LOCKS_TID); + table_schema.set_rowkey_split_pos(0); + table_schema.set_is_use_bloomfilter(false); + table_schema.set_progressive_merge_num(0); + table_schema.set_rowkey_column_num(0); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(SYSTEM_VIEW); + table_schema.set_index_type(INDEX_TYPE_IS_NOT); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_INNODB_LOCKS_TNAME))) { + LOG_ERROR("fail to set table_name", K(ret)); + } + } + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_compress_func_name(OB_DEFAULT_COMPRESS_FUNC_NAME))) { + LOG_ERROR("fail to set compress_func_name", K(ret)); + } + } + table_schema.set_part_level(PARTITION_LEVEL_ZERO); + table_schema.set_charset_type(ObCharset::get_default_charset()); + table_schema.set_collation_type(ObCharset::get_default_collation(ObCharset::get_default_charset())); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_view_definition(R"__( SELECT '0' as LOCK_ID, '0' as LOCK_TRX_ID, '0' as LOCK_MODE, '0' as LOCK_TYPE, '0' as LOCK_TABLE, '0' as LOCK_INDEX, 0 as LOCK_SPACE, 0 as LOCK_PAGE, 0 as LOCK_REC, '0' as LOCK_DATA )__"))) { + LOG_ERROR("fail to set view_definition", K(ret)); + } + } + 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); + table_schema.set_progressive_merge_round(1); + table_schema.set_storage_format_version(3); + table_schema.set_tablet_id(0); + table_schema.set_micro_index_clustered(false); + + table_schema.set_max_used_column_id(column_id); + return ret; +} + +int ObInnerTableSchema::innodb_trx_schema(ObTableSchema &table_schema) +{ + int ret = OB_SUCCESS; + uint64_t column_id = OB_APP_MIN_COLUMN_ID - 1; + + //generated fields: + table_schema.set_tenant_id(OB_SYS_TENANT_ID); + table_schema.set_tablegroup_id(OB_INVALID_ID); + table_schema.set_database_id(OB_INFORMATION_SCHEMA_ID); + table_schema.set_table_id(OB_INNODB_TRX_TID); + table_schema.set_rowkey_split_pos(0); + table_schema.set_is_use_bloomfilter(false); + table_schema.set_progressive_merge_num(0); + table_schema.set_rowkey_column_num(0); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(SYSTEM_VIEW); + table_schema.set_index_type(INDEX_TYPE_IS_NOT); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_INNODB_TRX_TNAME))) { + LOG_ERROR("fail to set table_name", K(ret)); + } + } + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_compress_func_name(OB_DEFAULT_COMPRESS_FUNC_NAME))) { + LOG_ERROR("fail to set compress_func_name", K(ret)); + } + } + table_schema.set_part_level(PARTITION_LEVEL_ZERO); + table_schema.set_charset_type(ObCharset::get_default_charset()); + table_schema.set_collation_type(ObCharset::get_default_collation(ObCharset::get_default_charset())); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_view_definition(R"__( SELECT '0' as TRX_ID, '0' as TRX_STATE, now() as TRX_STARTED, '0' as TRX_REQUESTED_LOCK_ID, now() as TRX_WAIT_STARTED, 0 as TRX_WEIGHT, 0 as TRX_MYSQL_THREAD_ID, '0' as TRX_QUERY, '0' as TRX_OPERATION_STATE, 0 as TRX_TABLE_IN_USE, 0 as TRX_TABLES_LOCKED, 0 as TRX_LOCK_STRUCTS, 0 as TRX_LOCK_MEMORY_BYTES, 0 as TRX_ROWS_LOCKED, 0 as TRX_ROWS_MODIFIED, 0 as TRX_CONCURRENCY_TICKETS, '0' as TRX_ISOLATION_LEVEL, 0 as TRX_UNIQUE_CHECKS, 0 as TRX_FOREIGN_KEY_CHECKS, '0' as TRX_LAST_FOREIGN_KEY_ERROR, 0 as TRX_ADAPTIVE_HASH_LATCHED, 0 as TRX_ADAPTIVE_HASH_TIMEOUT, 0 as TRX_IS_READ_ONLY, 0 as TRX_AUTOCOMMIT_NON_LOCKING )__"))) { + LOG_ERROR("fail to set view_definition", K(ret)); + } + } + 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); + table_schema.set_progressive_merge_round(1); + table_schema.set_storage_format_version(3); + table_schema.set_tablet_id(0); + table_schema.set_micro_index_clustered(false); + + table_schema.set_max_used_column_id(column_id); + return ret; +} + +int ObInnerTableSchema::ndb_transid_mysql_connection_map_schema(ObTableSchema &table_schema) +{ + int ret = OB_SUCCESS; + uint64_t column_id = OB_APP_MIN_COLUMN_ID - 1; + + //generated fields: + table_schema.set_tenant_id(OB_SYS_TENANT_ID); + table_schema.set_tablegroup_id(OB_INVALID_ID); + table_schema.set_database_id(OB_INFORMATION_SCHEMA_ID); + table_schema.set_table_id(OB_NDB_TRANSID_MYSQL_CONNECTION_MAP_TID); + table_schema.set_rowkey_split_pos(0); + table_schema.set_is_use_bloomfilter(false); + table_schema.set_progressive_merge_num(0); + table_schema.set_rowkey_column_num(0); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(SYSTEM_VIEW); + table_schema.set_index_type(INDEX_TYPE_IS_NOT); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_NDB_TRANSID_MYSQL_CONNECTION_MAP_TNAME))) { + LOG_ERROR("fail to set table_name", K(ret)); + } + } + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_compress_func_name(OB_DEFAULT_COMPRESS_FUNC_NAME))) { + LOG_ERROR("fail to set compress_func_name", K(ret)); + } + } + table_schema.set_part_level(PARTITION_LEVEL_ZERO); + table_schema.set_charset_type(ObCharset::get_default_charset()); + table_schema.set_collation_type(ObCharset::get_default_collation(ObCharset::get_default_charset())); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_view_definition(R"__( SELECT 0 as MYSQL_CONNECTION_ID, 0 as NODE_ID, 0 as NDB_TRANSID )__"))) { + LOG_ERROR("fail to set view_definition", K(ret)); + } + } + 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); + table_schema.set_progressive_merge_round(1); + table_schema.set_storage_format_version(3); + table_schema.set_tablet_id(0); + table_schema.set_micro_index_clustered(false); + + table_schema.set_max_used_column_id(column_id); + return ret; +} + int ObInnerTableSchema::v_ob_group_io_stat_schema(ObTableSchema &table_schema) { int ret = OB_SUCCESS; diff --git a/src/share/inner_table/ob_inner_table_schema.h b/src/share/inner_table/ob_inner_table_schema.h index d601a4082a..81b81bae0e 100644 --- a/src/share/inner_table/ob_inner_table_schema.h +++ b/src/share/inner_table/ob_inner_table_schema.h @@ -1829,6 +1829,10 @@ public: static int v_ob_tenant_resource_limit_schema(share::schema::ObTableSchema &table_schema); static int gv_ob_tenant_resource_limit_detail_schema(share::schema::ObTableSchema &table_schema); static int v_ob_tenant_resource_limit_detail_schema(share::schema::ObTableSchema &table_schema); + static int innodb_lock_waits_schema(share::schema::ObTableSchema &table_schema); + static int innodb_locks_schema(share::schema::ObTableSchema &table_schema); + static int innodb_trx_schema(share::schema::ObTableSchema &table_schema); + static int ndb_transid_mysql_connection_map_schema(share::schema::ObTableSchema &table_schema); static int v_ob_group_io_stat_schema(share::schema::ObTableSchema &table_schema); static int gv_ob_group_io_stat_schema(share::schema::ObTableSchema &table_schema); static int dba_ob_storage_io_usage_schema(share::schema::ObTableSchema &table_schema); @@ -4785,6 +4789,10 @@ const schema_create_func sys_view_schema_creators [] = { ObInnerTableSchema::v_ob_tenant_resource_limit_schema, ObInnerTableSchema::gv_ob_tenant_resource_limit_detail_schema, ObInnerTableSchema::v_ob_tenant_resource_limit_detail_schema, + ObInnerTableSchema::innodb_lock_waits_schema, + ObInnerTableSchema::innodb_locks_schema, + ObInnerTableSchema::innodb_trx_schema, + ObInnerTableSchema::ndb_transid_mysql_connection_map_schema, ObInnerTableSchema::v_ob_group_io_stat_schema, ObInnerTableSchema::gv_ob_group_io_stat_schema, ObInnerTableSchema::dba_ob_storage_io_usage_schema, @@ -6566,6 +6574,10 @@ const uint64_t tenant_space_tables [] = { OB_V_OB_TENANT_RESOURCE_LIMIT_TID, OB_GV_OB_TENANT_RESOURCE_LIMIT_DETAIL_TID, OB_V_OB_TENANT_RESOURCE_LIMIT_DETAIL_TID, + OB_INNODB_LOCK_WAITS_TID, + OB_INNODB_LOCKS_TID, + OB_INNODB_TRX_TID, + OB_NDB_TRANSID_MYSQL_CONNECTION_MAP_TID, OB_V_OB_GROUP_IO_STAT_TID, OB_GV_OB_GROUP_IO_STAT_TID, OB_DBA_OB_STORAGE_IO_USAGE_TID, @@ -9287,6 +9299,10 @@ const char* const tenant_space_table_names [] = { OB_V_OB_TENANT_RESOURCE_LIMIT_TNAME, OB_GV_OB_TENANT_RESOURCE_LIMIT_DETAIL_TNAME, OB_V_OB_TENANT_RESOURCE_LIMIT_DETAIL_TNAME, + OB_INNODB_LOCK_WAITS_TNAME, + OB_INNODB_LOCKS_TNAME, + OB_INNODB_TRX_TNAME, + OB_NDB_TRANSID_MYSQL_CONNECTION_MAP_TNAME, OB_V_OB_GROUP_IO_STAT_TNAME, OB_GV_OB_GROUP_IO_STAT_TNAME, OB_DBA_OB_STORAGE_IO_USAGE_TNAME, @@ -13578,10 +13594,10 @@ static inline int get_sys_table_lob_aux_schema(const uint64_t tid, const int64_t OB_CORE_TABLE_COUNT = 4; const int64_t OB_SYS_TABLE_COUNT = 304; const int64_t OB_VIRTUAL_TABLE_COUNT = 851; -const int64_t OB_SYS_VIEW_COUNT = 959; -const int64_t OB_SYS_TENANT_TABLE_COUNT = 2119; +const int64_t OB_SYS_VIEW_COUNT = 963; +const int64_t OB_SYS_TENANT_TABLE_COUNT = 2123; const int64_t OB_CORE_SCHEMA_VERSION = 1; -const int64_t OB_BOOTSTRAP_SCHEMA_VERSION = 2122; +const int64_t OB_BOOTSTRAP_SCHEMA_VERSION = 2126; } // end namespace share } // end namespace oceanbase diff --git a/src/share/inner_table/ob_inner_table_schema_constants.h b/src/share/inner_table/ob_inner_table_schema_constants.h index d4f0ab37f9..3f5b8b18c4 100644 --- a/src/share/inner_table/ob_inner_table_schema_constants.h +++ b/src/share/inner_table/ob_inner_table_schema_constants.h @@ -1529,6 +1529,10 @@ const uint64_t OB_GV_OB_TENANT_RESOURCE_LIMIT_TID = 21550; // "GV$OB_TENANT_RESO const uint64_t OB_V_OB_TENANT_RESOURCE_LIMIT_TID = 21551; // "V$OB_TENANT_RESOURCE_LIMIT" const uint64_t OB_GV_OB_TENANT_RESOURCE_LIMIT_DETAIL_TID = 21552; // "GV$OB_TENANT_RESOURCE_LIMIT_DETAIL" const uint64_t OB_V_OB_TENANT_RESOURCE_LIMIT_DETAIL_TID = 21553; // "V$OB_TENANT_RESOURCE_LIMIT_DETAIL" +const uint64_t OB_INNODB_LOCK_WAITS_TID = 21554; // "INNODB_LOCK_WAITS" +const uint64_t OB_INNODB_LOCKS_TID = 21555; // "INNODB_LOCKS" +const uint64_t OB_INNODB_TRX_TID = 21556; // "INNODB_TRX" +const uint64_t OB_NDB_TRANSID_MYSQL_CONNECTION_MAP_TID = 21557; // "NDB_TRANSID_MYSQL_CONNECTION_MAP" const uint64_t OB_V_OB_GROUP_IO_STAT_TID = 21558; // "V$OB_GROUP_IO_STAT" const uint64_t OB_GV_OB_GROUP_IO_STAT_TID = 21559; // "GV$OB_GROUP_IO_STAT" const uint64_t OB_DBA_OB_STORAGE_IO_USAGE_TID = 21560; // "DBA_OB_STORAGE_IO_USAGE" @@ -4372,6 +4376,10 @@ const char *const OB_GV_OB_TENANT_RESOURCE_LIMIT_TNAME = "GV$OB_TENANT_RESOURCE_ const char *const OB_V_OB_TENANT_RESOURCE_LIMIT_TNAME = "V$OB_TENANT_RESOURCE_LIMIT"; const char *const OB_GV_OB_TENANT_RESOURCE_LIMIT_DETAIL_TNAME = "GV$OB_TENANT_RESOURCE_LIMIT_DETAIL"; const char *const OB_V_OB_TENANT_RESOURCE_LIMIT_DETAIL_TNAME = "V$OB_TENANT_RESOURCE_LIMIT_DETAIL"; +const char *const OB_INNODB_LOCK_WAITS_TNAME = "INNODB_LOCK_WAITS"; +const char *const OB_INNODB_LOCKS_TNAME = "INNODB_LOCKS"; +const char *const OB_INNODB_TRX_TNAME = "INNODB_TRX"; +const char *const OB_NDB_TRANSID_MYSQL_CONNECTION_MAP_TNAME = "NDB_TRANSID_MYSQL_CONNECTION_MAP"; const char *const OB_V_OB_GROUP_IO_STAT_TNAME = "V$OB_GROUP_IO_STAT"; const char *const OB_GV_OB_GROUP_IO_STAT_TNAME = "GV$OB_GROUP_IO_STAT"; const char *const OB_DBA_OB_STORAGE_IO_USAGE_TNAME = "DBA_OB_STORAGE_IO_USAGE"; 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 cb7aa89e56..fba5c12100 100644 --- a/src/share/inner_table/ob_inner_table_schema_def.py +++ b/src/share/inner_table/ob_inner_table_schema_def.py @@ -36073,10 +36073,102 @@ AND """.replace("\n", " ") ) -# 21554: INNODB_LOCK_WAITS -# 21555: INNODB_LOCKS -# 21556: INNODB_TRX -# 21557: ndb_transid_mysql_connection_map +def_table_schema( + owner = 'yangyifei.yyf', + database_id = 'OB_INFORMATION_SCHEMA_ID', + table_name = 'INNODB_LOCK_WAITS', + table_id = '21554', + table_type = 'SYSTEM_VIEW', + rowkey_columns = [], + normal_columns = [], + gm_columns = [], + in_tenant_space = True, + view_definition = """ + SELECT '0' as REQUESTING_TRX_ID, + '0' as REQUESTED_LOCK_ID, + '0' as BLOCKING_TRX_ID, + '0' as BLOCKING_LOCK_ID +""".replace("\n", " ") +) + +def_table_schema( + owner = 'yangyifei.yyf', + database_id = 'OB_INFORMATION_SCHEMA_ID', + table_name = 'INNODB_LOCKS', + table_id = '21555', + table_type = 'SYSTEM_VIEW', + rowkey_columns = [], + normal_columns = [], + gm_columns = [], + in_tenant_space = True, + view_definition = """ + SELECT '0' as LOCK_ID, + '0' as LOCK_TRX_ID, + '0' as LOCK_MODE, + '0' as LOCK_TYPE, + '0' as LOCK_TABLE, + '0' as LOCK_INDEX, + 0 as LOCK_SPACE, + 0 as LOCK_PAGE, + 0 as LOCK_REC, + '0' as LOCK_DATA +""".replace("\n", " ") +) + +def_table_schema( + owner = 'yangyifei.yyf', + database_id = 'OB_INFORMATION_SCHEMA_ID', + table_name = 'INNODB_TRX', + table_id = '21556', + table_type = 'SYSTEM_VIEW', + rowkey_columns = [], + normal_columns = [], + gm_columns = [], + in_tenant_space = True, + view_definition = """ + SELECT '0' as TRX_ID, + '0' as TRX_STATE, + now() as TRX_STARTED, + '0' as TRX_REQUESTED_LOCK_ID, + now() as TRX_WAIT_STARTED, + 0 as TRX_WEIGHT, + 0 as TRX_MYSQL_THREAD_ID, + '0' as TRX_QUERY, + '0' as TRX_OPERATION_STATE, + 0 as TRX_TABLE_IN_USE, + 0 as TRX_TABLES_LOCKED, + 0 as TRX_LOCK_STRUCTS, + 0 as TRX_LOCK_MEMORY_BYTES, + 0 as TRX_ROWS_LOCKED, + 0 as TRX_ROWS_MODIFIED, + 0 as TRX_CONCURRENCY_TICKETS, + '0' as TRX_ISOLATION_LEVEL, + 0 as TRX_UNIQUE_CHECKS, + 0 as TRX_FOREIGN_KEY_CHECKS, + '0' as TRX_LAST_FOREIGN_KEY_ERROR, + 0 as TRX_ADAPTIVE_HASH_LATCHED, + 0 as TRX_ADAPTIVE_HASH_TIMEOUT, + 0 as TRX_IS_READ_ONLY, + 0 as TRX_AUTOCOMMIT_NON_LOCKING +""".replace("\n", " ") +) + +def_table_schema( + owner = 'yangyifei.yyf', + database_id = 'OB_INFORMATION_SCHEMA_ID', + table_name = 'NDB_TRANSID_MYSQL_CONNECTION_MAP', + table_id = '21557', + table_type = 'SYSTEM_VIEW', + rowkey_columns = [], + normal_columns = [], + gm_columns = [], + in_tenant_space = True, + view_definition = """ + SELECT 0 as MYSQL_CONNECTION_ID, + 0 as NODE_ID, + 0 as NDB_TRANSID +""".replace("\n", " ") +) def_table_schema( owner = 'wyh329796', @@ -36239,26 +36331,6 @@ def_table_schema( """.replace("\n", " ") ) -# 21562: TABLESPACES -# 21563: INNODB_BUFFER_PAGE -# 21564: INNODB_BUFFER_PAGE_LRU -# 21565: INNODB_BUFFER_POOL_STATS -# 21566: INNODB_CMP -# 21567: INNODB_CMP_PER_INDEX -# 21568: INNODB_CMP_PER_INDEX_RESET -# 21569: INNODB_CMP_RESET -# 21570: INNODB_CMPMEM -# 21571: INNODB_CMPMEM_RESET -# 21572: INNODB_SYS_DATAFILES -# 21573: INNODB_SYS_INDEXES -# 21574: INNODB_SYS_TABLES -# 21575: INNODB_SYS_TABLESPACES -# 21576: INNODB_SYS_TABLESTATS -# 21577: INNODB_SYS_VIRTUAL -# 21578: INNODB_TEMP_TABLE_INFO -# 21579: INNODB_METRICS -# 21580: EVENTS - def_table_schema( owner = 'chaser.ch', tablegroup_id = 'OB_INVALID_ID', diff --git a/src/share/inner_table/table_id_to_name b/src/share/inner_table/table_id_to_name index a6af3d9ec3..1d6b1059b4 100644 --- a/src/share/inner_table/table_id_to_name +++ b/src/share/inner_table/table_id_to_name @@ -2224,6 +2224,10 @@ # 21551: V$OB_TENANT_RESOURCE_LIMIT # 21552: GV$OB_TENANT_RESOURCE_LIMIT_DETAIL # 21553: V$OB_TENANT_RESOURCE_LIMIT_DETAIL +# 21554: INNODB_LOCK_WAITS +# 21555: INNODB_LOCKS +# 21556: INNODB_TRX +# 21557: NDB_TRANSID_MYSQL_CONNECTION_MAP # 21558: V$OB_GROUP_IO_STAT # 21559: GV$OB_GROUP_IO_STAT # 21560: DBA_OB_STORAGE_IO_USAGE diff --git a/src/share/system_variable/ob_system_variable.cpp b/src/share/system_variable/ob_system_variable.cpp index 4413d41526..d84c8800fc 100644 --- a/src/share/system_variable/ob_system_variable.cpp +++ b/src/share/system_variable/ob_system_variable.cpp @@ -2107,10 +2107,11 @@ int ObSysVarOnCheckFuncs::check_and_convert_tx_isolation(ObExecContext &ctx, in_val.get_string().length(), in_val.get_string().ptr()); LOG_WARN("invalid tx_isolation value", K(ret)); } else if (ObTransIsolation::READ_UNCOMMITTED == isolation) { - ret = OB_NOT_SUPPORTED; - LOG_USER_ERROR(OB_NOT_SUPPORTED, - "Isolation level READ-UNCOMMITTED"); - LOG_WARN("isolation level read-uncommitted not supported", K(ret), K(in_val)); + if (lib::is_oracle_mode()) { + ret = OB_NOT_SUPPORTED; + LOG_USER_ERROR(OB_NOT_SUPPORTED, "isolation level READ-UNCOMMITTED"); + LOG_WARN("isolation level read-uncommitted not supported", K(ret), K(in_val)); + } } else { if (OB_FAIL(ob_write_obj(ctx.get_allocator(), in_val, out_val))) { LOG_WARN("deep copy out_val obj failed", K(ret)); @@ -2799,6 +2800,8 @@ int ObSysVarOnUpdateFuncs::update_tx_isolation(ObExecContext &ctx, const ObString &var_val = val.get_string(); ObTxIsolationLevel isolation = transaction::tx_isolation_from_str(var_val); bool for_next_trans = (set_var.set_scope_ == ObSetVar::SET_SCOPE_NEXT_TRANS); + + LOG_INFO("update tx_isolation", K(var_name), K(var_val), K(for_next_trans), K(isolation)); if (OB_ISNULL(session)) { ret = OB_ERR_UNEXPECTED; LOG_WARN("fail to get session info", K(ret)); @@ -2808,10 +2811,14 @@ int ObSysVarOnUpdateFuncs::update_tx_isolation(ObExecContext &ctx, var_name.length(), var_name.ptr(), var_val.length(), var_val.ptr()); LOG_WARN("isolation level is invalid", K(ret), K(var_val), K(var_name)); } else if (ObTxIsolationLevel::RU == isolation) { - ret = OB_NOT_SUPPORTED; - LOG_USER_ERROR(OB_NOT_SUPPORTED, - "Isolation level READ-UNCOMMITTED"); - LOG_WARN("isolation level read-uncommitted not supported", K(ret), K(var_val), K(var_name)); + // only supports RU syntax, the actual behavior is RC + if (lib::is_mysql_mode()) { + isolation = ObTxIsolationLevel::RC; + } else { + ret = OB_NOT_SUPPORTED; + LOG_USER_ERROR(OB_NOT_SUPPORTED, "isolation level READ-UNCOMMITTED"); + LOG_WARN("isolation level read-uncommitted not supported", K(ret), K(var_val), K(var_name)); + } } else if (for_next_trans && FALSE_IT(session->set_tx_isolation(isolation))) { // nothing. } else if (lib::is_oracle_mode()) { diff --git a/src/share/system_variable/ob_system_variable_init.cpp b/src/share/system_variable/ob_system_variable_init.cpp index 1181a16fd5..96a4e0a7d3 100644 --- a/src/share/system_variable/ob_system_variable_init.cpp +++ b/src/share/system_variable/ob_system_variable_init.cpp @@ -4513,7 +4513,7 @@ static struct VarsInit{ [&] (){ ObSysVars[318].default_value_ = "" ; - ObSysVars[318].info_ = "When used with global scope, this variable contains a representation of the set of all transactions executed on the server and GTIDs that have been set by a SET gtid_purged statement" ; + ObSysVars[318].info_ = "When used with global scope, this variable contains a representation of the set of all transactions executed on the server and GTIDs that have been set by a SET gtid_purged statement, merely simulates MySQL 5.7" ; ObSysVars[318].name_ = "gtid_executed" ; ObSysVars[318].data_type_ = ObVarcharType ; ObSysVars[318].flags_ = ObSysVarFlag::GLOBAL_SCOPE | ObSysVarFlag::READONLY | ObSysVarFlag::MYSQL_ONLY ; @@ -4526,7 +4526,7 @@ static struct VarsInit{ [&] (){ ObSysVars[319].default_value_ = "" ; - ObSysVars[319].info_ = "When used with global scope, gtid_owned holds a list of all the GTIDs that are currently in use on the server, with the IDs of the threads that own them. When used with session scope, gtid_owned holds a single GTID that is currently in use by and owned by this session" ; + ObSysVars[319].info_ = "When used with global scope, gtid_owned holds a list of all the GTIDs that are currently in use on the server, with the IDs of the threads that own them. When used with session scope, gtid_owned holds a single GTID that is currently in use by and owned by this session, merely simulates MySQL 5.7" ; ObSysVars[319].name_ = "gtid_owned" ; ObSysVars[319].data_type_ = ObVarcharType ; ObSysVars[319].flags_ = ObSysVarFlag::GLOBAL_SCOPE | ObSysVarFlag::SESSION_SCOPE | ObSysVarFlag::READONLY | ObSysVarFlag::MYSQL_ONLY ; @@ -4539,7 +4539,7 @@ static struct VarsInit{ [&] (){ ObSysVars[320].default_value_ = "0" ; - ObSysVars[320].info_ = "InnoDB rolls back only the last statement on a transaction timeout by default. If --innodb-rollback-on-timeout is specified, a transaction timeout causes InnoDB to abort and roll back the entire transaction" ; + ObSysVars[320].info_ = "InnoDB rolls back only the last statement on a transaction timeout by default. If --innodb-rollback-on-timeout is specified, a transaction timeout causes InnoDB to abort and roll back the entire transaction, merely simulates MySQL 5.7" ; ObSysVars[320].name_ = "innodb_rollback_on_timeout" ; ObSysVars[320].data_type_ = ObIntType ; ObSysVars[320].flags_ = ObSysVarFlag::GLOBAL_SCOPE | ObSysVarFlag::READONLY | ObSysVarFlag::MYSQL_ONLY ; @@ -4552,7 +4552,7 @@ static struct VarsInit{ [&] (){ ObSysVars[321].default_value_ = "0" ; - ObSysVars[321].info_ = "completion_type affects transactions that begin with START TRANSACTION or BEGIN and end with COMMIT or ROLLBACK. It does not apply for XA COMMIT, XA ROLLBACK, or when autocommit=1" ; + ObSysVars[321].info_ = "completion_type affects transactions that begin with START TRANSACTION or BEGIN and end with COMMIT or ROLLBACK. It does not apply for XA COMMIT, XA ROLLBACK, or when autocommit=1, merely simulates MySQL 5.7" ; ObSysVars[321].name_ = "completion_type" ; ObSysVars[321].data_type_ = ObIntType ; ObSysVars[321].enum_names_ = "[u'NO_CHAIN', u'CHAIN', u'RELEASE']" ; @@ -4566,7 +4566,7 @@ static struct VarsInit{ [&] (){ ObSysVars[322].default_value_ = "0" ; - ObSysVars[322].info_ = "Depending on the value of this variable, the server enforces GTID consistency by allowing execution of only statements that can be safely logged using a GTID. You must set this variable to ON before enabling GTID based replication" ; + ObSysVars[322].info_ = "Depending on the value of this variable, the server enforces GTID consistency by allowing execution of only statements that can be safely logged using a GTID. You must set this variable to ON before enabling GTID based replication, merely simulates MySQL 5.7" ; ObSysVars[322].name_ = "enforce_gtid_consistency" ; ObSysVars[322].data_type_ = ObIntType ; ObSysVars[322].enum_names_ = "[u'OFF', u'ON', u'WARN']" ; @@ -4580,7 +4580,7 @@ static struct VarsInit{ [&] (){ ObSysVars[323].default_value_ = "1000" ; - ObSysVars[323].info_ = "Compress the mysql.gtid_executed table each time this many transactions have been processed" ; + ObSysVars[323].info_ = "Compress the mysql.gtid_executed table each time this many transactions have been processed, merely simulates MySQL 5.7" ; ObSysVars[323].name_ = "gtid_executed_compression_period" ; ObSysVars[323].data_type_ = ObIntType ; ObSysVars[323].min_val_ = "0" ; @@ -4595,7 +4595,7 @@ static struct VarsInit{ [&] (){ ObSysVars[324].default_value_ = "0" ; - ObSysVars[324].info_ = "Controls whether GTID based logging is enabled and what type of transactions the logs can contain" ; + ObSysVars[324].info_ = "Controls whether GTID based logging is enabled and what type of transactions the logs can contain, merely simulates MySQL 5.7" ; ObSysVars[324].name_ = "gtid_mode" ; ObSysVars[324].data_type_ = ObIntType ; ObSysVars[324].enum_names_ = "[u'OFF', u'OFF_PERMISSIVE', u'ON_PERMISSIVE', u'ON']" ; @@ -4609,7 +4609,7 @@ static struct VarsInit{ [&] (){ ObSysVars[325].default_value_ = "0" ; - ObSysVars[325].info_ = "This variable is used to specify whether and how the next GTID is obtained" ; + ObSysVars[325].info_ = "This variable is used to specify whether and how the next GTID is obtained, merely simulates MySQL 5.7" ; ObSysVars[325].name_ = "gtid_next" ; ObSysVars[325].data_type_ = ObIntType ; ObSysVars[325].enum_names_ = "[u'AUTOMATIC', u'ANONYMOUS']" ; @@ -4623,7 +4623,7 @@ static struct VarsInit{ [&] (){ ObSysVars[326].default_value_ = "" ; - ObSysVars[326].info_ = "The global value of the gtid_purged system variable is a GTID set consisting of the GTIDs of all the transactions that have been committed on the server, but do not exist in any binary log file on the server. gtid_purged is a subset of gtid_executed" ; + ObSysVars[326].info_ = "The global value of the gtid_purged system variable is a GTID set consisting of the GTIDs of all the transactions that have been committed on the server, but do not exist in any binary log file on the server. gtid_purged is a subset of gtid_executed, merely simulates MySQL 5.7" ; ObSysVars[326].name_ = "gtid_purged" ; ObSysVars[326].data_type_ = ObVarcharType ; ObSysVars[326].flags_ = ObSysVarFlag::GLOBAL_SCOPE | ObSysVarFlag::MYSQL_ONLY ; @@ -4636,7 +4636,7 @@ static struct VarsInit{ [&] (){ ObSysVars[327].default_value_ = "5" ; - ObSysVars[327].info_ = "How often to auto-commit idle connections that use the InnoDB memcached interface, in seconds" ; + ObSysVars[327].info_ = "How often to auto-commit idle connections that use the InnoDB memcached interface, in seconds, merely simulates MySQL 5.7" ; ObSysVars[327].name_ = "innodb_api_bk_commit_interval" ; ObSysVars[327].data_type_ = ObIntType ; ObSysVars[327].min_val_ = "1" ; @@ -4651,7 +4651,7 @@ static struct VarsInit{ [&] (){ ObSysVars[328].default_value_ = "0" ; - ObSysVars[328].info_ = "Controls the transaction isolation level on queries processed by the memcached interface" ; + ObSysVars[328].info_ = "Controls the transaction isolation level on queries processed by the memcached interface, merely simulates MySQL 5.7" ; ObSysVars[328].name_ = "innodb_api_trx_level" ; ObSysVars[328].data_type_ = ObIntType ; ObSysVars[328].min_val_ = "0" ; @@ -4666,7 +4666,7 @@ static struct VarsInit{ [&] (){ ObSysVars[329].default_value_ = "1" ; - ObSysVars[329].info_ = "Enables InnoDB support for two-phase commit in XA transactions, causing an extra disk flush for transaction preparation" ; + ObSysVars[329].info_ = "Enables InnoDB support for two-phase commit in XA transactions, causing an extra disk flush for transaction preparation, merely simulates MySQL 5.7" ; ObSysVars[329].name_ = "innodb_support_xa" ; ObSysVars[329].data_type_ = ObIntType ; ObSysVars[329].flags_ = ObSysVarFlag::GLOBAL_SCOPE | ObSysVarFlag::SESSION_SCOPE | ObSysVarFlag::MYSQL_ONLY ; @@ -4679,7 +4679,7 @@ static struct VarsInit{ [&] (){ ObSysVars[330].default_value_ = "0" ; - ObSysVars[330].info_ = "Controls whether the server returns GTIDs to the client, enabling the client to use them to track the server state" ; + ObSysVars[330].info_ = "Controls whether the server returns GTIDs to the client, enabling the client to use them to track the server state, merely simulates MySQL 5.7" ; ObSysVars[330].name_ = "session_track_gtids" ; ObSysVars[330].data_type_ = ObIntType ; ObSysVars[330].enum_names_ = "[u'OFF', u'OWN_GTID', u'ALL_GTIDS']" ; @@ -4693,7 +4693,7 @@ static struct VarsInit{ [&] (){ ObSysVars[331].default_value_ = "0" ; - ObSysVars[331].info_ = "Controls whether the server tracks the state and characteristics of transactions within the current session and notifies the client to make this information available" ; + ObSysVars[331].info_ = "Controls whether the server tracks the state and characteristics of transactions within the current session and notifies the client to make this information available, merely simulates MySQL 5.7" ; ObSysVars[331].name_ = "session_track_transaction_info" ; ObSysVars[331].data_type_ = ObIntType ; ObSysVars[331].enum_names_ = "[u'OFF', u'STATE', u'CHARACTERISTICS']" ; @@ -4707,7 +4707,7 @@ static struct VarsInit{ [&] (){ ObSysVars[332].default_value_ = "8192" ; - ObSysVars[332].info_ = "The amount in bytes by which to increase a per-transaction memory pool which needs memory" ; + ObSysVars[332].info_ = "The amount in bytes by which to increase a per-transaction memory pool which needs memory, merely simulates MySQL 5.7" ; ObSysVars[332].name_ = "transaction_alloc_block_size" ; ObSysVars[332].data_type_ = ObIntType ; ObSysVars[332].min_val_ = "1024" ; @@ -4722,7 +4722,7 @@ static struct VarsInit{ [&] (){ ObSysVars[333].default_value_ = "0" ; - ObSysVars[333].info_ = "When set to 1 or ON, this variable enables batching of statements within the same transaction. To use this variable, autocommit must first be disabled by setting it to 0 or OFF; otherwise, setting transaction_allow_batching has no effect" ; + ObSysVars[333].info_ = "When set to 1 or ON, this variable enables batching of statements within the same transaction. To use this variable, autocommit must first be disabled by setting it to 0 or OFF; otherwise, setting transaction_allow_batching has no effect, merely simulates MySQL 5.7" ; ObSysVars[333].name_ = "transaction_allow_batching" ; ObSysVars[333].data_type_ = ObIntType ; ObSysVars[333].flags_ = ObSysVarFlag::SESSION_SCOPE | ObSysVarFlag::MYSQL_ONLY ; @@ -4735,7 +4735,7 @@ static struct VarsInit{ [&] (){ ObSysVars[334].default_value_ = "4096" ; - ObSysVars[334].info_ = "There is a per-transaction memory pool from which various transaction-related allocations take memory. The initial size of the pool in bytes is transaction_prealloc_size" ; + ObSysVars[334].info_ = "There is a per-transaction memory pool from which various transaction-related allocations take memory. The initial size of the pool in bytes is transaction_prealloc_size, merely simulates MySQL 5.7" ; ObSysVars[334].name_ = "transaction_prealloc_size" ; ObSysVars[334].data_type_ = ObIntType ; ObSysVars[334].min_val_ = "1024" ; @@ -4750,7 +4750,7 @@ static struct VarsInit{ [&] (){ ObSysVars[335].default_value_ = "0" ; - ObSysVars[335].info_ = "Defines the algorithm used to generate a hash identifying the writes associated with a transaction" ; + ObSysVars[335].info_ = "Defines the algorithm used to generate a hash identifying the writes associated with a transaction, merely simulates MySQL 5.7" ; ObSysVars[335].name_ = "transaction_write_set_extraction" ; ObSysVars[335].data_type_ = ObIntType ; ObSysVars[335].enum_names_ = "[u'OFF', u'MURMUR32', u'XXHASH64']" ; @@ -6579,7 +6579,7 @@ static struct VarsInit{ [&] (){ ObSysVars[470].default_value_ = "0" ; - ObSysVars[470].info_ = "Starts InnoDB in read-only mode. For distributing database applications or data sets on read-only media. Can also be used in data warehouses to share the same data directory between multiple instances." ; + ObSysVars[470].info_ = "Starts InnoDB in read-only mode. For distributing database applications or data sets on read-only media. Can also be used in data warehouses to share the same data directory between multiple instances, merely simulates MySQL 5.7" ; ObSysVars[470].name_ = "innodb_read_only" ; ObSysVars[470].data_type_ = ObIntType ; ObSysVars[470].flags_ = ObSysVarFlag::GLOBAL_SCOPE | ObSysVarFlag::MYSQL_ONLY | ObSysVarFlag::READONLY ; @@ -6592,7 +6592,7 @@ static struct VarsInit{ [&] (){ ObSysVars[471].default_value_ = "0" ; - ObSysVars[471].info_ = "Use this option to disable row locks when InnoDB memcached performs DML operations. By default, innodb_api_disable_rowlock is disabled, which means that memcached requests row locks for get and set operations." ; + ObSysVars[471].info_ = "Use this option to disable row locks when InnoDB memcached performs DML operations. By default, innodb_api_disable_rowlock is disabled, which means that memcached requests row locks for get and set operations, merely simulates MySQL 5.7" ; ObSysVars[471].name_ = "innodb_api_disable_rowlock" ; ObSysVars[471].data_type_ = ObIntType ; ObSysVars[471].flags_ = ObSysVarFlag::GLOBAL_SCOPE | ObSysVarFlag::MYSQL_ONLY | ObSysVarFlag::READONLY ; @@ -6605,7 +6605,7 @@ static struct VarsInit{ [&] (){ ObSysVars[472].default_value_ = "1" ; - ObSysVars[472].info_ = "The lock mode to use for generating auto-increment values. Permissible values are 0, 1, or 2, for traditional, consecutive, or interleaved, respectively. The default setting is 1 (consecutive)." ; + ObSysVars[472].info_ = "The lock mode to use for generating auto-increment values. Permissible values are 0, 1, or 2, for traditional, consecutive, or interleaved, respectively. The default setting is 1 (consecutive), merely simulates MySQL 5.7" ; ObSysVars[472].name_ = "innodb_autoinc_lock_mode" ; ObSysVars[472].data_type_ = ObIntType ; ObSysVars[472].min_val_ = "0" ; @@ -6620,7 +6620,7 @@ static struct VarsInit{ [&] (){ ObSysVars[473].default_value_ = "1" ; - ObSysVars[473].info_ = "This is OFF if mysqld uses external locking (system locking), ON if external locking is disabled." ; + ObSysVars[473].info_ = "This is OFF if mysqld uses external locking (system locking), ON if external locking is disabled, merely simulates MySQL 5.7" ; ObSysVars[473].name_ = "skip_external_locking" ; ObSysVars[473].data_type_ = ObIntType ; ObSysVars[473].flags_ = ObSysVarFlag::GLOBAL_SCOPE | ObSysVarFlag::MYSQL_ONLY | ObSysVarFlag::READONLY ; @@ -6633,7 +6633,7 @@ static struct VarsInit{ [&] (){ ObSysVars[474].default_value_ = "0" ; - ObSysVars[474].info_ = "If the read_only system variable is enabled, the server permits no client updates except from users who have the SUPER privilege. If the super_read_only system variable is also enabled, the server prohibits client updates even from users who have SUPER." ; + ObSysVars[474].info_ = "If the read_only system variable is enabled, the server permits no client updates except from users who have the SUPER privilege. If the super_read_only system variable is also enabled, the server prohibits client updates even from users who have SUPER, merely simulates MySQL 5.7" ; ObSysVars[474].name_ = "super_read_only" ; ObSysVars[474].data_type_ = ObIntType ; ObSysVars[474].flags_ = ObSysVarFlag::GLOBAL_SCOPE | ObSysVarFlag::MYSQL_ONLY | ObSysVarFlag::READONLY ; diff --git a/src/share/system_variable/ob_system_variable_init.json b/src/share/system_variable/ob_system_variable_init.json index 7443db15f5..42d3a7d96c 100644 --- a/src/share/system_variable/ob_system_variable_init.json +++ b/src/share/system_variable/ob_system_variable_init.json @@ -3825,6 +3825,7 @@ "background_cn": "", "ref_url": "" }, + "flush_time": { "id": 10182, "name": "flush_time", @@ -4673,13 +4674,13 @@ "background_cn": "", "ref_url": "" }, - "gtid_executed": { + "gtid_executed": { "id": 10234, "name": "gtid_executed", "default_value": "", "base_value": "", "data_type": "varchar", - "info": "When used with global scope, this variable contains a representation of the set of all transactions executed on the server and GTIDs that have been set by a SET gtid_purged statement", + "info": "When used with global scope, this variable contains a representation of the set of all transactions executed on the server and GTIDs that have been set by a SET gtid_purged statement, merely simulates MySQL 5.7", "flags": "GLOBAL | READONLY | MYSQL_ONLY", "publish_version": "424", "info_cn": "", @@ -4692,7 +4693,7 @@ "default_value": "", "base_value": "", "data_type": "varchar", - "info": "When used with global scope, gtid_owned holds a list of all the GTIDs that are currently in use on the server, with the IDs of the threads that own them. When used with session scope, gtid_owned holds a single GTID that is currently in use by and owned by this session", + "info": "When used with global scope, gtid_owned holds a list of all the GTIDs that are currently in use on the server, with the IDs of the threads that own them. When used with session scope, gtid_owned holds a single GTID that is currently in use by and owned by this session, merely simulates MySQL 5.7", "flags": "GLOBAL | SESSION | READONLY | MYSQL_ONLY", "publish_version": "424", "info_cn": "", @@ -4705,7 +4706,7 @@ "default_value": "0", "base_value": "0", "data_type": "bool", - "info": "InnoDB rolls back only the last statement on a transaction timeout by default. If --innodb-rollback-on-timeout is specified, a transaction timeout causes InnoDB to abort and roll back the entire transaction", + "info": "InnoDB rolls back only the last statement on a transaction timeout by default. If --innodb-rollback-on-timeout is specified, a transaction timeout causes InnoDB to abort and roll back the entire transaction, merely simulates MySQL 5.7", "flags": "GLOBAL | READONLY | MYSQL_ONLY", "publish_version": "424", "info_cn": "", @@ -4718,7 +4719,7 @@ "default_value": "0", "base_value": "0", "data_type": "enum", - "info": "completion_type affects transactions that begin with START TRANSACTION or BEGIN and end with COMMIT or ROLLBACK. It does not apply for XA COMMIT, XA ROLLBACK, or when autocommit=1", + "info": "completion_type affects transactions that begin with START TRANSACTION or BEGIN and end with COMMIT or ROLLBACK. It does not apply for XA COMMIT, XA ROLLBACK, or when autocommit=1, merely simulates MySQL 5.7", "flags": "GLOBAL | SESSION | MYSQL_ONLY", "enum_names": [ "NO_CHAIN", @@ -4736,7 +4737,7 @@ "default_value": "0", "base_value": "0", "data_type": "enum", - "info": "Depending on the value of this variable, the server enforces GTID consistency by allowing execution of only statements that can be safely logged using a GTID. You must set this variable to ON before enabling GTID based replication", + "info": "Depending on the value of this variable, the server enforces GTID consistency by allowing execution of only statements that can be safely logged using a GTID. You must set this variable to ON before enabling GTID based replication, merely simulates MySQL 5.7", "flags": "GLOBAL | MYSQL_ONLY", "enum_names": [ "OFF", @@ -4754,7 +4755,7 @@ "default_value": "1000", "base_value": "1000", "data_type": "int", - "info": "Compress the mysql.gtid_executed table each time this many transactions have been processed", + "info": "Compress the mysql.gtid_executed table each time this many transactions have been processed, merely simulates MySQL 5.7", "flags": "GLOBAL | MYSQL_ONLY", "min_val": "0", "max_val": "4294967295", @@ -4769,7 +4770,7 @@ "default_value": "0", "base_value": "0", "data_type": "enum", - "info": "Controls whether GTID based logging is enabled and what type of transactions the logs can contain", + "info": "Controls whether GTID based logging is enabled and what type of transactions the logs can contain, merely simulates MySQL 5.7", "flags": "GLOBAL | MYSQL_ONLY", "enum_names": [ "OFF", @@ -4788,7 +4789,7 @@ "default_value": "0", "base_value": "0", "data_type": "enum", - "info": "This variable is used to specify whether and how the next GTID is obtained", + "info": "This variable is used to specify whether and how the next GTID is obtained, merely simulates MySQL 5.7", "flags": "SESSION | MYSQL_ONLY", "enum_names": [ "AUTOMATIC", @@ -4805,7 +4806,7 @@ "default_value": "", "base_value": "", "data_type": "varchar", - "info": "The global value of the gtid_purged system variable is a GTID set consisting of the GTIDs of all the transactions that have been committed on the server, but do not exist in any binary log file on the server. gtid_purged is a subset of gtid_executed", + "info": "The global value of the gtid_purged system variable is a GTID set consisting of the GTIDs of all the transactions that have been committed on the server, but do not exist in any binary log file on the server. gtid_purged is a subset of gtid_executed, merely simulates MySQL 5.7", "flags": "GLOBAL | MYSQL_ONLY", "publish_version": "424", "info_cn": "", @@ -4818,7 +4819,7 @@ "default_value": "5", "base_value": "5", "data_type": "int", - "info": "How often to auto-commit idle connections that use the InnoDB memcached interface, in seconds", + "info": "How often to auto-commit idle connections that use the InnoDB memcached interface, in seconds, merely simulates MySQL 5.7", "flags": "GLOBAL | MYSQL_ONLY", "min_val": "1", "max_val": "1073741824", @@ -4833,7 +4834,7 @@ "default_value": "0", "base_value": "0", "data_type": "int", - "info": "Controls the transaction isolation level on queries processed by the memcached interface", + "info": "Controls the transaction isolation level on queries processed by the memcached interface, merely simulates MySQL 5.7", "flags": "GLOBAL | MYSQL_ONLY", "min_val": "0", "max_val": "3", @@ -4848,7 +4849,7 @@ "default_value": "1", "base_value": "1", "data_type": "bool", - "info": "Enables InnoDB support for two-phase commit in XA transactions, causing an extra disk flush for transaction preparation", + "info": "Enables InnoDB support for two-phase commit in XA transactions, causing an extra disk flush for transaction preparation, merely simulates MySQL 5.7", "flags": "GLOBAL | SESSION | MYSQL_ONLY", "publish_version": "424", "info_cn": "", @@ -4861,7 +4862,7 @@ "default_value": "0", "base_value": "0", "data_type": "enum", - "info": "Controls whether the server returns GTIDs to the client, enabling the client to use them to track the server state", + "info": "Controls whether the server returns GTIDs to the client, enabling the client to use them to track the server state, merely simulates MySQL 5.7", "flags": "GLOBAL | SESSION | MYSQL_ONLY", "enum_names": [ "OFF", @@ -4879,7 +4880,7 @@ "default_value": "0", "base_value": "0", "data_type": "enum", - "info": "Controls whether the server tracks the state and characteristics of transactions within the current session and notifies the client to make this information available", + "info": "Controls whether the server tracks the state and characteristics of transactions within the current session and notifies the client to make this information available, merely simulates MySQL 5.7", "flags": "GLOBAL | SESSION | MYSQL_ONLY", "enum_names": [ "OFF", @@ -4898,7 +4899,7 @@ "default_value": "8192", "base_value": "8192", "data_type": "int", - "info": "The amount in bytes by which to increase a per-transaction memory pool which needs memory", + "info": "The amount in bytes by which to increase a per-transaction memory pool which needs memory, merely simulates MySQL 5.7", "flags": "GLOBAL | SESSION | MYSQL_ONLY", "min_val": "1024", "max_val": "131072", @@ -4913,7 +4914,7 @@ "default_value": "0", "base_value": "0", "data_type": "bool", - "info": "When set to 1 or ON, this variable enables batching of statements within the same transaction. To use this variable, autocommit must first be disabled by setting it to 0 or OFF; otherwise, setting transaction_allow_batching has no effect", + "info": "When set to 1 or ON, this variable enables batching of statements within the same transaction. To use this variable, autocommit must first be disabled by setting it to 0 or OFF; otherwise, setting transaction_allow_batching has no effect, merely simulates MySQL 5.7", "flags": "SESSION | MYSQL_ONLY", "publish_version": "424", "info_cn": "", @@ -4926,7 +4927,7 @@ "default_value": "4096", "base_value": "4096", "data_type": "int", - "info": "There is a per-transaction memory pool from which various transaction-related allocations take memory. The initial size of the pool in bytes is transaction_prealloc_size", + "info": "There is a per-transaction memory pool from which various transaction-related allocations take memory. The initial size of the pool in bytes is transaction_prealloc_size, merely simulates MySQL 5.7", "flags": "GLOBAL | SESSION | MYSQL_ONLY", "min_val": "1024", "max_val": "131072", @@ -4941,7 +4942,7 @@ "default_value": "0", "base_value": "0", "data_type": "enum", - "info": "Defines the algorithm used to generate a hash identifying the writes associated with a transaction", + "info": "Defines the algorithm used to generate a hash identifying the writes associated with a transaction, merely simulates MySQL 5.7", "flags": "GLOBAL | SESSION | MYSQL_ONLY", "enum_names": [ "OFF", @@ -6822,7 +6823,7 @@ "default_value": "0", "base_value": "0", "data_type": "bool", - "info": "Starts InnoDB in read-only mode. For distributing database applications or data sets on read-only media. Can also be used in data warehouses to share the same data directory between multiple instances.", + "info": "Starts InnoDB in read-only mode. For distributing database applications or data sets on read-only media. Can also be used in data warehouses to share the same data directory between multiple instances, merely simulates MySQL 5.7", "flags": "GLOBAL | MYSQL_ONLY | READONLY", "publish_version": "424", "info_cn": "", @@ -6835,7 +6836,7 @@ "default_value": "0", "base_value": "0", "data_type": "bool", - "info": "Use this option to disable row locks when InnoDB memcached performs DML operations. By default, innodb_api_disable_rowlock is disabled, which means that memcached requests row locks for get and set operations.", + "info": "Use this option to disable row locks when InnoDB memcached performs DML operations. By default, innodb_api_disable_rowlock is disabled, which means that memcached requests row locks for get and set operations, merely simulates MySQL 5.7", "flags": "GLOBAL | MYSQL_ONLY | READONLY", "publish_version": "424", "info_cn": "", @@ -6848,7 +6849,7 @@ "default_value": "1", "base_value": "1", "data_type": "int", - "info": "The lock mode to use for generating auto-increment values. Permissible values are 0, 1, or 2, for traditional, consecutive, or interleaved, respectively. The default setting is 1 (consecutive).", + "info": "The lock mode to use for generating auto-increment values. Permissible values are 0, 1, or 2, for traditional, consecutive, or interleaved, respectively. The default setting is 1 (consecutive), merely simulates MySQL 5.7", "flags": "GLOBAL | MYSQL_ONLY | READONLY", "min_val": "0", "max_val": "2", @@ -6863,7 +6864,7 @@ "default_value": "1", "base_value": "1", "data_type": "bool", - "info": "This is OFF if mysqld uses external locking (system locking), ON if external locking is disabled.", + "info": "This is OFF if mysqld uses external locking (system locking), ON if external locking is disabled, merely simulates MySQL 5.7", "flags": "GLOBAL | MYSQL_ONLY | READONLY", "publish_version": "424", "info_cn": "", @@ -6876,7 +6877,7 @@ "default_value": "0", "base_value": "0", "data_type": "bool", - "info": "If the read_only system variable is enabled, the server permits no client updates except from users who have the SUPER privilege. If the super_read_only system variable is also enabled, the server prohibits client updates even from users who have SUPER.", + "info": "If the read_only system variable is enabled, the server permits no client updates except from users who have the SUPER privilege. If the super_read_only system variable is also enabled, the server prohibits client updates even from users who have SUPER, merely simulates MySQL 5.7", "flags": "GLOBAL | MYSQL_ONLY | READONLY", "publish_version": "424", "info_cn": "", diff --git a/src/sql/CMakeLists.txt b/src/sql/CMakeLists.txt index d422c81d73..439985433c 100644 --- a/src/sql/CMakeLists.txt +++ b/src/sql/CMakeLists.txt @@ -773,6 +773,7 @@ ob_set_subtarget(ob_sql engine_expr engine/expr/ob_expr_vec_key.cpp engine/expr/ob_expr_vec_data.cpp engine/expr/ob_expr_topn_filter.cpp + engine/expr/ob_expr_gtid.cpp engine/expr/ob_expr_inner_table_option_printer.cpp engine/expr/ob_expr_rb_build_empty.cpp engine/expr/ob_expr_rb_is_empty.cpp diff --git a/src/sql/engine/cmd/ob_variable_set_executor.cpp b/src/sql/engine/cmd/ob_variable_set_executor.cpp index 5fef667544..3f54e260cf 100644 --- a/src/sql/engine/cmd/ob_variable_set_executor.cpp +++ b/src/sql/engine/cmd/ob_variable_set_executor.cpp @@ -1380,7 +1380,9 @@ int ObVariableSetExecutor::is_support(const share::ObSetVar &set_var) LOG_WARN("unknown variable", K(set_var.var_name_), K(ret)); } else if ((SYS_VAR_DEBUG <= var_id && SYS_VAR_STORED_PROGRAM_CACHE >= var_id) || (SYS_VAR_INSERT_ID <= var_id && SYS_VAR_MAX_WRITE_LOCK_COUNT >= var_id) || - (SYS_VAR_BIG_TABLES <= var_id && SYS_VAR_DELAYED_INSERT_LIMIT >= var_id)) { + (SYS_VAR_BIG_TABLES <= var_id && SYS_VAR_DELAYED_INSERT_LIMIT >= var_id) || + (SYS_VAR_GTID_EXECUTED <= var_id && SYS_VAR_TRANSACTION_WRITE_SET_EXTRACTION >= var_id) || + (SYS_VAR_INNODB_READ_ONLY <= var_id && SYS_VAR_SUPER_READ_ONLY >= var_id)) { ret = OB_NOT_SUPPORTED; LOG_WARN("This variable not support, just mock", K(set_var.var_name_), K(var_id), K(ret)); } diff --git a/src/sql/engine/expr/ob_expr_eval_functions.cpp b/src/sql/engine/expr/ob_expr_eval_functions.cpp index 96713100db..458bba4f78 100644 --- a/src/sql/engine/expr/ob_expr_eval_functions.cpp +++ b/src/sql/engine/expr/ob_expr_eval_functions.cpp @@ -386,6 +386,7 @@ #include "ob_expr_func_ceil.h" #include "ob_expr_topn_filter.h" #include "ob_expr_sdo_relate.h" +#include "ob_expr_gtid.h" #include "ob_expr_inner_table_option_printer.h" #include "ob_expr_password.h" #include "ob_expr_decode_trace_id.h" @@ -1189,10 +1190,10 @@ static ObExpr::EvalFunc g_expr_eval_functions[] = { ObExprIsUsedLock::is_used_lock, /* 683 */ ObExprReleaseLock::release_lock, /* 684 */ ObExprReleaseAllLocks::release_all_locks, /* 685 */ - NULL, // ObExprGTIDSubset::eval_subset, /* 686 */ - NULL, // ObExprGTIDSubtract::eval_subtract, /* 687 */ - NULL, // ObExprWaitForExecutedGTIDSet::eval_wait_for_executed_gtid_set, /* 688 */ - NULL, // ObExprWaitUntilSQLThreadAfterGTIDs::eval_wait_until_sql_thread_after_gtids /* 689 */ + ObExprGTIDSubset::eval_subset, /* 686 */ + ObExprGTIDSubtract::eval_subtract, /* 687 */ + ObExprWaitForExecutedGTIDSet::eval_wait_for_executed_gtid_set, /* 688 */ + ObExprWaitUntilSQLThreadAfterGTIDs::eval_wait_until_sql_thread_after_gtids, /* 689 */ ObExprLastRefreshScn::eval_last_refresh_scn, /* 690 */ ObExprDocLength::generate_doc_length, /* 691 */ ObExprTopNFilter::eval_topn_filter, /* 692 */ diff --git a/src/sql/engine/expr/ob_expr_gtid.cpp b/src/sql/engine/expr/ob_expr_gtid.cpp new file mode 100644 index 0000000000..a65f0aa9d3 --- /dev/null +++ b/src/sql/engine/expr/ob_expr_gtid.cpp @@ -0,0 +1,239 @@ +/** + * Copyright (c) 2021 OceanBase + * OceanBase CE is licensed under Mulan PubL v2. + * You can use this software according to the terms and conditions of the Mulan PubL v2. + * You may obtain a copy of Mulan PubL v2 at: + * http://license.coscl.org.cn/MulanPubL-2.0 + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, + * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, + * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PubL v2 for more details. + * This file contains implementation for _st_asmvtgeom. + */ + +#define USING_LOG_PREFIX SQL_ENG + +#include "sql/engine/expr/ob_expr_gtid.h" +using namespace oceanbase::common; +using namespace oceanbase::sql; + +namespace oceanbase +{ +namespace sql +{ +ObExprGTID::ObExprGTID(common::ObIAllocator &alloc, ObExprOperatorType type, const char *name, int32_t param_num) : + ObFuncExprOperator(alloc, type, name, param_num, NOT_VALID_FOR_GENERATED_COL, NOT_ROW_DIMENSION){}; + +ObExprGTID::~ObExprGTID(){}; + +ObExprGTIDSubset::ObExprGTIDSubset(common::ObIAllocator &alloc) : + ObExprGTID(alloc, T_FUN_SYS_GTID_SUBSET, N_GTID_SUBSET, 2){}; + +int ObExprGTIDSubset::cg_expr(ObExprCGCtx &expr_cg_ctx, const ObRawExpr &raw_expr, ObExpr &rt_expr) const +{ + int ret = OB_SUCCESS; + UNUSED(expr_cg_ctx); + UNUSED(raw_expr); + + CK (2 == rt_expr.arg_cnt_); + const ObExpr *set1 = rt_expr.args_[0]; + const ObExpr *set2 = rt_expr.args_[1]; + CK (OB_NOT_NULL(set1), OB_NOT_NULL(set2)); + + if (OB_SUCC(ret)) { + rt_expr.eval_func_ = ObExprGTIDSubset::eval_subset; + } + + return ret; +} + +int ObExprGTIDSubset::calc_result_type2(ObExprResType &type, + ObExprResType &type1, + ObExprResType &type2, + common::ObExprTypeCtx &type_ctx) const +{ + int ret = OB_SUCCESS; + // result + type.set_type(ObIntType); + type_ctx.set_cast_mode(type_ctx.get_cast_mode() | CM_NULL_ON_WARN); + + // set1 + type1.set_calc_type(ObVarcharType); + type1.set_calc_collation_type(ObCharset::get_system_collation()); + + // set2 + type2.set_calc_type(ObVarcharType); + type2.set_calc_collation_type(ObCharset::get_system_collation()); + return ret; +} + +int ObExprGTIDSubset::eval_subset(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &result) +{ + // mock + result.set_null(); + return OB_SUCCESS; +} + +ObExprGTIDSubtract::ObExprGTIDSubtract(common::ObIAllocator &alloc) : + ObExprGTID(alloc, T_FUN_SYS_GTID_SUBTRACT, N_GTID_SUBTRACT, 2){}; + +int ObExprGTIDSubtract::cg_expr(ObExprCGCtx &expr_cg_ctx, const ObRawExpr &raw_expr, ObExpr &rt_expr) const +{ + int ret = OB_SUCCESS; + UNUSED(expr_cg_ctx); + UNUSED(raw_expr); + + CK (2 == rt_expr.arg_cnt_); + const ObExpr *set1 = rt_expr.args_[0]; + const ObExpr *set2 = rt_expr.args_[1]; + CK (OB_NOT_NULL(set1), OB_NOT_NULL(set2)); + + if (OB_SUCC(ret)) { + rt_expr.eval_func_ = ObExprGTIDSubtract::eval_subtract; + } + + return ret; +} + +int ObExprGTIDSubtract::calc_result_type2(ObExprResType &type, + ObExprResType &type1, + ObExprResType &type2, + common::ObExprTypeCtx &type_ctx) const +{ + int ret = OB_SUCCESS; + // result + type.set_type(ObIntType); + type_ctx.set_cast_mode(type_ctx.get_cast_mode() | CM_NULL_ON_WARN); + + // set1 + type1.set_calc_type(ObVarcharType); + type1.set_calc_collation_type(ObCharset::get_system_collation()); + + // set2 + type2.set_calc_type(ObVarcharType); + type2.set_calc_collation_type(ObCharset::get_system_collation()); + return ret; +} + +int ObExprGTIDSubtract::eval_subtract(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &result) +{ + // mock + result.set_null(); + return OB_SUCCESS; +} + +ObExprWaitForExecutedGTIDSet::ObExprWaitForExecutedGTIDSet(common::ObIAllocator &alloc) : + ObExprGTID(alloc, T_FUN_SYS_WAIT_FOR_EXECUTED_GTID_SET, N_WAIT_FOR_EXECUTED_GTID_SET, ONE_OR_TWO){}; + +int ObExprWaitForExecutedGTIDSet::cg_expr(ObExprCGCtx &expr_cg_ctx, const ObRawExpr &raw_expr, ObExpr &rt_expr) const +{ + int ret = OB_SUCCESS; + UNUSED(expr_cg_ctx); + UNUSED(raw_expr); + + CK (1 == rt_expr.arg_cnt_ || 2 == rt_expr.arg_cnt_); + const ObExpr *set = rt_expr.args_[0]; + CK (OB_NOT_NULL(set)); + if (2 == rt_expr.arg_cnt_) { + const ObExpr *timeout = rt_expr.args_[1]; + CK (OB_NOT_NULL(timeout)); + } + + if (OB_SUCC(ret)) { + rt_expr.eval_func_ = ObExprWaitForExecutedGTIDSet::eval_wait_for_executed_gtid_set; + } + + return ret; +} + +int ObExprWaitForExecutedGTIDSet::calc_result_typeN(ObExprResType &type, + ObExprResType *types, + int64_t param_num, + common::ObExprTypeCtx &type_ctx) const +{ + int ret = OB_SUCCESS; + // result + type.set_type(ObIntType); + type_ctx.set_cast_mode(type_ctx.get_cast_mode() | CM_NULL_ON_WARN); + + // gtid_set + types[0].set_calc_type(ObVarcharType); + types[0].set_calc_collation_type(ObCharset::get_system_collation()); + + // timeout + if (2 == param_num) { + type.set_type(ObIntType); + } + + return ret; +} + +int ObExprWaitForExecutedGTIDSet::eval_wait_for_executed_gtid_set(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &result) +{ + // mock + result.set_null(); + return OB_SUCCESS; +} + + +ObExprWaitUntilSQLThreadAfterGTIDs::ObExprWaitUntilSQLThreadAfterGTIDs(common::ObIAllocator &alloc) : + ObExprGTID(alloc, T_FUN_SYS_WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS, N_WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS, MORE_THAN_ZERO){}; + +int ObExprWaitUntilSQLThreadAfterGTIDs::cg_expr(ObExprCGCtx &expr_cg_ctx, const ObRawExpr &raw_expr, ObExpr &rt_expr) const +{ + int ret = OB_SUCCESS; + UNUSED(expr_cg_ctx); + UNUSED(raw_expr); + + CK (1 == rt_expr.arg_cnt_ || 2 == rt_expr.arg_cnt_ || 3 == rt_expr.arg_cnt_); + const ObExpr *set = rt_expr.args_[0]; + CK (OB_NOT_NULL(set)); + if (2 <= rt_expr.arg_cnt_) { + const ObExpr *timeout = rt_expr.args_[1]; + CK (OB_NOT_NULL(timeout)); + if (3 == rt_expr.arg_cnt_) { + const ObExpr *channel = rt_expr.args_[2]; + CK (OB_NOT_NULL(channel)); + } + } + + if (OB_SUCC(ret)) { + rt_expr.eval_func_ = ObExprWaitUntilSQLThreadAfterGTIDs::eval_wait_until_sql_thread_after_gtids; + } + + return ret; +} + +int ObExprWaitUntilSQLThreadAfterGTIDs::calc_result_typeN(ObExprResType &type, + ObExprResType *types, + int64_t param_num, + common::ObExprTypeCtx &type_ctx) const +{ + int ret = OB_SUCCESS; + // result + type.set_type(ObIntType); + type_ctx.set_cast_mode(type_ctx.get_cast_mode() | CM_NULL_ON_WARN); + + // gtid_set + types[0].set_calc_type(ObVarcharType); + types[0].set_calc_collation_type(ObCharset::get_system_collation()); + + if (2 <= param_num) { + // timeout + types[1].set_type(ObIntType); + if (3 == param_num) { + // channel + types[2].set_type(ObIntType); + } + } + return ret; +} + +int ObExprWaitUntilSQLThreadAfterGTIDs::eval_wait_until_sql_thread_after_gtids(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &result) +{ + // mock + result.set_null(); + return OB_SUCCESS; +} +} // namespace sql +} // namespace oceanbase diff --git a/src/sql/engine/expr/ob_expr_gtid.h b/src/sql/engine/expr/ob_expr_gtid.h new file mode 100644 index 0000000000..6093d2e8df --- /dev/null +++ b/src/sql/engine/expr/ob_expr_gtid.h @@ -0,0 +1,95 @@ +/** + * Copyright (c) 2021 OceanBase + * OceanBase CE is licensed under Mulan PubL v2. + * You can use this software according to the terms and conditions of the Mulan PubL v2. + * You may obtain a copy of Mulan PubL v2 at: + * http://license.coscl.org.cn/MulanPubL-2.0 + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, + * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, + * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PubL v2 for more details. + * This file contains implementation for _st_asmvtgeom. + */ + +#ifndef OCEANBASE_SQL_OB_EXPR_GTID_H_ +#define OCEANBASE_SQL_OB_EXPR_GTID_H_ + +#include "sql/engine/expr/ob_expr_operator.h" + +using namespace oceanbase::common; + +namespace oceanbase +{ +namespace sql +{ +class ObExprGTID : public ObFuncExprOperator +{ +public: + explicit ObExprGTID(common::ObIAllocator &alloc, ObExprOperatorType type, const char *name, int32_t param_num); + virtual ~ObExprGTID(); + +private: + DISALLOW_COPY_AND_ASSIGN(ObExprGTID); +}; +class ObExprGTIDSubset : public ObExprGTID +{ +public: + explicit ObExprGTIDSubset(common::ObIAllocator &alloc); + int cg_expr(ObExprCGCtx &expr_cg_ctx, const ObRawExpr &raw_expr, ObExpr &rt_expr) const override; + int calc_result_type2(ObExprResType &type, + ObExprResType &type1, + ObExprResType &type2, + common::ObExprTypeCtx &type_ctx) const override; + static int eval_subset(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &result); + +private: + DISALLOW_COPY_AND_ASSIGN(ObExprGTIDSubset); +}; + +class ObExprGTIDSubtract : public ObExprGTID +{ +public: + explicit ObExprGTIDSubtract(common::ObIAllocator &alloc); + int cg_expr(ObExprCGCtx &expr_cg_ctx, const ObRawExpr &raw_expr, ObExpr &rt_expr) const override; + int calc_result_type2(ObExprResType &type, + ObExprResType &type1, + ObExprResType &type2, + common::ObExprTypeCtx &type_ctx) const override; + static int eval_subtract(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &result); + +private: + DISALLOW_COPY_AND_ASSIGN(ObExprGTIDSubtract); +}; + +class ObExprWaitForExecutedGTIDSet : public ObExprGTID +{ +public: + explicit ObExprWaitForExecutedGTIDSet(common::ObIAllocator &alloc); + int cg_expr(ObExprCGCtx &expr_cg_ctx, const ObRawExpr &raw_expr, ObExpr &rt_expr) const override; + int calc_result_typeN(ObExprResType &type, + ObExprResType *types, + int64_t param_num, + common::ObExprTypeCtx &type_ctx) const override; + static int eval_wait_for_executed_gtid_set(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &result); + +private: + DISALLOW_COPY_AND_ASSIGN(ObExprWaitForExecutedGTIDSet); +}; + +class ObExprWaitUntilSQLThreadAfterGTIDs : public ObExprGTID +{ +public: + explicit ObExprWaitUntilSQLThreadAfterGTIDs(common::ObIAllocator &alloc); + int cg_expr(ObExprCGCtx &expr_cg_ctx, const ObRawExpr &raw_expr, ObExpr &rt_expr) const override; + int calc_result_typeN(ObExprResType &type, + ObExprResType *types, + int64_t param_num, + common::ObExprTypeCtx &type_ctx) const override; + static int eval_wait_until_sql_thread_after_gtids(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &result); + +private: + DISALLOW_COPY_AND_ASSIGN(ObExprWaitUntilSQLThreadAfterGTIDs); +}; +} // namespace sql +} // namespace oceanbase +#endif // OCEANBASE_SQL_OB_EXPR_JSON_REMOVE_H_ diff --git a/src/sql/engine/expr/ob_expr_operator_factory.cpp b/src/sql/engine/expr/ob_expr_operator_factory.cpp index 98a63b9920..a4338be75e 100644 --- a/src/sql/engine/expr/ob_expr_operator_factory.cpp +++ b/src/sql/engine/expr/ob_expr_operator_factory.cpp @@ -440,6 +440,7 @@ #include "sql/engine/expr/ob_expr_st_symdifference.h" #include "sql/engine/expr/ob_expr_priv_st_asmvtgeom.h" #include "sql/engine/expr/ob_expr_priv_st_makevalid.h" +#include "sql/engine/expr/ob_expr_gtid.h" #include "sql/engine/expr/ob_expr_array.h" #include "sql/engine/expr/ob_expr_vec_vid.h" #include "sql/engine/expr/ob_expr_vec_type.h" @@ -1146,6 +1147,10 @@ void ObExprOperatorFactory::register_expr_operators() REG_OP(ObExprRbToString); REG_OP(ObExprRbFromString); REG_OP(ObExprGetPath); + REG_OP(ObExprGTIDSubset); + REG_OP(ObExprGTIDSubtract); + REG_OP(ObExprWaitForExecutedGTIDSet); + REG_OP(ObExprWaitUntilSQLThreadAfterGTIDs); REG_OP(ObExprArrayContains); REG_OP(ObExprDecodeTraceId); REG_OP(ObExprAuditLogSetFilter); diff --git a/src/storage/tx/ob_trans_define.h b/src/storage/tx/ob_trans_define.h index 45b58a6fd0..60a60010eb 100644 --- a/src/storage/tx/ob_trans_define.h +++ b/src/storage/tx/ob_trans_define.h @@ -923,7 +923,8 @@ public: public: static bool is_valid(const int32_t level) { - return level == READ_COMMITED + return level == READ_UNCOMMITTED + || level == READ_COMMITED || level == REPEATABLE_READ || level == SERIALIZABLE; } diff --git a/tools/deploy/mysql_test/r/mysql/information_schema.result b/tools/deploy/mysql_test/r/mysql/information_schema.result index 4f0860f9a7..6953ff50d2 100644 --- a/tools/deploy/mysql_test/r/mysql/information_schema.result +++ b/tools/deploy/mysql_test/r/mysql/information_schema.result @@ -211,6 +211,8 @@ select * from information_schema.tables where table_schema in ('oceanbase', 'mys | def | information_schema | INNODB_FT_CONFIG | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | information_schema | INNODB_FT_DELETED | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | information_schema | INNODB_FT_INDEX_CACHE | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | +| def | information_schema | INNODB_LOCKS | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | +| def | information_schema | INNODB_LOCK_WAITS | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | information_schema | INNODB_METRICS | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | information_schema | INNODB_SYS_COLUMNS | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | information_schema | INNODB_SYS_DATAFILES | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | @@ -223,7 +225,9 @@ select * from information_schema.tables where table_schema in ('oceanbase', 'mys | def | information_schema | INNODB_SYS_TABLESTATS | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | information_schema | INNODB_SYS_VIRTUAL | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | information_schema | INNODB_TEMP_TABLE_INFO | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | +| def | information_schema | INNODB_TRX | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | information_schema | KEY_COLUMN_USAGE | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | +| def | information_schema | NDB_TRANSID_MYSQL_CONNECTION_MAP | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | information_schema | OPTIMIZER_TRACE | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | information_schema | PARAMETERS | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | information_schema | PARTITIONS | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | @@ -1769,6 +1773,8 @@ select * from information_schema.tables where table_schema in ('oceanbase', 'mys | def | information_schema | INNODB_FT_CONFIG | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | information_schema | INNODB_FT_DELETED | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | information_schema | INNODB_FT_INDEX_CACHE | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | +| def | information_schema | INNODB_LOCKS | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | +| def | information_schema | INNODB_LOCK_WAITS | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | information_schema | INNODB_METRICS | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | information_schema | INNODB_SYS_COLUMNS | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | information_schema | INNODB_SYS_DATAFILES | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | @@ -1781,7 +1787,9 @@ select * from information_schema.tables where table_schema in ('oceanbase', 'mys | def | information_schema | INNODB_SYS_TABLESTATS | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | information_schema | INNODB_SYS_VIRTUAL | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | information_schema | INNODB_TEMP_TABLE_INFO | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | +| def | information_schema | INNODB_TRX | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | information_schema | KEY_COLUMN_USAGE | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | +| def | information_schema | NDB_TRANSID_MYSQL_CONNECTION_MAP | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | information_schema | OPTIMIZER_TRACE | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | information_schema | PARAMETERS | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | information_schema | PARTITIONS | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | 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 797fa35735..3f9aad4a43 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 @@ -6464,6 +6464,67 @@ LIMIT_VALUE bigint(20) NO select /*+QUERY_TIMEOUT(60000000)*/ count(*) as cnt from (select * from oceanbase.V$OB_TENANT_RESOURCE_LIMIT_DETAIL limit 1); cnt 1 +desc information_schema.INNODB_LOCK_WAITS; +Field Type Null Key Default Extra +REQUESTING_TRX_ID varchar(1) NO +REQUESTED_LOCK_ID varchar(1) NO +BLOCKING_TRX_ID varchar(1) NO +BLOCKING_LOCK_ID varchar(1) NO +select /*+QUERY_TIMEOUT(60000000)*/ count(*) as cnt from (select * from information_schema.INNODB_LOCK_WAITS limit 1); +cnt +1 +desc information_schema.INNODB_LOCKS; +Field Type Null Key Default Extra +LOCK_ID varchar(1) NO +LOCK_TRX_ID varchar(1) NO +LOCK_MODE varchar(1) NO +LOCK_TYPE varchar(1) NO +LOCK_TABLE varchar(1) NO +LOCK_INDEX varchar(1) NO +LOCK_SPACE bigint(1) NO +LOCK_PAGE bigint(1) NO +LOCK_REC bigint(1) NO +LOCK_DATA varchar(1) NO +select /*+QUERY_TIMEOUT(60000000)*/ count(*) as cnt from (select * from information_schema.INNODB_LOCKS limit 1); +cnt +1 +desc information_schema.INNODB_TRX; +Field Type Null Key Default Extra +TRX_ID varchar(1) NO +TRX_STATE varchar(1) NO +TRX_STARTED datetime NO +TRX_REQUESTED_LOCK_ID varchar(1) NO +TRX_WAIT_STARTED datetime NO +TRX_WEIGHT bigint(1) NO +TRX_MYSQL_THREAD_ID bigint(1) NO +TRX_QUERY varchar(1) NO +TRX_OPERATION_STATE varchar(1) NO +TRX_TABLE_IN_USE bigint(1) NO +TRX_TABLES_LOCKED bigint(1) NO +TRX_LOCK_STRUCTS bigint(1) NO +TRX_LOCK_MEMORY_BYTES bigint(1) NO +TRX_ROWS_LOCKED bigint(1) NO +TRX_ROWS_MODIFIED bigint(1) NO +TRX_CONCURRENCY_TICKETS bigint(1) NO +TRX_ISOLATION_LEVEL varchar(1) NO +TRX_UNIQUE_CHECKS bigint(1) NO +TRX_FOREIGN_KEY_CHECKS bigint(1) NO +TRX_LAST_FOREIGN_KEY_ERROR varchar(1) NO +TRX_ADAPTIVE_HASH_LATCHED bigint(1) NO +TRX_ADAPTIVE_HASH_TIMEOUT bigint(1) NO +TRX_IS_READ_ONLY bigint(1) NO +TRX_AUTOCOMMIT_NON_LOCKING bigint(1) NO +select /*+QUERY_TIMEOUT(60000000)*/ count(*) as cnt from (select * from information_schema.INNODB_TRX limit 1); +cnt +1 +desc information_schema.NDB_TRANSID_MYSQL_CONNECTION_MAP; +Field Type Null Key Default Extra +MYSQL_CONNECTION_ID bigint(1) NO +NODE_ID bigint(1) NO +NDB_TRANSID bigint(1) NO +select /*+QUERY_TIMEOUT(60000000)*/ count(*) as cnt from (select * from information_schema.NDB_TRANSID_MYSQL_CONNECTION_MAP limit 1); +cnt +1 desc oceanbase.V$OB_GROUP_IO_STAT; Field Type Null Key Default Extra TENANT_ID bigint(20) NO 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 6b0ea96f11..0f4bc35a93 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 @@ -9364,6 +9364,67 @@ LIMIT_VALUE bigint(20) NO select /*+QUERY_TIMEOUT(60000000)*/ count(*) as cnt from (select * from oceanbase.V$OB_TENANT_RESOURCE_LIMIT_DETAIL limit 1); cnt 1 +desc information_schema.INNODB_LOCK_WAITS; +Field Type Null Key Default Extra +REQUESTING_TRX_ID varchar(1) NO +REQUESTED_LOCK_ID varchar(1) NO +BLOCKING_TRX_ID varchar(1) NO +BLOCKING_LOCK_ID varchar(1) NO +select /*+QUERY_TIMEOUT(60000000)*/ count(*) as cnt from (select * from information_schema.INNODB_LOCK_WAITS limit 1); +cnt +1 +desc information_schema.INNODB_LOCKS; +Field Type Null Key Default Extra +LOCK_ID varchar(1) NO +LOCK_TRX_ID varchar(1) NO +LOCK_MODE varchar(1) NO +LOCK_TYPE varchar(1) NO +LOCK_TABLE varchar(1) NO +LOCK_INDEX varchar(1) NO +LOCK_SPACE bigint(1) NO +LOCK_PAGE bigint(1) NO +LOCK_REC bigint(1) NO +LOCK_DATA varchar(1) NO +select /*+QUERY_TIMEOUT(60000000)*/ count(*) as cnt from (select * from information_schema.INNODB_LOCKS limit 1); +cnt +1 +desc information_schema.INNODB_TRX; +Field Type Null Key Default Extra +TRX_ID varchar(1) NO +TRX_STATE varchar(1) NO +TRX_STARTED datetime NO +TRX_REQUESTED_LOCK_ID varchar(1) NO +TRX_WAIT_STARTED datetime NO +TRX_WEIGHT bigint(1) NO +TRX_MYSQL_THREAD_ID bigint(1) NO +TRX_QUERY varchar(1) NO +TRX_OPERATION_STATE varchar(1) NO +TRX_TABLE_IN_USE bigint(1) NO +TRX_TABLES_LOCKED bigint(1) NO +TRX_LOCK_STRUCTS bigint(1) NO +TRX_LOCK_MEMORY_BYTES bigint(1) NO +TRX_ROWS_LOCKED bigint(1) NO +TRX_ROWS_MODIFIED bigint(1) NO +TRX_CONCURRENCY_TICKETS bigint(1) NO +TRX_ISOLATION_LEVEL varchar(1) NO +TRX_UNIQUE_CHECKS bigint(1) NO +TRX_FOREIGN_KEY_CHECKS bigint(1) NO +TRX_LAST_FOREIGN_KEY_ERROR varchar(1) NO +TRX_ADAPTIVE_HASH_LATCHED bigint(1) NO +TRX_ADAPTIVE_HASH_TIMEOUT bigint(1) NO +TRX_IS_READ_ONLY bigint(1) NO +TRX_AUTOCOMMIT_NON_LOCKING bigint(1) NO +select /*+QUERY_TIMEOUT(60000000)*/ count(*) as cnt from (select * from information_schema.INNODB_TRX limit 1); +cnt +1 +desc information_schema.NDB_TRANSID_MYSQL_CONNECTION_MAP; +Field Type Null Key Default Extra +MYSQL_CONNECTION_ID bigint(1) NO +NODE_ID bigint(1) NO +NDB_TRANSID bigint(1) NO +select /*+QUERY_TIMEOUT(60000000)*/ count(*) as cnt from (select * from information_schema.NDB_TRANSID_MYSQL_CONNECTION_MAP limit 1); +cnt +1 desc oceanbase.V$OB_GROUP_IO_STAT; Field Type Null Key Default Extra TENANT_ID bigint(20) NO diff --git a/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/inner_table_overall.result b/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/inner_table_overall.result index 9b9de90070..5159d1a6b6 100644 --- a/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/inner_table_overall.result +++ b/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/inner_table_overall.result @@ -1217,6 +1217,10 @@ select 0xffffffffff & table_id, table_name, table_type, database_id, part_num fr 21551 V$OB_TENANT_RESOURCE_LIMIT 1 201001 1 21552 GV$OB_TENANT_RESOURCE_LIMIT_DETAIL 1 201001 1 21553 V$OB_TENANT_RESOURCE_LIMIT_DETAIL 1 201001 1 +21554 INNODB_LOCK_WAITS 1 201002 1 +21555 INNODB_LOCKS 1 201002 1 +21556 INNODB_TRX 1 201002 1 +21557 NDB_TRANSID_MYSQL_CONNECTION_MAP 1 201002 1 21558 V$OB_GROUP_IO_STAT 1 201001 1 21559 GV$OB_GROUP_IO_STAT 1 201001 1 21560 DBA_OB_STORAGE_IO_USAGE 1 201001 1 diff --git a/tools/deploy/mysql_test/test_suite/sys_vars/r/mysql/tx_isolation_basic.result b/tools/deploy/mysql_test/test_suite/sys_vars/r/mysql/tx_isolation_basic.result index b20ec604dc..93a0ebf77a 100644 --- a/tools/deploy/mysql_test/test_suite/sys_vars/r/mysql/tx_isolation_basic.result +++ b/tools/deploy/mysql_test/test_suite/sys_vars/r/mysql/tx_isolation_basic.result @@ -17,9 +17,13 @@ ERROR 42000: Variable 'tx_isolation' can't be set to the value of '' SET @@session.transaction_isolation=''; ERROR 42000: Variable 'transaction_isolation' can't be set to the value of '' SET @@global.tx_isolation='READ-UNCOMMITTED'; -ERROR 0A000: Isolation level READ-UNCOMMITTED not supported +SELECT @@global.tx_isolation; +@@global.tx_isolation +READ-UNCOMMITTED SET @@global.transaction_isolation='READ-UNCOMMITTED'; -ERROR 0A000: Isolation level READ-UNCOMMITTED not supported +SELECT @@global.transaction_isolation; +@@global.transaction_isolation +READ-UNCOMMITTED SET @@global.tx_isolation='read-COMMITTED'; SELECT @@global.tx_isolation; @@global.tx_isolation @@ -45,9 +49,13 @@ SELECT @@global.transaction_isolation; @@global.transaction_isolation SERIALIZABLE SET @@session.tx_isolation='READ-UNCOMMITTED'; -ERROR 0A000: Isolation level READ-UNCOMMITTED not supported +SELECT @@session.tx_isolation; +@@session.tx_isolation +READ-UNCOMMITTED SET @@session.transaction_isolation='READ-UNCOMMITTED'; -ERROR 0A000: Isolation level READ-UNCOMMITTED not supported +SELECT @@session.transaction_isolation; +@@session.transaction_isolation +READ-UNCOMMITTED SET @@session.tx_isolation='READ-COMMITTED'; SELECT @@session.tx_isolation; @@session.tx_isolation diff --git a/tools/deploy/mysql_test/test_suite/sys_vars/t/tx_isolation_basic.test b/tools/deploy/mysql_test/test_suite/sys_vars/t/tx_isolation_basic.test index d6bd575e30..48511789c4 100644 --- a/tools/deploy/mysql_test/test_suite/sys_vars/t/tx_isolation_basic.test +++ b/tools/deploy/mysql_test/test_suite/sys_vars/t/tx_isolation_basic.test @@ -28,11 +28,10 @@ SET @@session.tx_isolation=''; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.transaction_isolation=''; ---Error ER_NOT_SUPPORTED_YET SET @@global.tx_isolation='READ-UNCOMMITTED'; - ---Error ER_NOT_SUPPORTED_YET +SELECT @@global.tx_isolation; SET @@global.transaction_isolation='READ-UNCOMMITTED'; +SELECT @@global.transaction_isolation; SET @@global.tx_isolation='read-COMMITTED'; SELECT @@global.tx_isolation; @@ -52,11 +51,12 @@ SELECT @@global.transaction_isolation; SET @@global.transaction_isolation='SERIALizable'; SELECT @@global.transaction_isolation; ---Error ER_NOT_SUPPORTED_YET SET @@session.tx_isolation='READ-UNCOMMITTED'; +SELECT @@session.tx_isolation; ---Error ER_NOT_SUPPORTED_YET SET @@session.transaction_isolation='READ-UNCOMMITTED'; +SELECT @@session.transaction_isolation; + SET @@session.tx_isolation='READ-COMMITTED'; SELECT @@session.tx_isolation;