diff --git a/src/share/inner_table/ob_inner_table_schema.101_150.cpp b/src/share/inner_table/ob_inner_table_schema.101_150.cpp index 96c536c812..42af046803 100644 --- a/src/share/inner_table/ob_inner_table_schema.101_150.cpp +++ b/src/share/inner_table/ob_inner_table_schema.101_150.cpp @@ -4140,6 +4140,25 @@ int ObInnerTableSchema::all_table_privilege_schema(ObTableSchema &table_schema) priv_show_view_default, priv_show_view_default); //default_value } + + if (OB_SUCC(ret)) { + ObObj priv_others_default; + priv_others_default.set_int(0); + ADD_COLUMN_SCHEMA_T("priv_others", //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 + priv_others_default, + priv_others_default); //default_value + } table_schema.set_index_using_type(USING_BTREE); table_schema.set_row_store_type(ENCODING_ROW_STORE); table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL); @@ -4531,6 +4550,25 @@ int ObInnerTableSchema::all_table_privilege_history_schema(ObTableSchema &table_ priv_show_view_default, priv_show_view_default); //default_value } + + if (OB_SUCC(ret)) { + ObObj priv_others_default; + priv_others_default.set_int(0); + ADD_COLUMN_SCHEMA_T("priv_others", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + true, //is_nullable + false, //is_autoincrement + priv_others_default, + priv_others_default); //default_value + } table_schema.set_index_using_type(USING_BTREE); table_schema.set_row_store_type(ENCODING_ROW_STORE); table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL); diff --git a/src/share/inner_table/ob_inner_table_schema.12051_12100.cpp b/src/share/inner_table/ob_inner_table_schema.12051_12100.cpp index 1ef2569962..4073cf9f44 100644 --- a/src/share/inner_table/ob_inner_table_schema.12051_12100.cpp +++ b/src/share/inner_table/ob_inner_table_schema.12051_12100.cpp @@ -3676,6 +3676,25 @@ int ObInnerTableSchema::all_virtual_table_privilege_schema(ObTableSchema &table_ priv_show_view_default, priv_show_view_default); //default_value } + + if (OB_SUCC(ret)) { + ObObj priv_others_default; + priv_others_default.set_int(0); + ADD_COLUMN_SCHEMA_T("priv_others", //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 + priv_others_default, + priv_others_default); //default_value + } table_schema.set_index_using_type(USING_BTREE); table_schema.set_row_store_type(ENCODING_ROW_STORE); table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL); @@ -4051,6 +4070,25 @@ int ObInnerTableSchema::all_virtual_table_privilege_history_schema(ObTableSchema priv_show_view_default, priv_show_view_default); //default_value } + + if (OB_SUCC(ret)) { + ObObj priv_others_default; + priv_others_default.set_int(0); + ADD_COLUMN_SCHEMA_T("priv_others", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + true, //is_nullable + false, //is_autoincrement + priv_others_default, + priv_others_default); //default_value + } table_schema.set_index_using_type(USING_BTREE); table_schema.set_row_store_type(ENCODING_ROW_STORE); table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL); diff --git a/src/share/inner_table/ob_inner_table_schema.15151_15200.cpp b/src/share/inner_table/ob_inner_table_schema.15151_15200.cpp index c1e6e6cf47..6e096624df 100644 --- a/src/share/inner_table/ob_inner_table_schema.15151_15200.cpp +++ b/src/share/inner_table/ob_inner_table_schema.15151_15200.cpp @@ -836,6 +836,21 @@ int ObInnerTableSchema::all_virtual_table_privilege_real_agent_ora_schema(ObTabl false); //is_autoincrement } + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("PRIV_OTHERS", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false, //is_nullable + false); //is_autoincrement + } + if (OB_SUCC(ret)) { ADD_COLUMN_SCHEMA("GMT_CREATE", //column_name ++column_id, //column_id diff --git a/src/share/inner_table/ob_inner_table_schema_def.py b/src/share/inner_table/ob_inner_table_schema_def.py index 5672766c1f..5833570499 100644 --- a/src/share/inner_table/ob_inner_table_schema_def.py +++ b/src/share/inner_table/ob_inner_table_schema_def.py @@ -580,6 +580,7 @@ all_table_privilege_def = dict( ('priv_index', 'int', 'false', '0'), ('priv_create_view', 'int', 'false', '0'), ('priv_show_view', 'int', 'false', '0'), + ('priv_others', 'int', 'false', '0'), ], ) diff --git a/src/share/schema/ob_priv_mgr.cpp b/src/share/schema/ob_priv_mgr.cpp index 4b5360ec3b..a23440ab6c 100644 --- a/src/share/schema/ob_priv_mgr.cpp +++ b/src/share/schema/ob_priv_mgr.cpp @@ -78,6 +78,8 @@ const char *ObPrivMgr::priv_names_[] = { "CREATE TABLESPACE", "SHUTDOWN", "RELOAD", + "CREATE ROLE", + "DROP ROLE", }; ObPrivMgr::ObPrivMgr() diff --git a/src/share/schema/ob_priv_type.h b/src/share/schema/ob_priv_type.h index 8c9ab1084f..8a48ed65e3 100644 --- a/src/share/schema/ob_priv_type.h +++ b/src/share/schema/ob_priv_type.h @@ -70,6 +70,8 @@ enum OB_PRIV_SHIFT OB_PRIV_CREATE_TABLESPACE_SHIFT, OB_PRIV_SHUTDOWN_SHIFT, OB_PRIV_RELOAD_SHIFT, + OB_PRIV_CREATE_ROLE_SHIFT, + OB_PRIV_DROP_ROLE_SHIFT, OB_PRIV_MAX_SHIFT_PLUS_ONE, OB_PRIV_MAX_SHIFT_LIMIT = 65 }; @@ -135,4 +137,17 @@ enum OB_PRIV_SHIFT OB_PRIV_DROP | OB_PRIV_INSERT | OB_PRIV_UPDATE | OB_PRIV_SELECT | \ OB_PRIV_INDEX | OB_PRIV_CREATE_VIEW | OB_PRIV_SHOW_VIEW) +enum OB_PRIV_OTHERS_TYPE +{ + OB_PRIV_OTHERS_EXECUTE = (1LL << 0), + OB_PRIV_OTHERS_ALTER_ROUTINE = (1LL << 1), + OB_PRIV_OTHERS_CREATE_ROUTINE = (1LL << 2), + OB_PRIV_OTHERS_CREATE_TABLESPACE = (1LL << 3), + OB_PRIV_OTHERS_SHUTDOWN = (1LL << 4), + OB_PRIV_OTHERS_RELOAD = (1LL << 5), + OB_PRIV_OTHERS_REFERENCES = (1LL << 6), + OB_PRIV_OTHERS_CREATE_ROLE = (1LL << 7), + OB_PRIV_OTHERS_DROP_ROLE = (1LL << 8) +}; + #endif //ifndef OCEABASE_SHARE_SCHEMA_OB_PRIV_TYPE_H_ 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 a8eca7d4c9..aaf8b8acc7 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 @@ -2490,6 +2490,7 @@ priv_select bigint(20) NO 0 priv_index bigint(20) NO 0 priv_create_view bigint(20) NO 0 priv_show_view bigint(20) NO 0 +priv_others bigint(20) NO 0 select /*+QUERY_TIMEOUT(60000000)*/ IF(count(*) >= 0, 1, 0) from oceanbase.__all_virtual_table_privilege; IF(count(*) >= 0, 1, 0) 1 @@ -2514,6 +2515,7 @@ priv_select bigint(20) YES 0 priv_index bigint(20) YES 0 priv_create_view bigint(20) YES 0 priv_show_view bigint(20) YES 0 +priv_others bigint(20) YES 0 select /*+QUERY_TIMEOUT(60000000)*/ IF(count(*) >= 0, 1, 0) from oceanbase.__all_virtual_table_privilege_history; IF(count(*) >= 0, 1, 0) 1