-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_user_deltas.sql
4 lines (4 loc) · 2.13 KB
/
get_user_deltas.sql
1
2
3
4
start transaction;
truncate provisioning.user_delta;
insert into provisioning.user_delta select Host , uc.User , Password , Select_priv , Insert_priv , Update_priv , Delete_priv , Create_priv , Drop_priv , Reload_priv , Shutdown_priv , Process_priv , File_priv , Grant_priv , References_priv , Index_priv , Alter_priv , Show_db_priv , Super_priv , Create_tmp_table_priv , Lock_tables_priv , Execute_priv , Repl_slave_priv , Repl_client_priv , Create_view_priv , Show_view_priv , Create_routine_priv , Alter_routine_priv , Create_user_priv , Event_priv , Trigger_priv , Create_tablespace_priv , ssl_type , ssl_cipher , x509_issuer , x509_subject , max_questions , max_updates , max_connections , max_user_connections , plugin , authentication_string from provisioning.userx u,provisioning.user_class uc where u.user=uc.class and not exists (select * from provisioning.user_audit ua inner join provisioning.user_class uc2 on ua.user = uc2.user where uc.user=ua.user and u.host=ua.host and u.select_priv = ua.select_priv and u.insert_priv = ua.insert_priv and u.update_priv = ua.update_priv and u.delete_priv = ua.delete_priv and u.create_priv = ua.create_priv and u.drop_priv = ua.drop_priv and u.reload_priv = ua.reload_priv and u.shutdown_priv = ua.shutdown_priv and u.process_priv = ua.process_priv and u.file_priv = ua.file_priv and u.grant_priv = ua.grant_priv and u.references_priv = ua.references_priv and u.index_priv = ua.index_priv and u.alter_priv = ua.alter_priv and u.show_db_priv = ua.show_db_priv and u.super_priv = ua.super_priv and u.create_tmp_table_priv = ua.create_tmp_table_priv and u.lock_tables_priv = ua.lock_tables_priv and u.execute_priv = ua.execute_priv and u.repl_slave_priv = ua.repl_slave_priv and u.repl_client_priv = ua.repl_client_priv and u.create_view_priv = ua.create_view_priv and u.show_view_priv = ua.show_view_priv and u.create_routine_priv = ua.create_routine_priv and u.alter_routine_priv = ua.alter_routine_priv and u.create_user_priv = ua.create_user_priv and u.event_priv = ua.event_priv and u.trigger_priv = ua.trigger_priv and u.create_tablespace_priv = ua.create_tablespace_priv);
commit;