From 0b116d160a5f2179c1c92fbf4971217cf9061fb4 Mon Sep 17 00:00:00 2001
From: Sergei Golubchik <serg@mariadb.org>
Date: Mon, 3 May 2021 11:21:56 +0200
Subject: [PATCH] 5.7.34

---
 include/mysql/psi/mysql_file.h                |   4 +-
 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              |   2 +-
 include/mysql/psi/mysql_transaction.h         |   2 +-
 include/mysql/psi/psi.h                       |   2 +-
 include/mysql/psi/psi_abi_v0.h                |   2 +-
 include/mysql/psi/psi_abi_v1.h                |   2 +-
 include/mysql/psi/psi_abi_v2.h                |   2 +-
 include/mysql/psi/psi_base.h                  |   2 +-
 include/mysql/psi/psi_memory.h                |   2 +-
 .../perfschema/r/max_program_zero.result      |  24 +-
 mysql-test/suite/perfschema/r/misc.result     |   2 +-
 .../suite/perfschema/r/ortho_iter.result      |  26 +-
 .../perfschema/r/privilege_table_io.result    |  26 +-
 .../suite/perfschema/r/read_only.result       |  69 +++
 .../suite/perfschema/r/show_sanity.result     |   4 +
 .../r/start_server_disable_idle.result        |  26 +-
 .../r/start_server_disable_stages.result      |  26 +-
 .../r/start_server_disable_statements.result  |  26 +-
 .../start_server_disable_transactions.result  |  26 +-
 .../r/start_server_disable_waits.result       |  26 +-
 .../perfschema/r/start_server_innodb.result   |  26 +-
 .../r/start_server_low_index.result           |  24 +-
 .../r/start_server_low_table_lock.result      |  24 +-
 .../r/start_server_no_account.result          |  26 +-
 .../r/start_server_no_cond_class.result       |  26 +-
 .../r/start_server_no_cond_inst.result        |  24 +-
 .../r/start_server_no_file_class.result       |  26 +-
 .../r/start_server_no_file_inst.result        |  24 +-
 .../perfschema/r/start_server_no_host.result  |  26 +-
 .../perfschema/r/start_server_no_index.result |  24 +-
 .../perfschema/r/start_server_no_mdl.result   |  24 +-
 .../r/start_server_no_memory_class.result     |  26 +-
 .../r/start_server_no_mutex_class.result      |  26 +-
 .../r/start_server_no_mutex_inst.result       |  24 +-
 ..._server_no_prepared_stmts_instances.result |  24 +-
 .../r/start_server_no_rwlock_class.result     |  26 +-
 .../r/start_server_no_rwlock_inst.result      |  24 +-
 .../r/start_server_no_setup_actors.result     |  26 +-
 .../r/start_server_no_setup_objects.result    |  26 +-
 .../r/start_server_no_socket_class.result     |  26 +-
 .../r/start_server_no_socket_inst.result      |  24 +-
 .../r/start_server_no_stage_class.result      |  26 +-
 .../r/start_server_no_stages_history.result   |  26 +-
 ...start_server_no_stages_history_long.result |  26 +-
 .../r/start_server_no_statement_class.result  |  26 +-
 .../start_server_no_statements_history.result |  26 +-
 ...t_server_no_statements_history_long.result |  26 +-
 .../r/start_server_no_table_hdl.result        |  28 +-
 .../r/start_server_no_table_inst.result       |  22 +-
 .../r/start_server_no_table_lock.result       |  24 +-
 .../r/start_server_no_thread_class.result     |  26 +-
 .../r/start_server_no_thread_inst.result      |  24 +-
 ...tart_server_no_transactions_history.result |  26 +-
 ...server_no_transactions_history_long.result |  26 +-
 .../perfschema/r/start_server_no_user.result  |  26 +-
 .../r/start_server_no_waits_history.result    |  26 +-
 .../start_server_no_waits_history_long.result |  26 +-
 .../perfschema/r/start_server_nothing.result  |   4 +-
 .../suite/perfschema/r/start_server_on.result |  26 +-
 .../r/statement_program_lost_inst.result      |  24 +-
 .../r/table_aggregate_global_2u_2t.result     |  26 +-
 .../r/table_aggregate_global_2u_3t.result     |  26 +-
 .../r/table_aggregate_global_4u_2t.result     |  26 +-
 .../r/table_aggregate_global_4u_3t.result     |  26 +-
 .../r/table_aggregate_hist_2u_2t.result       |  26 +-
 .../r/table_aggregate_hist_2u_3t.result       |  26 +-
 .../r/table_aggregate_hist_4u_2t.result       |  26 +-
 .../r/table_aggregate_hist_4u_3t.result       |  26 +-
 .../perfschema/r/table_aggregate_off.result   |  26 +-
 .../r/table_aggregate_thread_2u_2t.result     |  26 +-
 .../r/table_aggregate_thread_2u_3t.result     |  26 +-
 .../r/table_aggregate_thread_4u_2t.result     |  26 +-
 .../r/table_aggregate_thread_4u_3t.result     |  26 +-
 .../r/table_io_aggregate_global_2u_2t.result  |  26 +-
 .../r/table_io_aggregate_global_2u_3t.result  |  26 +-
 .../r/table_io_aggregate_global_4u_2t.result  |  26 +-
 .../r/table_io_aggregate_global_4u_3t.result  |  26 +-
 .../r/table_io_aggregate_hist_2u_2t.result    |  26 +-
 .../r/table_io_aggregate_hist_2u_3t.result    |  26 +-
 .../r/table_io_aggregate_hist_4u_2t.result    |  26 +-
 .../r/table_io_aggregate_hist_4u_3t.result    |  26 +-
 .../r/table_io_aggregate_thread_2u_2t.result  |  26 +-
 .../r/table_io_aggregate_thread_2u_3t.result  |  26 +-
 .../r/table_io_aggregate_thread_4u_2t.result  |  26 +-
 .../r/table_io_aggregate_thread_4u_3t.result  |  26 +-
 .../table_lock_aggregate_global_2u_2t.result  |  26 +-
 .../table_lock_aggregate_global_2u_3t.result  |  26 +-
 .../table_lock_aggregate_global_4u_2t.result  |  26 +-
 .../table_lock_aggregate_global_4u_3t.result  |  26 +-
 .../r/table_lock_aggregate_hist_2u_2t.result  |  26 +-
 .../r/table_lock_aggregate_hist_2u_3t.result  |  26 +-
 .../r/table_lock_aggregate_hist_4u_2t.result  |  26 +-
 .../r/table_lock_aggregate_hist_4u_3t.result  |  26 +-
 .../table_lock_aggregate_thread_2u_2t.result  |  26 +-
 .../table_lock_aggregate_thread_2u_3t.result  |  26 +-
 .../table_lock_aggregate_thread_4u_2t.result  |  26 +-
 .../table_lock_aggregate_thread_4u_3t.result  |  26 +-
 mysql-test/suite/perfschema/t/read_only.test  |  87 ++++
 storage/perfschema/CMakeLists.txt             |   2 +-
 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           |  28 +-
 storage/perfschema/ha_perfschema.h            |   6 +-
 storage/perfschema/pfs.cc                     | 490 +++++++++---------
 storage/perfschema/pfs.h                      |   2 +-
 storage/perfschema/pfs_account.cc             |  12 +-
 storage/perfschema/pfs_account.h              |   2 +-
 storage/perfschema/pfs_atomic.h               |   2 +-
 storage/perfschema/pfs_autosize.cc            |  20 +-
 storage/perfschema/pfs_buffer_container.cc    |   2 +-
 storage/perfschema/pfs_buffer_container.h     |  30 +-
 storage/perfschema/pfs_builtin_memory.cc      |   4 +-
 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              |  10 +-
 storage/perfschema/pfs_digest.h               |   2 +-
 storage/perfschema/pfs_engine_table.cc        |  40 +-
 storage/perfschema/pfs_engine_table.h         |   2 +-
 storage/perfschema/pfs_events.h               |   2 +-
 storage/perfschema/pfs_events_stages.cc       |   6 +-
 storage/perfschema/pfs_events_stages.h        |   2 +-
 storage/perfschema/pfs_events_statements.cc   |   6 +-
 storage/perfschema/pfs_events_statements.h    |   2 +-
 storage/perfschema/pfs_events_transactions.cc |   8 +-
 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              |  20 +-
 storage/perfschema/pfs_global.h               |   4 +-
 storage/perfschema/pfs_host.cc                |  10 +-
 storage/perfschema/pfs_host.h                 |   2 +-
 storage/perfschema/pfs_instr.cc               |  64 +--
 storage/perfschema/pfs_instr.h                |   2 +-
 storage/perfschema/pfs_instr_class.cc         |  26 +-
 storage/perfschema/pfs_instr_class.h          |   6 +-
 storage/perfschema/pfs_lock.h                 |  10 +-
 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             |  10 +-
 storage/perfschema/pfs_program.h              |   2 +-
 storage/perfschema/pfs_server.cc              |   4 +-
 storage/perfschema/pfs_server.h               |   2 +-
 storage/perfschema/pfs_setup_actor.cc         |  10 +-
 storage/perfschema/pfs_setup_actor.h          |   2 +-
 storage/perfschema/pfs_setup_object.cc        |  12 +-
 storage/perfschema/pfs_setup_object.h         |   2 +-
 storage/perfschema/pfs_stat.h                 |   6 +-
 storage/perfschema/pfs_status.cc              |   2 +-
 storage/perfschema/pfs_status.h               |   2 +-
 storage/perfschema/pfs_timer.cc               |  12 +-
 storage/perfschema/pfs_timer.h                |   2 +-
 storage/perfschema/pfs_user.cc                |  10 +-
 storage/perfschema/pfs_user.h                 |   2 +-
 storage/perfschema/pfs_variable.cc            |  38 +-
 storage/perfschema/pfs_variable.h             |   4 +-
 storage/perfschema/pfs_visitor.cc             |  50 +-
 storage/perfschema/pfs_visitor.h              |   2 +-
 storage/perfschema/table_accounts.cc          |   6 +-
 storage/perfschema/table_accounts.h           |   2 +-
 storage/perfschema/table_all_instr.cc         |   2 +-
 storage/perfschema/table_all_instr.h          |   2 +-
 .../table_esgs_by_account_by_event_name.cc    |   4 +-
 .../table_esgs_by_account_by_event_name.h     |   2 +-
 .../table_esgs_by_host_by_event_name.cc       |   4 +-
 .../table_esgs_by_host_by_event_name.h        |   2 +-
 .../table_esgs_by_thread_by_event_name.cc     |   4 +-
 .../table_esgs_by_thread_by_event_name.h      |   2 +-
 .../table_esgs_by_user_by_event_name.cc       |   4 +-
 .../table_esgs_by_user_by_event_name.h        |   2 +-
 .../table_esgs_global_by_event_name.cc        |   4 +-
 .../table_esgs_global_by_event_name.h         |   2 +-
 .../table_esms_by_account_by_event_name.cc    |   4 +-
 .../table_esms_by_account_by_event_name.h     |   2 +-
 storage/perfschema/table_esms_by_digest.cc    |   4 +-
 storage/perfschema/table_esms_by_digest.h     |   2 +-
 .../table_esms_by_host_by_event_name.cc       |   4 +-
 .../table_esms_by_host_by_event_name.h        |   2 +-
 storage/perfschema/table_esms_by_program.cc   |   4 +-
 storage/perfschema/table_esms_by_program.h    |   2 +-
 .../table_esms_by_thread_by_event_name.cc     |   4 +-
 .../table_esms_by_thread_by_event_name.h      |   2 +-
 .../table_esms_by_user_by_event_name.cc       |   4 +-
 .../table_esms_by_user_by_event_name.h        |   2 +-
 .../table_esms_global_by_event_name.cc        |   4 +-
 .../table_esms_global_by_event_name.h         |   2 +-
 .../table_ets_by_account_by_event_name.cc     |   4 +-
 .../table_ets_by_account_by_event_name.h      |   2 +-
 .../table_ets_by_host_by_event_name.cc        |   4 +-
 .../table_ets_by_host_by_event_name.h         |   2 +-
 .../table_ets_by_thread_by_event_name.cc      |   4 +-
 .../table_ets_by_thread_by_event_name.h       |   2 +-
 .../table_ets_by_user_by_event_name.cc        |   4 +-
 .../table_ets_by_user_by_event_name.h         |   2 +-
 .../table_ets_global_by_event_name.cc         |   4 +-
 .../table_ets_global_by_event_name.h          |   2 +-
 storage/perfschema/table_events_stages.cc     |  10 +-
 storage/perfschema/table_events_stages.h      |   2 +-
 storage/perfschema/table_events_statements.cc |  12 +-
 storage/perfschema/table_events_statements.h  |   2 +-
 .../perfschema/table_events_transactions.cc   |  16 +-
 .../perfschema/table_events_transactions.h    |   2 +-
 storage/perfschema/table_events_waits.cc      |  12 +-
 storage/perfschema/table_events_waits.h       |   2 +-
 .../perfschema/table_events_waits_summary.cc  |   6 +-
 .../perfschema/table_events_waits_summary.h   |   2 +-
 .../table_ews_by_account_by_event_name.cc     |   8 +-
 .../table_ews_by_account_by_event_name.h      |   2 +-
 .../table_ews_by_host_by_event_name.cc        |   8 +-
 .../table_ews_by_host_by_event_name.h         |   2 +-
 .../table_ews_by_thread_by_event_name.cc      |   8 +-
 .../table_ews_by_thread_by_event_name.h       |   2 +-
 .../table_ews_by_user_by_event_name.cc        |   8 +-
 .../table_ews_by_user_by_event_name.h         |   2 +-
 .../table_ews_global_by_event_name.cc         |  10 +-
 .../table_ews_global_by_event_name.h          |   2 +-
 storage/perfschema/table_file_instances.cc    |   6 +-
 storage/perfschema/table_file_instances.h     |   2 +-
 .../table_file_summary_by_event_name.cc       |   6 +-
 .../table_file_summary_by_event_name.h        |   2 +-
 .../table_file_summary_by_instance.cc         |   6 +-
 .../table_file_summary_by_instance.h          |   2 +-
 storage/perfschema/table_global_status.cc     |   6 +-
 storage/perfschema/table_global_status.h      |   2 +-
 storage/perfschema/table_global_variables.cc  |   8 +-
 storage/perfschema/table_global_variables.h   |   2 +-
 storage/perfschema/table_helper.cc            |  42 +-
 storage/perfschema/table_helper.h             |   4 +-
 storage/perfschema/table_host_cache.cc        |  16 +-
 storage/perfschema/table_host_cache.h         |   2 +-
 storage/perfschema/table_hosts.cc             |   6 +-
 storage/perfschema/table_hosts.h              |   2 +-
 storage/perfschema/table_md_locks.cc          |   6 +-
 storage/perfschema/table_md_locks.h           |   2 +-
 .../table_mems_by_account_by_event_name.cc    |   4 +-
 .../table_mems_by_account_by_event_name.h     |   2 +-
 .../table_mems_by_host_by_event_name.cc       |   4 +-
 .../table_mems_by_host_by_event_name.h        |   2 +-
 .../table_mems_by_thread_by_event_name.cc     |   4 +-
 .../table_mems_by_thread_by_event_name.h      |   2 +-
 .../table_mems_by_user_by_event_name.cc       |   4 +-
 .../table_mems_by_user_by_event_name.h        |   2 +-
 .../table_mems_global_by_event_name.cc        |   4 +-
 .../table_mems_global_by_event_name.h         |   2 +-
 storage/perfschema/table_os_global_by_type.cc |   6 +-
 storage/perfschema/table_os_global_by_type.h  |   2 +-
 .../perfschema/table_performance_timers.cc    |  10 +-
 storage/perfschema/table_performance_timers.h |   2 +-
 .../table_prepared_stmt_instances.cc          |   4 +-
 .../table_prepared_stmt_instances.h           |   2 +-
 ...table_replication_applier_configuration.cc |  10 +-
 .../table_replication_applier_configuration.h |   2 +-
 .../table_replication_applier_status.cc       |  10 +-
 .../table_replication_applier_status.h        |   2 +-
 ...plication_applier_status_by_coordinator.cc |  10 +-
 ...eplication_applier_status_by_coordinator.h |   2 +-
 ...le_replication_applier_status_by_worker.cc |  14 +-
 ...ble_replication_applier_status_by_worker.h |   2 +-
 ...le_replication_connection_configuration.cc |   8 +-
 ...ble_replication_connection_configuration.h |   2 +-
 .../table_replication_connection_status.cc    |  10 +-
 .../table_replication_connection_status.h     |   2 +-
 .../table_replication_group_member_stats.cc   |   8 +-
 .../table_replication_group_member_stats.h    |   2 +-
 .../table_replication_group_members.cc        |   8 +-
 .../table_replication_group_members.h         |   2 +-
 .../table_session_account_connect_attrs.cc    |   4 +-
 .../table_session_account_connect_attrs.h     |   2 +-
 storage/perfschema/table_session_connect.cc   |   6 +-
 storage/perfschema/table_session_connect.h    |   2 +-
 .../perfschema/table_session_connect_attrs.cc |   2 +-
 .../perfschema/table_session_connect_attrs.h  |   2 +-
 storage/perfschema/table_session_status.cc    |   8 +-
 storage/perfschema/table_session_status.h     |   2 +-
 storage/perfschema/table_session_variables.cc |   8 +-
 storage/perfschema/table_session_variables.h  |   2 +-
 storage/perfschema/table_setup_actors.cc      |  12 +-
 storage/perfschema/table_setup_actors.h       |   2 +-
 storage/perfschema/table_setup_consumers.cc   |  14 +-
 storage/perfschema/table_setup_consumers.h    |   2 +-
 storage/perfschema/table_setup_instruments.cc |  10 +-
 storage/perfschema/table_setup_instruments.h  |   2 +-
 storage/perfschema/table_setup_objects.cc     |  12 +-
 storage/perfschema/table_setup_objects.h      |   2 +-
 storage/perfschema/table_setup_timers.cc      |  14 +-
 storage/perfschema/table_setup_timers.h       |   2 +-
 storage/perfschema/table_socket_instances.cc  |   6 +-
 storage/perfschema/table_socket_instances.h   |   2 +-
 .../table_socket_summary_by_event_name.cc     |   6 +-
 .../table_socket_summary_by_event_name.h      |   2 +-
 .../table_socket_summary_by_instance.cc       |   6 +-
 .../table_socket_summary_by_instance.h        |   2 +-
 storage/perfschema/table_status_by_account.cc |   8 +-
 storage/perfschema/table_status_by_account.h  |   2 +-
 storage/perfschema/table_status_by_host.cc    |   8 +-
 storage/perfschema/table_status_by_host.h     |   2 +-
 storage/perfschema/table_status_by_thread.cc  |   8 +-
 storage/perfschema/table_status_by_thread.h   |   2 +-
 storage/perfschema/table_status_by_user.cc    |   8 +-
 storage/perfschema/table_status_by_user.h     |   2 +-
 storage/perfschema/table_sync_instances.cc    |  14 +-
 storage/perfschema/table_sync_instances.h     |   2 +-
 storage/perfschema/table_table_handles.cc     |   6 +-
 storage/perfschema/table_table_handles.h      |   2 +-
 storage/perfschema/table_threads.cc           |  10 +-
 storage/perfschema/table_threads.h            |   2 +-
 .../perfschema/table_tiws_by_index_usage.cc   |   8 +-
 .../perfschema/table_tiws_by_index_usage.h    |   2 +-
 storage/perfschema/table_tiws_by_table.cc     |   6 +-
 storage/perfschema/table_tiws_by_table.h      |   2 +-
 storage/perfschema/table_tlws_by_table.cc     |   6 +-
 storage/perfschema/table_tlws_by_table.h      |   2 +-
 storage/perfschema/table_users.cc             |   6 +-
 storage/perfschema/table_users.h              |   2 +-
 storage/perfschema/table_uvar_by_thread.cc    |  12 +-
 storage/perfschema/table_uvar_by_thread.h     |   4 +-
 .../perfschema/table_variables_by_thread.cc   |   8 +-
 .../perfschema/table_variables_by_thread.h    |   2 +-
 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     |   2 +-
 .../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 |   4 +-
 .../perfschema/unittest/stub_print_error.h    |   2 +-
 362 files changed, 2191 insertions(+), 2031 deletions(-)

diff --git a/include/mysql/psi/mysql_file.h b/include/mysql/psi/mysql_file.h
index a7d0bcbc86b..9f87aa3e64f 100644
--- a/include/mysql/psi/mysql_file.h
+++ b/include/mysql/psi/mysql_file.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -218,7 +218,7 @@
   With the instrumentation, mysql_fclose(NULL, ...) will safely return 0,
   which is an extension compared to my_fclose and is therefore compliant.
   mysql_fclose is on purpose *not* implementing
-  @code DBUG_ASSERT(file != NULL) @endcode,
+  @code assert(file != NULL) @endcode,
   since doing so could introduce regressions.
 */
 #ifdef HAVE_PSI_FILE_INTERFACE
diff --git a/include/mysql/psi/mysql_idle.h b/include/mysql/psi/mysql_idle.h
index 662de59f1d9..ca657b4476b 100644
--- a/include/mysql/psi/mysql_idle.h
+++ b/include/mysql/psi/mysql_idle.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
 
   This 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 0db0160c77d..4dba7ccb2c1 100644
--- a/include/mysql/psi/mysql_mdl.h
+++ b/include/mysql/psi/mysql_mdl.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
 
   This 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 2955c9d303e..11a8f8438a7 100644
--- a/include/mysql/psi/mysql_memory.h
+++ b/include/mysql/psi/mysql_memory.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
 
   This 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 e68994d949c..e664d07c451 100644
--- a/include/mysql/psi/mysql_ps.h
+++ b/include/mysql/psi/mysql_ps.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2014, 2021, Oracle and/or its affiliates.
 
   This 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 94e17c4f866..ea86db0049c 100644
--- a/include/mysql/psi/mysql_socket.h
+++ b/include/mysql/psi/mysql_socket.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
 This 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 5eeea37f4c4..68b79f1b852 100644
--- a/include/mysql/psi/mysql_sp.h
+++ b/include/mysql/psi/mysql_sp.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
 
   This 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 fa6dbc2df61..2e09004d93e 100644
--- a/include/mysql/psi/mysql_stage.h
+++ b/include/mysql/psi/mysql_stage.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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 597d15270a6..953400ff7e0 100644
--- a/include/mysql/psi/mysql_statement.h
+++ b/include/mysql/psi/mysql_statement.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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 bad0ae3cdfd..7492f41ca5b 100644
--- a/include/mysql/psi/mysql_table.h
+++ b/include/mysql/psi/mysql_table.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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 7f87192182f..479d1511df4 100644
--- a/include/mysql/psi/mysql_thread.h
+++ b/include/mysql/psi/mysql_thread.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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_transaction.h b/include/mysql/psi/mysql_transaction.h
index 41629395ee0..075b8543fbd 100644
--- a/include/mysql/psi/mysql_transaction.h
+++ b/include/mysql/psi/mysql_transaction.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
 
   This 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 34422d31b8f..e16a194db1f 100644
--- a/include/mysql/psi/psi.h
+++ b/include/mysql/psi/psi.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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_v0.h b/include/mysql/psi/psi_abi_v0.h
index da643cd3539..2272c41b9d5 100644
--- a/include/mysql/psi/psi_abi_v0.h
+++ b/include/mysql/psi/psi_abi_v0.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
 
   This 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 723e5aa3216..ba244be38b6 100644
--- a/include/mysql/psi/psi_abi_v1.h
+++ b/include/mysql/psi/psi_abi_v1.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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_v2.h b/include/mysql/psi/psi_abi_v2.h
index 385bc9a5c5e..c70cfc8cb93 100644
--- a/include/mysql/psi/psi_abi_v2.h
+++ b/include/mysql/psi/psi_abi_v2.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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 d9f2520c215..624a55cff32 100644
--- a/include/mysql/psi/psi_base.h
+++ b/include/mysql/psi/psi_base.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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_memory.h b/include/mysql/psi/psi_memory.h
index d6915a11a72..4640a29b4ef 100644
--- a/include/mysql/psi/psi_memory.h
+++ b/include/mysql/psi/psi_memory.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
 
   This 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/r/max_program_zero.result b/mysql-test/suite/perfschema/r/max_program_zero.result
index 54a203e8289..9a2a30f2f9e 100644
--- a/mysql-test/suite/perfschema/r/max_program_zero.result
+++ b/mysql-test/suite/perfschema/r/max_program_zero.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
 performance_schema_max_program_instances	0
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	1
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/misc.result b/mysql-test/suite/perfschema/r/misc.result
index c3214c1ff06..038c442a650 100644
--- a/mysql-test/suite/perfschema/r/misc.result
+++ b/mysql-test/suite/perfschema/r/misc.result
@@ -94,7 +94,7 @@ test	t_60905	NULL	5	5	0	1
 DROP TABLE t_60905;
 show global variables like "performance_schema_max_thread_instances";
 Variable_name	Value
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 explain select * from performance_schema.threads;
 id	select_type	table	partitions	type	possible_keys	key	key_len	ref	rows	filtered	Extra
 1	SIMPLE	threads	NULL	ALL	NULL	NULL	NULL	NULL	256	100.00	NULL
diff --git a/mysql-test/suite/perfschema/r/ortho_iter.result b/mysql-test/suite/perfschema/r/ortho_iter.result
index dbb5eed68a5..4bbddd0c04b 100644
--- a/mysql-test/suite/perfschema/r/ortho_iter.result
+++ b/mysql-test/suite/perfschema/r/ortho_iter.result
@@ -230,31 +230,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/privilege_table_io.result b/mysql-test/suite/perfschema/r/privilege_table_io.result
index 356e2390bec..7b8ae29e260 100644
--- a/mysql-test/suite/perfschema/r/privilege_table_io.result
+++ b/mysql-test/suite/perfschema/r/privilege_table_io.result
@@ -37,31 +37,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/read_only.result b/mysql-test/suite/perfschema/r/read_only.result
index 0aa745151e5..01764bc8c2e 100644
--- a/mysql-test/suite/perfschema/r/read_only.result
+++ b/mysql-test/suite/perfschema/r/read_only.result
@@ -70,6 +70,75 @@ select * from performance_schema.setup_instruments;
 # super user.
 update performance_schema.setup_instruments set enabled='NO';
 update performance_schema.setup_instruments set enabled='YES';
+#
+# Bug#31080309 - REGRESSION FOR BUG 81009 FIXED IN 5.7.17
+#   Bug23103937(BUG81009) - PS_TRUNCATE_ALL_TABLES() DOES NOT WORK IN
+#                           SUPER_READ_ONLY MODE.
+#
+connection default;
+# Reset read_only and super_read_only mode.
+set global read_only=0;
+set global super_read_only=0;
+# Grant truncate table and execute stored procedure privileges to pfsuser.
+grant DROP on performance_schema.* to pfsuser@localhost;
+grant EXECUTE on procedure sys.ps_truncate_all_tables to pfsuser@localhost;
+#-----------------------------------------------------------------------
+# Test case to verify truncate operation on performance schema table by
+# super user with super_read_only=ON.
+#-----------------------------------------------------------------------
+# Set super_read_only mode.
+set global super_read_only=1;
+connection con1;
+# truncate operation is allowed in super_read_only mode on performance schema
+# tables for super user.
+# Without fix following statements fail because of super read only mode.
+truncate table performance_schema.events_statements_summary_by_digest;
+call sys.ps_truncate_all_tables(0);
+#-----------------------------------------------------------------------
+# Test case to verify truncate operation on performance schema table by
+# super user with read_only=ON.
+#-----------------------------------------------------------------------
+connection default;
+# Reset super_read_only mode.
+set global super_read_only=0;
+# Set read_only mode.
+set global read_only=1;
+connection con1;
+# truncate operation is allowed in read_only mode on performance schema
+# tables for super user.
+# Without fix following statements fail because of super read only mode.
+truncate table performance_schema.events_statements_summary_by_digest;
+call sys.ps_truncate_all_tables(0);
+#-----------------------------------------------------------------------
+# Test case to verify truncate operation on performance schema table by
+# non-super user with super_read_only=ON.
+#-----------------------------------------------------------------------
+connection default;
+set global super_read_only=0;
+# Revoke SUPER privilege from pfsuser.
+revoke SUPER on *.* from pfsuser@localhost;
+# Reset super_read_only mode.
+set global super_read_only=1;
+connection con1;
+# truncate operation is allowed in super_read_only mode on performance schema
+# tables for non-super user.
+truncate table performance_schema.events_statements_summary_by_digest;
+call sys.ps_truncate_all_tables(0);
+#-----------------------------------------------------------------------
+# Test case to verify truncate operation on performance schema table by
+# non-super user with read_only=ON.
+#-----------------------------------------------------------------------
+connection default;
+# Reset super_read_only mode.
+set global super_read_only=0;
+# Set read_only mode.
+set global read_only=1;
+connection con1;
+# truncate operation is allowed in read_only mode on performance schema
+# tables for non-super user.
+truncate table performance_schema.events_statements_summary_by_digest;
+call sys.ps_truncate_all_tables(0);
+########################################################################
 disconnect con1;
 connection default;
 set global read_only= @start_read_only;
diff --git a/mysql-test/suite/perfschema/r/show_sanity.result b/mysql-test/suite/perfschema/r/show_sanity.result
index 71bc92a2c2f..dc326dd7f64 100644
--- a/mysql-test/suite/perfschema/r/show_sanity.result
+++ b/mysql-test/suite/perfschema/r/show_sanity.result
@@ -414,6 +414,8 @@ 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	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
 
 ================================================================================
@@ -442,6 +444,8 @@ 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	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/start_server_disable_idle.result b/mysql-test/suite/perfschema/r/start_server_disable_idle.result
index 03373d66b78..1204e4b57a9 100644
--- a/mysql-test/suite/perfschema/r/start_server_disable_idle.result
+++ b/mysql-test/suite/perfschema/r/start_server_disable_idle.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_disable_stages.result b/mysql-test/suite/perfschema/r/start_server_disable_stages.result
index a2becc0b603..3aa4a6b9573 100644
--- a/mysql-test/suite/perfschema/r/start_server_disable_stages.result
+++ b/mysql-test/suite/perfschema/r/start_server_disable_stages.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_disable_statements.result b/mysql-test/suite/perfschema/r/start_server_disable_statements.result
index 1c9cfb977ee..a3f20107af5 100644
--- a/mysql-test/suite/perfschema/r/start_server_disable_statements.result
+++ b/mysql-test/suite/perfschema/r/start_server_disable_statements.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_disable_transactions.result b/mysql-test/suite/perfschema/r/start_server_disable_transactions.result
index ca4e6842be4..d77a12f83f2 100644
--- a/mysql-test/suite/perfschema/r/start_server_disable_transactions.result
+++ b/mysql-test/suite/perfschema/r/start_server_disable_transactions.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_disable_waits.result b/mysql-test/suite/perfschema/r/start_server_disable_waits.result
index 28deef3ef73..b59e7b08023 100644
--- a/mysql-test/suite/perfschema/r/start_server_disable_waits.result
+++ b/mysql-test/suite/perfschema/r/start_server_disable_waits.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_innodb.result b/mysql-test/suite/perfschema/r/start_server_innodb.result
index 740ed6cb25b..7caf2863dfc 100644
--- a/mysql-test/suite/perfschema/r/start_server_innodb.result
+++ b/mysql-test/suite/perfschema/r/start_server_innodb.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_low_index.result b/mysql-test/suite/perfschema/r/start_server_low_index.result
index e829c460feb..87ac365e02c 100644
--- a/mysql-test/suite/perfschema/r/start_server_low_index.result
+++ b/mysql-test/suite/perfschema/r/start_server_low_index.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
+performance_schema_max_file_instances	-1
 performance_schema_max_index_stat	38
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_low_table_lock.result b/mysql-test/suite/perfschema/r/start_server_low_table_lock.result
index b0f3bbadfdf..32ff64949a6 100644
--- a/mysql-test/suite/perfschema/r/start_server_low_table_lock.result
+++ b/mysql-test/suite/perfschema/r/start_server_low_table_lock.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
 performance_schema_max_table_lock_stat	1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_no_account.result b/mysql-test/suite/perfschema/r/start_server_no_account.result
index def072610a4..7986377ec34 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_account.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_account.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_no_cond_class.result b/mysql-test/suite/perfschema/r/start_server_no_cond_class.result
index 276249c2b76..d97efeaca69 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_cond_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_cond_class.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	0
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result b/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result
index b48a699e367..e3b5332b302 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result
@@ -126,27 +126,27 @@ performance_schema_max_cond_instances	0
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_no_file_class.result b/mysql-test/suite/perfschema/r/start_server_no_file_class.result
index 11cae0adaf5..152452cc373 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_file_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_file_class.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	0
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_no_file_inst.result b/mysql-test/suite/perfschema/r/start_server_no_file_inst.result
index 5d2a9903cd8..b3a177e5f7f 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_file_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_file_inst.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
 performance_schema_max_file_instances	0
-performance_schema_max_index_stat	5000
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_no_host.result b/mysql-test/suite/perfschema/r/start_server_no_host.result
index cc848fa2edf..434208b573a 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_host.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_host.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	0
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_no_index.result b/mysql-test/suite/perfschema/r/start_server_no_index.result
index 2233f2c7210..31bfffc1ce7 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_index.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_index.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
+performance_schema_max_file_instances	-1
 performance_schema_max_index_stat	0
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_no_mdl.result b/mysql-test/suite/perfschema/r/start_server_no_mdl.result
index d9b6c8630e3..6da730a39ea 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_mdl.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_mdl.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
 performance_schema_max_metadata_locks	0
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_no_memory_class.result b/mysql-test/suite/perfschema/r/start_server_no_memory_class.result
index ba3e9bea7d5..06f337c1dff 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_memory_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_memory_class.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	0
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result b/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result
index 4714f33e433..b966284b954 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	0
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result b/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result
index 41dc11311d4..ba7f80ec857 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
 performance_schema_max_mutex_instances	0
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_no_prepared_stmts_instances.result b/mysql-test/suite/perfschema/r/start_server_no_prepared_stmts_instances.result
index 1c047e94978..bd5643707b1 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_prepared_stmts_instances.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_prepared_stmts_instances.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
+performance_schema_max_mutex_instances	-1
 performance_schema_max_prepared_statements_instances	0
-performance_schema_max_program_instances	5000
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result b/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result
index a161f5d6aeb..17b55f88f04 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	0
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result b/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result
index b81a6377aec..b8aebe52838 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
 performance_schema_max_rwlock_instances	0
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result b/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result
index 68c3086d5d8..c46c1b61150 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	0
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result b/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result
index a0020934260..206ba243a02 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	0
diff --git a/mysql-test/suite/perfschema/r/start_server_no_socket_class.result b/mysql-test/suite/perfschema/r/start_server_no_socket_class.result
index 37e56a623e1..1a7de31d12c 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_socket_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_socket_class.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	0
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result b/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result
index ab454eb3ce1..0ee80fbdc34 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
 performance_schema_max_socket_instances	0
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_no_stage_class.result b/mysql-test/suite/perfschema/r/start_server_no_stage_class.result
index 7a6e45269f0..83218d0cd0c 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_stage_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_stage_class.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	0
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_no_stages_history.result b/mysql-test/suite/perfschema/r/start_server_no_stages_history.result
index 28ae3017e13..7605a6742ea 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_stages_history.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_stages_history.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result
index e08a4d879e9..0a657b0207d 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_no_statement_class.result b/mysql-test/suite/perfschema/r/start_server_no_statement_class.result
index cb283dc4892..8340c9a065e 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_statement_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_statement_class.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	0
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_no_statements_history.result b/mysql-test/suite/perfschema/r/start_server_no_statements_history.result
index 9ce6f38b500..41ec7acac67 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_statements_history.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_statements_history.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result
index 2d3640fa00c..e730dd5f917 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result b/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result
index d89e5ab03be..e2c97655595 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
 performance_schema_max_table_handles	0
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
@@ -155,7 +155,7 @@ show engine PERFORMANCE_SCHEMA status;
 show global status like "performance_schema%";
 show global variables like "performance_schema_max_table_instances";
 Variable_name	Value
