From 61d08f74275b129c5d00daaa7856aead88f034ff Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Fri, 29 Jul 2022 14:48:01 +0200 Subject: [PATCH] mysql-5.7.39 --- include/mysql/psi/mysql_file.h | 2 +- include/mysql/psi/mysql_idle.h | 2 +- include/mysql/psi/mysql_mdl.h | 2 +- include/mysql/psi/mysql_memory.h | 2 +- include/mysql/psi/mysql_ps.h | 2 +- include/mysql/psi/mysql_socket.h | 2 +- include/mysql/psi/mysql_sp.h | 2 +- include/mysql/psi/mysql_stage.h | 2 +- include/mysql/psi/mysql_statement.h | 2 +- include/mysql/psi/mysql_table.h | 2 +- include/mysql/psi/mysql_thread.h | 9 +- include/mysql/psi/mysql_transaction.h | 2 +- include/mysql/psi/psi.h | 13 +- include/mysql/psi/psi_abi_v0.h | 2 +- include/mysql/psi/psi_abi_v1.h | 2 +- include/mysql/psi/psi_abi_v1.h.pp | 3 + include/mysql/psi/psi_abi_v2.h | 2 +- include/mysql/psi/psi_base.h | 8 +- include/mysql/psi/psi_memory.h | 2 +- .../perfschema/include/processlist_load.inc | 39 ++ .../perfschema/include/processlist_set.inc | 17 + .../suite/perfschema/r/ddl_processlist.result | 20 + .../suite/perfschema/r/dml_handler.result | 69 +-- .../suite/perfschema/r/dml_processlist.result | 24 ++ .../perfschema/r/information_schema.result | 10 + .../perfschema/r/max_program_zero.result | 1 + .../perfschema/r/misc_global_status.result | 101 +++++ .../suite/perfschema/r/ortho_iter.result | 1 + .../perfschema/r/pfs_upgrade_event.result | 1 + .../perfschema/r/pfs_upgrade_func.result | 1 + .../perfschema/r/pfs_upgrade_proc.result | 1 + .../perfschema/r/pfs_upgrade_table.result | 1 + .../perfschema/r/pfs_upgrade_view.result | 1 + .../perfschema/r/privilege_table_io.result | 1 + .../suite/perfschema/r/processlist.result | 201 +++++++++ .../suite/perfschema/r/processlist_57.result | 345 +++++++++++++++ .../suite/perfschema/r/processlist_acl.result | 255 +++++++++++ .../perfschema/r/processlist_anonymous.result | 66 +++ .../perfschema/r/processlist_no_pfs.result | 181 ++++++++ .../perfschema/r/processlist_port.result | 145 +++++++ .../perfschema/r/processlist_reg_user.result | 89 ++++ mysql-test/suite/perfschema/r/schema.result | 1 + .../suite/perfschema/r/show_sanity.result | 2 + .../r/start_server_disable_idle.result | 1 + .../r/start_server_disable_stages.result | 1 + .../r/start_server_disable_statements.result | 1 + .../start_server_disable_transactions.result | 1 + .../r/start_server_disable_waits.result | 1 + .../perfschema/r/start_server_innodb.result | 1 + .../r/start_server_low_index.result | 1 + .../r/start_server_low_table_lock.result | 1 + .../r/start_server_no_account.result | 1 + .../r/start_server_no_cond_class.result | 1 + .../r/start_server_no_cond_inst.result | 1 + .../r/start_server_no_file_class.result | 1 + .../r/start_server_no_file_inst.result | 1 + .../perfschema/r/start_server_no_host.result | 1 + .../perfschema/r/start_server_no_index.result | 1 + .../perfschema/r/start_server_no_mdl.result | 1 + .../r/start_server_no_memory_class.result | 1 + .../r/start_server_no_mutex_class.result | 1 + .../r/start_server_no_mutex_inst.result | 1 + ..._server_no_prepared_stmts_instances.result | 1 + .../r/start_server_no_rwlock_class.result | 1 + .../r/start_server_no_rwlock_inst.result | 1 + .../r/start_server_no_setup_actors.result | 1 + .../r/start_server_no_setup_objects.result | 1 + .../r/start_server_no_socket_class.result | 1 + .../r/start_server_no_socket_inst.result | 1 + .../r/start_server_no_stage_class.result | 1 + .../r/start_server_no_stages_history.result | 1 + ...start_server_no_stages_history_long.result | 1 + .../r/start_server_no_statement_class.result | 1 + .../start_server_no_statements_history.result | 1 + ...t_server_no_statements_history_long.result | 1 + .../r/start_server_no_table_hdl.result | 1 + .../r/start_server_no_table_inst.result | 1 + .../r/start_server_no_table_lock.result | 1 + .../r/start_server_no_thread_class.result | 1 + .../r/start_server_no_thread_inst.result | 1 + ...tart_server_no_transactions_history.result | 1 + ...server_no_transactions_history_long.result | 1 + .../perfschema/r/start_server_no_user.result | 1 + .../r/start_server_no_waits_history.result | 1 + .../start_server_no_waits_history_long.result | 1 + .../perfschema/r/start_server_nothing.result | 2 + .../perfschema/r/start_server_off.result | 1 + .../suite/perfschema/r/start_server_on.result | 1 + .../r/statement_program_lost_inst.result | 1 + .../r/table_aggregate_global_2u_2t.result | 1 + .../r/table_aggregate_global_2u_3t.result | 1 + .../r/table_aggregate_global_4u_2t.result | 1 + .../r/table_aggregate_global_4u_3t.result | 1 + .../r/table_aggregate_hist_2u_2t.result | 1 + .../r/table_aggregate_hist_2u_3t.result | 1 + .../r/table_aggregate_hist_4u_2t.result | 1 + .../r/table_aggregate_hist_4u_3t.result | 1 + .../perfschema/r/table_aggregate_off.result | 1 + .../r/table_aggregate_thread_2u_2t.result | 1 + .../r/table_aggregate_thread_2u_3t.result | 1 + .../r/table_aggregate_thread_4u_2t.result | 1 + .../r/table_aggregate_thread_4u_3t.result | 1 + .../r/table_io_aggregate_global_2u_2t.result | 1 + .../r/table_io_aggregate_global_2u_3t.result | 1 + .../r/table_io_aggregate_global_4u_2t.result | 1 + .../r/table_io_aggregate_global_4u_3t.result | 1 + .../r/table_io_aggregate_hist_2u_2t.result | 1 + .../r/table_io_aggregate_hist_2u_3t.result | 1 + .../r/table_io_aggregate_hist_4u_2t.result | 1 + .../r/table_io_aggregate_hist_4u_3t.result | 1 + .../r/table_io_aggregate_thread_2u_2t.result | 1 + .../r/table_io_aggregate_thread_2u_3t.result | 1 + .../r/table_io_aggregate_thread_4u_2t.result | 1 + .../r/table_io_aggregate_thread_4u_3t.result | 1 + .../table_lock_aggregate_global_2u_2t.result | 1 + .../table_lock_aggregate_global_2u_3t.result | 1 + .../table_lock_aggregate_global_4u_2t.result | 1 + .../table_lock_aggregate_global_4u_3t.result | 1 + .../r/table_lock_aggregate_hist_2u_2t.result | 1 + .../r/table_lock_aggregate_hist_2u_3t.result | 1 + .../r/table_lock_aggregate_hist_4u_2t.result | 1 + .../r/table_lock_aggregate_hist_4u_3t.result | 1 + .../table_lock_aggregate_thread_2u_2t.result | 1 + .../table_lock_aggregate_thread_2u_3t.result | 1 + .../table_lock_aggregate_thread_4u_2t.result | 1 + .../table_lock_aggregate_thread_4u_3t.result | 1 + .../suite/perfschema/r/table_schema.result | 8 + .../suite/perfschema/r/threads_mysql.result | 16 +- .../suite/perfschema/t/ddl_processlist.test | 32 ++ .../suite/perfschema/t/dml_processlist.test | 39 ++ .../t/misc_global_status-master.opt | 1 + .../perfschema/t/misc_global_status.test | 134 ++++++ .../suite/perfschema/t/processlist-master.opt | 1 + .../suite/perfschema/t/processlist.test | 197 +++++++++ .../suite/perfschema/t/processlist_57.test | 349 +++++++++++++++ .../perfschema/t/processlist_acl-master.opt | 1 + .../suite/perfschema/t/processlist_acl.test | 196 +++++++++ .../perfschema/t/processlist_anonymous.test | 111 +++++ .../t/processlist_no_pfs-master.opt | 2 + .../perfschema/t/processlist_no_pfs.test | 29 ++ .../perfschema/t/processlist_port-master.opt | 1 + .../suite/perfschema/t/processlist_port.test | 162 +++++++ .../perfschema/t/processlist_reg_user.test | 134 ++++++ .../suite/perfschema/t/threads_mysql.test | 6 +- storage/perfschema/CMakeLists.txt | 4 +- storage/perfschema/cursor_by_account.cc | 2 +- storage/perfschema/cursor_by_account.h | 2 +- storage/perfschema/cursor_by_host.cc | 2 +- storage/perfschema/cursor_by_host.h | 2 +- storage/perfschema/cursor_by_thread.cc | 2 +- storage/perfschema/cursor_by_thread.h | 2 +- .../cursor_by_thread_connect_attr.cc | 2 +- .../cursor_by_thread_connect_attr.h | 2 +- storage/perfschema/cursor_by_user.cc | 2 +- storage/perfschema/cursor_by_user.h | 2 +- storage/perfschema/ha_perfschema.cc | 49 ++- storage/perfschema/ha_perfschema.h | 2 +- storage/perfschema/pfs.cc | 15 +- storage/perfschema/pfs.h | 2 +- storage/perfschema/pfs_account.cc | 29 +- storage/perfschema/pfs_account.h | 2 +- storage/perfschema/pfs_atomic.h | 2 +- storage/perfschema/pfs_autosize.cc | 2 +- storage/perfschema/pfs_buffer_container.cc | 2 +- storage/perfschema/pfs_buffer_container.h | 2 +- storage/perfschema/pfs_builtin_memory.cc | 2 +- storage/perfschema/pfs_builtin_memory.h | 2 +- storage/perfschema/pfs_check.cc | 2 +- storage/perfschema/pfs_column_types.h | 2 +- storage/perfschema/pfs_column_values.cc | 2 +- storage/perfschema/pfs_column_values.h | 2 +- storage/perfschema/pfs_con_slice.cc | 2 +- storage/perfschema/pfs_con_slice.h | 2 +- storage/perfschema/pfs_defaults.cc | 2 +- storage/perfschema/pfs_defaults.h | 2 +- storage/perfschema/pfs_digest.cc | 2 +- storage/perfschema/pfs_digest.h | 2 +- storage/perfschema/pfs_engine_table.cc | 105 ++++- storage/perfschema/pfs_engine_table.h | 32 +- storage/perfschema/pfs_events.h | 2 +- storage/perfschema/pfs_events_stages.cc | 2 +- storage/perfschema/pfs_events_stages.h | 2 +- storage/perfschema/pfs_events_statements.cc | 2 +- storage/perfschema/pfs_events_statements.h | 2 +- storage/perfschema/pfs_events_transactions.cc | 2 +- storage/perfschema/pfs_events_transactions.h | 2 +- storage/perfschema/pfs_events_waits.cc | 2 +- storage/perfschema/pfs_events_waits.h | 2 +- storage/perfschema/pfs_global.cc | 2 +- storage/perfschema/pfs_global.h | 2 +- storage/perfschema/pfs_host.cc | 2 +- storage/perfschema/pfs_host.h | 2 +- storage/perfschema/pfs_instr.cc | 4 +- storage/perfschema/pfs_instr.h | 5 +- storage/perfschema/pfs_instr_class.cc | 2 +- storage/perfschema/pfs_instr_class.h | 5 +- storage/perfschema/pfs_lock.h | 2 +- storage/perfschema/pfs_memory.cc | 2 +- storage/perfschema/pfs_memory.h | 2 +- storage/perfschema/pfs_prepared_stmt.cc | 2 +- storage/perfschema/pfs_prepared_stmt.h | 2 +- storage/perfschema/pfs_program.cc | 2 +- storage/perfschema/pfs_program.h | 2 +- storage/perfschema/pfs_server.cc | 2 +- storage/perfschema/pfs_server.h | 2 +- storage/perfschema/pfs_setup_actor.cc | 2 +- storage/perfschema/pfs_setup_actor.h | 2 +- storage/perfschema/pfs_setup_object.cc | 2 +- storage/perfschema/pfs_setup_object.h | 2 +- storage/perfschema/pfs_stat.h | 2 +- storage/perfschema/pfs_status.cc | 2 +- storage/perfschema/pfs_status.h | 2 +- storage/perfschema/pfs_timer.cc | 2 +- storage/perfschema/pfs_timer.h | 2 +- storage/perfschema/pfs_user.cc | 2 +- storage/perfschema/pfs_user.h | 2 +- storage/perfschema/pfs_variable.cc | 2 +- storage/perfschema/pfs_variable.h | 2 +- storage/perfschema/pfs_visitor.cc | 2 +- storage/perfschema/pfs_visitor.h | 2 +- storage/perfschema/table_accounts.cc | 12 +- storage/perfschema/table_accounts.h | 3 +- storage/perfschema/table_all_instr.cc | 2 +- storage/perfschema/table_all_instr.h | 2 +- .../table_esgs_by_account_by_event_name.cc | 12 +- .../table_esgs_by_account_by_event_name.h | 3 +- .../table_esgs_by_host_by_event_name.cc | 12 +- .../table_esgs_by_host_by_event_name.h | 3 +- .../table_esgs_by_thread_by_event_name.cc | 12 +- .../table_esgs_by_thread_by_event_name.h | 3 +- .../table_esgs_by_user_by_event_name.cc | 12 +- .../table_esgs_by_user_by_event_name.h | 3 +- .../table_esgs_global_by_event_name.cc | 12 +- .../table_esgs_global_by_event_name.h | 3 +- .../table_esms_by_account_by_event_name.cc | 12 +- .../table_esms_by_account_by_event_name.h | 3 +- storage/perfschema/table_esms_by_digest.cc | 12 +- storage/perfschema/table_esms_by_digest.h | 3 +- .../table_esms_by_host_by_event_name.cc | 12 +- .../table_esms_by_host_by_event_name.h | 3 +- storage/perfschema/table_esms_by_program.cc | 12 +- storage/perfschema/table_esms_by_program.h | 3 +- .../table_esms_by_thread_by_event_name.cc | 12 +- .../table_esms_by_thread_by_event_name.h | 3 +- .../table_esms_by_user_by_event_name.cc | 12 +- .../table_esms_by_user_by_event_name.h | 3 +- .../table_esms_global_by_event_name.cc | 12 +- .../table_esms_global_by_event_name.h | 3 +- .../table_ets_by_account_by_event_name.cc | 12 +- .../table_ets_by_account_by_event_name.h | 3 +- .../table_ets_by_host_by_event_name.cc | 12 +- .../table_ets_by_host_by_event_name.h | 3 +- .../table_ets_by_thread_by_event_name.cc | 12 +- .../table_ets_by_thread_by_event_name.h | 3 +- .../table_ets_by_user_by_event_name.cc | 12 +- .../table_ets_by_user_by_event_name.h | 3 +- .../table_ets_global_by_event_name.cc | 12 +- .../table_ets_global_by_event_name.h | 3 +- storage/perfschema/table_events_stages.cc | 32 +- storage/perfschema/table_events_stages.h | 5 +- storage/perfschema/table_events_statements.cc | 32 +- storage/perfschema/table_events_statements.h | 5 +- .../perfschema/table_events_transactions.cc | 32 +- .../perfschema/table_events_transactions.h | 5 +- storage/perfschema/table_events_waits.cc | 32 +- storage/perfschema/table_events_waits.h | 5 +- .../perfschema/table_events_waits_summary.cc | 12 +- .../perfschema/table_events_waits_summary.h | 3 +- .../table_ews_by_account_by_event_name.cc | 12 +- .../table_ews_by_account_by_event_name.h | 3 +- .../table_ews_by_host_by_event_name.cc | 12 +- .../table_ews_by_host_by_event_name.h | 3 +- .../table_ews_by_thread_by_event_name.cc | 12 +- .../table_ews_by_thread_by_event_name.h | 3 +- .../table_ews_by_user_by_event_name.cc | 12 +- .../table_ews_by_user_by_event_name.h | 3 +- .../table_ews_global_by_event_name.cc | 12 +- .../table_ews_global_by_event_name.h | 3 +- storage/perfschema/table_file_instances.cc | 12 +- storage/perfschema/table_file_instances.h | 3 +- .../table_file_summary_by_event_name.cc | 12 +- .../table_file_summary_by_event_name.h | 3 +- .../table_file_summary_by_instance.cc | 12 +- .../table_file_summary_by_instance.h | 3 +- storage/perfschema/table_global_status.cc | 12 +- storage/perfschema/table_global_status.h | 3 +- storage/perfschema/table_global_variables.cc | 12 +- storage/perfschema/table_global_variables.h | 3 +- storage/perfschema/table_helper.cc | 2 +- storage/perfschema/table_helper.h | 2 +- storage/perfschema/table_host_cache.cc | 12 +- storage/perfschema/table_host_cache.h | 3 +- storage/perfschema/table_hosts.cc | 12 +- storage/perfschema/table_hosts.h | 3 +- storage/perfschema/table_md_locks.cc | 12 +- storage/perfschema/table_md_locks.h | 3 +- .../table_mems_by_account_by_event_name.cc | 12 +- .../table_mems_by_account_by_event_name.h | 3 +- .../table_mems_by_host_by_event_name.cc | 12 +- .../table_mems_by_host_by_event_name.h | 3 +- .../table_mems_by_thread_by_event_name.cc | 12 +- .../table_mems_by_thread_by_event_name.h | 3 +- .../table_mems_by_user_by_event_name.cc | 12 +- .../table_mems_by_user_by_event_name.h | 3 +- .../table_mems_global_by_event_name.cc | 12 +- .../table_mems_global_by_event_name.h | 3 +- storage/perfschema/table_os_global_by_type.cc | 12 +- storage/perfschema/table_os_global_by_type.h | 3 +- .../perfschema/table_performance_timers.cc | 12 +- storage/perfschema/table_performance_timers.h | 3 +- .../table_prepared_stmt_instances.cc | 12 +- .../table_prepared_stmt_instances.h | 3 +- storage/perfschema/table_processlist.cc | 406 ++++++++++++++++++ storage/perfschema/table_processlist.h | 133 ++++++ ...table_replication_applier_configuration.cc | 12 +- .../table_replication_applier_configuration.h | 3 +- .../table_replication_applier_status.cc | 12 +- .../table_replication_applier_status.h | 3 +- ...plication_applier_status_by_coordinator.cc | 12 +- ...eplication_applier_status_by_coordinator.h | 3 +- ...le_replication_applier_status_by_worker.cc | 12 +- ...ble_replication_applier_status_by_worker.h | 3 +- ...le_replication_connection_configuration.cc | 12 +- ...ble_replication_connection_configuration.h | 3 +- .../table_replication_connection_status.cc | 12 +- .../table_replication_connection_status.h | 3 +- .../table_replication_group_member_stats.cc | 12 +- .../table_replication_group_member_stats.h | 3 +- .../table_replication_group_members.cc | 12 +- .../table_replication_group_members.h | 3 +- .../table_session_account_connect_attrs.cc | 12 +- .../table_session_account_connect_attrs.h | 3 +- storage/perfschema/table_session_connect.cc | 2 +- storage/perfschema/table_session_connect.h | 2 +- .../perfschema/table_session_connect_attrs.cc | 12 +- .../perfschema/table_session_connect_attrs.h | 3 +- storage/perfschema/table_session_status.cc | 12 +- storage/perfschema/table_session_status.h | 3 +- storage/perfschema/table_session_variables.cc | 12 +- storage/perfschema/table_session_variables.h | 3 +- storage/perfschema/table_setup_actors.cc | 12 +- storage/perfschema/table_setup_actors.h | 3 +- storage/perfschema/table_setup_consumers.cc | 12 +- storage/perfschema/table_setup_consumers.h | 3 +- storage/perfschema/table_setup_instruments.cc | 12 +- storage/perfschema/table_setup_instruments.h | 3 +- storage/perfschema/table_setup_objects.cc | 12 +- storage/perfschema/table_setup_objects.h | 3 +- storage/perfschema/table_setup_timers.cc | 12 +- storage/perfschema/table_setup_timers.h | 3 +- storage/perfschema/table_socket_instances.cc | 12 +- storage/perfschema/table_socket_instances.h | 3 +- .../table_socket_summary_by_event_name.cc | 12 +- .../table_socket_summary_by_event_name.h | 3 +- .../table_socket_summary_by_instance.cc | 12 +- .../table_socket_summary_by_instance.h | 3 +- storage/perfschema/table_status_by_account.cc | 12 +- storage/perfschema/table_status_by_account.h | 3 +- storage/perfschema/table_status_by_host.cc | 12 +- storage/perfschema/table_status_by_host.h | 3 +- storage/perfschema/table_status_by_thread.cc | 14 +- storage/perfschema/table_status_by_thread.h | 3 +- storage/perfschema/table_status_by_user.cc | 12 +- storage/perfschema/table_status_by_user.h | 3 +- storage/perfschema/table_sync_instances.cc | 32 +- storage/perfschema/table_sync_instances.h | 5 +- storage/perfschema/table_table_handles.cc | 12 +- storage/perfschema/table_table_handles.h | 3 +- storage/perfschema/table_threads.cc | 12 +- storage/perfschema/table_threads.h | 3 +- .../perfschema/table_tiws_by_index_usage.cc | 12 +- .../perfschema/table_tiws_by_index_usage.h | 3 +- storage/perfschema/table_tiws_by_table.cc | 12 +- storage/perfschema/table_tiws_by_table.h | 3 +- storage/perfschema/table_tlws_by_table.cc | 12 +- storage/perfschema/table_tlws_by_table.h | 3 +- storage/perfschema/table_users.cc | 12 +- storage/perfschema/table_users.h | 3 +- storage/perfschema/table_uvar_by_thread.cc | 12 +- storage/perfschema/table_uvar_by_thread.h | 3 +- .../perfschema/table_variables_by_thread.cc | 12 +- .../perfschema/table_variables_by_thread.h | 3 +- storage/perfschema/unittest/CMakeLists.txt | 2 +- storage/perfschema/unittest/conf.txt | 2 +- storage/perfschema/unittest/pfs-t.cc | 2 +- .../perfschema/unittest/pfs_account-oom-t.cc | 2 +- .../perfschema/unittest/pfs_connect_attr-t.cc | 2 +- storage/perfschema/unittest/pfs_host-oom-t.cc | 2 +- .../perfschema/unittest/pfs_instr-oom-t.cc | 2 +- storage/perfschema/unittest/pfs_instr-t.cc | 2 +- .../unittest/pfs_instr_class-oom-t.cc | 2 +- .../perfschema/unittest/pfs_instr_class-t.cc | 2 +- storage/perfschema/unittest/pfs_misc-t.cc | 2 +- storage/perfschema/unittest/pfs_noop-t.cc | 4 +- .../perfschema/unittest/pfs_server_stubs.cc | 2 +- storage/perfschema/unittest/pfs_timer-t.cc | 2 +- storage/perfschema/unittest/pfs_user-oom-t.cc | 2 +- .../unittest/stub_global_status_var.h | 2 +- .../perfschema/unittest/stub_pfs_defaults.h | 2 +- storage/perfschema/unittest/stub_pfs_global.h | 2 +- .../perfschema/unittest/stub_print_error.h | 2 +- 401 files changed, 4852 insertions(+), 527 deletions(-) create mode 100644 mysql-test/suite/perfschema/include/processlist_load.inc create mode 100644 mysql-test/suite/perfschema/include/processlist_set.inc create mode 100644 mysql-test/suite/perfschema/r/ddl_processlist.result create mode 100644 mysql-test/suite/perfschema/r/dml_processlist.result create mode 100644 mysql-test/suite/perfschema/r/misc_global_status.result create mode 100644 mysql-test/suite/perfschema/r/processlist.result create mode 100644 mysql-test/suite/perfschema/r/processlist_57.result create mode 100644 mysql-test/suite/perfschema/r/processlist_acl.result create mode 100644 mysql-test/suite/perfschema/r/processlist_anonymous.result create mode 100644 mysql-test/suite/perfschema/r/processlist_no_pfs.result create mode 100644 mysql-test/suite/perfschema/r/processlist_port.result create mode 100644 mysql-test/suite/perfschema/r/processlist_reg_user.result create mode 100644 mysql-test/suite/perfschema/t/ddl_processlist.test create mode 100644 mysql-test/suite/perfschema/t/dml_processlist.test create mode 100644 mysql-test/suite/perfschema/t/misc_global_status-master.opt create mode 100644 mysql-test/suite/perfschema/t/misc_global_status.test create mode 100644 mysql-test/suite/perfschema/t/processlist-master.opt create mode 100644 mysql-test/suite/perfschema/t/processlist.test create mode 100644 mysql-test/suite/perfschema/t/processlist_57.test create mode 100644 mysql-test/suite/perfschema/t/processlist_acl-master.opt create mode 100644 mysql-test/suite/perfschema/t/processlist_acl.test create mode 100644 mysql-test/suite/perfschema/t/processlist_anonymous.test create mode 100644 mysql-test/suite/perfschema/t/processlist_no_pfs-master.opt create mode 100644 mysql-test/suite/perfschema/t/processlist_no_pfs.test create mode 100644 mysql-test/suite/perfschema/t/processlist_port-master.opt create mode 100644 mysql-test/suite/perfschema/t/processlist_port.test create mode 100644 mysql-test/suite/perfschema/t/processlist_reg_user.test create mode 100644 storage/perfschema/table_processlist.cc create mode 100644 storage/perfschema/table_processlist.h diff --git a/include/mysql/psi/mysql_file.h b/include/mysql/psi/mysql_file.h index 9f87aa3e64f..8f0fe6d9c78 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 ca657b4476b..61a25f20a0e 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. This 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_mdl.h b/include/mysql/psi/mysql_mdl.h index 4dba7ccb2c1..45723a60d3b 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 11a8f8438a7..03dc181b83d 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 e664d07c451..a3291e3402e 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 ea86db0049c..3bc22dddca9 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. This 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_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 2e09004d93e..473611dc66d 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 953400ff7e0..bee98456d2f 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. This 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_table.h b/include/mysql/psi/mysql_table.h index 7492f41ca5b..a0755aa4c92 100644 --- a/include/mysql/psi/mysql_table.h +++ b/include/mysql/psi/mysql_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, diff --git a/include/mysql/psi/mysql_thread.h b/include/mysql/psi/mysql_thread.h index 479d1511df4..c25e90f2120 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. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -1320,6 +1320,13 @@ static inline void inline_mysql_thread_set_psi_THD(THD *thd) } #endif /* __cplusplus */ +static inline void mysql_thread_set_peer_port(uint port MY_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 075b8543fbd..763c3aa05dd 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 e16a194db1f..98bcffd7b5c 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, @@ -1678,6 +1678,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); @@ -2724,6 +2733,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 2272c41b9d5..2fe6546ecac 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 ba244be38b6..78c2ddb094f 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 10fcde7128e..b84be5867a9 100644 --- a/include/mysql/psi/psi_abi_v1.h.pp +++ b/include/mysql/psi/psi_abi_v1.h.pp @@ -463,6 +463,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) @@ -834,6 +836,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 c70cfc8cb93..0aeebaca779 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 624a55cff32..66d709b48ef 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, @@ -89,6 +89,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 4640a29b4ef..454c3dbe2a1 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/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 2 3 4 5 6