summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2022-08-02 09:34:15 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2022-08-02 09:34:15 +0200
commitb043e1098e3575f6e91882ab7b6b254327a2865b (patch)
treeccc06f38301a8e4dcaade49dee57faeaa45cdb98
parent4d0c53a3276da82e84d477c5a94bf40083f06cbf (diff)
parent61d08f74275b129c5d00daaa7856aead88f034ff (diff)
downloadmariadb-git-b043e1098e3575f6e91882ab7b6b254327a2865b.tar.gz
Merge branch 'merge-perfschema-5.7' into 10.5
-rw-r--r--include/mysql/psi/mysql_file.h2
-rw-r--r--include/mysql/psi/mysql_idle.h2
-rw-r--r--include/mysql/psi/mysql_mdl.h2
-rw-r--r--include/mysql/psi/mysql_memory.h2
-rw-r--r--include/mysql/psi/mysql_ps.h2
-rw-r--r--include/mysql/psi/mysql_socket.h2
-rw-r--r--include/mysql/psi/mysql_sp.h2
-rw-r--r--include/mysql/psi/mysql_stage.h2
-rw-r--r--include/mysql/psi/mysql_statement.h2
-rw-r--r--include/mysql/psi/mysql_thread.h9
-rw-r--r--include/mysql/psi/mysql_transaction.h2
-rw-r--r--include/mysql/psi/psi.h13
-rw-r--r--include/mysql/psi/psi_abi_v0.h2
-rw-r--r--include/mysql/psi/psi_abi_v1.h2
-rw-r--r--include/mysql/psi/psi_abi_v1.h.pp3
-rw-r--r--include/mysql/psi/psi_abi_v2.h2
-rw-r--r--include/mysql/psi/psi_base.h8
-rw-r--r--include/mysql/psi/psi_memory.h2
-rw-r--r--include/pfs_thread_provider.h2
-rw-r--r--mysql-test/include/have_query_cache_disabled.inc36
-rw-r--r--mysql-test/suite/perfschema/disabled.def10
-rw-r--r--mysql-test/suite/perfschema/include/processlist_load.inc39
-rw-r--r--mysql-test/suite/perfschema/include/processlist_set.inc17
-rw-r--r--mysql-test/suite/perfschema/r/ddl_processlist.result20
-rw-r--r--mysql-test/suite/perfschema/r/dml_processlist.result24
-rw-r--r--mysql-test/suite/perfschema/r/misc_global_status.result106
-rw-r--r--mysql-test/suite/perfschema/r/processlist.result201
-rw-r--r--mysql-test/suite/perfschema/r/processlist_57.result345
-rw-r--r--mysql-test/suite/perfschema/r/processlist_acl.result255
-rw-r--r--mysql-test/suite/perfschema/r/processlist_anonymous.result66
-rw-r--r--mysql-test/suite/perfschema/r/processlist_no_pfs.result181
-rw-r--r--mysql-test/suite/perfschema/r/processlist_port.result145
-rw-r--r--mysql-test/suite/perfschema/r/processlist_reg_user.result89
-rw-r--r--mysql-test/suite/perfschema/r/show_sanity.result2
-rw-r--r--mysql-test/suite/perfschema/r/threads_mysql.result8
-rw-r--r--mysql-test/suite/perfschema/t/ddl_processlist.test32
-rw-r--r--mysql-test/suite/perfschema/t/dml_processlist.test39
-rw-r--r--mysql-test/suite/perfschema/t/misc_global_status-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/misc_global_status.test134
-rw-r--r--mysql-test/suite/perfschema/t/processlist-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/processlist.test197
-rw-r--r--mysql-test/suite/perfschema/t/processlist_57.test349
-rw-r--r--mysql-test/suite/perfschema/t/processlist_acl-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/processlist_acl.test196
-rw-r--r--mysql-test/suite/perfschema/t/processlist_anonymous.test111
-rw-r--r--mysql-test/suite/perfschema/t/processlist_no_pfs-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/processlist_no_pfs.test29
-rw-r--r--mysql-test/suite/perfschema/t/processlist_port-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/processlist_port.test162
-rw-r--r--mysql-test/suite/perfschema/t/processlist_reg_user.test134
-rw-r--r--mysql-test/suite/perfschema/t/threads_mysql.test6
-rw-r--r--mysys/psi_noop.c39
-rw-r--r--storage/perfschema/CMakeLists.txt4
-rw-r--r--storage/perfschema/cursor_by_account.cc2
-rw-r--r--storage/perfschema/cursor_by_account.h2
-rw-r--r--storage/perfschema/cursor_by_host.cc2
-rw-r--r--storage/perfschema/cursor_by_host.h2
-rw-r--r--storage/perfschema/cursor_by_thread.cc2
-rw-r--r--storage/perfschema/cursor_by_thread.h2
-rw-r--r--storage/perfschema/cursor_by_thread_connect_attr.cc2
-rw-r--r--storage/perfschema/cursor_by_thread_connect_attr.h2
-rw-r--r--storage/perfschema/cursor_by_user.cc2
-rw-r--r--storage/perfschema/cursor_by_user.h2
-rw-r--r--storage/perfschema/ha_perfschema.cc49
-rw-r--r--storage/perfschema/ha_perfschema.h2
-rw-r--r--storage/perfschema/pfs.cc15
-rw-r--r--storage/perfschema/pfs.h2
-rw-r--r--storage/perfschema/pfs_account.cc29
-rw-r--r--storage/perfschema/pfs_account.h2
-rw-r--r--storage/perfschema/pfs_atomic.h2
-rw-r--r--storage/perfschema/pfs_autosize.cc2
-rw-r--r--storage/perfschema/pfs_buffer_container.cc2
-rw-r--r--storage/perfschema/pfs_buffer_container.h2
-rw-r--r--storage/perfschema/pfs_builtin_memory.cc2
-rw-r--r--storage/perfschema/pfs_builtin_memory.h2
-rw-r--r--storage/perfschema/pfs_column_types.h2
-rw-r--r--storage/perfschema/pfs_column_values.cc2
-rw-r--r--storage/perfschema/pfs_column_values.h2
-rw-r--r--storage/perfschema/pfs_con_slice.cc2
-rw-r--r--storage/perfschema/pfs_con_slice.h2
-rw-r--r--storage/perfschema/pfs_defaults.cc2
-rw-r--r--storage/perfschema/pfs_defaults.h2
-rw-r--r--storage/perfschema/pfs_digest.cc2
-rw-r--r--storage/perfschema/pfs_digest.h2
-rw-r--r--storage/perfschema/pfs_engine_table.cc48
-rw-r--r--storage/perfschema/pfs_engine_table.h32
-rw-r--r--storage/perfschema/pfs_events.h2
-rw-r--r--storage/perfschema/pfs_events_stages.cc2
-rw-r--r--storage/perfschema/pfs_events_stages.h2
-rw-r--r--storage/perfschema/pfs_events_statements.cc2
-rw-r--r--storage/perfschema/pfs_events_statements.h2
-rw-r--r--storage/perfschema/pfs_events_transactions.cc2
-rw-r--r--storage/perfschema/pfs_events_transactions.h2
-rw-r--r--storage/perfschema/pfs_events_waits.cc2
-rw-r--r--storage/perfschema/pfs_events_waits.h2
-rw-r--r--storage/perfschema/pfs_global.cc2
-rw-r--r--storage/perfschema/pfs_global.h2
-rw-r--r--storage/perfschema/pfs_host.cc2
-rw-r--r--storage/perfschema/pfs_host.h2
-rw-r--r--storage/perfschema/pfs_instr.cc4
-rw-r--r--storage/perfschema/pfs_instr.h5
-rw-r--r--storage/perfschema/pfs_instr_class.cc2
-rw-r--r--storage/perfschema/pfs_instr_class.h5
-rw-r--r--storage/perfschema/pfs_lock.h2
-rw-r--r--storage/perfschema/pfs_memory.cc2
-rw-r--r--storage/perfschema/pfs_memory.h2
-rw-r--r--storage/perfschema/pfs_prepared_stmt.cc2
-rw-r--r--storage/perfschema/pfs_prepared_stmt.h2
-rw-r--r--storage/perfschema/pfs_program.cc2
-rw-r--r--storage/perfschema/pfs_program.h2
-rw-r--r--storage/perfschema/pfs_server.cc2
-rw-r--r--storage/perfschema/pfs_server.h2
-rw-r--r--storage/perfschema/pfs_setup_actor.cc2
-rw-r--r--storage/perfschema/pfs_setup_actor.h2
-rw-r--r--storage/perfschema/pfs_setup_object.cc2
-rw-r--r--storage/perfschema/pfs_setup_object.h2
-rw-r--r--storage/perfschema/pfs_stat.h2
-rw-r--r--storage/perfschema/pfs_status.cc2
-rw-r--r--storage/perfschema/pfs_status.h2
-rw-r--r--storage/perfschema/pfs_timer.cc2
-rw-r--r--storage/perfschema/pfs_timer.h2
-rw-r--r--storage/perfschema/pfs_user.cc2
-rw-r--r--storage/perfschema/pfs_user.h2
-rw-r--r--storage/perfschema/pfs_variable.cc2
-rw-r--r--storage/perfschema/pfs_variable.h2
-rw-r--r--storage/perfschema/pfs_visitor.cc2
-rw-r--r--storage/perfschema/pfs_visitor.h2
-rw-r--r--storage/perfschema/table_accounts.cc12
-rw-r--r--storage/perfschema/table_accounts.h3
-rw-r--r--storage/perfschema/table_all_instr.cc2
-rw-r--r--storage/perfschema/table_all_instr.h2
-rw-r--r--storage/perfschema/table_esgs_by_account_by_event_name.cc12
-rw-r--r--storage/perfschema/table_esgs_by_account_by_event_name.h3
-rw-r--r--storage/perfschema/table_esgs_by_host_by_event_name.cc11
-rw-r--r--storage/perfschema/table_esgs_by_host_by_event_name.h3
-rw-r--r--storage/perfschema/table_esgs_by_thread_by_event_name.cc11
-rw-r--r--storage/perfschema/table_esgs_by_thread_by_event_name.h3
-rw-r--r--storage/perfschema/table_esgs_by_user_by_event_name.cc11
-rw-r--r--storage/perfschema/table_esgs_by_user_by_event_name.h3
-rw-r--r--storage/perfschema/table_esgs_global_by_event_name.cc11
-rw-r--r--storage/perfschema/table_esgs_global_by_event_name.h3
-rw-r--r--storage/perfschema/table_esms_by_account_by_event_name.cc11
-rw-r--r--storage/perfschema/table_esms_by_account_by_event_name.h3
-rw-r--r--storage/perfschema/table_esms_by_digest.cc11
-rw-r--r--storage/perfschema/table_esms_by_digest.h3
-rw-r--r--storage/perfschema/table_esms_by_host_by_event_name.cc11
-rw-r--r--storage/perfschema/table_esms_by_host_by_event_name.h3
-rw-r--r--storage/perfschema/table_esms_by_program.cc11
-rw-r--r--storage/perfschema/table_esms_by_program.h3
-rw-r--r--storage/perfschema/table_esms_by_thread_by_event_name.cc11
-rw-r--r--storage/perfschema/table_esms_by_thread_by_event_name.h3
-rw-r--r--storage/perfschema/table_esms_by_user_by_event_name.cc11
-rw-r--r--storage/perfschema/table_esms_by_user_by_event_name.h3
-rw-r--r--storage/perfschema/table_esms_global_by_event_name.cc11
-rw-r--r--storage/perfschema/table_esms_global_by_event_name.h3
-rw-r--r--storage/perfschema/table_ets_by_account_by_event_name.cc11
-rw-r--r--storage/perfschema/table_ets_by_account_by_event_name.h3
-rw-r--r--storage/perfschema/table_ets_by_host_by_event_name.cc11
-rw-r--r--storage/perfschema/table_ets_by_host_by_event_name.h3
-rw-r--r--storage/perfschema/table_ets_by_thread_by_event_name.cc11
-rw-r--r--storage/perfschema/table_ets_by_thread_by_event_name.h3
-rw-r--r--storage/perfschema/table_ets_by_user_by_event_name.cc11
-rw-r--r--storage/perfschema/table_ets_by_user_by_event_name.h3
-rw-r--r--storage/perfschema/table_ets_global_by_event_name.cc11
-rw-r--r--storage/perfschema/table_ets_global_by_event_name.h3
-rw-r--r--storage/perfschema/table_events_stages.cc29
-rw-r--r--storage/perfschema/table_events_stages.h5
-rw-r--r--storage/perfschema/table_events_statements.cc29
-rw-r--r--storage/perfschema/table_events_statements.h5
-rw-r--r--storage/perfschema/table_events_transactions.cc29
-rw-r--r--storage/perfschema/table_events_transactions.h5
-rw-r--r--storage/perfschema/table_events_waits.cc29
-rw-r--r--storage/perfschema/table_events_waits.h5
-rw-r--r--storage/perfschema/table_events_waits_summary.cc11
-rw-r--r--storage/perfschema/table_events_waits_summary.h3
-rw-r--r--storage/perfschema/table_ews_by_account_by_event_name.cc11
-rw-r--r--storage/perfschema/table_ews_by_account_by_event_name.h3
-rw-r--r--storage/perfschema/table_ews_by_host_by_event_name.cc11
-rw-r--r--storage/perfschema/table_ews_by_host_by_event_name.h3
-rw-r--r--storage/perfschema/table_ews_by_thread_by_event_name.cc11
-rw-r--r--storage/perfschema/table_ews_by_thread_by_event_name.h3
-rw-r--r--storage/perfschema/table_ews_by_user_by_event_name.cc11
-rw-r--r--storage/perfschema/table_ews_by_user_by_event_name.h3
-rw-r--r--storage/perfschema/table_ews_global_by_event_name.cc10
-rw-r--r--storage/perfschema/table_ews_global_by_event_name.h3
-rw-r--r--storage/perfschema/table_file_instances.cc10
-rw-r--r--storage/perfschema/table_file_instances.h3
-rw-r--r--storage/perfschema/table_file_summary_by_event_name.cc10
-rw-r--r--storage/perfschema/table_file_summary_by_event_name.h3
-rw-r--r--storage/perfschema/table_file_summary_by_instance.cc11
-rw-r--r--storage/perfschema/table_file_summary_by_instance.h3
-rw-r--r--storage/perfschema/table_global_status.cc11
-rw-r--r--storage/perfschema/table_global_status.h3
-rw-r--r--storage/perfschema/table_global_variables.cc10
-rw-r--r--storage/perfschema/table_global_variables.h3
-rw-r--r--storage/perfschema/table_helper.cc2
-rw-r--r--storage/perfschema/table_helper.h2
-rw-r--r--storage/perfschema/table_host_cache.cc11
-rw-r--r--storage/perfschema/table_host_cache.h3
-rw-r--r--storage/perfschema/table_hosts.cc11
-rw-r--r--storage/perfschema/table_hosts.h3
-rw-r--r--storage/perfschema/table_md_locks.cc11
-rw-r--r--storage/perfschema/table_md_locks.h3
-rw-r--r--storage/perfschema/table_mems_by_account_by_event_name.cc11
-rw-r--r--storage/perfschema/table_mems_by_account_by_event_name.h3
-rw-r--r--storage/perfschema/table_mems_by_host_by_event_name.cc11
-rw-r--r--storage/perfschema/table_mems_by_host_by_event_name.h3
-rw-r--r--storage/perfschema/table_mems_by_thread_by_event_name.cc11
-rw-r--r--storage/perfschema/table_mems_by_thread_by_event_name.h3
-rw-r--r--storage/perfschema/table_mems_by_user_by_event_name.cc11
-rw-r--r--storage/perfschema/table_mems_by_user_by_event_name.h3
-rw-r--r--storage/perfschema/table_mems_global_by_event_name.cc11
-rw-r--r--storage/perfschema/table_mems_global_by_event_name.h3
-rw-r--r--storage/perfschema/table_os_global_by_type.cc11
-rw-r--r--storage/perfschema/table_os_global_by_type.h3
-rw-r--r--storage/perfschema/table_performance_timers.cc11
-rw-r--r--storage/perfschema/table_performance_timers.h3
-rw-r--r--storage/perfschema/table_prepared_stmt_instances.cc11
-rw-r--r--storage/perfschema/table_prepared_stmt_instances.h3
-rw-r--r--storage/perfschema/table_processlist.cc360
-rw-r--r--storage/perfschema/table_processlist.h133
-rw-r--r--storage/perfschema/table_replication_applier_configuration.cc11
-rw-r--r--storage/perfschema/table_replication_applier_configuration.h3
-rw-r--r--storage/perfschema/table_replication_applier_status.cc11
-rw-r--r--storage/perfschema/table_replication_applier_status.h3
-rw-r--r--storage/perfschema/table_replication_applier_status_by_coordinator.cc11
-rw-r--r--storage/perfschema/table_replication_applier_status_by_coordinator.h3
-rw-r--r--storage/perfschema/table_replication_applier_status_by_worker.cc10
-rw-r--r--storage/perfschema/table_replication_applier_status_by_worker.h3
-rw-r--r--storage/perfschema/table_replication_connection_configuration.cc11
-rw-r--r--storage/perfschema/table_replication_connection_configuration.h3
-rw-r--r--storage/perfschema/table_replication_connection_status.cc12
-rw-r--r--storage/perfschema/table_replication_connection_status.h3
-rw-r--r--storage/perfschema/table_replication_group_member_stats.cc12
-rw-r--r--storage/perfschema/table_replication_group_member_stats.h3
-rw-r--r--storage/perfschema/table_replication_group_members.cc12
-rw-r--r--storage/perfschema/table_replication_group_members.h3
-rw-r--r--storage/perfschema/table_session_account_connect_attrs.cc11
-rw-r--r--storage/perfschema/table_session_account_connect_attrs.h3
-rw-r--r--storage/perfschema/table_session_connect.cc2
-rw-r--r--storage/perfschema/table_session_connect.h2
-rw-r--r--storage/perfschema/table_session_connect_attrs.cc11
-rw-r--r--storage/perfschema/table_session_connect_attrs.h3
-rw-r--r--storage/perfschema/table_session_status.cc11
-rw-r--r--storage/perfschema/table_session_status.h3
-rw-r--r--storage/perfschema/table_session_variables.cc10
-rw-r--r--storage/perfschema/table_session_variables.h3
-rw-r--r--storage/perfschema/table_setup_actors.cc11
-rw-r--r--storage/perfschema/table_setup_actors.h3
-rw-r--r--storage/perfschema/table_setup_consumers.cc11
-rw-r--r--storage/perfschema/table_setup_consumers.h3
-rw-r--r--storage/perfschema/table_setup_instruments.cc11
-rw-r--r--storage/perfschema/table_setup_instruments.h3
-rw-r--r--storage/perfschema/table_setup_objects.cc10
-rw-r--r--storage/perfschema/table_setup_objects.h3
-rw-r--r--storage/perfschema/table_setup_timers.cc11
-rw-r--r--storage/perfschema/table_setup_timers.h3
-rw-r--r--storage/perfschema/table_socket_instances.cc11
-rw-r--r--storage/perfschema/table_socket_instances.h3
-rw-r--r--storage/perfschema/table_socket_summary_by_event_name.cc11
-rw-r--r--storage/perfschema/table_socket_summary_by_event_name.h3
-rw-r--r--storage/perfschema/table_socket_summary_by_instance.cc11
-rw-r--r--storage/perfschema/table_socket_summary_by_instance.h3
-rw-r--r--storage/perfschema/table_status_by_account.cc11
-rw-r--r--storage/perfschema/table_status_by_account.h3
-rw-r--r--storage/perfschema/table_status_by_host.cc11
-rw-r--r--storage/perfschema/table_status_by_host.h3
-rw-r--r--storage/perfschema/table_status_by_thread.cc13
-rw-r--r--storage/perfschema/table_status_by_thread.h3
-rw-r--r--storage/perfschema/table_status_by_user.cc11
-rw-r--r--storage/perfschema/table_status_by_user.h3
-rw-r--r--storage/perfschema/table_sync_instances.cc29
-rw-r--r--storage/perfschema/table_sync_instances.h5
-rw-r--r--storage/perfschema/table_table_handles.cc11
-rw-r--r--storage/perfschema/table_table_handles.h3
-rw-r--r--storage/perfschema/table_threads.cc11
-rw-r--r--storage/perfschema/table_threads.h3
-rw-r--r--storage/perfschema/table_tiws_by_index_usage.cc11
-rw-r--r--storage/perfschema/table_tiws_by_index_usage.h3
-rw-r--r--storage/perfschema/table_tiws_by_table.cc11
-rw-r--r--storage/perfschema/table_tiws_by_table.h3
-rw-r--r--storage/perfschema/table_tlws_by_table.cc11
-rw-r--r--storage/perfschema/table_tlws_by_table.h3
-rw-r--r--storage/perfschema/table_users.cc11
-rw-r--r--storage/perfschema/table_users.h3
-rw-r--r--storage/perfschema/table_uvar_by_thread.cc11
-rw-r--r--storage/perfschema/table_uvar_by_thread.h3
-rw-r--r--storage/perfschema/table_variables_by_thread.cc10
-rw-r--r--storage/perfschema/table_variables_by_thread.h3
-rw-r--r--storage/perfschema/unittest/CMakeLists.txt2
-rw-r--r--storage/perfschema/unittest/conf.txt2
-rw-r--r--storage/perfschema/unittest/pfs-t.cc2
-rw-r--r--storage/perfschema/unittest/pfs_account-oom-t.cc2
-rw-r--r--storage/perfschema/unittest/pfs_connect_attr-t.cc2
-rw-r--r--storage/perfschema/unittest/pfs_host-oom-t.cc2
-rw-r--r--storage/perfschema/unittest/pfs_instr-oom-t.cc2
-rw-r--r--storage/perfschema/unittest/pfs_instr-t.cc2
-rw-r--r--storage/perfschema/unittest/pfs_instr_class-oom-t.cc2
-rw-r--r--storage/perfschema/unittest/pfs_instr_class-t.cc2
-rw-r--r--storage/perfschema/unittest/pfs_misc-t.cc2
-rw-r--r--storage/perfschema/unittest/pfs_noop-t.cc5
-rw-r--r--storage/perfschema/unittest/pfs_server_stubs.cc2
-rw-r--r--storage/perfschema/unittest/pfs_timer-t.cc2
-rw-r--r--storage/perfschema/unittest/pfs_user-oom-t.cc2
-rw-r--r--storage/perfschema/unittest/stub_global_status_var.h2
-rw-r--r--storage/perfschema/unittest/stub_pfs_defaults.h2
-rw-r--r--storage/perfschema/unittest/stub_pfs_global.h2
-rw-r--r--storage/perfschema/unittest/stub_print_error.h2
308 files changed, 4683 insertions, 404 deletions
diff --git a/include/mysql/psi/mysql_file.h b/include/mysql/psi/mysql_file.h
index 795a40e38b7..9b172cfe9b0 100644
--- a/include/mysql/psi/mysql_file.h
+++ b/include/mysql/psi/mysql_file.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/include/mysql/psi/mysql_idle.h b/include/mysql/psi/mysql_idle.h
index 95886bd4e13..1c9927f95b2 100644
--- a/include/mysql/psi/mysql_idle.h
+++ b/include/mysql/psi/mysql_idle.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates
Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
diff --git a/include/mysql/psi/mysql_mdl.h b/include/mysql/psi/mysql_mdl.h
index 3b3aba0a81f..483f28f396b 100644
--- a/include/mysql/psi/mysql_mdl.h
+++ b/include/mysql/psi/mysql_mdl.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2012, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/include/mysql/psi/mysql_memory.h b/include/mysql/psi/mysql_memory.h
index b461f2fb206..06027a655f7 100644
--- a/include/mysql/psi/mysql_memory.h
+++ b/include/mysql/psi/mysql_memory.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2012, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/include/mysql/psi/mysql_ps.h b/include/mysql/psi/mysql_ps.h
index 42f518b77c4..670555fc55f 100644
--- a/include/mysql/psi/mysql_ps.h
+++ b/include/mysql/psi/mysql_ps.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2014, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/include/mysql/psi/mysql_socket.h b/include/mysql/psi/mysql_socket.h
index 143c382c912..e32474db1dd 100644
--- a/include/mysql/psi/mysql_socket.h
+++ b/include/mysql/psi/mysql_socket.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
Copyright (c) 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
diff --git a/include/mysql/psi/mysql_sp.h b/include/mysql/psi/mysql_sp.h
index 68b79f1b852..1fec59cec91 100644
--- a/include/mysql/psi/mysql_sp.h
+++ b/include/mysql/psi/mysql_sp.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/include/mysql/psi/mysql_stage.h b/include/mysql/psi/mysql_stage.h
index f16b0ce207e..cb579ea4e8c 100644
--- a/include/mysql/psi/mysql_stage.h
+++ b/include/mysql/psi/mysql_stage.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/include/mysql/psi/mysql_statement.h b/include/mysql/psi/mysql_statement.h
index 7a95e4057fd..78a4de73869 100644
--- a/include/mysql/psi/mysql_statement.h
+++ b/include/mysql/psi/mysql_statement.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
diff --git a/include/mysql/psi/mysql_thread.h b/include/mysql/psi/mysql_thread.h
index f380f2f02ac..9ff3dd382a8 100644
--- a/include/mysql/psi/mysql_thread.h
+++ b/include/mysql/psi/mysql_thread.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
Copyright (c) 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
@@ -1339,6 +1339,13 @@ static inline void inline_mysql_thread_set_psi_THD(THD *thd)
}
#endif /* __cplusplus */
+static inline void mysql_thread_set_peer_port(uint port __attribute__ ((unused))) {
+#ifdef HAVE_PSI_THREAD_INTERFACE
+ struct PSI_thread *psi = PSI_THREAD_CALL(get_thread)();
+ PSI_THREAD_CALL(set_thread_peer_port)(psi, port);
+#endif
+}
+
#endif
#endif /* DISABLE_MYSQL_THREAD_H */
diff --git a/include/mysql/psi/mysql_transaction.h b/include/mysql/psi/mysql_transaction.h
index 611bd1fa0f9..02f08bfab44 100644
--- a/include/mysql/psi/mysql_transaction.h
+++ b/include/mysql/psi/mysql_transaction.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/include/mysql/psi/psi.h b/include/mysql/psi/psi.h
index b9beab77e2a..4c3e2c6a9c4 100644
--- a/include/mysql/psi/psi.h
+++ b/include/mysql/psi/psi.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -1692,6 +1692,15 @@ typedef void (*set_thread_info_v1_t)(const char* info, uint info_len);
*/
typedef void (*set_thread_v1_t)(struct PSI_thread *thread);
+/**
+ Assign the remote (peer) port to the instrumented thread.
+
+ @param thread pointer to the thread instrumentation
+ @param port the remote port
+*/
+typedef void (*set_thread_peer_port_v1_t)(PSI_thread *thread,
+ unsigned int port);
+
/** Delete the current thread instrumentation. */
typedef void (*delete_current_thread_v1_t)(void);
@@ -2737,6 +2746,8 @@ struct PSI_v1
start_metadata_wait_v1_t start_metadata_wait;
end_metadata_wait_v1_t end_metadata_wait;
+
+ set_thread_peer_port_v1_t set_thread_peer_port;
};
/** @} (end of group Group_PSI_v1) */
diff --git a/include/mysql/psi/psi_abi_v0.h b/include/mysql/psi/psi_abi_v0.h
index b94a7695ade..df47ae78eb4 100644
--- a/include/mysql/psi/psi_abi_v0.h
+++ b/include/mysql/psi/psi_abi_v0.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/include/mysql/psi/psi_abi_v1.h b/include/mysql/psi/psi_abi_v1.h
index bdf475147ab..61018bdf030 100644
--- a/include/mysql/psi/psi_abi_v1.h
+++ b/include/mysql/psi/psi_abi_v1.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/include/mysql/psi/psi_abi_v1.h.pp b/include/mysql/psi/psi_abi_v1.h.pp
index a1845ac62f6..2dc27e09ca4 100644
--- a/include/mysql/psi/psi_abi_v1.h.pp
+++ b/include/mysql/psi/psi_abi_v1.h.pp
@@ -459,6 +459,8 @@ typedef void (*set_thread_start_time_v1_t)(time_t start_time);
typedef void (*set_thread_state_v1_t)(const char* state);
typedef void (*set_thread_info_v1_t)(const char* info, uint info_len);
typedef void (*set_thread_v1_t)(struct PSI_thread *thread);
+typedef void (*set_thread_peer_port_v1_t)(PSI_thread *thread,
+ unsigned int port);
typedef void (*delete_current_thread_v1_t)(void);
typedef void (*delete_thread_v1_t)(struct PSI_thread *thread);
typedef struct PSI_file_locker* (*get_thread_file_name_locker_v1_t)
@@ -829,6 +831,7 @@ struct PSI_v1
destroy_metadata_lock_v1_t destroy_metadata_lock;
start_metadata_wait_v1_t start_metadata_wait;
end_metadata_wait_v1_t end_metadata_wait;
+ set_thread_peer_port_v1_t set_thread_peer_port;
};
typedef struct PSI_v1 PSI;
typedef struct PSI_mutex_info_v1 PSI_mutex_info;
diff --git a/include/mysql/psi/psi_abi_v2.h b/include/mysql/psi/psi_abi_v2.h
index 63d99106055..31c9e8fc42f 100644
--- a/include/mysql/psi/psi_abi_v2.h
+++ b/include/mysql/psi/psi_abi_v2.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/include/mysql/psi/psi_base.h b/include/mysql/psi/psi_base.h
index 7b4eaf80892..592aaf58fef 100644
--- a/include/mysql/psi/psi_base.h
+++ b/include/mysql/psi/psi_base.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -94,6 +94,12 @@ extern "C" {
*/
#define PSI_FLAG_VOLATILITY_SESSION (1 << 6)
+/**
+ System thread flag.
+ Indicates that the instrumented object exists on a system thread.
+*/
+#define PSI_FLAG_THREAD_SYSTEM (1 << 9)
+
#ifdef HAVE_PSI_INTERFACE
/**
diff --git a/include/mysql/psi/psi_memory.h b/include/mysql/psi/psi_memory.h
index 9b968667d53..4f5215d1808 100644
--- a/include/mysql/psi/psi_memory.h
+++ b/include/mysql/psi/psi_memory.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/include/pfs_thread_provider.h b/include/pfs_thread_provider.h
index 3c43f8e3d77..6b5633722f5 100644
--- a/include/pfs_thread_provider.h
+++ b/include/pfs_thread_provider.h
@@ -99,6 +99,8 @@ void pfs_set_thread_info_v1(const char* info, uint info_len);
void pfs_set_thread_v1(PSI_thread* thread);
+void pfs_set_thread_peer_port_v1(PSI_thread *thread, uint port);
+
void pfs_delete_current_thread_v1(void);
void pfs_delete_thread_v1(PSI_thread *thread);
diff --git a/mysql-test/include/have_query_cache_disabled.inc b/mysql-test/include/have_query_cache_disabled.inc
new file mode 100644
index 00000000000..9087fa392e1
--- /dev/null
+++ b/mysql-test/include/have_query_cache_disabled.inc
@@ -0,0 +1,36 @@
+# Skip the test if 'query cache' is disabled.
+# Note : There are 2 techniques to disable query cache :
+# (1) Set query_cache_type to 0 or OFF
+# (2) Set query_cache_size to 0
+
+disable_query_log;
+
+let $do_skip=0;
+
+let $qc_var_1= query_get_value("SELECT COUNT(*) AS var1 FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME = 'have_query_cache' AND variable_value = 'YES'", var1, 1);
+if ($qc_var_1 == 1)
+{
+ let $do_skip=1;
+}
+
+# Check if 'query_cache_type' is OFF
+let $qc_var_2= query_get_value("SELECT COUNT(*) AS var2 FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME = 'query_cache_type' AND VARIABLE_VALUE = 'OFF'", var2, 1);
+if ($qc_var_2 == 1)
+{
+ let $do_skip=0;
+}
+
+# Check if 'query_cache_size' is 0
+let $qc_var_3= query_get_value("SELECT COUNT(*) AS var3 FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME = 'query_cache_size' AND VARIABLE_VALUE = 0", var3, 1);
+
+if ($qc_var_3 == 1)
+{
+ let $do_skip=0;
+}
+
+if ($do_skip)
+{
+ skip Query Cache enabled, skipping test;
+}
+
+enable_query_log;
diff --git a/mysql-test/suite/perfschema/disabled.def b/mysql-test/suite/perfschema/disabled.def
index 9c36708729a..0fd7e49c2b7 100644
--- a/mysql-test/suite/perfschema/disabled.def
+++ b/mysql-test/suite/perfschema/disabled.def
@@ -55,3 +55,13 @@ show_misc: todo
show_plugin: todo
status_reprepare:why P_S filters out Com_* variables?
+
+processlist: todo
+processlist_acl: todo
+processlist_port: todo
+processlist_no_pfs: todo
+ddl_processlist: todo
+dml_processlist: todo
+processlist_57: todo
+processlist_anonymous: todo
+processlist_reg_user: todo
diff --git a/mysql-test/suite/perfschema/include/processlist_load.inc b/mysql-test/suite/perfschema/include/processlist_load.inc
new file mode 100644
index 00000000000..5a14ea17d07
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/processlist_load.inc
@@ -0,0 +1,39 @@
+# ../include/processlist_load.inc
+#
+# SUMMARY
+#
+# Execute PROCESSLIST queries, sorted by user
+#
+# USAGE
+#
+# Example: Using processlist_set.inc to set @@global.performance_schema_show_processlist
+#
+# let $pfs_spl = on/off
+# --source ../include/processlist_set.inc
+# --source ../include/processlist_load.inc
+#
+# Columns
+# 1 <Id> 2 <User> 3 <Host> 4 <db> 5 <Command> 6 <Time> 7 <State> 8 <Info>
+
+# Sort SHOW PROCESSLIST by User instead of Id because Id is not zero-padded
+# Unique usernames give best results
+--echo
+--replace_column 1 <Id> 3 <Host> 6 <Time> 7 <State>
+--replace_regex /Daemon/<Command>/ /Connect/<Command>/ /Sleep/<Command>/
+--sorted_result
+SHOW FULL PROCESSLIST;
+
+--echo
+--echo # Performance Schema processlist table
+--echo
+--replace_column 1 <Id> 3 <Host> 6 <Time> 7 <State>
+--replace_regex /Daemon/<Command>/ /Connect/<Command>/ /Sleep/<Command>/
+select * from performance_schema.processlist order by user, id;
+
+--echo
+--echo # Information Schema processlist table
+--echo
+--replace_column 1 <Id> 3 <Host> 6 <Time> 7 <State>
+--replace_regex /Daemon/<Command>/ /Connect/<Command>/ /Sleep/<Command>/
+select * from information_schema.processlist order by user, id;
+
diff --git a/mysql-test/suite/perfschema/include/processlist_set.inc b/mysql-test/suite/perfschema/include/processlist_set.inc
new file mode 100644
index 00000000000..a15e09fd989
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/processlist_set.inc
@@ -0,0 +1,17 @@
+# ../include/processlist_set.inc
+#
+# SUMMARY
+#
+# Set the value of performance_schema_show_proceslist then
+# wait for the operation to complete
+#
+# USAGE
+#
+# let $pfs_spl = on;
+# --source ../include/processlist_set.inc
+
+eval set @@global.performance_schema_show_processlist = $pfs_spl;
+
+let $wait_condition = show variables where variable_name like '%show_processlist%' and value = '$pfs_spl';
+--source include/wait_condition.inc
+
diff --git a/mysql-test/suite/perfschema/r/ddl_processlist.result b/mysql-test/suite/perfschema/r/ddl_processlist.result
new file mode 100644
index 00000000000..3b1b8608725
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/ddl_processlist.result
@@ -0,0 +1,20 @@
+select @@global.performance_schema_show_processlist into @save_processlist;
+set @@global.performance_schema_show_processlist = 'on';
+alter table performance_schema.processlist
+add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+truncate table performance_schema.processlist;
+ERROR HY000: Invalid performance_schema usage.
+alter table performance_schema.processlist
+add index test_index(info);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+create unique index test_index
+on performance_schema.processlist(host);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+drop index `PRIMARY`
+ on performance_schema.processlist;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE TABLE test.create_select
+AS SELECT * from performance_schema.processlist;
+DROP TABLE test.create_select;
+set @@global.performance_schema_show_processlist = @save_processlist;
diff --git a/mysql-test/suite/perfschema/r/dml_processlist.result b/mysql-test/suite/perfschema/r/dml_processlist.result
new file mode 100644
index 00000000000..f3627807a49
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/dml_processlist.result
@@ -0,0 +1,24 @@
+select @@global.performance_schema_show_processlist into @save_processlist;
+set @@global.performance_schema_show_processlist = 'on';
+select * from performance_schema.processlist
+where user like 'event_scheduler';
+select * from performance_schema.processlist
+where user = 'FOO';
+insert into performance_schema.processlist
+values (12, 'foo', 'bar', 'test', null, 1000, 'state', 'info');
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'processlist'
+update performance_schema.processlist
+set id=12, user='foo';
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'processlist'
+delete from performance_schema.processlist
+where id <> 99;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'processlist'
+delete from performance_schema.processlist;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'processlist'
+LOCK TABLES performance_schema.processlist READ;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'processlist'
+UNLOCK TABLES;
+LOCK TABLES performance_schema.processlist WRITE;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'processlist'
+UNLOCK TABLES;
+set @@global.performance_schema_show_processlist = @save_processlist;
diff --git a/mysql-test/suite/perfschema/r/misc_global_status.result b/mysql-test/suite/perfschema/r/misc_global_status.result
new file mode 100644
index 00000000000..1863dde6103
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/misc_global_status.result
@@ -0,0 +1,106 @@
+CREATE USER user1@localhost;
+CREATE USER user2@localhost;
+CREATE USER user3@localhost;
+grant ALL on *.* to user1@localhost;
+grant ALL on *.* to user2@localhost;
+grant ALL on *.* to user3@localhost;
+TRUNCATE TABLE performance_schema.accounts;
+FLUSH PRIVILEGES;
+CREATE TABLE test.t_range(a int, b int, PRIMARY KEY(a));
+INSERT INTO test.t_range values (1, 1), (2,2), (3, 3), (4, 4), (5, 5);
+INSERT INTO test.t_range values (6, 6), (7,7), (8, 8), (9, 9), (10, 10);
+FLUSH STATUS;
+SELECT * from test.t_range where (a >= 3) AND (a <= 5);
+a b
+3 3
+4 4
+5 5
+SELECT * from performance_schema.session_status
+WHERE VARIABLE_NAME = 'Select_range';
+VARIABLE_NAME VARIABLE_VALUE
+Select_range 1
+VARIABLE_NAME DELTA
+Select_range 1
+connect con1, localhost, user1,,;
+SELECT * from test.t_range where (a >= 3) AND (a <= 5);
+a b
+3 3
+4 4
+5 5
+SELECT * from performance_schema.session_status
+WHERE VARIABLE_NAME = 'Select_range';
+VARIABLE_NAME VARIABLE_VALUE
+Select_range 1
+VARIABLE_NAME DELTA
+Select_range 2
+connect con2, localhost, user2,,;
+SELECT * from test.t_range where (a >= 3) AND (a <= 5);
+a b
+3 3
+4 4
+5 5
+SELECT * from test.t_range where (a >= 4) AND (a <= 6);
+a b
+4 4
+5 5
+6 6
+SELECT * from performance_schema.session_status
+WHERE VARIABLE_NAME = 'Select_range';
+VARIABLE_NAME VARIABLE_VALUE
+Select_range 2
+VARIABLE_NAME DELTA
+Select_range 4
+connect con3, localhost, user3,,;
+SELECT * from test.t_range where (a >= 3) AND (a <= 5);
+a b
+3 3
+4 4
+5 5
+SELECT * from test.t_range where (a >= 4) AND (a <= 6);
+a b
+4 4
+5 5
+6 6
+SELECT * from test.t_range where (a >= 5) AND (a <= 7);
+a b
+5 5
+6 6
+7 7
+SELECT * from performance_schema.session_status
+WHERE VARIABLE_NAME = 'Select_range';
+VARIABLE_NAME VARIABLE_VALUE
+Select_range 3
+VARIABLE_NAME DELTA
+Select_range 7
+connection default;
+VARIABLE_NAME DELTA
+Select_range 7
+SELECT `USER`, `HOST`, VARIABLE_NAME, VARIABLE_VALUE
+FROM performance_schema.status_by_account WHERE VARIABLE_NAME = 'Select_range'
+ AND `USER` LIKE 'user%'
+ ORDER BY `USER`;
+USER HOST VARIABLE_NAME VARIABLE_VALUE
+user1 localhost Select_range 1
+user2 localhost Select_range 2
+user3 localhost Select_range 3
+disconnect con1;
+disconnect con2;
+VARIABLE_NAME DELTA
+Select_range 7
+TRUNCATE TABLE performance_schema.accounts;
+VARIABLE_NAME DELTA
+Select_range 7
+disconnect con3;
+VARIABLE_NAME DELTA
+Select_range 7
+TRUNCATE TABLE performance_schema.accounts;
+VARIABLE_NAME DELTA
+Select_range 7
+DROP TABLE test.t_range;
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM user1@localhost;
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM user2@localhost;
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM user3@localhost;
+DROP USER user1@localhost;
+DROP USER user2@localhost;
+DROP USER user3@localhost;
+FLUSH PRIVILEGES;
diff --git a/mysql-test/suite/perfschema/r/processlist.result b/mysql-test/suite/perfschema/r/processlist.result
new file mode 100644
index 00000000000..40c5a0f04a8
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/processlist.result
@@ -0,0 +1,201 @@
+##
+## Test the Performance Schema-based implementation of SHOW PROCESSLIST.
+##
+## Test cases:
+## 1. Execute the new SHOW [FULL] PROCESSLIST and SELECT on performance_schema.processlist
+## 2. Execute the legacy SHOW [FULL] PROCESSLIST and SELECT on information_schema.processlist
+## 3. Verify that performance_schema_show_processlist = ON executes the new implementation
+## 4. Verify that performance_schema_show_processlist = OFF executes the legacy code path
+##
+## Results must be manually verified.
+
+### Setup ###
+
+select @@global.performance_schema_show_processlist into @save_processlist;
+
+create user user1@localhost, user2@localhost,
+user3@localhost, user4@localhost;
+
+grant ALL on *.* to user1@localhost;
+grant ALL on *.* to user2@localhost;
+grant ALL on *.* to user3@localhost;
+grant ALL on *.* to user4@localhost;
+
+flush privileges;
+
+use test;
+create table test.t1 (s1 int, s2 int, s3 int, s4 int);
+
+# Switch to (con0, localhost, root, , )
+
+insert into test.t1 values(1, 1, 1, 1);
+insert into test.t1 values(2, 2, 2, 2);
+insert into test.t1 values(3, 3, 3, 3);
+insert into test.t1 values(4, 4, 4, 4);
+
+# Lock test.t1, insert/update/deletes will block
+lock tables t1 read;
+
+# Connect (con1, localhost, user1, , )
+insert into test.t1 values (0, 0, 0, 0);
+
+# Connect (con2, localhost, user2, , )
+update test.t1 set s1 = s1 + 1, s2 = s2 + 2, s3 = s3 + 3, s4 = ((s4 + 4) * (s4 + 5)) + 12345 + 67890 + 11111 + 22222 + 33333 + 44444 + 55555 + 99999;;
+
+# Connect (con3, localhost, user3, , )
+delete from test.t1 where s1 = 3;
+
+# Connect (con4, localhost, user4, , )
+insert into test.t1 values (4, 4, 4, 4);
+
+# Connection default
+
+# Wait for queries to appear in the processlist table
+
+
+### Execute new SHOW [FULL] PROCESSLIST and SELECT on performance_schema.processlist
+
+set @@global.performance_schema_show_processlist = on;
+
+SHOW FULL PROCESSLIST;
+Id User Host db Command Time State Info
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
+<Id> root <Host> test <Command> <Time> <State> NULL
+<Id> root <Host> test Query <Time> <State> SHOW FULL PROCESSLIST
+<Id> user1 <Host> test Query <Time> <State> insert into test.t1 values (0, 0, 0, 0)
+<Id> user2 <Host> test Query <Time> <State> update test.t1 set s1 = s1 + 1, s2 = s2 + 2, s3 = s3 + 3, s4 = ((s4 + 4) * (s4 + 5)) + 12345 + 67890 + 11111 + 22222 + 33333 + 44444 + 55555 + 99999
+<Id> user3 <Host> test Query <Time> <State> delete from test.t1 where s1 = 3
+<Id> user4 <Host> test Query <Time> <State> insert into test.t1 values (4, 4, 4, 4)
+
+# Performance Schema processlist table
+
+select * from performance_schema.processlist order by user, id;
+ID USER HOST DB COMMAND TIME STATE INFO
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
+<Id> root <Host> test Query <Time> <State> select * from performance_schema.processlist order by user, id
+<Id> root <Host> test <Command> <Time> <State> NULL
+<Id> user1 <Host> test Query <Time> <State> insert into test.t1 values (0, 0, 0, 0)
+<Id> user2 <Host> test Query <Time> <State> update test.t1 set s1 = s1 + 1, s2 = s2 + 2, s3 = s3 + 3, s4 = ((s4 + 4) * (s4 + 5)) + 12345 + 67890 + 11111 + 22222 + 33333 + 44444 + 55555 + 99999
+<Id> user3 <Host> test Query <Time> <State> delete from test.t1 where s1 = 3
+<Id> user4 <Host> test Query <Time> <State> insert into test.t1 values (4, 4, 4, 4)
+
+# Information Schema processlist table
+
+select * from information_schema.processlist order by user, id;
+ID USER HOST DB COMMAND TIME STATE INFO
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
+<Id> root <Host> test Query <Time> <State> select * from information_schema.processlist order by user, id
+<Id> root <Host> test <Command> <Time> <State> NULL
+<Id> user1 <Host> test Query <Time> <State> insert into test.t1 values (0, 0, 0, 0)
+<Id> user2 <Host> test Query <Time> <State> update test.t1 set s1 = s1 + 1, s2 = s2 + 2, s3 = s3 + 3, s4 = ((s4 + 4) * (s4 + 5)) + 12345 + 67890 + 11111 + 22222 + 33333 + 44444 + 55555 + 99999
+<Id> user3 <Host> test Query <Time> <State> delete from test.t1 where s1 = 3
+<Id> user4 <Host> test Query <Time> <State> insert into test.t1 values (4, 4, 4, 4)
+
+
+### Execute legacy SHOW [FULL] PROCESSLIST and SELECT on information_schema.processlist
+
+set @@global.performance_schema_show_processlist = off;
+
+SHOW FULL PROCESSLIST;
+Id User Host db Command Time State Info
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
+<Id> root <Host> test <Command> <Time> <State> NULL
+<Id> root <Host> test Query <Time> <State> SHOW FULL PROCESSLIST
+<Id> user1 <Host> test Query <Time> <State> insert into test.t1 values (0, 0, 0, 0)
+<Id> user2 <Host> test Query <Time> <State> update test.t1 set s1 = s1 + 1, s2 = s2 + 2, s3 = s3 + 3, s4 = ((s4 + 4) * (s4 + 5)) + 12345 + 67890 + 11111 + 22222 + 33333 + 44444 + 55555 + 99999
+<Id> user3 <Host> test Query <Time> <State> delete from test.t1 where s1 = 3
+<Id> user4 <Host> test Query <Time> <State> insert into test.t1 values (4, 4, 4, 4)
+
+# Performance Schema processlist table
+
+select * from performance_schema.processlist order by user, id;
+ID USER HOST DB COMMAND TIME STATE INFO
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
+<Id> root <Host> test Query <Time> <State> select * from performance_schema.processlist order by user, id
+<Id> root <Host> test <Command> <Time> <State> NULL
+<Id> user1 <Host> test Query <Time> <State> insert into test.t1 values (0, 0, 0, 0)
+<Id> user2 <Host> test Query <Time> <State> update test.t1 set s1 = s1 + 1, s2 = s2 + 2, s3 = s3 + 3, s4 = ((s4 + 4) * (s4 + 5)) + 12345 + 67890 + 11111 + 22222 + 33333 + 44444 + 55555 + 99999
+<Id> user3 <Host> test Query <Time> <State> delete from test.t1 where s1 = 3
+<Id> user4 <Host> test Query <Time> <State> insert into test.t1 values (4, 4, 4, 4)
+
+# Information Schema processlist table
+
+select * from information_schema.processlist order by user, id;
+ID USER HOST DB COMMAND TIME STATE INFO
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
+<Id> root <Host> test Query <Time> <State> select * from information_schema.processlist order by user, id
+<Id> root <Host> test <Command> <Time> <State> NULL
+<Id> user1 <Host> test Query <Time> <State> insert into test.t1 values (0, 0, 0, 0)
+<Id> user2 <Host> test Query <Time> <State> update test.t1 set s1 = s1 + 1, s2 = s2 + 2, s3 = s3 + 3, s4 = ((s4 + 4) * (s4 + 5)) + 12345 + 67890 + 11111 + 22222 + 33333 + 44444 + 55555 + 99999
+<Id> user3 <Host> test Query <Time> <State> delete from test.t1 where s1 = 3
+<Id> user4 <Host> test Query <Time> <State> insert into test.t1 values (4, 4, 4, 4)
+
+
+### Verify feature code path
+
+# Enable SHOW PROCESSLIST via the Performance Schema
+set @@global.performance_schema_show_processlist = on;
+
+# Connection default, send SHOW PROCESSLIST
+SET DEBUG_SYNC='pfs_show_processlist_performance_schema SIGNAL pfs_processlist_pfs WAIT_FOR continue';
+SHOW FULL PROCESSLIST;
+
+# Connection con0
+SET DEBUG_SYNC='now WAIT_FOR pfs_processlist_pfs';
+SET DEBUG_SYNC='now SIGNAL continue';
+
+# Connection default, reap
+Id User Host db Command Time State Info
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> <Info>
+<Id> root <Host> test <Command> <Time> <State> <Info>
+<Id> root <Host> test <Command> <Time> <State> <Info>
+<Id> user1 <Host> test <Command> <Time> <State> <Info>
+<Id> user2 <Host> test <Command> <Time> <State> <Info>
+<Id> user3 <Host> test <Command> <Time> <State> <Info>
+<Id> user4 <Host> test <Command> <Time> <State> <Info>
+
+
+### Verify legacy code path
+
+# Enable the legacy SHOW PROCESSLIST
+set @@global.performance_schema_show_processlist = off;
+
+# Connection default, send SHOW PROCESSLIST
+SET DEBUG_SYNC='RESET';
+SET DEBUG_SYNC='pfs_show_processlist_legacy SIGNAL pfs_processlist_legacy WAIT_FOR continue';
+SHOW FULL PROCESSLIST;
+
+# Connection con0
+SET DEBUG_SYNC='now WAIT_FOR pfs_processlist_legacy';
+SET DEBUG_SYNC='now SIGNAL continue';
+
+# Connection default, reap
+Id User Host db Command Time State Info
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> <Info>
+<Id> root <Host> test <Command> <Time> <State> <Info>
+<Id> root <Host> test <Command> <Time> <State> <Info>
+<Id> user1 <Host> test <Command> <Time> <State> <Info>
+<Id> user2 <Host> test <Command> <Time> <State> <Info>
+<Id> user3 <Host> test <Command> <Time> <State> <Info>
+<Id> user4 <Host> test <Command> <Time> <State> <Info>
+
+
+### Clean up ###
+
+# Connection con0, unlock test.t1, disconnect
+unlock tables;
+
+# Connection con1, reap, disconnect
+# Connection con2, reap, disconnect
+# Connection con3, reap, disconnect
+# Connection con4, reap, disconnect
+
+# Connection default
+
+drop table test.t1;
+drop user user1@localhost;
+drop user user2@localhost;
+drop user user3@localhost;
+drop user user4@localhost;
+
+set @@global.performance_schema_show_processlist = @save_processlist;
diff --git a/mysql-test/suite/perfschema/r/processlist_57.result b/mysql-test/suite/perfschema/r/processlist_57.result
new file mode 100644
index 00000000000..0068eb6c3cd
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/processlist_57.result
@@ -0,0 +1,345 @@
+call mtr.add_suppression("Optional native table 'performance_schema'.'processlist' has the wrong structure or is missing.");
+call mtr.add_suppression("Column count of performance_schema.processlist is wrong. Expected 8, found 2. The table is probably corrupted");
+##
+## Verify fresh 5.7 instance
+##
+SELECT @@global.performance_schema_show_processlist;
+@@global.performance_schema_show_processlist
+0
+SHOW CREATE TABLE performance_schema.processlist;
+Table Create Table
+processlist CREATE TABLE `processlist` (
+ `ID` bigint(20) unsigned NOT NULL,
+ `USER` varchar(32) DEFAULT NULL,
+ `HOST` varchar(66) DEFAULT NULL,
+ `DB` varchar(64) DEFAULT NULL,
+ `COMMAND` varchar(16) DEFAULT NULL,
+ `TIME` bigint(20) DEFAULT NULL,
+ `STATE` varchar(64) DEFAULT NULL,
+ `INFO` longtext
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+##
+## Simulate old 5.7 instance
+##
+DROP TABLE performance_schema.processlist;
+SHOW CREATE TABLE performance_schema.processlist;
+ERROR 42S02: Table 'performance_schema.processlist' doesn't exist
+##
+## Server shutdown
+##
+##
+### Server restart
+##
+##
+## Verify old 5.7 instance
+##
+SELECT @@global.performance_schema_show_processlist;
+@@global.performance_schema_show_processlist
+0
+SHOW CREATE TABLE performance_schema.processlist;
+ERROR 42S02: Table 'performance_schema.processlist' doesn't exist
+SELECT * FROM performance_schema.processlist;
+ERROR 42S02: Table 'performance_schema.processlist' doesn't exist
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info
+2 root [HOST:PORT] test Query [TIME] starting SHOW PROCESSLIST
+SET GLOBAL performance_schema_show_processlist = 'ON';
+SELECT * FROM performance_schema.processlist;
+ERROR 42S02: Table 'performance_schema.processlist' doesn't exist
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW PROCESSLIST;
+ERROR 42S02: Table 'performance_schema.processlist' doesn't exist
+##
+## Perform broken upgrade (case 1)
+##
+CREATE TABLE performance_schema.processlist (a int, b int);
+SHOW CREATE TABLE performance_schema.processlist;
+Table Create Table
+processlist CREATE TABLE `processlist` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+SET GLOBAL performance_schema_show_processlist = 'OFF';
+SELECT * FROM performance_schema.processlist;
+a b
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info
+2 root [HOST:PORT] test Query [TIME] starting SHOW PROCESSLIST
+SET GLOBAL performance_schema_show_processlist = 'ON';
+SELECT * FROM performance_schema.processlist;
+a b
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW PROCESSLIST;
+ERROR 42S22: Unknown column 'ID' in 'field list'
+##
+## Server shutdown
+##
+##
+### Server restart
+##
+SHOW CREATE TABLE performance_schema.processlist;
+Table Create Table
+processlist CREATE TABLE `processlist` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+SET GLOBAL performance_schema_show_processlist = 'OFF';
+SELECT * FROM performance_schema.processlist;
+a b
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info
+2 root [HOST:PORT] test Query [TIME] starting SHOW PROCESSLIST
+SET GLOBAL performance_schema_show_processlist = 'ON';
+SELECT * FROM performance_schema.processlist;
+a b
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW PROCESSLIST;
+ERROR 42S22: Unknown column 'ID' in 'field list'
+##
+## Perform broken upgrade (case 2)
+##
+DROP TABLE performance_schema.processlist;
+CREATE TABLE performance_schema.processlist (
+`ID` bigint(20) unsigned NOT NULL,
+`USER` varchar(32) DEFAULT NULL,
+`HOST` varchar(66) DEFAULT NULL,
+`DB` varchar(64) DEFAULT NULL,
+`COMMAND` varchar(16) DEFAULT NULL,
+`TIME` bigint(20) DEFAULT NULL,
+`STATE` varchar(64) DEFAULT NULL,
+`INFO` longtext
+);
+SHOW CREATE TABLE performance_schema.processlist;
+Table Create Table
+processlist CREATE TABLE `processlist` (
+ `ID` bigint(20) unsigned NOT NULL,
+ `USER` varchar(32) DEFAULT NULL,
+ `HOST` varchar(66) DEFAULT NULL,
+ `DB` varchar(64) DEFAULT NULL,
+ `COMMAND` varchar(16) DEFAULT NULL,
+ `TIME` bigint(20) DEFAULT NULL,
+ `STATE` varchar(64) DEFAULT NULL,
+ `INFO` longtext
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+SET GLOBAL performance_schema_show_processlist = 'OFF';
+SELECT * FROM performance_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info
+2 root [HOST:PORT] test Query [TIME] starting SHOW PROCESSLIST
+SET GLOBAL performance_schema_show_processlist = 'ON';
+SELECT * FROM performance_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info
+##
+## Server shutdown
+##
+##
+### Server restart
+##
+SHOW CREATE TABLE performance_schema.processlist;
+Table Create Table
+processlist CREATE TABLE `processlist` (
+ `ID` bigint(20) unsigned NOT NULL,
+ `USER` varchar(32) DEFAULT NULL,
+ `HOST` varchar(66) DEFAULT NULL,
+ `DB` varchar(64) DEFAULT NULL,
+ `COMMAND` varchar(16) DEFAULT NULL,
+ `TIME` bigint(20) DEFAULT NULL,
+ `STATE` varchar(64) DEFAULT NULL,
+ `INFO` longtext
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+SET GLOBAL performance_schema_show_processlist = 'OFF';
+SELECT * FROM performance_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info
+2 root [HOST:PORT] test Query [TIME] starting SHOW PROCESSLIST
+SET GLOBAL performance_schema_show_processlist = 'ON';
+SELECT * FROM performance_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info
+##
+## Perform broken upgrade (case 3)
+##
+DROP TABLE performance_schema.processlist;
+CREATE TABLE performance_schema.processlist
+LIKE INFORMATION_SCHEMA.PROCESSLIST;
+SHOW CREATE TABLE performance_schema.processlist;
+Table Create Table
+processlist CREATE TABLE `processlist` (
+ `ID` bigint(21) unsigned NOT NULL DEFAULT '0',
+ `USER` varchar(32) NOT NULL DEFAULT '',
+ `HOST` varchar(64) NOT NULL DEFAULT '',
+ `DB` varchar(64) DEFAULT NULL,
+ `COMMAND` varchar(16) NOT NULL DEFAULT '',
+ `TIME` int(7) NOT NULL DEFAULT '0',
+ `STATE` varchar(64) DEFAULT NULL,
+ `INFO` longtext
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+SET GLOBAL performance_schema_show_processlist = 'OFF';
+SELECT * FROM performance_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info
+2 root [HOST:PORT] test Query [TIME] starting SHOW PROCESSLIST
+SET GLOBAL performance_schema_show_processlist = 'ON';
+SELECT * FROM performance_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info
+##
+## Server shutdown
+##
+##
+### Server restart
+##
+SHOW CREATE TABLE performance_schema.processlist;
+Table Create Table
+processlist CREATE TABLE `processlist` (
+ `ID` bigint(21) unsigned NOT NULL DEFAULT '0',
+ `USER` varchar(32) NOT NULL DEFAULT '',
+ `HOST` varchar(64) NOT NULL DEFAULT '',
+ `DB` varchar(64) DEFAULT NULL,
+ `COMMAND` varchar(16) NOT NULL DEFAULT '',
+ `TIME` int(7) NOT NULL DEFAULT '0',
+ `STATE` varchar(64) DEFAULT NULL,
+ `INFO` longtext
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+SET GLOBAL performance_schema_show_processlist = 'OFF';
+SELECT * FROM performance_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info
+2 root [HOST:PORT] test Query [TIME] starting SHOW PROCESSLIST
+SET GLOBAL performance_schema_show_processlist = 'ON';
+SELECT * FROM performance_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info
+##
+## Perform correct upgrade
+##
+DROP TABLE performance_schema.processlist;
+CREATE TABLE performance_schema.processlist (
+`ID` bigint(20) unsigned NOT NULL,
+`USER` varchar(32) DEFAULT NULL,
+`HOST` varchar(66) DEFAULT NULL,
+`DB` varchar(64) DEFAULT NULL,
+`COMMAND` varchar(16) DEFAULT NULL,
+`TIME` bigint(20) DEFAULT NULL,
+`STATE` varchar(64) DEFAULT NULL,
+`INFO` longtext
+) ENGINE = 'PERFORMANCE_SCHEMA';
+SHOW CREATE TABLE performance_schema.processlist;
+Table Create Table
+processlist CREATE TABLE `processlist` (
+ `ID` bigint(20) unsigned NOT NULL,
+ `USER` varchar(32) DEFAULT NULL,
+ `HOST` varchar(66) DEFAULT NULL,
+ `DB` varchar(64) DEFAULT NULL,
+ `COMMAND` varchar(16) DEFAULT NULL,
+ `TIME` bigint(20) DEFAULT NULL,
+ `STATE` varchar(64) DEFAULT NULL,
+ `INFO` longtext
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+SET GLOBAL performance_schema_show_processlist = 'OFF';
+SELECT * FROM performance_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] Sending data SELECT * FROM performance_schema.processlist
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info
+2 root [HOST:PORT] test Query [TIME] starting SHOW PROCESSLIST
+SET GLOBAL performance_schema_show_processlist = 'ON';
+SELECT * FROM performance_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] Sending data SELECT * FROM performance_schema.processlist
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info
+2 root [HOST:PORT] test Query [TIME] Sending data SHOW PROCESSLIST
+##
+## Server shutdown
+##
+##
+### Server restart
+##
+SHOW CREATE TABLE performance_schema.processlist;
+Table Create Table
+processlist CREATE TABLE `processlist` (
+ `ID` bigint(20) unsigned NOT NULL,
+ `USER` varchar(32) DEFAULT NULL,
+ `HOST` varchar(66) DEFAULT NULL,
+ `DB` varchar(64) DEFAULT NULL,
+ `COMMAND` varchar(16) DEFAULT NULL,
+ `TIME` bigint(20) DEFAULT NULL,
+ `STATE` varchar(64) DEFAULT NULL,
+ `INFO` longtext
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+SET GLOBAL performance_schema_show_processlist = 'OFF';
+SELECT * FROM performance_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] Sending data SELECT * FROM performance_schema.processlist
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info
+2 root [HOST:PORT] test Query [TIME] starting SHOW PROCESSLIST
+SET GLOBAL performance_schema_show_processlist = 'ON';
+SELECT * FROM performance_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] Sending data SELECT * FROM performance_schema.processlist
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info
+2 root [HOST:PORT] test Query [TIME] Sending data SHOW PROCESSLIST
+SET GLOBAL performance_schema_show_processlist = 'OFF';
diff --git a/mysql-test/suite/perfschema/r/processlist_acl.result b/mysql-test/suite/perfschema/r/processlist_acl.result
new file mode 100644
index 00000000000..2e60b403484
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/processlist_acl.result
@@ -0,0 +1,255 @@
+##
+## Test the Performance Schema-based implementation of SHOW PROCESSLIST.
+##
+## Verify handling of the SELECT and PROCESS privileges.
+##
+## Test cases:
+## - Execute SHOW PROCESSLIST (new and legacy) with all privileges
+## - Execute SELECT on the performance_schema.processlist and information_schema.processlist with all privileges
+## - Execute SHOW PROCESSLIST (new and legacy) with no privileges
+## - Execute SELECT on the performance_schema.processlist and information_schema.processlist with no privileges
+##
+## Results must be manually verified.
+
+### Setup ###
+
+select @@global.performance_schema_show_processlist into @save_processlist;
+
+# Control users
+create user user_00@localhost, user_01@localhost;
+grant ALL on *.* to user_00@localhost;
+grant ALL on *.* to user_01@localhost;
+
+# Test users
+create user user_all@localhost, user_none@localhost;
+grant ALL on *.* to user_all@localhost;
+grant USAGE on *.* to user_none@localhost;
+
+flush privileges;
+
+show grants for user_all@localhost;
+Grants for user_all@localhost
+GRANT ALL PRIVILEGES ON *.* TO 'user_all'@'localhost'
+
+show grants for user_none@localhost;
+Grants for user_none@localhost
+GRANT USAGE ON *.* TO 'user_none'@'localhost'
+
+use test;
+create table test.t1 (s1 int, s2 int, s3 int, s4 int);
+
+# Connect (con_00, localhost, user_00, , )
+# Connect (con_01, localhost, user_01, , )
+
+insert into test.t1 values(1, 1, 1, 1);
+insert into test.t1 values(2, 2, 2, 2);
+insert into test.t1 values(3, 3, 3, 3);
+insert into test.t1 values(4, 4, 4, 4);
+
+# Lock test.t1, insert/update/deletes will block
+lock tables t1 read;
+
+# Establish 2 connections for user_all
+# Connect (con_all_1, localhost, user_all, , )
+# Connect (con_all_2, localhost, user_all, , )
+insert into test.t1 values (0, 0, 0, 0);
+
+# Establish 4 connections for user_none
+# Connect (con_none_1, localhost, user_none, , )
+# Connect (con_none_2, localhost, user_none, , )
+# Connect (con_none_3, localhost, user_none, , )
+# Connect (con_none_4, localhost, user_none, , )
+update test.t1 set s1 = s1 + 1, s2 = s2 + 2;;
+
+# Connection con_all_1
+
+# Wait for queries to appear in the processlist table
+
+### Execute SHOW PROCESSLIST with all privileges
+### Expect all users
+
+# New SHOW PROCESSLIST
+set @@global.performance_schema_show_processlist = on;
+
+SHOW FULL PROCESSLIST;
+Id User Host db Command Time State Info
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
+<Id> root <Host> test <Command> <Time> <State> NULL
+<Id> user_00 <Host> test <Command> <Time> <State> NULL
+<Id> user_01 <Host> test <Command> <Time> <State> NULL
+<Id> user_all <Host> test Query <Time> <State> SHOW FULL PROCESSLIST
+<Id> user_all <Host> test Query <Time> <State> insert into test.t1 values (0, 0, 0, 0)
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test Query <Time> <State> update test.t1 set s1 = s1 + 1, s2 = s2 + 2
+
+# Performance Schema processlist table
+
+select * from performance_schema.processlist order by user, id;
+ID USER HOST DB COMMAND TIME STATE INFO
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
+<Id> root <Host> test <Command> <Time> <State> NULL
+<Id> user_00 <Host> test <Command> <Time> <State> NULL
+<Id> user_01 <Host> test <Command> <Time> <State> NULL
+<Id> user_all <Host> test Query <Time> <State> select * from performance_schema.processlist order by user, id
+<Id> user_all <Host> test Query <Time> <State> insert into test.t1 values (0, 0, 0, 0)
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test Query <Time> <State> update test.t1 set s1 = s1 + 1, s2 = s2 + 2
+
+# Information Schema processlist table
+
+select * from information_schema.processlist order by user, id;
+ID USER HOST DB COMMAND TIME STATE INFO
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
+<Id> root <Host> test <Command> <Time> <State> NULL
+<Id> user_00 <Host> test <Command> <Time> <State> NULL
+<Id> user_01 <Host> test <Command> <Time> <State> NULL
+<Id> user_all <Host> test Query <Time> <State> select * from information_schema.processlist order by user, id
+<Id> user_all <Host> test Query <Time> <State> insert into test.t1 values (0, 0, 0, 0)
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test Query <Time> <State> update test.t1 set s1 = s1 + 1, s2 = s2 + 2
+
+# Legacy SHOW PROCESSLIST
+set @@global.performance_schema_show_processlist = off;
+
+SHOW FULL PROCESSLIST;
+Id User Host db Command Time State Info
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
+<Id> root <Host> test <Command> <Time> <State> NULL
+<Id> user_00 <Host> test <Command> <Time> <State> NULL
+<Id> user_01 <Host> test <Command> <Time> <State> NULL
+<Id> user_all <Host> test Query <Time> <State> SHOW FULL PROCESSLIST
+<Id> user_all <Host> test Query <Time> <State> insert into test.t1 values (0, 0, 0, 0)
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test Query <Time> <State> update test.t1 set s1 = s1 + 1, s2 = s2 + 2
+
+# Performance Schema processlist table
+
+select * from performance_schema.processlist order by user, id;
+ID USER HOST DB COMMAND TIME STATE INFO
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
+<Id> root <Host> test <Command> <Time> <State> NULL
+<Id> user_00 <Host> test <Command> <Time> <State> NULL
+<Id> user_01 <Host> test <Command> <Time> <State> NULL
+<Id> user_all <Host> test Query <Time> <State> select * from performance_schema.processlist order by user, id
+<Id> user_all <Host> test Query <Time> <State> insert into test.t1 values (0, 0, 0, 0)
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test Query <Time> <State> update test.t1 set s1 = s1 + 1, s2 = s2 + 2
+
+# Information Schema processlist table
+
+select * from information_schema.processlist order by user, id;
+ID USER HOST DB COMMAND TIME STATE INFO
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
+<Id> root <Host> test <Command> <Time> <State> NULL
+<Id> user_00 <Host> test <Command> <Time> <State> NULL
+<Id> user_01 <Host> test <Command> <Time> <State> NULL
+<Id> user_all <Host> test Query <Time> <State> select * from information_schema.processlist order by user, id
+<Id> user_all <Host> test Query <Time> <State> insert into test.t1 values (0, 0, 0, 0)
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test Query <Time> <State> update test.t1 set s1 = s1 + 1, s2 = s2 + 2
+
+
+### Execute SHOW PROCESSLIST with no SELECT and no PROCESS privileges
+### Expect processes only from user_none
+
+# New SHOW PROCESSLIST
+set @@global.performance_schema_show_processlist = on;
+
+# Connection con_none_1
+
+SHOW FULL PROCESSLIST;
+Id User Host db Command Time State Info
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test Query <Time> <State> SHOW FULL PROCESSLIST
+<Id> user_none <Host> test Query <Time> <State> update test.t1 set s1 = s1 + 1, s2 = s2 + 2
+
+# Performance Schema processlist table
+
+select * from performance_schema.processlist order by user, id;
+ID USER HOST DB COMMAND TIME STATE INFO
+<Id> user_none <Host> test Query <Time> <State> select * from performance_schema.processlist order by user, id
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test Query <Time> <State> update test.t1 set s1 = s1 + 1, s2 = s2 + 2
+
+# Information Schema processlist table
+
+select * from information_schema.processlist order by user, id;
+ID USER HOST DB COMMAND TIME STATE INFO
+<Id> user_none <Host> test Query <Time> <State> select * from information_schema.processlist order by user, id
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test Query <Time> <State> update test.t1 set s1 = s1 + 1, s2 = s2 + 2
+
+# Confirm that only processes from user_none are visible
+
+select count(*) as "Expect 0" from performance_schema.processlist
+where user not in ('user_none');
+Expect 0
+0
+
+# Legacy SHOW PROCESSLIST
+set @@global.performance_schema_show_processlist = off;
+
+# Connection con_none_1
+
+SHOW FULL PROCESSLIST;
+Id User Host db Command Time State Info
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test Query <Time> <State> SHOW FULL PROCESSLIST
+<Id> user_none <Host> test Query <Time> <State> update test.t1 set s1 = s1 + 1, s2 = s2 + 2
+
+# Performance Schema processlist table
+
+select * from performance_schema.processlist order by user, id;
+ID USER HOST DB COMMAND TIME STATE INFO
+<Id> user_none <Host> test Query <Time> <State> select * from performance_schema.processlist order by user, id
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test Query <Time> <State> update test.t1 set s1 = s1 + 1, s2 = s2 + 2
+
+# Information Schema processlist table
+
+select * from information_schema.processlist order by user, id;
+ID USER HOST DB COMMAND TIME STATE INFO
+<Id> user_none <Host> test Query <Time> <State> select * from information_schema.processlist order by user, id
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test Query <Time> <State> update test.t1 set s1 = s1 + 1, s2 = s2 + 2
+
+
+### Clean up ###
+
+# Disconnect con_00
+# Connection con_01, unlock test.t1, disconnect
+unlock tables;
+# Disconnect con_all_1
+# Reap con_all_2, disconnect
+# Disconnect con_none_1
+# Disconnect con_none_2
+# Disconnect con_none_3
+# Reap con_none_4, disconnect
+
+# Connection default
+
+drop table test.t1;
+drop user user_00@localhost;
+drop user user_01@localhost;
+drop user user_all@localhost;
+drop user user_none@localhost;
+
+set @@global.performance_schema_show_processlist = @save_processlist;
diff --git a/mysql-test/suite/perfschema/r/processlist_anonymous.result b/mysql-test/suite/perfschema/r/processlist_anonymous.result
new file mode 100644
index 00000000000..a27a6df2606
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/processlist_anonymous.result
@@ -0,0 +1,66 @@
+##
+## Test the Performance Schema-based implementation of SHOW PROCESSLIST.
+## Verify behavior for anonymous users and PROCESS_ACL.
+##
+SELECT @@global.performance_schema_show_processlist INTO @save_processlist;
+SET @@global.performance_schema_show_processlist = OFF;
+SHOW GRANTS;
+Grants for @localhost
+GRANT USAGE ON *.* TO ''@'localhost'
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+SELECT * FROM performance_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+SHOW PROCESSLIST;
+ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
+SET @@global.performance_schema_show_processlist = ON;
+SHOW GRANTS;
+Grants for @localhost
+GRANT USAGE ON *.* TO ''@'localhost'
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+SELECT * FROM performance_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+SHOW PROCESSLIST;
+ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
+GRANT PROCESS ON *.* TO ''@'localhost';
+SET @@global.performance_schema_show_processlist = OFF;
+SHOW GRANTS;
+Grants for @localhost
+GRANT PROCESS ON *.* TO ''@'localhost'
+SELECT count(*) >= 2 FROM INFORMATION_SCHEMA.PROCESSLIST;
+count(*) >= 2
+1
+SELECT count(*) >= 2 FROM performance_schema.processlist;
+count(*) >= 2
+1
+SHOW PROCESSLIST;
+SELECT "Previous statement is now completed." as status;
+status
+Previous statement is now completed.
+SELECT EVENT_NAME, SQL_TEXT, ROWS_SENT as BROKEN_ROWS_SENT
+FROM performance_schema.events_statements_history
+WHERE SQL_TEXT = "SHOW PROCESSLIST";
+EVENT_NAME SQL_TEXT BROKEN_ROWS_SENT
+statement/sql/show_processlist SHOW PROCESSLIST 0
+TRUNCATE TABLE performance_schema.events_statements_history;
+set @@global.performance_schema_show_processlist = ON;
+SHOW GRANTS;
+Grants for @localhost
+GRANT PROCESS ON *.* TO ''@'localhost'
+SELECT count(*) >= 2 FROM INFORMATION_SCHEMA.PROCESSLIST;
+count(*) >= 2
+1
+SELECT count(*) >= 2 FROM performance_schema.processlist;
+count(*) >= 2
+1
+SHOW PROCESSLIST;
+SELECT "Previous statement is now completed." as status;
+status
+Previous statement is now completed.
+SELECT EVENT_NAME, SQL_TEXT, ROWS_SENT >= 2
+FROM performance_schema.events_statements_history
+WHERE SQL_TEXT = "SHOW PROCESSLIST";
+EVENT_NAME SQL_TEXT ROWS_SENT >= 2
+statement/sql/show_processlist SHOW PROCESSLIST 1
+SET @@global.performance_schema_show_processlist = @save_processlist;
diff --git a/mysql-test/suite/perfschema/r/processlist_no_pfs.result b/mysql-test/suite/perfschema/r/processlist_no_pfs.result
new file mode 100644
index 00000000000..16e5a13b52a
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/processlist_no_pfs.result
@@ -0,0 +1,181 @@
+show databases;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+sys
+test
+select count(*) from performance_schema.performance_timers;
+count(*)
+0
+select count(*) from performance_schema.setup_consumers;
+count(*)
+0
+select count(*) > 4 from performance_schema.setup_instruments;
+count(*) > 4
+0
+select count(*) from performance_schema.setup_timers;
+count(*)
+0
+Warnings:
+Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release.
+select * from performance_schema.accounts;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_digest;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
+select * from performance_schema.events_transactions_current;
+select * from performance_schema.events_transactions_history;
+select * from performance_schema.events_transactions_history_long;
+select * from performance_schema.events_transactions_summary_by_account_by_event_name;
+select * from performance_schema.events_transactions_summary_by_host_by_event_name;
+select * from performance_schema.events_transactions_summary_by_thread_by_event_name;
+select * from performance_schema.events_transactions_summary_by_user_by_event_name;
+select * from performance_schema.events_transactions_summary_global_by_event_name;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.memory_summary_by_account_by_event_name;
+select * from performance_schema.memory_summary_by_host_by_event_name;
+select * from performance_schema.memory_summary_by_thread_by_event_name;
+select * from performance_schema.memory_summary_by_user_by_event_name;
+select * from performance_schema.memory_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.hosts;
+select * from performance_schema.memory_summary_by_account_by_event_name;
+select * from performance_schema.memory_summary_by_host_by_event_name;
+select * from performance_schema.memory_summary_by_thread_by_event_name;
+select * from performance_schema.memory_summary_by_user_by_event_name;
+select * from performance_schema.memory_summary_global_by_event_name;
+select * from performance_schema.metadata_locks;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.session_account_connect_attrs;
+select * from performance_schema.session_connect_attrs;
+select * from performance_schema.setup_actors;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
+select * from performance_schema.setup_timers;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.table_handles;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+select * from performance_schema.table_io_waits_summary_by_table;
+select * from performance_schema.table_lock_waits_summary_by_table;
+select * from performance_schema.threads;
+select * from performance_schema.users;
+select * from performance_schema.replication_connection_configuration;
+select * from performance_schema.replication_connection_status;
+select * from performance_schema.replication_applier_configuration;
+select * from performance_schema.replication_applier_status;
+select * from performance_schema.replication_applier_status_by_coordinator;
+select * from performance_schema.replication_applier_status_by_worker;
+select * from performance_schema.global_status;
+select * from performance_schema.status_by_thread;
+select * from performance_schema.status_by_user;
+select * from performance_schema.status_by_host;
+select * from performance_schema.status_by_account;
+select * from performance_schema.session_status;
+select * from performance_schema.global_variables;
+select * from performance_schema.variables_by_thread;
+select * from performance_schema.session_variables;
+show global variables like "performance_schema%";
+Variable_name Value
+performance_schema OFF
+performance_schema_accounts_size 0
+performance_schema_digests_size 0
+performance_schema_events_stages_history_long_size 0
+performance_schema_events_stages_history_size 0
+performance_schema_events_statements_history_long_size 0
+performance_schema_events_statements_history_size 0
+performance_schema_events_transactions_history_long_size 0
+performance_schema_events_transactions_history_size 0
+performance_schema_events_waits_history_long_size 0
+performance_schema_events_waits_history_size 0
+performance_schema_hosts_size 0
+performance_schema_max_cond_classes 0
+performance_schema_max_cond_instances 0
+performance_schema_max_digest_length 0
+performance_schema_max_file_classes 0
+performance_schema_max_file_handles 0
+performance_schema_max_file_instances 0
+performance_schema_max_index_stat 0
+performance_schema_max_memory_classes 0
+performance_schema_max_metadata_locks 0
+performance_schema_max_mutex_classes 0
+performance_schema_max_mutex_instances 0
+performance_schema_max_prepared_statements_instances 0
+performance_schema_max_program_instances 0
+performance_schema_max_rwlock_classes 0
+performance_schema_max_rwlock_instances 0
+performance_schema_max_socket_classes 0
+performance_schema_max_socket_instances 0
+performance_schema_max_sql_text_length 0
+performance_schema_max_stage_classes 0
+performance_schema_max_statement_classes 0
+performance_schema_max_statement_stack 0
+performance_schema_max_table_handles 0
+performance_schema_max_table_instances 0
+performance_schema_max_table_lock_stat 0
+performance_schema_max_thread_classes 0
+performance_schema_max_thread_instances 0
+performance_schema_session_connect_attrs_size 0
+performance_schema_setup_actors_size 0
+performance_schema_setup_objects_size 0
+performance_schema_show_processlist ON
+performance_schema_users_size 0
+show engine PERFORMANCE_SCHEMA status;
+show global status like "performance_schema%";
+
+select * from information_schema.engines
+where engine = "PERFORMANCE_SCHEMA";
+ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
+PERFORMANCE_SCHEMA YES Performance Schema NO NO NO
+
+# If the Performance Schema is disabled, then expect
+# performance-schema-show-processlist = OFF
+# regardless of its initial setting
+
+select @@global.performance_schema_show_processlist;
+@@global.performance_schema_show_processlist
+1
+
+# If the Performance Schema is disabled, then setting
+# performance-schema-show-processlist = ON
+# succeeds, SHOW PROCESSLIST returns no data.
+
+set @@global.performance_schema_show_processlist = ON;
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info
+
+show global variables like "performance_schema";
+Variable_name Value
+performance_schema OFF
diff --git a/mysql-test/suite/perfschema/r/processlist_port.result b/mysql-test/suite/perfschema/r/processlist_port.result
new file mode 100644
index 00000000000..c11ff41f112
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/processlist_port.result
@@ -0,0 +1,145 @@
+##
+## Test the Performance Schema-based implementation of SHOW PROCESSLIST.
+##
+## Verify the Host field (hostname:port) against the legacy implementation.
+##
+
+### Setup ###
+
+select @@global.performance_schema_show_processlist into @save_processlist;
+
+# Control user
+create user user0@localhost;
+grant ALL on *.* to user0@localhost;
+# Test users
+
+create user user1@localhost, user2@localhost,
+user3@localhost, user4@localhost;
+
+grant USAGE on *.* to user1@localhost;
+grant ALL on *.* to user2@localhost;
+grant ALL on *.* to user3@localhost;
+grant ALL on *.* to user4@localhost;
+
+flush privileges;
+
+show grants for user1@localhost;
+Grants for user1@localhost
+GRANT USAGE ON *.* TO 'user1'@'localhost'
+
+# Connect (con_user0, 127.0.0.1, user0, , , MASTER_MYPORT, )
+
+select connection_id() into @con_user0_id;
+# Connect (con_user1, 127.0.0.1, user1, , , MASTER_MYPORT, )
+# Connect (con_user2, 127.0.0.1, user2, , , MASTER_MYPORT, )
+# Connect (con_user3, 127.0.0.1, user3, , , MASTER_MYPORT, )
+# Connect (con_user4, 127.0.0.1, user4, , , MASTER_MYPORT, )
+# Connection user0
+
+### Compare the SHOW PROCESSLIST Host column between the new and old implementations
+
+## New SHOW PROCESSLIST
+set @@global.performance_schema_show_processlist = on;
+
+SHOW FULL PROCESSLIST;
+Id User Host db Command Time State Info
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
+<Id> root <Host> test <Command> <Time> <State> NULL
+<Id> user0 <Host> test Query <Time> <State> SHOW FULL PROCESSLIST
+<Id> user1 <Host> test <Command> <Time> <State> NULL
+<Id> user2 <Host> test <Command> <Time> <State> NULL
+<Id> user3 <Host> test <Command> <Time> <State> NULL
+<Id> user4 <Host> test <Command> <Time> <State> NULL
+
+# Performance Schema processlist table
+
+select * from performance_schema.processlist order by user, id;
+ID USER HOST DB COMMAND TIME STATE INFO
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
+<Id> root <Host> test <Command> <Time> <State> NULL
+<Id> user0 <Host> test Query <Time> <State> select * from performance_schema.processlist order by user, id
+<Id> user1 <Host> test <Command> <Time> <State> NULL
+<Id> user2 <Host> test <Command> <Time> <State> NULL
+<Id> user3 <Host> test <Command> <Time> <State> NULL
+<Id> user4 <Host> test <Command> <Time> <State> NULL
+
+# Information Schema processlist table
+
+select * from information_schema.processlist order by user, id;
+ID USER HOST DB COMMAND TIME STATE INFO
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
+<Id> root <Host> test <Command> <Time> <State> NULL
+<Id> user0 <Host> test Query <Time> <State> select * from information_schema.processlist order by user, id
+<Id> user1 <Host> test <Command> <Time> <State> NULL
+<Id> user2 <Host> test <Command> <Time> <State> NULL
+<Id> user3 <Host> test <Command> <Time> <State> NULL
+<Id> user4 <Host> test <Command> <Time> <State> NULL
+
+# Connection user1
+# Get Host:Port, new
+
+## Legacy SHOW PROCESSLIST
+set @@global.performance_schema_show_processlist = off;
+
+SHOW FULL PROCESSLIST;
+Id User Host db Command Time State Info
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
+<Id> root <Host> test <Command> <Time> <State> NULL
+<Id> user0 <Host> test Query <Time> <State> SHOW FULL PROCESSLIST
+<Id> user1 <Host> test <Command> <Time> <State> NULL
+<Id> user2 <Host> test <Command> <Time> <State> NULL
+<Id> user3 <Host> test <Command> <Time> <State> NULL
+<Id> user4 <Host> test <Command> <Time> <State> NULL
+
+# Performance Schema processlist table
+
+select * from performance_schema.processlist order by user, id;
+ID USER HOST DB COMMAND TIME STATE INFO
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
+<Id> root <Host> test <Command> <Time> <State> NULL
+<Id> user0 <Host> test Query <Time> <State> select * from performance_schema.processlist order by user, id
+<Id> user1 <Host> test <Command> <Time> <State> NULL
+<Id> user2 <Host> test <Command> <Time> <State> NULL
+<Id> user3 <Host> test <Command> <Time> <State> NULL
+<Id> user4 <Host> test <Command> <Time> <State> NULL
+
+# Information Schema processlist table
+
+select * from information_schema.processlist order by user, id;
+ID USER HOST DB COMMAND TIME STATE INFO
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
+<Id> root <Host> test <Command> <Time> <State> NULL
+<Id> user0 <Host> test Query <Time> <State> select * from information_schema.processlist order by user, id
+<Id> user1 <Host> test <Command> <Time> <State> NULL
+<Id> user2 <Host> test <Command> <Time> <State> NULL
+<Id> user3 <Host> test <Command> <Time> <State> NULL
+<Id> user4 <Host> test <Command> <Time> <State> NULL
+
+# Connection user1
+# Get Host:Port, legacy
+
+***SUCCESS*** The SHOW PROCESSLIST Host fields match
+
+### Compare the processlist Host column between Performance Schema and the Information Schema
+
+# Connection con_user0
+
+***SUCCESS*** The processlist Host fields match between the Performance Schema and the Information Schema
+
+
+### Clean up ###
+
+# Disconnect con_user0
+# Disconnect con_user1
+# Disconnect con_user2
+# Disconnect con_user3
+# Disconnect con_user4
+# Connection default
+
+drop user user0@localhost;
+drop user user1@localhost;
+drop user user2@localhost;
+drop user user3@localhost;
+drop user user4@localhost;
+
+set @@global.performance_schema_show_processlist = @save_processlist;
diff --git a/mysql-test/suite/perfschema/r/processlist_reg_user.result b/mysql-test/suite/perfschema/r/processlist_reg_user.result
new file mode 100644
index 00000000000..72e879e4c09
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/processlist_reg_user.result
@@ -0,0 +1,89 @@
+##
+## Test the Performance Schema-based implementation of SHOW PROCESSLIST.
+## Verify behavior for regular users and PROCESS_ACL.
+##
+SELECT @@global.performance_schema_show_processlist INTO @save_processlist;
+SET @@global.performance_schema_show_processlist = OFF;
+CREATE USER 'regular'@'localhost';
+SHOW GRANTS;
+Grants for regular@localhost
+GRANT USAGE ON *.* TO 'regular'@'localhost'
+SELECT USER, INFO FROM INFORMATION_SCHEMA.PROCESSLIST;
+USER INFO
+regular SELECT USER, INFO FROM INFORMATION_SCHEMA.PROCESSLIST
+SELECT USER, INFO FROM performance_schema.processlist;
+USER INFO
+regular SELECT USER, INFO FROM performance_schema.processlist
+SHOW PROCESSLIST;
+SELECT "Previous statement is now completed." as status;
+status
+Previous statement is now completed.
+SELECT EVENT_NAME, SQL_TEXT, ROWS_SENT as BROKEN_ROWS_SENT
+FROM performance_schema.events_statements_history
+WHERE SQL_TEXT = "SHOW PROCESSLIST";
+EVENT_NAME SQL_TEXT BROKEN_ROWS_SENT
+statement/sql/show_processlist SHOW PROCESSLIST 0
+TRUNCATE TABLE performance_schema.events_statements_history;
+SET @@global.performance_schema_show_processlist = ON;
+SHOW GRANTS;
+Grants for regular@localhost
+GRANT USAGE ON *.* TO 'regular'@'localhost'
+SELECT USER, INFO FROM INFORMATION_SCHEMA.PROCESSLIST;
+USER INFO
+regular SELECT USER, INFO FROM INFORMATION_SCHEMA.PROCESSLIST
+SELECT USER, INFO FROM performance_schema.processlist;
+USER INFO
+regular SELECT USER, INFO FROM performance_schema.processlist
+SHOW PROCESSLIST;
+SELECT "Previous statement is now completed." as status;
+status
+Previous statement is now completed.
+SELECT EVENT_NAME, SQL_TEXT, ROWS_SENT
+FROM performance_schema.events_statements_history
+WHERE SQL_TEXT = "SHOW PROCESSLIST";
+EVENT_NAME SQL_TEXT ROWS_SENT
+statement/sql/show_processlist SHOW PROCESSLIST 1
+TRUNCATE TABLE performance_schema.events_statements_history;
+GRANT PROCESS ON *.* TO 'regular'@'localhost';
+SET @@global.performance_schema_show_processlist = OFF;
+SHOW GRANTS;
+Grants for regular@localhost
+GRANT PROCESS ON *.* TO 'regular'@'localhost'
+SELECT count(*) >= 2 FROM INFORMATION_SCHEMA.PROCESSLIST;
+count(*) >= 2
+1
+SELECT count(*) >= 2 FROM performance_schema.processlist;
+count(*) >= 2
+1
+SHOW PROCESSLIST;
+SELECT "Previous statement is now completed." as status;
+status
+Previous statement is now completed.
+SELECT EVENT_NAME, SQL_TEXT, ROWS_SENT as BROKEN_ROWS_SENT
+FROM performance_schema.events_statements_history
+WHERE SQL_TEXT = "SHOW PROCESSLIST";
+EVENT_NAME SQL_TEXT BROKEN_ROWS_SENT
+statement/sql/show_processlist SHOW PROCESSLIST 0
+TRUNCATE TABLE performance_schema.events_statements_history;
+SET @@global.performance_schema_show_processlist = ON;
+SHOW GRANTS;
+Grants for regular@localhost
+GRANT PROCESS ON *.* TO 'regular'@'localhost'
+SELECT count(*) >= 2 FROM INFORMATION_SCHEMA.PROCESSLIST;
+count(*) >= 2
+1
+SELECT count(*) >= 2 FROM performance_schema.processlist;
+count(*) >= 2
+1
+SHOW PROCESSLIST;
+SELECT "Previous statement is now completed." as status;
+status
+Previous statement is now completed.
+SELECT EVENT_NAME, SQL_TEXT, ROWS_SENT >= 2
+FROM performance_schema.events_statements_history
+WHERE SQL_TEXT = "SHOW PROCESSLIST";
+EVENT_NAME SQL_TEXT ROWS_SENT >= 2
+statement/sql/show_processlist SHOW PROCESSLIST 1
+TRUNCATE TABLE performance_schema.events_statements_history;
+SET @@global.performance_schema_show_processlist = @save_processlist;
+DROP USER 'regular'@'localhost';
diff --git a/mysql-test/suite/perfschema/r/show_sanity.result b/mysql-test/suite/perfschema/r/show_sanity.result
index dc326dd7f64..6fb33ea4d17 100644
--- a/mysql-test/suite/perfschema/r/show_sanity.result
+++ b/mysql-test/suite/perfschema/r/show_sanity.result
@@ -414,6 +414,7 @@ SHOW_MODE SOURCE VARIABLE_NAME
5.6 I_S.SESSION_VARIABLES INNODB_STATS_INCLUDE_DELETE_MARKED
5.6 I_S.SESSION_VARIABLES KEYRING_OPERATIONS
5.6 I_S.SESSION_VARIABLES LOG_STATEMENTS_UNSAFE_FOR_BINLOG
+5.6 I_S.SESSION_VARIABLES PERFORMANCE_SCHEMA_SHOW_PROCESSLIST
5.6 I_S.SESSION_VARIABLES REPLICATION_OPTIMIZE_FOR_STATIC_PLUGIN_CONFIG
5.6 I_S.SESSION_VARIABLES REPLICATION_SENDER_OBSERVE_COMMIT_ONLY
5.6 I_S.SESSION_VARIABLES TLS_VERSION
@@ -444,6 +445,7 @@ SHOW_MODE SOURCE VARIABLE_NAME
5.6 I_S.SESSION_VARIABLES INNODB_STATS_INCLUDE_DELETE_MARKED
5.6 I_S.SESSION_VARIABLES KEYRING_OPERATIONS
5.6 I_S.SESSION_VARIABLES LOG_STATEMENTS_UNSAFE_FOR_BINLOG
+5.6 I_S.SESSION_VARIABLES PERFORMANCE_SCHEMA_SHOW_PROCESSLIST
5.6 I_S.SESSION_VARIABLES REPLICATION_OPTIMIZE_FOR_STATIC_PLUGIN_CONFIG
5.6 I_S.SESSION_VARIABLES REPLICATION_SENDER_OBSERVE_COMMIT_ONLY
5.6 I_S.SESSION_VARIABLES TLS_VERSION
diff --git a/mysql-test/suite/perfschema/r/threads_mysql.result b/mysql-test/suite/perfschema/r/threads_mysql.result
index d0748349af3..20c119da31f 100644
--- a/mysql-test/suite/perfschema/r/threads_mysql.result
+++ b/mysql-test/suite/perfschema/r/threads_mysql.result
@@ -3,7 +3,7 @@ SELECT name, type, processlist_user, processlist_host, processlist_db,
processlist_command, processlist_info, connection_type,
IF(parent_thread_id IS NULL, parent_thread_id, 'unified parent_thread_id')
AS unified_parent_thread_id,
-role, instrumented
+`role`, instrumented
FROM performance_schema.threads
WHERE name LIKE 'thread/sql%'
ORDER BY name;
@@ -39,7 +39,7 @@ processlist_info SELECT name, type, processlist_user, processlist_host, processl
processlist_command, processlist_info, connection_type,
IF(parent_thread_id IS NULL, parent_thread_id, 'unified parent_thread_id')
AS unified_parent_thread_id,
-role, instrumented
+`role`, instrumented
FROM performance_schema.threads
WHERE name LIKE 'thread/sql%'
ORDER BY name
@@ -66,7 +66,7 @@ SELECT name, type, processlist_user, processlist_host, processlist_db,
processlist_command, processlist_info,
IF(parent_thread_id IS NULL, parent_thread_id, 'unified parent_thread_id')
AS unified_parent_thread_id,
-role, instrumented
+`role`, instrumented
FROM performance_schema.threads
WHERE name LIKE 'thread/sql%'
AND thread_id NOT IN (SELECT thread_id FROM t1)
@@ -94,7 +94,7 @@ SELECT name, type, processlist_user, processlist_host, processlist_db,
processlist_command, processlist_info,
IF(parent_thread_id IS NULL, parent_thread_id, 'unified parent_thread_id')
AS unified_parent_thread_id,
-role, instrumented
+`role`, instrumented
FROM performance_schema.threads
WHERE name LIKE 'thread/sql%'
AND thread_id NOT IN (SELECT thread_id FROM t1)
diff --git a/mysql-test/suite/perfschema/t/ddl_processlist.test b/mysql-test/suite/perfschema/t/ddl_processlist.test
new file mode 100644
index 00000000000..d960bf2df89
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/ddl_processlist.test
@@ -0,0 +1,32 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+
+select @@global.performance_schema_show_processlist into @save_processlist;
+set @@global.performance_schema_show_processlist = 'on';
+
+--error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.processlist
+ add column foo integer;
+
+--error ER_WRONG_PERFSCHEMA_USAGE
+truncate table performance_schema.processlist;
+
+--error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.processlist
+ add index test_index(info);
+
+--error ER_DBACCESS_DENIED_ERROR
+create unique index test_index
+ on performance_schema.processlist(host);
+
+-- error ER_DBACCESS_DENIED_ERROR
+drop index `PRIMARY`
+ on performance_schema.processlist;
+
+CREATE TABLE test.create_select
+ AS SELECT * from performance_schema.processlist;
+
+DROP TABLE test.create_select;
+
+set @@global.performance_schema_show_processlist = @save_processlist;
diff --git a/mysql-test/suite/perfschema/t/dml_processlist.test b/mysql-test/suite/perfschema/t/dml_processlist.test
new file mode 100644
index 00000000000..c075db3eabd
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/dml_processlist.test
@@ -0,0 +1,39 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+
+select @@global.performance_schema_show_processlist into @save_processlist;
+set @@global.performance_schema_show_processlist = 'on';
+
+--disable_result_log
+select * from performance_schema.processlist
+ where user like 'event_scheduler';
+
+select * from performance_schema.processlist
+ where user = 'FOO';
+--enable_result_log
+
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into performance_schema.processlist
+ values (12, 'foo', 'bar', 'test', null, 1000, 'state', 'info');
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.processlist
+ set id=12, user='foo';
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.processlist
+ where id <> 99;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.processlist;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.processlist READ;
+UNLOCK TABLES;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.processlist WRITE;
+UNLOCK TABLES;
+
+set @@global.performance_schema_show_processlist = @save_processlist;
diff --git a/mysql-test/suite/perfschema/t/misc_global_status-master.opt b/mysql-test/suite/perfschema/t/misc_global_status-master.opt
new file mode 100644
index 00000000000..26b61f08d4e
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/misc_global_status-master.opt
@@ -0,0 +1 @@
+--loose-performance_schema_hosts_size=0
diff --git a/mysql-test/suite/perfschema/t/misc_global_status.test b/mysql-test/suite/perfschema/t/misc_global_status.test
new file mode 100644
index 00000000000..be20835c66e
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/misc_global_status.test
@@ -0,0 +1,134 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+--source include/have_query_cache_disabled.inc
+
+CREATE USER user1@localhost;
+CREATE USER user2@localhost;
+CREATE USER user3@localhost;
+
+grant ALL on *.* to user1@localhost;
+grant ALL on *.* to user2@localhost;
+grant ALL on *.* to user3@localhost;
+
+# To aggregate to accounts
+#SET GLOBAL show_compatibility_56=0;
+
+TRUNCATE TABLE performance_schema.accounts;
+
+FLUSH PRIVILEGES;
+
+CREATE TABLE test.t_range(a int, b int, PRIMARY KEY(a));
+
+INSERT INTO test.t_range values (1, 1), (2,2), (3, 3), (4, 4), (5, 5);
+INSERT INTO test.t_range values (6, 6), (7,7), (8, 8), (9, 9), (10, 10);
+
+FLUSH STATUS;
+
+let $initial= `SELECT VARIABLE_VALUE FROM performance_schema.global_status WHERE VARIABLE_NAME = 'Select_range'`;
+
+# Causes Select_range to increment (+1)
+SELECT * from test.t_range where (a >= 3) AND (a <= 5);
+
+SELECT * from performance_schema.session_status
+ WHERE VARIABLE_NAME = 'Select_range';
+
+--disable_query_log
+eval SELECT VARIABLE_NAME, (VARIABLE_VALUE - $initial) AS DELTA from performance_schema.global_status WHERE VARIABLE_NAME = 'Select_range';
+--enable_query_log
+
+connect(con1, localhost, user1,,);
+# Causes Select_range to increment (+1)
+SELECT * from test.t_range where (a >= 3) AND (a <= 5);
+
+SELECT * from performance_schema.session_status
+ WHERE VARIABLE_NAME = 'Select_range';
+
+--disable_query_log
+eval SELECT VARIABLE_NAME, (VARIABLE_VALUE - $initial) AS DELTA from performance_schema.global_status WHERE VARIABLE_NAME = 'Select_range';
+--enable_query_log
+
+connect(con2, localhost, user2,,);
+# Causes Select_range to increment (+2)
+SELECT * from test.t_range where (a >= 3) AND (a <= 5);
+SELECT * from test.t_range where (a >= 4) AND (a <= 6);
+
+SELECT * from performance_schema.session_status
+ WHERE VARIABLE_NAME = 'Select_range';
+
+--disable_query_log
+eval SELECT VARIABLE_NAME, (VARIABLE_VALUE - $initial) AS DELTA from performance_schema.global_status WHERE VARIABLE_NAME = 'Select_range';
+--enable_query_log
+
+connect(con3, localhost, user3,,);
+# Causes Select_range to increment (+3)
+SELECT * from test.t_range where (a >= 3) AND (a <= 5);
+SELECT * from test.t_range where (a >= 4) AND (a <= 6);
+SELECT * from test.t_range where (a >= 5) AND (a <= 7);
+
+SELECT * from performance_schema.session_status
+ WHERE VARIABLE_NAME = 'Select_range';
+
+--disable_query_log
+eval SELECT VARIABLE_NAME, (VARIABLE_VALUE - $initial) AS DELTA from performance_schema.global_status WHERE VARIABLE_NAME = 'Select_range';
+--enable_query_log
+
+--connection default
+
+--disable_query_log
+eval SELECT VARIABLE_NAME, (VARIABLE_VALUE - $initial) AS DELTA from performance_schema.global_status WHERE VARIABLE_NAME = 'Select_range';
+--enable_query_log
+
+SELECT `USER`, `HOST`, VARIABLE_NAME, VARIABLE_VALUE
+ FROM performance_schema.status_by_account WHERE VARIABLE_NAME = 'Select_range'
+ AND `USER` LIKE 'user%'
+ ORDER BY `USER`;
+
+--disconnect con1
+--disconnect con2
+
+# Wait till all disconnects are completed
+let $count_sessions= 2;
+--source include/wait_until_count_sessions.inc
+
+--disable_query_log
+eval SELECT VARIABLE_NAME, (VARIABLE_VALUE - $initial) AS DELTA from performance_schema.global_status WHERE VARIABLE_NAME = 'Select_range';
+--enable_query_log
+
+TRUNCATE TABLE performance_schema.accounts;
+
+--disable_query_log
+eval SELECT VARIABLE_NAME, (VARIABLE_VALUE - $initial) AS DELTA from performance_schema.global_status WHERE VARIABLE_NAME = 'Select_range';
+--enable_query_log
+
+--disconnect con3
+
+# Wait till all disconnects are completed
+let $count_sessions= 1;
+--source include/wait_until_count_sessions.inc
+
+--disable_query_log
+eval SELECT VARIABLE_NAME, (VARIABLE_VALUE - $initial) AS DELTA from performance_schema.global_status WHERE VARIABLE_NAME = 'Select_range';
+--enable_query_log
+
+# Make sure TRUNCATE on accounts does not add to global_status
+TRUNCATE TABLE performance_schema.accounts;
+
+--disable_query_log
+eval SELECT VARIABLE_NAME, (VARIABLE_VALUE - $initial) AS DELTA from performance_schema.global_status WHERE VARIABLE_NAME = 'Select_range';
+--enable_query_log
+
+DROP TABLE test.t_range;
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM user1@localhost;
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM user2@localhost;
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM user3@localhost;
+DROP USER user1@localhost;
+DROP USER user2@localhost;
+DROP USER user3@localhost;
+
+#SET GLOBAL show_compatibility_56=1;
+
+FLUSH PRIVILEGES;
+
diff --git a/mysql-test/suite/perfschema/t/processlist-master.opt b/mysql-test/suite/perfschema/t/processlist-master.opt
new file mode 100644
index 00000000000..f93413a61e5
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/processlist-master.opt
@@ -0,0 +1 @@
+--event-scheduler
diff --git a/mysql-test/suite/perfschema/t/processlist.test b/mysql-test/suite/perfschema/t/processlist.test
new file mode 100644
index 00000000000..fed22153931
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/processlist.test
@@ -0,0 +1,197 @@
+--echo ##
+--echo ## Test the Performance Schema-based implementation of SHOW PROCESSLIST.
+--echo ##
+--echo ## Test cases:
+--echo ## 1. Execute the new SHOW [FULL] PROCESSLIST and SELECT on performance_schema.processlist
+--echo ## 2. Execute the legacy SHOW [FULL] PROCESSLIST and SELECT on information_schema.processlist
+--echo ## 3. Verify that performance_schema_show_processlist = ON executes the new implementation
+--echo ## 4. Verify that performance_schema_show_processlist = OFF executes the legacy code path
+--echo ##
+--echo ## Results must be manually verified.
+
+--source include/no_protocol.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+--source include/not_embedded.inc
+
+--echo
+--echo ### Setup ###
+--echo
+select @@global.performance_schema_show_processlist into @save_processlist;
+
+--echo
+create user user1@localhost, user2@localhost,
+ user3@localhost, user4@localhost;
+--echo
+grant ALL on *.* to user1@localhost;
+grant ALL on *.* to user2@localhost;
+grant ALL on *.* to user3@localhost;
+grant ALL on *.* to user4@localhost;
+--echo
+flush privileges;
+
+--echo
+use test;
+create table test.t1 (s1 int, s2 int, s3 int, s4 int);
+
+--echo
+--echo # Switch to (con0, localhost, root, , )
+connect (con0, localhost, root, , );
+--echo
+insert into test.t1 values(1, 1, 1, 1);
+insert into test.t1 values(2, 2, 2, 2);
+insert into test.t1 values(3, 3, 3, 3);
+insert into test.t1 values(4, 4, 4, 4);
+
+--echo
+--echo # Lock test.t1, insert/update/deletes will block
+lock tables t1 read;
+
+--echo
+--echo # Connect (con1, localhost, user1, , )
+connect (con1, localhost, user1, , );
+--send insert into test.t1 values (0, 0, 0, 0)
+
+--echo
+--echo # Connect (con2, localhost, user2, , )
+connect (con2, localhost, user2, , );
+# Create a query > 100 characters
+--send update test.t1 set s1 = s1 + 1, s2 = s2 + 2, s3 = s3 + 3, s4 = ((s4 + 4) * (s4 + 5)) + 12345 + 67890 + 11111 + 22222 + 33333 + 44444 + 55555 + 99999;
+--echo
+--echo # Connect (con3, localhost, user3, , )
+connect (con3, localhost, user3, , );
+--send delete from test.t1 where s1 = 3
+
+--echo
+--echo # Connect (con4, localhost, user4, , )
+connect (con4, localhost, user4, , );
+--send insert into test.t1 values (4, 4, 4, 4)
+
+--echo
+--echo # Connection default
+--connection default
+
+--echo
+--echo # Wait for queries to appear in the processlist table
+let $wait_condition = select count(*) >= 4 from information_schema.processlist
+ where state like '%metadata%';
+--source include/wait_condition.inc
+
+--echo
+--echo
+--echo ### Execute new SHOW [FULL] PROCESSLIST and SELECT on performance_schema.processlist
+--echo
+let $pfs_spl = on;
+--source ../include/processlist_set.inc
+--source ../include/processlist_load.inc
+
+--echo
+--echo
+--echo ### Execute legacy SHOW [FULL] PROCESSLIST and SELECT on information_schema.processlist
+--echo
+let $pfs_spl = off;
+--source ../include/processlist_set.inc
+--source ../include/processlist_load.inc
+
+--echo
+--echo
+--echo ### Verify feature code path
+--echo
+--echo # Enable SHOW PROCESSLIST via the Performance Schema
+let $pfs_spl = on;
+--source ../include/processlist_set.inc
+
+--echo
+--echo # Connection default, send SHOW PROCESSLIST
+--connection default
+SET DEBUG_SYNC='pfs_show_processlist_performance_schema SIGNAL pfs_processlist_pfs WAIT_FOR continue';
+--send SHOW FULL PROCESSLIST
+
+--echo
+--echo # Connection con0
+--connection con0
+SET DEBUG_SYNC='now WAIT_FOR pfs_processlist_pfs';
+SET DEBUG_SYNC='now SIGNAL continue';
+
+--echo
+--echo # Connection default, reap
+--connection default
+--replace_column 1 <Id> 3 <Host> 5 <Command> 6 <Time> 7 <State> 8 <Info>
+--sorted_result
+--reap
+
+--echo
+--echo
+--echo ### Verify legacy code path
+--echo
+--echo # Enable the legacy SHOW PROCESSLIST
+let $pfs_spl = off;
+--source ../include/processlist_set.inc
+
+--echo
+--echo # Connection default, send SHOW PROCESSLIST
+--connection default
+SET DEBUG_SYNC='RESET';
+SET DEBUG_SYNC='pfs_show_processlist_legacy SIGNAL pfs_processlist_legacy WAIT_FOR continue';
+--send SHOW FULL PROCESSLIST
+
+--echo
+--echo # Connection con0
+--connection con0
+SET DEBUG_SYNC='now WAIT_FOR pfs_processlist_legacy';
+SET DEBUG_SYNC='now SIGNAL continue';
+
+--echo
+--echo # Connection default, reap
+--connection default
+--replace_column 1 <Id> 3 <Host> 5 <Command> 6 <Time> 7 <State> 8 <Info>
+--sorted_result
+--reap
+
+--echo
+--echo
+--echo ### Clean up ###
+--echo
+
+--echo # Connection con0, unlock test.t1, disconnect
+--connection con0
+unlock tables;
+--disconnect con0
+
+--disable_query_log
+--disable_result_log
+--echo
+--echo # Connection con1, reap, disconnect
+--connection con1
+--reap
+--disconnect con1
+
+--echo # Connection con2, reap, disconnect
+--connection con2
+--reap
+--disconnect con2
+
+--echo # Connection con3, reap, disconnect
+--connection con3
+--reap
+--disconnect con3
+
+--echo # Connection con4, reap, disconnect
+--connection con4
+--reap
+--disconnect con4
+--enable_result_log
+--enable_query_log
+
+--echo
+--echo # Connection default
+--connection default
+
+--echo
+drop table test.t1;
+drop user user1@localhost;
+drop user user2@localhost;
+drop user user3@localhost;
+drop user user4@localhost;
+--echo
+set @@global.performance_schema_show_processlist = @save_processlist;
diff --git a/mysql-test/suite/perfschema/t/processlist_57.test b/mysql-test/suite/perfschema/t/processlist_57.test
new file mode 100644
index 00000000000..748d8b7402b
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/processlist_57.test
@@ -0,0 +1,349 @@
+
+--source include/no_protocol.inc
+--source include/not_embedded.inc
+
+call mtr.add_suppression("Optional native table 'performance_schema'.'processlist' has the wrong structure or is missing.");
+call mtr.add_suppression("Column count of performance_schema.processlist is wrong. Expected 8, found 2. The table is probably corrupted");
+
+--echo ##
+--echo ## Verify fresh 5.7 instance
+--echo ##
+
+SELECT @@global.performance_schema_show_processlist;
+
+SHOW CREATE TABLE performance_schema.processlist;
+
+--echo ##
+--echo ## Simulate old 5.7 instance
+--echo ##
+
+DROP TABLE performance_schema.processlist;
+
+--error ER_NO_SUCH_TABLE
+SHOW CREATE TABLE performance_schema.processlist;
+
+let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
+--exec echo "wait" > $restart_file
+--echo ##
+--echo ## Server shutdown
+--echo ##
+--shutdown_server
+--source include/wait_until_disconnected.inc
+--echo ##
+--echo ### Server restart
+--echo ##
+--exec echo "restart:">$restart_file
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+--echo ##
+--echo ## Verify old 5.7 instance
+--echo ##
+
+SELECT @@global.performance_schema_show_processlist;
+
+--error ER_NO_SUCH_TABLE
+SHOW CREATE TABLE performance_schema.processlist;
+
+--error ER_NO_SUCH_TABLE
+SELECT * FROM performance_schema.processlist;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SHOW PROCESSLIST;
+
+SET GLOBAL performance_schema_show_processlist = 'ON';
+
+--error ER_NO_SUCH_TABLE
+SELECT * FROM performance_schema.processlist;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+--error ER_NO_SUCH_TABLE
+SHOW PROCESSLIST;
+
+--echo ##
+--echo ## Perform broken upgrade (case 1)
+--echo ##
+
+CREATE TABLE performance_schema.processlist (a int, b int);
+
+SHOW CREATE TABLE performance_schema.processlist;
+
+SET GLOBAL performance_schema_show_processlist = 'OFF';
+
+SELECT * FROM performance_schema.processlist;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SHOW PROCESSLIST;
+
+SET GLOBAL performance_schema_show_processlist = 'ON';
+
+SELECT * FROM performance_schema.processlist;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+--error ER_BAD_FIELD_ERROR
+SHOW PROCESSLIST;
+
+--exec echo "wait" > $restart_file
+--echo ##
+--echo ## Server shutdown
+--echo ##
+--shutdown_server
+--source include/wait_until_disconnected.inc
+--echo ##
+--echo ### Server restart
+--echo ##
+--exec echo "restart:">$restart_file
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+SHOW CREATE TABLE performance_schema.processlist;
+
+SET GLOBAL performance_schema_show_processlist = 'OFF';
+
+SELECT * FROM performance_schema.processlist;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SHOW PROCESSLIST;
+
+SET GLOBAL performance_schema_show_processlist = 'ON';
+
+SELECT * FROM performance_schema.processlist;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+--error ER_BAD_FIELD_ERROR
+SHOW PROCESSLIST;
+
+--echo ##
+--echo ## Perform broken upgrade (case 2)
+--echo ##
+
+DROP TABLE performance_schema.processlist;
+CREATE TABLE performance_schema.processlist (
+ `ID` bigint(20) unsigned NOT NULL,
+ `USER` varchar(32) DEFAULT NULL,
+ `HOST` varchar(66) DEFAULT NULL,
+ `DB` varchar(64) DEFAULT NULL,
+ `COMMAND` varchar(16) DEFAULT NULL,
+ `TIME` bigint(20) DEFAULT NULL,
+ `STATE` varchar(64) DEFAULT NULL,
+ `INFO` longtext
+);
+
+SHOW CREATE TABLE performance_schema.processlist;
+
+SET GLOBAL performance_schema_show_processlist = 'OFF';
+
+SELECT * FROM performance_schema.processlist;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SHOW PROCESSLIST;
+
+SET GLOBAL performance_schema_show_processlist = 'ON';
+
+SELECT * FROM performance_schema.processlist;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+# Works and returns no data, innodb table is empty.
+SHOW PROCESSLIST;
+
+--exec echo "wait" > $restart_file
+--echo ##
+--echo ## Server shutdown
+--echo ##
+--shutdown_server
+--source include/wait_until_disconnected.inc
+--echo ##
+--echo ### Server restart
+--echo ##
+--exec echo "restart:">$restart_file
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+SHOW CREATE TABLE performance_schema.processlist;
+
+SET GLOBAL performance_schema_show_processlist = 'OFF';
+
+SELECT * FROM performance_schema.processlist;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SHOW PROCESSLIST;
+
+SET GLOBAL performance_schema_show_processlist = 'ON';
+
+SELECT * FROM performance_schema.processlist;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+# Works and returns no data, innodb table is empty.
+SHOW PROCESSLIST;
+
+--echo ##
+--echo ## Perform broken upgrade (case 3)
+--echo ##
+
+DROP TABLE performance_schema.processlist;
+CREATE TABLE performance_schema.processlist
+ LIKE INFORMATION_SCHEMA.PROCESSLIST;
+
+SHOW CREATE TABLE performance_schema.processlist;
+
+SET GLOBAL performance_schema_show_processlist = 'OFF';
+
+SELECT * FROM performance_schema.processlist;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SHOW PROCESSLIST;
+
+SET GLOBAL performance_schema_show_processlist = 'ON';
+
+SELECT * FROM performance_schema.processlist;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+# Works and returns no data, innodb table is empty.
+SHOW PROCESSLIST;
+
+--exec echo "wait" > $restart_file
+--echo ##
+--echo ## Server shutdown
+--echo ##
+--shutdown_server
+--source include/wait_until_disconnected.inc
+--echo ##
+--echo ### Server restart
+--echo ##
+--exec echo "restart:">$restart_file
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+SHOW CREATE TABLE performance_schema.processlist;
+
+SET GLOBAL performance_schema_show_processlist = 'OFF';
+
+SELECT * FROM performance_schema.processlist;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SHOW PROCESSLIST;
+
+SET GLOBAL performance_schema_show_processlist = 'ON';
+
+SELECT * FROM performance_schema.processlist;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+# Works and returns no data, innodb table is empty.
+SHOW PROCESSLIST;
+
+--echo ##
+--echo ## Perform correct upgrade
+--echo ##
+
+DROP TABLE performance_schema.processlist;
+CREATE TABLE performance_schema.processlist (
+ `ID` bigint(20) unsigned NOT NULL,
+ `USER` varchar(32) DEFAULT NULL,
+ `HOST` varchar(66) DEFAULT NULL,
+ `DB` varchar(64) DEFAULT NULL,
+ `COMMAND` varchar(16) DEFAULT NULL,
+ `TIME` bigint(20) DEFAULT NULL,
+ `STATE` varchar(64) DEFAULT NULL,
+ `INFO` longtext
+) ENGINE = 'PERFORMANCE_SCHEMA';
+
+SHOW CREATE TABLE performance_schema.processlist;
+
+SET GLOBAL performance_schema_show_processlist = 'OFF';
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM performance_schema.processlist;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SHOW PROCESSLIST;
+
+SET GLOBAL performance_schema_show_processlist = 'ON';
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM performance_schema.processlist;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SHOW PROCESSLIST;
+
+--exec echo "wait" > $restart_file
+--echo ##
+--echo ## Server shutdown
+--echo ##
+--shutdown_server
+--source include/wait_until_disconnected.inc
+--echo ##
+--echo ### Server restart
+--echo ##
+--exec echo "restart:">$restart_file
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+SHOW CREATE TABLE performance_schema.processlist;
+
+SET GLOBAL performance_schema_show_processlist = 'OFF';
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM performance_schema.processlist;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SHOW PROCESSLIST;
+
+SET GLOBAL performance_schema_show_processlist = 'ON';
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM performance_schema.processlist;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SHOW PROCESSLIST;
+
+# Cleanup
+
+SET GLOBAL performance_schema_show_processlist = 'OFF';
+
diff --git a/mysql-test/suite/perfschema/t/processlist_acl-master.opt b/mysql-test/suite/perfschema/t/processlist_acl-master.opt
new file mode 100644
index 00000000000..f93413a61e5
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/processlist_acl-master.opt
@@ -0,0 +1 @@
+--event-scheduler
diff --git a/mysql-test/suite/perfschema/t/processlist_acl.test b/mysql-test/suite/perfschema/t/processlist_acl.test
new file mode 100644
index 00000000000..f0733865ebc
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/processlist_acl.test
@@ -0,0 +1,196 @@
+--echo ##
+--echo ## Test the Performance Schema-based implementation of SHOW PROCESSLIST.
+--echo ##
+--echo ## Verify handling of the SELECT and PROCESS privileges.
+--echo ##
+--echo ## Test cases:
+--echo ## - Execute SHOW PROCESSLIST (new and legacy) with all privileges
+--echo ## - Execute SELECT on the performance_schema.processlist and information_schema.processlist with all privileges
+--echo ## - Execute SHOW PROCESSLIST (new and legacy) with no privileges
+--echo ## - Execute SELECT on the performance_schema.processlist and information_schema.processlist with no privileges
+--echo ##
+--echo ## Results must be manually verified.
+--echo
+
+--source include/no_protocol.inc
+--source include/not_embedded.inc
+
+--echo ### Setup ###
+--echo
+select @@global.performance_schema_show_processlist into @save_processlist;
+
+--echo
+--echo # Control users
+create user user_00@localhost, user_01@localhost;
+grant ALL on *.* to user_00@localhost;
+grant ALL on *.* to user_01@localhost;
+
+--echo
+--echo # Test users
+create user user_all@localhost, user_none@localhost;
+grant ALL on *.* to user_all@localhost;
+grant USAGE on *.* to user_none@localhost;
+--echo
+flush privileges;
+
+--echo
+show grants for user_all@localhost;
+--echo
+show grants for user_none@localhost;
+
+--echo
+use test;
+create table test.t1 (s1 int, s2 int, s3 int, s4 int);
+
+--echo
+--echo # Connect (con_00, localhost, user_00, , )
+connect (con_00, localhost, user_00, , );
+
+--echo # Connect (con_01, localhost, user_01, , )
+connect (con_01, localhost, user_01, , );
+--echo
+insert into test.t1 values(1, 1, 1, 1);
+insert into test.t1 values(2, 2, 2, 2);
+insert into test.t1 values(3, 3, 3, 3);
+insert into test.t1 values(4, 4, 4, 4);
+
+--echo
+--echo # Lock test.t1, insert/update/deletes will block
+lock tables t1 read;
+
+--echo
+--echo # Establish 2 connections for user_all
+--echo # Connect (con_all_1, localhost, user_all, , )
+connect (con_all_1, localhost, user_all, , );
+
+--echo # Connect (con_all_2, localhost, user_all, , )
+connect (con_all_2, localhost, user_all, , );
+--send insert into test.t1 values (0, 0, 0, 0)
+
+--echo
+--echo # Establish 4 connections for user_none
+--echo # Connect (con_none_1, localhost, user_none, , )
+connect (con_none_1, localhost, user_none, , );
+
+--echo # Connect (con_none_2, localhost, user_none, , )
+connect (con_none_2, localhost, user_none, , );
+
+--echo # Connect (con_none_3, localhost, user_none, , )
+connect (con_none_3, localhost, user_none, , );
+
+--echo # Connect (con_none_4, localhost, user_none, , )
+connect (con_none_4, localhost, user_none, , );
+--send update test.t1 set s1 = s1 + 1, s2 = s2 + 2;
+
+--echo
+--echo # Connection con_all_1
+--connection con_all_1
+
+# Note: When expecting processlist results for all users, the wait_condition
+# and subsequent execution of SHOW PROCESSLIST should be conducted from the
+# same connection to ensure consistent values in the Command and Info columns.
+
+--echo
+--echo # Wait for queries to appear in the processlist table
+let $wait_condition = select count(*) >= 2 from information_schema.processlist
+ where state like '%metadata%';
+--source include/wait_condition.inc
+
+--echo
+--echo ### Execute SHOW PROCESSLIST with all privileges
+--echo ### Expect all users
+--echo
+--echo # New SHOW PROCESSLIST
+let $pfs_spl = on;
+--source ../include/processlist_set.inc
+--source ../include/processlist_load.inc
+
+--echo
+--echo # Legacy SHOW PROCESSLIST
+let $pfs_spl = off;
+--source ../include/processlist_set.inc
+--source ../include/processlist_load.inc
+
+--echo
+--echo
+--echo ### Execute SHOW PROCESSLIST with no SELECT and no PROCESS privileges
+--echo ### Expect processes only from user_none
+--echo
+--echo # New SHOW PROCESSLIST
+let $pfs_spl = on;
+--source ../include/processlist_set.inc
+
+--echo
+--echo # Connection con_none_1
+--connection con_none_1
+--source ../include/processlist_load.inc
+
+--echo
+--echo # Confirm that only processes from user_none are visible
+--echo
+select count(*) as "Expect 0" from performance_schema.processlist
+ where user not in ('user_none');
+
+--echo
+--echo # Legacy SHOW PROCESSLIST
+--connection con_00
+let $pfs_spl = off;
+--source ../include/processlist_set.inc
+
+--echo
+--echo # Connection con_none_1
+--connection con_none_1
+--source ../include/processlist_load.inc
+
+--echo
+--echo
+--echo ### Clean up ###
+--echo
+
+--echo # Disconnect con_00
+--connection con_00
+--disconnect con_00
+
+--echo # Connection con_01, unlock test.t1, disconnect
+--connection con_01
+unlock tables;
+--disconnect con_01
+
+--echo # Disconnect con_all_1
+--connection con_all_1
+--disconnect con_all_1
+
+--echo # Reap con_all_2, disconnect
+--connection con_all_2
+--reap
+--disconnect con_all_2
+
+--echo # Disconnect con_none_1
+--connection con_none_1
+--disconnect con_none_1
+
+--echo # Disconnect con_none_2
+--connection con_none_2
+--disconnect con_none_2
+
+--echo # Disconnect con_none_3
+--connection con_none_3
+--disconnect con_none_3
+
+--echo # Reap con_none_4, disconnect
+--connection con_none_4
+--reap
+--disconnect con_none_4
+
+--echo
+--echo # Connection default
+--connection default
+
+--echo
+drop table test.t1;
+drop user user_00@localhost;
+drop user user_01@localhost;
+drop user user_all@localhost;
+drop user user_none@localhost;
+--echo
+set @@global.performance_schema_show_processlist = @save_processlist;
diff --git a/mysql-test/suite/perfschema/t/processlist_anonymous.test b/mysql-test/suite/perfschema/t/processlist_anonymous.test
new file mode 100644
index 00000000000..4b8e7ec2e1f
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/processlist_anonymous.test
@@ -0,0 +1,111 @@
+--echo ##
+--echo ## Test the Performance Schema-based implementation of SHOW PROCESSLIST.
+--echo ## Verify behavior for anonymous users and PROCESS_ACL.
+--echo ##
+
+--source include/no_protocol.inc
+--source include/not_embedded.inc
+
+SELECT @@global.performance_schema_show_processlist INTO @save_processlist;
+
+--source include/add_anonymous_users.inc
+
+SET @@global.performance_schema_show_processlist = OFF;
+
+connect (anon,localhost,test,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
+
+SHOW GRANTS;
+
+# Empty
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+# Empty
+SELECT * FROM performance_schema.processlist;
+
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+SHOW PROCESSLIST;
+
+connection default;
+
+SET @@global.performance_schema_show_processlist = ON;
+
+connection anon;
+
+SHOW GRANTS;
+
+# Empty
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+# Empty
+SELECT * FROM performance_schema.processlist;
+
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+SHOW PROCESSLIST;
+
+disconnect anon;
+connection default;
+
+GRANT PROCESS ON *.* TO ''@'localhost';
+
+SET @@global.performance_schema_show_processlist = OFF;
+
+connect (anon2,localhost,test,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
+
+SHOW GRANTS;
+
+# Full rows
+SELECT count(*) >= 2 FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+# Full rows
+SELECT count(*) >= 2 FROM performance_schema.processlist;
+
+# Full rows
+--disable_result_log
+SHOW PROCESSLIST;
+--enable_result_log
+
+SELECT "Previous statement is now completed." as status;
+
+connection default;
+# Returns ROWS_SENT = 0 even when SHOW PROCESSLIST has rows
+SELECT EVENT_NAME, SQL_TEXT, ROWS_SENT as BROKEN_ROWS_SENT
+ FROM performance_schema.events_statements_history
+ WHERE SQL_TEXT = "SHOW PROCESSLIST";
+connection anon2;
+
+
+connection default;
+
+TRUNCATE TABLE performance_schema.events_statements_history;
+set @@global.performance_schema_show_processlist = ON;
+
+
+connection anon2;
+
+SHOW GRANTS;
+
+# Full rows
+SELECT count(*) >= 2 FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+# Full rows
+SELECT count(*) >= 2 FROM performance_schema.processlist;
+
+# Full rows
+--disable_result_log
+SHOW PROCESSLIST;
+--enable_result_log
+
+SELECT "Previous statement is now completed." as status;
+
+connection default;
+SELECT EVENT_NAME, SQL_TEXT, ROWS_SENT >= 2
+ FROM performance_schema.events_statements_history
+ WHERE SQL_TEXT = "SHOW PROCESSLIST";
+
+disconnect anon2;
+connection default;
+
+--source include/delete_anonymous_users.inc
+
+SET @@global.performance_schema_show_processlist = @save_processlist;
+
diff --git a/mysql-test/suite/perfschema/t/processlist_no_pfs-master.opt b/mysql-test/suite/perfschema/t/processlist_no_pfs-master.opt
new file mode 100644
index 00000000000..6fb075f60bc
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/processlist_no_pfs-master.opt
@@ -0,0 +1,2 @@
+--loose-disable-performance-schema
+--loose-performance-schema-show-processlist=ON
diff --git a/mysql-test/suite/perfschema/t/processlist_no_pfs.test b/mysql-test/suite/perfschema/t/processlist_no_pfs.test
new file mode 100644
index 00000000000..273e180a18a
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/processlist_no_pfs.test
@@ -0,0 +1,29 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+
+--source ../include/start_server_common.inc
+
+--echo
+select * from information_schema.engines
+ where engine = "PERFORMANCE_SCHEMA";
+
+--echo
+--echo # If the Performance Schema is disabled, then expect
+--echo # performance-schema-show-processlist = OFF
+--echo # regardless of its initial setting
+--echo
+select @@global.performance_schema_show_processlist;
+
+--echo
+--echo # If the Performance Schema is disabled, then setting
+--echo # performance-schema-show-processlist = ON
+--echo # succeeds, SHOW PROCESSLIST returns no data.
+--echo
+set @@global.performance_schema_show_processlist = ON;
+
+SHOW PROCESSLIST;
+
+--echo
+show global variables like "performance_schema";
+
diff --git a/mysql-test/suite/perfschema/t/processlist_port-master.opt b/mysql-test/suite/perfschema/t/processlist_port-master.opt
new file mode 100644
index 00000000000..f93413a61e5
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/processlist_port-master.opt
@@ -0,0 +1 @@
+--event-scheduler
diff --git a/mysql-test/suite/perfschema/t/processlist_port.test b/mysql-test/suite/perfschema/t/processlist_port.test
new file mode 100644
index 00000000000..8403b0c793b
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/processlist_port.test
@@ -0,0 +1,162 @@
+--echo ##
+--echo ## Test the Performance Schema-based implementation of SHOW PROCESSLIST.
+--echo ##
+--echo ## Verify the Host field (hostname:port) against the legacy implementation.
+--echo ##
+
+--source include/no_protocol.inc
+--source include/not_embedded.inc
+
+--echo
+--echo ### Setup ###
+--echo
+select @@global.performance_schema_show_processlist into @save_processlist;
+
+--echo
+--echo # Control user
+create user user0@localhost;
+grant ALL on *.* to user0@localhost;
+
+--echo # Test users
+--echo
+create user user1@localhost, user2@localhost,
+ user3@localhost, user4@localhost;
+--echo
+# Grant no privileges to user1 to ensure only one process
+grant USAGE on *.* to user1@localhost;
+grant ALL on *.* to user2@localhost;
+grant ALL on *.* to user3@localhost;
+grant ALL on *.* to user4@localhost;
+--echo
+flush privileges;
+--echo
+show grants for user1@localhost;
+
+--echo
+--echo # Connect (con_user0, 127.0.0.1, user0, , , MASTER_MYPORT, )
+connect (con_user0, 127.0.0.1, user0, , , $MASTER_MYPORT, );
+--echo
+select connection_id() into @con_user0_id;
+
+--echo # Connect (con_user1, 127.0.0.1, user1, , , MASTER_MYPORT, )
+connect (con_user1, 127.0.0.1, user1, , , $MASTER_MYPORT, );
+
+--echo # Connect (con_user2, 127.0.0.1, user2, , , MASTER_MYPORT, )
+connect (con_user2, 127.0.0.1, user2, , , $MASTER_MYPORT, );
+
+--echo # Connect (con_user3, 127.0.0.1, user3, , , MASTER_MYPORT, )
+connect (con_user3, 127.0.0.1, user3, , , $MASTER_MYPORT, );
+
+--echo # Connect (con_user4, 127.0.0.1, user4, , , MASTER_MYPORT, )
+connect (con_user4, 127.0.0.1, user4, , , $MASTER_MYPORT, );
+
+--echo # Connection user0
+--connection con_user0
+let $wait_condition = select connection_id() = @con_user0_id;
+--source include/wait_condition.inc
+
+--echo
+--echo ### Compare the SHOW PROCESSLIST Host column between the new and old implementations
+--echo
+--echo ## New SHOW PROCESSLIST
+let $pfs_spl = on;
+--source ../include/processlist_set.inc
+--source ../include/processlist_load.inc
+
+--echo
+--echo # Connection user1
+--connection con_user1
+
+--echo # Get Host:Port, new
+let $host_new = query_get_value(SHOW FULL PROCESSLIST, Host, 1);
+
+--echo
+--echo ## Legacy SHOW PROCESSLIST
+--connection con_user0
+let $pfs_spl = off;
+--source ../include/processlist_set.inc
+--source ../include/processlist_load.inc
+
+--echo
+--echo # Connection user1
+--connection con_user1
+
+--echo # Get Host:Port, legacy
+let $host_old = query_get_value(SHOW FULL PROCESSLIST, Host, 1);
+
+--echo
+
+## DEBUG ONLY
+## --echo DEBUG: New: $host_new Old: $host_old
+
+if ($host_new == $host_old)
+{
+ --echo ***SUCCESS*** The SHOW PROCESSLIST Host fields match
+}
+
+if ($host_new != $host_old)
+{
+ --echo ***ERROR*** SHOW PROCESSLIST Host fields do not match. New: $host_new Old: $host_old
+}
+
+--echo
+--echo ### Compare the processlist Host column between Performance Schema and the Information Schema
+--echo
+--echo # Connection con_user0
+--connection con_user0
+let $count_new = `select count(*) from performance_schema.processlist`;
+let $count_old = `select count(*) from information_schema.processlist`;
+let $count_join = `select count(*) from performance_schema.processlist pspl
+ left join information_schema.processlist ispl on pspl.host = ispl.host and pspl.id = ispl.id`;
+
+--echo
+
+if ($count_old == $count_join)
+{
+ --echo ***SUCCESS*** The processlist Host fields match between the Performance Schema and the Information Schema
+}
+
+if ($count_old != $count_join)
+{
+ --echo ***ERROR*** The processlist Host fields do not match
+ --echo Count new: $count_new Count old: $count_old Count join: $count_join
+ --echo
+ select * from performance_schema.processlist order by host, id;
+ --echo
+ select * from information_schema.processlist order by host, id;
+ --echo
+ select * from performance_schema.processlist pspl
+ left join information_schema.processlist ispl on pspl.host = ispl.host and pspl.id = ispl.id;
+}
+
+--echo
+--echo
+--echo ### Clean up ###
+--echo
+
+--echo # Disconnect con_user0
+--connection con_user0
+--disconnect con_user0
+--echo # Disconnect con_user1
+--connection con_user1
+--disconnect con_user1
+--echo # Disconnect con_user2
+--connection con_user2
+--disconnect con_user2
+--echo # Disconnect con_user3
+--connection con_user3
+--disconnect con_user3
+--echo # Disconnect con_user4
+--connection con_user4
+--disconnect con_user4
+
+--echo # Connection default
+--connection default
+--echo
+drop user user0@localhost;
+drop user user1@localhost;
+drop user user2@localhost;
+drop user user3@localhost;
+drop user user4@localhost;
+--echo
+set @@global.performance_schema_show_processlist = @save_processlist;
diff --git a/mysql-test/suite/perfschema/t/processlist_reg_user.test b/mysql-test/suite/perfschema/t/processlist_reg_user.test
new file mode 100644
index 00000000000..53dc8abfa63
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/processlist_reg_user.test
@@ -0,0 +1,134 @@
+--echo ##
+--echo ## Test the Performance Schema-based implementation of SHOW PROCESSLIST.
+--echo ## Verify behavior for regular users and PROCESS_ACL.
+--echo ##
+
+--source include/no_protocol.inc
+--source include/not_embedded.inc
+
+SELECT @@global.performance_schema_show_processlist INTO @save_processlist;
+
+--source include/add_anonymous_users.inc
+
+SET @@global.performance_schema_show_processlist = OFF;
+
+CREATE USER 'regular'@'localhost';
+
+connect (reg,localhost,regular,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
+
+SHOW GRANTS;
+
+# Self rows only
+SELECT USER, INFO FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+# Self rows only
+SELECT USER, INFO FROM performance_schema.processlist;
+
+# Self rows only
+--disable_result_log
+SHOW PROCESSLIST;
+--enable_result_log
+
+SELECT "Previous statement is now completed." as status;
+
+connection default;
+
+# Returns ROWS_SENT = 0 even when SHOW PROCESSLIST has rows
+SELECT EVENT_NAME, SQL_TEXT, ROWS_SENT as BROKEN_ROWS_SENT
+ FROM performance_schema.events_statements_history
+ WHERE SQL_TEXT = "SHOW PROCESSLIST";
+
+TRUNCATE TABLE performance_schema.events_statements_history;
+SET @@global.performance_schema_show_processlist = ON;
+
+connection reg;
+
+SHOW GRANTS;
+
+# Self rows only
+SELECT USER, INFO FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+# Self rows only
+SELECT USER, INFO FROM performance_schema.processlist;
+
+# Self rows only
+--disable_result_log
+SHOW PROCESSLIST;
+--enable_result_log
+
+SELECT "Previous statement is now completed." as status;
+
+connection default;
+
+SELECT EVENT_NAME, SQL_TEXT, ROWS_SENT
+ FROM performance_schema.events_statements_history
+ WHERE SQL_TEXT = "SHOW PROCESSLIST";
+
+TRUNCATE TABLE performance_schema.events_statements_history;
+
+disconnect reg;
+
+GRANT PROCESS ON *.* TO 'regular'@'localhost';
+
+SET @@global.performance_schema_show_processlist = OFF;
+
+connect (reg2,localhost,regular,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
+
+SHOW GRANTS;
+
+# Full rows
+SELECT count(*) >= 2 FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+# Full rows
+SELECT count(*) >= 2 FROM performance_schema.processlist;
+
+# Full rows
+--disable_result_log
+SHOW PROCESSLIST;
+--enable_result_log
+
+SELECT "Previous statement is now completed." as status;
+
+connection default;
+
+# Returns ROWS_SENT = 0 even when SHOW PROCESSLIST has rows
+SELECT EVENT_NAME, SQL_TEXT, ROWS_SENT as BROKEN_ROWS_SENT
+ FROM performance_schema.events_statements_history
+ WHERE SQL_TEXT = "SHOW PROCESSLIST";
+
+TRUNCATE TABLE performance_schema.events_statements_history;
+SET @@global.performance_schema_show_processlist = ON;
+
+connection reg2;
+
+SHOW GRANTS;
+
+# Full rows
+SELECT count(*) >= 2 FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+# Full rows
+SELECT count(*) >= 2 FROM performance_schema.processlist;
+
+# Full rows
+--disable_result_log
+SHOW PROCESSLIST;
+--enable_result_log
+
+SELECT "Previous statement is now completed." as status;
+
+connection default;
+
+SELECT EVENT_NAME, SQL_TEXT, ROWS_SENT >= 2
+ FROM performance_schema.events_statements_history
+ WHERE SQL_TEXT = "SHOW PROCESSLIST";
+
+TRUNCATE TABLE performance_schema.events_statements_history;
+
+disconnect reg2;
+
+--source include/delete_anonymous_users.inc
+
+SET @@global.performance_schema_show_processlist = @save_processlist;
+
+DROP USER 'regular'@'localhost';
+
diff --git a/mysql-test/suite/perfschema/t/threads_mysql.test b/mysql-test/suite/perfschema/t/threads_mysql.test
index 8a021055d44..e19b3664f21 100644
--- a/mysql-test/suite/perfschema/t/threads_mysql.test
+++ b/mysql-test/suite/perfschema/t/threads_mysql.test
@@ -35,7 +35,7 @@ SELECT name, type, processlist_user, processlist_host, processlist_db,
processlist_command, processlist_info, connection_type,
IF(parent_thread_id IS NULL, parent_thread_id, 'unified parent_thread_id')
AS unified_parent_thread_id,
- role, instrumented
+ `role`, instrumented
FROM performance_schema.threads
WHERE name LIKE 'thread/sql%'
ORDER BY name;
@@ -54,7 +54,7 @@ SELECT name, type, processlist_user, processlist_host, processlist_db,
processlist_command, processlist_info,
IF(parent_thread_id IS NULL, parent_thread_id, 'unified parent_thread_id')
AS unified_parent_thread_id,
- role, instrumented
+ `role`, instrumented
FROM performance_schema.threads
WHERE name LIKE 'thread/sql%'
AND thread_id NOT IN (SELECT thread_id FROM t1)
@@ -94,7 +94,7 @@ SELECT name, type, processlist_user, processlist_host, processlist_db,
processlist_command, processlist_info,
IF(parent_thread_id IS NULL, parent_thread_id, 'unified parent_thread_id')
AS unified_parent_thread_id,
- role, instrumented
+ `role`, instrumented
FROM performance_schema.threads
WHERE name LIKE 'thread/sql%'
AND thread_id NOT IN (SELECT thread_id FROM t1)
diff --git a/mysys/psi_noop.c b/mysys/psi_noop.c
index e81ad4893b7..403be3c94e9 100644
--- a/mysys/psi_noop.c
+++ b/mysys/psi_noop.c
@@ -1,17 +1,29 @@
-/* Copyright (c) 2011, 2016, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
+
+ Without limiting anything contained in the foregoing, this file,
+ which is part of C Driver for MySQL (Connector/C), is also subject to the
+ Universal FOSS Exception, version 1.0, a copy of which can be found at
+ http://oss.oracle.com/licenses/universal-foss-exception.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ GNU General Public License, version 2.0, for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
+ 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
/*
Always provide the noop performance interface, for plugins.
@@ -262,6 +274,11 @@ static void set_thread_noop(PSI_thread* thread NNN)
return;
}
+static void set_thread_peer_port_noop(PSI_thread * thread NNN, uint port NNN)
+{
+ return;
+}
+
static void delete_current_thread_noop(void)
{
return;
@@ -481,7 +498,7 @@ static void end_file_rename_wait_noop(PSI_file_locker *locker NNN,
static PSI_stage_progress*
start_stage_noop(PSI_stage_key key NNN,
- const char *src_file NNN, int src_line NNN)
+ const char *src_file NNN, int src_line NNN)
{
return NULL;
}
@@ -776,9 +793,9 @@ digest_end_noop(PSI_digest_locker *locker NNN,
}
static int
-set_thread_connect_attrs_noop(const char *buffer NNN,
- uint length NNN,
- const void *from_cs NNN)
+set_thread_connect_attrs_noop(const char *buffer __attribute__ ((unused)),
+ uint length __attribute__ ((unused)),
+ const void *from_cs __attribute__ ((unused)))
{
return 0;
}
@@ -1025,7 +1042,9 @@ static PSI PSI_noop=
set_metadata_lock_status_noop,
destroy_metadata_lock_noop,
start_metadata_wait_noop,
- end_metadata_wait_noop
+ end_metadata_wait_noop,
+
+ set_thread_peer_port_noop
};
/**
diff --git a/storage/perfschema/CMakeLists.txt b/storage/perfschema/CMakeLists.txt
index 59a110103b4..b820cf9fc8d 100644
--- a/storage/perfschema/CMakeLists.txt
+++ b/storage/perfschema/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2009, 2021, Oracle and/or its affiliates.
+# Copyright (c) 2009, 2022, Oracle and/or its affiliates.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
@@ -92,6 +92,7 @@ table_esms_by_host_by_event_name.h
table_esms_by_digest.h
table_esms_by_program.h
table_prepared_stmt_instances.h
+#table_processlist.h
table_esms_by_thread_by_event_name.h
table_esms_by_user_by_event_name.h
table_esms_global_by_event_name.h
@@ -208,6 +209,7 @@ table_esms_by_host_by_event_name.cc
table_esms_by_digest.cc
table_esms_by_program.cc
table_prepared_stmt_instances.cc
+#table_processlist.cc
table_esms_by_thread_by_event_name.cc
table_esms_by_user_by_event_name.cc
table_esms_global_by_event_name.cc
diff --git a/storage/perfschema/cursor_by_account.cc b/storage/perfschema/cursor_by_account.cc
index 38359cb24aa..25e3ed662d1 100644
--- a/storage/perfschema/cursor_by_account.cc
+++ b/storage/perfschema/cursor_by_account.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/cursor_by_account.h b/storage/perfschema/cursor_by_account.h
index 1f6d65adc98..30ee3761f37 100644
--- a/storage/perfschema/cursor_by_account.h
+++ b/storage/perfschema/cursor_by_account.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/cursor_by_host.cc b/storage/perfschema/cursor_by_host.cc
index 26bdbc457f8..956644cfce2 100644
--- a/storage/perfschema/cursor_by_host.cc
+++ b/storage/perfschema/cursor_by_host.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/cursor_by_host.h b/storage/perfschema/cursor_by_host.h
index 45a2fb894c1..e7ae47fef72 100644
--- a/storage/perfschema/cursor_by_host.h
+++ b/storage/perfschema/cursor_by_host.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/cursor_by_thread.cc b/storage/perfschema/cursor_by_thread.cc
index f8a4fa243ce..ff90c77e47d 100644
--- a/storage/perfschema/cursor_by_thread.cc
+++ b/storage/perfschema/cursor_by_thread.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/cursor_by_thread.h b/storage/perfschema/cursor_by_thread.h
index 24578fd44f1..910291c2be3 100644
--- a/storage/perfschema/cursor_by_thread.h
+++ b/storage/perfschema/cursor_by_thread.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/cursor_by_thread_connect_attr.cc b/storage/perfschema/cursor_by_thread_connect_attr.cc
index f87ce7059fb..877056074f6 100644
--- a/storage/perfschema/cursor_by_thread_connect_attr.cc
+++ b/storage/perfschema/cursor_by_thread_connect_attr.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/cursor_by_thread_connect_attr.h b/storage/perfschema/cursor_by_thread_connect_attr.h
index 4a18bdc5b7a..aa1b63ad51e 100644
--- a/storage/perfschema/cursor_by_thread_connect_attr.h
+++ b/storage/perfschema/cursor_by_thread_connect_attr.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2012, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/cursor_by_user.cc b/storage/perfschema/cursor_by_user.cc
index 4300f61f04f..9778e240b8c 100644
--- a/storage/perfschema/cursor_by_user.cc
+++ b/storage/perfschema/cursor_by_user.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/cursor_by_user.h b/storage/perfschema/cursor_by_user.h
index 1bbb06d2c18..ca4fef9209c 100644
--- a/storage/perfschema/cursor_by_user.h
+++ b/storage/perfschema/cursor_by_user.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/ha_perfschema.cc b/storage/perfschema/ha_perfschema.cc
index c0fa80b8e0d..982876216aa 100644
--- a/storage/perfschema/ha_perfschema.cc
+++ b/storage/perfschema/ha_perfschema.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -444,6 +444,53 @@ THR_LOCK_DATA **ha_perfschema::store_lock(THD *thd,
int ha_perfschema::delete_table(const char *name)
{
DBUG_ENTER("ha_perfschema::delete_table");
+
+ /*
+ The name string looks like:
+ "./performance_schema/processlist"
+
+ Make a copy of it, parse the '/' to
+ isolate the schema and table name.
+ */
+
+ char table_path[FN_REFLEN+1];
+ strncpy(table_path, name, sizeof(table_path));
+ table_path[FN_REFLEN]='\0';
+
+ char *ptr;
+ char *table_name;
+ char *db_name;
+ const PFS_engine_table_share *share;
+
+ /* Start scan from the end. */
+ ptr = strend(table_path) - 1;
+
+ /* Find path separator */
+ while ((ptr >= table_path) && (*ptr != '\\') && (*ptr != '/')) {
+ ptr--;
+ }
+
+ table_name = ptr + 1;
+ *ptr = '\0';
+
+ /* Find path separator */
+ while ((ptr >= table_path) && (*ptr != '\\') && (*ptr != '/')) {
+ ptr--;
+ }
+
+ db_name = ptr + 1;
+
+ share = find_table_share(db_name, table_name);
+ if (share != NULL) {
+ if (share->m_optional) {
+ /*
+ An optional table is deleted,
+ disarm the checked flag so we don't trust it any more.
+ */
+ share->m_state->m_checked = false;
+ }
+ }
+
DBUG_RETURN(0);
}
diff --git a/storage/perfschema/ha_perfschema.h b/storage/perfschema/ha_perfschema.h
index f3d84a3e264..eab97434265 100644
--- a/storage/perfschema/ha_perfschema.h
+++ b/storage/perfschema/ha_perfschema.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs.cc b/storage/perfschema/pfs.cc
index 4e3d4f551a0..244b11a30fc 100644
--- a/storage/perfschema/pfs.cc
+++ b/storage/perfschema/pfs.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -2571,6 +2571,16 @@ void pfs_set_thread_v1(PSI_thread* thread)
/**
Implementation of the thread instrumentation interface.
+*/
+void pfs_set_thread_peer_port_v1(PSI_thread *thread, uint port) {
+ PFS_thread *pfs = reinterpret_cast<PFS_thread *>(thread);
+ if (likely(pfs != NULL)) {
+ pfs->m_peer_port = port;
+ }
+}
+
+/**
+ Implementation of the thread instrumentation interface.
@sa PSI_v1::delete_current_thread.
*/
void pfs_delete_current_thread_v1(void)
@@ -7136,7 +7146,8 @@ PSI_v1 PFS_v1=
pfs_set_metadata_lock_status_v1,
pfs_destroy_metadata_lock_v1,
pfs_start_metadata_wait_v1,
- pfs_end_metadata_wait_v1
+ pfs_end_metadata_wait_v1,
+ pfs_set_thread_peer_port_v1
};
static void* get_interface(int version)
diff --git a/storage/perfschema/pfs.h b/storage/perfschema/pfs.h
index 3525f27724f..94d349a5fd2 100644
--- a/storage/perfschema/pfs.h
+++ b/storage/perfschema/pfs.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_account.cc b/storage/perfschema/pfs_account.cc
index abf31a6bc55..53a45bcfd9b 100644
--- a/storage/perfschema/pfs_account.cc
+++ b/storage/perfschema/pfs_account.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -527,30 +527,18 @@ void PFS_account::aggregate_memory(bool alive, PFS_user *safe_user, PFS_host *sa
void PFS_account::aggregate_status(PFS_user *safe_user, PFS_host *safe_host)
{
- if (likely(safe_user != NULL && safe_host != NULL))
- {
- /*
- Aggregate STATUS_BY_ACCOUNT to:
- - STATUS_BY_USER
- - STATUS_BY_HOST
- */
- safe_user->m_status_stats.aggregate(& m_status_stats);
- safe_host->m_status_stats.aggregate(& m_status_stats);
- m_status_stats.reset();
- return;
- }
+ /*
+ Never aggregate to global_status_var,
+ because of the parallel THD -> global_status_var flow.
+ */
if (safe_user != NULL)
{
/*
Aggregate STATUS_BY_ACCOUNT to:
- STATUS_BY_USER
- - GLOBAL_STATUS
*/
safe_user->m_status_stats.aggregate(& m_status_stats);
- //m_status_stats.aggregate_to(& global_status_var);
- m_status_stats.reset();
- return;
}
if (safe_host != NULL)
@@ -560,15 +548,8 @@ void PFS_account::aggregate_status(PFS_user *safe_user, PFS_host *safe_host)
- STATUS_BY_HOST
*/
safe_host->m_status_stats.aggregate(& m_status_stats);
- m_status_stats.reset();
- return;
}
- /*
- Aggregate STATUS_BY_ACCOUNT to:
- - GLOBAL_STATUS
- */
- //m_status_stats.aggregate_to(& global_status_var);
m_status_stats.reset();
return;
}
diff --git a/storage/perfschema/pfs_account.h b/storage/perfschema/pfs_account.h
index c98ff5d2740..196f3595082 100644
--- a/storage/perfschema/pfs_account.h
+++ b/storage/perfschema/pfs_account.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_atomic.h b/storage/perfschema/pfs_atomic.h
index 52c96527c3f..54c4cba163c 100644
--- a/storage/perfschema/pfs_atomic.h
+++ b/storage/perfschema/pfs_atomic.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2009, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_autosize.cc b/storage/perfschema/pfs_autosize.cc
index 65d0458220a..d418ea594e2 100644
--- a/storage/perfschema/pfs_autosize.cc
+++ b/storage/perfschema/pfs_autosize.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2012, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_buffer_container.cc b/storage/perfschema/pfs_buffer_container.cc
index 7d1d74541d1..dfae6e0ad2e 100644
--- a/storage/perfschema/pfs_buffer_container.cc
+++ b/storage/perfschema/pfs_buffer_container.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2014, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_buffer_container.h b/storage/perfschema/pfs_buffer_container.h
index 5baed2f872c..0f856ceee86 100644
--- a/storage/perfschema/pfs_buffer_container.h
+++ b/storage/perfschema/pfs_buffer_container.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2014, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_builtin_memory.cc b/storage/perfschema/pfs_builtin_memory.cc
index 354de87f05f..60e97451852 100644
--- a/storage/perfschema/pfs_builtin_memory.cc
+++ b/storage/perfschema/pfs_builtin_memory.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2014, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_builtin_memory.h b/storage/perfschema/pfs_builtin_memory.h
index 2c9da9dd4a0..c0f0aa86c45 100644
--- a/storage/perfschema/pfs_builtin_memory.h
+++ b/storage/perfschema/pfs_builtin_memory.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2014, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_column_types.h b/storage/perfschema/pfs_column_types.h
index 146c9c8054e..1985c6ea719 100644
--- a/storage/perfschema/pfs_column_types.h
+++ b/storage/perfschema/pfs_column_types.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_column_values.cc b/storage/perfschema/pfs_column_values.cc
index 02c939d4274..fe3d16df21c 100644
--- a/storage/perfschema/pfs_column_values.cc
+++ b/storage/perfschema/pfs_column_values.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_column_values.h b/storage/perfschema/pfs_column_values.h
index b06f7a0130b..e3f36512ef5 100644
--- a/storage/perfschema/pfs_column_values.h
+++ b/storage/perfschema/pfs_column_values.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_con_slice.cc b/storage/perfschema/pfs_con_slice.cc
index eaa65d524ba..9a3e2a60929 100644
--- a/storage/perfschema/pfs_con_slice.cc
+++ b/storage/perfschema/pfs_con_slice.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_con_slice.h b/storage/perfschema/pfs_con_slice.h
index f28c40f884c..d71e9f5a90a 100644
--- a/storage/perfschema/pfs_con_slice.h
+++ b/storage/perfschema/pfs_con_slice.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_defaults.cc b/storage/perfschema/pfs_defaults.cc
index 522beb890eb..d5c415a5f77 100644
--- a/storage/perfschema/pfs_defaults.cc
+++ b/storage/perfschema/pfs_defaults.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_defaults.h b/storage/perfschema/pfs_defaults.h
index 34ac1b0955a..0225010f8b3 100644
--- a/storage/perfschema/pfs_defaults.h
+++ b/storage/perfschema/pfs_defaults.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_digest.cc b/storage/perfschema/pfs_digest.cc
index 43375c753dd..fdae7ba2b87 100644
--- a/storage/perfschema/pfs_digest.cc
+++ b/storage/perfschema/pfs_digest.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_digest.h b/storage/perfschema/pfs_digest.h
index e99bdfebf57..6611cfbfd76 100644
--- a/storage/perfschema/pfs_digest.h
+++ b/storage/perfschema/pfs_digest.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_engine_table.cc b/storage/perfschema/pfs_engine_table.cc
index 28715411ac2..a43ad090537 100644
--- a/storage/perfschema/pfs_engine_table.cc
+++ b/storage/perfschema/pfs_engine_table.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -48,6 +48,7 @@
#include "table_file_summary_by_instance.h"
#include "table_file_summary_by_event_name.h"
#include "table_threads.h"
+//#include "table_processlist.h"
#include "table_ews_by_host_by_event_name.h"
#include "table_ews_by_user_by_event_name.h"
@@ -333,9 +334,27 @@ static PFS_engine_table_share *all_shares[]=
//&table_global_variables::m_share,
//&table_session_variables::m_share,
+ //&table_processlist::m_share,
+
NULL
};
+/** Error reporting for schema integrity checks. */
+class PFS_silent_check_intact : public Table_check_intact
+{
+protected:
+ virtual void report_error(uint code, const char *fmt, ...) {}
+
+public:
+ PFS_silent_check_intact()
+ {}
+
+ ~PFS_silent_check_intact()
+ {}
+};
+
+
+
/** Initialize all the table share locks. */
void PFS_engine_table_share::init_all_locks(void)
{
@@ -770,6 +789,33 @@ PFS_readonly_world_acl::check(privilege_t want_access, privilege_t *save_priv) c
return res;
}
+PFS_readonly_processlist_acl pfs_readonly_processlist_acl;
+
+ACL_internal_access_result PFS_readonly_processlist_acl::check(
+ privilege_t want_access, privilege_t *save_priv) const {
+ ACL_internal_access_result res =
+ PFS_readonly_acl::check(want_access, save_priv);
+
+ if ((res == ACL_INTERNAL_ACCESS_CHECK_GRANT) && (want_access == SELECT_ACL)) {
+ THD *thd = current_thd;
+ if (thd != NULL) {
+ if (thd->lex->sql_command == SQLCOM_SHOW_PROCESSLIST ||
+ thd->lex->sql_command == SQLCOM_SELECT) {
+ /*
+ For compatibility with the historical
+ SHOW PROCESSLIST command,
+ SHOW PROCESSLIST does not require a
+ SELECT privilege on table performance_schema.processlist,
+ when rewriting the query using table processlist.
+ */
+ return ACL_INTERNAL_ACCESS_GRANTED;
+ }
+ }
+ }
+
+ return res;
+}
+
PFS_truncatable_acl pfs_truncatable_acl;
diff --git a/storage/perfschema/pfs_engine_table.h b/storage/perfschema/pfs_engine_table.h
index 925a2186a92..6280a3799b3 100644
--- a/storage/perfschema/pfs_engine_table.h
+++ b/storage/perfschema/pfs_engine_table.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -286,6 +286,11 @@ typedef int (*pfs_delete_all_rows_t)(void);
/** Callback to get a row count. */
typedef ha_rows (*pfs_get_row_count_t)(void);
+struct PFS_engine_table_share_state {
+ /** Schema integrity flag. */
+ bool m_checked;
+};
+
/**
A PERFORMANCE_SCHEMA table share.
This data is shared by all the table handles opened on the same table.
@@ -319,6 +324,10 @@ struct PFS_engine_table_share
LEX_STRING sql;
/** Table is available even if the Performance Schema is disabled. */
bool m_perpetual;
+ /** Table is optional. */
+ bool m_optional;
+ /** Dynamic state. */
+ PFS_engine_table_share_state *m_state;
};
/**
@@ -354,7 +363,7 @@ public:
~PFS_truncatable_acl()
{}
- ACL_internal_access_result check(privilege_t want_access,
+ virtual ACL_internal_access_result check(privilege_t want_access,
privilege_t *save_priv) const;
};
@@ -459,6 +468,25 @@ public:
extern PFS_truncatable_world_acl pfs_truncatable_world_acl;
+/**
+ Privileges for readable processlist tables.
+*/
+class PFS_readonly_processlist_acl : public PFS_readonly_acl {
+ public:
+ PFS_readonly_processlist_acl()
+ {}
+
+ ~PFS_readonly_processlist_acl()
+ {}
+
+ virtual ACL_internal_access_result check(privilege_t want_access,
+ privilege_t *save_priv) const;
+};
+
+/** Singleton instance of PFS_readonly_processlist_acl */
+extern PFS_readonly_processlist_acl pfs_readonly_processlist_acl;
+
+
/** Position of a cursor, for simple iterations. */
struct PFS_simple_index
{
diff --git a/storage/perfschema/pfs_events.h b/storage/perfschema/pfs_events.h
index fbe65d6ebad..41175596cf6 100644
--- a/storage/perfschema/pfs_events.h
+++ b/storage/perfschema/pfs_events.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_events_stages.cc b/storage/perfschema/pfs_events_stages.cc
index 087e5a1c55f..2e3ad4af786 100644
--- a/storage/perfschema/pfs_events_stages.cc
+++ b/storage/perfschema/pfs_events_stages.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_events_stages.h b/storage/perfschema/pfs_events_stages.h
index eeae350ddf4..e6ceddf93fe 100644
--- a/storage/perfschema/pfs_events_stages.h
+++ b/storage/perfschema/pfs_events_stages.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_events_statements.cc b/storage/perfschema/pfs_events_statements.cc
index 37b179e8924..c0f1809a2f3 100644
--- a/storage/perfschema/pfs_events_statements.cc
+++ b/storage/perfschema/pfs_events_statements.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_events_statements.h b/storage/perfschema/pfs_events_statements.h
index 2b2426ef7d1..e20689d9e1f 100644
--- a/storage/perfschema/pfs_events_statements.h
+++ b/storage/perfschema/pfs_events_statements.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_events_transactions.cc b/storage/perfschema/pfs_events_transactions.cc
index 8b83b71c96b..6f6b1a4cbc6 100644
--- a/storage/perfschema/pfs_events_transactions.cc
+++ b/storage/perfschema/pfs_events_transactions.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_events_transactions.h b/storage/perfschema/pfs_events_transactions.h
index 57e57e70210..46d42b1e121 100644
--- a/storage/perfschema/pfs_events_transactions.h
+++ b/storage/perfschema/pfs_events_transactions.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_events_waits.cc b/storage/perfschema/pfs_events_waits.cc
index 14f6d743764..0462c2cf9ef 100644
--- a/storage/perfschema/pfs_events_waits.cc
+++ b/storage/perfschema/pfs_events_waits.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_events_waits.h b/storage/perfschema/pfs_events_waits.h
index 8a7355f2d32..f2e7f228b3c 100644
--- a/storage/perfschema/pfs_events_waits.h
+++ b/storage/perfschema/pfs_events_waits.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates..
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates..
Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
diff --git a/storage/perfschema/pfs_global.cc b/storage/perfschema/pfs_global.cc
index 1f9d24eea4e..bda4d10ef8d 100644
--- a/storage/perfschema/pfs_global.cc
+++ b/storage/perfschema/pfs_global.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. All rights
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights
reserved.
This program is free software; you can redistribute it and/or modify
diff --git a/storage/perfschema/pfs_global.h b/storage/perfschema/pfs_global.h
index 48a5587839e..823d95e9e8d 100644
--- a/storage/perfschema/pfs_global.h
+++ b/storage/perfschema/pfs_global.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_host.cc b/storage/perfschema/pfs_host.cc
index 7d7af7700c2..a8a3b696b55 100644
--- a/storage/perfschema/pfs_host.cc
+++ b/storage/perfschema/pfs_host.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_host.h b/storage/perfschema/pfs_host.h
index 71ef0d7f5ad..d05c37bfd01 100644
--- a/storage/perfschema/pfs_host.h
+++ b/storage/perfschema/pfs_host.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_instr.cc b/storage/perfschema/pfs_instr.cc
index 41b1b24295a..105a8cb9959 100644
--- a/storage/perfschema/pfs_instr.cc
+++ b/storage/perfschema/pfs_instr.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -576,6 +576,8 @@ PFS_thread* create_thread(PFS_thread_class *klass, const void *identity,
pfs->m_account= NULL;
set_thread_account(pfs);
+ pfs->m_peer_port = 0;
+
/*
For child waits, by default,
- NESTING_EVENT_ID is NULL
diff --git a/storage/perfschema/pfs_instr.h b/storage/perfschema/pfs_instr.h
index e09cc7a1cf0..b9f31e63636 100644
--- a/storage/perfschema/pfs_instr.h
+++ b/storage/perfschema/pfs_instr.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -609,6 +609,9 @@ struct PFS_ALIGNED PFS_thread : PFS_connection_slice
PFS_user *m_user;
PFS_account *m_account;
+ /** Remote (peer) port */
+ uint m_peer_port;
+
/** Reset session connect attributes */
void reset_session_connect_attrs();
diff --git a/storage/perfschema/pfs_instr_class.cc b/storage/perfschema/pfs_instr_class.cc
index 971ee7ca00f..2a6be8be6d4 100644
--- a/storage/perfschema/pfs_instr_class.cc
+++ b/storage/perfschema/pfs_instr_class.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
Copyright (c) 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
diff --git a/storage/perfschema/pfs_instr_class.h b/storage/perfschema/pfs_instr_class.h
index b8ff8497241..c3f83c45b7e 100644
--- a/storage/perfschema/pfs_instr_class.h
+++ b/storage/perfschema/pfs_instr_class.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -246,6 +246,9 @@ struct PFS_ALIGNED PFS_thread_class
char m_name[PFS_MAX_INFO_NAME_LENGTH];
/** Length in bytes of @c m_name. */
uint m_name_length;
+ /** Instrument flags. */
+ int m_flags;
+ bool is_system_thread() const { return m_flags & PSI_FLAG_THREAD_SYSTEM; }
};
#define PFS_TABLESHARE_HASHKEY_SIZE (NAME_LEN + 1 + NAME_LEN + 1)
diff --git a/storage/perfschema/pfs_lock.h b/storage/perfschema/pfs_lock.h
index 4c1674c5e67..ae90ebd0784 100644
--- a/storage/perfschema/pfs_lock.h
+++ b/storage/perfschema/pfs_lock.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2009, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_memory.cc b/storage/perfschema/pfs_memory.cc
index d2185ecc648..4b4b14fc186 100644
--- a/storage/perfschema/pfs_memory.cc
+++ b/storage/perfschema/pfs_memory.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_memory.h b/storage/perfschema/pfs_memory.h
index a3e753656ce..085f8af8bad 100644
--- a/storage/perfschema/pfs_memory.h
+++ b/storage/perfschema/pfs_memory.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_prepared_stmt.cc b/storage/perfschema/pfs_prepared_stmt.cc
index ccb49f3290d..e0e10553680 100644
--- a/storage/perfschema/pfs_prepared_stmt.cc
+++ b/storage/perfschema/pfs_prepared_stmt.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2014, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_prepared_stmt.h b/storage/perfschema/pfs_prepared_stmt.h
index 1014d9c6af6..d89ad80cbd8 100644
--- a/storage/perfschema/pfs_prepared_stmt.h
+++ b/storage/perfschema/pfs_prepared_stmt.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2014, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_program.cc b/storage/perfschema/pfs_program.cc
index 00b8082ec53..9bd9f06b22c 100644
--- a/storage/perfschema/pfs_program.cc
+++ b/storage/perfschema/pfs_program.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_program.h b/storage/perfschema/pfs_program.h
index a34f533d444..56abcee97f7 100644
--- a/storage/perfschema/pfs_program.h
+++ b/storage/perfschema/pfs_program.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_server.cc b/storage/perfschema/pfs_server.cc
index 0a97f05c54a..f5b1bf9c03f 100644
--- a/storage/perfschema/pfs_server.cc
+++ b/storage/perfschema/pfs_server.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_server.h b/storage/perfschema/pfs_server.h
index c1ebb531a85..d87d48ac19b 100644
--- a/storage/perfschema/pfs_server.h
+++ b/storage/perfschema/pfs_server.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_setup_actor.cc b/storage/perfschema/pfs_setup_actor.cc
index 6e066e34231..ca45547d6ee 100644
--- a/storage/perfschema/pfs_setup_actor.cc
+++ b/storage/perfschema/pfs_setup_actor.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_setup_actor.h b/storage/perfschema/pfs_setup_actor.h
index 3570748085a..ede8f6c4b4e 100644
--- a/storage/perfschema/pfs_setup_actor.h
+++ b/storage/perfschema/pfs_setup_actor.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_setup_object.cc b/storage/perfschema/pfs_setup_object.cc
index 540f2c74936..64a54e9369a 100644
--- a/storage/perfschema/pfs_setup_object.cc
+++ b/storage/perfschema/pfs_setup_object.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_setup_object.h b/storage/perfschema/pfs_setup_object.h
index 63e275385b1..259c3dc8340 100644
--- a/storage/perfschema/pfs_setup_object.h
+++ b/storage/perfschema/pfs_setup_object.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_stat.h b/storage/perfschema/pfs_stat.h
index f266267f4cd..1349b7ba4df 100644
--- a/storage/perfschema/pfs_stat.h
+++ b/storage/perfschema/pfs_stat.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_status.cc b/storage/perfschema/pfs_status.cc
index 50f361db083..62aed2e8de9 100644
--- a/storage/perfschema/pfs_status.cc
+++ b/storage/perfschema/pfs_status.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_status.h b/storage/perfschema/pfs_status.h
index b29791420ad..a415fcc4704 100644
--- a/storage/perfschema/pfs_status.h
+++ b/storage/perfschema/pfs_status.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_timer.cc b/storage/perfschema/pfs_timer.cc
index c5a0bdf2262..505e49de968 100644
--- a/storage/perfschema/pfs_timer.cc
+++ b/storage/perfschema/pfs_timer.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_timer.h b/storage/perfschema/pfs_timer.h
index e9387c110ee..6218bc603d8 100644
--- a/storage/perfschema/pfs_timer.h
+++ b/storage/perfschema/pfs_timer.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_user.cc b/storage/perfschema/pfs_user.cc
index d7dfda4efc2..bd5fc3eadce 100644
--- a/storage/perfschema/pfs_user.cc
+++ b/storage/perfschema/pfs_user.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_user.h b/storage/perfschema/pfs_user.h
index 58c95ad720e..acffaf9a724 100644
--- a/storage/perfschema/pfs_user.h
+++ b/storage/perfschema/pfs_user.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_variable.cc b/storage/perfschema/pfs_variable.cc
index 17b7dfc200c..982409baf82 100644
--- a/storage/perfschema/pfs_variable.cc
+++ b/storage/perfschema/pfs_variable.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
Copyright (c) 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
diff --git a/storage/perfschema/pfs_variable.h b/storage/perfschema/pfs_variable.h
index e59b02f2af8..948baf4e3b8 100644
--- a/storage/perfschema/pfs_variable.h
+++ b/storage/perfschema/pfs_variable.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_visitor.cc b/storage/perfschema/pfs_visitor.cc
index 52e0d6871f3..4cb0673f1b2 100644
--- a/storage/perfschema/pfs_visitor.cc
+++ b/storage/perfschema/pfs_visitor.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_visitor.h b/storage/perfschema/pfs_visitor.h
index ebedae6e7f0..4644888ea33 100644
--- a/storage/perfschema/pfs_visitor.h
+++ b/storage/perfschema/pfs_visitor.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_accounts.cc b/storage/perfschema/table_accounts.cc
index 34dd49017a9..fcf636b8e3e 100644
--- a/storage/perfschema/table_accounts.cc
+++ b/storage/perfschema/table_accounts.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -33,6 +33,12 @@
THR_LOCK table_accounts::m_table_lock;
+
+PFS_engine_table_share_state
+table_accounts::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_accounts::m_share=
{
@@ -49,7 +55,9 @@ table_accounts::m_share=
"HOST CHAR(" HOSTNAME_LENGTH_STR ") collate utf8_bin default null comment 'The connection client''s host name, or NULL if an internal thread.',"
"CURRENT_CONNECTIONS bigint not null comment 'Current connections for the account.',"
"TOTAL_CONNECTIONS bigint not null comment 'Total connections for the account.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_accounts::create()
diff --git a/storage/perfschema/table_accounts.h b/storage/perfschema/table_accounts.h
index c3c62f77924..f44d05b2700 100644
--- a/storage/perfschema/table_accounts.h
+++ b/storage/perfschema/table_accounts.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -49,6 +49,7 @@ struct row_accounts
class table_accounts : public cursor_by_account
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
/** Table builder */
diff --git a/storage/perfschema/table_all_instr.cc b/storage/perfschema/table_all_instr.cc
index 6a01912a3a0..c4d05cf13f0 100644
--- a/storage/perfschema/table_all_instr.cc
+++ b/storage/perfschema/table_all_instr.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_all_instr.h b/storage/perfschema/table_all_instr.h
index ea52f5d2de2..7dfb27c6032 100644
--- a/storage/perfschema/table_all_instr.h
+++ b/storage/perfschema/table_all_instr.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_esgs_by_account_by_event_name.cc b/storage/perfschema/table_esgs_by_account_by_event_name.cc
index d6c97ac3edf..cfc325f352e 100644
--- a/storage/perfschema/table_esgs_by_account_by_event_name.cc
+++ b/storage/perfschema/table_esgs_by_account_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,12 @@
THR_LOCK table_esgs_by_account_by_event_name::m_table_lock;
+
+PFS_engine_table_share_state
+table_esgs_by_account_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_esgs_by_account_by_event_name::m_share=
{
@@ -58,7 +64,9 @@ table_esgs_by_account_by_event_name::m_share=
"MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the timed summarized events.',"
"AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the timed summarized events.',"
"MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the timed summarized events.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_esgs_by_account_by_event_name.h b/storage/perfschema/table_esgs_by_account_by_event_name.h
index f19241a4d7b..dd805f4d038 100644
--- a/storage/perfschema/table_esgs_by_account_by_event_name.h
+++ b/storage/perfschema/table_esgs_by_account_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -84,6 +84,7 @@ struct pos_esgs_by_account_by_event_name
class table_esgs_by_account_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_esgs_by_host_by_event_name.cc b/storage/perfschema/table_esgs_by_host_by_event_name.cc
index bf219705513..2a3e72353b6 100644
--- a/storage/perfschema/table_esgs_by_host_by_event_name.cc
+++ b/storage/perfschema/table_esgs_by_host_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -39,6 +39,11 @@
THR_LOCK table_esgs_by_host_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_esgs_by_host_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_esgs_by_host_by_event_name::m_share=
{
@@ -58,7 +63,9 @@ table_esgs_by_host_by_event_name::m_share=
"MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the timed summarized events.',"
"AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the timed summarized events.',"
"MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the timed summarized events.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_esgs_by_host_by_event_name.h b/storage/perfschema/table_esgs_by_host_by_event_name.h
index 71592834d9a..674b6bfb883 100644
--- a/storage/perfschema/table_esgs_by_host_by_event_name.h
+++ b/storage/perfschema/table_esgs_by_host_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -84,6 +84,7 @@ struct pos_esgs_by_host_by_event_name
class table_esgs_by_host_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_esgs_by_thread_by_event_name.cc b/storage/perfschema/table_esgs_by_thread_by_event_name.cc
index f6568655e51..69111680704 100644
--- a/storage/perfschema/table_esgs_by_thread_by_event_name.cc
+++ b/storage/perfschema/table_esgs_by_thread_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,11 @@
THR_LOCK table_esgs_by_thread_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_esgs_by_thread_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_esgs_by_thread_by_event_name::m_share=
{
@@ -57,7 +62,9 @@ table_esgs_by_thread_by_event_name::m_share=
"MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the timed summarized events.',"
"AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the timed summarized events.',"
"MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the timed summarized events.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_esgs_by_thread_by_event_name.h b/storage/perfschema/table_esgs_by_thread_by_event_name.h
index e5c30363704..d009aabbdfc 100644
--- a/storage/perfschema/table_esgs_by_thread_by_event_name.h
+++ b/storage/perfschema/table_esgs_by_thread_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -88,6 +88,7 @@ struct pos_esgs_by_thread_by_event_name
class table_esgs_by_thread_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_esgs_by_user_by_event_name.cc b/storage/perfschema/table_esgs_by_user_by_event_name.cc
index ecec4e08425..d8b6af382a3 100644
--- a/storage/perfschema/table_esgs_by_user_by_event_name.cc
+++ b/storage/perfschema/table_esgs_by_user_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,11 @@
THR_LOCK table_esgs_by_user_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_esgs_by_user_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_esgs_by_user_by_event_name::m_share=
{
@@ -57,7 +62,9 @@ table_esgs_by_user_by_event_name::m_share=
"MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the timed summarized events.',"
"AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the timed summarized events.',"
"MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the timed summarized events.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_esgs_by_user_by_event_name.h b/storage/perfschema/table_esgs_by_user_by_event_name.h
index 895840fc476..a62578ca9b6 100644
--- a/storage/perfschema/table_esgs_by_user_by_event_name.h
+++ b/storage/perfschema/table_esgs_by_user_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -89,6 +89,7 @@ struct pos_esgs_by_user_by_event_name
class table_esgs_by_user_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_esgs_global_by_event_name.cc b/storage/perfschema/table_esgs_global_by_event_name.cc
index fe24d6794c1..288891861c9 100644
--- a/storage/perfschema/table_esgs_global_by_event_name.cc
+++ b/storage/perfschema/table_esgs_global_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -39,6 +39,11 @@
THR_LOCK table_esgs_global_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_esgs_global_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_esgs_global_by_event_name::m_share=
{
@@ -57,7 +62,9 @@ table_esgs_global_by_event_name::m_share=
"MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the timed summarized events.',"
"AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the timed summarized events.',"
"MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the timed summarized events.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_esgs_global_by_event_name.h b/storage/perfschema/table_esgs_global_by_event_name.h
index f2e51f625c7..ab70e8303ca 100644
--- a/storage/perfschema/table_esgs_global_by_event_name.h
+++ b/storage/perfschema/table_esgs_global_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -55,6 +55,7 @@ struct row_esgs_global_by_event_name
class table_esgs_global_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_esms_by_account_by_event_name.cc b/storage/perfschema/table_esms_by_account_by_event_name.cc
index 9756bc3c70b..a1805170332 100644
--- a/storage/perfschema/table_esms_by_account_by_event_name.cc
+++ b/storage/perfschema/table_esms_by_account_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,11 @@
THR_LOCK table_esms_by_account_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_esms_by_account_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_esms_by_account_by_event_name::m_share=
{
@@ -77,7 +82,9 @@ table_esms_by_account_by_event_name::m_share=
"SUM_SORT_SCAN BIGINT unsigned not null comment 'Sum of the SORT_SCAN column in the events_statements_current table.',"
"SUM_NO_INDEX_USED BIGINT unsigned not null comment 'Sum of the NO_INDEX_USED column in the events_statements_current table.',"
"SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null comment 'Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_esms_by_account_by_event_name.h b/storage/perfschema/table_esms_by_account_by_event_name.h
index e5f17ee1113..1afe7cb09df 100644
--- a/storage/perfschema/table_esms_by_account_by_event_name.h
+++ b/storage/perfschema/table_esms_by_account_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -84,6 +84,7 @@ struct pos_esms_by_account_by_event_name
class table_esms_by_account_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_esms_by_digest.cc b/storage/perfschema/table_esms_by_digest.cc
index c27e3372562..6a3f2bf3c3c 100644
--- a/storage/perfschema/table_esms_by_digest.cc
+++ b/storage/perfschema/table_esms_by_digest.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -41,6 +41,11 @@
THR_LOCK table_esms_by_digest::m_table_lock;
+PFS_engine_table_share_state
+table_esms_by_digest::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_esms_by_digest::m_share=
{
@@ -82,7 +87,9 @@ table_esms_by_digest::m_share=
"SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null comment 'Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table.',"
"FIRST_SEEN TIMESTAMP(0) NOT NULL default 0 comment 'Time at which the digest was first seen.',"
"LAST_SEEN TIMESTAMP(0) NOT NULL default 0 comment 'Time at which the digest was most recently seen.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_esms_by_digest.h b/storage/perfschema/table_esms_by_digest.h
index 7b84cdd6429..27b916e66ac 100644
--- a/storage/perfschema/table_esms_by_digest.h
+++ b/storage/perfschema/table_esms_by_digest.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -58,6 +58,7 @@ struct row_esms_by_digest
class table_esms_by_digest : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_esms_by_host_by_event_name.cc b/storage/perfschema/table_esms_by_host_by_event_name.cc
index ac6a584965f..3e7355fef80 100644
--- a/storage/perfschema/table_esms_by_host_by_event_name.cc
+++ b/storage/perfschema/table_esms_by_host_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -39,6 +39,11 @@
THR_LOCK table_esms_by_host_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_esms_by_host_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_esms_by_host_by_event_name::m_share=
{
@@ -77,7 +82,9 @@ table_esms_by_host_by_event_name::m_share=
"SUM_SORT_SCAN BIGINT unsigned not null comment 'Sum of the SORT_SCAN column in the events_statements_current table.',"
"SUM_NO_INDEX_USED BIGINT unsigned not null comment 'Sum of the NO_INDEX_USED column in the events_statements_current table.',"
"SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null comment 'Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_esms_by_host_by_event_name.h b/storage/perfschema/table_esms_by_host_by_event_name.h
index 54237b1deb5..2c47d4302b6 100644
--- a/storage/perfschema/table_esms_by_host_by_event_name.h
+++ b/storage/perfschema/table_esms_by_host_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -84,6 +84,7 @@ struct pos_esms_by_host_by_event_name
class table_esms_by_host_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_esms_by_program.cc b/storage/perfschema/table_esms_by_program.cc
index 5a4dab759cd..ab3e1a440b8 100644
--- a/storage/perfschema/table_esms_by_program.cc
+++ b/storage/perfschema/table_esms_by_program.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -41,6 +41,11 @@
THR_LOCK table_esms_by_program::m_table_lock;
+PFS_engine_table_share_state
+table_esms_by_program::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_esms_by_program::m_share=
{
@@ -85,7 +90,9 @@ table_esms_by_program::m_share=
"SUM_SORT_SCAN bigint(20) unsigned NOT NULL comment 'The total number of sorts that were done by scanning the table by the summarized statements.',"
"SUM_NO_INDEX_USED bigint(20) unsigned NOT NULL comment 'The total number of statements that performed a table scan without using an index.',"
"SUM_NO_GOOD_INDEX_USED bigint(20) unsigned NOT NULL comment 'The total number of statements where no good index was found.')")},
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_esms_by_program.h b/storage/perfschema/table_esms_by_program.h
index fdafb655918..a9aa47c2300 100644
--- a/storage/perfschema/table_esms_by_program.h
+++ b/storage/perfschema/table_esms_by_program.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -68,6 +68,7 @@ struct row_esms_by_program
class table_esms_by_program : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_esms_by_thread_by_event_name.cc b/storage/perfschema/table_esms_by_thread_by_event_name.cc
index eb38c3e5687..ad22fa3c63f 100644
--- a/storage/perfschema/table_esms_by_thread_by_event_name.cc
+++ b/storage/perfschema/table_esms_by_thread_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,11 @@
THR_LOCK table_esms_by_thread_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_esms_by_thread_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_esms_by_thread_by_event_name::m_share=
{
@@ -76,7 +81,9 @@ table_esms_by_thread_by_event_name::m_share=
"SUM_SORT_SCAN BIGINT unsigned not null comment 'Sum of the SORT_SCAN column in the events_statements_current table.',"
"SUM_NO_INDEX_USED BIGINT unsigned not null comment 'Sum of the NO_INDEX_USED column in the events_statements_current table.',"
"SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null comment 'Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_esms_by_thread_by_event_name.h b/storage/perfschema/table_esms_by_thread_by_event_name.h
index 9a0818291b9..e4100c076f6 100644
--- a/storage/perfschema/table_esms_by_thread_by_event_name.h
+++ b/storage/perfschema/table_esms_by_thread_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -88,6 +88,7 @@ struct pos_esms_by_thread_by_event_name
class table_esms_by_thread_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_esms_by_user_by_event_name.cc b/storage/perfschema/table_esms_by_user_by_event_name.cc
index a0efa66c177..82479d329b3 100644
--- a/storage/perfschema/table_esms_by_user_by_event_name.cc
+++ b/storage/perfschema/table_esms_by_user_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,11 @@
THR_LOCK table_esms_by_user_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_esms_by_user_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_esms_by_user_by_event_name::m_share=
{
@@ -76,7 +81,9 @@ table_esms_by_user_by_event_name::m_share=
"SUM_SORT_SCAN BIGINT unsigned not null comment 'Sum of the SORT_SCAN column in the events_statements_current table.',"
"SUM_NO_INDEX_USED BIGINT unsigned not null comment 'Sum of the NO_INDEX_USED column in the events_statements_current table.',"
"SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null comment 'Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_esms_by_user_by_event_name.h b/storage/perfschema/table_esms_by_user_by_event_name.h
index 51762be4143..85399b18622 100644
--- a/storage/perfschema/table_esms_by_user_by_event_name.h
+++ b/storage/perfschema/table_esms_by_user_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -84,6 +84,7 @@ struct pos_esms_by_user_by_event_name
class table_esms_by_user_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_esms_global_by_event_name.cc b/storage/perfschema/table_esms_global_by_event_name.cc
index f889df11b5a..cde0ef5deee 100644
--- a/storage/perfschema/table_esms_global_by_event_name.cc
+++ b/storage/perfschema/table_esms_global_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -39,6 +39,11 @@
THR_LOCK table_esms_global_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_esms_global_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_esms_global_by_event_name::m_share=
{
@@ -76,7 +81,9 @@ table_esms_global_by_event_name::m_share=
"SUM_SORT_SCAN BIGINT unsigned not null comment 'Sum of the SORT_SCAN column in the events_statements_current table.',"
"SUM_NO_INDEX_USED BIGINT unsigned not null comment 'Sum of the NO_INDEX_USED column in the events_statements_current table.',"
"SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null comment 'Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_esms_global_by_event_name.h b/storage/perfschema/table_esms_global_by_event_name.h
index c4a32da11bf..780c7fa6e4f 100644
--- a/storage/perfschema/table_esms_global_by_event_name.h
+++ b/storage/perfschema/table_esms_global_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -55,6 +55,7 @@ struct row_esms_global_by_event_name
class table_esms_global_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_ets_by_account_by_event_name.cc b/storage/perfschema/table_ets_by_account_by_event_name.cc
index 9d323eb78d9..95746b57e5a 100644
--- a/storage/perfschema/table_ets_by_account_by_event_name.cc
+++ b/storage/perfschema/table_ets_by_account_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,11 @@
THR_LOCK table_ets_by_account_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_ets_by_account_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_ets_by_account_by_event_name::m_share=
{
@@ -68,7 +73,9 @@ table_ets_by_account_by_event_name::m_share=
"MIN_TIMER_READ_ONLY BIGINT unsigned not null comment 'The minimum wait time of only READ ONLY transaction events.',"
"AVG_TIMER_READ_ONLY BIGINT unsigned not null comment 'The average wait time of only READ ONLY transaction events.',"
"MAX_TIMER_READ_ONLY BIGINT unsigned not null comment 'The maximum wait time of only READ ONLY transaction events.')")},
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_ets_by_account_by_event_name.h b/storage/perfschema/table_ets_by_account_by_event_name.h
index 3399c27d6e4..e227db2e08e 100644
--- a/storage/perfschema/table_ets_by_account_by_event_name.h
+++ b/storage/perfschema/table_ets_by_account_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -88,6 +88,7 @@ struct pos_ets_by_account_by_event_name
class table_ets_by_account_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_ets_by_host_by_event_name.cc b/storage/perfschema/table_ets_by_host_by_event_name.cc
index 6ca2cfad81a..5b89e9cbfd2 100644
--- a/storage/perfschema/table_ets_by_host_by_event_name.cc
+++ b/storage/perfschema/table_ets_by_host_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -39,6 +39,11 @@
THR_LOCK table_ets_by_host_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_ets_by_host_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_ets_by_host_by_event_name::m_share=
{
@@ -68,7 +73,9 @@ table_ets_by_host_by_event_name::m_share=
"MIN_TIMER_READ_ONLY BIGINT unsigned not null comment 'The minimum wait time of only READ ONLY transaction events.',"
"AVG_TIMER_READ_ONLY BIGINT unsigned not null comment 'The average wait time of only READ ONLY transaction events.',"
"MAX_TIMER_READ_ONLY BIGINT unsigned not null comment 'The maximum wait time of only READ ONLY transaction events.')")},
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_ets_by_host_by_event_name.h b/storage/perfschema/table_ets_by_host_by_event_name.h
index 2188f385701..add2d1a32a6 100644
--- a/storage/perfschema/table_ets_by_host_by_event_name.h
+++ b/storage/perfschema/table_ets_by_host_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -88,6 +88,7 @@ struct pos_ets_by_host_by_event_name
class table_ets_by_host_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_ets_by_thread_by_event_name.cc b/storage/perfschema/table_ets_by_thread_by_event_name.cc
index 257f37d56ed..1dc876bd293 100644
--- a/storage/perfschema/table_ets_by_thread_by_event_name.cc
+++ b/storage/perfschema/table_ets_by_thread_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,11 @@
THR_LOCK table_ets_by_thread_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_ets_by_thread_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_ets_by_thread_by_event_name::m_share=
{
@@ -67,7 +72,9 @@ table_ets_by_thread_by_event_name::m_share=
"MIN_TIMER_READ_ONLY BIGINT unsigned not null comment 'The minimum wait time of only READ ONLY transaction events.',"
"AVG_TIMER_READ_ONLY BIGINT unsigned not null comment 'The average wait time of only READ ONLY transaction events.',"
"MAX_TIMER_READ_ONLY BIGINT unsigned not null comment 'The maximum wait time of only READ ONLY transaction events.')")},
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_ets_by_thread_by_event_name.h b/storage/perfschema/table_ets_by_thread_by_event_name.h
index dbfe1fae016..a69e19653ee 100644
--- a/storage/perfschema/table_ets_by_thread_by_event_name.h
+++ b/storage/perfschema/table_ets_by_thread_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -92,6 +92,7 @@ struct pos_ets_by_thread_by_event_name
class table_ets_by_thread_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_ets_by_user_by_event_name.cc b/storage/perfschema/table_ets_by_user_by_event_name.cc
index 6b54175b6cc..3883e8c7e69 100644
--- a/storage/perfschema/table_ets_by_user_by_event_name.cc
+++ b/storage/perfschema/table_ets_by_user_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,11 @@
THR_LOCK table_ets_by_user_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_ets_by_user_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_ets_by_user_by_event_name::m_share=
{
@@ -67,7 +72,9 @@ table_ets_by_user_by_event_name::m_share=
"MIN_TIMER_READ_ONLY BIGINT unsigned not null comment 'The minimum wait time of only READ ONLY transaction events.',"
"AVG_TIMER_READ_ONLY BIGINT unsigned not null comment 'The average wait time of only READ ONLY transaction events.',"
"MAX_TIMER_READ_ONLY BIGINT unsigned not null comment 'The maximum wait time of only READ ONLY transaction events.')")},
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_ets_by_user_by_event_name.h b/storage/perfschema/table_ets_by_user_by_event_name.h
index 62721ce9adf..fc18a3e94e6 100644
--- a/storage/perfschema/table_ets_by_user_by_event_name.h
+++ b/storage/perfschema/table_ets_by_user_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -88,6 +88,7 @@ struct pos_ets_by_user_by_event_name
class table_ets_by_user_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_ets_global_by_event_name.cc b/storage/perfschema/table_ets_global_by_event_name.cc
index e08ff15075d..209ecf47aac 100644
--- a/storage/perfschema/table_ets_global_by_event_name.cc
+++ b/storage/perfschema/table_ets_global_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -39,6 +39,11 @@
THR_LOCK table_ets_global_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_ets_global_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_ets_global_by_event_name::m_share=
{
@@ -67,7 +72,9 @@ table_ets_global_by_event_name::m_share=
"MIN_TIMER_READ_ONLY BIGINT unsigned not null comment 'The minimum wait time of only READ ONLY transaction events.',"
"AVG_TIMER_READ_ONLY BIGINT unsigned not null comment 'The average wait time of only READ ONLY transaction events.',"
"MAX_TIMER_READ_ONLY BIGINT unsigned not null comment 'The maximum wait time of only READ ONLY transaction events.')")},
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_ets_global_by_event_name.h b/storage/perfschema/table_ets_global_by_event_name.h
index 717a737f93c..a2136a23210 100644
--- a/storage/perfschema/table_ets_global_by_event_name.h
+++ b/storage/perfschema/table_ets_global_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -59,6 +59,7 @@ struct row_ets_global_by_event_name
class table_ets_global_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_events_stages.cc b/storage/perfschema/table_events_stages.cc
index 66887d39e5a..e2689ad0ad9 100644
--- a/storage/perfschema/table_events_stages.cc
+++ b/storage/perfschema/table_events_stages.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -37,6 +37,11 @@
THR_LOCK table_events_stages_current::m_table_lock;
+PFS_engine_table_share_state
+table_events_stages_current::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_events_stages_current::m_share=
{
@@ -61,11 +66,18 @@ table_events_stages_current::m_share=
"WORK_ESTIMATED BIGINT unsigned comment 'The number of work units expected for the stage. NULL if the stage event progress is not instrumented.',"
"NESTING_EVENT_ID BIGINT unsigned comment 'EVENT_ID of event within which this event nests.',"
"NESTING_EVENT_TYPE ENUM('TRANSACTION', 'STATEMENT', 'STAGE', 'WAIT') comment 'Nesting event type. Either transaction, statement, stage or wait.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
THR_LOCK table_events_stages_history::m_table_lock;
+PFS_engine_table_share_state
+table_events_stages_history::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_events_stages_history::m_share=
{
@@ -90,11 +102,18 @@ table_events_stages_history::m_share=
"WORK_ESTIMATED BIGINT unsigned comment 'The number of work units expected for the stage. NULL if the stage event progress is not instrumented.',"
"NESTING_EVENT_ID BIGINT unsigned comment 'EVENT_ID of event within which this event nests.',"
"NESTING_EVENT_TYPE ENUM('TRANSACTION', 'STATEMENT', 'STAGE', 'WAIT') comment 'Nesting event type. Either transaction, statement, stage or wait.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
THR_LOCK table_events_stages_history_long::m_table_lock;
+PFS_engine_table_share_state
+table_events_stages_history_long::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_events_stages_history_long::m_share=
{
@@ -119,7 +138,9 @@ table_events_stages_history_long::m_share=
"WORK_ESTIMATED BIGINT unsigned comment 'The number of work units expected for the stage. NULL if the stage event progress is not instrumented.',"
"NESTING_EVENT_ID BIGINT unsigned comment 'EVENT_ID of event within which this event nests.',"
"NESTING_EVENT_TYPE ENUM('TRANSACTION', 'STATEMENT', 'STAGE', 'WAIT') comment 'Nesting event type. Either transaction, statement, stage or wait.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
table_events_stages_common::table_events_stages_common
diff --git a/storage/perfschema/table_events_stages.h b/storage/perfschema/table_events_stages.h
index 2fd760cfae3..2ef37c16a11 100644
--- a/storage/perfschema/table_events_stages.h
+++ b/storage/perfschema/table_events_stages.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -122,6 +122,7 @@ protected:
class table_events_stages_current : public table_events_stages_common
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
@@ -157,6 +158,7 @@ private:
class table_events_stages_history : public table_events_stages_common
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
@@ -189,6 +191,7 @@ private:
class table_events_stages_history_long : public table_events_stages_common
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_events_statements.cc b/storage/perfschema/table_events_statements.cc
index 5e30f39c785..4b27db19ca2 100644
--- a/storage/perfschema/table_events_statements.cc
+++ b/storage/perfschema/table_events_statements.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -39,6 +39,11 @@
THR_LOCK table_events_statements_current::m_table_lock;
+PFS_engine_table_share_state
+table_events_statements_current::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_events_statements_current::m_share=
{
@@ -92,11 +97,18 @@ table_events_statements_current::m_share=
"NESTING_EVENT_ID BIGINT unsigned comment 'NULL for top level statements. The parent statement event id for nested statements (stored programs).',"
"NESTING_EVENT_TYPE ENUM('TRANSACTION', 'STATEMENT', 'STAGE', 'WAIT') comment 'NULL for top level statements. The parent statement event type for nested statements (stored programs).',"
"NESTING_EVENT_LEVEL INT comment '0 for top level statements. The parent statement level plus 1 for nested statements (stored programs).')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
THR_LOCK table_events_statements_history::m_table_lock;
+PFS_engine_table_share_state
+table_events_statements_history::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_events_statements_history::m_share=
{
@@ -150,11 +162,18 @@ table_events_statements_history::m_share=
"NESTING_EVENT_ID BIGINT unsigned comment 'NULL for top level statements. The parent statement event id for nested statements (stored programs).',"
"NESTING_EVENT_TYPE ENUM('TRANSACTION', 'STATEMENT', 'STAGE', 'WAIT') comment 'NULL for top level statements. The parent statement event type for nested statements (stored programs).',"
"NESTING_EVENT_LEVEL INT comment '0 for top level statements. The parent statement level plus 1 for nested statements (stored programs).')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
THR_LOCK table_events_statements_history_long::m_table_lock;
+PFS_engine_table_share_state
+table_events_statements_history_long::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_events_statements_history_long::m_share=
{
@@ -208,7 +227,9 @@ table_events_statements_history_long::m_share=
"NESTING_EVENT_ID BIGINT unsigned comment 'NULL for top level statements. The parent statement event id for nested statements (stored programs).',"
"NESTING_EVENT_TYPE ENUM('TRANSACTION', 'STATEMENT', 'STAGE', 'WAIT') comment 'NULL for top level statements. The parent statement event type for nested statements (stored programs).',"
"NESTING_EVENT_LEVEL INT comment '0 for top level statements. The parent statement level plus 1 for nested statements (stored programs).')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
table_events_statements_common::table_events_statements_common
diff --git a/storage/perfschema/table_events_statements.h b/storage/perfschema/table_events_statements.h
index 5499c8d62ec..a7fb6fd0ec7 100644
--- a/storage/perfschema/table_events_statements.h
+++ b/storage/perfschema/table_events_statements.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -209,6 +209,7 @@ protected:
class table_events_statements_current : public table_events_statements_common
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
@@ -246,6 +247,7 @@ private:
class table_events_statements_history : public table_events_statements_common
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
@@ -280,6 +282,7 @@ private:
class table_events_statements_history_long : public table_events_statements_common
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_events_transactions.cc b/storage/perfschema/table_events_transactions.cc
index 543d106ff26..e9fe172d8cf 100644
--- a/storage/perfschema/table_events_transactions.cc
+++ b/storage/perfschema/table_events_transactions.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -39,6 +39,11 @@
THR_LOCK table_events_transactions_current::m_table_lock;
+PFS_engine_table_share_state
+table_events_transactions_current::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_events_transactions_current::m_share=
{
@@ -75,11 +80,18 @@ table_events_transactions_current::m_share=
"OBJECT_INSTANCE_BEGIN BIGINT unsigned comment 'Unused.',"
"NESTING_EVENT_ID BIGINT unsigned comment 'The EVENT_ID value of the event within which this event is nested.',"
"NESTING_EVENT_TYPE ENUM('TRANSACTION', 'STATEMENT', 'STAGE', 'WAIT') comment 'The nesting event type.')")},
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
THR_LOCK table_events_transactions_history::m_table_lock;
+PFS_engine_table_share_state
+table_events_transactions_history::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_events_transactions_history::m_share=
{
@@ -116,11 +128,18 @@ table_events_transactions_history::m_share=
"OBJECT_INSTANCE_BEGIN BIGINT unsigned comment 'Unused.',"
"NESTING_EVENT_ID BIGINT unsigned comment 'The EVENT_ID value of the event within which this event is nested.',"
"NESTING_EVENT_TYPE ENUM('TRANSACTION', 'STATEMENT', 'STAGE', 'WAIT') comment 'The nesting event type.')")},
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
THR_LOCK table_events_transactions_history_long::m_table_lock;
+PFS_engine_table_share_state
+table_events_transactions_history_long::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_events_transactions_history_long::m_share=
{
@@ -157,7 +176,9 @@ table_events_transactions_history_long::m_share=
"OBJECT_INSTANCE_BEGIN BIGINT unsigned comment 'Unused.',"
"NESTING_EVENT_ID BIGINT unsigned comment 'The EVENT_ID value of the event within which this event is nested.',"
"NESTING_EVENT_TYPE ENUM('TRANSACTION', 'STATEMENT', 'STAGE', 'WAIT') comment 'The nesting event type.')")},
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
table_events_transactions_common::table_events_transactions_common
diff --git a/storage/perfschema/table_events_transactions.h b/storage/perfschema/table_events_transactions.h
index b9f8f750d85..940546093c8 100644
--- a/storage/perfschema/table_events_transactions.h
+++ b/storage/perfschema/table_events_transactions.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -149,6 +149,7 @@ protected:
class table_events_transactions_current : public table_events_transactions_common
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
@@ -190,6 +191,7 @@ private:
class table_events_transactions_history : public table_events_transactions_common
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
@@ -222,6 +224,7 @@ private:
class table_events_transactions_history_long : public table_events_transactions_common
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_events_waits.cc b/storage/perfschema/table_events_waits.cc
index a345c6fdf3a..e0052b8f656 100644
--- a/storage/perfschema/table_events_waits.cc
+++ b/storage/perfschema/table_events_waits.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -39,6 +39,11 @@
THR_LOCK table_events_waits_current::m_table_lock;
+PFS_engine_table_share_state
+table_events_waits_current::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_events_waits_current::m_share=
{
@@ -70,11 +75,18 @@ table_events_waits_current::m_share=
"OPERATION VARCHAR(32) not null comment 'Operation type, for example read, write or lock',"
"NUMBER_OF_BYTES BIGINT comment 'Number of bytes that the operation read or wrote, or NULL for table I/O waits.',"
"FLAGS INTEGER unsigned comment 'Reserved for use in the future.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
THR_LOCK table_events_waits_history::m_table_lock;
+PFS_engine_table_share_state
+table_events_waits_history::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_events_waits_history::m_share=
{
@@ -106,11 +118,18 @@ table_events_waits_history::m_share=
"OPERATION VARCHAR(32) not null comment 'Operation type, for example read, write or lock',"
"NUMBER_OF_BYTES BIGINT comment 'Number of bytes that the operation read or wrote, or NULL for table I/O waits.',"
"FLAGS INTEGER unsigned comment 'Reserved for use in the future.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
THR_LOCK table_events_waits_history_long::m_table_lock;
+PFS_engine_table_share_state
+table_events_waits_history_long::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_events_waits_history_long::m_share=
{
@@ -142,7 +161,9 @@ table_events_waits_history_long::m_share=
"OPERATION VARCHAR(32) not null comment 'Operation type, for example read, write or lock',"
"NUMBER_OF_BYTES BIGINT comment 'Number of bytes that the operation read or wrote, or NULL for table I/O waits.',"
"FLAGS INTEGER unsigned comment 'Reserved for use in the future.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
table_events_waits_common::table_events_waits_common
diff --git a/storage/perfschema/table_events_waits.h b/storage/perfschema/table_events_waits.h
index 82d6f56bbb7..926d54fd970 100644
--- a/storage/perfschema/table_events_waits.h
+++ b/storage/perfschema/table_events_waits.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -167,6 +167,7 @@ protected:
class table_events_waits_current : public table_events_waits_common
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
@@ -203,6 +204,7 @@ private:
class table_events_waits_history : public table_events_waits_common
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
@@ -236,6 +238,7 @@ private:
class table_events_waits_history_long : public table_events_waits_common
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_events_waits_summary.cc b/storage/perfschema/table_events_waits_summary.cc
index b9565d54460..3ee14e9a3e8 100644
--- a/storage/perfschema/table_events_waits_summary.cc
+++ b/storage/perfschema/table_events_waits_summary.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -36,6 +36,11 @@
THR_LOCK table_events_waits_summary_by_instance::m_table_lock;
+PFS_engine_table_share_state
+table_events_waits_summary_by_instance::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_events_waits_summary_by_instance::m_share=
{
@@ -55,7 +60,9 @@ table_events_waits_summary_by_instance::m_share=
"MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the summarized events that are timed.',"
"AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the summarized events that are timed.',"
"MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the summarized events that are timed.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_events_waits_summary_by_instance::create(void)
diff --git a/storage/perfschema/table_events_waits_summary.h b/storage/perfschema/table_events_waits_summary.h
index 13d50a23760..0cc6f18be3c 100644
--- a/storage/perfschema/table_events_waits_summary.h
+++ b/storage/perfschema/table_events_waits_summary.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -57,6 +57,7 @@ struct row_events_waits_summary_by_instance
class table_events_waits_summary_by_instance : public table_all_instr
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_ews_by_account_by_event_name.cc b/storage/perfschema/table_ews_by_account_by_event_name.cc
index 007f75e52eb..661fff768a8 100644
--- a/storage/perfschema/table_ews_by_account_by_event_name.cc
+++ b/storage/perfschema/table_ews_by_account_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,11 @@
THR_LOCK table_ews_by_account_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_ews_by_account_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_ews_by_account_by_event_name::m_share=
{
@@ -58,7 +63,9 @@ table_ews_by_account_by_event_name::m_share=
"MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the summarized events that are timed.',"
"AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the summarized events that are timed.',"
"MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the summarized events that are timed.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_ews_by_account_by_event_name.h b/storage/perfschema/table_ews_by_account_by_event_name.h
index 4d626cf44cf..6ca0f2912bd 100644
--- a/storage/perfschema/table_ews_by_account_by_event_name.h
+++ b/storage/perfschema/table_ews_by_account_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -96,6 +96,7 @@ struct pos_ews_by_account_by_event_name
class table_ews_by_account_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_ews_by_host_by_event_name.cc b/storage/perfschema/table_ews_by_host_by_event_name.cc
index 3a1ee52b6e4..6fb54deb4b2 100644
--- a/storage/perfschema/table_ews_by_host_by_event_name.cc
+++ b/storage/perfschema/table_ews_by_host_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -39,6 +39,11 @@
THR_LOCK table_ews_by_host_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_ews_by_host_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_ews_by_host_by_event_name::m_share=
{
@@ -58,7 +63,9 @@ table_ews_by_host_by_event_name::m_share=
"MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the summarized events that are timed.',"
"AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the summarized events that are timed.',"
"MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the summarized events that are timed.' )") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_ews_by_host_by_event_name.h b/storage/perfschema/table_ews_by_host_by_event_name.h
index fb1060cb45e..ac07e698f13 100644
--- a/storage/perfschema/table_ews_by_host_by_event_name.h
+++ b/storage/perfschema/table_ews_by_host_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -96,6 +96,7 @@ struct pos_ews_by_host_by_event_name
class table_ews_by_host_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_ews_by_thread_by_event_name.cc b/storage/perfschema/table_ews_by_thread_by_event_name.cc
index 803e81b4a7b..35d82378717 100644
--- a/storage/perfschema/table_ews_by_thread_by_event_name.cc
+++ b/storage/perfschema/table_ews_by_thread_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,11 @@
THR_LOCK table_ews_by_thread_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_ews_by_thread_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_ews_by_thread_by_event_name::m_share=
{
@@ -57,7 +62,9 @@ table_ews_by_thread_by_event_name::m_share=
"MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the summarized events that are timed.',"
"AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the summarized events that are timed.',"
"MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the summarized events that are timed.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_ews_by_thread_by_event_name.h b/storage/perfschema/table_ews_by_thread_by_event_name.h
index 85209f6fad4..b811cd40962 100644
--- a/storage/perfschema/table_ews_by_thread_by_event_name.h
+++ b/storage/perfschema/table_ews_by_thread_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -95,6 +95,7 @@ struct pos_ews_by_thread_by_event_name
class table_ews_by_thread_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_ews_by_user_by_event_name.cc b/storage/perfschema/table_ews_by_user_by_event_name.cc
index d1e88da59aa..62ea8aaa7be 100644
--- a/storage/perfschema/table_ews_by_user_by_event_name.cc
+++ b/storage/perfschema/table_ews_by_user_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,11 @@
THR_LOCK table_ews_by_user_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_ews_by_user_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_ews_by_user_by_event_name::m_share=
{
@@ -57,7 +62,9 @@ table_ews_by_user_by_event_name::m_share=
"MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the summarized events that are timed.',"
"AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the summarized events that are timed.',"
"MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the summarized events that are timed.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_ews_by_user_by_event_name.h b/storage/perfschema/table_ews_by_user_by_event_name.h
index ffb2e9074b2..2dc34203d9e 100644
--- a/storage/perfschema/table_ews_by_user_by_event_name.h
+++ b/storage/perfschema/table_ews_by_user_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -96,6 +96,7 @@ struct pos_ews_by_user_by_event_name
class table_ews_by_user_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_ews_global_by_event_name.cc b/storage/perfschema/table_ews_global_by_event_name.cc
index d4853685a17..777112da092 100644
--- a/storage/perfschema/table_ews_global_by_event_name.cc
+++ b/storage/perfschema/table_ews_global_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,10 @@
#include "field.h"
THR_LOCK table_ews_global_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_ews_global_by_event_name::m_share_state = {
+ false /* m_checked */
+};
PFS_engine_table_share
table_ews_global_by_event_name::m_share=
@@ -57,7 +61,9 @@ table_ews_global_by_event_name::m_share=
"MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the summarized events that are timed.',"
"AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the summarized events that are timed.',"
"MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the summarized events that are timed.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_ews_global_by_event_name.h b/storage/perfschema/table_ews_global_by_event_name.h
index 548f0af4666..811dfbb6812 100644
--- a/storage/perfschema/table_ews_global_by_event_name.h
+++ b/storage/perfschema/table_ews_global_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -84,6 +84,7 @@ struct pos_ews_global_by_event_name
class table_ews_global_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_file_instances.cc b/storage/perfschema/table_file_instances.cc
index abbaf0745b3..c5fd7db2c23 100644
--- a/storage/perfschema/table_file_instances.cc
+++ b/storage/perfschema/table_file_instances.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -36,6 +36,10 @@
#include "field.h"
THR_LOCK table_file_instances::m_table_lock;
+PFS_engine_table_share_state
+table_file_instances::m_share_state = {
+ false /* m_checked */
+};
PFS_engine_table_share
table_file_instances::m_share=
@@ -52,7 +56,9 @@ table_file_instances::m_share=
"FILE_NAME VARCHAR(512) not null comment 'File name.',"
"EVENT_NAME VARCHAR(128) not null comment 'Instrument name associated with the file.',"
"OPEN_COUNT INTEGER unsigned not null comment 'Open handles on the file. A value of greater than zero means that the file is currently open.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_file_instances::create(void)
diff --git a/storage/perfschema/table_file_instances.h b/storage/perfschema/table_file_instances.h
index 1517e83035b..adad5dadd06 100644
--- a/storage/perfschema/table_file_instances.h
+++ b/storage/perfschema/table_file_instances.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -55,6 +55,7 @@ struct row_file_instances
class table_file_instances : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_file_summary_by_event_name.cc b/storage/perfschema/table_file_summary_by_event_name.cc
index e7c2d5559e6..d91fb02fe06 100644
--- a/storage/perfschema/table_file_summary_by_event_name.cc
+++ b/storage/perfschema/table_file_summary_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -36,6 +36,10 @@
#include "field.h"
THR_LOCK table_file_summary_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_file_summary_by_event_name::m_share_state = {
+ false /* m_checked */
+};
PFS_engine_table_share
table_file_summary_by_event_name::m_share=
@@ -72,7 +76,9 @@ table_file_summary_by_event_name::m_share=
"MIN_TIMER_MISC BIGINT unsigned not null comment 'Minimum wait time of all miscellaneous operations that are timed.',"
"AVG_TIMER_MISC BIGINT unsigned not null comment 'Average wait time of all miscellaneous operations that are timed.',"
"MAX_TIMER_MISC BIGINT unsigned not null comment 'Maximum wait time of all miscellaneous operations that are timed.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_file_summary_by_event_name::create(void)
diff --git a/storage/perfschema/table_file_summary_by_event_name.h b/storage/perfschema/table_file_summary_by_event_name.h
index 852b680262e..877adf9476a 100644
--- a/storage/perfschema/table_file_summary_by_event_name.h
+++ b/storage/perfschema/table_file_summary_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -55,6 +55,7 @@ struct row_file_summary_by_event_name
class table_file_summary_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_file_summary_by_instance.cc b/storage/perfschema/table_file_summary_by_instance.cc
index 2a41f9b7bff..5cd98955d62 100644
--- a/storage/perfschema/table_file_summary_by_instance.cc
+++ b/storage/perfschema/table_file_summary_by_instance.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -37,6 +37,11 @@
THR_LOCK table_file_summary_by_instance::m_table_lock;
+PFS_engine_table_share_state
+table_file_summary_by_instance::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_file_summary_by_instance::m_share=
{
@@ -74,7 +79,9 @@ table_file_summary_by_instance::m_share=
"MIN_TIMER_MISC BIGINT unsigned not null comment 'Minimum wait time of all miscellaneous operations that are timed.',"
"AVG_TIMER_MISC BIGINT unsigned not null comment 'Average wait time of all miscellaneous operations that are timed.',"
"MAX_TIMER_MISC BIGINT unsigned not null comment 'Maximum wait time of all miscellaneous operations that are timed.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_file_summary_by_instance::create(void)
diff --git a/storage/perfschema/table_file_summary_by_instance.h b/storage/perfschema/table_file_summary_by_instance.h
index f0c3c1303fb..3b044fa064d 100644
--- a/storage/perfschema/table_file_summary_by_instance.h
+++ b/storage/perfschema/table_file_summary_by_instance.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -63,6 +63,7 @@ struct row_file_summary_by_instance
class table_file_summary_by_instance : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_global_status.cc b/storage/perfschema/table_global_status.cc
index c68e501d819..d9a20dc7e24 100644
--- a/storage/perfschema/table_global_status.cc
+++ b/storage/perfschema/table_global_status.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -35,6 +35,11 @@
THR_LOCK table_global_status::m_table_lock;
+PFS_engine_table_share_state
+table_global_status::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_global_status::m_share=
{
@@ -49,7 +54,9 @@ table_global_status::m_share=
{ C_STRING_WITH_LEN("CREATE TABLE global_status("
"VARIABLE_NAME VARCHAR(64) not null comment 'The global status variable name.',"
"VARIABLE_VALUE VARCHAR(1024) comment 'The global status variable value.')") },
- true /* perpetual */
+ true, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_global_status.h b/storage/perfschema/table_global_status.h
index 53d7ca459c9..45c57fb6900 100644
--- a/storage/perfschema/table_global_status.h
+++ b/storage/perfschema/table_global_status.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -68,6 +68,7 @@ class table_global_status : public PFS_engine_table
typedef PFS_simple_index pos_t;
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_global_variables.cc b/storage/perfschema/table_global_variables.cc
index 67be7e4e99a..fbe6b977cd1 100644
--- a/storage/perfschema/table_global_variables.cc
+++ b/storage/perfschema/table_global_variables.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -35,6 +35,11 @@
THR_LOCK table_global_variables::m_table_lock;
+PFS_engine_table_share_state
+table_global_variables::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_global_variables::m_share=
{
@@ -49,7 +54,8 @@ table_global_variables::m_share=
{ C_STRING_WITH_LEN("CREATE TABLE global_variables("
"VARIABLE_NAME VARCHAR(64) not null,"
"VARIABLE_VALUE VARCHAR(1024))") },
- true /* perpetual */
+ true, /* m_perpetual */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_global_variables.h b/storage/perfschema/table_global_variables.h
index 8a9bbd63574..f5429c671a2 100644
--- a/storage/perfschema/table_global_variables.h
+++ b/storage/perfschema/table_global_variables.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -68,6 +68,7 @@ class table_global_variables : public PFS_engine_table
typedef PFS_simple_index pos_t;
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_helper.cc b/storage/perfschema/table_helper.cc
index 0ae6f6c0786..477a1cd6006 100644
--- a/storage/perfschema/table_helper.cc
+++ b/storage/perfschema/table_helper.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_helper.h b/storage/perfschema/table_helper.h
index c7e4bf4dfb5..0e39b80875f 100644
--- a/storage/perfschema/table_helper.h
+++ b/storage/perfschema/table_helper.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_host_cache.cc b/storage/perfschema/table_host_cache.cc
index 1c1cba60b0d..79318223e21 100644
--- a/storage/perfschema/table_host_cache.cc
+++ b/storage/perfschema/table_host_cache.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -34,6 +34,11 @@
THR_LOCK table_host_cache::m_table_lock;
+PFS_engine_table_share_state
+table_host_cache::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_host_cache::m_share=
{
@@ -75,7 +80,9 @@ table_host_cache::m_share=
"LAST_SEEN TIMESTAMP(0) NOT NULL default 0 comment 'Timestamp of the most recent connection attempt by the IP.',"
"FIRST_ERROR_SEEN TIMESTAMP(0) null default 0 comment 'Timestamp of the first error seen from the IP.',"
"LAST_ERROR_SEEN TIMESTAMP(0) null default 0 comment 'Timestamp of the most recent error seen from the IP.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_host_cache::create(void)
diff --git a/storage/perfschema/table_host_cache.h b/storage/perfschema/table_host_cache.h
index 5680a49675f..bb1cb444c33 100644
--- a/storage/perfschema/table_host_cache.h
+++ b/storage/perfschema/table_host_cache.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -107,6 +107,7 @@ struct row_host_cache
class table_host_cache : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share. */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_hosts.cc b/storage/perfschema/table_hosts.cc
index 7c6f6212bb8..443cb12e6e0 100644
--- a/storage/perfschema/table_hosts.cc
+++ b/storage/perfschema/table_hosts.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -34,6 +34,11 @@
THR_LOCK table_hosts::m_table_lock;
+PFS_engine_table_share_state
+table_hosts::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_hosts::m_share=
{
@@ -49,7 +54,9 @@ table_hosts::m_share=
"HOST CHAR(" STRINGIFY_ARG(HOSTNAME_LENGTH) ") collate utf8_bin default null comment 'Host name used by the client to connect, NULL for internal threads or user sessions that failed to authenticate.',"
"CURRENT_CONNECTIONS bigint not null comment 'Current number of the host''s connections.',"
"TOTAL_CONNECTIONS bigint not null comment 'Total number of the host''s connections')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_hosts::create()
diff --git a/storage/perfschema/table_hosts.h b/storage/perfschema/table_hosts.h
index 51bc7f2f2a7..8262beabda5 100644
--- a/storage/perfschema/table_hosts.h
+++ b/storage/perfschema/table_hosts.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -49,6 +49,7 @@ struct row_hosts
class table_hosts : public cursor_by_host
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
/** Table builder */
diff --git a/storage/perfschema/table_md_locks.cc b/storage/perfschema/table_md_locks.cc
index d7e3423d9bc..2b69e385a79 100644
--- a/storage/perfschema/table_md_locks.cc
+++ b/storage/perfschema/table_md_locks.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2012, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -37,6 +37,11 @@
THR_LOCK table_metadata_locks::m_table_lock;
+PFS_engine_table_share_state
+table_metadata_locks::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_metadata_locks::m_share=
{
@@ -59,7 +64,9 @@ table_metadata_locks::m_share=
"SOURCE VARCHAR(64) comment 'Source file containing the instrumented code that produced the event, as well as the line number where the instrumentation occurred. This allows one to examine the source code involved.',"
"OWNER_THREAD_ID BIGINT unsigned comment 'Thread that requested the lock.',"
"OWNER_EVENT_ID BIGINT unsigned comment 'Event that requested the lock.')")},
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_metadata_locks::create(void)
diff --git a/storage/perfschema/table_md_locks.h b/storage/perfschema/table_md_locks.h
index c6a4a2eca8d..ddb133ea7ff 100644
--- a/storage/perfschema/table_md_locks.h
+++ b/storage/perfschema/table_md_locks.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2012, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -63,6 +63,7 @@ struct row_metadata_lock
class table_metadata_locks : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share. */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_mems_by_account_by_event_name.cc b/storage/perfschema/table_mems_by_account_by_event_name.cc
index c4217641f6a..ec074872733 100644
--- a/storage/perfschema/table_mems_by_account_by_event_name.cc
+++ b/storage/perfschema/table_mems_by_account_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -39,6 +39,11 @@
THR_LOCK table_mems_by_account_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_mems_by_account_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_mems_by_account_by_event_name::m_share=
{
@@ -64,7 +69,9 @@ table_mems_by_account_by_event_name::m_share=
"LOW_NUMBER_OF_BYTES_USED BIGINT not null comment 'Lowest number of bytes used.',"
"CURRENT_NUMBER_OF_BYTES_USED BIGINT not null comment 'Current number of bytes used (total allocated minus total freed).',"
"HIGH_NUMBER_OF_BYTES_USED BIGINT not null comment 'Highest number of bytes used.')")},
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_mems_by_account_by_event_name::create(void)
diff --git a/storage/perfschema/table_mems_by_account_by_event_name.h b/storage/perfschema/table_mems_by_account_by_event_name.h
index 9d43c4cf404..626190461d5 100644
--- a/storage/perfschema/table_mems_by_account_by_event_name.h
+++ b/storage/perfschema/table_mems_by_account_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -85,6 +85,7 @@ struct pos_mems_by_account_by_event_name
class table_mems_by_account_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_mems_by_host_by_event_name.cc b/storage/perfschema/table_mems_by_host_by_event_name.cc
index b86fe70da28..d08444c311d 100644
--- a/storage/perfschema/table_mems_by_host_by_event_name.cc
+++ b/storage/perfschema/table_mems_by_host_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -39,6 +39,11 @@
THR_LOCK table_mems_by_host_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_mems_by_host_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_mems_by_host_by_event_name::m_share=
{
@@ -63,7 +68,9 @@ table_mems_by_host_by_event_name::m_share=
"LOW_NUMBER_OF_BYTES_USED BIGINT not null comment 'Lowest number of bytes used.',"
"CURRENT_NUMBER_OF_BYTES_USED BIGINT not null comment 'Current number of bytes used (total allocated minus total freed).',"
"HIGH_NUMBER_OF_BYTES_USED BIGINT not null comment 'Highest number of bytes used.')")},
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_mems_by_host_by_event_name::create(void)
diff --git a/storage/perfschema/table_mems_by_host_by_event_name.h b/storage/perfschema/table_mems_by_host_by_event_name.h
index a4fdde24fbd..f46f3c889e0 100644
--- a/storage/perfschema/table_mems_by_host_by_event_name.h
+++ b/storage/perfschema/table_mems_by_host_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -85,6 +85,7 @@ struct pos_mems_by_host_by_event_name
class table_mems_by_host_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_mems_by_thread_by_event_name.cc b/storage/perfschema/table_mems_by_thread_by_event_name.cc
index 8c79f8cc8d8..eb76a016030 100644
--- a/storage/perfschema/table_mems_by_thread_by_event_name.cc
+++ b/storage/perfschema/table_mems_by_thread_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -39,6 +39,11 @@
THR_LOCK table_mems_by_thread_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_mems_by_thread_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_mems_by_thread_by_event_name::m_share=
{
@@ -63,7 +68,9 @@ table_mems_by_thread_by_event_name::m_share=
"LOW_NUMBER_OF_BYTES_USED BIGINT not null comment 'Lowest number of bytes used.',"
"CURRENT_NUMBER_OF_BYTES_USED BIGINT not null comment 'Current number of bytes used (total allocated minus total freed).',"
"HIGH_NUMBER_OF_BYTES_USED BIGINT not null comment 'Highest number of bytes used.')")},
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_mems_by_thread_by_event_name::create(void)
diff --git a/storage/perfschema/table_mems_by_thread_by_event_name.h b/storage/perfschema/table_mems_by_thread_by_event_name.h
index b89172669e6..17196e0fd80 100644
--- a/storage/perfschema/table_mems_by_thread_by_event_name.h
+++ b/storage/perfschema/table_mems_by_thread_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -85,6 +85,7 @@ struct pos_mems_by_thread_by_event_name
class table_mems_by_thread_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_mems_by_user_by_event_name.cc b/storage/perfschema/table_mems_by_user_by_event_name.cc
index 4bae383166a..708c5681c3c 100644
--- a/storage/perfschema/table_mems_by_user_by_event_name.cc
+++ b/storage/perfschema/table_mems_by_user_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -39,6 +39,11 @@
THR_LOCK table_mems_by_user_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_mems_by_user_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_mems_by_user_by_event_name::m_share=
{
@@ -63,7 +68,9 @@ table_mems_by_user_by_event_name::m_share=
"LOW_NUMBER_OF_BYTES_USED BIGINT not null comment 'Lowest number of bytes used.',"
"CURRENT_NUMBER_OF_BYTES_USED BIGINT not null comment 'Current number of bytes used (total allocated minus total freed).',"
"HIGH_NUMBER_OF_BYTES_USED BIGINT not null comment 'Highest number of bytes used.')")},
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_mems_by_user_by_event_name::create(void)
diff --git a/storage/perfschema/table_mems_by_user_by_event_name.h b/storage/perfschema/table_mems_by_user_by_event_name.h
index 34c4cd518ae..c2ad8bd7462 100644
--- a/storage/perfschema/table_mems_by_user_by_event_name.h
+++ b/storage/perfschema/table_mems_by_user_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -85,6 +85,7 @@ struct pos_mems_by_user_by_event_name
class table_mems_by_user_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_mems_global_by_event_name.cc b/storage/perfschema/table_mems_global_by_event_name.cc
index e4b681072c8..c84fa1a1529 100644
--- a/storage/perfschema/table_mems_global_by_event_name.cc
+++ b/storage/perfschema/table_mems_global_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -39,6 +39,11 @@
THR_LOCK table_mems_global_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_mems_global_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_mems_global_by_event_name::m_share=
{
@@ -62,7 +67,9 @@ table_mems_global_by_event_name::m_share=
"LOW_NUMBER_OF_BYTES_USED BIGINT not null comment 'Lowest number of bytes used.',"
"CURRENT_NUMBER_OF_BYTES_USED BIGINT not null comment 'Current number of bytes used (total allocated minus total freed).',"
"HIGH_NUMBER_OF_BYTES_USED BIGINT not null comment 'Highest number of bytes used.')")},
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_mems_global_by_event_name::create(void)
diff --git a/storage/perfschema/table_mems_global_by_event_name.h b/storage/perfschema/table_mems_global_by_event_name.h
index 46dbccbd414..eaff095f8d7 100644
--- a/storage/perfschema/table_mems_global_by_event_name.h
+++ b/storage/perfschema/table_mems_global_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -87,6 +87,7 @@ class table_mems_global_by_event_name : public PFS_engine_table
typedef pos_mems_global_by_event_name pos_t;
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_os_global_by_type.cc b/storage/perfschema/table_os_global_by_type.cc
index b82ce9c2a7d..ac1c123e5f4 100644
--- a/storage/perfschema/table_os_global_by_type.cc
+++ b/storage/perfschema/table_os_global_by_type.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -37,6 +37,11 @@
THR_LOCK table_os_global_by_type::m_table_lock;
+PFS_engine_table_share_state
+table_os_global_by_type::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_os_global_by_type::m_share=
{
@@ -57,7 +62,9 @@ table_os_global_by_type::m_share=
"MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the summarized events that are timed.',"
"AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the summarized events that are timed.',"
"MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the summarized events that are timed.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_os_global_by_type.h b/storage/perfschema/table_os_global_by_type.h
index 9cb3b47b964..8009d2125b3 100644
--- a/storage/perfschema/table_os_global_by_type.h
+++ b/storage/perfschema/table_os_global_by_type.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -86,6 +86,7 @@ struct pos_os_global_by_type : public PFS_double_index,
class table_os_global_by_type : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_performance_timers.cc b/storage/perfschema/table_performance_timers.cc
index 68878919e2b..c89ad8d9021 100644
--- a/storage/perfschema/table_performance_timers.cc
+++ b/storage/perfschema/table_performance_timers.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -34,6 +34,11 @@
THR_LOCK table_performance_timers::m_table_lock;
+PFS_engine_table_share_state
+table_performance_timers::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_performance_timers::m_share=
{
@@ -50,7 +55,9 @@ table_performance_timers::m_share=
"TIMER_FREQUENCY BIGINT comment 'Number of timer units per second. Dependent on the processor speed.',"
"TIMER_RESOLUTION BIGINT comment 'Number of timer units by which timed values increase each time.',"
"TIMER_OVERHEAD BIGINT comment 'Minimum timer overhead, determined during initialization by calling the timer 20 times and selecting the smallest value. Total overhead will be at least double this, as the timer is called at the beginning and end of each timed event.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_performance_timers::create(void)
diff --git a/storage/perfschema/table_performance_timers.h b/storage/perfschema/table_performance_timers.h
index a2e12a4f824..5479c6f577d 100644
--- a/storage/perfschema/table_performance_timers.h
+++ b/storage/perfschema/table_performance_timers.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -53,6 +53,7 @@ struct row_performance_timers
class table_performance_timers : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share. */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_prepared_stmt_instances.cc b/storage/perfschema/table_prepared_stmt_instances.cc
index 592386db4bb..8ff699eb03c 100644
--- a/storage/perfschema/table_prepared_stmt_instances.cc
+++ b/storage/perfschema/table_prepared_stmt_instances.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2014, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -41,6 +41,11 @@
THR_LOCK table_prepared_stmt_instances::m_table_lock;
+PFS_engine_table_share_state
+table_prepared_stmt_instances::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_prepared_stmt_instances::m_share=
{
@@ -88,7 +93,9 @@ table_prepared_stmt_instances::m_share=
"SUM_SORT_SCAN bigint(20) unsigned NOT NULL comment 'The total number of sorts that were done by scanning the table by the prepared statements.',"
"SUM_NO_INDEX_USED bigint(20) unsigned NOT NULL comment 'The total number of statements that performed a table scan without using an index.',"
"SUM_NO_GOOD_INDEX_USED bigint(20) unsigned NOT NULL comment 'The total number of statements where no good index was found.')")},
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_prepared_stmt_instances.h b/storage/perfschema/table_prepared_stmt_instances.h
index a061e0d9883..e7afe5d48b0 100644
--- a/storage/perfschema/table_prepared_stmt_instances.h
+++ b/storage/perfschema/table_prepared_stmt_instances.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2014, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -87,6 +87,7 @@ struct row_prepared_stmt_instances
class table_prepared_stmt_instances : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_processlist.cc b/storage/perfschema/table_processlist.cc
new file mode 100644
index 00000000000..25d9ca7129c
--- /dev/null
+++ b/storage/perfschema/table_processlist.cc
@@ -0,0 +1,360 @@
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License, version 2.0, for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
+/**
+ @file storage/perfschema/table_processlist.cc
+ TABLE PROCESSLIST.
+*/
+
+#include "my_global.h"
+
+#include "table_processlist.h"
+
+#include <assert.h>
+// #include "lex_string.h"
+#include "my_compiler.h"
+
+#include "my_thread.h"
+//#include "auth_acls.h"
+#include "sql_acl.h"
+#include "field.h"
+#include "sql_class.h"
+#include "sql_parse.h"
+#include "table.h"
+#include "pfs_buffer_container.h"
+#include "pfs_global.h"
+#include "pfs_instr.h"
+#include "pfs_instr_class.h"
+
+THR_LOCK table_processlist::m_table_lock;
+
+PFS_engine_table_share_state
+table_processlist::m_share_state = {
+ false /* m_checked */
+};
+
+PFS_engine_table_share table_processlist::m_share = {
+ {C_STRING_WITH_LEN("processlist")},
+ &pfs_readonly_processlist_acl,
+ table_processlist::create,
+ NULL, /* write_row */
+ NULL, /* delete_all_rows */
+ cursor_by_thread::get_row_count,
+ sizeof(PFS_simple_index), /* ref length */
+ &m_table_lock,
+ &m_field_def,
+ false, /* m_perpetual */
+ true, /* m_optional */
+ &m_share_state
+};
+
+PFS_engine_table *table_processlist::create() {
+ return new table_processlist();
+}
+
+table_processlist::table_processlist()
+ : cursor_by_thread(&m_share), m_row_exists(false) {
+ m_row_priv.m_auth = PROCESSLIST_DENIED;
+}
+
+int table_processlist::set_access(void) {
+ THD *thd = current_thd;
+ if (thd == NULL) {
+ /* Robustness, no user session. */
+ m_row_priv.m_auth = PROCESSLIST_DENIED;
+ return 0;
+ }
+
+ if (thd->security_context()->check_access(PROCESS_ACL)) {
+ /* PROCESS_ACL granted. */
+ m_row_priv.m_auth = PROCESSLIST_ALL;
+ return 0;
+ }
+
+ LEX_CSTRING client_priv_user = thd->security_context()->priv_user();
+ if (client_priv_user.length == 0) {
+ /* Anonymous user. */
+ m_row_priv.m_auth = PROCESSLIST_DENIED;
+ return 0;
+ }
+
+ /* Authenticated user, PROCESS_ACL not granted. */
+ m_row_priv.m_auth = PROCESSLIST_USER_ONLY;
+ m_row_priv.m_priv_user_length =
+ std::min(client_priv_user.length, sizeof(m_row_priv.m_priv_user));
+ memcpy(m_row_priv.m_priv_user, client_priv_user.str,
+ m_row_priv.m_priv_user_length);
+ return 0;
+}
+
+int table_processlist::rnd_init(bool scan) {
+ set_access();
+ return 0;
+}
+
+void table_processlist::make_row(PFS_thread *pfs) {
+ pfs_optimistic_state lock;
+ pfs_optimistic_state session_lock;
+ pfs_optimistic_state stmt_lock;
+ PFS_stage_class *stage_class;
+ PFS_thread_class *safe_class;
+
+ m_row_exists = false;
+
+ if (m_row_priv.m_auth == PROCESSLIST_DENIED) {
+ return;
+ }
+
+ /* Protect this reader against thread termination */
+ pfs->m_lock.begin_optimistic_lock(&lock);
+
+ safe_class = sanitize_thread_class(pfs->m_class);
+ if (unlikely(safe_class == NULL)) {
+ return;
+ }
+
+ /* Ignore background threads. */
+ if (pfs->m_username_length == 0 || pfs->m_processlist_id == 0) return;
+
+ m_row.m_processlist_id = pfs->m_processlist_id;
+
+ /* Protect this reader against session attribute changes */
+ pfs->m_session_lock.begin_optimistic_lock(&session_lock);
+
+ /* Maintain user/host compatibility with the legacy SHOW PROCESSLIST. */
+ const char *username = pfs->m_username;
+ uint username_len = pfs->m_username_length;
+ uint hostname_len = pfs->m_hostname_length;
+
+ if (pfs->m_class->is_system_thread()) {
+ if (username_len == 0 ||
+ (!strncmp(username, "root", 4) && username_len == 4)) {
+ username = "system user";
+ username_len = strlen(username);
+ hostname_len = 0;
+ }
+ } else {
+ if (username_len == 0) {
+ username = "unauthenticated user";
+ username_len = strlen(username);
+ hostname_len = 0;
+ }
+ }
+
+ m_row.m_username_length = username_len;
+ if (unlikely(m_row.m_username_length > sizeof(m_row.m_username))) {
+ return;
+ }
+
+ if (m_row.m_username_length != 0) {
+ memcpy(m_row.m_username, username, username_len);
+ }
+
+ m_row.m_hostname_length = hostname_len;
+ if (unlikely(m_row.m_hostname_length > sizeof(m_row.m_hostname))) {
+ return;
+ }
+
+ if (m_row.m_hostname_length != 0) {
+ memcpy(m_row.m_hostname, pfs->m_hostname, m_row.m_hostname_length);
+ }
+
+ if (!pfs->m_session_lock.end_optimistic_lock(&session_lock)) {
+ /*
+ One of the columns:
+ - USER
+ - HOST
+ is being updated.
+ Do not discard the entire row.
+ Do not loop waiting for a stable value.
+ Just return NULL values.
+ */
+ m_row.m_username_length = 0;
+ m_row.m_hostname_length = 0;
+ }
+
+ /* Enforce row filtering. */
+ if (m_row_priv.m_auth == PROCESSLIST_USER_ONLY) {
+ if (m_row.m_username_length != m_row_priv.m_priv_user_length) {
+ return;
+ }
+ if (strncmp(m_row.m_username, m_row_priv.m_priv_user,
+ m_row_priv.m_priv_user_length) != 0) {
+ return;
+ }
+ }
+
+ /* Protect this reader against statement attributes changes */
+ pfs->m_stmt_lock.begin_optimistic_lock(&stmt_lock);
+
+ m_row.m_dbname_length = pfs->m_dbname_length;
+ if (unlikely(m_row.m_dbname_length > sizeof(m_row.m_dbname))) {
+ return;
+ }
+
+ if (m_row.m_dbname_length != 0) {
+ memcpy(m_row.m_dbname, pfs->m_dbname, m_row.m_dbname_length);
+ }
+
+ m_row.m_processlist_info_ptr = &pfs->m_processlist_info[0];
+ m_row.m_processlist_info_length = pfs->m_processlist_info_length;
+
+ if (!pfs->m_stmt_lock.end_optimistic_lock(&stmt_lock)) {
+ /*
+ One of the columns:
+ - DB
+ - INFO
+ is being updated.
+ Do not discard the entire row.
+ Do not loop waiting for a stable value.
+ Just return NULL values.
+ */
+ m_row.m_dbname_length = 0;
+ m_row.m_processlist_info_length = 0;
+ }
+
+ /* Dirty read, sanitize the command. */
+ m_row.m_command = pfs->m_command;
+ if ((m_row.m_command < 0) || (m_row.m_command > COM_END)) {
+ m_row.m_command = COM_END;
+ }
+
+ m_row.m_start_time = pfs->m_start_time;
+
+ stage_class = find_stage_class(pfs->m_stage);
+ if (stage_class != NULL) {
+ m_row.m_processlist_state_ptr =
+ stage_class->m_name + stage_class->m_prefix_length;
+ m_row.m_processlist_state_length =
+ stage_class->m_name_length - stage_class->m_prefix_length;
+ if (m_row.m_processlist_state_length > 64) {
+ /*
+ Column STATE is VARCHAR(64)
+ for compatibility reasons with the historical
+ INFORMATION_SCHEMA.PROCESSLIST table.
+ Stages however can have longer names.
+ We silently truncate data here,
+ so it fits into STATE.
+ */
+ m_row.m_processlist_state_length = 64;
+ }
+ } else {
+ m_row.m_processlist_state_ptr = "";
+ m_row.m_processlist_state_length = 0;
+ }
+
+ m_row.m_port = pfs->m_peer_port;
+
+ if (m_row.m_hostname_length > 0 && m_row.m_port != 0) {
+ /* Create HOST:PORT. */
+ char str_port[10];
+ sprintf(str_port, ":%d", m_row.m_port);
+ std::string host(m_row.m_hostname, m_row.m_hostname_length);
+ std::string host_ip = host + str_port;
+ m_row.m_hostname_length =
+ std::min((int)HOST_AND_PORT_LENGTH, (int)host_ip.length());
+ memcpy(m_row.m_hostname, host_ip.c_str(), m_row.m_hostname_length);
+ }
+
+ if (!pfs->m_lock.end_optimistic_lock(&lock)) {
+ return;
+ }
+
+ m_row_exists = true;
+ return;
+}
+
+int table_processlist::read_row_values(TABLE *table, unsigned char *buf,
+ Field **fields, bool read_all) {
+ Field *f;
+
+ if (unlikely(!m_row_exists)) {
+ return HA_ERR_RECORD_DELETED;
+ }
+
+ /* Set the null bits */
+ assert(table->s->null_bytes == 1);
+ buf[0] = 0;
+
+ for (; (f = *fields); fields++) {
+ if (read_all || bitmap_is_set(table->read_set, f->field_index)) {
+ switch (f->field_index) {
+ case 0: /* ID */
+ set_field_ulonglong(f, m_row.m_processlist_id);
+ break;
+ case 1: /* USER */
+ if (m_row.m_username_length > 0) {
+ set_field_varchar_utf8(f, m_row.m_username,
+ m_row.m_username_length);
+ } else {
+ f->set_null();
+ }
+ break;
+ case 2: /* HOST */
+ if (m_row.m_hostname_length > 0) {
+ set_field_varchar_utf8(f, m_row.m_hostname,
+ m_row.m_hostname_length);
+ } else {
+ f->set_null();
+ }
+ break;
+ case 3: /* DB */
+ if (m_row.m_dbname_length > 0) {
+ set_field_varchar_utf8(f, m_row.m_dbname, m_row.m_dbname_length);
+ } else {
+ f->set_null();
+ }
+ break;
+ case 4: /* COMMAND */
+ set_field_varchar_utf8(f, command_name[m_row.m_command].str,
+ command_name[m_row.m_command].length);
+ break;
+ case 5: /* TIME */
+ if (m_row.m_start_time) {
+ time_t now = my_time(0);
+ ulonglong elapsed =
+ (now > m_row.m_start_time ? now - m_row.m_start_time : 0);
+ set_field_ulonglong(f, elapsed);
+ } else {
+ f->set_null();
+ }
+ break;
+ case 6: /* STATE */
+ /* For compatibility, leave blank if state is NULL. */
+ set_field_varchar_utf8(f, m_row.m_processlist_state_ptr,
+ m_row.m_processlist_state_length);
+ break;
+ case 7: /* INFO */
+ if (m_row.m_processlist_info_length > 0)
+ set_field_blob(f, m_row.m_processlist_info_ptr,
+ m_row.m_processlist_info_length);
+ else {
+ f->set_null();
+ }
+ break;
+ default:
+ assert(false);
+ }
+ }
+ }
+ return 0;
+}
diff --git a/storage/perfschema/table_processlist.h b/storage/perfschema/table_processlist.h
new file mode 100644
index 00000000000..0944b5619fe
--- /dev/null
+++ b/storage/perfschema/table_processlist.h
@@ -0,0 +1,133 @@
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License, version 2.0, for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
+#ifndef TABLE_PROCESSLIST_H
+#define TABLE_PROCESSLIST_H
+
+/**
+ @file storage/perfschema/table_processlist.h
+ TABLE THREADS.
+*/
+
+#include <sys/types.h>
+#include <time.h>
+#include <algorithm>
+
+// #include "my_hostname.h"
+// #include "my_inttypes.h"
+#include "cursor_by_thread.h"
+#include "pfs_column_types.h"
+
+struct PFS_thread;
+
+/**
+ @addtogroup performance_schema_tables
+ @{
+*/
+
+/**
+ A row of PERFORMANCE_SCHEMA.PROCESSLIST.
+*/
+struct row_processlist {
+ /** Column ID. */
+ ulonglong m_processlist_id;
+ /** Column USER. */
+ char m_username[USERNAME_LENGTH];
+ /** Length in bytes of @c m_username. */
+ uint m_username_length;
+ /** Column HOST. */
+ char m_hostname[HOST_AND_PORT_LENGTH];
+ /** Length in bytes of @c m_hostname. */
+ uint m_hostname_length;
+ /** Port. */
+ uint m_port;
+ /** Column DB. */
+ char m_dbname[NAME_LEN];
+ /** Length in bytes of @c m_dbname. */
+ uint m_dbname_length;
+ /** Column COMMAND. */
+ int m_command;
+ /** Column TIME. */
+ time_t m_start_time;
+ /** Column STATE. */
+ const char *m_processlist_state_ptr;
+ /** Length in bytes of @c m_processlist_state_ptr. */
+ uint m_processlist_state_length;
+ /** Column INFO. */
+ const char *m_processlist_info_ptr;
+ /** Length in bytes of @c m_processlist_info_ptr. */
+ uint m_processlist_info_length;
+};
+
+enum enum_priv_processlist {
+ /** User is not allowed to see any data. */
+ PROCESSLIST_DENIED,
+ /** User does not have the PROCESS_ACL priviledge. */
+ PROCESSLIST_USER_ONLY,
+ /** User has the PROCESS_ACL priviledge. */
+ PROCESSLIST_ALL
+};
+
+struct row_priv_processlist {
+ enum enum_priv_processlist m_auth;
+ char m_priv_user[USERNAME_LENGTH];
+ size_t m_priv_user_length;
+};
+
+/** Table PERFORMANCE_SCHEMA.PROCESSLIST. */
+class table_processlist : public cursor_by_thread {
+ public:
+ static PFS_engine_table_share_state m_share_state;
+ /** Table share */
+ static PFS_engine_table_share m_share;
+ /** Table builder */
+ static PFS_engine_table *create();
+
+ protected:
+ table_processlist();
+
+ virtual int rnd_init(bool scan);
+
+ virtual int read_row_values(TABLE *table, unsigned char *buf, Field **fields,
+ bool read_all);
+ int set_access(void);
+
+ public:
+ virtual ~table_processlist() {}
+
+ private:
+ virtual void make_row(PFS_thread *pfs);
+ /** Table share lock. */
+ static THR_LOCK m_table_lock;
+ /** Fields definition. */
+ static TABLE_FIELD_DEF m_field_def;
+
+ /** Current row. */
+ row_processlist m_row;
+ /** Row privileges. */
+ row_priv_processlist m_row_priv;
+ /** True if the current row exists. */
+ bool m_row_exists;
+};
+
+/** @} */
+#endif
diff --git a/storage/perfschema/table_replication_applier_configuration.cc b/storage/perfschema/table_replication_applier_configuration.cc
index 809dfead9a2..46f35ce7a6a 100644
--- a/storage/perfschema/table_replication_applier_configuration.cc
+++ b/storage/perfschema/table_replication_applier_configuration.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -42,6 +42,11 @@
#ifdef HAVE_REPLICATION
THR_LOCK table_replication_applier_configuration::m_table_lock;
+PFS_engine_table_share_state
+table_replication_applier_configuration::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_replication_applier_configuration::m_share=
{
@@ -56,7 +61,9 @@ table_replication_applier_configuration::m_share=
{ C_STRING_WITH_LEN("CREATE TABLE replication_applier_configuration("
"CHANNEL_NAME CHAR(64) collate utf8_general_ci not null comment 'Replication channel name.',"
"DESIRED_DELAY INTEGER not null comment 'Desired replica delay functionality not supported by MariaDB. Always 0.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_replication_applier_configuration::create(void)
diff --git a/storage/perfschema/table_replication_applier_configuration.h b/storage/perfschema/table_replication_applier_configuration.h
index 7baa9a6d990..bfe3982463c 100644
--- a/storage/perfschema/table_replication_applier_configuration.h
+++ b/storage/perfschema/table_replication_applier_configuration.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -93,6 +93,7 @@ protected:
public:
~table_replication_applier_configuration();
+ static PFS_engine_table_share_state m_share_state;
/** Table share. */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_replication_applier_status.cc b/storage/perfschema/table_replication_applier_status.cc
index ebe922902e7..e17a1153a7e 100644
--- a/storage/perfschema/table_replication_applier_status.cc
+++ b/storage/perfschema/table_replication_applier_status.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -43,6 +43,11 @@
THR_LOCK table_replication_applier_status::m_table_lock;
+PFS_engine_table_share_state
+table_replication_applier_status::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_replication_applier_status::m_share=
{
@@ -59,7 +64,9 @@ table_replication_applier_status::m_share=
"SERVICE_STATE ENUM('ON','OFF') not null comment 'Shows ON when the replication channel''s applier threads are active or idle, OFF means that the applier threads are not active.',"
"REMAINING_DELAY INTEGER unsigned comment 'Desired replica delay functionality not supported by MariaDB. Always 0.',"
"COUNT_TRANSACTIONS_RETRIES BIGINT unsigned not null comment 'The number of retries that were made because the replication SQL thread failed to apply a transaction.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
diff --git a/storage/perfschema/table_replication_applier_status.h b/storage/perfschema/table_replication_applier_status.h
index 6278186bd53..5261917c307 100644
--- a/storage/perfschema/table_replication_applier_status.h
+++ b/storage/perfschema/table_replication_applier_status.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -104,6 +104,7 @@ protected:
public:
~table_replication_applier_status();
+ static PFS_engine_table_share_state m_share_state;
/** Table share. */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_replication_applier_status_by_coordinator.cc b/storage/perfschema/table_replication_applier_status_by_coordinator.cc
index 906b69540a8..c9fef5a3d7a 100644
--- a/storage/perfschema/table_replication_applier_status_by_coordinator.cc
+++ b/storage/perfschema/table_replication_applier_status_by_coordinator.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -43,6 +43,11 @@
THR_LOCK table_replication_applier_status_by_coordinator::m_table_lock;
+PFS_engine_table_share_state
+table_replication_applier_status_by_coordinator::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_replication_applier_status_by_coordinator::m_share=
{
@@ -61,7 +66,9 @@ table_replication_applier_status_by_coordinator::m_share=
"LAST_ERROR_NUMBER INTEGER not null comment 'Last error number that caused the SQL/coordinator thread to stop.',"
"LAST_ERROR_MESSAGE VARCHAR(1024) not null comment 'Last error message that caused the SQL/coordinator thread to stop.',"
"LAST_ERROR_TIMESTAMP TIMESTAMP(0) not null comment 'Timestamp that shows when the most recent SQL/coordinator error occured.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_replication_applier_status_by_coordinator::create(void)
diff --git a/storage/perfschema/table_replication_applier_status_by_coordinator.h b/storage/perfschema/table_replication_applier_status_by_coordinator.h
index 36427e83e66..32e33c797e9 100644
--- a/storage/perfschema/table_replication_applier_status_by_coordinator.h
+++ b/storage/perfschema/table_replication_applier_status_by_coordinator.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -110,6 +110,7 @@ protected:
public:
~table_replication_applier_status_by_coordinator();
+ static PFS_engine_table_share_state m_share_state;
/** Table share. */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_replication_applier_status_by_worker.cc b/storage/perfschema/table_replication_applier_status_by_worker.cc
index 74db4ee658c..08bc01f2ea9 100644
--- a/storage/perfschema/table_replication_applier_status_by_worker.cc
+++ b/storage/perfschema/table_replication_applier_status_by_worker.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -42,6 +42,11 @@
THR_LOCK table_replication_applier_status_by_worker::m_table_lock;
+PFS_engine_table_share_state
+table_replication_applier_status_by_worker::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_replication_applier_status_by_worker::m_share=
{
@@ -62,7 +67,8 @@ table_replication_applier_status_by_worker::m_share=
"LAST_ERROR_NUMBER INTEGER not null comment 'Last Error that occurred on a particular worker.',"
"LAST_ERROR_MESSAGE VARCHAR(1024) not null comment 'Last error specific message.',"
"LAST_ERROR_TIMESTAMP TIMESTAMP(0) not null comment 'Time stamp of last error.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ &m_share_state
};
PFS_engine_table* table_replication_applier_status_by_worker::create(void)
diff --git a/storage/perfschema/table_replication_applier_status_by_worker.h b/storage/perfschema/table_replication_applier_status_by_worker.h
index 3298d953158..3bd42634793 100644
--- a/storage/perfschema/table_replication_applier_status_by_worker.h
+++ b/storage/perfschema/table_replication_applier_status_by_worker.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -168,6 +168,7 @@ protected:
public:
~table_replication_applier_status_by_worker();
+ static PFS_engine_table_share_state m_share_state;
/** Table share. */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_replication_connection_configuration.cc b/storage/perfschema/table_replication_connection_configuration.cc
index 6af8641c7a7..7233557a881 100644
--- a/storage/perfschema/table_replication_connection_configuration.cc
+++ b/storage/perfschema/table_replication_connection_configuration.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -42,6 +42,11 @@
#ifdef HAVE_REPLICATION
THR_LOCK table_replication_connection_configuration::m_table_lock;
+PFS_engine_table_share_state
+table_replication_connection_configuration::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_replication_connection_configuration::m_share=
{
@@ -73,7 +78,9 @@ table_replication_connection_configuration::m_share=
"CONNECTION_RETRY_COUNT BIGINT unsigned not null comment 'The number of times the replica can attempt to reconnect to the source in the event of a lost connection.',"
"HEARTBEAT_INTERVAL DOUBLE(10,3) unsigned not null COMMENT 'Number of seconds after which a heartbeat will be sent.',"
"TLS_VERSION VARCHAR(255) not null comment 'Not implemented, always blank.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
diff --git a/storage/perfschema/table_replication_connection_configuration.h b/storage/perfschema/table_replication_connection_configuration.h
index 4eb4726f7a6..ba737c8386e 100644
--- a/storage/perfschema/table_replication_connection_configuration.h
+++ b/storage/perfschema/table_replication_connection_configuration.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -138,6 +138,7 @@ protected:
public:
~table_replication_connection_configuration();
+ static PFS_engine_table_share_state m_share_state;
/** Table share. */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_replication_connection_status.cc b/storage/perfschema/table_replication_connection_status.cc
index fd0b5309f7e..71c02e314ed 100644
--- a/storage/perfschema/table_replication_connection_status.cc
+++ b/storage/perfschema/table_replication_connection_status.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -149,6 +149,11 @@ static const TABLE_FIELD_TYPE field_types[]=
TABLE_FIELD_DEF
table_replication_connection_status::m_field_def= { 11, field_types };
+PFS_engine_table_share_state
+table_replication_connection_status::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_replication_connection_status::m_share=
{
@@ -161,8 +166,9 @@ table_replication_connection_status::m_share=
sizeof(pos_t), /* ref length */
&m_table_lock,
&m_field_def,
- false, /* checked */
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_replication_connection_status::create(void)
diff --git a/storage/perfschema/table_replication_connection_status.h b/storage/perfschema/table_replication_connection_status.h
index 596a4e9ed49..a40ae408dea 100644
--- a/storage/perfschema/table_replication_connection_status.h
+++ b/storage/perfschema/table_replication_connection_status.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -136,6 +136,7 @@ protected:
public:
~table_replication_connection_status();
+ static PFS_engine_table_share_state m_share_state;
/** Table share. */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_replication_group_member_stats.cc b/storage/perfschema/table_replication_group_member_stats.cc
index 7d15e383d70..e4a38bac44f 100644
--- a/storage/perfschema/table_replication_group_member_stats.cc
+++ b/storage/perfschema/table_replication_group_member_stats.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2014, 2021, Oracle and/or its affiliates.
+ Copyright (c) 2014, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -188,6 +188,11 @@ TABLE_FIELD_DEF
table_replication_group_member_stats::m_field_def=
{ 9, field_types };
+PFS_engine_table_share_state
+table_replication_group_member_stats::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_replication_group_member_stats::m_share=
{
@@ -200,8 +205,9 @@ table_replication_group_member_stats::m_share=
sizeof(PFS_simple_index), /* ref length */
&m_table_lock,
&m_field_def,
- false, /* checked */
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_replication_group_member_stats::create(void)
diff --git a/storage/perfschema/table_replication_group_member_stats.h b/storage/perfschema/table_replication_group_member_stats.h
index 67a05cb8e53..628e87e891d 100644
--- a/storage/perfschema/table_replication_group_member_stats.h
+++ b/storage/perfschema/table_replication_group_member_stats.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2014, 2021, Oracle and/or its affiliates.
+ Copyright (c) 2014, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -101,6 +101,7 @@ protected:
public:
~table_replication_group_member_stats();
+ static PFS_engine_table_share_state m_share_state;
/** Table share. */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_replication_group_members.cc b/storage/perfschema/table_replication_group_members.cc
index 2a870e58ce3..850191373b0 100644
--- a/storage/perfschema/table_replication_group_members.cc
+++ b/storage/perfschema/table_replication_group_members.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -130,6 +130,11 @@ TABLE_FIELD_DEF
table_replication_group_members::m_field_def=
{ 5, field_types };
+PFS_engine_table_share_state
+table_replication_group_members::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_replication_group_members::m_share=
{
@@ -142,8 +147,9 @@ table_replication_group_members::m_share=
sizeof(PFS_simple_index), /* ref length */
&m_table_lock,
&m_field_def,
- false, /* checked */
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_replication_group_members::create(void)
diff --git a/storage/perfschema/table_replication_group_members.h b/storage/perfschema/table_replication_group_members.h
index 2df013fa35b..454f58de048 100644
--- a/storage/perfschema/table_replication_group_members.h
+++ b/storage/perfschema/table_replication_group_members.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -94,6 +94,7 @@ protected:
public:
~table_replication_group_members();
+ static PFS_engine_table_share_state m_share_state;
/** Table share. */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_session_account_connect_attrs.cc b/storage/perfschema/table_session_account_connect_attrs.cc
index 563ce03d638..075d66dd5cb 100644
--- a/storage/perfschema/table_session_account_connect_attrs.cc
+++ b/storage/perfschema/table_session_account_connect_attrs.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -25,6 +25,11 @@
THR_LOCK table_session_account_connect_attrs::m_table_lock;
+PFS_engine_table_share_state
+table_session_account_connect_attrs::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_session_account_connect_attrs::m_share=
{
@@ -42,7 +47,9 @@ table_session_account_connect_attrs::m_share=
"ATTR_VALUE VARCHAR(1024) comment 'Attribute value.',"
"ORDINAL_POSITION INT comment 'Order in which attribute was added to the connection attributes.'"
") CHARACTER SET utf8 COLLATE utf8_bin") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_session_account_connect_attrs::create()
diff --git a/storage/perfschema/table_session_account_connect_attrs.h b/storage/perfschema/table_session_account_connect_attrs.h
index dec5295808d..ea8d26b719b 100644
--- a/storage/perfschema/table_session_account_connect_attrs.h
+++ b/storage/perfschema/table_session_account_connect_attrs.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2012, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -33,6 +33,7 @@
class table_session_account_connect_attrs : public table_session_connect
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
/** Table builder */
diff --git a/storage/perfschema/table_session_connect.cc b/storage/perfschema/table_session_connect.cc
index dfb203c5d46..9d9b1eafc13 100644
--- a/storage/perfschema/table_session_connect.cc
+++ b/storage/perfschema/table_session_connect.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_session_connect.h b/storage/perfschema/table_session_connect.h
index b9be1ce304c..89ae4f221d3 100644
--- a/storage/perfschema/table_session_connect.h
+++ b/storage/perfschema/table_session_connect.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2012, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_session_connect_attrs.cc b/storage/perfschema/table_session_connect_attrs.cc
index 034ff12c91e..5983f3f18a2 100644
--- a/storage/perfschema/table_session_connect_attrs.cc
+++ b/storage/perfschema/table_session_connect_attrs.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -25,6 +25,11 @@
THR_LOCK table_session_connect_attrs::m_table_lock;
+PFS_engine_table_share_state
+table_session_connect_attrs::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_session_connect_attrs::m_share=
{
@@ -42,7 +47,9 @@ table_session_connect_attrs::m_share=
"ATTR_VALUE VARCHAR(1024) comment 'Attribute value.',"
"ORDINAL_POSITION INT comment 'Order in which attribute was added to the connection attributes.'"
") CHARACTER SET utf8 COLLATE utf8_bin") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_session_connect_attrs::create()
diff --git a/storage/perfschema/table_session_connect_attrs.h b/storage/perfschema/table_session_connect_attrs.h
index 823207726f3..c35f4b89f4e 100644
--- a/storage/perfschema/table_session_connect_attrs.h
+++ b/storage/perfschema/table_session_connect_attrs.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2012, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -33,6 +33,7 @@
class table_session_connect_attrs : public table_session_connect
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
/** Table builder */
diff --git a/storage/perfschema/table_session_status.cc b/storage/perfschema/table_session_status.cc
index 05795af4f3c..403b2acabfe 100644
--- a/storage/perfschema/table_session_status.cc
+++ b/storage/perfschema/table_session_status.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -35,6 +35,11 @@
THR_LOCK table_session_status::m_table_lock;
+PFS_engine_table_share_state
+table_session_status::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_session_status::m_share=
{
@@ -49,7 +54,9 @@ table_session_status::m_share=
{ C_STRING_WITH_LEN("CREATE TABLE session_status("
"VARIABLE_NAME VARCHAR(64) not null comment 'The session status variable name.',"
"VARIABLE_VALUE VARCHAR(1024) comment 'The session status variable value.')") },
- true /* perpetual */
+ true, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_session_status.h b/storage/perfschema/table_session_status.h
index ed42d3fc57d..d338ccafa8a 100644
--- a/storage/perfschema/table_session_status.h
+++ b/storage/perfschema/table_session_status.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -70,6 +70,7 @@ class table_session_status : public PFS_engine_table
typedef PFS_simple_index pos_t;
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_session_variables.cc b/storage/perfschema/table_session_variables.cc
index dd6914d81c8..2a37686f6d9 100644
--- a/storage/perfschema/table_session_variables.cc
+++ b/storage/perfschema/table_session_variables.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -35,6 +35,11 @@
THR_LOCK table_session_variables::m_table_lock;
+PFS_engine_table_share_state
+table_session_variables::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_session_variables::m_share=
{
@@ -49,7 +54,8 @@ table_session_variables::m_share=
{ C_STRING_WITH_LEN("CREATE TABLE session_variables("
"VARIABLE_NAME VARCHAR(64) not null,"
"VARIABLE_VALUE VARCHAR(1024))") },
- true /* perpetual */
+ true, /* m_perpetual */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_session_variables.h b/storage/perfschema/table_session_variables.h
index a32b7483bce..0223438824a 100644
--- a/storage/perfschema/table_session_variables.h
+++ b/storage/perfschema/table_session_variables.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -68,6 +68,7 @@ class table_session_variables : public PFS_engine_table
typedef PFS_simple_index pos_t;
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_setup_actors.cc b/storage/perfschema/table_setup_actors.cc
index 03f42cb6433..e2733a94fcc 100644
--- a/storage/perfschema/table_setup_actors.cc
+++ b/storage/perfschema/table_setup_actors.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,11 @@
THR_LOCK table_setup_actors::m_table_lock;
+PFS_engine_table_share_state
+table_setup_actors::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_setup_actors::m_share=
{
@@ -55,7 +60,9 @@ table_setup_actors::m_share=
"ROLE CHAR(" USERNAME_CHAR_LENGTH_STR ") collate utf8_bin default '%' not null comment 'Unused',"
"ENABLED ENUM('YES', 'NO') not null default 'YES' comment 'Whether to enable instrumentation for foreground threads matched by the row.',"
"HISTORY ENUM('YES', 'NO') not null default 'YES' comment 'Whether to log historical events for foreground threads matched by the row.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_setup_actors::create()
diff --git a/storage/perfschema/table_setup_actors.h b/storage/perfschema/table_setup_actors.h
index f9c316e3396..758d3b22ef7 100644
--- a/storage/perfschema/table_setup_actors.h
+++ b/storage/perfschema/table_setup_actors.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -62,6 +62,7 @@ struct row_setup_actors
class table_setup_actors : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share. */
static PFS_engine_table_share m_share;
/** Table builder. */
diff --git a/storage/perfschema/table_setup_consumers.cc b/storage/perfschema/table_setup_consumers.cc
index 88e689b9ff8..ab2fb030468 100644
--- a/storage/perfschema/table_setup_consumers.cc
+++ b/storage/perfschema/table_setup_consumers.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -131,6 +131,11 @@ static row_setup_consumers all_setup_consumers_data[COUNT_SETUP_CONSUMERS]=
THR_LOCK table_setup_consumers::m_table_lock;
+PFS_engine_table_share_state
+table_setup_consumers::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_setup_consumers::m_share=
{
@@ -145,7 +150,9 @@ table_setup_consumers::m_share=
{ C_STRING_WITH_LEN("CREATE TABLE setup_consumers("
"NAME VARCHAR(64) not null comment 'Consumer name',"
"ENABLED ENUM ('YES', 'NO') not null comment 'YES or NO for whether or not the consumer is enabled. You can modify this column to ensure that event information is added, or is not added.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_setup_consumers::create(void)
diff --git a/storage/perfschema/table_setup_consumers.h b/storage/perfschema/table_setup_consumers.h
index 77cd09dcfbb..8c3479a88b1 100644
--- a/storage/perfschema/table_setup_consumers.h
+++ b/storage/perfschema/table_setup_consumers.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -53,6 +53,7 @@ struct row_setup_consumers
class table_setup_consumers : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share. */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_setup_instruments.cc b/storage/perfschema/table_setup_instruments.cc
index 86682b8a1d0..40a17bc1deb 100644
--- a/storage/perfschema/table_setup_instruments.cc
+++ b/storage/perfschema/table_setup_instruments.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -39,6 +39,11 @@
THR_LOCK table_setup_instruments::m_table_lock;
+PFS_engine_table_share_state
+table_setup_instruments::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_setup_instruments::m_share=
{
@@ -54,7 +59,9 @@ table_setup_instruments::m_share=
"NAME VARCHAR(128) not null comment 'Instrument name',"
"ENABLED ENUM ('YES', 'NO') not null comment 'Whether or not the instrument is enabled. It can be disabled, and the instrument will produce no events.',"
"TIMED ENUM ('YES', 'NO') not null comment 'Whether or not the instrument is timed. It can be set, but if disabled, events produced by the instrument will have NULL values for the corresponding TIMER_START, TIMER_END, and TIMER_WAIT values.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_setup_instruments::create(void)
diff --git a/storage/perfschema/table_setup_instruments.h b/storage/perfschema/table_setup_instruments.h
index 59378824236..4b6ad9b46dd 100644
--- a/storage/perfschema/table_setup_instruments.h
+++ b/storage/perfschema/table_setup_instruments.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -91,6 +91,7 @@ struct pos_setup_instruments : public PFS_double_index
class table_setup_instruments : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share. */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_setup_objects.cc b/storage/perfschema/table_setup_objects.cc
index b71d3b7afa9..d43ac4ae5e5 100644
--- a/storage/perfschema/table_setup_objects.cc
+++ b/storage/perfschema/table_setup_objects.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,10 @@
#include "field.h"
THR_LOCK table_setup_objects::m_table_lock;
+PFS_engine_table_share_state
+table_setup_objects::m_share_state = {
+ false /* m_checked */
+};
PFS_engine_table_share
table_setup_objects::m_share=
@@ -56,7 +60,9 @@ table_setup_objects::m_share=
"OBJECT_NAME VARCHAR(64) not null default '%' comment 'Name of the instrumented object, either the literal or % for any object.',"
"ENABLED ENUM ('YES', 'NO') not null default 'YES' comment 'Whether the object''s events are instrumented or not. Can be disabled, in which case monitoring is not enabled for those objects.',"
"TIMED ENUM ('YES', 'NO') not null default 'YES' comment 'Whether the object''s events are timed or not. Can be modified.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
int update_derived_flags()
diff --git a/storage/perfschema/table_setup_objects.h b/storage/perfschema/table_setup_objects.h
index feca8fc2f74..2d17e2e15ff 100644
--- a/storage/perfschema/table_setup_objects.h
+++ b/storage/perfschema/table_setup_objects.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -61,6 +61,7 @@ struct row_setup_objects
class table_setup_objects : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share. */
static PFS_engine_table_share m_share;
/** Table builder. */
diff --git a/storage/perfschema/table_setup_timers.cc b/storage/perfschema/table_setup_timers.cc
index b8b70981a36..4109f4fc5e6 100644
--- a/storage/perfschema/table_setup_timers.cc
+++ b/storage/perfschema/table_setup_timers.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -61,6 +61,11 @@ static row_setup_timers all_setup_timers_data[COUNT_SETUP_TIMERS]=
THR_LOCK table_setup_timers::m_table_lock;
+PFS_engine_table_share_state
+table_setup_timers::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_setup_timers::m_share=
{
@@ -75,7 +80,9 @@ table_setup_timers::m_share=
{ C_STRING_WITH_LEN("CREATE TABLE setup_timers("
"NAME VARCHAR(64) not null comment 'Type of instrument the timer is used for.',"
"TIMER_NAME ENUM ('CYCLE', 'NANOSECOND', 'MICROSECOND', 'MILLISECOND', 'TICK') not null comment 'Timer applying to the instrument type. Can be modified.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_setup_timers::create(void)
diff --git a/storage/perfschema/table_setup_timers.h b/storage/perfschema/table_setup_timers.h
index 9237fa2a059..68bf9a55130 100644
--- a/storage/perfschema/table_setup_timers.h
+++ b/storage/perfschema/table_setup_timers.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -49,6 +49,7 @@ struct row_setup_timers
class table_setup_timers : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share. */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_socket_instances.cc b/storage/perfschema/table_socket_instances.cc
index ee1818b900b..7d2e06955f4 100644
--- a/storage/perfschema/table_socket_instances.cc
+++ b/storage/perfschema/table_socket_instances.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -37,6 +37,11 @@
THR_LOCK table_socket_instances::m_table_lock;
+PFS_engine_table_share_state
+table_socket_instances::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_socket_instances::m_share=
{
@@ -56,7 +61,9 @@ table_socket_instances::m_share=
"IP VARCHAR(64) not null comment 'Client IP address. Blank for Unix socket file, otherwise an IPv4 or IPv6 address. Together with the PORT identifies the connection.',"
"PORT INTEGER not null comment 'TCP/IP port number, from 0 to 65535. Together with the IP identifies the connection.',"
"STATE ENUM('IDLE','ACTIVE') not null comment 'Socket status, either IDLE if waiting to receive a request from a client, or ACTIVE')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_socket_instances::create(void)
diff --git a/storage/perfschema/table_socket_instances.h b/storage/perfschema/table_socket_instances.h
index 30f18086c3a..763860d08c1 100644
--- a/storage/perfschema/table_socket_instances.h
+++ b/storage/perfschema/table_socket_instances.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -67,6 +67,7 @@ struct row_socket_instances
class table_socket_instances : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_socket_summary_by_event_name.cc b/storage/perfschema/table_socket_summary_by_event_name.cc
index 6efab95d5b1..77461ea3ede 100644
--- a/storage/perfschema/table_socket_summary_by_event_name.cc
+++ b/storage/perfschema/table_socket_summary_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -37,6 +37,11 @@
THR_LOCK table_socket_summary_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_socket_summary_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_socket_summary_by_event_name::m_share=
{
@@ -72,7 +77,9 @@ table_socket_summary_by_event_name::m_share=
"MIN_TIMER_MISC BIGINT unsigned not null comment 'Minimum wait time of all miscellaneous operations that are timed.',"
"AVG_TIMER_MISC BIGINT unsigned not null comment 'Average wait time of all miscellaneous operations that are timed.',"
"MAX_TIMER_MISC BIGINT unsigned not null comment 'Maximum wait time of all miscellaneous operations that are timed.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_socket_summary_by_event_name::create(void)
diff --git a/storage/perfschema/table_socket_summary_by_event_name.h b/storage/perfschema/table_socket_summary_by_event_name.h
index 39361b54bb5..f386d62f8ee 100644
--- a/storage/perfschema/table_socket_summary_by_event_name.h
+++ b/storage/perfschema/table_socket_summary_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -56,6 +56,7 @@ struct row_socket_summary_by_event_name
class table_socket_summary_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_socket_summary_by_instance.cc b/storage/perfschema/table_socket_summary_by_instance.cc
index 4bb7a2af773..17ea3d1abe6 100644
--- a/storage/perfschema/table_socket_summary_by_instance.cc
+++ b/storage/perfschema/table_socket_summary_by_instance.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -37,6 +37,11 @@
THR_LOCK table_socket_summary_by_instance::m_table_lock;
+PFS_engine_table_share_state
+table_socket_summary_by_instance::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_socket_summary_by_instance::m_share=
{
@@ -73,7 +78,9 @@ table_socket_summary_by_instance::m_share=
"MIN_TIMER_MISC BIGINT unsigned not null comment 'Minimum wait time of all miscellaneous operations that are timed.',"
"AVG_TIMER_MISC BIGINT unsigned not null comment 'Average wait time of all miscellaneous operations that are timed.',"
"MAX_TIMER_MISC BIGINT unsigned not null comment 'Maximum wait time of all miscellaneous operations that are timed.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_socket_summary_by_instance::create(void)
diff --git a/storage/perfschema/table_socket_summary_by_instance.h b/storage/perfschema/table_socket_summary_by_instance.h
index 39a02c939b5..c7712871c51 100644
--- a/storage/perfschema/table_socket_summary_by_instance.h
+++ b/storage/perfschema/table_socket_summary_by_instance.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -59,6 +59,7 @@ struct row_socket_summary_by_instance
class table_socket_summary_by_instance : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_status_by_account.cc b/storage/perfschema/table_status_by_account.cc
index 347012bc064..7ee8c116f70 100644
--- a/storage/perfschema/table_status_by_account.cc
+++ b/storage/perfschema/table_status_by_account.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -36,6 +36,11 @@
THR_LOCK table_status_by_account::m_table_lock;
+PFS_engine_table_share_state
+table_status_by_account::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_status_by_account::m_share=
{
@@ -52,7 +57,9 @@ table_status_by_account::m_share=
"HOST CHAR(60) collate utf8_bin default null comment 'Host for which the status variable is reported.',"
"VARIABLE_NAME VARCHAR(64) not null comment 'Status variable name.',"
"VARIABLE_VALUE VARCHAR(1024) comment 'Aggregated status variable value.' )") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_status_by_account.h b/storage/perfschema/table_status_by_account.h
index 19a4f1db1de..3da5077ebc6 100644
--- a/storage/perfschema/table_status_by_account.h
+++ b/storage/perfschema/table_status_by_account.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -104,6 +104,7 @@ class table_status_by_account : public PFS_engine_table
typedef pos_status_by_account pos_t;
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_status_by_host.cc b/storage/perfschema/table_status_by_host.cc
index 6b280011565..3837df5cb34 100644
--- a/storage/perfschema/table_status_by_host.cc
+++ b/storage/perfschema/table_status_by_host.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -36,6 +36,11 @@
THR_LOCK table_status_by_host::m_table_lock;
+PFS_engine_table_share_state
+table_status_by_host::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_status_by_host::m_share=
{
@@ -51,7 +56,9 @@ table_status_by_host::m_share=
"HOST CHAR(60) collate utf8_bin default null comment 'Host for which the status variable is reported.',"
"VARIABLE_NAME VARCHAR(64) not null comment 'Status variable name.',"
"VARIABLE_VALUE VARCHAR(1024) comment 'Aggregated status variable value.' )") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_status_by_host.h b/storage/perfschema/table_status_by_host.h
index f1c92268b02..c697638bacf 100644
--- a/storage/perfschema/table_status_by_host.h
+++ b/storage/perfschema/table_status_by_host.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -102,6 +102,7 @@ class table_status_by_host : public PFS_engine_table
typedef pos_status_by_host pos_t;
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_status_by_thread.cc b/storage/perfschema/table_status_by_thread.cc
index 984a15b26eb..8b1d945609b 100644
--- a/storage/perfschema/table_status_by_thread.cc
+++ b/storage/perfschema/table_status_by_thread.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -35,6 +35,11 @@
THR_LOCK table_status_by_thread::m_table_lock;
+PFS_engine_table_share_state
+table_status_by_thread::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_status_by_thread::m_share=
{
@@ -50,7 +55,9 @@ table_status_by_thread::m_share=
"THREAD_ID BIGINT unsigned not null comment 'The thread identifier of the session in which the status variable is defined.',"
"VARIABLE_NAME VARCHAR(64) not null comment 'Status variable name.',"
"VARIABLE_VALUE VARCHAR(1024) comment 'Aggregated status variable value.' )") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
@@ -61,7 +68,7 @@ table_status_by_thread::create(void)
int table_status_by_thread::delete_all_rows(void)
{
- /* Lock required to aggregate to global_status_vars. */
+ /* Lock required to aggregate to global_status_var. */
mysql_mutex_lock(&LOCK_status);
reset_status_by_thread();
diff --git a/storage/perfschema/table_status_by_thread.h b/storage/perfschema/table_status_by_thread.h
index 90a1735d1e2..c3f50941597 100644
--- a/storage/perfschema/table_status_by_thread.h
+++ b/storage/perfschema/table_status_by_thread.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -100,6 +100,7 @@ class table_status_by_thread : public PFS_engine_table
typedef pos_status_by_thread pos_t;
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_status_by_user.cc b/storage/perfschema/table_status_by_user.cc
index 84f81402e1c..8ea45205ae4 100644
--- a/storage/perfschema/table_status_by_user.cc
+++ b/storage/perfschema/table_status_by_user.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -37,6 +37,11 @@
THR_LOCK table_status_by_user::m_table_lock;
+PFS_engine_table_share_state
+table_status_by_user::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_status_by_user::m_share=
{
@@ -52,7 +57,9 @@ table_status_by_user::m_share=
"USER CHAR(32) collate utf8_bin default null comment 'User for which the status variable is reported.',"
"VARIABLE_NAME VARCHAR(64) not null comment 'Status variable name.',"
"VARIABLE_VALUE VARCHAR(1024) comment 'Aggregated status variable value.' )") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_status_by_user.h b/storage/perfschema/table_status_by_user.h
index 2fe2cc24407..4cf348fdec7 100644
--- a/storage/perfschema/table_status_by_user.h
+++ b/storage/perfschema/table_status_by_user.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -102,6 +102,7 @@ class table_status_by_user : public PFS_engine_table
typedef pos_status_by_user pos_t;
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_sync_instances.cc b/storage/perfschema/table_sync_instances.cc
index a85dea21ba2..5f2c709170f 100644
--- a/storage/perfschema/table_sync_instances.cc
+++ b/storage/perfschema/table_sync_instances.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,11 @@
THR_LOCK table_mutex_instances::m_table_lock;
+PFS_engine_table_share_state
+table_mutex_instances::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_mutex_instances::m_share=
{
@@ -53,7 +58,9 @@ table_mutex_instances::m_share=
"NAME VARCHAR(128) not null comment 'Instrument name associated with the mutex.',"
"OBJECT_INSTANCE_BEGIN BIGINT unsigned not null comment 'Memory address of the instrumented mutex.',"
"LOCKED_BY_THREAD_ID BIGINT unsigned comment 'The THREAD_ID of the locking thread if a thread has a mutex locked, otherwise NULL.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_mutex_instances::create(void)
@@ -186,6 +193,11 @@ int table_mutex_instances::read_row_values(TABLE *table,
THR_LOCK table_rwlock_instances::m_table_lock;
+PFS_engine_table_share_state
+table_rwlock_instances::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_rwlock_instances::m_share=
{
@@ -202,7 +214,9 @@ table_rwlock_instances::m_share=
"OBJECT_INSTANCE_BEGIN BIGINT unsigned not null comment 'Address in memory of the instrumented lock',"
"WRITE_LOCKED_BY_THREAD_ID BIGINT unsigned comment 'THREAD_ID of the locking thread if locked in write (exclusive) mode, otherwise NULL.',"
"READ_LOCKED_BY_COUNT INTEGER unsigned not null comment 'Count of current read locks held')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_rwlock_instances::create(void)
@@ -342,6 +356,11 @@ int table_rwlock_instances::read_row_values(TABLE *table,
THR_LOCK table_cond_instances::m_table_lock;
+PFS_engine_table_share_state
+table_cond_instances::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_cond_instances::m_share=
{
@@ -356,7 +375,9 @@ table_cond_instances::m_share=
{ C_STRING_WITH_LEN("CREATE TABLE cond_instances("
"NAME VARCHAR(128) not null comment 'Client user name for the connection, or NULL if an internal thread.',"
"OBJECT_INSTANCE_BEGIN BIGINT unsigned not null comment 'Address in memory of the instrumented condition.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_cond_instances::create(void)
diff --git a/storage/perfschema/table_sync_instances.h b/storage/perfschema/table_sync_instances.h
index f1f56248a12..ce756cef50c 100644
--- a/storage/perfschema/table_sync_instances.h
+++ b/storage/perfschema/table_sync_instances.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -59,6 +59,7 @@ struct row_mutex_instances
class table_mutex_instances : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share. */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
@@ -117,6 +118,7 @@ struct row_rwlock_instances
class table_rwlock_instances : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
@@ -169,6 +171,7 @@ struct row_cond_instances
class table_cond_instances : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share. */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_table_handles.cc b/storage/perfschema/table_table_handles.cc
index 91ab7f889e4..d878ce2f7c1 100644
--- a/storage/perfschema/table_table_handles.cc
+++ b/storage/perfschema/table_table_handles.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2012, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,11 @@
THR_LOCK table_table_handles::m_table_lock;
+PFS_engine_table_share_state
+table_table_handles::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_table_handles::m_share=
{
@@ -58,7 +63,9 @@ table_table_handles::m_share=
"OWNER_EVENT_ID BIGINT unsigned comment 'The event which caused the table handle to be opened.',"
"INTERNAL_LOCK VARCHAR(64) comment 'The table lock used at the SQL level.',"
"EXTERNAL_LOCK VARCHAR(64) comment 'The table lock used at the storage engine level.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_table_handles.h b/storage/perfschema/table_table_handles.h
index 3b738d89413..3f2f8c5c1ad 100644
--- a/storage/perfschema/table_table_handles.h
+++ b/storage/perfschema/table_table_handles.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2012, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -63,6 +63,7 @@ struct row_table_handles
class table_table_handles : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_threads.cc b/storage/perfschema/table_threads.cc
index 5528056c022..c98a612eca2 100644
--- a/storage/perfschema/table_threads.cc
+++ b/storage/perfschema/table_threads.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -29,6 +29,11 @@
THR_LOCK table_threads::m_table_lock;
+PFS_engine_table_share_state
+table_threads::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_threads::m_share=
{
@@ -58,7 +63,9 @@ table_threads::m_share=
"HISTORY ENUM ('YES', 'NO') not null comment 'Whether to log historical events for the thread.',"
"CONNECTION_TYPE VARCHAR(16) comment 'The protocol used to establish the connection, or NULL for background threads.',"
"THREAD_OS_ID BIGINT unsigned comment 'The thread or task identifier as defined by the underlying operating system, if there is one.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_threads::create()
diff --git a/storage/perfschema/table_threads.h b/storage/perfschema/table_threads.h
index a7ce83dad72..078dbbda5a9 100644
--- a/storage/perfschema/table_threads.h
+++ b/storage/perfschema/table_threads.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -88,6 +88,7 @@ struct row_threads
class table_threads : public cursor_by_thread
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
/** Table builder */
diff --git a/storage/perfschema/table_tiws_by_index_usage.cc b/storage/perfschema/table_tiws_by_index_usage.cc
index 7375c62ae38..b8f3bfa4039 100644
--- a/storage/perfschema/table_tiws_by_index_usage.cc
+++ b/storage/perfschema/table_tiws_by_index_usage.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,11 @@
THR_LOCK table_tiws_by_index_usage::m_table_lock;
+PFS_engine_table_share_state
+table_tiws_by_index_usage::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_tiws_by_index_usage::m_share=
{
@@ -89,7 +94,9 @@ table_tiws_by_index_usage::m_share=
"MIN_TIMER_DELETE BIGINT unsigned not null comment 'Minimum wait time of all delete operations that are timed.',"
"AVG_TIMER_DELETE BIGINT unsigned not null comment 'Average wait time of all delete operations that are timed.',"
"MAX_TIMER_DELETE BIGINT unsigned not null comment 'Maximum wait time of all delete operations that are timed.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_tiws_by_index_usage.h b/storage/perfschema/table_tiws_by_index_usage.h
index 990f2dede66..64e08683b9b 100644
--- a/storage/perfschema/table_tiws_by_index_usage.h
+++ b/storage/perfschema/table_tiws_by_index_usage.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -80,6 +80,7 @@ struct pos_tiws_by_index_usage : public PFS_double_index
class table_tiws_by_index_usage : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_tiws_by_table.cc b/storage/perfschema/table_tiws_by_table.cc
index cbd754b3342..75eaf70cd8a 100644
--- a/storage/perfschema/table_tiws_by_table.cc
+++ b/storage/perfschema/table_tiws_by_table.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,11 @@
THR_LOCK table_tiws_by_table::m_table_lock;
+PFS_engine_table_share_state
+table_tiws_by_table::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_tiws_by_table::m_share=
{
@@ -88,7 +93,9 @@ table_tiws_by_table::m_share=
"MIN_TIMER_DELETE BIGINT unsigned not null comment 'Minimum wait time of all delete operations that are timed.',"
"AVG_TIMER_DELETE BIGINT unsigned not null comment 'Average wait time of all delete operations that are timed.',"
"MAX_TIMER_DELETE BIGINT unsigned not null comment 'Maximum wait time of all delete operations that are timed.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_tiws_by_table.h b/storage/perfschema/table_tiws_by_table.h
index 693e07f0e65..fed3b694fde 100644
--- a/storage/perfschema/table_tiws_by_table.h
+++ b/storage/perfschema/table_tiws_by_table.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -55,6 +55,7 @@ struct row_tiws_by_table
class table_tiws_by_table : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_tlws_by_table.cc b/storage/perfschema/table_tlws_by_table.cc
index ebb01567adf..17bdf6449a6 100644
--- a/storage/perfschema/table_tlws_by_table.cc
+++ b/storage/perfschema/table_tlws_by_table.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,11 @@
THR_LOCK table_tlws_by_table::m_table_lock;
+PFS_engine_table_share_state
+table_tlws_by_table::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_tlws_by_table::m_share=
{
@@ -123,7 +128,9 @@ table_tlws_by_table::m_share=
"MIN_TIMER_WRITE_EXTERNAL BIGINT unsigned not null comment 'Minimum wait time of all external write locks that are timed.',"
"AVG_TIMER_WRITE_EXTERNAL BIGINT unsigned not null comment 'Average wait time of all external write locks that are timed.',"
"MAX_TIMER_WRITE_EXTERNAL BIGINT unsigned not null comment 'Maximum wait time of all external write locks that are timed.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_tlws_by_table.h b/storage/perfschema/table_tlws_by_table.h
index 5bcf89d3a24..ba0668e5938 100644
--- a/storage/perfschema/table_tlws_by_table.h
+++ b/storage/perfschema/table_tlws_by_table.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -55,6 +55,7 @@ struct row_tlws_by_table
class table_tlws_by_table : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_users.cc b/storage/perfschema/table_users.cc
index d56c90c0270..14fc8bf7db1 100644
--- a/storage/perfschema/table_users.cc
+++ b/storage/perfschema/table_users.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -34,6 +34,11 @@
THR_LOCK table_users::m_table_lock;
+PFS_engine_table_share_state
+table_users::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_users::m_share=
{
@@ -49,7 +54,9 @@ table_users::m_share=
"USER CHAR(" USERNAME_CHAR_LENGTH_STR ") collate utf8_bin default null comment 'The connection''s client user name for the connection, or NULL if an internal thread.',"
"CURRENT_CONNECTIONS bigint not null comment 'Current connections for the user.',"
"TOTAL_CONNECTIONS bigint not null comment 'Total connections for the user.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_users::create()
diff --git a/storage/perfschema/table_users.h b/storage/perfschema/table_users.h
index c2476c71707..2adc77569d9 100644
--- a/storage/perfschema/table_users.h
+++ b/storage/perfschema/table_users.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -49,6 +49,7 @@ struct row_users
class table_users : public cursor_by_user
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
/** Table builder */
diff --git a/storage/perfschema/table_uvar_by_thread.cc b/storage/perfschema/table_uvar_by_thread.cc
index b80ae2beefe..43b9bf347d3 100644
--- a/storage/perfschema/table_uvar_by_thread.cc
+++ b/storage/perfschema/table_uvar_by_thread.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -129,6 +129,11 @@ void User_variables::materialize(PFS_thread *pfs, THD *thd)
THR_LOCK table_uvar_by_thread::m_table_lock;
+PFS_engine_table_share_state
+table_uvar_by_thread::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_uvar_by_thread::m_share=
{
@@ -144,7 +149,9 @@ table_uvar_by_thread::m_share=
"THREAD_ID BIGINT unsigned not null comment 'The thread identifier of the session in which the variable is defined.',"
"VARIABLE_NAME VARCHAR(64) not null comment 'The variable name, without the leading @ character.',"
"VARIABLE_VALUE LONGBLOB comment 'The variable value')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_uvar_by_thread.h b/storage/perfschema/table_uvar_by_thread.h
index cd20897743d..82faf1a52ec 100644
--- a/storage/perfschema/table_uvar_by_thread.h
+++ b/storage/perfschema/table_uvar_by_thread.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -148,6 +148,7 @@ class table_uvar_by_thread : public PFS_engine_table
typedef pos_uvar_by_thread pos_t;
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_variables_by_thread.cc b/storage/perfschema/table_variables_by_thread.cc
index bdf1aaf5227..db9e4c2c9ec 100644
--- a/storage/perfschema/table_variables_by_thread.cc
+++ b/storage/perfschema/table_variables_by_thread.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -35,6 +35,11 @@
THR_LOCK table_variables_by_thread::m_table_lock;
+PFS_engine_table_share_state
+table_variables_by_thread::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_variables_by_thread::m_share=
{
@@ -50,7 +55,8 @@ table_variables_by_thread::m_share=
"THREAD_ID BIGINT unsigned not null,"
"VARIABLE_NAME VARCHAR(64) not null,"
"VARIABLE_VALUE VARCHAR(1024))") },
- true /* perpetual */
+ true, /* m_perpetual */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_variables_by_thread.h b/storage/perfschema/table_variables_by_thread.h
index 5143067adbb..a9e70388366 100644
--- a/storage/perfschema/table_variables_by_thread.h
+++ b/storage/perfschema/table_variables_by_thread.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -101,6 +101,7 @@ class table_variables_by_thread : public PFS_engine_table
typedef pos_variables_by_thread pos_t;
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/unittest/CMakeLists.txt b/storage/perfschema/unittest/CMakeLists.txt
index 712f22242c3..ce20006a00e 100644
--- a/storage/perfschema/unittest/CMakeLists.txt
+++ b/storage/perfschema/unittest/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2009, 2021, Oracle and/or its affiliates.
+# Copyright (c) 2009, 2022, Oracle and/or its affiliates.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/conf.txt b/storage/perfschema/unittest/conf.txt
index db9cf980c33..a22d8fd41b2 100644
--- a/storage/perfschema/unittest/conf.txt
+++ b/storage/perfschema/unittest/conf.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2009, 2021, Oracle and/or its affiliates.
+# Copyright (c) 2009, 2022, Oracle and/or its affiliates.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/pfs-t.cc b/storage/perfschema/unittest/pfs-t.cc
index 2240c2917e8..412184ecbed 100644
--- a/storage/perfschema/unittest/pfs-t.cc
+++ b/storage/perfschema/unittest/pfs-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/pfs_account-oom-t.cc b/storage/perfschema/unittest/pfs_account-oom-t.cc
index ea39903484c..68190218b74 100644
--- a/storage/perfschema/unittest/pfs_account-oom-t.cc
+++ b/storage/perfschema/unittest/pfs_account-oom-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/pfs_connect_attr-t.cc b/storage/perfschema/unittest/pfs_connect_attr-t.cc
index e414a17a1ef..c09f10fd7de 100644
--- a/storage/perfschema/unittest/pfs_connect_attr-t.cc
+++ b/storage/perfschema/unittest/pfs_connect_attr-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/pfs_host-oom-t.cc b/storage/perfschema/unittest/pfs_host-oom-t.cc
index 0dc77f9e307..1e46963fcb8 100644
--- a/storage/perfschema/unittest/pfs_host-oom-t.cc
+++ b/storage/perfschema/unittest/pfs_host-oom-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/pfs_instr-oom-t.cc b/storage/perfschema/unittest/pfs_instr-oom-t.cc
index 5f0d97e6be4..eff2385ef48 100644
--- a/storage/perfschema/unittest/pfs_instr-oom-t.cc
+++ b/storage/perfschema/unittest/pfs_instr-oom-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/pfs_instr-t.cc b/storage/perfschema/unittest/pfs_instr-t.cc
index 95971214c83..b0d3bd9c36f 100644
--- a/storage/perfschema/unittest/pfs_instr-t.cc
+++ b/storage/perfschema/unittest/pfs_instr-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/pfs_instr_class-oom-t.cc b/storage/perfschema/unittest/pfs_instr_class-oom-t.cc
index da80a658f99..612cc5adf3f 100644
--- a/storage/perfschema/unittest/pfs_instr_class-oom-t.cc
+++ b/storage/perfschema/unittest/pfs_instr_class-oom-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/pfs_instr_class-t.cc b/storage/perfschema/unittest/pfs_instr_class-t.cc
index 09a38706b86..b5f08f739ac 100644
--- a/storage/perfschema/unittest/pfs_instr_class-t.cc
+++ b/storage/perfschema/unittest/pfs_instr_class-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/pfs_misc-t.cc b/storage/perfschema/unittest/pfs_misc-t.cc
index e2522a053e1..6765dca0550 100644
--- a/storage/perfschema/unittest/pfs_misc-t.cc
+++ b/storage/perfschema/unittest/pfs_misc-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/pfs_noop-t.cc b/storage/perfschema/unittest/pfs_noop-t.cc
index e577a7cc509..896a29d1bd4 100644
--- a/storage/perfschema/unittest/pfs_noop-t.cc
+++ b/storage/perfschema/unittest/pfs_noop-t.cc
@@ -1,4 +1,5 @@
-/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
+ Copyright (c) 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -228,6 +229,8 @@ void test_noop()
PSI_server->set_thread_THD(NULL, NULL);
+ PSI_server->set_thread_peer_port(NULL, 0);
+
ok(true, "all noop api called");
}
diff --git a/storage/perfschema/unittest/pfs_server_stubs.cc b/storage/perfschema/unittest/pfs_server_stubs.cc
index 9fc3b2fb143..a873bdcbd10 100644
--- a/storage/perfschema/unittest/pfs_server_stubs.cc
+++ b/storage/perfschema/unittest/pfs_server_stubs.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. All rights
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. All rights
reserved.
This program is free software; you can redistribute it and/or modify
diff --git a/storage/perfschema/unittest/pfs_timer-t.cc b/storage/perfschema/unittest/pfs_timer-t.cc
index 22fdb163aed..07f61f59fe7 100644
--- a/storage/perfschema/unittest/pfs_timer-t.cc
+++ b/storage/perfschema/unittest/pfs_timer-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/pfs_user-oom-t.cc b/storage/perfschema/unittest/pfs_user-oom-t.cc
index 4cc23a018d2..62748648ea1 100644
--- a/storage/perfschema/unittest/pfs_user-oom-t.cc
+++ b/storage/perfschema/unittest/pfs_user-oom-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/stub_global_status_var.h b/storage/perfschema/unittest/stub_global_status_var.h
index c2785d2eac1..e985ad25bbf 100644
--- a/storage/perfschema/unittest/stub_global_status_var.h
+++ b/storage/perfschema/unittest/stub_global_status_var.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/stub_pfs_defaults.h b/storage/perfschema/unittest/stub_pfs_defaults.h
index 338fd9f8324..354d2291fa3 100644
--- a/storage/perfschema/unittest/stub_pfs_defaults.h
+++ b/storage/perfschema/unittest/stub_pfs_defaults.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/stub_pfs_global.h b/storage/perfschema/unittest/stub_pfs_global.h
index 6d10e29161d..a34d18d05c8 100644
--- a/storage/perfschema/unittest/stub_pfs_global.h
+++ b/storage/perfschema/unittest/stub_pfs_global.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
Copyright (c) 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
diff --git a/storage/perfschema/unittest/stub_print_error.h b/storage/perfschema/unittest/stub_print_error.h
index ac1ecf1f637..7f6df940515 100644
--- a/storage/perfschema/unittest/stub_print_error.h
+++ b/storage/perfschema/unittest/stub_print_error.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,