-performance_schema_max_table_instances	500
+performance_schema_max_table_instances	-1
 show global variables like "performance_schema_max_table_handles";
 Variable_name	Value
 performance_schema_max_table_handles	0
@@ -170,7 +170,7 @@ a
 drop table test.instrument_me;
 show global variables like "performance_schema_max_table_instances";
 Variable_name	Value
-performance_schema_max_table_instances	500
+performance_schema_max_table_instances	-1
 select variable_value > 0 from information_schema.global_status
 where variable_name like 'PERFORMANCE_SCHEMA_TABLE_HANDLES_LOST';
 variable_value > 0
diff --git a/mysql-test/suite/perfschema/r/start_server_no_table_inst.result b/mysql-test/suite/perfschema/r/start_server_no_table_inst.result
index 6732eaa34f4..a591154e1a5 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_table_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_table_inst.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
+performance_schema_max_file_instances	-1
 performance_schema_max_index_stat	0
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
+performance_schema_max_table_handles	-1
 performance_schema_max_table_instances	0
 performance_schema_max_table_lock_stat	0
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
@@ -158,7 +158,7 @@ Variable_name	Value
 performance_schema_max_table_instances	0
 show global variables like "performance_schema_max_table_handles";
 Variable_name	Value
-performance_schema_max_table_handles	1000
+performance_schema_max_table_handles	-1
 drop table if exists test.instrument_me;
 create table test.instrument_me(a int);
 insert into test.instrument_me values (1), (2), (3);
diff --git a/mysql-test/suite/perfschema/r/start_server_no_table_lock.result b/mysql-test/suite/perfschema/r/start_server_no_table_lock.result
index b530246a27f..ca0b4a864a9 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_table_lock.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_table_lock.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
 performance_schema_max_table_lock_stat	0
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_no_thread_class.result b/mysql-test/suite/perfschema/r/start_server_no_thread_class.result
index cd900fec3f8..bd2718de70d 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_thread_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_thread_class.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	0
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result b/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result
index d69a8622f66..6eefbf7e885 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result
@@ -122,29 +122,29 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
 performance_schema_max_thread_instances	0
 performance_schema_session_connect_attrs_size	2048
diff --git a/mysql-test/suite/perfschema/r/start_server_no_transactions_history.result b/mysql-test/suite/perfschema/r/start_server_no_transactions_history.result
index f6739aa055b..69e26208045 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_transactions_history.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_transactions_history.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_no_transactions_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_transactions_history_long.result
index 581019a044f..c5f2aa23e76 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_transactions_history_long.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_transactions_history_long.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_no_user.result b/mysql-test/suite/perfschema/r/start_server_no_user.result
index a2a1bc121ee..6d226ad8d5d 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_user.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_user.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_no_waits_history.result b/mysql-test/suite/perfschema/r/start_server_no_waits_history.result
index ef82e08f55e..801b8990bdd 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_waits_history.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_waits_history.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	0
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result
index e67b8de7af8..9a2b667d1ef 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	0
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/start_server_nothing.result b/mysql-test/suite/perfschema/r/start_server_nothing.result
index 7be6be09ba8..0c708b77381 100644
--- a/mysql-test/suite/perfschema/r/start_server_nothing.result
+++ b/mysql-test/suite/perfschema/r/start_server_nothing.result
@@ -132,7 +132,7 @@ 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	100
+performance_schema_max_prepared_statements_instances	-1
 performance_schema_max_program_instances	0
 performance_schema_max_rwlock_classes	0
 performance_schema_max_rwlock_instances	0
@@ -178,7 +178,7 @@ 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	100
+performance_schema_max_prepared_statements_instances	-1
 performance_schema_max_program_instances	0
 performance_schema_max_rwlock_classes	0
 performance_schema_max_rwlock_instances	0
diff --git a/mysql-test/suite/perfschema/r/start_server_on.result b/mysql-test/suite/perfschema/r/start_server_on.result
index 740ed6cb25b..7caf2863dfc 100644
--- a/mysql-test/suite/perfschema/r/start_server_on.result
+++ b/mysql-test/suite/perfschema/r/start_server_on.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/statement_program_lost_inst.result b/mysql-test/suite/perfschema/r/statement_program_lost_inst.result
index 2f0ab6988f4..81b6bd69e54 100644
--- a/mysql-test/suite/perfschema/r/statement_program_lost_inst.result
+++ b/mysql-test/suite/perfschema/r/statement_program_lost_inst.result
@@ -122,31 +122,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
 performance_schema_max_program_instances	7
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	2
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result
index 982a8e881be..a53604e33fd 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result
@@ -69,31 +69,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result
index 9e56822f5d0..9db2bab0e40 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result
@@ -68,31 +68,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result
index 07c3d7c2a18..1e053c47ae5 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result
@@ -69,31 +69,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result
index a718b2b513b..5a9bc84ec07 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result
@@ -68,31 +68,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result
index 5b488993bfb..27a191f1e3c 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result
@@ -67,31 +67,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result
index f5e8efd76c5..0b5fd259df2 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result
@@ -66,31 +66,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result
index 62a20e15c0b..59c32ba7fe1 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result
@@ -67,31 +67,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result
index 37dba990a1d..50597b5575c 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result
@@ -66,31 +66,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_off.result b/mysql-test/suite/perfschema/r/table_aggregate_off.result
index 65b00404947..a7995e640ac 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_off.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_off.result
@@ -68,31 +68,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result
index 68d47390d0f..6d85c5a92ca 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result
@@ -69,31 +69,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result
index 50744dd22d7..ea21763a371 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result
@@ -68,31 +68,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result
index 8d53db6ed8d..77c11f86d98 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result
@@ -69,31 +69,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result
index 8ddf5262d11..a3de3c85f41 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result
@@ -68,31 +68,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result
index 91b32f148a9..5cf3b33cfac 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result
@@ -71,31 +71,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result
index 2567ab405b7..16be22d8cd2 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result
@@ -70,31 +70,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result
index 4a671b79013..55c1e46b026 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result
@@ -71,31 +71,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result
index 51605627ad5..d09a544105e 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result
@@ -70,31 +70,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result
index 699b2ce5409..4cdfc181099 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result
@@ -69,31 +69,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result
index d0f4e078033..e2ed0f3c5fb 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result
@@ -68,31 +68,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result
index aae364736a4..c818ba89bb6 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result
@@ -69,31 +69,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result
index c2501355b8a..ca1b6d37e67 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result
@@ -68,31 +68,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result
index 45766897df3..679ac7a4c07 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result
@@ -71,31 +71,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result
index 89faa9c12ac..26c3070d242 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result
@@ -70,31 +70,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result
index 9c61d65df50..96ef0a6a6a6 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result
@@ -71,31 +71,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result
index 33925454953..a0beb393a74 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result
@@ -70,31 +70,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result
index 9f30b3b7efc..5d97d0fa177 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result
@@ -71,31 +71,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result
index c1c3ccbd8d3..f013a396726 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result
@@ -70,31 +70,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result
index 7efb952bc0d..bed4a2f99a5 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result
@@ -71,31 +71,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result
index a40d332a4ef..9d3cc74beb4 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result
@@ -70,31 +70,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result
index 264edae51f2..5cbe7735ebf 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result
@@ -69,31 +69,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result
index fbf61a3c970..c4a5e08bc74 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result
@@ -68,31 +68,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result
index bea2a5c1995..8785c2399e7 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result
@@ -69,31 +69,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result
index 639e29da7fa..b9a8343f868 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result
@@ -68,31 +68,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result
index 0f466c890c2..9666c17c1e4 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result
@@ -71,31 +71,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result
index e237be9270a..a31f8f41b96 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result
@@ -70,31 +70,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result
index 24d1786c543..dc440c2b768 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result
@@ -71,31 +71,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result
index 5bb0b38eec0..9aed1d06cb9 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result
@@ -70,31 +70,31 @@ performance_schema_events_waits_history_long_size	10000
 performance_schema_events_waits_history_size	10
 performance_schema_hosts_size	100
 performance_schema_max_cond_classes	80
-performance_schema_max_cond_instances	1000
+performance_schema_max_cond_instances	-1
 performance_schema_max_digest_length	1024
 performance_schema_max_file_classes	80
 performance_schema_max_file_handles	32768
-performance_schema_max_file_instances	10000
-performance_schema_max_index_stat	5000
+performance_schema_max_file_instances	-1
+performance_schema_max_index_stat	-1
 performance_schema_max_memory_classes	320
-performance_schema_max_metadata_locks	10000
+performance_schema_max_metadata_locks	-1
 performance_schema_max_mutex_classes	210
-performance_schema_max_mutex_instances	5000
-performance_schema_max_prepared_statements_instances	100
-performance_schema_max_program_instances	5000
+performance_schema_max_mutex_instances	-1
+performance_schema_max_prepared_statements_instances	-1
+performance_schema_max_program_instances	-1
 performance_schema_max_rwlock_classes	50
-performance_schema_max_rwlock_instances	5000
+performance_schema_max_rwlock_instances	-1
 performance_schema_max_socket_classes	10
-performance_schema_max_socket_instances	1000
+performance_schema_max_socket_instances	-1
 performance_schema_max_sql_text_length	1024
 performance_schema_max_stage_classes	150
 performance_schema_max_statement_classes	193
 performance_schema_max_statement_stack	10
-performance_schema_max_table_handles	1000
-performance_schema_max_table_instances	500
-performance_schema_max_table_lock_stat	500
+performance_schema_max_table_handles	-1
+performance_schema_max_table_instances	-1
+performance_schema_max_table_lock_stat	-1
 performance_schema_max_thread_classes	50
-performance_schema_max_thread_instances	200
+performance_schema_max_thread_instances	-1
 performance_schema_session_connect_attrs_size	2048
 performance_schema_setup_actors_size	100
 performance_schema_setup_objects_size	100
diff --git a/mysql-test/suite/perfschema/t/read_only.test b/mysql-test/suite/perfschema/t/read_only.test
index 92b17761e63..85914980313 100644
--- a/mysql-test/suite/perfschema/t/read_only.test
+++ b/mysql-test/suite/perfschema/t/read_only.test
@@ -82,6 +82,93 @@ update performance_schema.setup_instruments set enabled='NO';
 update performance_schema.setup_instruments set enabled='YES';
 --enable_result_log
 
+--echo #
+--echo # Bug#31080309 - REGRESSION FOR BUG 81009 FIXED IN 5.7.17
+--echo #   Bug23103937(BUG81009) - PS_TRUNCATE_ALL_TABLES() DOES NOT WORK IN
+--echo #                           SUPER_READ_ONLY MODE.
+--echo #
+
+connection default;
+--echo # Reset read_only and super_read_only mode.
+set global read_only=0;
+set global super_read_only=0;
+--echo # Grant truncate table and execute stored procedure privileges to pfsuser.
+grant DROP on performance_schema.* to pfsuser@localhost;
+grant EXECUTE on procedure sys.ps_truncate_all_tables to pfsuser@localhost;
+
+--echo #-----------------------------------------------------------------------
+--echo # Test case to verify truncate operation on performance schema table by
+--echo # super user with super_read_only=ON.
+--echo #-----------------------------------------------------------------------
+--echo # Set super_read_only mode.
+set global super_read_only=1;
+
+connection con1;
+--echo # truncate operation is allowed in super_read_only mode on performance schema
+--echo # tables for super user.
+--echo # Without fix following statements fail because of super read only mode.
+--disable_result_log
+truncate table performance_schema.events_statements_summary_by_digest;
+call sys.ps_truncate_all_tables(0);
+--enable_result_log
+
+--echo #-----------------------------------------------------------------------
+--echo # Test case to verify truncate operation on performance schema table by
+--echo # super user with read_only=ON.
+--echo #-----------------------------------------------------------------------
+connection default;
+--echo # Reset super_read_only mode.
+set global super_read_only=0;
+--echo # Set read_only mode.
+set global read_only=1;
+
+connection con1;
+--echo # truncate operation is allowed in read_only mode on performance schema
+--echo # tables for super user.
+--echo # Without fix following statements fail because of super read only mode.
+--disable_result_log
+truncate table performance_schema.events_statements_summary_by_digest;
+call sys.ps_truncate_all_tables(0);
+--enable_result_log
+
+--echo #-----------------------------------------------------------------------
+--echo # Test case to verify truncate operation on performance schema table by
+--echo # non-super user with super_read_only=ON.
+--echo #-----------------------------------------------------------------------
+connection default;
+set global super_read_only=0;
+--echo # Revoke SUPER privilege from pfsuser.
+revoke SUPER on *.* from pfsuser@localhost;
+--echo # Reset super_read_only mode.
+set global super_read_only=1;
+
+connection con1;
+--echo # truncate operation is allowed in super_read_only mode on performance schema
+--echo # tables for non-super user.
+--disable_result_log
+truncate table performance_schema.events_statements_summary_by_digest;
+call sys.ps_truncate_all_tables(0);
+--enable_result_log
+
+--echo #-----------------------------------------------------------------------
+--echo # Test case to verify truncate operation on performance schema table by
+--echo # non-super user with read_only=ON.
+--echo #-----------------------------------------------------------------------
+connection default;
+--echo # Reset super_read_only mode.
+set global super_read_only=0;
+--echo # Set read_only mode.
+set global read_only=1;
+
+connection con1;
+--echo # truncate operation is allowed in read_only mode on performance schema
+--echo # tables for non-super user.
+--disable_result_log
+truncate table performance_schema.events_statements_summary_by_digest;
+call sys.ps_truncate_all_tables(0);
+--enable_result_log
+--echo ########################################################################
+
 disconnect con1;
 --source include/wait_until_disconnected.inc
 
diff --git a/storage/perfschema/CMakeLists.txt b/storage/perfschema/CMakeLists.txt
index 3c463ae3073..75eb6031746 100644
--- a/storage/perfschema/CMakeLists.txt
+++ b/storage/perfschema/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2021, Oracle and/or its affiliates.
 #
 #
 # This program is free software; you can redistribute it and/or modify
diff --git a/storage/perfschema/cursor_by_account.cc b/storage/perfschema/cursor_by_account.cc
index 45ee1814a0b..14963979a76 100644
--- a/storage/perfschema/cursor_by_account.cc
+++ b/storage/perfschema/cursor_by_account.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
 
   This 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 ec025451414..2b3d3eda117 100644
--- a/storage/perfschema/cursor_by_account.h
+++ b/storage/perfschema/cursor_by_account.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
 
   This 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 28afce2ad33..4c0ccff6556 100644
--- a/storage/perfschema/cursor_by_host.cc
+++ b/storage/perfschema/cursor_by_host.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
 
   This 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 fa503e7ce20..cdafbae86d3 100644
--- a/storage/perfschema/cursor_by_host.h
+++ b/storage/perfschema/cursor_by_host.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
 
   This 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 c45e3dd0543..18f9776dfbe 100644
--- a/storage/perfschema/cursor_by_thread.cc
+++ b/storage/perfschema/cursor_by_thread.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
 
   This 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 5bcafc6e6af..b49d2934710 100644
--- a/storage/perfschema/cursor_by_thread.h
+++ b/storage/perfschema/cursor_by_thread.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
 
   This 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 e873e81672b..33c21a208f6 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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 a9b8271d0b0..102fb38760b 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
 
   This 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 c5c4ea57c9a..094ecd4a29d 100644
--- a/storage/perfschema/cursor_by_user.cc
+++ b/storage/perfschema/cursor_by_user.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
 
   This 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 f7e43248a6a..c5220d6c8b8 100644
--- a/storage/perfschema/cursor_by_user.h
+++ b/storage/perfschema/cursor_by_user.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
 
   This 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 903477902fe..80d632aec1f 100644
--- a/storage/perfschema/ha_perfschema.cc
+++ b/storage/perfschema/ha_perfschema.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -268,7 +268,7 @@ int ha_perfschema::write_row(uchar *buf)
   if (!PFS_ENABLED())
     DBUG_RETURN(HA_ERR_WRONG_COMMAND);
 
-  DBUG_ASSERT(m_table_share);
+  assert(m_table_share);
   ha_statistic_increment(&SSV::ha_write_count);
   result= m_table_share->write_row(table, buf, table->field);
   DBUG_RETURN(result);
@@ -294,7 +294,7 @@ int ha_perfschema::update_row(const uchar *old_data, uchar *new_data)
   if (is_executed_by_slave())
     DBUG_RETURN(0);
 
-  DBUG_ASSERT(m_table);
+  assert(m_table);
   ha_statistic_increment(&SSV::ha_update_count);
   int result= m_table->update_row(table, old_data, new_data, table->field);
   DBUG_RETURN(result);
@@ -306,7 +306,7 @@ int ha_perfschema::delete_row(const uchar *buf)
   if (!PFS_ENABLED())
     DBUG_RETURN(HA_ERR_WRONG_COMMAND);
 
-  DBUG_ASSERT(m_table);
+  assert(m_table);
   ha_statistic_increment(&SSV::ha_delete_count);
   int result= m_table->delete_row(table, buf, table->field);
   DBUG_RETURN(result);
@@ -317,8 +317,8 @@ int ha_perfschema::rnd_init(bool scan)
   int result;
   DBUG_ENTER("ha_perfschema::rnd_init");
 
-  DBUG_ASSERT(m_table_share);
-  DBUG_ASSERT(m_table_share->m_open_table != NULL);
+  assert(m_table_share);
+  assert(m_table_share->m_open_table != NULL);
 
   stats.records= 0;
   if (m_table == NULL)
@@ -336,7 +336,7 @@ int ha_perfschema::rnd_init(bool scan)
 int ha_perfschema::rnd_end(void)
 {
   DBUG_ENTER("ha_perfschema::rnd_end");
-  DBUG_ASSERT(m_table);
+  assert(m_table);
   delete m_table;
   m_table= NULL;
   DBUG_RETURN(0);
@@ -351,7 +351,7 @@ int ha_perfschema::rnd_next(uchar *buf)
     DBUG_RETURN(HA_ERR_END_OF_FILE);
   }
 
-  DBUG_ASSERT(m_table);
+  assert(m_table);
   ha_statistic_increment(&SSV::ha_read_rnd_next_count);
 
   int result= m_table->rnd_next();
@@ -369,7 +369,7 @@ void ha_perfschema::position(const uchar *record)
 {
   DBUG_ENTER("ha_perfschema::position");
 
-  DBUG_ASSERT(m_table);
+  assert(m_table);
   m_table->get_position(ref);
   DBUG_VOID_RETURN;
 }
@@ -383,7 +383,7 @@ int ha_perfschema::rnd_pos(uchar *buf, uchar *pos)
     DBUG_RETURN(HA_ERR_END_OF_FILE);
   }
 
-  DBUG_ASSERT(m_table);
+  assert(m_table);
   ha_statistic_increment(&SSV::ha_read_rnd_count);
   int result= m_table->rnd_pos(pos);
   if (result == 0)
@@ -395,7 +395,7 @@ int ha_perfschema::rnd_pos(uchar *buf, uchar *pos)
 int ha_perfschema::info(uint flag)
 {
   DBUG_ENTER("ha_perfschema::info");
-  DBUG_ASSERT(m_table_share);
+  assert(m_table_share);
   if (flag & HA_STATUS_VARIABLE)
     stats.records= m_table_share->get_row_count();
   if (flag & HA_STATUS_CONST)
@@ -414,7 +414,7 @@ int ha_perfschema::delete_all_rows(void)
   if (is_executed_by_slave())
     DBUG_RETURN(0);
 
-  DBUG_ASSERT(m_table_share);
+  assert(m_table_share);
   if (m_table_share->m_delete_all_rows)
     result= m_table_share->m_delete_all_rows();
   else
@@ -456,8 +456,8 @@ int ha_perfschema::create(const char *name, TABLE *table_arg,
                           HA_CREATE_INFO *create_info)
 {
   DBUG_ENTER("ha_perfschema::create");
-  DBUG_ASSERT(table_arg);
-  DBUG_ASSERT(table_arg->s);
+  assert(table_arg);
+  assert(table_arg->s);
   if (find_table_share(table_arg->s->db.str,
                        table_arg->s->table_name.str))
   {
diff --git a/storage/perfschema/ha_perfschema.h b/storage/perfschema/ha_perfschema.h
index e39fcc78714..e0f55253bfd 100644
--- a/storage/perfschema/ha_perfschema.h
+++ b/storage/perfschema/ha_perfschema.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -235,8 +235,8 @@ class ha_perfschema : public handler
   */
   bool is_executed_by_slave() const
   {
-    DBUG_ASSERT(table != NULL);
-    DBUG_ASSERT(table->in_use != NULL);
+    assert(table != NULL);
+    assert(table->in_use != NULL);
     return table->in_use->slave_thread;
 
   }
diff --git a/storage/perfschema/pfs.cc b/storage/perfschema/pfs.cc
index 584d6b017a8..df06f1c5348 100644
--- a/storage/perfschema/pfs.cc
+++ b/storage/perfschema/pfs.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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,9 +92,9 @@ static void report_memory_accounting_error(
                   old_thread->m_thread_internal_id,
                   old_thread->m_class->m_name);
 
-  DBUG_ASSERT(strcmp(new_thread->m_class->m_name, "thread/sql/event_worker") != 0);
-  DBUG_ASSERT(strcmp(new_thread->m_class->m_name, "thread/sql/event_scheduler") != 0);
-  DBUG_ASSERT(strcmp(new_thread->m_class->m_name, "thread/sql/one_connection") != 0);
+  assert(strcmp(new_thread->m_class->m_name, "thread/sql/event_worker") != 0);
+  assert(strcmp(new_thread->m_class->m_name, "thread/sql/event_scheduler") != 0);
+  assert(strcmp(new_thread->m_class->m_name, "thread/sql/one_connection") != 0);
 }
 #endif /* PFS_PARANOID */
 
@@ -1367,16 +1367,16 @@ bool THR_PFS_initialized= false;
 static inline PFS_thread*
 my_thread_get_THR_PFS()
 {
-  DBUG_ASSERT(THR_PFS_initialized);
+  assert(THR_PFS_initialized);
   PFS_thread *thread= static_cast<PFS_thread*>(my_get_thread_local(THR_PFS));
-  DBUG_ASSERT(thread == NULL || sanitize_thread(thread) != NULL);
+  assert(thread == NULL || sanitize_thread(thread) != NULL);
   return thread;
 }
 
 static inline void
 my_thread_set_THR_PFS(PFS_thread *pfs)
 {
-  DBUG_ASSERT(THR_PFS_initialized);
+  assert(THR_PFS_initialized);
   my_set_thread_local(THR_PFS, pfs);
 }
 
@@ -1553,8 +1553,8 @@ static int build_prefix(const LEX_STRING *prefix, const char *category,
   size_t len;                                                               \
   size_t full_length;                                                       \
                                                                             \
-  DBUG_ASSERT(category != NULL);                                            \
-  DBUG_ASSERT(info != NULL);                                                \
+  assert(category != NULL);                                             \
+  assert(info != NULL);                                                 \
   if (unlikely(build_prefix(&PREFIX, category,                              \
                    formatted_name, &prefix_length)) ||                      \
       ! pfs_initialized)                                                    \
@@ -1566,8 +1566,8 @@ static int build_prefix(const LEX_STRING *prefix, const char *category,
                                                                             \
   for (; count>0; count--, info++)                                          \
   {                                                                         \
-    DBUG_ASSERT(info->m_key != NULL);                                       \
-    DBUG_ASSERT(info->m_name != NULL);                                      \
+    assert(info->m_key != NULL);                                        \
+    assert(info->m_name != NULL);                                       \
     len= strlen(info->m_name);                                              \
     full_length= prefix_length + len;                                       \
     if (likely(full_length <= PFS_MAX_INFO_NAME_LENGTH))                    \
@@ -1619,8 +1619,8 @@ void pfs_register_rwlock_v1(const char *category,
   size_t len;
   size_t full_length;
 
-  DBUG_ASSERT(category != NULL);
-  DBUG_ASSERT(info != NULL);
+  assert(category != NULL);
+  assert(info != NULL);
   if (build_prefix(&rwlock_instrument_prefix, category,
                    rw_formatted_name, &rw_prefix_length) ||
       build_prefix(&sxlock_instrument_prefix, category,
@@ -1634,8 +1634,8 @@ void pfs_register_rwlock_v1(const char *category,
 
   for (; count>0; count--, info++)
   {
-    DBUG_ASSERT(info->m_key != NULL);
-    DBUG_ASSERT(info->m_name != NULL);
+    assert(info->m_key != NULL);
+    assert(info->m_name != NULL);
     len= strlen(info->m_name);
 
     if (info->m_flags & PSI_RWLOCK_FLAG_SX)
@@ -1723,8 +1723,8 @@ void pfs_register_stage_v1(const char *category,
   size_t full_length;
   PSI_stage_info_v1 *info;
 
-  DBUG_ASSERT(category != NULL);
-  DBUG_ASSERT(info_array != NULL);
+  assert(category != NULL);
+  assert(info_array != NULL);
   if (unlikely(build_prefix(&stage_instrument_prefix, category,
                formatted_name, &prefix_length)) ||
       ! pfs_initialized)
@@ -1737,8 +1737,8 @@ void pfs_register_stage_v1(const char *category,
   for (; count>0; count--, info_array++)
   {
     info= *info_array;
-    DBUG_ASSERT(info != NULL);
-    DBUG_ASSERT(info->m_name != NULL);
+    assert(info != NULL);
+    assert(info->m_name != NULL);
     len= strlen(info->m_name);
     full_length= prefix_length + len;
     if (likely(full_length <= PFS_MAX_INFO_NAME_LENGTH))
@@ -1768,8 +1768,8 @@ void pfs_register_statement_v1(const char *category,
   size_t len;
   size_t full_length;
 
-  DBUG_ASSERT(category != NULL);
-  DBUG_ASSERT(info != NULL);
+  assert(category != NULL);
+  assert(info != NULL);
   if (unlikely(build_prefix(&statement_instrument_prefix,
                             category, formatted_name, &prefix_length)) ||
       ! pfs_initialized)
@@ -1781,7 +1781,7 @@ void pfs_register_statement_v1(const char *category,
 
   for (; count>0; count--, info++)
   {
-    DBUG_ASSERT(info->m_name != NULL);
+    assert(info->m_name != NULL);
     len= strlen(info->m_name);
     full_length= prefix_length + len;
     if (likely(full_length <= PFS_MAX_INFO_NAME_LENGTH))
@@ -1835,7 +1835,7 @@ void pfs_destroy_mutex_v1(PSI_mutex* mutex)
 {
   PFS_mutex *pfs= reinterpret_cast<PFS_mutex*> (mutex);
 
-  DBUG_ASSERT(pfs != NULL);
+  assert(pfs != NULL);
 
   destroy_mutex(pfs);
 }
@@ -1858,7 +1858,7 @@ void pfs_destroy_rwlock_v1(PSI_rwlock* rwlock)
 {
   PFS_rwlock *pfs= reinterpret_cast<PFS_rwlock*> (rwlock);
 
-  DBUG_ASSERT(pfs != NULL);
+  assert(pfs != NULL);
 
   destroy_rwlock(pfs);
 }
@@ -1881,7 +1881,7 @@ void pfs_destroy_cond_v1(PSI_cond* cond)
 {
   PFS_cond *pfs= reinterpret_cast<PFS_cond*> (cond);
 
-  DBUG_ASSERT(pfs != NULL);
+  assert(pfs != NULL);
 
   destroy_cond(pfs);
 }
@@ -1999,7 +1999,7 @@ pfs_rebind_table_v1(PSI_table_share *share, const void *identity, PSI_table *tab
   PFS_table *pfs= reinterpret_cast<PFS_table*> (table);
   if (likely(pfs != NULL))
   {
-    DBUG_ASSERT(pfs->m_thread_owner == NULL);
+    assert(pfs->m_thread_owner == NULL);
 
     if (unlikely(! pfs->m_share->m_enabled))
     {
@@ -2083,7 +2083,7 @@ void pfs_destroy_socket_v1(PSI_socket *socket)
 {
   PFS_socket *pfs= reinterpret_cast<PFS_socket*> (socket);
 
-  DBUG_ASSERT(pfs != NULL);
+  assert(pfs != NULL);
 
   destroy_socket(pfs);
 }
@@ -2325,9 +2325,9 @@ void pfs_set_thread_user_v1(const char *user, int user_len)
   pfs_dirty_state dirty_state;
   PFS_thread *pfs= my_thread_get_THR_PFS();
 
-  DBUG_ASSERT((user != NULL) || (user_len == 0));
-  DBUG_ASSERT(user_len >= 0);
-  DBUG_ASSERT((uint) user_len <= sizeof(pfs->m_username));
+  assert((user != NULL) || (user_len == 0));
+  assert(user_len >= 0);
+  assert((uint) user_len <= sizeof(pfs->m_username));
 
   if (unlikely(pfs == NULL))
     return;
@@ -2383,11 +2383,11 @@ void pfs_set_thread_account_v1(const char *user, int user_len,
   pfs_dirty_state dirty_state;
   PFS_thread *pfs= my_thread_get_THR_PFS();
 
-  DBUG_ASSERT((user != NULL) || (user_len == 0));
-  DBUG_ASSERT(user_len >= 0);
-  DBUG_ASSERT((uint) user_len <= sizeof(pfs->m_username));
-  DBUG_ASSERT((host != NULL) || (host_len == 0));
-  DBUG_ASSERT(host_len >= 0);
+  assert((user != NULL) || (user_len == 0));
+  assert(user_len >= 0);
+  assert((uint) user_len <= sizeof(pfs->m_username));
+  assert((host != NULL) || (host_len == 0));
+  assert(host_len >= 0);
 
   host_len= min<size_t>(host_len, sizeof(pfs->m_hostname));
   if (unlikely(pfs == NULL))
@@ -2444,9 +2444,9 @@ void pfs_set_thread_db_v1(const char* db, int db_len)
 {
   PFS_thread *pfs= my_thread_get_THR_PFS();
 
-  DBUG_ASSERT((db != NULL) || (db_len == 0));
-  DBUG_ASSERT(db_len >= 0);
-  DBUG_ASSERT((uint) db_len <= sizeof(pfs->m_dbname));
+  assert((db != NULL) || (db_len == 0));
+  assert(db_len >= 0);
+  assert((uint) db_len <= sizeof(pfs->m_dbname));
 
   if (likely(pfs != NULL))
   {
@@ -2467,8 +2467,8 @@ void pfs_set_thread_command_v1(int command)
 {
   PFS_thread *pfs= my_thread_get_THR_PFS();
 
-  DBUG_ASSERT(command >= 0);
-  DBUG_ASSERT(command <= (int) COM_END);
+  assert(command >= 0);
+  assert(command <= (int) COM_END);
 
   if (likely(pfs != NULL))
   {
@@ -2484,8 +2484,8 @@ void pfs_set_connection_type_v1(opaque_vio_type conn_type)
 {
   PFS_thread *pfs= my_thread_get_THR_PFS();
 
-  DBUG_ASSERT(conn_type >= FIRST_VIO_TYPE);
-  DBUG_ASSERT(conn_type <= LAST_VIO_TYPE);
+  assert(conn_type >= FIRST_VIO_TYPE);
+  assert(conn_type <= LAST_VIO_TYPE);
 
   if (likely(pfs != NULL))
   {
@@ -2526,7 +2526,7 @@ void pfs_set_thread_info_v1(const char* info, uint info_len)
   pfs_dirty_state dirty_state;
   PFS_thread *pfs= my_thread_get_THR_PFS();
 
-  DBUG_ASSERT((info != NULL) || (info_len == 0));
+  assert((info != NULL) || (info_len == 0));
 
   if (likely(pfs != NULL))
   {
@@ -2599,12 +2599,12 @@ pfs_start_mutex_wait_v1(PSI_mutex_locker_state *state,
                         const char *src_file, uint src_line)
 {
   PFS_mutex *pfs_mutex= reinterpret_cast<PFS_mutex*> (mutex);
-  DBUG_ASSERT((int) op >= 0);
-  DBUG_ASSERT((uint) op < array_elements(mutex_operation_map));
-  DBUG_ASSERT(state != NULL);
+  assert((int) op >= 0);
+  assert((uint) op < array_elements(mutex_operation_map));
+  assert(state != NULL);
 
-  DBUG_ASSERT(pfs_mutex != NULL);
-  DBUG_ASSERT(pfs_mutex->m_class != NULL);
+  assert(pfs_mutex != NULL);
+  assert(pfs_mutex->m_class != NULL);
 
   if (! pfs_mutex->m_enabled)
     return NULL;
@@ -2698,31 +2698,31 @@ pfs_start_rwlock_wait_v1(PSI_rwlock_locker_state *state,
                          const char *src_file, uint src_line)
 {
   PFS_rwlock *pfs_rwlock= reinterpret_cast<PFS_rwlock*> (rwlock);
-  DBUG_ASSERT(static_cast<int> (op) >= 0);
-  DBUG_ASSERT(static_cast<uint> (op) < array_elements(rwlock_operation_map));
-  DBUG_ASSERT(state != NULL);
-  DBUG_ASSERT(pfs_rwlock != NULL);
-  DBUG_ASSERT(pfs_rwlock->m_class != NULL);
+  assert(static_cast<int> (op) >= 0);
+  assert(static_cast<uint> (op) < array_elements(rwlock_operation_map));
+  assert(state != NULL);
+  assert(pfs_rwlock != NULL);
+  assert(pfs_rwlock->m_class != NULL);
 
   /* Operations supported for READ WRITE LOCK */
 
-  DBUG_ASSERT(   pfs_rwlock->m_class->is_shared_exclusive()
-              || (op == PSI_RWLOCK_READLOCK)
-              || (op == PSI_RWLOCK_WRITELOCK)
-              || (op == PSI_RWLOCK_TRYREADLOCK)
-              || (op == PSI_RWLOCK_TRYWRITELOCK)
-             );
+  assert(   pfs_rwlock->m_class->is_shared_exclusive()
+            || (op == PSI_RWLOCK_READLOCK)
+            || (op == PSI_RWLOCK_WRITELOCK)
+            || (op == PSI_RWLOCK_TRYREADLOCK)
+            || (op == PSI_RWLOCK_TRYWRITELOCK)
+            );
 
   /* Operations supported for SHARED EXCLUSIVE LOCK */
 
-  DBUG_ASSERT(   ! pfs_rwlock->m_class->is_shared_exclusive()
-              || (op == PSI_RWLOCK_SHAREDLOCK)
-              || (op == PSI_RWLOCK_SHAREDEXCLUSIVELOCK)
-              || (op == PSI_RWLOCK_EXCLUSIVELOCK)
-              || (op == PSI_RWLOCK_TRYSHAREDLOCK)
-              || (op == PSI_RWLOCK_TRYSHAREDEXCLUSIVELOCK)
-              || (op == PSI_RWLOCK_TRYEXCLUSIVELOCK)
-             );
+  assert(   ! pfs_rwlock->m_class->is_shared_exclusive()
+            || (op == PSI_RWLOCK_SHAREDLOCK)
+            || (op == PSI_RWLOCK_SHAREDEXCLUSIVELOCK)
+            || (op == PSI_RWLOCK_EXCLUSIVELOCK)
+            || (op == PSI_RWLOCK_TRYSHAREDLOCK)
+            || (op == PSI_RWLOCK_TRYSHAREDEXCLUSIVELOCK)
+            || (op == PSI_RWLOCK_TRYEXCLUSIVELOCK)
+            );
 
   if (! pfs_rwlock->m_enabled)
     return NULL;
@@ -2811,10 +2811,10 @@ pfs_start_rwlock_rdwait_v1(PSI_rwlock_locker_state *state,
                            PSI_rwlock_operation op,
                            const char *src_file, uint src_line)
 {
-  DBUG_ASSERT((op == PSI_RWLOCK_READLOCK) ||
-              (op == PSI_RWLOCK_TRYREADLOCK) ||
-              (op == PSI_RWLOCK_SHAREDLOCK) ||
-              (op == PSI_RWLOCK_TRYSHAREDLOCK));
+  assert((op == PSI_RWLOCK_READLOCK) ||
+         (op == PSI_RWLOCK_TRYREADLOCK) ||
+         (op == PSI_RWLOCK_SHAREDLOCK) ||
+         (op == PSI_RWLOCK_TRYSHAREDLOCK));
 
   return pfs_start_rwlock_wait_v1(state, rwlock, op, src_file, src_line);
 }
@@ -2825,12 +2825,12 @@ pfs_start_rwlock_wrwait_v1(PSI_rwlock_locker_state *state,
                            PSI_rwlock_operation op,
                            const char *src_file, uint src_line)
 {
-  DBUG_ASSERT((op == PSI_RWLOCK_WRITELOCK) ||
-              (op == PSI_RWLOCK_TRYWRITELOCK) ||
-              (op == PSI_RWLOCK_SHAREDEXCLUSIVELOCK) ||
-              (op == PSI_RWLOCK_TRYSHAREDEXCLUSIVELOCK) ||
-              (op == PSI_RWLOCK_EXCLUSIVELOCK) ||
-              (op == PSI_RWLOCK_TRYEXCLUSIVELOCK));
+  assert((op == PSI_RWLOCK_WRITELOCK) ||
+         (op == PSI_RWLOCK_TRYWRITELOCK) ||
+         (op == PSI_RWLOCK_SHAREDEXCLUSIVELOCK) ||
+         (op == PSI_RWLOCK_TRYSHAREDEXCLUSIVELOCK) ||
+         (op == PSI_RWLOCK_EXCLUSIVELOCK) ||
+         (op == PSI_RWLOCK_TRYEXCLUSIVELOCK));
 
   return pfs_start_rwlock_wait_v1(state, rwlock, op, src_file, src_line);
 }
@@ -2857,11 +2857,11 @@ pfs_start_cond_wait_v1(PSI_cond_locker_state *state,
     in start_cond_wait_v1() and end_cond_wait_v1().
   */
   PFS_cond *pfs_cond= reinterpret_cast<PFS_cond*> (cond);
-  DBUG_ASSERT(static_cast<int> (op) >= 0);
-  DBUG_ASSERT(static_cast<uint> (op) < array_elements(cond_operation_map));
-  DBUG_ASSERT(state != NULL);
-  DBUG_ASSERT(pfs_cond != NULL);
-  DBUG_ASSERT(pfs_cond->m_class != NULL);
+  assert(static_cast<int> (op) >= 0);
+  assert(static_cast<uint> (op) < array_elements(cond_operation_map));
+  assert(state != NULL);
+  assert(pfs_cond != NULL);
+  assert(pfs_cond->m_class != NULL);
 
   if (! pfs_cond->m_enabled)
     return NULL;
@@ -2973,7 +2973,7 @@ static inline PFS_TL_LOCK_TYPE lock_flags_to_lock_type(uint flags)
     case TL_WRITE_DEFAULT:
     case TL_WRITE_CONCURRENT_DEFAULT:
     default:
-      DBUG_ASSERT(false);
+      assert(false);
   }
 
   /* Dead code */
@@ -2982,7 +2982,7 @@ static inline PFS_TL_LOCK_TYPE lock_flags_to_lock_type(uint flags)
 
 static inline PFS_TL_LOCK_TYPE external_lock_flags_to_lock_type(uint flags)
 {
-  DBUG_ASSERT(flags == F_RDLCK || flags == F_WRLCK);
+  assert(flags == F_RDLCK || flags == F_WRLCK);
   return (flags == F_RDLCK ? PFS_TL_READ_EXTERNAL : PFS_TL_WRITE_EXTERNAL);
 }
 
@@ -2997,12 +2997,12 @@ pfs_start_table_io_wait_v1(PSI_table_locker_state *state,
                            uint index,
                            const char *src_file, uint src_line)
 {
-  DBUG_ASSERT(static_cast<int> (op) >= 0);
-  DBUG_ASSERT(static_cast<uint> (op) < array_elements(table_io_operation_map));
-  DBUG_ASSERT(state != NULL);
+  assert(static_cast<int> (op) >= 0);
+  assert(static_cast<uint> (op) < array_elements(table_io_operation_map));
+  assert(state != NULL);
   PFS_table *pfs_table= reinterpret_cast<PFS_table*> (table);
-  DBUG_ASSERT(pfs_table != NULL);
-  DBUG_ASSERT(pfs_table->m_share != NULL);
+  assert(pfs_table != NULL);
+  assert(pfs_table->m_share != NULL);
 
   if (! pfs_table->m_io_enabled)
     return NULL;
@@ -3099,13 +3099,13 @@ pfs_start_table_lock_wait_v1(PSI_table_locker_state *state,
                              ulong op_flags,
                              const char *src_file, uint src_line)
 {
-  DBUG_ASSERT(state != NULL);
-  DBUG_ASSERT((op == PSI_TABLE_LOCK) || (op == PSI_TABLE_EXTERNAL_LOCK));
+  assert(state != NULL);
+  assert((op == PSI_TABLE_LOCK) || (op == PSI_TABLE_EXTERNAL_LOCK));
 
   PFS_table *pfs_table= reinterpret_cast<PFS_table*> (table);
 
-  DBUG_ASSERT(pfs_table != NULL);
-  DBUG_ASSERT(pfs_table->m_share != NULL);
+  assert(pfs_table != NULL);
+  assert(pfs_table->m_share != NULL);
 
   if (! pfs_table->m_lock_enabled)
     return NULL;
@@ -3135,10 +3135,10 @@ pfs_start_table_lock_wait_v1(PSI_table_locker_state *state,
       break;
     default:
       lock_type= PFS_TL_READ;
-      DBUG_ASSERT(false);
+      assert(false);
   }
 
-  DBUG_ASSERT((uint) lock_type < array_elements(table_lock_operation_map));
+  assert((uint) lock_type < array_elements(table_lock_operation_map));
 
   uint flags;
   ulonglong timer_start= 0;
@@ -3228,9 +3228,9 @@ pfs_get_thread_file_name_locker_v1(PSI_file_locker_state *state,
                                    PSI_file_operation op,
                                    const char *name, const void *identity)
 {
-  DBUG_ASSERT(static_cast<int> (op) >= 0);
-  DBUG_ASSERT(static_cast<uint> (op) < array_elements(file_operation_map));
-  DBUG_ASSERT(state != NULL);
+  assert(static_cast<int> (op) >= 0);
+  assert(static_cast<uint> (op) < array_elements(file_operation_map));
+  assert(state != NULL);
 
   if (! flag_global_instrumentation)
     return NULL;
@@ -3305,13 +3305,13 @@ pfs_get_thread_file_stream_locker_v1(PSI_file_locker_state *state,
                                      PSI_file *file, PSI_file_operation op)
 {
   PFS_file *pfs_file= reinterpret_cast<PFS_file*> (file);
-  DBUG_ASSERT(static_cast<int> (op) >= 0);
-  DBUG_ASSERT(static_cast<uint> (op) < array_elements(file_operation_map));
-  DBUG_ASSERT(state != NULL);
+  assert(static_cast<int> (op) >= 0);
+  assert(static_cast<uint> (op) < array_elements(file_operation_map));
+  assert(state != NULL);
 
   if (unlikely(pfs_file == NULL))
     return NULL;
-  DBUG_ASSERT(pfs_file->m_class != NULL);
+  assert(pfs_file->m_class != NULL);
   PFS_file_class *klass= pfs_file->m_class;
 
   if (! pfs_file->m_enabled)
@@ -3398,9 +3398,9 @@ pfs_get_thread_file_descriptor_locker_v1(PSI_file_locker_state *state,
                                          File file, PSI_file_operation op)
 {
   int index= static_cast<int> (file);
-  DBUG_ASSERT(static_cast<int> (op) >= 0);
-  DBUG_ASSERT(static_cast<uint> (op) < array_elements(file_operation_map));
-  DBUG_ASSERT(state != NULL);
+  assert(static_cast<int> (op) >= 0);
+  assert(static_cast<uint> (op) < array_elements(file_operation_map));
+  assert(state != NULL);
 
   if (unlikely((index < 0) || (index >= file_handle_max)))
     return NULL;
@@ -3423,7 +3423,7 @@ pfs_get_thread_file_descriptor_locker_v1(PSI_file_locker_state *state,
   if (! pfs_file->m_enabled)
     return NULL;
 
-  DBUG_ASSERT(pfs_file->m_class != NULL);
+  assert(pfs_file->m_class != NULL);
   PFS_file_class *klass= pfs_file->m_class;
 
   /* Needed for the LF_HASH */
@@ -3507,13 +3507,13 @@ pfs_start_socket_wait_v1(PSI_socket_locker_state *state,
                          size_t count,
                          const char *src_file, uint src_line)
 {
-  DBUG_ASSERT(static_cast<int> (op) >= 0);
-  DBUG_ASSERT(static_cast<uint> (op) < array_elements(socket_operation_map));
-  DBUG_ASSERT(state != NULL);
+  assert(static_cast<int> (op) >= 0);
+  assert(static_cast<uint> (op) < array_elements(socket_operation_map));
+  assert(state != NULL);
   PFS_socket *pfs_socket= reinterpret_cast<PFS_socket*> (socket);
 
-  DBUG_ASSERT(pfs_socket != NULL);
-  DBUG_ASSERT(pfs_socket->m_class != NULL);
+  assert(pfs_socket != NULL);
+  assert(pfs_socket->m_class != NULL);
 
   if (!pfs_socket->m_enabled || pfs_socket->m_idle)
     return NULL;
@@ -3629,7 +3629,7 @@ void pfs_unlock_mutex_v1(PSI_mutex *mutex)
 {
   PFS_mutex *pfs_mutex= reinterpret_cast<PFS_mutex*> (mutex);
 
-  DBUG_ASSERT(pfs_mutex != NULL);
+  assert(pfs_mutex != NULL);
 
   /*
     Note that this code is still protected by the instrumented mutex,
@@ -3665,10 +3665,10 @@ void pfs_unlock_mutex_v1(PSI_mutex *mutex)
 void pfs_unlock_rwlock_v1(PSI_rwlock *rwlock)
 {
   PFS_rwlock *pfs_rwlock= reinterpret_cast<PFS_rwlock*> (rwlock);
-  DBUG_ASSERT(pfs_rwlock != NULL);
-  DBUG_ASSERT(pfs_rwlock == sanitize_rwlock(pfs_rwlock));
-  DBUG_ASSERT(pfs_rwlock->m_class != NULL);
-  DBUG_ASSERT(pfs_rwlock->m_lock.is_populated());
+  assert(pfs_rwlock != NULL);
+  assert(pfs_rwlock == sanitize_rwlock(pfs_rwlock));
+  assert(pfs_rwlock->m_class != NULL);
+  assert(pfs_rwlock->m_lock.is_populated());
 
   bool last_writer= false;
   bool last_reader= false;
@@ -3745,7 +3745,7 @@ void pfs_signal_cond_v1(PSI_cond* cond)
 #ifdef PFS_LATER
   PFS_cond *pfs_cond= reinterpret_cast<PFS_cond*> (cond);
 
-  DBUG_ASSERT(pfs_cond != NULL);
+  assert(pfs_cond != NULL);
 
   pfs_cond->m_cond_stat.m_signal_count++;
 #endif
@@ -3760,7 +3760,7 @@ void pfs_broadcast_cond_v1(PSI_cond* cond)
 #ifdef PFS_LATER
   PFS_cond *pfs_cond= reinterpret_cast<PFS_cond*> (cond);
 
-  DBUG_ASSERT(pfs_cond != NULL);
+  assert(pfs_cond != NULL);
 
   pfs_cond->m_cond_stat.m_broadcast_count++;
 #endif
@@ -3773,7 +3773,7 @@ void pfs_broadcast_cond_v1(PSI_cond* cond)
 PSI_idle_locker*
 pfs_start_idle_wait_v1(PSI_idle_locker_state* state, const char *src_file, uint src_line)
 {
-  DBUG_ASSERT(state != NULL);
+  assert(state != NULL);
 
   if (!flag_global_instrumentation)
     return NULL;
@@ -3794,7 +3794,7 @@ pfs_start_idle_wait_v1(PSI_idle_locker_state* state, const char *src_file, uint
     state->m_thread= reinterpret_cast<PSI_thread *> (pfs_thread);
     flags= STATE_FLAG_THREAD;
 
-    DBUG_ASSERT(pfs_thread->m_events_statements_count == 0);
+    assert(pfs_thread->m_events_statements_count == 0);
 
     if (global_idle_class.m_timed)
     {
@@ -3859,7 +3859,7 @@ pfs_start_idle_wait_v1(PSI_idle_locker_state* state, const char *src_file, uint
 void pfs_end_idle_wait_v1(PSI_idle_locker* locker)
 {
   PSI_idle_locker_state *state= reinterpret_cast<PSI_idle_locker_state*> (locker);
-  DBUG_ASSERT(state != NULL);
+  assert(state != NULL);
   ulonglong timer_end= 0;
   ulonglong wait_time= 0;
 
@@ -3891,7 +3891,7 @@ void pfs_end_idle_wait_v1(PSI_idle_locker* locker)
     if (flags & STATE_FLAG_EVENT)
     {
       PFS_events_waits *wait= reinterpret_cast<PFS_events_waits*> (state->m_wait);
-      DBUG_ASSERT(wait != NULL);
+      assert(wait != NULL);
 
       wait->m_timer_end= timer_end;
       wait->m_end_event_id= thread->m_event_id;
@@ -3901,7 +3901,7 @@ void pfs_end_idle_wait_v1(PSI_idle_locker* locker)
         insert_events_waits_history_long(wait);
       thread->m_events_waits_current--;
 
-      DBUG_ASSERT(wait == thread->m_events_waits_current);
+      assert(wait == thread->m_events_waits_current);
     }
   }
 
@@ -3924,13 +3924,13 @@ void pfs_end_idle_wait_v1(PSI_idle_locker* locker)
 void pfs_end_mutex_wait_v1(PSI_mutex_locker* locker, int rc)
 {
   PSI_mutex_locker_state *state= reinterpret_cast<PSI_mutex_locker_state*> (locker);
-  DBUG_ASSERT(state != NULL);
+  assert(state != NULL);
 
   ulonglong timer_end= 0;
   ulonglong wait_time= 0;
 
   PFS_mutex *mutex= reinterpret_cast<PFS_mutex *> (state->m_mutex);
-  DBUG_ASSERT(mutex != NULL);
+  assert(mutex != NULL);
   PFS_thread *thread= reinterpret_cast<PFS_thread *> (state->m_thread);
 
   uint flags= state->m_flags;
@@ -3960,8 +3960,8 @@ void pfs_end_mutex_wait_v1(PSI_mutex_locker* locker, int rc)
     event_name_array= thread->write_instr_class_waits_stats();
     uint index= mutex->m_class->m_event_name_index;
 
-    DBUG_ASSERT(index <= wait_class_max);
-    DBUG_ASSERT(sanitize_thread(thread) != NULL);
+    assert(index <= wait_class_max);
+    assert(sanitize_thread(thread) != NULL);
 
     if (flags & STATE_FLAG_TIMED)
     {
@@ -3977,7 +3977,7 @@ void pfs_end_mutex_wait_v1(PSI_mutex_locker* locker, int rc)
     if (flags & STATE_FLAG_EVENT)
     {
       PFS_events_waits *wait= reinterpret_cast<PFS_events_waits*> (state->m_wait);
-      DBUG_ASSERT(wait != NULL);
+      assert(wait != NULL);
 
       wait->m_timer_end= timer_end;
       wait->m_end_event_id= thread->m_event_id;
@@ -3987,7 +3987,7 @@ void pfs_end_mutex_wait_v1(PSI_mutex_locker* locker, int rc)
         insert_events_waits_history_long(wait);
       thread->m_events_waits_current--;
 
-      DBUG_ASSERT(wait == thread->m_events_waits_current);
+      assert(wait == thread->m_events_waits_current);
     }
   }
 }
@@ -3999,13 +3999,13 @@ void pfs_end_mutex_wait_v1(PSI_mutex_locker* locker, int rc)
 void pfs_end_rwlock_rdwait_v1(PSI_rwlock_locker* locker, int rc)
 {
   PSI_rwlock_locker_state *state= reinterpret_cast<PSI_rwlock_locker_state*> (locker);
-  DBUG_ASSERT(state != NULL);
+  assert(state != NULL);
 
   ulonglong timer_end= 0;
   ulonglong wait_time= 0;
 
   PFS_rwlock *rwlock= reinterpret_cast<PFS_rwlock *> (state->m_rwlock);
-  DBUG_ASSERT(rwlock != NULL);
+  assert(rwlock != NULL);
 
   if (state->m_flags & STATE_FLAG_TIMED)
   {
@@ -4038,7 +4038,7 @@ void pfs_end_rwlock_rdwait_v1(PSI_rwlock_locker* locker, int rc)
   if (state->m_flags & STATE_FLAG_THREAD)
   {
     PFS_thread *thread= reinterpret_cast<PFS_thread *> (state->m_thread);
-    DBUG_ASSERT(thread != NULL);
+    assert(thread != NULL);
 
     PFS_single_stat *event_name_array;
     event_name_array= thread->write_instr_class_waits_stats();
@@ -4058,7 +4058,7 @@ void pfs_end_rwlock_rdwait_v1(PSI_rwlock_locker* locker, int rc)
     if (state->m_flags & STATE_FLAG_EVENT)
     {
       PFS_events_waits *wait= reinterpret_cast<PFS_events_waits*> (state->m_wait);
-      DBUG_ASSERT(wait != NULL);
+      assert(wait != NULL);
 
       wait->m_timer_end= timer_end;
       wait->m_end_event_id= thread->m_event_id;
@@ -4068,7 +4068,7 @@ void pfs_end_rwlock_rdwait_v1(PSI_rwlock_locker* locker, int rc)
         insert_events_waits_history_long(wait);
       thread->m_events_waits_current--;
 
-      DBUG_ASSERT(wait == thread->m_events_waits_current);
+      assert(wait == thread->m_events_waits_current);
     }
   }
 }
@@ -4080,13 +4080,13 @@ void pfs_end_rwlock_rdwait_v1(PSI_rwlock_locker* locker, int rc)
 void pfs_end_rwlock_wrwait_v1(PSI_rwlock_locker* locker, int rc)
 {
   PSI_rwlock_locker_state *state= reinterpret_cast<PSI_rwlock_locker_state*> (locker);
-  DBUG_ASSERT(state != NULL);
+  assert(state != NULL);
 
   ulonglong timer_end= 0;
   ulonglong wait_time= 0;
 
   PFS_rwlock *rwlock= reinterpret_cast<PFS_rwlock *> (state->m_rwlock);
-  DBUG_ASSERT(rwlock != NULL);
+  assert(rwlock != NULL);
   PFS_thread *thread= reinterpret_cast<PFS_thread *> (state->m_thread);
 
   if (state->m_flags & STATE_FLAG_TIMED)
@@ -4137,7 +4137,7 @@ void pfs_end_rwlock_wrwait_v1(PSI_rwlock_locker* locker, int rc)
     if (state->m_flags & STATE_FLAG_EVENT)
     {
       PFS_events_waits *wait= reinterpret_cast<PFS_events_waits*> (state->m_wait);
-      DBUG_ASSERT(wait != NULL);
+      assert(wait != NULL);
 
       wait->m_timer_end= timer_end;
       wait->m_end_event_id= thread->m_event_id;
@@ -4147,7 +4147,7 @@ void pfs_end_rwlock_wrwait_v1(PSI_rwlock_locker* locker, int rc)
         insert_events_waits_history_long(wait);
       thread->m_events_waits_current--;
 
-      DBUG_ASSERT(wait == thread->m_events_waits_current);
+      assert(wait == thread->m_events_waits_current);
     }
   }
 }
@@ -4159,7 +4159,7 @@ void pfs_end_rwlock_wrwait_v1(PSI_rwlock_locker* locker, int rc)
 void pfs_end_cond_wait_v1(PSI_cond_locker* locker, int rc)
 {
   PSI_cond_locker_state *state= reinterpret_cast<PSI_cond_locker_state*> (locker);
-  DBUG_ASSERT(state != NULL);
+  assert(state != NULL);
 
   ulonglong timer_end= 0;
   ulonglong wait_time= 0;
@@ -4183,7 +4183,7 @@ void pfs_end_cond_wait_v1(PSI_cond_locker* locker, int rc)
   if (state->m_flags & STATE_FLAG_THREAD)
   {
     PFS_thread *thread= reinterpret_cast<PFS_thread *> (state->m_thread);
-    DBUG_ASSERT(thread != NULL);
+    assert(thread != NULL);
 
     PFS_single_stat *event_name_array;
     event_name_array= thread->write_instr_class_waits_stats();
@@ -4203,7 +4203,7 @@ void pfs_end_cond_wait_v1(PSI_cond_locker* locker, int rc)
     if (state->m_flags & STATE_FLAG_EVENT)
     {
       PFS_events_waits *wait= reinterpret_cast<PFS_events_waits*> (state->m_wait);
-      DBUG_ASSERT(wait != NULL);
+      assert(wait != NULL);
 
       wait->m_timer_end= timer_end;
       wait->m_end_event_id= thread->m_event_id;
@@ -4213,7 +4213,7 @@ void pfs_end_cond_wait_v1(PSI_cond_locker* locker, int rc)
         insert_events_waits_history_long(wait);
       thread->m_events_waits_current--;
 
-      DBUG_ASSERT(wait == thread->m_events_waits_current);
+      assert(wait == thread->m_events_waits_current);
     }
   }
 }
@@ -4225,19 +4225,19 @@ void pfs_end_cond_wait_v1(PSI_cond_locker* locker, int rc)
 void pfs_end_table_io_wait_v1(PSI_table_locker* locker, ulonglong numrows)
 {
   PSI_table_locker_state *state= reinterpret_cast<PSI_table_locker_state*> (locker);
-  DBUG_ASSERT(state != NULL);
+  assert(state != NULL);
 
   ulonglong timer_end= 0;
   ulonglong wait_time= 0;
 
   PFS_table *table= reinterpret_cast<PFS_table *> (state->m_table);
-  DBUG_ASSERT(table != NULL);
+  assert(table != NULL);
 
   PFS_single_stat *stat;
   PFS_table_io_stat *table_io_stat;
 
-  DBUG_ASSERT((state->m_index < table->m_share->m_key_count) ||
-              (state->m_index == MAX_INDEXES));
+  assert((state->m_index < table->m_share->m_key_count) ||
+         (state->m_index == MAX_INDEXES));
 
   table_io_stat= & table->m_table_stat.m_index_stat[state->m_index];
   table_io_stat->m_has_data= true;
@@ -4257,7 +4257,7 @@ void pfs_end_table_io_wait_v1(PSI_table_locker* locker, ulonglong numrows)
     stat= & table_io_stat->m_delete;
     break;
   default:
-    DBUG_ASSERT(false);
+    assert(false);
     stat= NULL;
     break;
   }
@@ -4278,7 +4278,7 @@ void pfs_end_table_io_wait_v1(PSI_table_locker* locker, ulonglong numrows)
   if (flags & STATE_FLAG_THREAD)
   {
     PFS_thread *thread= reinterpret_cast<PFS_thread *> (state->m_thread);
-    DBUG_ASSERT(thread != NULL);
+    assert(thread != NULL);
 
     PFS_single_stat *event_name_array;
     event_name_array= thread->write_instr_class_waits_stats();
@@ -4299,7 +4299,7 @@ void pfs_end_table_io_wait_v1(PSI_table_locker* locker, ulonglong numrows)
     if (flags & STATE_FLAG_EVENT)
     {
       PFS_events_waits *wait= reinterpret_cast<PFS_events_waits*> (state->m_wait);
-      DBUG_ASSERT(wait != NULL);
+      assert(wait != NULL);
 
       wait->m_timer_end= timer_end;
       wait->m_end_event_id= thread->m_event_id;
@@ -4310,7 +4310,7 @@ void pfs_end_table_io_wait_v1(PSI_table_locker* locker, ulonglong numrows)
         insert_events_waits_history_long(wait);
       thread->m_events_waits_current--;
 
-      DBUG_ASSERT(wait == thread->m_events_waits_current);
+      assert(wait == thread->m_events_waits_current);
     }
   }
 
@@ -4324,13 +4324,13 @@ void pfs_end_table_io_wait_v1(PSI_table_locker* locker, ulonglong numrows)
 void pfs_end_table_lock_wait_v1(PSI_table_locker* locker)
 {
   PSI_table_locker_state *state= reinterpret_cast<PSI_table_locker_state*> (locker);
-  DBUG_ASSERT(state != NULL);
+  assert(state != NULL);
 
   ulonglong timer_end= 0;
   ulonglong wait_time= 0;
 
   PFS_table *table= reinterpret_cast<PFS_table *> (state->m_table);
-  DBUG_ASSERT(table != NULL);
+  assert(table != NULL);
 
   PFS_single_stat *stat= & table->m_table_stat.m_lock_stat.m_stat[state->m_index];
 
@@ -4350,7 +4350,7 @@ void pfs_end_table_lock_wait_v1(PSI_table_locker* locker)
   if (flags & STATE_FLAG_THREAD)
   {
     PFS_thread *thread= reinterpret_cast<PFS_thread *> (state->m_thread);
-    DBUG_ASSERT(thread != NULL);
+    assert(thread != NULL);
 
     PFS_single_stat *event_name_array;
     event_name_array= thread->write_instr_class_waits_stats();
@@ -4371,7 +4371,7 @@ void pfs_end_table_lock_wait_v1(PSI_table_locker* locker)
     if (flags & STATE_FLAG_EVENT)
     {
       PFS_events_waits *wait= reinterpret_cast<PFS_events_waits*> (state->m_wait);
-      DBUG_ASSERT(wait != NULL);
+      assert(wait != NULL);
 
       wait->m_timer_end= timer_end;
       wait->m_end_event_id= thread->m_event_id;
@@ -4381,7 +4381,7 @@ void pfs_end_table_lock_wait_v1(PSI_table_locker* locker)
         insert_events_waits_history_long(wait);
       thread->m_events_waits_current--;
 
-      DBUG_ASSERT(wait == thread->m_events_waits_current);
+      assert(wait == thread->m_events_waits_current);
     }
   }
 
@@ -4418,7 +4418,7 @@ pfs_end_file_open_wait_v1(PSI_file_locker *locker,
                           void *result)
 {
   PSI_file_locker_state *state= reinterpret_cast<PSI_file_locker_state*> (locker);
-  DBUG_ASSERT(state != NULL);
+  assert(state != NULL);
 
   switch (state->m_operation)
   {
@@ -4439,7 +4439,7 @@ pfs_end_file_open_wait_v1(PSI_file_locker *locker,
     }
     break;
   default:
-    DBUG_ASSERT(false);
+    assert(false);
     break;
   }
 
@@ -4458,7 +4458,7 @@ void pfs_end_file_open_wait_and_bind_to_descriptor_v1
   PFS_file *pfs_file= NULL;
   int index= (int) file;
   PSI_file_locker_state *state= reinterpret_cast<PSI_file_locker_state*> (locker);
-  DBUG_ASSERT(state != NULL);
+  assert(state != NULL);
 
   if (index >= 0)
   {
@@ -4492,9 +4492,9 @@ void pfs_end_file_open_wait_and_bind_to_descriptor_v1
 void pfs_end_temp_file_open_wait_and_bind_to_descriptor_v1
   (PSI_file_locker *locker, File file, const char *filename)
 {
-  DBUG_ASSERT(filename != NULL);
+  assert(filename != NULL);
   PSI_file_locker_state *state= reinterpret_cast<PSI_file_locker_state*> (locker);
-  DBUG_ASSERT(state != NULL);
+  assert(state != NULL);
 
   /* Set filename that was generated during creation of temporary file. */
   state->m_name= filename;
@@ -4519,7 +4519,7 @@ void pfs_start_file_wait_v1(PSI_file_locker *locker,
 {
   ulonglong timer_start= 0;
   PSI_file_locker_state *state= reinterpret_cast<PSI_file_locker_state*> (locker);
-  DBUG_ASSERT(state != NULL);
+  assert(state != NULL);
 
   uint flags= state->m_flags;
 
@@ -4532,7 +4532,7 @@ void pfs_start_file_wait_v1(PSI_file_locker *locker,
   if (flags & STATE_FLAG_EVENT)
   {
     PFS_events_waits *wait= reinterpret_cast<PFS_events_waits*> (state->m_wait);
-    DBUG_ASSERT(wait != NULL);
+    assert(wait != NULL);
 
     wait->m_timer_start= timer_start;
     wait->m_source_file= src_file;
@@ -4549,7 +4549,7 @@ void pfs_end_file_wait_v1(PSI_file_locker *locker,
                           size_t byte_count)
 {
   PSI_file_locker_state *state= reinterpret_cast<PSI_file_locker_state*> (locker);
-  DBUG_ASSERT(state != NULL);
+  assert(state != NULL);
   PFS_file *file= reinterpret_cast<PFS_file *> (state->m_file);
   PFS_file_class *klass= reinterpret_cast<PFS_file_class *> (state->m_class);
   PFS_thread *thread= reinterpret_cast<PFS_thread *> (state->m_thread);
@@ -4600,7 +4600,7 @@ void pfs_end_file_wait_v1(PSI_file_locker *locker,
       byte_stat= &file_stat->m_io_stat.m_misc;
       break;
     default:
-      DBUG_ASSERT(false);
+      assert(false);
       byte_stat= NULL;
       break;
   }
@@ -4621,7 +4621,7 @@ void pfs_end_file_wait_v1(PSI_file_locker *locker,
 
   if (flags & STATE_FLAG_THREAD)
   {
-    DBUG_ASSERT(thread != NULL);
+    assert(thread != NULL);
 
     PFS_single_stat *event_name_array;
     event_name_array= thread->write_instr_class_waits_stats();
@@ -4641,7 +4641,7 @@ void pfs_end_file_wait_v1(PSI_file_locker *locker,
     if (state->m_flags & STATE_FLAG_EVENT)
     {
       PFS_events_waits *wait= reinterpret_cast<PFS_events_waits*> (state->m_wait);
-      DBUG_ASSERT(wait != NULL);
+      assert(wait != NULL);
 
       wait->m_timer_end= timer_end;
       wait->m_number_of_bytes= bytes;
@@ -4656,7 +4656,7 @@ void pfs_end_file_wait_v1(PSI_file_locker *locker,
         insert_events_waits_history_long(wait);
       thread->m_events_waits_current--;
 
-      DBUG_ASSERT(wait == thread->m_events_waits_current);
+      assert(wait == thread->m_events_waits_current);
     }
   }
 }
@@ -4674,7 +4674,7 @@ void pfs_start_file_close_wait_v1(PSI_file_locker *locker,
   uint len;
   PFS_file *pfs_file;
   PSI_file_locker_state *state= reinterpret_cast<PSI_file_locker_state*> (locker);
-  DBUG_ASSERT(state != NULL);
+  assert(state != NULL);
 
   switch (state->m_operation)
   {
@@ -4689,7 +4689,7 @@ void pfs_start_file_close_wait_v1(PSI_file_locker *locker,
   case PSI_FILE_CLOSE:
     break;
   default:
-    DBUG_ASSERT(false);
+    assert(false);
     break;
   }
 
@@ -4705,7 +4705,7 @@ void pfs_start_file_close_wait_v1(PSI_file_locker *locker,
 void pfs_end_file_close_wait_v1(PSI_file_locker *locker, int rc)
 {
   PSI_file_locker_state *state= reinterpret_cast<PSI_file_locker_state*> (locker);
-  DBUG_ASSERT(state != NULL);
+  assert(state != NULL);
 
   pfs_end_file_wait_v1(locker, 0);
 
@@ -4722,7 +4722,7 @@ void pfs_end_file_close_wait_v1(PSI_file_locker *locker, int rc)
       {
         if (file->m_temporary)
         {
-          DBUG_ASSERT(file->m_file_stat.m_open_count <= 1);
+          assert(file->m_file_stat.m_open_count <= 1);
           destroy_file(thread, file);
         }
         else
@@ -4738,7 +4738,7 @@ void pfs_end_file_close_wait_v1(PSI_file_locker *locker, int rc)
         destroy_file(thread, file);
       break;
     default:
-      DBUG_ASSERT(false);
+      assert(false);
       break;
     }
   }
@@ -4753,8 +4753,8 @@ void pfs_end_file_rename_wait_v1(PSI_file_locker *locker, const char *old_name,
                                  const char *new_name, int rc)
 {
   PSI_file_locker_state *state= reinterpret_cast<PSI_file_locker_state*> (locker);
-  DBUG_ASSERT(state != NULL);
-  DBUG_ASSERT(state->m_operation == PSI_FILE_RENAME);
+  assert(state != NULL);
+  assert(state->m_operation == PSI_FILE_RENAME);
 
   if (rc == 0)
   {
@@ -4959,8 +4959,8 @@ pfs_get_thread_statement_locker_v1(PSI_statement_locker_state *state,
                                    PSI_statement_key key,
                                    const void *charset, PSI_sp_share *sp_share)
 {
-  DBUG_ASSERT(state != NULL);
-  DBUG_ASSERT(charset != NULL);
+  assert(state != NULL);
+  assert(charset != NULL);
   if (! flag_global_instrumentation)
     return NULL;
   PFS_statement_class *klass= find_statement_class(key);
@@ -5152,11 +5152,11 @@ pfs_refine_statement_v1(PSI_statement_locker *locker,
   PSI_statement_locker_state *state= reinterpret_cast<PSI_statement_locker_state*> (locker);
   if (state == NULL)
     return NULL;
-  DBUG_ASSERT(state->m_class != NULL);
+  assert(state->m_class != NULL);
   PFS_statement_class *klass;
   /* Only refine statements for mutable instrumentation */
   klass= reinterpret_cast<PFS_statement_class*> (state->m_class);
-  DBUG_ASSERT(klass->is_mutable());
+  assert(klass->is_mutable());
   klass= find_statement_class(key);
 
   uint flags= state->m_flags;
@@ -5167,7 +5167,7 @@ pfs_refine_statement_v1(PSI_statement_locker *locker,
     if (flags & STATE_FLAG_THREAD)
     {
       PFS_thread *pfs_thread= reinterpret_cast<PFS_thread *> (state->m_thread);
-      DBUG_ASSERT(pfs_thread != NULL);
+      assert(pfs_thread != NULL);
       if (pfs_thread->m_events_statements_count > 0)
         pfs_thread->m_events_statements_count--;
     }
@@ -5182,7 +5182,7 @@ pfs_refine_statement_v1(PSI_statement_locker *locker,
   if (flags & STATE_FLAG_EVENT)
   {
     PFS_events_statements *pfs= reinterpret_cast<PFS_events_statements*> (state->m_statement);
-    DBUG_ASSERT(pfs != NULL);
+    assert(pfs != NULL);
 
     /* mutate EVENTS_STATEMENTS_CURRENT.EVENT_NAME */
     pfs->m_class= klass;
@@ -5198,7 +5198,7 @@ void pfs_start_statement_v1(PSI_statement_locker *locker,
                             const char *src_file, uint src_line)
 {
   PSI_statement_locker_state *state= reinterpret_cast<PSI_statement_locker_state*> (locker);
-  DBUG_ASSERT(state != NULL);
+  assert(state != NULL);
 
   uint flags= state->m_flags;
   ulonglong timer_start= 0;
@@ -5210,7 +5210,7 @@ void pfs_start_statement_v1(PSI_statement_locker *locker,
   }
 
   compile_time_assert(PSI_SCHEMA_NAME_LEN == NAME_LEN);
-  DBUG_ASSERT(db_len <= sizeof(state->m_schema_name));
+  assert(db_len <= sizeof(state->m_schema_name));
 
   if (db_len > 0)
     memcpy(state->m_schema_name, db, db_len);
@@ -5219,13 +5219,13 @@ void pfs_start_statement_v1(PSI_statement_locker *locker,
   if (flags & STATE_FLAG_EVENT)
   {
     PFS_events_statements *pfs= reinterpret_cast<PFS_events_statements*> (state->m_statement);
-    DBUG_ASSERT(pfs != NULL);
+    assert(pfs != NULL);
 
     pfs->m_timer_start= timer_start;
     pfs->m_source_file= src_file;
     pfs->m_source_line= src_line;
 
-    DBUG_ASSERT(db_len <= sizeof(pfs->m_current_schema_name));
+    assert(db_len <= sizeof(pfs->m_current_schema_name));
     if (db_len > 0)
       memcpy(pfs->m_current_schema_name, db, db_len);
     pfs->m_current_schema_name_length= db_len;
@@ -5236,7 +5236,7 @@ void pfs_set_statement_text_v1(PSI_statement_locker *locker,
                                const char *text, uint text_len)
 {
   PSI_statement_locker_state *state= reinterpret_cast<PSI_statement_locker_state*> (locker);
-  DBUG_ASSERT(state != NULL);
+  assert(state != NULL);
 
   if (state->m_discarded)
     return;
@@ -5244,7 +5244,7 @@ void pfs_set_statement_text_v1(PSI_statement_locker *locker,
   if (state->m_flags & STATE_FLAG_EVENT)
   {
     PFS_events_statements *pfs= reinterpret_cast<PFS_events_statements*> (state->m_statement);
-    DBUG_ASSERT(pfs != NULL);
+    assert(pfs != NULL);
     if (text_len > pfs_max_sqltext)
     {
       text_len= (uint)pfs_max_sqltext;
@@ -5271,7 +5271,7 @@ void pfs_set_statement_text_v1(PSI_statement_locker *locker,
   {                                                                     \
     PFS_events_statements *pfs;                                         \
     pfs= reinterpret_cast<PFS_events_statements*> (state->m_statement); \
-    DBUG_ASSERT(pfs != NULL);                                           \
+    assert(pfs != NULL);                                                \
     pfs->ATTR= VALUE;                                                   \
   }                                                                     \
   return;
@@ -5288,7 +5288,7 @@ void pfs_set_statement_text_v1(PSI_statement_locker *locker,
   {                                                                     \
     PFS_events_statements *pfs;                                         \
     pfs= reinterpret_cast<PFS_events_statements*> (state->m_statement); \
-    DBUG_ASSERT(pfs != NULL);                                           \
+    assert(pfs != NULL);                                                \
     pfs->ATTR+= VALUE;                                                  \
   }                                                                     \
   return;
@@ -5391,14 +5391,14 @@ void pfs_end_statement_v1(PSI_statement_locker *locker, void *stmt_da)
 {
   PSI_statement_locker_state *state= reinterpret_cast<PSI_statement_locker_state*> (locker);
   Diagnostics_area *da= reinterpret_cast<Diagnostics_area*> (stmt_da);
-  DBUG_ASSERT(state != NULL);
-  DBUG_ASSERT(da != NULL);
+  assert(state != NULL);
+  assert(da != NULL);
 
   if (state->m_discarded)
     return;
 
   PFS_statement_class *klass= reinterpret_cast<PFS_statement_class *> (state->m_class);
-  DBUG_ASSERT(klass != NULL);
+  assert(klass != NULL);
 
   ulonglong timer_end= 0;
   ulonglong wait_time= 0;
@@ -5425,7 +5425,7 @@ void pfs_end_statement_v1(PSI_statement_locker *locker, void *stmt_da)
   if (flags & STATE_FLAG_THREAD)
   {
     PFS_thread *thread= reinterpret_cast<PFS_thread *> (state->m_thread);
-    DBUG_ASSERT(thread != NULL);
+    assert(thread != NULL);
     event_name_array= thread->write_instr_class_statements_stats();
     /* Aggregate to EVENTS_STATEMENTS_SUMMARY_BY_THREAD_BY_EVENT_NAME */
     stat= & event_name_array[index];
@@ -5446,7 +5446,7 @@ void pfs_end_statement_v1(PSI_statement_locker *locker, void *stmt_da)
     if (flags & STATE_FLAG_EVENT)
     {
       PFS_events_statements *pfs= reinterpret_cast<PFS_events_statements*> (state->m_statement);
-      DBUG_ASSERT(pfs != NULL);
+      assert(pfs != NULL);
 
       pfs_dirty_state dirty_state;
       thread->m_stmt_lock.allocated_to_dirty(& dirty_state);
@@ -5500,7 +5500,7 @@ void pfs_end_statement_v1(PSI_statement_locker *locker, void *stmt_da)
       if (thread->m_flag_events_statements_history_long)
         insert_events_statements_history_long(pfs);
 
-      DBUG_ASSERT(thread->m_events_statements_count > 0);
+      assert(thread->m_events_statements_count > 0);
       thread->m_events_statements_count--;
       thread->m_stmt_lock.dirty_to_allocated(& dirty_state);
     }
@@ -5763,7 +5763,7 @@ static inline enum_object_type sp_type_to_object_type(uint sp_type)
     case SP_TYPE_EVENT:
       return OBJECT_TYPE_EVENT;
     default:
-      DBUG_ASSERT(false);
+      assert(false);
       /* Dead code */
       return NO_OBJECT_TYPE;
   }
@@ -5809,7 +5809,7 @@ void pfs_release_sp_share_v1(PSI_sp_share* sp_share)
 PSI_sp_locker* pfs_start_sp_v1(PSI_sp_locker_state *state,
                                PSI_sp_share *sp_share)
 {
-  DBUG_ASSERT(state != NULL);
+  assert(state != NULL);
   if (! flag_global_instrumentation)
     return NULL;
 
@@ -5847,7 +5847,7 @@ PSI_sp_locker* pfs_start_sp_v1(PSI_sp_locker_state *state,
 void pfs_end_sp_v1(PSI_sp_locker *locker)
 {
   PSI_sp_locker_state *state= reinterpret_cast<PSI_sp_locker_state*> (locker);
-  DBUG_ASSERT(state != NULL);
+  assert(state != NULL);
 
   ulonglong timer_end;
   ulonglong wait_time;
@@ -5898,7 +5898,7 @@ pfs_get_thread_transaction_locker_v1(PSI_transaction_locker_state *state,
                                      my_bool read_only,
                                      my_bool autocommit)
 {
-  DBUG_ASSERT(state != NULL);
+  assert(state != NULL);
 
   if (!flag_global_instrumentation)
     return NULL;
@@ -5986,7 +5986,7 @@ void pfs_start_transaction_v1(PSI_transaction_locker *locker,
                               const char *src_file, uint src_line)
 {
   PSI_transaction_locker_state *state= reinterpret_cast<PSI_transaction_locker_state*> (locker);
-  DBUG_ASSERT(state != NULL);
+  assert(state != NULL);
 
   uint flags= state->m_flags;
   ulonglong timer_start= 0;
@@ -6000,7 +6000,7 @@ void pfs_start_transaction_v1(PSI_transaction_locker *locker,
   if (flags & STATE_FLAG_EVENT)
   {
     PFS_events_transactions *pfs= reinterpret_cast<PFS_events_transactions*> (state->m_transaction);
-    DBUG_ASSERT(pfs != NULL);
+    assert(pfs != NULL);
 
     pfs->m_timer_start= timer_start;
     pfs->m_source_file= src_file;
@@ -6016,14 +6016,14 @@ void pfs_set_transaction_gtid_v1(PSI_transaction_locker *locker,
                                  const void *gtid_spec)
 {
   PSI_transaction_locker_state *state= reinterpret_cast<PSI_transaction_locker_state*> (locker);
-  DBUG_ASSERT(state != NULL);
-  DBUG_ASSERT(sid != NULL);
-  DBUG_ASSERT(gtid_spec != NULL);
+  assert(state != NULL);
+  assert(sid != NULL);
+  assert(gtid_spec != NULL);
 
   if (state->m_flags & STATE_FLAG_EVENT)
   {
     PFS_events_transactions *pfs= reinterpret_cast<PFS_events_transactions*> (state->m_transaction);
-    DBUG_ASSERT(pfs != NULL);
+    assert(pfs != NULL);
     pfs->m_sid= *(rpl_sid *)sid;
     pfs->m_gtid_spec= *(Gtid_specification *)gtid_spec;
   }
@@ -6034,13 +6034,13 @@ void pfs_set_transaction_xid_v1(PSI_transaction_locker *locker,
                                 int xa_state)
 {
   PSI_transaction_locker_state *state= reinterpret_cast<PSI_transaction_locker_state*> (locker);
-  DBUG_ASSERT(state != NULL);
+  assert(state != NULL);
 
   if (state->m_flags & STATE_FLAG_EVENT)
   {
     PFS_events_transactions *pfs= reinterpret_cast<PFS_events_transactions*> (state->m_transaction);
-    DBUG_ASSERT(pfs != NULL);
-    DBUG_ASSERT(xid != NULL);
+    assert(pfs != NULL);
+    assert(xid != NULL);
 
     pfs->m_xid= *(PSI_xid *)xid;
     pfs->m_xa_state= (enum_xa_transaction_state)xa_state;
@@ -6053,12 +6053,12 @@ void pfs_set_transaction_xa_state_v1(PSI_transaction_locker *locker,
                                      int xa_state)
 {
   PSI_transaction_locker_state *state= reinterpret_cast<PSI_transaction_locker_state*> (locker);
-  DBUG_ASSERT(state != NULL);
+  assert(state != NULL);
 
   if (state->m_flags & STATE_FLAG_EVENT)
   {
     PFS_events_transactions *pfs= reinterpret_cast<PFS_events_transactions*> (state->m_transaction);
-    DBUG_ASSERT(pfs != NULL);
+    assert(pfs != NULL);
 
     pfs->m_xa_state= (enum_xa_transaction_state)xa_state;
     pfs->m_xa= true;
@@ -6069,15 +6069,15 @@ void pfs_set_transaction_xa_state_v1(PSI_transaction_locker *locker,
 void pfs_set_transaction_trxid_v1(PSI_transaction_locker *locker,
                                   const ulonglong *trxid)
 {
-  DBUG_ASSERT(trxid != NULL);
+  assert(trxid != NULL);
 
   PSI_transaction_locker_state *state= reinterpret_cast<PSI_transaction_locker_state*> (locker);
-  DBUG_ASSERT(state != NULL);
+  assert(state != NULL);
 
   if (state->m_flags & STATE_FLAG_EVENT)
   {
     PFS_events_transactions *pfs= reinterpret_cast<PFS_events_transactions*> (state->m_transaction);
-    DBUG_ASSERT(pfs != NULL);
+    assert(pfs != NULL);
 
     if (pfs->m_trxid == 0)
       pfs->m_trxid= *trxid;
@@ -6094,7 +6094,7 @@ void pfs_set_transaction_trxid_v1(PSI_transaction_locker *locker,
   {                                                                     \
     PFS_events_transactions *pfs;                                       \
     pfs= reinterpret_cast<PFS_events_transactions*> (state->m_transaction); \
-    DBUG_ASSERT(pfs != NULL);                                           \
+    assert(pfs != NULL);                                                \
     pfs->ATTR+= VALUE;                                                  \
   }                                                                     \
   return;
@@ -6121,7 +6121,7 @@ void pfs_inc_transaction_release_savepoint_v1(PSI_transaction_locker *locker,
 void pfs_end_transaction_v1(PSI_transaction_locker *locker, my_bool commit)
 {
   PSI_transaction_locker_state *state= reinterpret_cast<PSI_transaction_locker_state*> (locker);
-  DBUG_ASSERT(state != NULL);
+  assert(state != NULL);
 
   ulonglong timer_end= 0;
   ulonglong wait_time= 0;
@@ -6138,7 +6138,7 @@ void pfs_end_transaction_v1(PSI_transaction_locker *locker, my_bool commit)
   if (flags & STATE_FLAG_THREAD)
   {
     PFS_thread *pfs_thread= reinterpret_cast<PFS_thread *> (state->m_thread);
-    DBUG_ASSERT(pfs_thread != NULL);
+    assert(pfs_thread != NULL);
 
     /* Aggregate to EVENTS_TRANSACTIONS_SUMMARY_BY_THREAD_BY_EVENT_NAME */
     stat= &pfs_thread->write_instr_class_transactions_stats()[GLOBAL_TRANSACTION_INDEX];
@@ -6146,7 +6146,7 @@ void pfs_end_transaction_v1(PSI_transaction_locker *locker, my_bool commit)
     if (flags & STATE_FLAG_EVENT)
     {
       PFS_events_transactions *pfs= reinterpret_cast<PFS_events_transactions*> (state->m_transaction);
-      DBUG_ASSERT(pfs != NULL);
+      assert(pfs != NULL);
 
       /* events_transactions_current may have been cleared while the transaction was active */
       if (unlikely(pfs->m_class == NULL))
@@ -6202,10 +6202,10 @@ void pfs_end_transaction_v1(PSI_transaction_locker *locker, my_bool commit)
 void pfs_end_socket_wait_v1(PSI_socket_locker *locker, size_t byte_count)
 {
   PSI_socket_locker_state *state= reinterpret_cast<PSI_socket_locker_state*> (locker);
-  DBUG_ASSERT(state != NULL);
+  assert(state != NULL);
 
   PFS_socket *socket= reinterpret_cast<PFS_socket *>(state->m_socket);
-  DBUG_ASSERT(socket != NULL);
+  assert(socket != NULL);
 
   ulonglong timer_end= 0;
   ulonglong wait_time= 0;
@@ -6240,7 +6240,7 @@ void pfs_end_socket_wait_v1(PSI_socket_locker *locker, size_t byte_count)
       byte_stat= &socket->m_socket_stat.m_io_stat.m_misc;
       break;
     default:
-      DBUG_ASSERT(false);
+      assert(false);
       byte_stat= NULL;
       break;
   }
@@ -6264,9 +6264,9 @@ void pfs_end_socket_wait_v1(PSI_socket_locker *locker, size_t byte_count)
   if (flags & STATE_FLAG_EVENT)
   {
     PFS_thread *thread= reinterpret_cast<PFS_thread *>(state->m_thread);
-    DBUG_ASSERT(thread != NULL);
+    assert(thread != NULL);
     PFS_events_waits *wait= reinterpret_cast<PFS_events_waits*> (state->m_wait);
-    DBUG_ASSERT(wait != NULL);
+    assert(wait != NULL);
 
     wait->m_timer_end= timer_end;
     wait->m_end_event_id= thread->m_event_id;
@@ -6278,17 +6278,17 @@ void pfs_end_socket_wait_v1(PSI_socket_locker *locker, size_t byte_count)
       insert_events_waits_history_long(wait);
     thread->m_events_waits_current--;
 
-    DBUG_ASSERT(wait == thread->m_events_waits_current);
+    assert(wait == thread->m_events_waits_current);
   }
 }
 
 void pfs_set_socket_state_v1(PSI_socket *socket, PSI_socket_state state)
 {
-  DBUG_ASSERT((state == PSI_SOCKET_STATE_IDLE) || (state == PSI_SOCKET_STATE_ACTIVE));
+  assert((state == PSI_SOCKET_STATE_IDLE) || (state == PSI_SOCKET_STATE_ACTIVE));
   PFS_socket *pfs= reinterpret_cast<PFS_socket*>(socket);
-  DBUG_ASSERT(pfs != NULL);
-  DBUG_ASSERT(pfs->m_idle || (state == PSI_SOCKET_STATE_IDLE));
-  DBUG_ASSERT(!pfs->m_idle || (state == PSI_SOCKET_STATE_ACTIVE));
+  assert(pfs != NULL);
+  assert(pfs->m_idle || (state == PSI_SOCKET_STATE_IDLE));
+  assert(!pfs->m_idle || (state == PSI_SOCKET_STATE_ACTIVE));
   pfs->m_idle= (state == PSI_SOCKET_STATE_IDLE);
 }
 
@@ -6301,7 +6301,7 @@ void pfs_set_socket_info_v1(PSI_socket *socket,
                             socklen_t addr_len)
 {
   PFS_socket *pfs= reinterpret_cast<PFS_socket*>(socket);
-  DBUG_ASSERT(pfs != NULL);
+  assert(pfs != NULL);
 
   /** Set socket descriptor */
   if (fd != NULL)
@@ -6327,7 +6327,7 @@ void pfs_set_socket_info_v1(PSI_socket *socket,
 void pfs_set_socket_thread_owner_v1(PSI_socket *socket)
 {
   PFS_socket *pfs_socket= reinterpret_cast<PFS_socket*>(socket);
-  DBUG_ASSERT(pfs_socket != NULL);
+  assert(pfs_socket != NULL);
   pfs_socket->m_thread_owner= my_thread_get_THR_PFS();
 }
 
@@ -6336,7 +6336,7 @@ pfs_digest_start_v1(PSI_statement_locker *locker)
 {
   PSI_statement_locker_state *statement_state;
   statement_state= reinterpret_cast<PSI_statement_locker_state*> (locker);
-  DBUG_ASSERT(statement_state != NULL);
+  assert(statement_state != NULL);
 
   if (statement_state->m_discarded)
     return NULL;
@@ -6353,8 +6353,8 @@ void pfs_digest_end_v1(PSI_digest_locker *locker, const sql_digest_storage *dige
 {
   PSI_statement_locker_state *statement_state;
   statement_state= reinterpret_cast<PSI_statement_locker_state*> (locker);
-  DBUG_ASSERT(statement_state != NULL);
-  DBUG_ASSERT(digest != NULL);
+  assert(statement_state != NULL);
+  assert(digest != NULL);
 
   if (statement_state->m_discarded)
     return;
@@ -6398,7 +6398,7 @@ void pfs_execute_prepared_stmt_v1 (PSI_statement_locker *locker,
                                    PSI_prepared_stmt* ps)
 {
   PSI_statement_locker_state *state= reinterpret_cast<PSI_statement_locker_state*> (locker);
-  DBUG_ASSERT(state != NULL);
+  assert(state != NULL);
 
   state->m_parent_prepared_stmt= ps;
   state->m_in_prepare= false;
@@ -6427,7 +6427,7 @@ void pfs_set_prepared_stmt_text_v1(PSI_prepared_stmt *prepared_stmt,
 {
   PFS_prepared_stmt *pfs_prepared_stmt =
     reinterpret_cast<PFS_prepared_stmt *>(prepared_stmt);
-  DBUG_ASSERT(pfs_prepared_stmt != NULL);
+  assert(pfs_prepared_stmt != NULL);
 
   uint max_len = COL_INFO_SIZE;
   if (text_len > max_len)
@@ -6450,7 +6450,7 @@ int pfs_set_thread_connect_attrs_v1(const char *buffer, uint length,
 {
   PFS_thread *thd= my_thread_get_THR_PFS();
 
-  DBUG_ASSERT(buffer != NULL);
+  assert(buffer != NULL);
 
   if (likely(thd != NULL) && session_connect_attrs_size_per_thread > 0)
   {
@@ -6487,7 +6487,7 @@ void pfs_register_memory_v1(const char *category,
 PSI_memory_key pfs_memory_alloc_v1(PSI_memory_key key, size_t size, PSI_thread **owner)
 {
   PFS_thread ** owner_thread= reinterpret_cast<PFS_thread**>(owner);
-  DBUG_ASSERT(owner_thread != NULL);
+  assert(owner_thread != NULL);
 
   if (! flag_global_instrumentation)
   {
@@ -6557,7 +6557,7 @@ PSI_memory_key pfs_memory_alloc_v1(PSI_memory_key key, size_t size, PSI_thread *
 PSI_memory_key pfs_memory_realloc_v1(PSI_memory_key key, size_t old_size, size_t new_size, PSI_thread **owner)
 {
   PFS_thread ** owner_thread_hdl= reinterpret_cast<PFS_thread**>(owner);
-  DBUG_ASSERT(owner != NULL);
+  assert(owner != NULL);
 
   PFS_memory_class *klass= find_memory_class(key);
   if (klass == NULL)
@@ -6635,7 +6635,7 @@ PSI_memory_key pfs_memory_realloc_v1(PSI_memory_key key, size_t old_size, size_t
 PSI_memory_key pfs_memory_claim_v1(PSI_memory_key key, size_t size, PSI_thread **owner)
 {
   PFS_thread ** owner_thread= reinterpret_cast<PFS_thread**>(owner);
-  DBUG_ASSERT(owner_thread != NULL);
+  assert(owner_thread != NULL);
 
   PFS_memory_class *klass= find_memory_class(key);
   if (klass == NULL)
@@ -6767,7 +6767,7 @@ void pfs_unlock_table_v1(PSI_table *table)
 {
   PFS_table *pfs_table= reinterpret_cast<PFS_table*> (table);
 
-  DBUG_ASSERT(pfs_table != NULL);
+  assert(pfs_table != NULL);
 
   pfs_table->m_internal_lock= PFS_TL_NONE;
   return;
@@ -6811,7 +6811,7 @@ void
 pfs_set_metadata_lock_status_v1(PSI_metadata_lock *lock, opaque_mdl_status mdl_status)
 {
   PFS_metadata_lock *pfs= reinterpret_cast<PFS_metadata_lock*> (lock);
-  DBUG_ASSERT(pfs != NULL);
+  assert(pfs != NULL);
   pfs->m_mdl_status= mdl_status;
 }
 
@@ -6819,7 +6819,7 @@ void
 pfs_destroy_metadata_lock_v1(PSI_metadata_lock *lock)
 {
   PFS_metadata_lock *pfs= reinterpret_cast<PFS_metadata_lock*> (lock);
-  DBUG_ASSERT(pfs != NULL);
+  assert(pfs != NULL);
   destroy_metadata_lock(pfs);
 }
 
@@ -6830,8 +6830,8 @@ pfs_start_metadata_wait_v1(PSI_metadata_locker_state *state,
                            uint src_line)
 {
   PFS_metadata_lock *pfs_lock= reinterpret_cast<PFS_metadata_lock*> (lock);
-  DBUG_ASSERT(state != NULL);
-  DBUG_ASSERT(pfs_lock != NULL);
+  assert(state != NULL);
+  assert(pfs_lock != NULL);
 
   if (! pfs_lock->m_enabled)
     return NULL;
@@ -6920,7 +6920,7 @@ pfs_end_metadata_wait_v1(PSI_metadata_locker *locker,
                          int rc)
 {
   PSI_metadata_locker_state *state= reinterpret_cast<PSI_metadata_locker_state*> (locker);
-  DBUG_ASSERT(state != NULL);
+  assert(state != NULL);
 
   ulonglong timer_end= 0;
   ulonglong wait_time= 0;
@@ -6954,7 +6954,7 @@ pfs_end_metadata_wait_v1(PSI_metadata_locker *locker,
     if (flags & STATE_FLAG_EVENT)
     {
       PFS_events_waits *wait= reinterpret_cast<PFS_events_waits*> (state->m_wait);
-      DBUG_ASSERT(wait != NULL);
+      assert(wait != NULL);
 
       wait->m_timer_end= timer_end;
       wait->m_end_event_id= thread->m_event_id;
@@ -6964,7 +6964,7 @@ pfs_end_metadata_wait_v1(PSI_metadata_locker *locker,
         insert_events_waits_history_long(wait);
       thread->m_events_waits_current--;
 
-      DBUG_ASSERT(wait == thread->m_events_waits_current);
+      assert(wait == thread->m_events_waits_current);
     }
   }
   else
diff --git a/storage/perfschema/pfs.h b/storage/perfschema/pfs.h
index ce90745dc45..56b89ef6f9f 100644
--- a/storage/perfschema/pfs.h
+++ b/storage/perfschema/pfs.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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 fe644394829..8e75538c0be 100644
--- a/storage/perfschema/pfs_account.cc
+++ b/storage/perfschema/pfs_account.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -74,9 +74,9 @@ static uchar *account_hash_get_key(const uchar *entry, size_t *length,
   const PFS_account *account;
   const void *result;
   typed_entry= reinterpret_cast<const PFS_account* const *> (entry);
-  DBUG_ASSERT(typed_entry != NULL);
+  assert(typed_entry != NULL);
   account= *typed_entry;
-  DBUG_ASSERT(account != NULL);
+  assert(account != NULL);
   *length= account->m_key.m_key_length;
   result= account->m_key.m_hash_key;
   return const_cast<uchar*> (reinterpret_cast<const uchar*> (result));
@@ -123,8 +123,8 @@ static void set_account_key(PFS_account_key *key,
                               const char *user, uint user_length,
                               const char *host, uint host_length)
 {
-  DBUG_ASSERT(user_length <= USERNAME_LENGTH);
-  DBUG_ASSERT(host_length <= HOSTNAME_LENGTH);
+  assert(user_length <= USERNAME_LENGTH);
+  assert(host_length <= HOSTNAME_LENGTH);
 
   char *ptr= &key->m_hash_key[0];
   if (user_length > 0)
@@ -653,7 +653,7 @@ void purge_account(PFS_thread *thread, PFS_account *account)
                     account->m_key.m_key_length));
   if (entry && (entry != MY_ERRPTR))
   {
-    DBUG_ASSERT(*entry == account);
+    assert(*entry == account);
     if (account->get_refcount() == 0)
     {
       lf_hash_delete(&account_hash, pins,
diff --git a/storage/perfschema/pfs_account.h b/storage/perfschema/pfs_account.h
index 4b3e30806b8..a05e59f8f1d 100644
--- a/storage/perfschema/pfs_account.h
+++ b/storage/perfschema/pfs_account.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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 6a9f8b3cb6f..b0542f092d6 100644
--- a/storage/perfschema/pfs_atomic.h
+++ b/storage/perfschema/pfs_atomic.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2009, 2021, Oracle and/or its affiliates.
 
   This 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 7ce8b400a6b..4a554b626c6 100644
--- a/storage/perfschema/pfs_autosize.cc
+++ b/storage/perfschema/pfs_autosize.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -242,15 +242,15 @@ void pfs_automated_sizing(PFS_global_param *param)
     heuristic= estimate_hints(param);
     apply_heuristic(param, heuristic);
 
-    DBUG_ASSERT(param->m_events_waits_history_sizing >= 0);
-    DBUG_ASSERT(param->m_events_waits_history_long_sizing >= 0);
-    DBUG_ASSERT(param->m_events_stages_history_sizing >= 0);
-    DBUG_ASSERT(param->m_events_stages_history_long_sizing >= 0);
-    DBUG_ASSERT(param->m_events_statements_history_sizing >= 0);
-    DBUG_ASSERT(param->m_events_statements_history_long_sizing >= 0);
-    DBUG_ASSERT(param->m_events_transactions_history_sizing >= 0);
-    DBUG_ASSERT(param->m_events_transactions_history_long_sizing >= 0);
-    DBUG_ASSERT(param->m_session_connect_attrs_sizing >= 0);
+    assert(param->m_events_waits_history_sizing >= 0);
+    assert(param->m_events_waits_history_long_sizing >= 0);
+    assert(param->m_events_stages_history_sizing >= 0);
+    assert(param->m_events_stages_history_long_sizing >= 0);
+    assert(param->m_events_statements_history_sizing >= 0);
+    assert(param->m_events_statements_history_long_sizing >= 0);
+    assert(param->m_events_transactions_history_sizing >= 0);
+    assert(param->m_events_transactions_history_long_sizing >= 0);
+    assert(param->m_session_connect_attrs_sizing >= 0);
   }
   else
   {
diff --git a/storage/perfschema/pfs_buffer_container.cc b/storage/perfschema/pfs_buffer_container.cc
index cd87cb247e2..7d1d74541d1 100644
--- a/storage/perfschema/pfs_buffer_container.cc
+++ b/storage/perfschema/pfs_buffer_container.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2014, 2021, Oracle and/or its affiliates.
 
   This 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 ed1a933f545..cdbf4119fae 100644
--- a/storage/perfschema/pfs_buffer_container.h
+++ b/storage/perfschema/pfs_buffer_container.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2014, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -159,7 +159,7 @@ class PFS_buffer_default_allocator
 
   void free_array(array_type *array)
   {
-    DBUG_ASSERT(array->m_max > 0);
+    assert(array->m_max > 0);
 
     PFS_FREE_ARRAY(m_builtin_class,
                    array->m_max, sizeof(T), array->m_ptr);
@@ -259,7 +259,7 @@ class PFS_buffer_container
 
   iterator_type iterate(uint index)
   {
-    DBUG_ASSERT(index <= m_max);
+    assert(index <= m_max);
     return PFS_buffer_iterator<T, U, V>(this, index);
   }
 
@@ -319,7 +319,7 @@ class PFS_buffer_container
 
   inline value_type* get(uint index)
   {
-    DBUG_ASSERT(index < m_max);
+    assert(index < m_max);
 
     value_type *pfs= m_array.m_ptr + index;
     if (pfs->m_lock.is_populated())
@@ -364,7 +364,7 @@ class PFS_buffer_container
 private:
   value_type* scan_next(uint & index, uint * found_index)
   {
-    DBUG_ASSERT(index <= m_max);
+    assert(index <= m_max);
 
     value_type *pfs_first= m_array.get_first();
     value_type *pfs= pfs_first + index;
@@ -479,9 +479,9 @@ class PFS_buffer_scalable_container
       m_full= false;
     }
 
-    DBUG_ASSERT(m_max_page_count <= PFS_PAGE_COUNT);
-    DBUG_ASSERT(0 < m_last_page_size);
-    DBUG_ASSERT(m_last_page_size <= PFS_PAGE_SIZE);
+    assert(m_max_page_count <= PFS_PAGE_COUNT);
+    assert(0 < m_last_page_size);
+    assert(m_last_page_size <= PFS_PAGE_SIZE);
 
     native_mutex_init(& m_critical_section, NULL);
     return 0;
@@ -692,7 +692,7 @@ class PFS_buffer_scalable_container
         // ==================================================================
       }
 
-      DBUG_ASSERT(array != NULL);
+      assert(array != NULL);
       pfs= array->allocate(dirty_state);
       if (pfs != NULL)
       {
@@ -753,7 +753,7 @@ class PFS_buffer_scalable_container
 
   iterator_type iterate(uint index)
   {
-    DBUG_ASSERT(index <= m_max);
+    assert(index <= m_max);
     return PFS_buffer_scalable_iterator<T, PFS_PAGE_SIZE, PFS_PAGE_COUNT, U, V>(this, index);
   }
 
@@ -861,7 +861,7 @@ class PFS_buffer_scalable_container
 
   value_type* get(uint index)
   {
-    DBUG_ASSERT(index < m_max);
+    assert(index < m_max);
 
     uint index_1= index / PFS_PAGE_SIZE;
     array_type *page= m_pages[index_1];
@@ -958,13 +958,13 @@ class PFS_buffer_scalable_container
   {
     if (page_index + 1 < m_max_page_count)
       return PFS_PAGE_SIZE;
-    DBUG_ASSERT(page_index + 1 == m_max_page_count);
+    assert(page_index + 1 == m_max_page_count);
     return m_last_page_size;
   }
 
   value_type* scan_next(uint & index, uint * found_index)
   {
-    DBUG_ASSERT(index <= m_max);
+    assert(index <= m_max);
 
     uint index_1= index / PFS_PAGE_SIZE;
     uint index_2= index % PFS_PAGE_SIZE;
@@ -1179,7 +1179,7 @@ class PFS_partitioned_buffer_scalable_container
 
   value_type *allocate(pfs_dirty_state *dirty_state, uint partition)
   {
-    DBUG_ASSERT(partition < PFS_PARTITION_COUNT);
+    assert(partition < PFS_PARTITION_COUNT);
 
     return m_partitions[partition]->allocate(dirty_state);
   }
@@ -1308,7 +1308,7 @@ class PFS_partitioned_buffer_scalable_container
   value_type* scan_next(uint & partition_index, uint & sub_index, uint * found_partition, uint * found_sub_index)
   {
     value_type *record= NULL;
-    DBUG_ASSERT(partition_index < PFS_PARTITION_COUNT);
+    assert(partition_index < PFS_PARTITION_COUNT);
 
     while (partition_index < PFS_PARTITION_COUNT)
     {
diff --git a/storage/perfschema/pfs_builtin_memory.cc b/storage/perfschema/pfs_builtin_memory.cc
index 6955f1a8ec3..7528b557f19 100644
--- a/storage/perfschema/pfs_builtin_memory.cc
+++ b/storage/perfschema/pfs_builtin_memory.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2014, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -119,7 +119,7 @@ static void init_builtin_memory_class(PFS_builtin_memory_class *klass, const cha
   my_snprintf(klass->m_class.m_name, sizeof(klass->m_class.m_name), "%.*s",
               PFS_MAX_INFO_NAME_LENGTH - 1, name);
   klass->m_class.m_name_length= strlen(name);
-  DBUG_ASSERT(klass->m_class.m_name_length < sizeof(klass->m_class.m_name));
+  assert(klass->m_class.m_name_length < sizeof(klass->m_class.m_name));
   klass->m_class.m_timer= NULL;
 
   klass->m_stat.reset();
diff --git a/storage/perfschema/pfs_builtin_memory.h b/storage/perfschema/pfs_builtin_memory.h
index 1c00275d5b9..2c9da9dd4a0 100644
--- a/storage/perfschema/pfs_builtin_memory.h
+++ b/storage/perfschema/pfs_builtin_memory.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2014, 2021, Oracle and/or its affiliates.
 
   This 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_check.cc b/storage/perfschema/pfs_check.cc
index 6496bf2f745..cd5efe254de 100644
--- a/storage/perfschema/pfs_check.cc
+++ b/storage/perfschema/pfs_check.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2009, 2021, Oracle and/or its affiliates.
 
   This 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 cef9fcc4588..6285a1ecddb 100644
--- a/storage/perfschema/pfs_column_types.h
+++ b/storage/perfschema/pfs_column_types.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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 8372cb95efe..46bbed11f50 100644
--- a/storage/perfschema/pfs_column_values.cc
+++ b/storage/perfschema/pfs_column_values.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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 c730e6cb2d2..6bf2f60674b 100644
--- a/storage/perfschema/pfs_column_values.h
+++ b/storage/perfschema/pfs_column_values.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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 b6774f652c3..9f75c58fb06 100644
--- a/storage/perfschema/pfs_con_slice.cc
+++ b/storage/perfschema/pfs_con_slice.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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 149f7ea6845..0e14ce87680 100644
--- a/storage/perfschema/pfs_con_slice.h
+++ b/storage/perfschema/pfs_con_slice.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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 bd6a9aab7fa..52deec9a7cb 100644
--- a/storage/perfschema/pfs_defaults.cc
+++ b/storage/perfschema/pfs_defaults.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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 7a3168cbc51..54dd741d9fc 100644
--- a/storage/perfschema/pfs_defaults.h
+++ b/storage/perfschema/pfs_defaults.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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 5e6131da712..34b35ed7181 100644
--- a/storage/perfschema/pfs_digest.cc
+++ b/storage/perfschema/pfs_digest.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -146,9 +146,9 @@ static uchar *digest_hash_get_key(const uchar *entry, size_t *length,
   const PFS_statements_digest_stat *digest;
   const void *result;
   typed_entry= reinterpret_cast<const PFS_statements_digest_stat*const*>(entry);
-  DBUG_ASSERT(typed_entry != NULL);
+  assert(typed_entry != NULL);
   digest= *typed_entry;
-  DBUG_ASSERT(digest != NULL);
+  assert(digest != NULL);
   *length= sizeof (PFS_digest_key);
   result= & digest->m_digest_key;
   return const_cast<uchar*> (reinterpret_cast<const uchar*> (result));
@@ -198,7 +198,7 @@ find_or_create_digest(PFS_thread *thread,
                       const char *schema_name,
                       uint schema_name_length)
 {
-  DBUG_ASSERT(digest_storage != NULL);
+  assert(digest_storage != NULL);
 
   if (statements_digest_stat_array == NULL)
     return NULL;
@@ -276,7 +276,7 @@ find_or_create_digest(PFS_thread *thread,
     }
 
     /* Add a new record in digest stat array. */
-    DBUG_ASSERT(safe_index < digest_max);
+    assert(safe_index < digest_max);
     pfs= &statements_digest_stat_array[safe_index];
 
     if (pfs->m_lock.is_free())
diff --git a/storage/perfschema/pfs_digest.h b/storage/perfschema/pfs_digest.h
index a4aed040fa6..091dd26cc45 100644
--- a/storage/perfschema/pfs_digest.h
+++ b/storage/perfschema/pfs_digest.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
 
   This 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 2d0c38d366c..232f427dd4d 100644
--- a/storage/perfschema/pfs_engine_table.cc
+++ b/storage/perfschema/pfs_engine_table.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -146,13 +146,13 @@ bool PFS_table_context::initialize(void)
   {
     /* Restore context from TLS. */
     PFS_table_context *context= static_cast<PFS_table_context *>(my_get_thread_local(m_thr_key));
-    DBUG_ASSERT(context != NULL);
+    assert(context != NULL);
 
     if(context)
     {
       m_last_version= context->m_current_version;
       m_map= context->m_map;
-      DBUG_ASSERT(m_map_size == context->m_map_size);
+      assert(m_map_size == context->m_map_size);
       m_map_size= context->m_map_size;
       m_word_size= context->m_word_size;
     }
@@ -161,7 +161,7 @@ bool PFS_table_context::initialize(void)
   {
     /* Check that TLS is not in use. */
     PFS_table_context *context= static_cast<PFS_table_context *>(my_get_thread_local(m_thr_key));
-    //DBUG_ASSERT(context == NULL);
+    //assert(context == NULL);
 
     context= this;
 
@@ -653,28 +653,28 @@ void PFS_engine_table::get_normalizer(PFS_instr_class *instr_class)
 
 void PFS_engine_table::set_field_long(Field *f, long value)
 {
-  DBUG_ASSERT(f->real_type() == MYSQL_TYPE_LONG);
+  assert(f->real_type() == MYSQL_TYPE_LONG);
   Field_long *f2= (Field_long*) f;
   f2->store(value, false);
 }
 
 void PFS_engine_table::set_field_ulong(Field *f, ulong value)
 {
-  DBUG_ASSERT(f->real_type() == MYSQL_TYPE_LONG);
+  assert(f->real_type() == MYSQL_TYPE_LONG);
   Field_long *f2= (Field_long*) f;
   f2->store(value, true);
 }
 
 void PFS_engine_table::set_field_longlong(Field *f, longlong value)
 {
-  DBUG_ASSERT(f->real_type() == MYSQL_TYPE_LONGLONG);
+  assert(f->real_type() == MYSQL_TYPE_LONGLONG);
   Field_longlong *f2= (Field_longlong*) f;
   f2->store(value, false);
 }
 
 void PFS_engine_table::set_field_ulonglong(Field *f, ulonglong value)
 {
-  DBUG_ASSERT(f->real_type() == MYSQL_TYPE_LONGLONG);
+  assert(f->real_type() == MYSQL_TYPE_LONGLONG);
   Field_longlong *f2= (Field_longlong*) f;
   f2->store(value, true);
 }
@@ -682,7 +682,7 @@ void PFS_engine_table::set_field_ulonglong(Field *f, ulonglong value)
 void PFS_engine_table::set_field_char_utf8(Field *f, const char* str,
                                            uint len)
 {
-  DBUG_ASSERT(f->real_type() == MYSQL_TYPE_STRING);
+  assert(f->real_type() == MYSQL_TYPE_STRING);
   Field_string *f2= (Field_string*) f;
   f2->store(str, len, &my_charset_utf8_bin);
 }
@@ -692,7 +692,7 @@ void PFS_engine_table::set_field_varchar(Field *f,
                                          const char* str,
                                          uint len)
 {
-  DBUG_ASSERT(f->real_type() == MYSQL_TYPE_VARCHAR);
+  assert(f->real_type() == MYSQL_TYPE_VARCHAR);
   Field_varstring *f2= (Field_varstring*) f;
   f2->store(str, len, cs);
 }
@@ -700,7 +700,7 @@ void PFS_engine_table::set_field_varchar(Field *f,
 void PFS_engine_table::set_field_varchar_utf8(Field *f, const char* str,
                                               uint len)
 {
-  DBUG_ASSERT(f->real_type() == MYSQL_TYPE_VARCHAR);
+  assert(f->real_type() == MYSQL_TYPE_VARCHAR);
   Field_varstring *f2= (Field_varstring*) f;
   f2->store(str, len, &my_charset_utf8_bin);
 }
@@ -708,7 +708,7 @@ void PFS_engine_table::set_field_varchar_utf8(Field *f, const char* str,
 void PFS_engine_table::set_field_longtext_utf8(Field *f, const char* str,
                                                uint len)
 {
-  DBUG_ASSERT(f->real_type() == MYSQL_TYPE_BLOB);
+  assert(f->real_type() == MYSQL_TYPE_BLOB);
   Field_blob *f2= (Field_blob*) f;
   f2->store(str, len, &my_charset_utf8_bin);
 }
@@ -716,14 +716,14 @@ void PFS_engine_table::set_field_longtext_utf8(Field *f, const char* str,
 void PFS_engine_table::set_field_blob(Field *f, const char* val,
                                       uint len)
 {
-  DBUG_ASSERT(f->real_type() == MYSQL_TYPE_BLOB);
+  assert(f->real_type() == MYSQL_TYPE_BLOB);
   Field_blob *f2= (Field_blob*) f;
   f2->store(val, len, &my_charset_utf8_bin);
 }
 
 void PFS_engine_table::set_field_enum(Field *f, ulonglong value)
 {
-  DBUG_ASSERT(f->real_type() == MYSQL_TYPE_ENUM);
+  assert(f->real_type() == MYSQL_TYPE_ENUM);
   Field_enum *f2= (Field_enum*) f;
   f2->store_type(value);
 }
@@ -733,21 +733,21 @@ void PFS_engine_table::set_field_timestamp(Field *f, ulonglong value)
   struct timeval tm;
   tm.tv_sec= (long)(value / 1000000);
   tm.tv_usec= (long)(value % 1000000);
-  DBUG_ASSERT(f->real_type() == MYSQL_TYPE_TIMESTAMP2);
+  assert(f->real_type() == MYSQL_TYPE_TIMESTAMP2);
   Field_timestampf *f2= (Field_timestampf*) f;
   f2->store_timestamp(& tm);
 }
 
 void PFS_engine_table::set_field_double(Field *f, double value)
 {
-  DBUG_ASSERT(f->real_type() == MYSQL_TYPE_DOUBLE);
+  assert(f->real_type() == MYSQL_TYPE_DOUBLE);
   Field_double *f2= (Field_double*) f;
   f2->store(value);
 }
 
 ulonglong PFS_engine_table::get_field_enum(Field *f)
 {
-  DBUG_ASSERT(f->real_type() == MYSQL_TYPE_ENUM);
+  assert(f->real_type() == MYSQL_TYPE_ENUM);
   Field_enum *f2= (Field_enum*) f;
   return f2->val_int();
 }
@@ -755,7 +755,7 @@ ulonglong PFS_engine_table::get_field_enum(Field *f)
 String*
 PFS_engine_table::get_field_char_utf8(Field *f, String *val)
 {
-  DBUG_ASSERT(f->real_type() == MYSQL_TYPE_STRING);
+  assert(f->real_type() == MYSQL_TYPE_STRING);
   Field_string *f2= (Field_string*) f;
   val= f2->val_str(NULL, val);
   return val;
@@ -764,7 +764,7 @@ PFS_engine_table::get_field_char_utf8(Field *f, String *val)
 String*
 PFS_engine_table::get_field_varchar_utf8(Field *f, String *val)
 {
-  DBUG_ASSERT(f->real_type() == MYSQL_TYPE_VARCHAR);
+  assert(f->real_type() == MYSQL_TYPE_VARCHAR);
   Field_varstring *f2= (Field_varstring*) f;
   val= f2->val_str(NULL, val);
   return val;
@@ -860,7 +860,7 @@ static bool allow_drop_table_privilege() {
     return false;
   }
 
-  DBUG_ASSERT(thd->lex != NULL);
+  assert(thd->lex != NULL);
   if ((thd->lex->sql_command != SQLCOM_TRUNCATE) &&
       (thd->lex->sql_command != SQLCOM_GRANT)) {
     return false;
diff --git a/storage/perfschema/pfs_engine_table.h b/storage/perfschema/pfs_engine_table.h
index 8ddb3a34c69..3d28ae2ffbd 100644
--- a/storage/perfschema/pfs_engine_table.h
+++ b/storage/perfschema/pfs_engine_table.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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.h b/storage/perfschema/pfs_events.h
index c908f24b33f..048ca7d991e 100644
--- a/storage/perfschema/pfs_events.h
+++ b/storage/perfschema/pfs_events.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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 1b42df5164b..7996f3a30c6 100644
--- a/storage/perfschema/pfs_events_stages.cc
+++ b/storage/perfschema/pfs_events_stages.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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,7 +101,7 @@ void insert_events_stages_history(PFS_thread *thread, PFS_events_stages *stage)
   if (unlikely(events_stages_history_per_thread == 0))
     return;
 
-  DBUG_ASSERT(thread->m_stages_history != NULL);
+  assert(thread->m_stages_history != NULL);
 
   uint index= thread->m_stages_history_index;
 
@@ -133,7 +133,7 @@ void insert_events_stages_history_long(PFS_events_stages *stage)
   if (unlikely(events_stages_history_long_size == 0))
     return;
 
-  DBUG_ASSERT(events_stages_history_long_array != NULL);
+  assert(events_stages_history_long_array != NULL);
 
   uint index= PFS_atomic::add_u32(&events_stages_history_long_index.m_u32, 1);
 
diff --git a/storage/perfschema/pfs_events_stages.h b/storage/perfschema/pfs_events_stages.h
index 2ca521bada8..d38a50fe0f7 100644
--- a/storage/perfschema/pfs_events_stages.h
+++ b/storage/perfschema/pfs_events_stages.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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 f8324006c2c..b4a95c327f2 100644
--- a/storage/perfschema/pfs_events_statements.cc
+++ b/storage/perfschema/pfs_events_statements.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -180,7 +180,7 @@ void insert_events_statements_history(PFS_thread *thread, PFS_events_statements
   if (unlikely(events_statements_history_per_thread == 0))
     return;
 
-  DBUG_ASSERT(thread->m_statements_history != NULL);
+  assert(thread->m_statements_history != NULL);
 
   uint index= thread->m_statements_history_index;
 
@@ -212,7 +212,7 @@ void insert_events_statements_history_long(PFS_events_statements *statement)
   if (unlikely(events_statements_history_long_size == 0))
     return ;
 
-  DBUG_ASSERT(events_statements_history_long_array != NULL);
+  assert(events_statements_history_long_array != NULL);
 
   uint index= PFS_atomic::add_u32(&events_statements_history_long_index.m_u32, 1);
 
diff --git a/storage/perfschema/pfs_events_statements.h b/storage/perfschema/pfs_events_statements.h
index 27894708a39..f1ee2f08402 100644
--- a/storage/perfschema/pfs_events_statements.h
+++ b/storage/perfschema/pfs_events_statements.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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 884234913e8..8b83b71c96b 100644
--- a/storage/perfschema/pfs_events_transactions.cc
+++ b/storage/perfschema/pfs_events_transactions.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
 
   This 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,7 +101,7 @@ void insert_events_transactions_history(PFS_thread *thread, PFS_events_transacti
   if (unlikely(events_transactions_history_per_thread == 0))
     return;
 
-  DBUG_ASSERT(thread->m_transactions_history != NULL);
+  assert(thread->m_transactions_history != NULL);
 
   uint index= thread->m_transactions_history_index;
 
@@ -133,7 +133,7 @@ void insert_events_transactions_history_long(PFS_events_transactions *transactio
   if (unlikely(events_transactions_history_long_size == 0))
     return ;
 
-  DBUG_ASSERT(events_transactions_history_long_array != NULL);
+  assert(events_transactions_history_long_array != NULL);
 
   uint index= PFS_atomic::add_u32(&events_transactions_history_long_index.m_u32, 1);
 
@@ -252,7 +252,7 @@ bool xid_printable(PSI_xid *xid, size_t offset, size_t length)
   if (xid->is_null())
     return false;
 
-  DBUG_ASSERT(offset + length <= MYSQL_XIDDATASIZE);
+  assert(offset + length <= MYSQL_XIDDATASIZE);
 
   unsigned char *c= (unsigned char*)&xid->data + offset;
 
diff --git a/storage/perfschema/pfs_events_transactions.h b/storage/perfschema/pfs_events_transactions.h
index 25c15e379b9..dae829fb1a8 100644
--- a/storage/perfschema/pfs_events_transactions.h
+++ b/storage/perfschema/pfs_events_transactions.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
 
   This 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 3e6e0dddff4..28e4f22f9d2 100644
--- a/storage/perfschema/pfs_events_waits.cc
+++ b/storage/perfschema/pfs_events_waits.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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 d79b310073e..d2091876c4e 100644
--- a/storage/perfschema/pfs_events_waits.h
+++ b/storage/perfschema/pfs_events_waits.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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_global.cc b/storage/perfschema/pfs_global.cc
index b79c6623be1..8296e77d5b6 100644
--- a/storage/perfschema/pfs_global.cc
+++ b/storage/perfschema/pfs_global.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. All rights
    reserved.
 
   This program is free software; you can redistribute it and/or modify
@@ -57,8 +57,8 @@ bool pfs_initialized= false;
 */
 void *pfs_malloc(PFS_builtin_memory_class *klass, size_t size, myf flags)
 {
-  DBUG_ASSERT(klass != NULL);
-  DBUG_ASSERT(size > 0);
+  assert(klass != NULL);
+  assert(size > 0);
 
   void *ptr= NULL;
 
@@ -135,9 +135,9 @@ void pfs_free(PFS_builtin_memory_class *klass, size_t size, void *ptr)
 */
 void *pfs_malloc_array(PFS_builtin_memory_class *klass, size_t n, size_t size, myf flags)
 {
-  DBUG_ASSERT(klass != NULL);
-  DBUG_ASSERT(n > 0);
-  DBUG_ASSERT(size > 0);
+  assert(klass != NULL);
+  assert(n > 0);
+  assert(size > 0);
   void *ptr= NULL;
   size_t array_size= n * size;
   /* Check for overflow before allocating. */
@@ -170,7 +170,7 @@ void pfs_free_array(PFS_builtin_memory_class *klass, size_t n, size_t size, void
     return;
   size_t array_size= n * size;
   /* Overflow should have been detected by pfs_malloc_array. */
-  DBUG_ASSERT(!is_overflow(array_size, n, size));
+  assert(!is_overflow(array_size, n, size));
   return pfs_free(klass, array_size, ptr);
 }
 
@@ -213,9 +213,9 @@ uint pfs_get_socket_address(char *host,
                             const struct sockaddr_storage *src_addr,
                             socklen_t src_len)
 {
-  DBUG_ASSERT(host);
-  DBUG_ASSERT(src_addr);
-  DBUG_ASSERT(port);
+  assert(host);
+  assert(src_addr);
+  assert(port);
 
   memset(host, 0, host_len);
   *port= 0;
diff --git a/storage/perfschema/pfs_global.h b/storage/perfschema/pfs_global.h
index dd47e90f1db..4b299c80b4d 100644
--- a/storage/perfschema/pfs_global.h
+++ b/storage/perfschema/pfs_global.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -174,7 +174,7 @@ inline uint randomized_index(const void *ptr, uint max_size)
   seed2= seed1*seed1;
   seed1= result;
 
-  DBUG_ASSERT(result < max_size);
+  assert(result < max_size);
   return result;
 }
 
diff --git a/storage/perfschema/pfs_host.cc b/storage/perfschema/pfs_host.cc
index d5a39e8888d..9b3f852aa15 100644
--- a/storage/perfschema/pfs_host.cc
+++ b/storage/perfschema/pfs_host.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -71,9 +71,9 @@ static uchar *host_hash_get_key(const uchar *entry, size_t *length,
   const PFS_host *host;
   const void *result;
   typed_entry= reinterpret_cast<const PFS_host* const *> (entry);
-  DBUG_ASSERT(typed_entry != NULL);
+  assert(typed_entry != NULL);
   host= *typed_entry;
-  DBUG_ASSERT(host != NULL);
+  assert(host != NULL);
   *length= host->m_key.m_key_length;
   result= host->m_key.m_hash_key;
   return const_cast<uchar*> (reinterpret_cast<const uchar*> (result));
@@ -119,7 +119,7 @@ static LF_PINS* get_host_hash_pins(PFS_thread *thread)
 static void set_host_key(PFS_host_key *key,
                          const char *host, uint host_length)
 {
-  DBUG_ASSERT(host_length <= HOSTNAME_LENGTH);
+  assert(host_length <= HOSTNAME_LENGTH);
 
   char *ptr= &key->m_hash_key[0];
   if (host_length > 0)
@@ -328,7 +328,7 @@ void purge_host(PFS_thread *thread, PFS_host *host)
                     host->m_key.m_hash_key, host->m_key.m_key_length));
   if (entry && (entry != MY_ERRPTR))
   {
-    DBUG_ASSERT(*entry == host);
+    assert(*entry == host);
     if (host->get_refcount() == 0)
     {
       lf_hash_delete(&host_hash, pins,
diff --git a/storage/perfschema/pfs_host.h b/storage/perfschema/pfs_host.h
index 7f601381de6..e006deed93b 100644
--- a/storage/perfschema/pfs_host.h
+++ b/storage/perfschema/pfs_host.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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 1c8f554c396..e7e96d77fb7 100644
--- a/storage/perfschema/pfs_instr.cc
+++ b/storage/perfschema/pfs_instr.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -105,7 +105,7 @@ int init_instruments(const PFS_global_param *param)
   uint index;
 
   /* Make sure init_event_name_sizing is called */
-  DBUG_ASSERT(wait_class_max != 0);
+  assert(wait_class_max != 0);
 
   file_handle_max= param->m_file_handle_sizing;
   file_handle_full= false;
@@ -257,9 +257,9 @@ static uchar *filename_hash_get_key(const uchar *entry, size_t *length,
   const PFS_file *file;
   const void *result;
   typed_entry= reinterpret_cast<const PFS_file* const *> (entry);
-  DBUG_ASSERT(typed_entry != NULL);
+  assert(typed_entry != NULL);
   file= *typed_entry;
-  DBUG_ASSERT(file != NULL);
+  assert(file != NULL);
   *length= file->m_filename_length;
   result= file->m_filename;
   return const_cast<uchar*> (reinterpret_cast<const uchar*> (result));
@@ -326,7 +326,7 @@ PFS_mutex* create_mutex(PFS_mutex_class *klass, const void *identity)
 */
 void destroy_mutex(PFS_mutex *pfs)
 {
-  DBUG_ASSERT(pfs != NULL);
+  assert(pfs != NULL);
   PFS_mutex_class *klass= pfs->m_class;
   /* Aggregate to EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME */
   klass->m_mutex_stat.aggregate(& pfs->m_mutex_stat);
@@ -374,7 +374,7 @@ PFS_rwlock* create_rwlock(PFS_rwlock_class *klass, const void *identity)
 */
 void destroy_rwlock(PFS_rwlock *pfs)
 {
-  DBUG_ASSERT(pfs != NULL);
+  assert(pfs != NULL);
   PFS_rwlock_class *klass= pfs->m_class;
   /* Aggregate to EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME */
   klass->m_rwlock_stat.aggregate(& pfs->m_rwlock_stat);
@@ -418,7 +418,7 @@ PFS_cond* create_cond(PFS_cond_class *klass, const void *identity)
 */
 void destroy_cond(PFS_cond *pfs)
 {
-  DBUG_ASSERT(pfs != NULL);
+  assert(pfs != NULL);
   PFS_cond_class *klass= pfs->m_class;
   /* Aggregate to EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME */
   klass->m_cond_stat.aggregate(& pfs->m_cond_stat);
@@ -649,14 +649,14 @@ PFS_metadata_lock *sanitize_metadata_lock(PFS_metadata_lock *unsafe)
 */
 void destroy_thread(PFS_thread *pfs)
 {
-  DBUG_ASSERT(pfs != NULL);
+  assert(pfs != NULL);
   pfs->reset_session_connect_attrs();
   if (pfs->m_account != NULL)
   {
     pfs->m_account->release();
     pfs->m_account= NULL;
-    DBUG_ASSERT(pfs->m_user == NULL);
-    DBUG_ASSERT(pfs->m_host == NULL);
+    assert(pfs->m_user == NULL);
+    assert(pfs->m_host == NULL);
   }
   else
   {
@@ -750,7 +750,7 @@ find_or_create_file(PFS_thread *thread, PFS_file_class *klass,
 {
   PFS_file *pfs;
 
-  DBUG_ASSERT(klass != NULL || ! create);
+  assert(klass != NULL || ! create);
 
   LF_PINS *pins= get_filename_hash_pins(thread);
   if (unlikely(pins == NULL))
@@ -925,7 +925,7 @@ void find_and_rename_file(PFS_thread *thread, const char *old_filename,
 {
   PFS_file *pfs;
 
-  DBUG_ASSERT(thread != NULL);
+  assert(thread != NULL);
 
   LF_PINS *pins= get_filename_hash_pins(thread);
   if (unlikely(pins == NULL))
@@ -1068,7 +1068,7 @@ void find_and_rename_file(PFS_thread *thread, const char *old_filename,
 */
 void release_file(PFS_file *pfs)
 {
-  DBUG_ASSERT(pfs != NULL);
+  assert(pfs != NULL);
   pfs->m_file_stat.m_open_count--;
 }
 
@@ -1079,8 +1079,8 @@ void release_file(PFS_file *pfs)
 */
 void destroy_file(PFS_thread *thread, PFS_file *pfs)
 {
-  DBUG_ASSERT(thread != NULL);
-  DBUG_ASSERT(pfs != NULL);
+  assert(thread != NULL);
+  assert(pfs != NULL);
   PFS_file_class *klass= pfs->m_class;
 
   /* Aggregate to FILE_SUMMARY_BY_EVENT_NAME */
@@ -1091,7 +1091,7 @@ void destroy_file(PFS_thread *thread, PFS_file *pfs)
     klass->m_singleton= NULL;
 
   LF_PINS *pins= get_filename_hash_pins(thread);
-  DBUG_ASSERT(pins != NULL);
+  assert(pins != NULL);
 
   lf_hash_delete(&filename_hash, pins,
                  pfs->m_filename, pfs->m_filename_length);
@@ -1185,8 +1185,8 @@ void PFS_table::safe_aggregate_io(const TABLE_SHARE *optional_server_share,
                                   PFS_table_stat *table_stat,
                                   PFS_table_share *table_share)
 {
-  DBUG_ASSERT(table_stat != NULL);
-  DBUG_ASSERT(table_share != NULL);
+  assert(table_stat != NULL);
+  assert(table_share != NULL);
 
   uint key_count= sanitize_index_count(table_share->m_key_count);
 
@@ -1194,7 +1194,7 @@ void PFS_table::safe_aggregate_io(const TABLE_SHARE *optional_server_share,
   PFS_table_io_stat *from_stat;
   uint index;
 
-  DBUG_ASSERT(key_count <= MAX_INDEXES);
+  assert(key_count <= MAX_INDEXES);
 
   /* Aggregate stats for each index, if any */
   for (index= 0; index < key_count; index++)
@@ -1248,8 +1248,8 @@ void PFS_table::safe_aggregate_io(const TABLE_SHARE *optional_server_share,
 void PFS_table::safe_aggregate_lock(PFS_table_stat *table_stat,
                                     PFS_table_share *table_share)
 {
-  DBUG_ASSERT(table_stat != NULL);
-  DBUG_ASSERT(table_share != NULL);
+  assert(table_stat != NULL);
+  assert(table_share != NULL);
 
   PFS_table_lock_stat *from_stat= & table_stat->m_lock_stat;
 
@@ -1271,7 +1271,7 @@ void PFS_table::safe_aggregate_lock(PFS_table_stat *table_stat,
 */
 void destroy_table(PFS_table *pfs)
 {
-  DBUG_ASSERT(pfs != NULL);
+  assert(pfs != NULL);
   pfs->m_share->dec_refcount();
   global_table_container.deallocate(pfs);
 }
@@ -1339,7 +1339,7 @@ PFS_socket* create_socket(PFS_socket_class *klass, const my_socket *fd,
 */
 void destroy_socket(PFS_socket *pfs)
 {
-  DBUG_ASSERT(pfs != NULL);
+  assert(pfs != NULL);
   PFS_socket_class *klass= pfs->m_class;
 
   /* Aggregate to SOCKET_SUMMARY_BY_EVENT_NAME */
@@ -1406,7 +1406,7 @@ PFS_metadata_lock* create_metadata_lock(void *identity,
 
 void destroy_metadata_lock(PFS_metadata_lock *pfs)
 {
-  DBUG_ASSERT(pfs != NULL);
+  assert(pfs != NULL);
   global_mdl_container.deallocate(pfs);
 }
 
@@ -1633,8 +1633,8 @@ void aggregate_all_statements(PFS_statement_stat *from_array,
 void aggregate_all_transactions(PFS_transaction_stat *from_array,
                                 PFS_transaction_stat *to_array)
 {
-  DBUG_ASSERT(from_array != NULL);
-  DBUG_ASSERT(to_array != NULL);
+  assert(from_array != NULL);
+  assert(to_array != NULL);
 
   if (from_array->count() > 0)
   {
@@ -1647,9 +1647,9 @@ void aggregate_all_transactions(PFS_transaction_stat *from_array,
                                 PFS_transaction_stat *to_array_1,
                                 PFS_transaction_stat *to_array_2)
 {
-  DBUG_ASSERT(from_array != NULL);
-  DBUG_ASSERT(to_array_1 != NULL);
-  DBUG_ASSERT(to_array_2 != NULL);
+  assert(from_array != NULL);
+  assert(to_array_1 != NULL);
+  assert(to_array_2 != NULL);
 
   if (from_array->count() > 0)
   {
@@ -2158,9 +2158,9 @@ void clear_thread_account(PFS_thread *thread)
 
 void set_thread_account(PFS_thread *thread)
 {
-  DBUG_ASSERT(thread->m_account == NULL);
-  DBUG_ASSERT(thread->m_user == NULL);
-  DBUG_ASSERT(thread->m_host == NULL);
+  assert(thread->m_account == NULL);
+  assert(thread->m_user == NULL);
+  assert(thread->m_host == NULL);
 
   thread->m_account= find_or_create_account(thread,
                                                 thread->m_username,
diff --git a/storage/perfschema/pfs_instr.h b/storage/perfschema/pfs_instr.h
index a90e17983b6..fefb1bf7884 100644
--- a/storage/perfschema/pfs_instr.h
+++ b/storage/perfschema/pfs_instr.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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_class.cc b/storage/perfschema/pfs_instr_class.cc
index 54046d52b70..264ec6b7020 100644
--- a/storage/perfschema/pfs_instr_class.cc
+++ b/storage/perfschema/pfs_instr_class.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -409,9 +409,9 @@ static uchar *table_share_hash_get_key(const uchar *entry, size_t *length,
   const PFS_table_share *share;
   const void *result;
   typed_entry= reinterpret_cast<const PFS_table_share* const *> (entry);
-  DBUG_ASSERT(typed_entry != NULL);
+  assert(typed_entry != NULL);
   share= *typed_entry;
-  DBUG_ASSERT(share != NULL);
+  assert(share != NULL);
   *length= share->m_key.m_key_length;
   result= &share->m_key.m_hash_key[0];
   return const_cast<uchar*> (reinterpret_cast<const uchar*> (result));
@@ -470,8 +470,8 @@ static void set_table_share_key(PFS_table_share_key *key,
                                 const char *schema_name, size_t schema_name_length,
                                 const char *table_name, size_t table_name_length)
 {
-  DBUG_ASSERT(schema_name_length <= NAME_LEN);
-  DBUG_ASSERT(table_name_length <= NAME_LEN);
+  assert(schema_name_length <= NAME_LEN);
+  assert(table_name_length <= NAME_LEN);
   char *saved_schema_name;
   char *saved_table_name;
 
@@ -585,7 +585,7 @@ void PFS_table_share::destroy_lock_stat()
 PFS_table_share_index*
 PFS_table_share::find_index_stat(uint index) const
 {
-  DBUG_ASSERT(index <= MAX_INDEXES);
+  assert(index <= MAX_INDEXES);
 
   PFS_table_share *that= const_cast<PFS_table_share*>(this);
   void *addr= & that->m_race_index_stat[index];
@@ -609,7 +609,7 @@ PFS_table_share::find_index_stat(uint index) const
 PFS_table_share_index*
 PFS_table_share::find_or_create_index_stat(const TABLE_SHARE *server_share, uint index)
 {
-  DBUG_ASSERT(index <= MAX_INDEXES);
+  assert(index <= MAX_INDEXES);
 
   void *addr= & this->m_race_index_stat[index];
   void * volatile * typed_addr= static_cast<void * volatile *>(addr);
@@ -762,7 +762,7 @@ int init_table_share_index_stat(uint index_stat_sizing)
 PFS_table_share_index*
 create_table_share_index_stat(const TABLE_SHARE *server_share, uint server_index)
 {
-  DBUG_ASSERT((server_share != NULL) || (server_index == MAX_INDEXES));
+  assert((server_share != NULL) || (server_index == MAX_INDEXES));
 
   PFS_table_share_index *pfs= NULL;
   pfs_dirty_state dirty_state;
@@ -1004,7 +1004,7 @@ static void init_instr_class(PFS_instr_class *klass,
                              int flags,
                              PFS_class_type class_type)
 {
-  DBUG_ASSERT(name_length <= PFS_MAX_INFO_NAME_LENGTH);
+  assert(name_length <= PFS_MAX_INFO_NAME_LENGTH);
   memset(klass, 0, sizeof(PFS_instr_class));
   memcpy(klass->m_name, name, name_length);
   klass->m_name_length= name_length;
@@ -1060,7 +1060,7 @@ static void configure_instr_class(PFS_instr_class *entry)
     if ((entry->m_name_length == NAME_LENGTH) &&                       \
         (strncmp(entry->m_name, NAME, NAME_LENGTH) == 0))              \
     {                                                                  \
-      DBUG_ASSERT(entry->m_flags == flags);                            \
+      assert(entry->m_flags == flags);                                 \
       return (INDEX + 1);                                              \
     }                                                                  \
   }
@@ -1314,7 +1314,7 @@ PFS_thread_key register_thread_class(const char *name, uint name_length,
   if (index < thread_class_max)
   {
     entry= &thread_class_array[index];
-    DBUG_ASSERT(name_length <= PFS_MAX_INFO_NAME_LENGTH);
+    assert(name_length <= PFS_MAX_INFO_NAME_LENGTH);
     strncpy(entry->m_name, name, name_length);
     entry->m_name_length= name_length;
     entry->m_enabled= true;
@@ -1881,7 +1881,7 @@ void PFS_table_share::sum_io(PFS_single_stat *result, uint key_count)
   uint index;
   PFS_table_share_index *stat;
 
-  DBUG_ASSERT(key_count <= MAX_INDEXES);
+  assert(key_count <= MAX_INDEXES);
 
   /* Sum stats for each index, if any */
   for (index= 0; index < key_count; index++)
@@ -1929,7 +1929,7 @@ void PFS_table_share::aggregate_lock(void)
 
 void release_table_share(PFS_table_share *pfs)
 {
-  DBUG_ASSERT(pfs->get_refcount() > 0);
+  assert(pfs->get_refcount() > 0);
   pfs->dec_refcount();
 }
 
diff --git a/storage/perfschema/pfs_instr_class.h b/storage/perfschema/pfs_instr_class.h
index 20869e14eae..6f3e0c10cdb 100644
--- a/storage/perfschema/pfs_instr_class.h
+++ b/storage/perfschema/pfs_instr_class.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -173,13 +173,13 @@ struct PFS_instr_class
 
   bool is_progress() const
   {
-    DBUG_ASSERT(m_type == PFS_CLASS_STAGE);
+    assert(m_type == PFS_CLASS_STAGE);
     return m_flags & PSI_FLAG_STAGE_PROGRESS;
   }
 
   bool is_shared_exclusive() const
   {
-    DBUG_ASSERT(m_type == PFS_CLASS_RWLOCK);
+    assert(m_type == PFS_CLASS_RWLOCK);
     return m_flags & PSI_RWLOCK_FLAG_SX;
   }
 
diff --git a/storage/perfschema/pfs_lock.h b/storage/perfschema/pfs_lock.h
index e6d40d173d5..d26765b3166 100644
--- a/storage/perfschema/pfs_lock.h
+++ b/storage/perfschema/pfs_lock.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2009, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -173,7 +173,7 @@ struct pfs_lock
   {
     uint32 copy= copy_version_state();
     /* Make sure the record was ALLOCATED. */
-    DBUG_ASSERT((copy & STATE_MASK) == PFS_LOCK_ALLOCATED);
+    assert((copy & STATE_MASK) == PFS_LOCK_ALLOCATED);
     /* Keep the same version, set the DIRTY state */
     uint32 new_val= (copy & VERSION_MASK) + PFS_LOCK_DIRTY;
     /* We own the record, no need to use compare and swap. */
@@ -191,7 +191,7 @@ struct pfs_lock
   void dirty_to_allocated(const pfs_dirty_state *copy)
   {
     /* Make sure the record was DIRTY. */
-    DBUG_ASSERT((copy->m_version_state & STATE_MASK) == PFS_LOCK_DIRTY);
+    assert((copy->m_version_state & STATE_MASK) == PFS_LOCK_DIRTY);
     /* Increment the version, set the ALLOCATED state */
     uint32 new_val= (copy->m_version_state & VERSION_MASK) + VERSION_INC + PFS_LOCK_ALLOCATED;
 
@@ -234,7 +234,7 @@ struct pfs_lock
   void dirty_to_free(const pfs_dirty_state *copy)
   {
     /* Make sure the record was DIRTY. */
-    DBUG_ASSERT((copy->m_version_state & STATE_MASK) == PFS_LOCK_DIRTY);
+    assert((copy->m_version_state & STATE_MASK) == PFS_LOCK_DIRTY);
     /* Keep the same version, set the FREE state */
     uint32 new_val= (copy->m_version_state & VERSION_MASK) + PFS_LOCK_FREE;
 
@@ -254,7 +254,7 @@ struct pfs_lock
     */
     uint32 copy= copy_version_state();
     /* Make sure the record was ALLOCATED. */
-    DBUG_ASSERT(((copy & STATE_MASK) == PFS_LOCK_ALLOCATED));
+    assert(((copy & STATE_MASK) == PFS_LOCK_ALLOCATED));
     /* Keep the same version, set the FREE state */
     uint32 new_val= (copy & VERSION_MASK) + PFS_LOCK_FREE;
 
diff --git a/storage/perfschema/pfs_memory.cc b/storage/perfschema/pfs_memory.cc
index c4e92d7d6b0..d2185ecc648 100644
--- a/storage/perfschema/pfs_memory.cc
+++ b/storage/perfschema/pfs_memory.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
 
   This 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 4dc21b892d5..a3e753656ce 100644
--- a/storage/perfschema/pfs_memory.h
+++ b/storage/perfschema/pfs_memory.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
 
   This 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 e3440560691..409520bd7ac 100644
--- a/storage/perfschema/pfs_prepared_stmt.cc
+++ b/storage/perfschema/pfs_prepared_stmt.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2014, 2021, Oracle and/or its affiliates.
 
   This 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 4638266cce7..eacc12143eb 100644
--- a/storage/perfschema/pfs_prepared_stmt.h
+++ b/storage/perfschema/pfs_prepared_stmt.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2014, 2021, Oracle and/or its affiliates.
 
   This 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 e8808b0b63a..4353049b73a 100644
--- a/storage/perfschema/pfs_program.cc
+++ b/storage/perfschema/pfs_program.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
 
   This 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,9 +70,9 @@ static uchar *program_hash_get_key(const uchar *entry, size_t *length,
   const PFS_program *program;
   const void *result;
   typed_entry= reinterpret_cast<const PFS_program* const *> (entry);
-  DBUG_ASSERT(typed_entry != NULL);
+  assert(typed_entry != NULL);
   program= *typed_entry;
-  DBUG_ASSERT(program != NULL);
+  assert(program != NULL);
   *length= program->m_key.m_key_length;
   result= program->m_key.m_hash_key;
   return const_cast<uchar*> (reinterpret_cast<const uchar*> (result));
@@ -109,8 +109,8 @@ static void set_program_key(PFS_program_key *key,
                             const char *object_name, uint object_name_length,
                             const char *schema_name, uint schema_name_length)
 {
-  DBUG_ASSERT(object_name_length <= COL_OBJECT_NAME_SIZE);
-  DBUG_ASSERT(schema_name_length <= COL_OBJECT_SCHEMA_SIZE);
+  assert(object_name_length <= COL_OBJECT_NAME_SIZE);
+  assert(schema_name_length <= COL_OBJECT_SCHEMA_SIZE);
 
   /*
     To make sure generated key is case insensitive,
diff --git a/storage/perfschema/pfs_program.h b/storage/perfschema/pfs_program.h
index 0cbd24b8699..a34f533d444 100644
--- a/storage/perfschema/pfs_program.h
+++ b/storage/perfschema/pfs_program.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
 
   This 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 babbdedcd72..e58ccbdc3be 100644
--- a/storage/perfschema/pfs_server.cc
+++ b/storage/perfschema/pfs_server.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -211,7 +211,7 @@ initialize_performance_schema(PFS_global_param *param)
 static void destroy_pfs_thread(void *key)
 {
   PFS_thread* pfs= reinterpret_cast<PFS_thread*> (key);
-  DBUG_ASSERT(pfs);
+  assert(pfs);
   /*
     This automatic cleanup is a last resort and best effort to avoid leaks,
     and may not work on windows due to the implementation of pthread_key_create().
diff --git a/storage/perfschema/pfs_server.h b/storage/perfschema/pfs_server.h
index 198436403fa..7f290271a67 100644
--- a/storage/perfschema/pfs_server.h
+++ b/storage/perfschema/pfs_server.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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 56cf2dc111b..c7e5fa3cf4a 100644
--- a/storage/perfschema/pfs_setup_actor.cc
+++ b/storage/perfschema/pfs_setup_actor.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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,9 +70,9 @@ static uchar *setup_actor_hash_get_key(const uchar *entry, size_t *length,
   const PFS_setup_actor *setup_actor;
   const void *result;
   typed_entry= reinterpret_cast<const PFS_setup_actor* const *> (entry);
-  DBUG_ASSERT(typed_entry != NULL);
+  assert(typed_entry != NULL);
   setup_actor= *typed_entry;
-  DBUG_ASSERT(setup_actor != NULL);
+  assert(setup_actor != NULL);
   *length= setup_actor->m_key.m_key_length;
   result= setup_actor->m_key.m_hash_key;
   return const_cast<uchar*> (reinterpret_cast<const uchar*> (result));
@@ -121,8 +121,8 @@ static void set_setup_actor_key(PFS_setup_actor_key *key,
                                 const char *host, uint host_length,
                                 const char *role, uint role_length)
 {
-  DBUG_ASSERT(user_length <= USERNAME_LENGTH);
-  DBUG_ASSERT(host_length <= HOSTNAME_LENGTH);
+  assert(user_length <= USERNAME_LENGTH);
+  assert(host_length <= HOSTNAME_LENGTH);
 
   char *ptr= &key->m_hash_key[0];
   memcpy(ptr, user, user_length);
diff --git a/storage/perfschema/pfs_setup_actor.h b/storage/perfschema/pfs_setup_actor.h
index ba3faec2d38..ee56ff403f2 100644
--- a/storage/perfschema/pfs_setup_actor.h
+++ b/storage/perfschema/pfs_setup_actor.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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 f6414483aa7..88114531778 100644
--- a/storage/perfschema/pfs_setup_object.cc
+++ b/storage/perfschema/pfs_setup_object.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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,9 +70,9 @@ static uchar *setup_object_hash_get_key(const uchar *entry, size_t *length,
   const PFS_setup_object *setup_object;
   const void *result;
   typed_entry= reinterpret_cast<const PFS_setup_object* const *> (entry);
-  DBUG_ASSERT(typed_entry != NULL);
+  assert(typed_entry != NULL);
   setup_object= *typed_entry;
-  DBUG_ASSERT(setup_object != NULL);
+  assert(setup_object != NULL);
   *length= setup_object->m_key.m_key_length;
   result= setup_object->m_key.m_hash_key;
   return const_cast<uchar*> (reinterpret_cast<const uchar*> (result));
@@ -120,8 +120,8 @@ static void set_setup_object_key(PFS_setup_object_key *key,
                                  const char *schema, uint schema_length,
                                  const char *object, uint object_length)
 {
-  DBUG_ASSERT(schema_length <= NAME_LEN);
-  DBUG_ASSERT(object_length <= NAME_LEN);
+  assert(schema_length <= NAME_LEN);
+  assert(object_length <= NAME_LEN);
 
   char *ptr= &key->m_hash_key[0];
   ptr[0]= (char) object_type;
@@ -278,7 +278,7 @@ void lookup_setup_object(PFS_thread *thread,
     - TABLE foo.bar
     - TEMPORARY TABLE foo.bar
   */
-  DBUG_ASSERT(object_type != OBJECT_TYPE_TEMPORARY_TABLE);
+  assert(object_type != OBJECT_TYPE_TEMPORARY_TABLE);
 
   LF_PINS* pins= get_setup_object_hash_pins(thread);
   if (unlikely(pins == NULL))
diff --git a/storage/perfschema/pfs_setup_object.h b/storage/perfschema/pfs_setup_object.h
index c063970dcb5..a247d164d18 100644
--- a/storage/perfschema/pfs_setup_object.h
+++ b/storage/perfschema/pfs_setup_object.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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 2032347aee3..0c2711a84bd 100644
--- a/storage/perfschema/pfs_stat.h
+++ b/storage/perfschema/pfs_stat.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -721,7 +721,7 @@ struct PFS_table_stat
     PFS_table_io_stat *to_stat_last;
     const PFS_table_io_stat *from_stat;
 
-    DBUG_ASSERT(key_count <= MAX_INDEXES);
+    assert(key_count <= MAX_INDEXES);
 
     /* Aggregate stats for each index, if any */
     to_stat= & m_index_stat[0];
@@ -752,7 +752,7 @@ struct PFS_table_stat
     PFS_table_io_stat *stat;
     PFS_table_io_stat *stat_last;
 
-    DBUG_ASSERT(key_count <= MAX_INDEXES);
+    assert(key_count <= MAX_INDEXES);
 
     /* Sum stats for each index, if any */
     stat= & m_index_stat[0];
diff --git a/storage/perfschema/pfs_status.cc b/storage/perfschema/pfs_status.cc
index 61afcbfccd9..acf53c858ae 100644
--- a/storage/perfschema/pfs_status.cc
+++ b/storage/perfschema/pfs_status.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
 
   This 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 0417976e9f2..ab20edcc130 100644
--- a/storage/perfschema/pfs_status.h
+++ b/storage/perfschema/pfs_status.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
 
   This 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 010c803c6c2..baa85c1aec0 100644
--- a/storage/perfschema/pfs_timer.cc
+++ b/storage/perfschema/pfs_timer.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -252,7 +252,7 @@ ulonglong get_timer_raw_value(enum_timer_name timer_name)
   case TIMER_NAME_TICK:
     return my_timer_ticks();
   default:
-    DBUG_ASSERT(false);
+    assert(false);
   }
   return 0;
 }
@@ -278,7 +278,7 @@ ulonglong get_timer_raw_value_and_function(enum_timer_name timer_name, timer_fct
     return my_timer_ticks();
   default:
     *fct= NULL;
-    DBUG_ASSERT(false);
+    assert(false);
   }
   return 0;
 }
@@ -306,7 +306,7 @@ ulonglong get_timer_pico_value(enum_timer_name timer_name)
     break;
   default:
     result= 0;
-    DBUG_ASSERT(false);
+    assert(false);
   }
   return result;
 }
@@ -315,8 +315,8 @@ time_normalizer* time_normalizer::get(enum_timer_name timer_name)
 {
   uint index= static_cast<uint> (timer_name);
 
-  DBUG_ASSERT(index >= FIRST_TIMER_NAME);
-  DBUG_ASSERT(index <= LAST_TIMER_NAME);
+  assert(index >= FIRST_TIMER_NAME);
+  assert(index <= LAST_TIMER_NAME);
 
   return & to_pico_data[index];
 }
diff --git a/storage/perfschema/pfs_timer.h b/storage/perfschema/pfs_timer.h
index 5b5b8451883..54fa3a42d6e 100644
--- a/storage/perfschema/pfs_timer.h
+++ b/storage/perfschema/pfs_timer.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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 42033065475..9e09e1eb878 100644
--- a/storage/perfschema/pfs_user.cc
+++ b/storage/perfschema/pfs_user.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -71,9 +71,9 @@ static uchar *user_hash_get_key(const uchar *entry, size_t *length,
   const PFS_user *user;
   const void *result;
   typed_entry= reinterpret_cast<const PFS_user* const *> (entry);
-  DBUG_ASSERT(typed_entry != NULL);
+  assert(typed_entry != NULL);
   user= *typed_entry;
-  DBUG_ASSERT(user != NULL);
+  assert(user != NULL);
   *length= user->m_key.m_key_length;
   result= user->m_key.m_hash_key;
   return const_cast<uchar*> (reinterpret_cast<const uchar*> (result));
@@ -119,7 +119,7 @@ static LF_PINS* get_user_hash_pins(PFS_thread *thread)
 static void set_user_key(PFS_user_key *key,
                          const char *user, uint user_length)
 {
-  DBUG_ASSERT(user_length <= USERNAME_LENGTH);
+  assert(user_length <= USERNAME_LENGTH);
 
   char *ptr= &key->m_hash_key[0];
   if (user_length > 0)
@@ -293,7 +293,7 @@ void purge_user(PFS_thread *thread, PFS_user *user)
                     user->m_key.m_hash_key, user->m_key.m_key_length));
   if (entry && (entry != MY_ERRPTR))
   {
-    DBUG_ASSERT(*entry == user);
+    assert(*entry == user);
     if (user->get_refcount() == 0)
     {
       lf_hash_delete(&user_hash, pins,
diff --git a/storage/perfschema/pfs_user.h b/storage/perfschema/pfs_user.h
index c67a7e1a3b5..db2da9d7cff 100644
--- a/storage/perfschema/pfs_user.h
+++ b/storage/perfschema/pfs_user.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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 3ff30d97497..2fa9d914c1c 100644
--- a/storage/perfschema/pfs_variable.cc
+++ b/storage/perfschema/pfs_variable.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
 
   This 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,7 +43,7 @@
 */
 bool PFS_system_variable_cache::init_show_var_array(enum_var_type scope, bool strict)
 {
-  DBUG_ASSERT(!m_initialized);
+  assert(!m_initialized);
   m_query_scope= scope;
 
   mysql_rwlock_rdlock(&LOCK_system_variables_hash);
@@ -130,7 +130,7 @@ int PFS_system_variable_cache::do_materialize_global(void)
   {
     const char* name= show_var->name;
     sys_var *value= (sys_var *)show_var->value;
-    DBUG_ASSERT(value);
+    assert(value);
 
     if ((m_query_scope == OPT_GLOBAL) &&
         (!my_strcasecmp(system_charset_info, name, "sql_log_bin")))
@@ -158,7 +158,7 @@ int PFS_system_variable_cache::do_materialize_global(void)
         The assert below will fail once SQL_LOG_BIN really is defined
         as SESSION_ONLY (in 5.8), so that this special case can be removed.
       */
-      DBUG_ASSERT(value->scope() == sys_var::SESSION);
+      assert(value->scope() == sys_var::SESSION);
       continue;
     }
 
@@ -208,7 +208,7 @@ int PFS_system_variable_cache::do_materialize_all(THD *unsafe_thd)
     {
       const char* name= show_var->name;
       sys_var *value= (sys_var *)show_var->value;
-      DBUG_ASSERT(value);
+      assert(value);
       bool ignore= false;
 
       if (value->scope() == sys_var::SESSION &&
@@ -319,7 +319,7 @@ int PFS_system_variable_cache::do_materialize_session(PFS_thread *pfs_thread)
   mysql_mutex_lock(&LOCK_plugin_delete);
 
   /* The SHOW_VAR array must be initialized externally. */
-  DBUG_ASSERT(m_initialized);
+  assert(m_initialized);
 
   /* Use a temporary mem_root to avoid depleting THD mem_root. */
   if (m_use_mem_root)
@@ -383,7 +383,7 @@ int PFS_system_variable_cache::do_materialize_session(PFS_thread *pfs_thread, ui
   mysql_mutex_lock(&LOCK_plugin_delete);
 
   /* The SHOW_VAR array must be initialized externally. */
-  DBUG_ASSERT(m_initialized);
+  assert(m_initialized);
 
   /* Get and lock a validated THD from the thread manager. */
   if ((m_safe_thd= get_THD(pfs_thread)) != NULL)
@@ -521,7 +521,7 @@ void System_variable::init(THD *target_thd, const SHOW_VAR *show_var,
     return;
 
   enum_mysql_show_type show_var_type= show_var->type;
-  DBUG_ASSERT(show_var_type == SHOW_SYS);
+  assert(show_var_type == SHOW_SYS);
   
   m_name= show_var->name;
   m_name_length= strlen(m_name);
@@ -544,7 +544,7 @@ void System_variable::init(THD *target_thd, const SHOW_VAR *show_var,
   mysql_mutex_lock(&LOCK_global_system_variables);
 
   sys_var *system_var= (sys_var *)show_var->value;
-  DBUG_ASSERT(system_var != NULL);
+  assert(system_var != NULL);
   m_charset= system_var->charset(target_thd);
   m_type= system_var->show_type();
   m_scope= system_var->scope();
@@ -682,8 +682,8 @@ bool PFS_status_variable_cache::match_scope(SHOW_SCOPE variable_scope, bool stri
 */
 bool PFS_status_variable_cache::filter_by_name(const SHOW_VAR *show_var)
 {
-  DBUG_ASSERT(show_var);
-  DBUG_ASSERT(show_var->name);
+  assert(show_var);
+  assert(show_var->name);
 
   if (show_var->type == SHOW_ARRAY)
   {
@@ -793,7 +793,7 @@ bool PFS_status_variable_cache::filter_show_var(const SHOW_VAR *show_var, bool s
 */
 bool PFS_status_variable_cache::init_show_var_array(enum_var_type scope, bool strict)
 {
-  DBUG_ASSERT(!m_initialized);
+  assert(!m_initialized);
 
   /* Resize if necessary. */
   m_show_var_array.reserve(all_status_vars.size()+1);
@@ -871,7 +871,7 @@ void PFS_status_variable_cache::expand_show_var_array(const SHOW_VAR *show_var_a
 char * PFS_status_variable_cache::make_show_var_name(const char* prefix, const char* name,
                                                      char *name_buf, size_t buf_len)
 {
-  DBUG_ASSERT(name_buf != NULL);
+  assert(name_buf != NULL);
   char *prefix_end= name_buf;
 
   if (prefix && *prefix)
@@ -987,7 +987,7 @@ int PFS_status_variable_cache::do_materialize_global(void)
 int PFS_status_variable_cache::do_materialize_all(THD* unsafe_thd)
 {
   int ret= 1;
-  DBUG_ASSERT(unsafe_thd != NULL);
+  assert(unsafe_thd != NULL);
 
   m_unsafe_thd= unsafe_thd;
   m_materialized= false;
@@ -1033,7 +1033,7 @@ int PFS_status_variable_cache::do_materialize_all(THD* unsafe_thd)
 int PFS_status_variable_cache::do_materialize_session(THD* unsafe_thd)
 {
   int ret= 1;
-  DBUG_ASSERT(unsafe_thd != NULL);
+  assert(unsafe_thd != NULL);
 
   m_unsafe_thd= unsafe_thd;
   m_materialized= false;
@@ -1080,7 +1080,7 @@ int PFS_status_variable_cache::do_materialize_session(THD* unsafe_thd)
 int PFS_status_variable_cache::do_materialize_session(PFS_thread *pfs_thread)
 {
   int ret= 1;
-  DBUG_ASSERT(pfs_thread != NULL);
+  assert(pfs_thread != NULL);
 
   m_pfs_thread= pfs_thread;
   m_materialized= false;
@@ -1091,7 +1091,7 @@ int PFS_status_variable_cache::do_materialize_session(PFS_thread *pfs_thread)
     mysql_mutex_lock(&LOCK_status);
 
   /* The SHOW_VAR array must be initialized externally. */
-  DBUG_ASSERT(m_initialized);
+  assert(m_initialized);
 
     /* Get and lock a validated THD from the thread manager. */
   if ((m_safe_thd= get_THD(pfs_thread)) != NULL)
@@ -1123,7 +1123,7 @@ int PFS_status_variable_cache::do_materialize_session(PFS_thread *pfs_thread)
 */
 int PFS_status_variable_cache::do_materialize_client(PFS_client *pfs_client)
 {
-  DBUG_ASSERT(pfs_client != NULL);
+  assert(pfs_client != NULL);
   STATUS_VAR status_totals;
 
   m_pfs_client= pfs_client;
@@ -1135,7 +1135,7 @@ int PFS_status_variable_cache::do_materialize_client(PFS_client *pfs_client)
     mysql_mutex_lock(&LOCK_status);
 
   /* The SHOW_VAR array must be initialized externally. */
-  DBUG_ASSERT(m_initialized);
+  assert(m_initialized);
 
   /*
     Generate status totals from active threads and from totals aggregated
diff --git a/storage/perfschema/pfs_variable.h b/storage/perfschema/pfs_variable.h
index d5cab96175a..f24f7c3e4f2 100644
--- a/storage/perfschema/pfs_variable.h
+++ b/storage/perfschema/pfs_variable.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -480,7 +480,7 @@ THD *PFS_variable_cache<Var_type>::get_THD(THD *unsafe_thd)
 template <class Var_type>
 THD *PFS_variable_cache<Var_type>::get_THD(PFS_thread *pfs_thread)
 {
-  DBUG_ASSERT(pfs_thread != NULL);
+  assert(pfs_thread != NULL);
   return get_THD(pfs_thread->m_thd);
 }
 
diff --git a/storage/perfschema/pfs_visitor.cc b/storage/perfschema/pfs_visitor.cc
index b9d13283fb9..bc89437bb6a 100644
--- a/storage/perfschema/pfs_visitor.cc
+++ b/storage/perfschema/pfs_visitor.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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,8 +63,8 @@ void PFS_connection_iterator::visit_global(bool with_hosts, bool with_users,
                                            bool with_THDs,
                                            PFS_connection_visitor *visitor)
 {
-  DBUG_ASSERT(visitor != NULL);
-  DBUG_ASSERT(! with_threads || ! with_THDs);
+  assert(visitor != NULL);
+  assert(! with_threads || ! with_THDs);
 
   visitor->visit_global();
 
@@ -163,8 +163,8 @@ void PFS_connection_iterator::visit_host(PFS_host *host,
                                          bool with_THDs,
                                          PFS_connection_visitor *visitor)
 {
-  DBUG_ASSERT(visitor != NULL);
-  DBUG_ASSERT(! with_threads || ! with_THDs);
+  assert(visitor != NULL);
+  assert(! with_threads || ! with_THDs);
 
   visitor->visit_host(host);
 
@@ -252,8 +252,8 @@ void PFS_connection_iterator::visit_user(PFS_user *user,
                                          bool with_THDs,
                                          PFS_connection_visitor *visitor)
 {
-  DBUG_ASSERT(visitor != NULL);
-  DBUG_ASSERT(! with_threads || ! with_THDs);
+  assert(visitor != NULL);
+  assert(! with_threads || ! with_THDs);
 
   visitor->visit_user(user);
 
@@ -333,8 +333,8 @@ void PFS_connection_iterator::visit_account(PFS_account *account,
                                             bool with_THDs,
                                             PFS_connection_visitor *visitor)
 {
-  DBUG_ASSERT(visitor != NULL);
-  DBUG_ASSERT(! with_threads || ! with_THDs);
+  assert(visitor != NULL);
+  assert(! with_threads || ! with_THDs);
 
   visitor->visit_account(account);
 
@@ -363,7 +363,7 @@ void PFS_connection_iterator::visit_account(PFS_account *account,
 void PFS_connection_iterator::visit_THD(THD *thd,
                                         PFS_connection_visitor *visitor)
 {
-  DBUG_ASSERT(visitor != NULL);
+  assert(visitor != NULL);
   visitor->visit_THD(thd);
 }
 
@@ -504,7 +504,7 @@ void PFS_instance_iterator::visit_all_file_instances(PFS_instance_visitor *visit
 void PFS_instance_iterator::visit_mutex_instances(PFS_mutex_class *klass,
                                                   PFS_instance_visitor *visitor)
 {
-  DBUG_ASSERT(visitor != NULL);
+  assert(visitor != NULL);
 
   visitor->visit_mutex_class(klass);
 
@@ -538,7 +538,7 @@ void PFS_instance_iterator::visit_mutex_instances(PFS_mutex_class *klass,
 void PFS_instance_iterator::visit_rwlock_instances(PFS_rwlock_class *klass,
                                                    PFS_instance_visitor *visitor)
 {
-  DBUG_ASSERT(visitor != NULL);
+  assert(visitor != NULL);
 
   visitor->visit_rwlock_class(klass);
 
@@ -572,7 +572,7 @@ void PFS_instance_iterator::visit_rwlock_instances(PFS_rwlock_class *klass,
 void PFS_instance_iterator::visit_cond_instances(PFS_cond_class *klass,
                                                  PFS_instance_visitor *visitor)
 {
-  DBUG_ASSERT(visitor != NULL);
+  assert(visitor != NULL);
 
   visitor->visit_cond_class(klass);
 
@@ -606,7 +606,7 @@ void PFS_instance_iterator::visit_cond_instances(PFS_cond_class *klass,
 void PFS_instance_iterator::visit_file_instances(PFS_file_class *klass,
                                                  PFS_instance_visitor *visitor)
 {
-  DBUG_ASSERT(visitor != NULL);
+  assert(visitor != NULL);
 
   visitor->visit_file_class(klass);
 
@@ -642,7 +642,7 @@ void PFS_instance_iterator::visit_file_instances(PFS_file_class *klass,
 void PFS_instance_iterator::visit_socket_instances(PFS_socket_class *klass,
                                                    PFS_instance_visitor *visitor)
 {
-  DBUG_ASSERT(visitor != NULL);
+  assert(visitor != NULL);
 
   visitor->visit_socket_class(klass);
 
@@ -680,8 +680,8 @@ void PFS_instance_iterator::visit_socket_instances(PFS_socket_class *klass,
                                                    PFS_thread *thread,
                                                    bool visit_class)
 {
-  DBUG_ASSERT(visitor != NULL);
-  DBUG_ASSERT(thread != NULL);
+  assert(visitor != NULL);
+  assert(thread != NULL);
 
   if (visit_class)
     visitor->visit_socket_class(klass);
@@ -720,8 +720,8 @@ void PFS_instance_iterator::visit_instances(PFS_instr_class *klass,
                                             PFS_thread *thread,
                                             bool visit_class)
 {
-  DBUG_ASSERT(visitor != NULL);
-  DBUG_ASSERT(klass != NULL);
+  assert(visitor != NULL);
+  assert(klass != NULL);
 
   switch (klass->m_type)
   {
@@ -789,7 +789,7 @@ class Proc_all_table_handles
 
 void PFS_object_iterator::visit_all_tables(PFS_object_visitor *visitor)
 {
-  DBUG_ASSERT(visitor != NULL);
+  assert(visitor != NULL);
 
   visitor->visit_global();
 
@@ -826,7 +826,7 @@ class Proc_one_table_share_handles
 void PFS_object_iterator::visit_tables(PFS_table_share *share,
                                        PFS_object_visitor *visitor)
 {
-  DBUG_ASSERT(visitor != NULL);
+  assert(visitor != NULL);
 
   if (!share->m_enabled)
     return;
@@ -869,7 +869,7 @@ void PFS_object_iterator::visit_table_indexes(PFS_table_share *share,
                                               uint index,
                                               PFS_object_visitor *visitor)
 {
-  DBUG_ASSERT(visitor != NULL);
+  assert(visitor != NULL);
 
   if (!share->m_enabled)
     return;
@@ -905,8 +905,8 @@ void PFS_connection_wait_visitor::visit_global()
     For waits, do not sum by connection but by instances,
     it is more efficient.
   */
-  DBUG_ASSERT(   (m_index == global_idle_class.m_event_name_index)
-              || (m_index == global_metadata_class.m_event_name_index));
+  assert(   (m_index == global_idle_class.m_event_name_index)
+            || (m_index == global_metadata_class.m_event_name_index));
 
   if (m_index == global_idle_class.m_event_name_index)
   {
@@ -968,7 +968,7 @@ PFS_connection_all_wait_visitor::~PFS_connection_all_wait_visitor()
 void PFS_connection_all_wait_visitor::visit_global()
 {
   /* Sum by instances, not by connection */
-  DBUG_ASSERT(false);
+  assert(false);
 }
 
 void PFS_connection_all_wait_visitor::visit_connection_slice(PFS_connection_slice *pfs)
diff --git a/storage/perfschema/pfs_visitor.h b/storage/perfschema/pfs_visitor.h
index ba97c5057e9..0258388d90a 100644
--- a/storage/perfschema/pfs_visitor.h
+++ b/storage/perfschema/pfs_visitor.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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 533eb758d38..7c1964721a6 100644
--- a/storage/perfschema/table_accounts.cc
+++ b/storage/perfschema/table_accounts.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -140,7 +140,7 @@ int table_accounts::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
@@ -158,7 +158,7 @@ int table_accounts::read_row_values(TABLE *table,
         m_row.m_connection_stat.set_field(f->field_index - 2, f);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_accounts.h b/storage/perfschema/table_accounts.h
index a760bb6327d..37e682fa9cc 100644
--- a/storage/perfschema/table_accounts.h
+++ b/storage/perfschema/table_accounts.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
 
   This 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.cc b/storage/perfschema/table_all_instr.cc
index 921dd8c1771..b54242fac15 100644
--- a/storage/perfschema/table_all_instr.cc
+++ b/storage/perfschema/table_all_instr.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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 8fb27a32541..ca27f46fcea 100644
--- a/storage/perfschema/table_all_instr.h
+++ b/storage/perfschema/table_all_instr.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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 9f33f68844e..536fd1be8a9 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -223,7 +223,7 @@ ::read_row_values(TABLE *table, unsigned char *buf, Field **fields,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
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 36cc3e51476..ef1ba92f619 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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_host_by_event_name.cc b/storage/perfschema/table_esgs_by_host_by_event_name.cc
index 4847a3bc5b3..f04f591c344 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -221,7 +221,7 @@ ::read_row_values(TABLE *table, unsigned char *buf, Field **fields,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
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 fb711031b2e..5d1a0466534 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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_thread_by_event_name.cc b/storage/perfschema/table_esgs_by_thread_by_event_name.cc
index 268ef3ad3d3..5c78f3bfa9e 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -213,7 +213,7 @@ ::read_row_values(TABLE *table, unsigned char *, Field **fields,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 0);
+  assert(table->s->null_bytes == 0);
 
   for (; (f= *fields) ; fields++)
   {
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 9f0e85c7bb0..ac60e834081 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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_user_by_event_name.cc b/storage/perfschema/table_esgs_by_user_by_event_name.cc
index 14f0a2c0256..ca4782a33e1 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -220,7 +220,7 @@ ::read_row_values(TABLE *table, unsigned char *buf, Field **fields,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
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 77bbb5963c4..4403b193ee2 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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_global_by_event_name.cc b/storage/perfschema/table_esgs_global_by_event_name.cc
index d288c3a2af5..7a132d44f64 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -201,7 +201,7 @@ ::read_row_values(TABLE *table, unsigned char *, Field **fields,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 0);
+  assert(table->s->null_bytes == 0);
 
   for (; (f= *fields) ; fields++)
   {
diff --git a/storage/perfschema/table_esgs_global_by_event_name.h b/storage/perfschema/table_esgs_global_by_event_name.h
index 5a1f3dd8090..f2613b995f4 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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_esms_by_account_by_event_name.cc b/storage/perfschema/table_esms_by_account_by_event_name.cc
index 627300e1a0b..8879461fbcf 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -321,7 +321,7 @@ ::read_row_values(TABLE *table, unsigned char *buf, Field **fields,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
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 e787184b214..7edd8b83588 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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_esms_by_digest.cc b/storage/perfschema/table_esms_by_digest.cc
index 4ffddfad0bc..3767d367e9b 100644
--- a/storage/perfschema/table_esms_by_digest.cc
+++ b/storage/perfschema/table_esms_by_digest.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -319,7 +319,7 @@ ::read_row_values(TABLE *table, unsigned char *buf, Field **fields,
     Set the null bits. It indicates how many fields could be null
     in the table.
   */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
diff --git a/storage/perfschema/table_esms_by_digest.h b/storage/perfschema/table_esms_by_digest.h
index 777cbecb698..76f1c033513 100644
--- a/storage/perfschema/table_esms_by_digest.h
+++ b/storage/perfschema/table_esms_by_digest.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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_esms_by_host_by_event_name.cc b/storage/perfschema/table_esms_by_host_by_event_name.cc
index beb86875935..f2a11a8389e 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -319,7 +319,7 @@ ::read_row_values(TABLE *table, unsigned char *buf, Field **fields,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
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 82eecda4b67..7580957f278 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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_esms_by_program.cc b/storage/perfschema/table_esms_by_program.cc
index 65794021e99..e026106078f 100644
--- a/storage/perfschema/table_esms_by_program.cc
+++ b/storage/perfschema/table_esms_by_program.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -334,7 +334,7 @@ ::read_row_values(TABLE *table, unsigned char *buf, Field **fields,
     Set the null bits. It indicates how many fields could be null
     in the table.
   */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
diff --git a/storage/perfschema/table_esms_by_program.h b/storage/perfschema/table_esms_by_program.h
index cc263878e28..fdafb655918 100644
--- a/storage/perfschema/table_esms_by_program.h
+++ b/storage/perfschema/table_esms_by_program.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
 
   This 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_esms_by_thread_by_event_name.cc b/storage/perfschema/table_esms_by_thread_by_event_name.cc
index 2094bd15d77..ea183b87665 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -312,7 +312,7 @@ ::read_row_values(TABLE *table, unsigned char *, Field **fields,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 0);
+  assert(table->s->null_bytes == 0);
 
   for (; (f= *fields) ; fields++)
   {
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 98bcd1d7563..afae89aad63 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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_esms_by_user_by_event_name.cc b/storage/perfschema/table_esms_by_user_by_event_name.cc
index 47e21e678fd..95a29002bc4 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -318,7 +318,7 @@ ::read_row_values(TABLE *table, unsigned char *buf, Field **fields,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
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 cb39ece6a0f..b50ef4f4dff 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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_esms_global_by_event_name.cc b/storage/perfschema/table_esms_global_by_event_name.cc
index 7d6befa0c11..2a9181cadf4 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -301,7 +301,7 @@ ::read_row_values(TABLE *table, unsigned char *, Field **fields,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 0);
+  assert(table->s->null_bytes == 0);
 
   for (; (f= *fields) ; fields++)
   {
diff --git a/storage/perfschema/table_esms_global_by_event_name.h b/storage/perfschema/table_esms_global_by_event_name.h
index 2de5126c9be..9071cbdfcf3 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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_ets_by_account_by_event_name.cc b/storage/perfschema/table_ets_by_account_by_event_name.cc
index b7ba4d261c5..279fb03593b 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -273,7 +273,7 @@ ::read_row_values(TABLE *table, unsigned char *buf, Field **fields,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
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 98fb45f79dd..3399c27d6e4 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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_ets_by_host_by_event_name.cc b/storage/perfschema/table_ets_by_host_by_event_name.cc
index ca1e47f9519..34dc14753a4 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -271,7 +271,7 @@ ::read_row_values(TABLE *table, unsigned char *buf, Field **fields,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
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 341c3878253..2188f385701 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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_ets_by_thread_by_event_name.cc b/storage/perfschema/table_ets_by_thread_by_event_name.cc
index 29fa901a21b..5b2d56aa89a 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -264,7 +264,7 @@ ::read_row_values(TABLE *table, unsigned char *, Field **fields,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 0);
+  assert(table->s->null_bytes == 0);
 
   for (; (f= *fields) ; fields++)
   {
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 ad63efa3f1a..dbfe1fae016 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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_ets_by_user_by_event_name.cc b/storage/perfschema/table_ets_by_user_by_event_name.cc
index e84e9dad41e..71d9bfa3209 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -270,7 +270,7 @@ ::read_row_values(TABLE *table, unsigned char *buf, Field **fields,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
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 c3a1d0b5c0a..62721ce9adf 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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_ets_global_by_event_name.cc b/storage/perfschema/table_ets_global_by_event_name.cc
index ebd5dd0f791..64433d32e30 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -245,7 +245,7 @@ ::read_row_values(TABLE *table, unsigned char *, Field **fields,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 0);
+  assert(table->s->null_bytes == 0);
 
   for (; (f= *fields) ; fields++)
   {
diff --git a/storage/perfschema/table_ets_global_by_event_name.h b/storage/perfschema/table_ets_global_by_event_name.h
index 47c8828cb47..717a737f93c 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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_events_stages.cc b/storage/perfschema/table_events_stages.cc
index 73e3ce34be8..7fafcdc615f 100644
--- a/storage/perfschema/table_events_stages.cc
+++ b/storage/perfschema/table_events_stages.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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,7 +228,7 @@ int table_events_stages_common::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 2);
+  assert(table->s->null_bytes == 2);
   buf[0]= 0;
   buf[1]= 0;
 
@@ -299,7 +299,7 @@ int table_events_stages_common::read_row_values(TABLE *table,
           f->set_null();
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
@@ -448,10 +448,10 @@ int table_events_stages_history::rnd_pos(const void *pos)
   PFS_thread *pfs_thread;
   PFS_events_stages *stage;
 
-  DBUG_ASSERT(events_stages_history_per_thread != 0);
+  assert(events_stages_history_per_thread != 0);
   set_position(pos);
 
-  DBUG_ASSERT(m_pos.m_index_2 < events_stages_history_per_thread);
+  assert(m_pos.m_index_2 < events_stages_history_per_thread);
 
   pfs_thread= global_thread_container.get(m_pos.m_index_1);
   if (pfs_thread != NULL)
diff --git a/storage/perfschema/table_events_stages.h b/storage/perfschema/table_events_stages.h
index 79cecedda7c..38b6917b77d 100644
--- a/storage/perfschema/table_events_stages.h
+++ b/storage/perfschema/table_events_stages.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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_events_statements.cc b/storage/perfschema/table_events_statements.cc
index 997e931ca45..46417d8e670 100644
--- a/storage/perfschema/table_events_statements.cc
+++ b/storage/perfschema/table_events_statements.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -472,7 +472,7 @@ int table_events_statements_common::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 3);
+  assert(table->s->null_bytes == 3);
   buf[0]= 0;
   buf[1]= 0;
   buf[2]= 0;
@@ -661,7 +661,7 @@ int table_events_statements_common::read_row_values(TABLE *table,
           set_field_ulong(f, m_row.m_nesting_event_level);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
@@ -754,7 +754,7 @@ int table_events_statements_current::rnd_pos(const void *pos)
         return HA_ERR_RECORD_DELETED;
     }
 
-    DBUG_ASSERT(m_pos.m_index_2 < statement_stack_max);
+    assert(m_pos.m_index_2 < statement_stack_max);
 
     statement= &pfs_thread->m_statement_stack[m_pos.m_index_2];
 
@@ -876,13 +876,13 @@ int table_events_statements_history::rnd_pos(const void *pos)
   PFS_thread *pfs_thread;
   PFS_events_statements *statement;
 
-  DBUG_ASSERT(events_statements_history_per_thread != 0);
+  assert(events_statements_history_per_thread != 0);
   set_position(pos);
 
   pfs_thread= global_thread_container.get(m_pos.m_index_1);
   if (pfs_thread != NULL)
   {
-    DBUG_ASSERT(m_pos.m_index_2 < events_statements_history_per_thread);
+    assert(m_pos.m_index_2 < events_statements_history_per_thread);
 
     if ( ! pfs_thread->m_statements_history_full &&
         (m_pos.m_index_2 >= pfs_thread->m_statements_history_index))
diff --git a/storage/perfschema/table_events_statements.h b/storage/perfschema/table_events_statements.h
index a06c8e0f1c6..5f326b5c298 100644
--- a/storage/perfschema/table_events_statements.h
+++ b/storage/perfschema/table_events_statements.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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_events_transactions.cc b/storage/perfschema/table_events_transactions.cc
index b34e10f5d77..1f7c6299baa 100644
--- a/storage/perfschema/table_events_transactions.cc
+++ b/storage/perfschema/table_events_transactions.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -320,8 +320,8 @@ static const ulong XID_BUFFER_SIZE= XIDDATASIZE*2 + 2 + 1;
 */
 static uint xid_to_hex(char *buf, size_t buf_len, PSI_xid *xid, size_t offset, size_t length)
 {
-  DBUG_ASSERT(buf_len >= XID_BUFFER_SIZE);
-  DBUG_ASSERT(offset + length <= XIDDATASIZE);
+  assert(buf_len >= XID_BUFFER_SIZE);
+  assert(offset + length <= XIDDATASIZE);
   *buf++= '0';
   *buf++= 'x';
   return bin_to_hex_str(buf, buf_len-2, (char*)(xid->data + offset), length) + 2;
@@ -338,7 +338,7 @@ static uint xid_to_hex(char *buf, size_t buf_len, PSI_xid *xid, size_t offset, s
 */
 static void xid_store(Field *field, PSI_xid *xid, size_t offset, size_t length)
 {
-  DBUG_ASSERT(!xid->is_null());
+  assert(!xid->is_null());
   if (xid_printable(xid, offset, length))
   {
     field->store(xid->data + offset, length, &my_charset_bin);
@@ -377,7 +377,7 @@ int table_events_transactions_common::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 3);
+  assert(table->s->null_bytes == 3);
   buf[0]= 0;
   buf[1]= 0;
   buf[2]= 0;
@@ -495,7 +495,7 @@ int table_events_transactions_common::read_row_values(TABLE *table,
           f->set_null();
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
@@ -650,10 +650,10 @@ int table_events_transactions_history::rnd_pos(const void *pos)
   PFS_thread *pfs_thread;
   PFS_events_transactions *transaction;
 
-  DBUG_ASSERT(events_transactions_history_per_thread != 0);
+  assert(events_transactions_history_per_thread != 0);
   set_position(pos);
 
-  DBUG_ASSERT(m_pos.m_index_2 < events_transactions_history_per_thread);
+  assert(m_pos.m_index_2 < events_transactions_history_per_thread);
 
   pfs_thread= global_thread_container.get(m_pos.m_index_1);
   if (pfs_thread != NULL)
diff --git a/storage/perfschema/table_events_transactions.h b/storage/perfschema/table_events_transactions.h
index e2eded16596..3c0c7dd564f 100644
--- a/storage/perfschema/table_events_transactions.h
+++ b/storage/perfschema/table_events_transactions.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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_events_waits.cc b/storage/perfschema/table_events_waits.cc
index 932d6f7c3e1..bb54f03a473 100644
--- a/storage/perfschema/table_events_waits.cc
+++ b/storage/perfschema/table_events_waits.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -709,7 +709,7 @@ int table_events_waits_common::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 2);
+  assert(table->s->null_bytes == 2);
   buf[0]= 0;
   buf[1]= 0;
 
@@ -841,7 +841,7 @@ int table_events_waits_common::read_row_values(TABLE *table,
         f->set_null();
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
@@ -960,7 +960,7 @@ int table_events_waits_current::rnd_pos(const void *pos)
     }
 #endif
 
-    DBUG_ASSERT(m_pos.m_index_2 < WAIT_STACK_LOGICAL_SIZE);
+    assert(m_pos.m_index_2 < WAIT_STACK_LOGICAL_SIZE);
 
     if (wait->m_wait_class != NO_WAIT_CLASS)
     {
@@ -1061,13 +1061,13 @@ int table_events_waits_history::rnd_pos(const void *pos)
   PFS_thread *pfs_thread;
   PFS_events_waits *wait;
 
-  DBUG_ASSERT(events_waits_history_per_thread != 0);
+  assert(events_waits_history_per_thread != 0);
   set_position(pos);
 
   pfs_thread= global_thread_container.get(m_pos.m_index_1);
   if (pfs_thread != NULL)
   {
-    DBUG_ASSERT(m_pos.m_index_2 < events_waits_history_per_thread);
+    assert(m_pos.m_index_2 < events_waits_history_per_thread);
 
     if ( ! pfs_thread->m_waits_history_full &&
         (m_pos.m_index_2 >= pfs_thread->m_waits_history_index))
diff --git a/storage/perfschema/table_events_waits.h b/storage/perfschema/table_events_waits.h
index ce71c797ef5..b0abcf7b0a6 100644
--- a/storage/perfschema/table_events_waits.h
+++ b/storage/perfschema/table_events_waits.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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_events_waits_summary.cc b/storage/perfschema/table_events_waits_summary.cc
index c2f7c478eb8..52d3f6ea10d 100644
--- a/storage/perfschema/table_events_waits_summary.cc
+++ b/storage/perfschema/table_events_waits_summary.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -233,7 +233,7 @@ ::read_row_values(TABLE *table, unsigned char *, Field **fields,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 0);
+  assert(table->s->null_bytes == 0);
 
   for (; (f= *fields) ; fields++)
   {
@@ -263,7 +263,7 @@ ::read_row_values(TABLE *table, unsigned char *, Field **fields,
         set_field_ulonglong(f, m_row.m_stat.m_max);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_events_waits_summary.h b/storage/perfschema/table_events_waits_summary.h
index 53e86558e96..0e97888f7b6 100644
--- a/storage/perfschema/table_events_waits_summary.h
+++ b/storage/perfschema/table_events_waits_summary.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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_ews_by_account_by_event_name.cc b/storage/perfschema/table_ews_by_account_by_event_name.cc
index 22910d10138..e6c7ab1a7cf 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -178,7 +178,7 @@ int table_ews_by_account_by_event_name::rnd_next(void)
           break;
         default:
           instr_class= NULL;
-          DBUG_ASSERT(false);
+          assert(false);
           break;
         }
 
@@ -235,7 +235,7 @@ table_ews_by_account_by_event_name::rnd_pos(const void *pos)
     break;
   default:
     instr_class= NULL;
-    DBUG_ASSERT(false);
+    assert(false);
   }
   if (instr_class)
   {
@@ -284,7 +284,7 @@ ::read_row_values(TABLE *table, unsigned char *buf, Field **fields,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
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 f42b9ab21fe..30b2deb6f30 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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_ews_by_host_by_event_name.cc b/storage/perfschema/table_ews_by_host_by_event_name.cc
index f36ef6eeaa3..86bce3c43d9 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -175,7 +175,7 @@ int table_ews_by_host_by_event_name::rnd_next(void)
           break;
         default:
           instr_class= NULL;
-          DBUG_ASSERT(false);
+          assert(false);
           break;
         }
 
@@ -232,7 +232,7 @@ table_ews_by_host_by_event_name::rnd_pos(const void *pos)
     break;
   default:
     instr_class= NULL;
-    DBUG_ASSERT(false);
+    assert(false);
     break;
   }
   if (instr_class)
@@ -283,7 +283,7 @@ ::read_row_values(TABLE *table, unsigned char *buf, Field **fields,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
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 34de54fb246..ade88d28da4 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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_ews_by_thread_by_event_name.cc b/storage/perfschema/table_ews_by_thread_by_event_name.cc
index a0269daab08..851ac37d7f0 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -171,7 +171,7 @@ int table_ews_by_thread_by_event_name::rnd_next(void)
           instr_class= find_metadata_class(m_pos.m_index_3);
           break;
         default:
-          DBUG_ASSERT(false);
+          assert(false);
           instr_class= NULL;
           break;
         }
@@ -227,7 +227,7 @@ table_ews_by_thread_by_event_name::rnd_pos(const void *pos)
       instr_class= find_metadata_class(m_pos.m_index_3);
       break;
     default:
-      DBUG_ASSERT(false);
+      assert(false);
       instr_class= NULL;
     }
 
@@ -290,7 +290,7 @@ ::read_row_values(TABLE *table, unsigned char *, Field **fields,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 0);
+  assert(table->s->null_bytes == 0);
 
   for (; (f= *fields) ; fields++)
   {
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 73ca273be52..30ff564563f 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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_ews_by_user_by_event_name.cc b/storage/perfschema/table_ews_by_user_by_event_name.cc
index 13a5e83abca..d5205320cf1 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -174,7 +174,7 @@ int table_ews_by_user_by_event_name::rnd_next(void)
           break;
         default:
           instr_class= NULL;
-          DBUG_ASSERT(false);
+          assert(false);
           break;
         }
 
@@ -231,7 +231,7 @@ table_ews_by_user_by_event_name::rnd_pos(const void *pos)
     break;
   default:
     instr_class= NULL;
-    DBUG_ASSERT(false);
+    assert(false);
     break;
   }
   if (instr_class)
@@ -282,7 +282,7 @@ ::read_row_values(TABLE *table, unsigned char *buf, Field **fields,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
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 21a66f69f7d..6883d61394b 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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_ews_global_by_event_name.cc b/storage/perfschema/table_ews_global_by_event_name.cc
index 099dcb308c2..d4169a562b2 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -273,8 +273,8 @@ table_ews_global_by_event_name::rnd_pos(const void *pos)
     }
     break;
   case pos_ews_global_by_event_name::VIEW_TABLE:
-    DBUG_ASSERT(m_pos.m_index_2 >= 1);
-    DBUG_ASSERT(m_pos.m_index_2 <= 2);
+    assert(m_pos.m_index_2 >= 1);
+    assert(m_pos.m_index_2 <= 2);
     if (m_pos.m_index_2 == 1)
       make_table_io_row(&global_table_io_class);
     else
@@ -305,7 +305,7 @@ table_ews_global_by_event_name::rnd_pos(const void *pos)
     }
     break;
   default:
-    DBUG_ASSERT(false);
+    assert(false);
     break;
   }
 
@@ -447,7 +447,7 @@ ::read_row_values(TABLE *table, unsigned char *, Field **fields,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 0);
+  assert(table->s->null_bytes == 0);
 
   for (; (f= *fields) ; fields++)
   {
diff --git a/storage/perfschema/table_ews_global_by_event_name.h b/storage/perfschema/table_ews_global_by_event_name.h
index 25c010ba6d9..ea146aaee50 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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_file_instances.cc b/storage/perfschema/table_file_instances.cc
index df79e3e92af..518c9bedad3 100644
--- a/storage/perfschema/table_file_instances.cc
+++ b/storage/perfschema/table_file_instances.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -166,7 +166,7 @@ int table_file_instances::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 0);
+  assert(table->s->null_bytes == 0);
 
   for (; (f= *fields) ; fields++)
   {
@@ -185,7 +185,7 @@ int table_file_instances::read_row_values(TABLE *table,
         set_field_ulong(f, m_row.m_open_count);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_file_instances.h b/storage/perfschema/table_file_instances.h
index b2073e9c372..073512d7bad 100644
--- a/storage/perfschema/table_file_instances.h
+++ b/storage/perfschema/table_file_instances.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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_file_summary_by_event_name.cc b/storage/perfschema/table_file_summary_by_event_name.cc
index 21ed56f18a3..9a5258111bb 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -274,7 +274,7 @@ int table_file_summary_by_event_name::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 0);
+  assert(table->s->null_bytes == 0);
 
   for (; (f= *fields) ; fields++)
   {
@@ -356,7 +356,7 @@ int table_file_summary_by_event_name::read_row_values(TABLE *table,
         break;
 
       default:
-        DBUG_ASSERT(false);
+        assert(false);
         break;
       }
     } // if
diff --git a/storage/perfschema/table_file_summary_by_event_name.h b/storage/perfschema/table_file_summary_by_event_name.h
index ec04478a59b..c6e698215fe 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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_file_summary_by_instance.cc b/storage/perfschema/table_file_summary_by_instance.cc
index 80c6b6b0e25..d4292421ca7 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -296,7 +296,7 @@ int table_file_summary_by_instance::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 0);
+  assert(table->s->null_bytes == 0);
 
   for (; (f= *fields) ; fields++)
   {
@@ -384,7 +384,7 @@ int table_file_summary_by_instance::read_row_values(TABLE *table,
         set_field_ulonglong(f, m_row.m_io_stat.m_misc.m_waits.m_max);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_file_summary_by_instance.h b/storage/perfschema/table_file_summary_by_instance.h
index 090c27b3dd0..574c4fbd9d5 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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_global_status.cc b/storage/perfschema/table_global_status.cc
index 75f57f2c60b..8b9ced5ab7f 100644
--- a/storage/perfschema/table_global_status.cc
+++ b/storage/perfschema/table_global_status.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -181,7 +181,7 @@ ::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
@@ -197,7 +197,7 @@ ::read_row_values(TABLE *table,
         m_row.m_variable_value.set_field(f);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_global_status.h b/storage/perfschema/table_global_status.h
index a97ea9d0041..53d7ca459c9 100644
--- a/storage/perfschema/table_global_status.h
+++ b/storage/perfschema/table_global_status.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
 
   This 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_global_variables.cc b/storage/perfschema/table_global_variables.cc
index 6c78a1a2459..4c60f4cdd0a 100644
--- a/storage/perfschema/table_global_variables.cc
+++ b/storage/perfschema/table_global_variables.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -141,7 +141,7 @@ int table_global_variables::rnd_pos(const void *pos)
     return HA_ERR_RECORD_DELETED;
 
   set_position(pos);
-  DBUG_ASSERT(m_pos.m_index < m_sysvar_cache.size());
+  assert(m_pos.m_index < m_sysvar_cache.size());
 
   const System_variable *system_var= m_sysvar_cache.get(m_pos.m_index);
   if (system_var != NULL)
@@ -175,7 +175,7 @@ ::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
@@ -191,7 +191,7 @@ ::read_row_values(TABLE *table,
         m_row.m_variable_value.set_field(f);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_global_variables.h b/storage/perfschema/table_global_variables.h
index b9124e76f65..8a9bbd63574 100644
--- a/storage/perfschema/table_global_variables.h
+++ b/storage/perfschema/table_global_variables.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
 
   This 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.cc b/storage/perfschema/table_helper.cc
index 6459e993ccb..8ba5219aae5 100644
--- a/storage/perfschema/table_helper.cc
+++ b/storage/perfschema/table_helper.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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,7 +107,7 @@ void PFS_account_row::set_field(uint index, Field *f)
         f->set_null();
       break;
     default:
-      DBUG_ASSERT(false);
+      assert(false);
       break;
   }
 }
@@ -181,7 +181,7 @@ void PFS_digest_row::set_field(uint index, Field *f)
         f->set_null();
       break;
     default:
-      DBUG_ASSERT(false);
+      assert(false);
       break;
   }
 }
@@ -318,7 +318,7 @@ void PFS_object_row::set_field(uint index, Field *f)
       PFS_engine_table::set_field_varchar_utf8(f, m_object_name, m_object_name_length);
       break;
     default:
-      DBUG_ASSERT(false);
+      assert(false);
   }
 }
 
@@ -345,7 +345,7 @@ void PFS_object_row::set_nullable_field(uint index, Field *f)
         f->set_null();
       break;
     default:
-      DBUG_ASSERT(false);
+      assert(false);
   }
 }
 
@@ -401,7 +401,7 @@ void PFS_index_row::set_field(uint index, Field *f)
         f->set_null();
       break;
     default:
-      DBUG_ASSERT(false);
+      assert(false);
   }
 }
 
@@ -474,7 +474,7 @@ void PFS_statement_stat_row::set_field(uint index, Field *f)
       PFS_engine_table::set_field_ulonglong(f, m_no_good_index_used);
       break;
     default:
-      DBUG_ASSERT(false);
+      assert(false);
       break;
   }
 }
@@ -505,7 +505,7 @@ void PFS_transaction_stat_row::set_field(uint index, Field *f)
       m_read_only_row.set_field(index-10, f);
       break;
     default:
-      DBUG_ASSERT(false);
+      assert(false);
       break;
   }
 }
@@ -521,7 +521,7 @@ void PFS_connection_stat_row::set_field(uint index, Field *f)
       PFS_engine_table::set_field_ulonglong(f, m_total_connections);
       break;
     default:
-      DBUG_ASSERT(false);
+      assert(false);
       break;
   }
 }
@@ -568,7 +568,7 @@ void set_field_object_type(Field *f, enum_object_type object_type)
     break;
   case NO_OBJECT_TYPE:
   default:
-    DBUG_ASSERT(false);
+    assert(false);
     PFS_engine_table::set_field_varchar_utf8(f, "", 0);
     break;
   }
@@ -612,7 +612,7 @@ void set_field_lock_type(Field *f, PFS_TL_LOCK_TYPE lock_type)
     f->set_null();
     break;
   default:
-    DBUG_ASSERT(false);
+    assert(false);
   }
 }
 
@@ -655,7 +655,7 @@ void set_field_mdl_type(Field *f, opaque_mdl_type mdl_type)
     PFS_engine_table::set_field_varchar_utf8(f, "EXCLUSIVE", 9);
     break;
   default:
-    DBUG_ASSERT(false);
+    assert(false);
   }
 }
 
@@ -675,7 +675,7 @@ void set_field_mdl_duration(Field *f, opaque_mdl_duration mdl_duration)
     break;
   case MDL_DURATION_END:
   default:
-    DBUG_ASSERT(false);
+    assert(false);
   }
 }
 
@@ -698,7 +698,7 @@ void set_field_mdl_status(Field *f, opaque_mdl_status mdl_status)
     PFS_engine_table::set_field_varchar_utf8(f, "POST_RELEASE_NOTIFY", 19);
     break;
   default:
-    DBUG_ASSERT(false);
+    assert(false);
   }
 }
 
@@ -745,7 +745,7 @@ void PFS_memory_stat_row::set_field(uint index, Field *f)
       PFS_engine_table::set_field_longlong(f, val);
       break;
     default:
-      DBUG_ASSERT(false);
+      assert(false);
       break;
   }
 }
@@ -767,7 +767,7 @@ void set_field_isolation_level(Field *f, enum_isolation_level iso_level)
     PFS_engine_table::set_field_varchar_utf8(f, "SERIALIZABLE", 12);
     break;
   default:
-    DBUG_ASSERT(false);
+    assert(false);
   }
 }
 
@@ -794,14 +794,14 @@ void set_field_xa_state(Field *f, enum_xa_transaction_state xa_state)
     PFS_engine_table::set_field_varchar_utf8(f, "COMMITTED", 9);
     break;
   default:
-    DBUG_ASSERT(false);
+    assert(false);
   }
 }
 
 void PFS_variable_name_row::make_row(const char* str, size_t length)
 {
-  DBUG_ASSERT(length <= sizeof(m_str));
-  DBUG_ASSERT(length <= NAME_CHAR_LEN);
+  assert(length <= sizeof(m_str));
+  assert(length <= NAME_CHAR_LEN);
 
   m_length= MY_MIN(length, NAME_CHAR_LEN); /* enforce max name length */
   if (m_length > 0)
@@ -821,8 +821,8 @@ void PFS_variable_value_row::make_row(const System_variable *var)
 
 void PFS_variable_value_row::make_row(const CHARSET_INFO *cs, const char* str, size_t length)
 {
-  DBUG_ASSERT(cs != NULL);
-  DBUG_ASSERT(length <= sizeof(m_str));
+  assert(cs != NULL);
+  assert(length <= sizeof(m_str));
   if (length > 0)
   {
     memcpy(m_str, str, length);
diff --git a/storage/perfschema/table_helper.h b/storage/perfschema/table_helper.h
index cacce967663..889f447df4e 100644
--- a/storage/perfschema/table_helper.h
+++ b/storage/perfschema/table_helper.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -278,7 +278,7 @@ struct PFS_stat_row
         PFS_engine_table::set_field_ulonglong(f, m_max);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
     }
   }
 };
diff --git a/storage/perfschema/table_host_cache.cc b/storage/perfschema/table_host_cache.cc
index d14032230b2..6f088eaffdc 100644
--- a/storage/perfschema/table_host_cache.cc
+++ b/storage/perfschema/table_host_cache.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
 
   This 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,7 +209,7 @@ PFS_engine_table* table_host_cache::create(void)
   if (t != NULL)
   {
     THD *thd= current_thd;
-    DBUG_ASSERT(thd != NULL);
+    assert(thd != NULL);
     t->materialize(thd);
   }
   return t;
@@ -252,8 +252,8 @@ void table_host_cache::materialize(THD *thd)
   row_host_cache *rows;
   row_host_cache *row;
 
-  DBUG_ASSERT(m_all_rows == NULL);
-  DBUG_ASSERT(m_row_count == 0);
+  assert(m_all_rows == NULL);
+  assert(m_row_count == 0);
 
   hostname_cache_lock();
 
@@ -366,7 +366,7 @@ int table_host_cache::rnd_next(void)
 int table_host_cache::rnd_pos(const void *pos)
 {
   set_position(pos);
-  DBUG_ASSERT(m_pos.m_index < m_row_count);
+  assert(m_pos.m_index < m_row_count);
   m_row= &m_all_rows[m_pos.m_index];
   return 0;
 }
@@ -378,10 +378,10 @@ int table_host_cache::read_row_values(TABLE *table,
 {
   Field *f;
 
-  DBUG_ASSERT(m_row);
+  assert(m_row);
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
@@ -487,7 +487,7 @@ int table_host_cache::read_row_values(TABLE *table,
           f->set_null();
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_host_cache.h b/storage/perfschema/table_host_cache.h
index 61a8809bf19..76a1108ea2e 100644
--- a/storage/perfschema/table_host_cache.h
+++ b/storage/perfschema/table_host_cache.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
 
   This 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_hosts.cc b/storage/perfschema/table_hosts.cc
index 3acdc7e7b1d..4a20c516297 100644
--- a/storage/perfschema/table_hosts.cc
+++ b/storage/perfschema/table_hosts.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -144,7 +144,7 @@ int table_hosts::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
@@ -161,7 +161,7 @@ int table_hosts::read_row_values(TABLE *table,
         m_row.m_connection_stat.set_field(f->field_index - 1, f);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_hosts.h b/storage/perfschema/table_hosts.h
index 9d5f1bf20a6..4e2690aa36b 100644
--- a/storage/perfschema/table_hosts.h
+++ b/storage/perfschema/table_hosts.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
 
   This 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_md_locks.cc b/storage/perfschema/table_md_locks.cc
index 3f6e82c73fb..3889c8037e0 100644
--- a/storage/perfschema/table_md_locks.cc
+++ b/storage/perfschema/table_md_locks.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -204,7 +204,7 @@ int table_metadata_locks::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
@@ -246,7 +246,7 @@ int table_metadata_locks::read_row_values(TABLE *table,
           f->set_null();
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_md_locks.h b/storage/perfschema/table_md_locks.h
index 40b6d2f6efb..c6a4a2eca8d 100644
--- a/storage/perfschema/table_md_locks.h
+++ b/storage/perfschema/table_md_locks.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
 
   This 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_mems_by_account_by_event_name.cc b/storage/perfschema/table_mems_by_account_by_event_name.cc
index 2fe8573b54d..a9ac82e74b2 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -254,7 +254,7 @@ int table_mems_by_account_by_event_name::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
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 b6151246f34..9d43c4cf404 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
 
   This 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_mems_by_host_by_event_name.cc b/storage/perfschema/table_mems_by_host_by_event_name.cc
index 3d18196fbd0..ff3dc8f6a68 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -251,7 +251,7 @@ int table_mems_by_host_by_event_name::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
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 1a55db2c9b3..a4fdde24fbd 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
 
   This 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_mems_by_thread_by_event_name.cc b/storage/perfschema/table_mems_by_thread_by_event_name.cc
index ea458d93cb6..117bc8f0062 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -245,7 +245,7 @@ int table_mems_by_thread_by_event_name::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 0);
+  assert(table->s->null_bytes == 0);
 
   for (; (f= *fields) ; fields++)
   {
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 f8608198c2a..b89172669e6 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
 
   This 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_mems_by_user_by_event_name.cc b/storage/perfschema/table_mems_by_user_by_event_name.cc
index 2f0f4ed0dac..201082f57d1 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -251,7 +251,7 @@ int table_mems_by_user_by_event_name::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
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 2791e1d3587..34c4cd518ae 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
 
   This 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_mems_global_by_event_name.cc b/storage/perfschema/table_mems_global_by_event_name.cc
index f6b2114518f..bca136a55bb 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -271,7 +271,7 @@ int table_mems_global_by_event_name::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 0);
+  assert(table->s->null_bytes == 0);
 
   for (; (f= *fields) ; fields++)
   {
diff --git a/storage/perfschema/table_mems_global_by_event_name.h b/storage/perfschema/table_mems_global_by_event_name.h
index 14a54142f4e..46dbccbd414 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
 
   This 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_os_global_by_type.cc b/storage/perfschema/table_os_global_by_type.cc
index 4119e67ee62..c957891f70d 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -298,7 +298,7 @@ int table_os_global_by_type::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
@@ -334,7 +334,7 @@ int table_os_global_by_type::read_row_values(TABLE *table,
         set_field_ulonglong(f, m_row.m_stat.m_max);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_os_global_by_type.h b/storage/perfschema/table_os_global_by_type.h
index d36cc29bffb..bf7220d9fc7 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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_performance_timers.cc b/storage/perfschema/table_performance_timers.cc
index 84e0c1ad10c..1fe44a92285 100644
--- a/storage/perfschema/table_performance_timers.cc
+++ b/storage/perfschema/table_performance_timers.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -147,7 +147,7 @@ int table_performance_timers::rnd_next(void)
 int table_performance_timers::rnd_pos(const void *pos)
 {
   set_position(pos);
-  DBUG_ASSERT(m_pos.m_index < COUNT_TIMER_NAME);
+  assert(m_pos.m_index < COUNT_TIMER_NAME);
   m_row= &m_data[m_pos.m_index];
   return 0;
 }
@@ -159,10 +159,10 @@ int table_performance_timers::read_row_values(TABLE *table,
 {
   Field *f;
 
-  DBUG_ASSERT(m_row);
+  assert(m_row);
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
@@ -193,7 +193,7 @@ int table_performance_timers::read_row_values(TABLE *table,
           f->set_null();
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_performance_timers.h b/storage/perfschema/table_performance_timers.h
index b7a66daebab..226c2d6a65a 100644
--- a/storage/perfschema/table_performance_timers.h
+++ b/storage/perfschema/table_performance_timers.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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_prepared_stmt_instances.cc b/storage/perfschema/table_prepared_stmt_instances.cc
index 859e0a5277a..459a01aae96 100644
--- a/storage/perfschema/table_prepared_stmt_instances.cc
+++ b/storage/perfschema/table_prepared_stmt_instances.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2014, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -367,7 +367,7 @@ ::read_row_values(TABLE *table, unsigned char *buf, Field **fields,
   /*
     Set the null bits.
   */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
diff --git a/storage/perfschema/table_prepared_stmt_instances.h b/storage/perfschema/table_prepared_stmt_instances.h
index a17184d4312..a061e0d9883 100644
--- a/storage/perfschema/table_prepared_stmt_instances.h
+++ b/storage/perfschema/table_prepared_stmt_instances.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2014, 2021, Oracle and/or its affiliates.
 
   This 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_replication_applier_configuration.cc b/storage/perfschema/table_replication_applier_configuration.cc
index 94e505a049d..cd807623450 100644
--- a/storage/perfschema/table_replication_applier_configuration.cc
+++ b/storage/perfschema/table_replication_applier_configuration.cc
@@ -1,5 +1,5 @@
 /*
-      Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+      Copyright (c) 2013, 2021, Oracle and/or its affiliates.
 
       This program is free software; you can redistribute it and/or modify
       it under the terms of the GNU General Public License, version 2.0,
@@ -154,8 +154,8 @@ void table_replication_applier_configuration::make_row(Master_info *mi)
 {
   m_row_exists= false;
 
-  DBUG_ASSERT(mi != NULL);
-  DBUG_ASSERT(mi->rli != NULL);
+  assert(mi != NULL);
+  assert(mi->rli != NULL);
 
   mysql_mutex_lock(&mi->data_lock);
   mysql_mutex_lock(&mi->rli->data_lock);
@@ -190,7 +190,7 @@ int table_replication_applier_configuration::read_row_values(TABLE *table,
     the table record reserves an extra null byte, see open_binary_frm().
   */
 
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
@@ -206,7 +206,7 @@ int table_replication_applier_configuration::read_row_values(TABLE *table,
         set_field_ulong(f, static_cast<ulong>(m_row.desired_delay));
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_replication_applier_configuration.h b/storage/perfschema/table_replication_applier_configuration.h
index b8b128ff2cb..934a05b3e16 100644
--- a/storage/perfschema/table_replication_applier_configuration.h
+++ b/storage/perfschema/table_replication_applier_configuration.h
@@ -1,5 +1,5 @@
 /*
-   Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+   Copyright (c) 2013, 2021, Oracle and/or its affiliates.
 
    This 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_replication_applier_status.cc b/storage/perfschema/table_replication_applier_status.cc
index 96dae833c8a..4094a98565f 100644
--- a/storage/perfschema/table_replication_applier_status.cc
+++ b/storage/perfschema/table_replication_applier_status.cc
@@ -1,5 +1,5 @@
 /*
-      Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+      Copyright (c) 2013, 2021, Oracle and/or its affiliates.
 
       This program is free software; you can redistribute it and/or modify
       it under the terms of the GNU General Public License, version 2.0,
@@ -164,8 +164,8 @@ void table_replication_applier_status::make_row(Master_info *mi)
 
   m_row_exists= false;
 
-  DBUG_ASSERT(mi != NULL);
-  DBUG_ASSERT(mi->rli != NULL);
+  assert(mi != NULL);
+  assert(mi->rli != NULL);
 
   m_row.channel_name_length= mi->get_channel()? strlen(mi->get_channel()):0;
   memcpy(m_row.channel_name, mi->get_channel(), m_row.channel_name_length);
@@ -215,7 +215,7 @@ int table_replication_applier_status::read_row_values(TABLE *table,
   if (unlikely(! m_row_exists))
     return HA_ERR_RECORD_DELETED;
 
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
@@ -240,7 +240,7 @@ int table_replication_applier_status::read_row_values(TABLE *table,
         set_field_ulonglong(f, m_row.count_transactions_retries);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_replication_applier_status.h b/storage/perfschema/table_replication_applier_status.h
index 4fb62999bf3..82b0e4c6d58 100644
--- a/storage/perfschema/table_replication_applier_status.h
+++ b/storage/perfschema/table_replication_applier_status.h
@@ -1,5 +1,5 @@
 /*
-   Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+   Copyright (c) 2013, 2021, Oracle and/or its affiliates.
 
    This 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_replication_applier_status_by_coordinator.cc b/storage/perfschema/table_replication_applier_status_by_coordinator.cc
index 47b13cbcb5b..2c44e2aab8e 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, 2018, Oracle and/or its affiliates. All rights reserved.
+      Copyright (c) 2013, 2021, Oracle and/or its affiliates.
 
       This program is free software; you can redistribute it and/or modify
       it under the terms of the GNU General Public License, version 2.0,
@@ -181,8 +181,8 @@ void table_replication_applier_status_by_coordinator::make_row(Master_info *mi)
 {
   m_row_exists= false;
 
-  DBUG_ASSERT(mi != NULL);
-  DBUG_ASSERT(mi->rli != NULL);
+  assert(mi != NULL);
+  assert(mi->rli != NULL);
 
   mysql_mutex_lock(&mi->rli->data_lock);
 
@@ -242,7 +242,7 @@ int table_replication_applier_status_by_coordinator
   if (unlikely(! m_row_exists))
     return HA_ERR_RECORD_DELETED;
 
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
@@ -274,7 +274,7 @@ int table_replication_applier_status_by_coordinator
         set_field_timestamp(f, m_row.last_error_timestamp);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_replication_applier_status_by_coordinator.h b/storage/perfschema/table_replication_applier_status_by_coordinator.h
index 5337bbaa2a0..3ba7a9b285b 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, 2018, Oracle and/or its affiliates. All rights reserved.
+   Copyright (c) 2013, 2021, Oracle and/or its affiliates.
 
    This 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_replication_applier_status_by_worker.cc b/storage/perfschema/table_replication_applier_status_by_worker.cc
index 5eebef920e7..30f1caa3497 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, 2018, Oracle and/or its affiliates. All rights reserved.
+      Copyright (c) 2013, 2021, Oracle and/or its affiliates.
 
       This program is free software; you can redistribute it and/or modify
       it under the terms of the GNU General Public License, version 2.0,
@@ -244,8 +244,8 @@ void table_replication_applier_status_by_worker::make_row(Master_info *mi)
 
   m_row.thread_id= 0;
 
-  DBUG_ASSERT(mi != NULL);
-  DBUG_ASSERT(mi->rli != NULL);
+  assert(mi != NULL);
+  assert(mi->rli != NULL);
 
   mysql_mutex_lock(&mi->rli->data_lock);
 
@@ -293,7 +293,7 @@ void table_replication_applier_status_by_worker::make_row(Master_info *mi)
       AUTOMATIC_GROUP when the SQL thread is not executing any
       transaction.  For this case, the field should be empty.
     */
-    DBUG_ASSERT(mi->rli->currently_executing_gtid.type == AUTOMATIC_GROUP);
+    assert(mi->rli->currently_executing_gtid.type == AUTOMATIC_GROUP);
     m_row.last_seen_transaction_length= 0;
     memcpy(m_row.last_seen_transaction, "", 1);
   }
@@ -376,7 +376,7 @@ void table_replication_applier_status_by_worker::make_row(Slave_worker *w)
       AUTOMATIC_GROUP when the worker is not executing any
       transaction.  For this case, the field should be empty.
     */
-    DBUG_ASSERT(w->currently_executing_gtid.type == AUTOMATIC_GROUP);
+    assert(w->currently_executing_gtid.type == AUTOMATIC_GROUP);
     m_row.last_seen_transaction_length= 0;
     memcpy(m_row.last_seen_transaction, "", 1);
   }
@@ -410,7 +410,7 @@ int table_replication_applier_status_by_worker
   if (unlikely(! m_row_exists))
     return HA_ERR_RECORD_DELETED;
 
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
@@ -447,7 +447,7 @@ int table_replication_applier_status_by_worker
         set_field_timestamp(f, m_row.last_error_timestamp);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_replication_applier_status_by_worker.h b/storage/perfschema/table_replication_applier_status_by_worker.h
index cc62dbee0a3..11a31e02518 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, 2018, Oracle and/or its affiliates. All rights reserved.
+   Copyright (c) 2013, 2021, Oracle and/or its affiliates.
 
    This 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_replication_connection_configuration.cc b/storage/perfschema/table_replication_connection_configuration.cc
index 88b1215a333..bcb07bf5b79 100644
--- a/storage/perfschema/table_replication_connection_configuration.cc
+++ b/storage/perfschema/table_replication_connection_configuration.cc
@@ -1,5 +1,5 @@
 /*
-      Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+      Copyright (c) 2013, 2021, Oracle and/or its affiliates.
 
       This program is free software; you can redistribute it and/or modify
       it under the terms of the GNU General Public License, version 2.0,
@@ -243,7 +243,7 @@ void table_replication_connection_configuration::make_row(Master_info *mi)
   m_row_exists= false;
 
 
-  DBUG_ASSERT(mi != NULL);
+  assert(mi != NULL);
 
   mysql_mutex_lock(&mi->data_lock);
   mysql_mutex_lock(&mi->rli->data_lock);
@@ -335,7 +335,7 @@ int table_replication_connection_configuration::read_row_values(TABLE *table,
   if (unlikely(! m_row_exists))
     return HA_ERR_RECORD_DELETED;
 
-  DBUG_ASSERT(table->s->null_bytes == 0);
+  assert(table->s->null_bytes == 0);
 
   for (; (f= *fields) ; fields++)
   {
@@ -408,7 +408,7 @@ int table_replication_connection_configuration::read_row_values(TABLE *table,
                                m_row.tls_version_length);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_replication_connection_configuration.h b/storage/perfschema/table_replication_connection_configuration.h
index 610670bfa78..47e2f84d53d 100644
--- a/storage/perfschema/table_replication_connection_configuration.h
+++ b/storage/perfschema/table_replication_connection_configuration.h
@@ -1,5 +1,5 @@
 /*
-   Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+   Copyright (c) 2013, 2021, Oracle and/or its affiliates.
 
    This 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_replication_connection_status.cc b/storage/perfschema/table_replication_connection_status.cc
index 0c296103b97..ca0b9393ac0 100644
--- a/storage/perfschema/table_replication_connection_status.cc
+++ b/storage/perfschema/table_replication_connection_status.cc
@@ -1,5 +1,5 @@
 /*
-      Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+      Copyright (c) 2013, 2021, Oracle and/or its affiliates.
 
       This program is free software; you can redistribute it and/or modify
       it under the terms of the GNU General Public License, version 2.0,
@@ -249,8 +249,8 @@ void table_replication_connection_status::make_row(Master_info *mi)
   m_row.thread_id_is_null= true;
   m_row.service_state= PS_RPL_CONNECT_SERVICE_STATE_NO;
 
-  DBUG_ASSERT(mi != NULL);
-  DBUG_ASSERT(mi->rli != NULL);
+  assert(mi != NULL);
+  assert(mi->rli != NULL);
 
   mysql_mutex_lock(&mi->data_lock);
   mysql_mutex_lock(&mi->rli->data_lock);
@@ -376,7 +376,7 @@ int table_replication_connection_status::read_row_values(TABLE *table,
   if (unlikely(! m_row_exists))
     return HA_ERR_RECORD_DELETED;
 
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
@@ -430,7 +430,7 @@ int table_replication_connection_status::read_row_values(TABLE *table,
         set_field_timestamp(f, m_row.last_error_timestamp);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_replication_connection_status.h b/storage/perfschema/table_replication_connection_status.h
index 45376b33e76..afc56ba9b54 100644
--- a/storage/perfschema/table_replication_connection_status.h
+++ b/storage/perfschema/table_replication_connection_status.h
@@ -1,5 +1,5 @@
 /*
-   Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+   Copyright (c) 2013, 2021, Oracle and/or its affiliates.
 
    This 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_replication_group_member_stats.cc b/storage/perfschema/table_replication_group_member_stats.cc
index 9c7f61817d1..d56c56c7874 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, 2016, Oracle and/or its affiliates. All rights reserved.
+  Copyright (c) 2014, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -263,7 +263,7 @@ int table_replication_group_member_stats::rnd_pos(const void *pos)
     return HA_ERR_END_OF_FILE;
 
   set_position(pos);
-  DBUG_ASSERT(m_pos.m_index < 1);
+  assert(m_pos.m_index < 1);
   make_row();
 
   return 0;
@@ -323,7 +323,7 @@ int table_replication_group_member_stats::read_row_values(TABLE *table,
   if (unlikely(! m_row_exists))
     return HA_ERR_RECORD_DELETED;
 
-  DBUG_ASSERT(table->s->null_bytes == 0);
+  assert(table->s->null_bytes == 0);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
@@ -364,7 +364,7 @@ int table_replication_group_member_stats::read_row_values(TABLE *table,
 
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_replication_group_member_stats.h b/storage/perfschema/table_replication_group_member_stats.h
index 0fa17be8143..7f63856f908 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, 2016, Oracle and/or its affiliates. All rights reserved.
+   Copyright (c) 2014, 2021, Oracle and/or its affiliates.
 
    This 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_replication_group_members.cc b/storage/perfschema/table_replication_group_members.cc
index 7aa4cf67fd9..4e6c004a571 100644
--- a/storage/perfschema/table_replication_group_members.cc
+++ b/storage/perfschema/table_replication_group_members.cc
@@ -1,5 +1,5 @@
 /*
-      Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+      Copyright (c) 2013, 2021, Oracle and/or its affiliates.
 
       This program is free software; you can redistribute it and/or modify
       it under the terms of the GNU General Public License, version 2.0,
@@ -193,7 +193,7 @@ int table_replication_group_members::rnd_pos(const void *pos)
     return HA_ERR_END_OF_FILE;
 
   set_position(pos);
-  DBUG_ASSERT(m_pos.m_index < get_row_count());
+  assert(m_pos.m_index < get_row_count());
   make_row(m_pos.m_index);
 
   return 0;
@@ -245,7 +245,7 @@ int table_replication_group_members::read_row_values(TABLE *table,
   if (unlikely(! m_row_exists))
     return HA_ERR_RECORD_DELETED;
 
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
@@ -273,7 +273,7 @@ int table_replication_group_members::read_row_values(TABLE *table,
         set_field_char_utf8(f, m_row.member_state, m_row.member_state_length);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_replication_group_members.h b/storage/perfschema/table_replication_group_members.h
index e2ea07771c0..b516362a863 100644
--- a/storage/perfschema/table_replication_group_members.h
+++ b/storage/perfschema/table_replication_group_members.h
@@ -1,5 +1,5 @@
 /*
-   Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+   Copyright (c) 2013, 2021, Oracle and/or its affiliates.
 
    This 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_account_connect_attrs.cc b/storage/perfschema/table_session_account_connect_attrs.cc
index 3e142484770..e80ca77e6d9 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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,7 +58,7 @@ table_session_account_connect_attrs::thread_fits(PFS_thread *thread)
     return false;
 
   /* The thread we compare to, by definition, has some instrumentation. */
-  DBUG_ASSERT(thread != NULL);
+  assert(thread != NULL);
 
   uint username_length= current_thread->m_username_length;
   uint hostname_length= current_thread->m_hostname_length;
diff --git a/storage/perfschema/table_session_account_connect_attrs.h b/storage/perfschema/table_session_account_connect_attrs.h
index 80d747c2735..6d97972f377 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
 
   This 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.cc b/storage/perfschema/table_session_connect.cc
index 1cac13ffcd3..a4bbc612165 100644
--- a/storage/perfschema/table_session_connect.cc
+++ b/storage/perfschema/table_session_connect.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -280,7 +280,7 @@ int table_session_connect::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
@@ -310,7 +310,7 @@ int table_session_connect::read_row_values(TABLE *table,
         set_field_ulong(f, m_row.m_ordinal_position);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_session_connect.h b/storage/perfschema/table_session_connect.h
index bbb63746e08..37313a14407 100644
--- a/storage/perfschema/table_session_connect.h
+++ b/storage/perfschema/table_session_connect.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
 
   This 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 e89481cc96d..193bcbe6818 100644
--- a/storage/perfschema/table_session_connect_attrs.cc
+++ b/storage/perfschema/table_session_connect_attrs.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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.h b/storage/perfschema/table_session_connect_attrs.h
index dc44d3830f8..ef5c0f457c4 100644
--- a/storage/perfschema/table_session_connect_attrs.h
+++ b/storage/perfschema/table_session_connect_attrs.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
 
   This 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_status.cc b/storage/perfschema/table_session_status.cc
index 1051bac5071..3a3d0c60a17 100644
--- a/storage/perfschema/table_session_status.cc
+++ b/storage/perfschema/table_session_status.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -140,7 +140,7 @@ table_session_status::rnd_pos(const void *pos)
     return HA_ERR_RECORD_DELETED;
 
   set_position(pos);
-  DBUG_ASSERT(m_pos.m_index < m_status_cache.size());
+  assert(m_pos.m_index < m_status_cache.size());
 
   if (m_status_cache.is_materialized())
   {
@@ -176,7 +176,7 @@ ::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
@@ -192,7 +192,7 @@ ::read_row_values(TABLE *table,
         m_row.m_variable_value.set_field(f);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_session_status.h b/storage/perfschema/table_session_status.h
index 24634fe47b5..ed42d3fc57d 100644
--- a/storage/perfschema/table_session_status.h
+++ b/storage/perfschema/table_session_status.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
 
   This 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_variables.cc b/storage/perfschema/table_session_variables.cc
index 3721ca31fe4..35240f683ab 100644
--- a/storage/perfschema/table_session_variables.cc
+++ b/storage/perfschema/table_session_variables.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -141,7 +141,7 @@ int table_session_variables::rnd_pos(const void *pos)
     return HA_ERR_RECORD_DELETED;
 
   set_position(pos);
-  DBUG_ASSERT(m_pos.m_index < m_sysvar_cache.size());
+  assert(m_pos.m_index < m_sysvar_cache.size());
 
   if (m_sysvar_cache.is_materialized())
   {
@@ -178,7 +178,7 @@ ::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
@@ -194,7 +194,7 @@ ::read_row_values(TABLE *table,
         m_row.m_variable_value.set_field(f);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_session_variables.h b/storage/perfschema/table_session_variables.h
index 576bf73edbb..a32b7483bce 100644
--- a/storage/perfschema/table_session_variables.h
+++ b/storage/perfschema/table_session_variables.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
 
   This 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_setup_actors.cc b/storage/perfschema/table_setup_actors.cc
index 9b561949d8c..f1bc33d6e85 100644
--- a/storage/perfschema/table_setup_actors.cc
+++ b/storage/perfschema/table_setup_actors.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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,7 +129,7 @@ int table_setup_actors::write_row(TABLE *table, unsigned char *buf,
         history_value= (enum_yes_no) get_field_enum(f);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
@@ -250,7 +250,7 @@ int table_setup_actors::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
 
   for (; (f= *fields) ; fields++)
   {
@@ -274,7 +274,7 @@ int table_setup_actors::read_row_values(TABLE *table,
         set_field_enum(f, (*m_row.m_history_ptr) ? ENUM_YES : ENUM_NO);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
@@ -316,7 +316,7 @@ int table_setup_actors::update_row_values(TABLE *table,
         *m_row.m_history_ptr= (value == ENUM_YES) ? true : false;
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
@@ -329,7 +329,7 @@ int table_setup_actors::delete_row_values(TABLE *table,
                                           const unsigned char *buf,
                                           Field **fields)
 {
-  DBUG_ASSERT(m_row_exists);
+  assert(m_row_exists);
 
   CHARSET_INFO *cs= &my_charset_utf8_bin;
   String user(m_row.m_username, m_row.m_username_length, cs);
diff --git a/storage/perfschema/table_setup_actors.h b/storage/perfschema/table_setup_actors.h
index 9f8a30c3efe..dd9d339c370 100644
--- a/storage/perfschema/table_setup_actors.h
+++ b/storage/perfschema/table_setup_actors.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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_setup_consumers.cc b/storage/perfschema/table_setup_consumers.cc
index 9ba5231c84a..7f5cbbce807 100644
--- a/storage/perfschema/table_setup_consumers.cc
+++ b/storage/perfschema/table_setup_consumers.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -211,7 +211,7 @@ int table_setup_consumers::rnd_next(void)
 int table_setup_consumers::rnd_pos(const void *pos)
 {
   set_position(pos);
-  DBUG_ASSERT(m_pos.m_index < COUNT_SETUP_CONSUMERS);
+  assert(m_pos.m_index < COUNT_SETUP_CONSUMERS);
   m_row= &all_setup_consumers_data[m_pos.m_index];
   return 0;
 }
@@ -223,11 +223,11 @@ int table_setup_consumers::read_row_values(TABLE *table,
 {
   Field *f;
 
-  DBUG_ASSERT(m_row);
+  assert(m_row);
 
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 0);
+  assert(table->s->null_bytes == 0);
 
   for (; (f= *fields) ; fields++)
   {
@@ -242,7 +242,7 @@ int table_setup_consumers::read_row_values(TABLE *table,
         set_field_enum(f, (*m_row->m_enabled_ptr) ? ENUM_YES : ENUM_NO);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
@@ -258,7 +258,7 @@ int table_setup_consumers::update_row_values(TABLE *table,
   Field *f;
   enum_yes_no value;
 
-  DBUG_ASSERT(m_row);
+  assert(m_row);
 
   for (; (f= *fields) ; fields++)
   {
@@ -275,7 +275,7 @@ int table_setup_consumers::update_row_values(TABLE *table,
         break;
       }
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_setup_consumers.h b/storage/perfschema/table_setup_consumers.h
index c1d1ba412ca..29df92accdc 100644
--- a/storage/perfschema/table_setup_consumers.h
+++ b/storage/perfschema/table_setup_consumers.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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_setup_instruments.cc b/storage/perfschema/table_setup_instruments.cc
index d21c263d427..960b3fd7a54 100644
--- a/storage/perfschema/table_setup_instruments.cc
+++ b/storage/perfschema/table_setup_instruments.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -276,7 +276,7 @@ int table_setup_instruments::read_row_values(TABLE *table,
 {
   Field *f;
 
-  DBUG_ASSERT(table->s->null_bytes == 0);
+  assert(table->s->null_bytes == 0);
 
   /*
     The row always exist, the instrument classes
@@ -299,7 +299,7 @@ int table_setup_instruments::read_row_values(TABLE *table,
         set_field_enum(f, m_row.m_instr_class->m_timed ? ENUM_YES : ENUM_NO);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
@@ -340,7 +340,7 @@ int table_setup_instruments::update_row_values(TABLE *table,
         }
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
@@ -384,7 +384,7 @@ int table_setup_instruments::update_row_values(TABLE *table,
       update_metadata_derived_flags();
       break;
     default:
-      DBUG_ASSERT(false);
+      assert(false);
       break;
   }
 
diff --git a/storage/perfschema/table_setup_instruments.h b/storage/perfschema/table_setup_instruments.h
index 4dc3c805f31..233fb85fcde 100644
--- a/storage/perfschema/table_setup_instruments.h
+++ b/storage/perfschema/table_setup_instruments.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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_setup_objects.cc b/storage/perfschema/table_setup_objects.cc
index 20b7c95dd5e..8d36cf3e645 100644
--- a/storage/perfschema/table_setup_objects.cc
+++ b/storage/perfschema/table_setup_objects.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -142,7 +142,7 @@ int table_setup_objects::write_row(TABLE *table, unsigned char *buf,
         timed_value= (enum_yes_no) get_field_enum(f);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
@@ -259,7 +259,7 @@ int table_setup_objects::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
@@ -292,7 +292,7 @@ int table_setup_objects::read_row_values(TABLE *table,
         set_field_enum(f, (*m_row.m_timed_ptr) ? ENUM_YES : ENUM_NO);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
@@ -334,7 +334,7 @@ int table_setup_objects::update_row_values(TABLE *table,
         *m_row.m_timed_ptr= (value == ENUM_YES) ? true : false;
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
@@ -347,7 +347,7 @@ int table_setup_objects::delete_row_values(TABLE *table,
                                            const unsigned char *buf,
                                            Field **fields)
 {
-  DBUG_ASSERT(m_row_exists);
+  assert(m_row_exists);
 
   CHARSET_INFO *cs= &my_charset_utf8_bin;
   enum_object_type object_type= OBJECT_TYPE_TABLE;
diff --git a/storage/perfschema/table_setup_objects.h b/storage/perfschema/table_setup_objects.h
index 0310f4b7d99..ec21e018a5e 100644
--- a/storage/perfschema/table_setup_objects.h
+++ b/storage/perfschema/table_setup_objects.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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_setup_timers.cc b/storage/perfschema/table_setup_timers.cc
index e95fb875521..73521e7ed33 100644
--- a/storage/perfschema/table_setup_timers.cc
+++ b/storage/perfschema/table_setup_timers.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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,7 +149,7 @@ int table_setup_timers::rnd_next(void)
 int table_setup_timers::rnd_pos(const void *pos)
 {
   set_position(pos);
-  DBUG_ASSERT(m_pos.m_index < COUNT_SETUP_TIMERS);
+  assert(m_pos.m_index < COUNT_SETUP_TIMERS);
   m_row= &all_setup_timers_data[m_pos.m_index];
   return 0;
 }
@@ -161,10 +161,10 @@ int table_setup_timers::read_row_values(TABLE *table,
 {
   Field *f;
 
-  DBUG_ASSERT(m_row);
+  assert(m_row);
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 0);
+  assert(table->s->null_bytes == 0);
 
   for (; (f= *fields) ; fields++)
   {
@@ -179,7 +179,7 @@ int table_setup_timers::read_row_values(TABLE *table,
         set_field_enum(f, *(m_row->m_timer_name_ptr));
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
@@ -195,7 +195,7 @@ int table_setup_timers::update_row_values(TABLE *table,
   Field *f;
   longlong value;
 
-  DBUG_ASSERT(m_row);
+  assert(m_row);
 
   for (; (f= *fields) ; fields++)
   {
@@ -213,7 +213,7 @@ int table_setup_timers::update_row_values(TABLE *table,
           return HA_ERR_WRONG_COMMAND;
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_setup_timers.h b/storage/perfschema/table_setup_timers.h
index cbfb9b27923..ddbcfb7cda3 100644
--- a/storage/perfschema/table_setup_timers.h
+++ b/storage/perfschema/table_setup_timers.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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_socket_instances.cc b/storage/perfschema/table_socket_instances.cc
index 59db5a10a63..1ea6b9cc33b 100644
--- a/storage/perfschema/table_socket_instances.cc
+++ b/storage/perfschema/table_socket_instances.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -201,7 +201,7 @@ int table_socket_instances::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
@@ -235,7 +235,7 @@ int table_socket_instances::read_row_values(TABLE *table,
         set_field_enum(f, m_row.m_state);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_socket_instances.h b/storage/perfschema/table_socket_instances.h
index 923a9afc4a9..cf7e44b1fcf 100644
--- a/storage/perfschema/table_socket_instances.h
+++ b/storage/perfschema/table_socket_instances.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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_socket_summary_by_event_name.cc b/storage/perfschema/table_socket_summary_by_event_name.cc
index 333e35731f6..623b57a6a76 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -269,7 +269,7 @@ int table_socket_summary_by_event_name::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 0);
+  assert(table->s->null_bytes == 0);
 
   for (; (f= *fields) ; fields++)
   {
@@ -351,7 +351,7 @@ int table_socket_summary_by_event_name::read_row_values(TABLE *table,
         break;
 
       default:
-        DBUG_ASSERT(false);
+        assert(false);
         break;
       }
     } // if
diff --git a/storage/perfschema/table_socket_summary_by_event_name.h b/storage/perfschema/table_socket_summary_by_event_name.h
index 5c537b495c7..2f2d2b03e45 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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_socket_summary_by_instance.cc b/storage/perfschema/table_socket_summary_by_instance.cc
index 1f45e516504..a77324a40ab 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -287,7 +287,7 @@ int table_socket_summary_by_instance::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 0);
+  assert(table->s->null_bytes == 0);
 
   for (; (f= *fields) ; fields++)
   {
@@ -372,7 +372,7 @@ int table_socket_summary_by_instance::read_row_values(TABLE *table,
         set_field_ulonglong(f, m_row.m_io_stat.m_misc.m_waits.m_max);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
         break;
       }
     }
diff --git a/storage/perfschema/table_socket_summary_by_instance.h b/storage/perfschema/table_socket_summary_by_instance.h
index 45fa1b74557..87ca63ee01b 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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_status_by_account.cc b/storage/perfschema/table_status_by_account.cc
index 199475dc8b2..8aedb083cd0 100644
--- a/storage/perfschema/table_status_by_account.cc
+++ b/storage/perfschema/table_status_by_account.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -189,7 +189,7 @@ table_status_by_account::rnd_pos(const void *pos)
     return HA_ERR_END_OF_FILE;
 
   set_position(pos);
-  DBUG_ASSERT(m_pos.m_index_1 < global_account_container.get_row_count());
+  assert(m_pos.m_index_1 < global_account_container.get_row_count());
 
   PFS_account *pfs_account= global_account_container.get(m_pos.m_index_1);
 
@@ -241,7 +241,7 @@ ::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
@@ -261,7 +261,7 @@ ::read_row_values(TABLE *table,
         m_row.m_variable_value.set_field(f);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_status_by_account.h b/storage/perfschema/table_status_by_account.h
index 401a184d8f1..19a4f1db1de 100644
--- a/storage/perfschema/table_status_by_account.h
+++ b/storage/perfschema/table_status_by_account.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
 
   This 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_status_by_host.cc b/storage/perfschema/table_status_by_host.cc
index 289cfc3e444..8188ccd3695 100644
--- a/storage/perfschema/table_status_by_host.cc
+++ b/storage/perfschema/table_status_by_host.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -185,7 +185,7 @@ table_status_by_host::rnd_pos(const void *pos)
     return HA_ERR_END_OF_FILE;
 
   set_position(pos);
-  DBUG_ASSERT(m_pos.m_index_1 < global_host_container.get_row_count());
+  assert(m_pos.m_index_1 < global_host_container.get_row_count());
 
   PFS_host *pfs_host= global_host_container.get(m_pos.m_index_1);
 
@@ -237,7 +237,7 @@ ::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
@@ -256,7 +256,7 @@ ::read_row_values(TABLE *table,
         m_row.m_variable_value.set_field(f);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_status_by_host.h b/storage/perfschema/table_status_by_host.h
index e4c6bf256ef..f1c92268b02 100644
--- a/storage/perfschema/table_status_by_host.h
+++ b/storage/perfschema/table_status_by_host.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
 
   This 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_status_by_thread.cc b/storage/perfschema/table_status_by_thread.cc
index c4f62b62199..5b52e5f167c 100644
--- a/storage/perfschema/table_status_by_thread.cc
+++ b/storage/perfschema/table_status_by_thread.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -178,7 +178,7 @@ table_status_by_thread::rnd_pos(const void *pos)
     return HA_ERR_RECORD_DELETED;
 
   set_position(pos);
-  DBUG_ASSERT(m_pos.m_index_1 < global_thread_container.get_row_count());
+  assert(m_pos.m_index_1 < global_thread_container.get_row_count());
 
   PFS_thread *pfs_thread= global_thread_container.get(m_pos.m_index_1);
   /*
@@ -231,7 +231,7 @@ ::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
@@ -250,7 +250,7 @@ ::read_row_values(TABLE *table,
         m_row.m_variable_value.set_field(f);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_status_by_thread.h b/storage/perfschema/table_status_by_thread.h
index f8de21dc41e..90a1735d1e2 100644
--- a/storage/perfschema/table_status_by_thread.h
+++ b/storage/perfschema/table_status_by_thread.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
 
   This 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_status_by_user.cc b/storage/perfschema/table_status_by_user.cc
index 25f87a87faf..545f96ff270 100644
--- a/storage/perfschema/table_status_by_user.cc
+++ b/storage/perfschema/table_status_by_user.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -186,7 +186,7 @@ table_status_by_user::rnd_pos(const void *pos)
     return HA_ERR_END_OF_FILE;
 
   set_position(pos);
-  DBUG_ASSERT(m_pos.m_index_1 < global_user_container.get_row_count());
+  assert(m_pos.m_index_1 < global_user_container.get_row_count());
 
   PFS_user *pfs_user= global_user_container.get(m_pos.m_index_1);
 
@@ -238,7 +238,7 @@ ::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
@@ -257,7 +257,7 @@ ::read_row_values(TABLE *table,
         m_row.m_variable_value.set_field(f);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_status_by_user.h b/storage/perfschema/table_status_by_user.h
index 6b4a67b4e3f..2fe2cc24407 100644
--- a/storage/perfschema/table_status_by_user.h
+++ b/storage/perfschema/table_status_by_user.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
 
   This 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_sync_instances.cc b/storage/perfschema/table_sync_instances.cc
index 2b416e6436a..85f126fc10f 100644
--- a/storage/perfschema/table_sync_instances.cc
+++ b/storage/perfschema/table_sync_instances.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -175,7 +175,7 @@ int table_mutex_instances::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
@@ -197,7 +197,7 @@ int table_mutex_instances::read_row_values(TABLE *table,
           f->set_null();
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
@@ -353,7 +353,7 @@ int table_rwlock_instances::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
@@ -378,7 +378,7 @@ int table_rwlock_instances::read_row_values(TABLE *table,
         set_field_ulong(f, m_row.m_readers);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
@@ -510,7 +510,7 @@ int table_cond_instances::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 0);
+  assert(table->s->null_bytes == 0);
 
   for (; (f= *fields) ; fields++)
   {
@@ -525,7 +525,7 @@ int table_cond_instances::read_row_values(TABLE *table,
         set_field_ulonglong(f, (intptr) m_row.m_identity);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_sync_instances.h b/storage/perfschema/table_sync_instances.h
index b60a0b89f3b..0089628c55a 100644
--- a/storage/perfschema/table_sync_instances.h
+++ b/storage/perfschema/table_sync_instances.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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_table_handles.cc b/storage/perfschema/table_table_handles.cc
index e47debcb87c..230ce441382 100644
--- a/storage/perfschema/table_table_handles.cc
+++ b/storage/perfschema/table_table_handles.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -215,7 +215,7 @@ int table_table_handles::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
@@ -245,7 +245,7 @@ int table_table_handles::read_row_values(TABLE *table,
         set_field_lock_type(f, m_row.m_external_lock);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_table_handles.h b/storage/perfschema/table_table_handles.h
index 0f1f76f4846..3b738d89413 100644
--- a/storage/perfschema/table_table_handles.h
+++ b/storage/perfschema/table_table_handles.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
 
   This 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_threads.cc b/storage/perfschema/table_threads.cc
index e9e66dd5092..81a43718285 100644
--- a/storage/perfschema/table_threads.cc
+++ b/storage/perfschema/table_threads.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -270,7 +270,7 @@ int table_threads::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 2);
+  assert(table->s->null_bytes == 2);
   buf[0]= 0;
   buf[1]= 0;
 
@@ -343,7 +343,7 @@ int table_threads::read_row_values(TABLE *table,
            server is updating this column for those threads. To prevent this
            kind of issue, an assert is added.
          */
-        DBUG_ASSERT(m_row.m_processlist_state_length <= f->char_length());
+        assert(m_row.m_processlist_state_length <= f->char_length());
         if (m_row.m_processlist_state_length > 0)
           set_field_varchar_utf8(f, m_row.m_processlist_state_ptr,
                                  m_row.m_processlist_state_length);
@@ -386,7 +386,7 @@ int table_threads::read_row_values(TABLE *table,
           f->set_null();
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
@@ -433,7 +433,7 @@ int table_threads::update_row_values(TABLE *table,
       case 16: /* THREAD_OS_ID */
         return HA_ERR_WRONG_COMMAND;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_threads.h b/storage/perfschema/table_threads.h
index 408734850f9..16d8813d2cc 100644
--- a/storage/perfschema/table_threads.h
+++ b/storage/perfschema/table_threads.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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_tiws_by_index_usage.cc b/storage/perfschema/table_tiws_by_index_usage.cc
index 97f40110d5a..c98eda01cac 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -364,7 +364,7 @@ void table_tiws_by_index_usage::make_row(PFS_table_share *pfs_share,
   PFS_table_share_index *pfs_index;
   pfs_optimistic_state lock;
 
-  DBUG_ASSERT(index <= MAX_INDEXES);
+  assert(index <= MAX_INDEXES);
 
   m_row_exists= false;
 
@@ -405,7 +405,7 @@ int table_tiws_by_index_usage::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
@@ -526,7 +526,7 @@ int table_tiws_by_index_usage::read_row_values(TABLE *table,
         set_field_ulonglong(f, m_row.m_stat.m_delete.m_max);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_tiws_by_index_usage.h b/storage/perfschema/table_tiws_by_index_usage.h
index 1a130cd9c04..ec55ce86b2d 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, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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_tiws_by_table.cc b/storage/perfschema/table_tiws_by_table.cc
index 163541ad35d..42bf2593e38 100644
--- a/storage/perfschema/table_tiws_by_table.cc
+++ b/storage/perfschema/table_tiws_by_table.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -364,7 +364,7 @@ int table_tiws_by_table::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
@@ -484,7 +484,7 @@ int table_tiws_by_table::read_row_values(TABLE *table,
         set_field_ulonglong(f, m_row.m_stat.m_delete.m_max);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_tiws_by_table.h b/storage/perfschema/table_tiws_by_table.h
index 5413d0c812f..15f2aa7df20 100644
--- a/storage/perfschema/table_tiws_by_table.h
+++ b/storage/perfschema/table_tiws_by_table.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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_tlws_by_table.cc b/storage/perfschema/table_tlws_by_table.cc
index f76b030a07d..f3d62da3478 100644
--- a/storage/perfschema/table_tlws_by_table.cc
+++ b/storage/perfschema/table_tlws_by_table.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -514,7 +514,7 @@ int table_tlws_by_table::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
@@ -735,7 +735,7 @@ int table_tlws_by_table::read_row_values(TABLE *table,
         break;
 
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_tlws_by_table.h b/storage/perfschema/table_tlws_by_table.h
index ee2cd04e27b..0add6ac5a6c 100644
--- a/storage/perfschema/table_tlws_by_table.h
+++ b/storage/perfschema/table_tlws_by_table.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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_users.cc b/storage/perfschema/table_users.cc
index d998a962688..99d681b8b8b 100644
--- a/storage/perfschema/table_users.cc
+++ b/storage/perfschema/table_users.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -144,7 +144,7 @@ int table_users::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
@@ -161,7 +161,7 @@ int table_users::read_row_values(TABLE *table,
         m_row.m_connection_stat.set_field(f->field_index - 1, f);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_users.h b/storage/perfschema/table_users.h
index 26bb66e9fa6..d8d68f513b7 100644
--- a/storage/perfschema/table_users.h
+++ b/storage/perfschema/table_users.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
 
   This 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_uvar_by_thread.cc b/storage/perfschema/table_uvar_by_thread.cc
index c74f9369b00..d153851a999 100644
--- a/storage/perfschema/table_uvar_by_thread.cc
+++ b/storage/perfschema/table_uvar_by_thread.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -105,7 +105,7 @@ void User_variables::materialize(PFS_thread *pfs, THD *thd)
     /* Copy VARIABLE_NAME */
     const char *name= sql_uvar->entry_name.ptr();
     size_t name_length= sql_uvar->entry_name.length();
-    DBUG_ASSERT(name_length <= sizeof(pfs_uvar.m_name));
+    assert(name_length <= sizeof(pfs_uvar.m_name));
     pfs_uvar.m_name.make_row(name, name_length);
 
     /* Copy VARIABLE_VALUE */
@@ -307,11 +307,11 @@ ::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
-  DBUG_ASSERT(m_row.m_variable_name != NULL);
-  DBUG_ASSERT(m_row.m_variable_value != NULL);
+  assert(m_row.m_variable_name != NULL);
+  assert(m_row.m_variable_value != NULL);
 
   for (; (f= *fields) ; fields++)
   {
@@ -340,7 +340,7 @@ ::read_row_values(TABLE *table,
         }
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_uvar_by_thread.h b/storage/perfschema/table_uvar_by_thread.h
index 6cd39b4fcd6..c3a541536e8 100644
--- a/storage/perfschema/table_uvar_by_thread.h
+++ b/storage/perfschema/table_uvar_by_thread.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -77,7 +77,7 @@ class User_variables
 
   bool is_materialized(PFS_thread *pfs)
   {
-    DBUG_ASSERT(pfs != NULL);
+    assert(pfs != NULL);
     if (m_pfs != pfs)
       return false;
     if (m_thread_internal_id != pfs->m_thread_internal_id)
diff --git a/storage/perfschema/table_variables_by_thread.cc b/storage/perfschema/table_variables_by_thread.cc
index 702bfd07d02..b339ed7af7c 100644
--- a/storage/perfschema/table_variables_by_thread.cc
+++ b/storage/perfschema/table_variables_by_thread.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
@@ -163,7 +163,7 @@ table_variables_by_thread::rnd_pos(const void *pos)
     return HA_ERR_RECORD_DELETED;
 
   set_position(pos);
-  DBUG_ASSERT(m_pos.m_index_1 < global_thread_container.get_row_count());
+  assert(m_pos.m_index_1 < global_thread_container.get_row_count());
 
   PFS_thread *pfs_thread= global_thread_container.get(m_pos.m_index_1);
     /*
@@ -221,7 +221,7 @@ ::read_row_values(TABLE *table,
     return HA_ERR_RECORD_DELETED;
 
   /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
+  assert(table->s->null_bytes == 1);
   buf[0]= 0;
 
   for (; (f= *fields) ; fields++)
@@ -240,7 +240,7 @@ ::read_row_values(TABLE *table,
         m_row.m_variable_value.set_field(f);
         break;
       default:
-        DBUG_ASSERT(false);
+        assert(false);
       }
     }
   }
diff --git a/storage/perfschema/table_variables_by_thread.h b/storage/perfschema/table_variables_by_thread.h
index d628707f9b4..5143067adbb 100644
--- a/storage/perfschema/table_variables_by_thread.h
+++ b/storage/perfschema/table_variables_by_thread.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
 
   This 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/CMakeLists.txt b/storage/perfschema/unittest/CMakeLists.txt
index f43d777d836..5577930617b 100644
--- a/storage/perfschema/unittest/CMakeLists.txt
+++ b/storage/perfschema/unittest/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2021, Oracle and/or its affiliates.
 #
 # This 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 2e355bafb6c..197eba97365 100644
--- a/storage/perfschema/unittest/conf.txt
+++ b/storage/perfschema/unittest/conf.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2021, Oracle and/or its affiliates.
 #
 # This 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 5fc2ea726a3..e90e6f63d15 100644
--- a/storage/perfschema/unittest/pfs-t.cc
+++ b/storage/perfschema/unittest/pfs-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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 e43ab80e6cc..562a273eaba 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, 2017, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
 
   This 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 5be14bf65c6..c852101b044 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, 2017, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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 7686c8db4ee..ad40de1ec77 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, 2017, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
 
   This 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 6636b8a3c55..086ff15f97e 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, 2017, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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 1446be96a57..0d23555939d 100644
--- a/storage/perfschema/unittest/pfs_instr-t.cc
+++ b/storage/perfschema/unittest/pfs_instr-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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 5cd8907bf0e..4134c36303b 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, 2017, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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 27ab065d314..7a33453236a 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, 2017, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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 0bd55f50ddf..3654e3e2942 100644
--- a/storage/perfschema/unittest/pfs_misc-t.cc
+++ b/storage/perfschema/unittest/pfs_misc-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
 
   This 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 8ef11371519..6fc84753699 100644
--- a/storage/perfschema/unittest/pfs_noop-t.cc
+++ b/storage/perfschema/unittest/pfs_noop-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
 
   This 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_server_stubs.cc b/storage/perfschema/unittest/pfs_server_stubs.cc
index 9b62de0095c..13f4223e8d8 100644
--- a/storage/perfschema/unittest/pfs_server_stubs.cc
+++ b/storage/perfschema/unittest/pfs_server_stubs.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights
+/* Copyright (c) 2010, 2021, 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 e1e1595df38..2ba7e89ca71 100644
--- a/storage/perfschema/unittest/pfs_timer-t.cc
+++ b/storage/perfschema/unittest/pfs_timer-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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 b6d805f9710..422e88605eb 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, 2017, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
 
   This 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 bfb06b4e0d5..ac2715e9268 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, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
 
   This 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 8f8594f1cc7..2af79a2034e 100644
--- a/storage/perfschema/unittest/stub_pfs_defaults.h
+++ b/storage/perfschema/unittest/stub_pfs_defaults.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
 
   This 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 8a18259203b..3b28a0641cd 100644
--- a/storage/perfschema/unittest/stub_pfs_global.h
+++ b/storage/perfschema/unittest/stub_pfs_global.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This 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,7 +37,7 @@ void *pfs_malloc(PFS_builtin_memory_class *klass, size_t size, myf)
   /*
     Catch non initialized sizing parameter in the unit tests.
   */
-  DBUG_ASSERT(size <= 100*1024*1024);
+  assert(size <= 100*1024*1024);
 
   if (stub_alloc_always_fails)
     return NULL;
diff --git a/storage/perfschema/unittest/stub_print_error.h b/storage/perfschema/unittest/stub_print_error.h
index 26a439a54ab..38cdd91cfbd 100644
--- a/storage/perfschema/unittest/stub_print_error.h
+++ b/storage/perfschema/unittest/stub_print_error.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2.0,
-- 
2.30.9