[Commits] 00ed367: MDEV-4262 - P_S discovery

svoj at mariadb.org svoj at mariadb.org
Mon Jul 7 13:42:40 EEST 2014


revision-id: 00ed36700addfbce91940223cce4ccd6ee5823a1
parent(s): f37f19a6c790100cc2ae5f483ba4db34a517f0ae
committer: Sergey Vojtovich
branch nick: 10.1
timestamp: 2014-07-07 14:32:13 +0400
message:

MDEV-4262 - P_S discovery

Discover P_S tables automatically.

Most of this patch is code clean-up:
- removed tests and code responsible for P_S tables correctness verification
- always return error from ha_perfschema::create()
- install/upgrade scripts won't create P_S tables anymore

---
 .../suite/perfschema/include/upgrade_check.inc     |    1 -
 .../suite/perfschema/r/pfs_upgrade_event.result    |   53 -
 .../suite/perfschema/r/pfs_upgrade_func.result     |   53 -
 .../suite/perfschema/r/pfs_upgrade_proc.result     |   53 -
 .../suite/perfschema/r/pfs_upgrade_table.result    |   53 -
 .../suite/perfschema/r/pfs_upgrade_view.result     |   53 -
 .../perfschema/r/tampered_perfschema_table1.result |    6 -
 .../t/tampered_perfschema_table1-master.opt        |    1 -
 .../perfschema/t/tampered_perfschema_table1.test   |   25 -
 scripts/mysql_performance_tables.sql               | 1424 --------------------
 sql/mysqld.cc                                      |    8 -
 storage/perfschema/CMakeLists.txt                  |    1 -
 storage/perfschema/ha_perfschema.cc                |   35 +-
 storage/perfschema/pfs_check.cc                    |   62 -
 storage/perfschema/pfs_engine_table.cc             |  133 +-
 storage/perfschema/pfs_engine_table.h              |   12 +-
 storage/perfschema/pfs_server.h                    |    2 -
 storage/perfschema/table_accounts.cc               |   35 +-
 storage/perfschema/table_accounts.h                |    2 -
 .../table_esgs_by_account_by_event_name.cc         |   59 +-
 .../table_esgs_by_account_by_event_name.h          |    2 -
 .../perfschema/table_esgs_by_host_by_event_name.cc |   53 +-
 .../perfschema/table_esgs_by_host_by_event_name.h  |    2 -
 .../table_esgs_by_thread_by_event_name.cc          |   53 +-
 .../table_esgs_by_thread_by_event_name.h           |    2 -
 .../perfschema/table_esgs_by_user_by_event_name.cc |   53 +-
 .../perfschema/table_esgs_by_user_by_event_name.h  |    2 -
 .../perfschema/table_esgs_global_by_event_name.cc  |   47 +-
 .../perfschema/table_esgs_global_by_event_name.h   |    2 -
 .../table_esms_by_account_by_event_name.cc         |  173 +--
 .../table_esms_by_account_by_event_name.h          |    2 -
 storage/perfschema/table_esms_by_digest.cc         |  185 +--
 storage/perfschema/table_esms_by_digest.h          |    2 -
 .../perfschema/table_esms_by_host_by_event_name.cc |  167 +--
 .../perfschema/table_esms_by_host_by_event_name.h  |    2 -
 .../table_esms_by_thread_by_event_name.cc          |  167 +--
 .../table_esms_by_thread_by_event_name.h           |    2 -
 .../perfschema/table_esms_by_user_by_event_name.cc |  167 +--
 .../perfschema/table_esms_by_user_by_event_name.h  |    2 -
 .../perfschema/table_esms_global_by_event_name.cc  |  161 +--
 .../perfschema/table_esms_global_by_event_name.h   |    2 -
 storage/perfschema/table_events_stages.cc          |   97 +-
 storage/perfschema/table_events_stages.h           |    6 -
 storage/perfschema/table_events_statements.cc      |  337 ++---
 storage/perfschema/table_events_statements.h       |    6 -
 storage/perfschema/table_events_waits.cc           |  169 +--
 storage/perfschema/table_events_waits.h            |    6 -
 storage/perfschema/table_events_waits_summary.cc   |   53 +-
 storage/perfschema/table_events_waits_summary.h    |    2 -
 .../table_ews_by_account_by_event_name.cc          |   59 +-
 .../table_ews_by_account_by_event_name.h           |    2 -
 .../perfschema/table_ews_by_host_by_event_name.cc  |   53 +-
 .../perfschema/table_ews_by_host_by_event_name.h   |    2 -
 .../table_ews_by_thread_by_event_name.cc           |   53 +-
 .../perfschema/table_ews_by_thread_by_event_name.h |    2 -
 .../perfschema/table_ews_by_user_by_event_name.cc  |   53 +-
 .../perfschema/table_ews_by_user_by_event_name.h   |    2 -
 .../perfschema/table_ews_global_by_event_name.cc   |   47 +-
 .../perfschema/table_ews_global_by_event_name.h    |    2 -
 storage/perfschema/table_file_instances.cc         |   29 +-
 storage/perfschema/table_file_instances.h          |    2 -
 storage/perfschema/table_file_summary.cc           |  372 -----
 storage/perfschema/table_file_summary.h            |  151 ---
 .../perfschema/table_file_summary_by_event_name.cc |  155 +--
 .../perfschema/table_file_summary_by_event_name.h  |    2 -
 .../perfschema/table_file_summary_by_instance.cc   |  167 +--
 .../perfschema/table_file_summary_by_instance.h    |    2 -
 storage/perfschema/table_host_cache.cc             |  185 +--
 storage/perfschema/table_host_cache.h              |    2 -
 storage/perfschema/table_hosts.cc                  |   29 +-
 storage/perfschema/table_hosts.h                   |    2 -
 storage/perfschema/table_os_global_by_type.cc      |   59 +-
 storage/perfschema/table_os_global_by_type.h       |    2 -
 storage/perfschema/table_performance_timers.cc     |   36 +-
 storage/perfschema/table_performance_timers.h      |    2 -
 .../table_session_account_connect_attrs.cc         |    8 +-
 storage/perfschema/table_session_connect.cc        |   27 -
 storage/perfschema/table_session_connect.h         |    2 -
 storage/perfschema/table_session_connect_attrs.cc  |    8 +-
 storage/perfschema/table_setup_actors.cc           |   29 +-
 storage/perfschema/table_setup_actors.h            |    2 -
 storage/perfschema/table_setup_consumers.cc        |   23 +-
 storage/perfschema/table_setup_consumers.h         |    2 -
 storage/perfschema/table_setup_instruments.cc      |   29 +-
 storage/perfschema/table_setup_instruments.h       |    2 -
 storage/perfschema/table_setup_objects.cc          |   41 +-
 storage/perfschema/table_setup_objects.h           |    2 -
 storage/perfschema/table_setup_timers.cc           |   24 +-
 storage/perfschema/table_setup_timers.h            |    2 -
 storage/perfschema/table_socket_instances.cc       |   53 +-
 storage/perfschema/table_socket_instances.h        |    2 -
 .../table_socket_summary_by_event_name.cc          |  155 +--
 .../table_socket_summary_by_event_name.h           |    2 -
 .../perfschema/table_socket_summary_by_instance.cc |  161 +--
 .../perfschema/table_socket_summary_by_instance.h  |    2 -
 storage/perfschema/table_sync_instances.cc         |   87 +-
 storage/perfschema/table_sync_instances.h          |    6 -
 storage/perfschema/table_threads.cc                |   95 +-
 storage/perfschema/table_threads.h                 |    2 -
 storage/perfschema/table_tiws_by_index_usage.cc    |  245 +---
 storage/perfschema/table_tiws_by_index_usage.h     |    2 -
 storage/perfschema/table_tiws_by_table.cc          |  239 +---
 storage/perfschema/table_tiws_by_table.h           |    2 -
 storage/perfschema/table_tlws_by_table.cc          |  449 +-----
 storage/perfschema/table_tlws_by_table.h           |    2 -
 storage/perfschema/table_users.cc                  |   29 +-
 storage/perfschema/table_users.h                   |    2 -
 107 files changed, 887 insertions(+), 6316 deletions(-)

diff --git a/mysql-test/suite/perfschema/include/upgrade_check.inc b/mysql-test/suite/perfschema/include/upgrade_check.inc
index 52d4cfd..1532de8 100644
--- a/mysql-test/suite/perfschema/include/upgrade_check.inc
+++ b/mysql-test/suite/perfschema/include/upgrade_check.inc
@@ -3,7 +3,6 @@
 #
 
 --source include/count_sessions.inc
---error 1
 --exec $MYSQL_UPGRADE --skip-verbose --force > $out_file 2> $err_file
 --source include/wait_until_count_sessions.inc
 
diff --git a/mysql-test/suite/perfschema/r/pfs_upgrade_event.result b/mysql-test/suite/perfschema/r/pfs_upgrade_event.result
index cbd684a..6397ef7 100644
--- a/mysql-test/suite/perfschema/r/pfs_upgrade_event.result
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade_event.result
@@ -3,59 +3,6 @@ drop event if exists test.user_event;
 create event test.user_event on schedule every 1 day do
 select "not supposed to be here";
 update mysql.event set db='performance_schema' where name='user_event';
-ERROR 1050 (42S01) at line ###: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line ###: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line ###: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'host_cache' already exists
-ERROR 1050 (42S01) at line ###: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line ###: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line ###: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line ###: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line ###: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line ###: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line ###: Table 'threads' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'hosts' already exists
-ERROR 1050 (42S01) at line ###: Table 'users' already exists
-ERROR 1050 (42S01) at line ###: Table 'accounts' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_digest' already exists
-ERROR 1050 (42S01) at line ###: Table 'session_connect_attrs' already exists
-ERROR 1050 (42S01) at line ###: Table 'session_account_connect_attrs' already exists
-FATAL ERROR: Upgrade failed
 select name from mysql.event where db='performance_schema';
 name
 user_event
diff --git a/mysql-test/suite/perfschema/r/pfs_upgrade_func.result b/mysql-test/suite/perfschema/r/pfs_upgrade_func.result
index 6978e1e..e03b526 100644
--- a/mysql-test/suite/perfschema/r/pfs_upgrade_func.result
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade_func.result
@@ -3,59 +3,6 @@ drop function if exists test.user_func;
 create function test.user_func() returns integer
 return 0;
 update mysql.proc set db='performance_schema' where name='user_func';
-ERROR 1050 (42S01) at line ###: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line ###: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line ###: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'host_cache' already exists
-ERROR 1050 (42S01) at line ###: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line ###: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line ###: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line ###: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line ###: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line ###: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line ###: Table 'threads' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'hosts' already exists
-ERROR 1050 (42S01) at line ###: Table 'users' already exists
-ERROR 1050 (42S01) at line ###: Table 'accounts' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_digest' already exists
-ERROR 1050 (42S01) at line ###: Table 'session_connect_attrs' already exists
-ERROR 1050 (42S01) at line ###: Table 'session_account_connect_attrs' already exists
-FATAL ERROR: Upgrade failed
 select name from mysql.proc where db='performance_schema';
 name
 user_func
diff --git a/mysql-test/suite/perfschema/r/pfs_upgrade_proc.result b/mysql-test/suite/perfschema/r/pfs_upgrade_proc.result
index f5a13fb..95e0943 100644
--- a/mysql-test/suite/perfschema/r/pfs_upgrade_proc.result
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade_proc.result
@@ -3,59 +3,6 @@ drop procedure if exists test.user_proc;
 create procedure test.user_proc()
 select "Not supposed to be here";
 update mysql.proc set db='performance_schema' where name='user_proc';
-ERROR 1050 (42S01) at line ###: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line ###: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line ###: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'host_cache' already exists
-ERROR 1050 (42S01) at line ###: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line ###: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line ###: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line ###: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line ###: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line ###: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line ###: Table 'threads' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'hosts' already exists
-ERROR 1050 (42S01) at line ###: Table 'users' already exists
-ERROR 1050 (42S01) at line ###: Table 'accounts' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_digest' already exists
-ERROR 1050 (42S01) at line ###: Table 'session_connect_attrs' already exists
-ERROR 1050 (42S01) at line ###: Table 'session_account_connect_attrs' already exists
-FATAL ERROR: Upgrade failed
 select name from mysql.proc where db='performance_schema';
 name
 user_proc
diff --git a/mysql-test/suite/perfschema/r/pfs_upgrade_table.result b/mysql-test/suite/perfschema/r/pfs_upgrade_table.result
index bb5ba70..a5f5ad5 100644
--- a/mysql-test/suite/perfschema/r/pfs_upgrade_table.result
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade_table.result
@@ -5,59 +5,6 @@ use performance_schema;
 show tables like "user_table";
 Tables_in_performance_schema (user_table)
 user_table
-ERROR 1050 (42S01) at line ###: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line ###: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line ###: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'host_cache' already exists
-ERROR 1050 (42S01) at line ###: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line ###: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line ###: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line ###: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line ###: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line ###: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line ###: Table 'threads' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'hosts' already exists
-ERROR 1050 (42S01) at line ###: Table 'users' already exists
-ERROR 1050 (42S01) at line ###: Table 'accounts' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_digest' already exists
-ERROR 1050 (42S01) at line ###: Table 'session_connect_attrs' already exists
-ERROR 1050 (42S01) at line ###: Table 'session_account_connect_attrs' already exists
-FATAL ERROR: Upgrade failed
 show tables like "user_table";
 Tables_in_performance_schema (user_table)
 user_table
diff --git a/mysql-test/suite/perfschema/r/pfs_upgrade_view.result b/mysql-test/suite/perfschema/r/pfs_upgrade_view.result
index f954168..3c6df20 100644
--- a/mysql-test/suite/perfschema/r/pfs_upgrade_view.result
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade_view.result
@@ -5,59 +5,6 @@ use performance_schema;
 show tables like "user_view";
 Tables_in_performance_schema (user_view)
 user_view
-ERROR 1050 (42S01) at line ###: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line ###: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line ###: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'host_cache' already exists
-ERROR 1050 (42S01) at line ###: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line ###: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line ###: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line ###: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line ###: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line ###: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line ###: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line ###: Table 'threads' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line ###: Table 'hosts' already exists
-ERROR 1050 (42S01) at line ###: Table 'users' already exists
-ERROR 1050 (42S01) at line ###: Table 'accounts' already exists
-ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_digest' already exists
-ERROR 1050 (42S01) at line ###: Table 'session_connect_attrs' already exists
-ERROR 1050 (42S01) at line ###: Table 'session_account_connect_attrs' already exists
-FATAL ERROR: Upgrade failed
 show tables like "user_view";
 Tables_in_performance_schema (user_view)
 user_view
diff --git a/mysql-test/suite/perfschema/r/tampered_perfschema_table1.result b/mysql-test/suite/perfschema/r/tampered_perfschema_table1.result
deleted file mode 100644
index e9537e5..0000000
--- a/mysql-test/suite/perfschema/r/tampered_perfschema_table1.result
+++ /dev/null
@@ -1,6 +0,0 @@
-call mtr.add_suppression(
-"Column count of performance_schema.setup_instruments is wrong. "
-"Expected 4, found 3. The table is probably corrupted");
-select * from performance_schema.setup_instruments limit 1;
-ERROR HY000: Native table 'performance_schema'.'setup_instruments' has the wrong structure
-select * from performance_schema.setup_consumers limit 1;
diff --git a/mysql-test/suite/perfschema/t/tampered_perfschema_table1-master.opt b/mysql-test/suite/perfschema/t/tampered_perfschema_table1-master.opt
deleted file mode 100644
index 5f094e6..0000000
--- a/mysql-test/suite/perfschema/t/tampered_perfschema_table1-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-debug=+d,tampered_perfschema_table1
diff --git a/mysql-test/suite/perfschema/t/tampered_perfschema_table1.test b/mysql-test/suite/perfschema/t/tampered_perfschema_table1.test
deleted file mode 100644
index 09e3d3a..0000000
--- a/mysql-test/suite/perfschema/t/tampered_perfschema_table1.test
+++ /dev/null
@@ -1,25 +0,0 @@
-# Tests for PERFORMANCE_SCHEMA
-
-# This test uses error injection,
-# see PFS_engine_table_share::check_all_tables()
-
-# Verify that the server starts even when a performance schema table
-# is corrupted, with an incompatible change.
-# Verify that using that table nicely fails.
-# Verify that other tables are not affected.
-
---source include/have_debug.inc
---source include/not_embedded.inc
---source include/have_perfschema.inc
-
-call mtr.add_suppression(
-"Column count of performance_schema.setup_instruments is wrong. "
-"Expected 4, found 3. The table is probably corrupted");
-
---error ER_WRONG_NATIVE_TABLE_STRUCTURE
-select * from performance_schema.setup_instruments limit 1;
-
---disable_result_log
-select * from performance_schema.setup_consumers limit 1;
---enable_result_log
-
diff --git a/scripts/mysql_performance_tables.sql b/scripts/mysql_performance_tables.sql
index d495578..3061603 100644
--- a/scripts/mysql_performance_tables.sql
+++ b/scripts/mysql_performance_tables.sql
@@ -53,1427 +53,3 @@ SET @str = IF(@broken_pfs = 0, @cmd, 'SET @dummy = 0');
 PREPARE stmt FROM @str;
 EXECUTE stmt;
 DROP PREPARE stmt;
-
---
--- From this point, only create the performance schema tables
--- if the server is built with performance schema
---
-
-set @have_pfs= (select count(engine) from information_schema.engines where engine='PERFORMANCE_SCHEMA' and support != 'NO');
-
---
--- TABLE COND_INSTANCES
---
-
-SET @cmd="CREATE TABLE performance_schema.cond_instances("
-  "NAME VARCHAR(128) not null,"
-  "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_WAITS_CURRENT
---
-
-SET @cmd="CREATE TABLE performance_schema.events_waits_current("
-  "THREAD_ID BIGINT unsigned not null,"
-  "EVENT_ID BIGINT unsigned not null,"
-  "END_EVENT_ID BIGINT unsigned,"
-  "EVENT_NAME VARCHAR(128) not null,"
-  "SOURCE VARCHAR(64),"
-  "TIMER_START BIGINT unsigned,"
-  "TIMER_END BIGINT unsigned,"
-  "TIMER_WAIT BIGINT unsigned,"
-  "SPINS INTEGER unsigned,"
-  "OBJECT_SCHEMA VARCHAR(64),"
-  "OBJECT_NAME VARCHAR(512),"
-  "INDEX_NAME VARCHAR(64),"
-  "OBJECT_TYPE VARCHAR(64),"
-  "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
-  "NESTING_EVENT_ID BIGINT unsigned,"
-  "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT'),"
-  "OPERATION VARCHAR(32) not null,"
-  "NUMBER_OF_BYTES BIGINT,"
-  "FLAGS INTEGER unsigned"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_WAITS_HISTORY
---
-
-SET @cmd="CREATE TABLE performance_schema.events_waits_history("
-  "THREAD_ID BIGINT unsigned not null,"
-  "EVENT_ID BIGINT unsigned not null,"
-  "END_EVENT_ID BIGINT unsigned,"
-  "EVENT_NAME VARCHAR(128) not null,"
-  "SOURCE VARCHAR(64),"
-  "TIMER_START BIGINT unsigned,"
-  "TIMER_END BIGINT unsigned,"
-  "TIMER_WAIT BIGINT unsigned,"
-  "SPINS INTEGER unsigned,"
-  "OBJECT_SCHEMA VARCHAR(64),"
-  "OBJECT_NAME VARCHAR(512),"
-  "INDEX_NAME VARCHAR(64),"
-  "OBJECT_TYPE VARCHAR(64),"
-  "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
-  "NESTING_EVENT_ID BIGINT unsigned,"
-  "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT'),"
-  "OPERATION VARCHAR(32) not null,"
-  "NUMBER_OF_BYTES BIGINT,"
-  "FLAGS INTEGER unsigned"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_WAITS_HISTORY_LONG
---
-
-SET @cmd="CREATE TABLE performance_schema.events_waits_history_long("
-  "THREAD_ID BIGINT unsigned not null,"
-  "EVENT_ID BIGINT unsigned not null,"
-  "END_EVENT_ID BIGINT unsigned,"
-  "EVENT_NAME VARCHAR(128) not null,"
-  "SOURCE VARCHAR(64),"
-  "TIMER_START BIGINT unsigned,"
-  "TIMER_END BIGINT unsigned,"
-  "TIMER_WAIT BIGINT unsigned,"
-  "SPINS INTEGER unsigned,"
-  "OBJECT_SCHEMA VARCHAR(64),"
-  "OBJECT_NAME VARCHAR(512),"
-  "INDEX_NAME VARCHAR(64),"
-  "OBJECT_TYPE VARCHAR(64),"
-  "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
-  "NESTING_EVENT_ID BIGINT unsigned,"
-  "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT'),"
-  "OPERATION VARCHAR(32) not null,"
-  "NUMBER_OF_BYTES BIGINT,"
-  "FLAGS INTEGER unsigned"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_WAITS_SUMMARY_BY_INSTANCE
---
-
-SET @cmd="CREATE TABLE performance_schema.events_waits_summary_by_instance("
-  "EVENT_NAME VARCHAR(128) not null,"
-  "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
-  "COUNT_STAR BIGINT unsigned not null,"
-  "SUM_TIMER_WAIT BIGINT unsigned not null,"
-  "MIN_TIMER_WAIT BIGINT unsigned not null,"
-  "AVG_TIMER_WAIT BIGINT unsigned not null,"
-  "MAX_TIMER_WAIT BIGINT unsigned not null"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_WAITS_SUMMARY_BY_HOST_BY_EVENT_NAME
---
-
-SET @cmd="CREATE TABLE performance_schema.events_waits_summary_by_host_by_event_name("
-  "HOST CHAR(60) collate utf8_bin default null,"
-  "EVENT_NAME VARCHAR(128) not null,"
-  "COUNT_STAR BIGINT unsigned not null,"
-  "SUM_TIMER_WAIT BIGINT unsigned not null,"
-  "MIN_TIMER_WAIT BIGINT unsigned not null,"
-  "AVG_TIMER_WAIT BIGINT unsigned not null,"
-  "MAX_TIMER_WAIT BIGINT unsigned not null"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_WAITS_SUMMARY_BY_USER_BY_EVENT_NAME
---
-
-SET @cmd="CREATE TABLE performance_schema.events_waits_summary_by_user_by_event_name("
-  "USER CHAR(16) collate utf8_bin default null,"
-  "EVENT_NAME VARCHAR(128) not null,"
-  "COUNT_STAR BIGINT unsigned not null,"
-  "SUM_TIMER_WAIT BIGINT unsigned not null,"
-  "MIN_TIMER_WAIT BIGINT unsigned not null,"
-  "AVG_TIMER_WAIT BIGINT unsigned not null,"
-  "MAX_TIMER_WAIT BIGINT unsigned not null"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_WAITS_SUMMARY_BY_ACCOUNT_BY_EVENT_NAME
---
-
-SET @cmd="CREATE TABLE performance_schema.events_waits_summary_by_account_by_event_name("
-  "USER CHAR(16) collate utf8_bin default null,"
-  "HOST CHAR(60) collate utf8_bin default null,"
-  "EVENT_NAME VARCHAR(128) not null,"
-  "COUNT_STAR BIGINT unsigned not null,"
-  "SUM_TIMER_WAIT BIGINT unsigned not null,"
-  "MIN_TIMER_WAIT BIGINT unsigned not null,"
-  "AVG_TIMER_WAIT BIGINT unsigned not null,"
-  "MAX_TIMER_WAIT BIGINT unsigned not null"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
---
-
-SET @cmd="CREATE TABLE performance_schema.events_waits_summary_by_thread_by_event_name("
-  "THREAD_ID BIGINT unsigned not null,"
-  "EVENT_NAME VARCHAR(128) not null,"
-  "COUNT_STAR BIGINT unsigned not null,"
-  "SUM_TIMER_WAIT BIGINT unsigned not null,"
-  "MIN_TIMER_WAIT BIGINT unsigned not null,"
-  "AVG_TIMER_WAIT BIGINT unsigned not null,"
-  "MAX_TIMER_WAIT BIGINT unsigned not null"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
---
-
-SET @cmd="CREATE TABLE performance_schema.events_waits_summary_global_by_event_name("
-  "EVENT_NAME VARCHAR(128) not null,"
-  "COUNT_STAR BIGINT unsigned not null,"
-  "SUM_TIMER_WAIT BIGINT unsigned not null,"
-  "MIN_TIMER_WAIT BIGINT unsigned not null,"
-  "AVG_TIMER_WAIT BIGINT unsigned not null,"
-  "MAX_TIMER_WAIT BIGINT unsigned not null"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE FILE_INSTANCES
---
-
-SET @cmd="CREATE TABLE performance_schema.file_instances("
-  "FILE_NAME VARCHAR(512) not null,"
-  "EVENT_NAME VARCHAR(128) not null,"
-  "OPEN_COUNT INTEGER unsigned not null"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE FILE_SUMMARY_BY_EVENT_NAME
---
-
-SET @cmd="CREATE TABLE performance_schema.file_summary_by_event_name("
-  "EVENT_NAME VARCHAR(128) not null,"
-  "COUNT_STAR BIGINT unsigned not null,"
-  "SUM_TIMER_WAIT BIGINT unsigned not null,"
-  "MIN_TIMER_WAIT BIGINT unsigned not null,"
-  "AVG_TIMER_WAIT BIGINT unsigned not null,"
-  "MAX_TIMER_WAIT BIGINT unsigned not null,"
-  "COUNT_READ BIGINT unsigned not null,"
-  "SUM_TIMER_READ BIGINT unsigned not null,"
-  "MIN_TIMER_READ BIGINT unsigned not null,"
-  "AVG_TIMER_READ BIGINT unsigned not null,"
-  "MAX_TIMER_READ BIGINT unsigned not null,"
-  "SUM_NUMBER_OF_BYTES_READ BIGINT not null,"
-  "COUNT_WRITE BIGINT unsigned not null,"
-  "SUM_TIMER_WRITE BIGINT unsigned not null,"
-  "MIN_TIMER_WRITE BIGINT unsigned not null,"
-  "AVG_TIMER_WRITE BIGINT unsigned not null,"
-  "MAX_TIMER_WRITE BIGINT unsigned not null,"
-  "SUM_NUMBER_OF_BYTES_WRITE BIGINT not null,"
-  "COUNT_MISC BIGINT unsigned not null,"
-  "SUM_TIMER_MISC BIGINT unsigned not null,"
-  "MIN_TIMER_MISC BIGINT unsigned not null,"
-  "AVG_TIMER_MISC BIGINT unsigned not null,"
-  "MAX_TIMER_MISC BIGINT unsigned not null"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE FILE_SUMMARY_BY_INSTANCE
---
-
-SET @cmd="CREATE TABLE performance_schema.file_summary_by_instance("
-  "FILE_NAME VARCHAR(512) not null,"
-  "EVENT_NAME VARCHAR(128) not null,"
-  "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
-  "COUNT_STAR BIGINT unsigned not null,"
-  "SUM_TIMER_WAIT BIGINT unsigned not null,"
-  "MIN_TIMER_WAIT BIGINT unsigned not null,"
-  "AVG_TIMER_WAIT BIGINT unsigned not null,"
-  "MAX_TIMER_WAIT BIGINT unsigned not null,"
-  "COUNT_READ BIGINT unsigned not null,"
-  "SUM_TIMER_READ BIGINT unsigned not null,"
-  "MIN_TIMER_READ BIGINT unsigned not null,"
-  "AVG_TIMER_READ BIGINT unsigned not null,"
-  "MAX_TIMER_READ BIGINT unsigned not null,"
-  "SUM_NUMBER_OF_BYTES_READ BIGINT not null,"
-  "COUNT_WRITE BIGINT unsigned not null,"
-  "SUM_TIMER_WRITE BIGINT unsigned not null,"
-  "MIN_TIMER_WRITE BIGINT unsigned not null,"
-  "AVG_TIMER_WRITE BIGINT unsigned not null,"
-  "MAX_TIMER_WRITE BIGINT unsigned not null,"
-  "SUM_NUMBER_OF_BYTES_WRITE BIGINT not null,"
-  "COUNT_MISC BIGINT unsigned not null,"
-  "SUM_TIMER_MISC BIGINT unsigned not null,"
-  "MIN_TIMER_MISC BIGINT unsigned not null,"
-  "AVG_TIMER_MISC BIGINT unsigned not null,"
-  "MAX_TIMER_MISC BIGINT unsigned not null"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
-
---
--- TABLE SOCKET_INSTANCES
---
-
-SET @cmd="CREATE TABLE performance_schema.socket_instances("
-  "EVENT_NAME VARCHAR(128) not null,"
-  "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
-  "THREAD_ID BIGINT unsigned,"
-  "SOCKET_ID INTEGER not null,"
-  "IP VARCHAR(64) not null,"
-  "PORT INTEGER not null,"
-  "STATE ENUM('IDLE','ACTIVE') not null"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE SOCKET_SUMMARY_BY_INSTANCE
---
-
-SET @cmd="CREATE TABLE performance_schema.socket_summary_by_instance("
-  "EVENT_NAME VARCHAR(128) not null,"
-  "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
-  "COUNT_STAR BIGINT unsigned not null,"
-  "SUM_TIMER_WAIT BIGINT unsigned not null,"
-  "MIN_TIMER_WAIT BIGINT unsigned not null,"
-  "AVG_TIMER_WAIT BIGINT unsigned not null,"
-  "MAX_TIMER_WAIT BIGINT unsigned not null,"
-  "COUNT_READ BIGINT unsigned not null,"
-  "SUM_TIMER_READ BIGINT unsigned not null,"
-  "MIN_TIMER_READ BIGINT unsigned not null,"
-  "AVG_TIMER_READ BIGINT unsigned not null,"
-  "MAX_TIMER_READ BIGINT unsigned not null,"
-  "SUM_NUMBER_OF_BYTES_READ BIGINT unsigned not null,"
-  "COUNT_WRITE BIGINT unsigned not null,"
-  "SUM_TIMER_WRITE BIGINT unsigned not null,"
-  "MIN_TIMER_WRITE BIGINT unsigned not null,"
-  "AVG_TIMER_WRITE BIGINT unsigned not null,"
-  "MAX_TIMER_WRITE BIGINT unsigned not null,"
-  "SUM_NUMBER_OF_BYTES_WRITE BIGINT unsigned not null,"
-  "COUNT_MISC BIGINT unsigned not null,"
-  "SUM_TIMER_MISC BIGINT unsigned not null,"
-  "MIN_TIMER_MISC BIGINT unsigned not null,"
-  "AVG_TIMER_MISC BIGINT unsigned not null,"
-  "MAX_TIMER_MISC BIGINT unsigned not null"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE SOCKET_SUMMARY_BY_INSTANCE
---
-
-SET @cmd="CREATE TABLE performance_schema.socket_summary_by_event_name("
-  "EVENT_NAME VARCHAR(128) not null,"
-  "COUNT_STAR BIGINT unsigned not null,"
-  "SUM_TIMER_WAIT BIGINT unsigned not null,"
-  "MIN_TIMER_WAIT BIGINT unsigned not null,"
-  "AVG_TIMER_WAIT BIGINT unsigned not null,"
-  "MAX_TIMER_WAIT BIGINT unsigned not null,"
-  "COUNT_READ BIGINT unsigned not null,"
-  "SUM_TIMER_READ BIGINT unsigned not null,"
-  "MIN_TIMER_READ BIGINT unsigned not null,"
-  "AVG_TIMER_READ BIGINT unsigned not null,"
-  "MAX_TIMER_READ BIGINT unsigned not null,"
-  "SUM_NUMBER_OF_BYTES_READ BIGINT unsigned not null,"
-  "COUNT_WRITE BIGINT unsigned not null,"
-  "SUM_TIMER_WRITE BIGINT unsigned not null,"
-  "MIN_TIMER_WRITE BIGINT unsigned not null,"
-  "AVG_TIMER_WRITE BIGINT unsigned not null,"
-  "MAX_TIMER_WRITE BIGINT unsigned not null,"
-  "SUM_NUMBER_OF_BYTES_WRITE BIGINT unsigned not null,"
-  "COUNT_MISC BIGINT unsigned not null,"
-  "SUM_TIMER_MISC BIGINT unsigned not null,"
-  "MIN_TIMER_MISC BIGINT unsigned not null,"
-  "AVG_TIMER_MISC BIGINT unsigned not null,"
-  "MAX_TIMER_MISC BIGINT unsigned not null"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE HOST_CACHE
---
-
-SET @cmd="CREATE TABLE performance_schema.host_cache("
-  "IP VARCHAR(64) not null,"
-  "HOST VARCHAR(255) collate utf8_bin,"
-  "HOST_VALIDATED ENUM ('YES', 'NO') not null,"
-  "SUM_CONNECT_ERRORS BIGINT not null,"
-  "COUNT_HOST_BLOCKED_ERRORS BIGINT not null,"
-  "COUNT_NAMEINFO_TRANSIENT_ERRORS BIGINT not null,"
-  "COUNT_NAMEINFO_PERMANENT_ERRORS BIGINT not null,"
-  "COUNT_FORMAT_ERRORS BIGINT not null,"
-  "COUNT_ADDRINFO_TRANSIENT_ERRORS BIGINT not null,"
-  "COUNT_ADDRINFO_PERMANENT_ERRORS BIGINT not null,"
-  "COUNT_FCRDNS_ERRORS BIGINT not null,"
-  "COUNT_HOST_ACL_ERRORS BIGINT not null,"
-  "COUNT_NO_AUTH_PLUGIN_ERRORS BIGINT not null,"
-  "COUNT_AUTH_PLUGIN_ERRORS BIGINT not null,"
-  "COUNT_HANDSHAKE_ERRORS BIGINT not null,"
-  "COUNT_PROXY_USER_ERRORS BIGINT not null,"
-  "COUNT_PROXY_USER_ACL_ERRORS BIGINT not null,"
-  "COUNT_AUTHENTICATION_ERRORS BIGINT not null,"
-  "COUNT_SSL_ERRORS BIGINT not null,"
-  "COUNT_MAX_USER_CONNECTIONS_ERRORS BIGINT not null,"
-  "COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS BIGINT not null,"
-  "COUNT_DEFAULT_DATABASE_ERRORS BIGINT not null,"
-  "COUNT_INIT_CONNECT_ERRORS BIGINT not null,"
-  "COUNT_LOCAL_ERRORS BIGINT not null,"
-  "COUNT_UNKNOWN_ERRORS BIGINT not null,"
-  "FIRST_SEEN TIMESTAMP(0) NOT NULL default 0,"
-  "LAST_SEEN TIMESTAMP(0) NOT NULL default 0,"
-  "FIRST_ERROR_SEEN TIMESTAMP(0) null default 0,"
-  "LAST_ERROR_SEEN TIMESTAMP(0) null default 0"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE MUTEX_INSTANCES
---
-
-SET @cmd="CREATE TABLE performance_schema.mutex_instances("
-  "NAME VARCHAR(128) not null,"
-  "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
-  "LOCKED_BY_THREAD_ID BIGINT unsigned"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE OBJECTS_SUMMARY_GLOBAL_BY_TYPE
---
-
-SET @cmd="CREATE TABLE performance_schema.objects_summary_global_by_type("
-  "OBJECT_TYPE VARCHAR(64),"
-  "OBJECT_SCHEMA VARCHAR(64),"
-  "OBJECT_NAME VARCHAR(64),"
-  "COUNT_STAR BIGINT unsigned not null,"
-  "SUM_TIMER_WAIT BIGINT unsigned not null,"
-  "MIN_TIMER_WAIT BIGINT unsigned not null,"
-  "AVG_TIMER_WAIT BIGINT unsigned not null,"
-  "MAX_TIMER_WAIT BIGINT unsigned not null"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE PERFORMANCE_TIMERS
---
-
-SET @cmd="CREATE TABLE performance_schema.performance_timers("
-  "TIMER_NAME ENUM ('CYCLE', 'NANOSECOND', 'MICROSECOND', 'MILLISECOND', 'TICK') not null,"
-  "TIMER_FREQUENCY BIGINT,"
-  "TIMER_RESOLUTION BIGINT,"
-  "TIMER_OVERHEAD BIGINT"
-  ") ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE RWLOCK_INSTANCES
---
-
-SET @cmd="CREATE TABLE performance_schema.rwlock_instances("
-  "NAME VARCHAR(128) not null,"
-  "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
-  "WRITE_LOCKED_BY_THREAD_ID BIGINT unsigned,"
-  "READ_LOCKED_BY_COUNT INTEGER unsigned not null"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE SETUP_ACTORS
---
-
-SET @cmd="CREATE TABLE performance_schema.setup_actors("
-  "HOST CHAR(60) collate utf8_bin default '%' not null,"
-  "USER CHAR(16) collate utf8_bin default '%' not null,"
-  "ROLE CHAR(16) collate utf8_bin default '%' not null"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE SETUP_CONSUMERS
---
-
-SET @cmd="CREATE TABLE performance_schema.setup_consumers("
-  "NAME VARCHAR(64) not null,"
-  "ENABLED ENUM ('YES', 'NO') not null"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE SETUP_INSTRUMENTS
---
-
-SET @cmd="CREATE TABLE performance_schema.setup_instruments("
-  "NAME VARCHAR(128) not null,"
-  "ENABLED ENUM ('YES', 'NO') not null,"
-  "TIMED ENUM ('YES', 'NO') not null"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE SETUP_OBJECTS
---
-
-SET @cmd="CREATE TABLE performance_schema.setup_objects("
-  "OBJECT_TYPE ENUM ('TABLE') not null default 'TABLE',"
-  "OBJECT_SCHEMA VARCHAR(64) default '%',"
-  "OBJECT_NAME VARCHAR(64) not null default '%',"
-  "ENABLED ENUM ('YES', 'NO') not null default 'YES',"
-  "TIMED ENUM ('YES', 'NO') not null default 'YES'"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE SETUP_TIMERS
---
-
-SET @cmd="CREATE TABLE performance_schema.setup_timers("
-  "NAME VARCHAR(64) not null,"
-  "TIMER_NAME ENUM ('CYCLE', 'NANOSECOND', 'MICROSECOND', 'MILLISECOND', 'TICK') not null"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE TABLE_IO_WAITS_SUMMARY_BY_INDEX_USAGE
---
-
-SET @cmd="CREATE TABLE performance_schema.table_io_waits_summary_by_index_usage("
-  "OBJECT_TYPE VARCHAR(64),"
-  "OBJECT_SCHEMA VARCHAR(64),"
-  "OBJECT_NAME VARCHAR(64),"
-  "INDEX_NAME VARCHAR(64),"
-  "COUNT_STAR BIGINT unsigned not null,"
-  "SUM_TIMER_WAIT BIGINT unsigned not null,"
-  "MIN_TIMER_WAIT BIGINT unsigned not null,"
-  "AVG_TIMER_WAIT BIGINT unsigned not null,"
-  "MAX_TIMER_WAIT BIGINT unsigned not null,"
-  "COUNT_READ BIGINT unsigned not null,"
-  "SUM_TIMER_READ BIGINT unsigned not null,"
-  "MIN_TIMER_READ BIGINT unsigned not null,"
-  "AVG_TIMER_READ BIGINT unsigned not null,"
-  "MAX_TIMER_READ BIGINT unsigned not null,"
-  "COUNT_WRITE BIGINT unsigned not null,"
-  "SUM_TIMER_WRITE BIGINT unsigned not null,"
-  "MIN_TIMER_WRITE BIGINT unsigned not null,"
-  "AVG_TIMER_WRITE BIGINT unsigned not null,"
-  "MAX_TIMER_WRITE BIGINT unsigned not null,"
-  "COUNT_FETCH BIGINT unsigned not null,"
-  "SUM_TIMER_FETCH BIGINT unsigned not null,"
-  "MIN_TIMER_FETCH BIGINT unsigned not null,"
-  "AVG_TIMER_FETCH BIGINT unsigned not null,"
-  "MAX_TIMER_FETCH BIGINT unsigned not null,"
-  "COUNT_INSERT BIGINT unsigned not null,"
-  "SUM_TIMER_INSERT BIGINT unsigned not null,"
-  "MIN_TIMER_INSERT BIGINT unsigned not null,"
-  "AVG_TIMER_INSERT BIGINT unsigned not null,"
-  "MAX_TIMER_INSERT BIGINT unsigned not null,"
-  "COUNT_UPDATE BIGINT unsigned not null,"
-  "SUM_TIMER_UPDATE BIGINT unsigned not null,"
-  "MIN_TIMER_UPDATE BIGINT unsigned not null,"
-  "AVG_TIMER_UPDATE BIGINT unsigned not null,"
-  "MAX_TIMER_UPDATE BIGINT unsigned not null,"
-  "COUNT_DELETE BIGINT unsigned not null,"
-  "SUM_TIMER_DELETE BIGINT unsigned not null,"
-  "MIN_TIMER_DELETE BIGINT unsigned not null,"
-  "AVG_TIMER_DELETE BIGINT unsigned not null,"
-  "MAX_TIMER_DELETE BIGINT unsigned not null"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE TABLE_IO_WAITS_SUMMARY_BY_TABLE
---
-
-SET @cmd="CREATE TABLE performance_schema.table_io_waits_summary_by_table("
-  "OBJECT_TYPE VARCHAR(64),"
-  "OBJECT_SCHEMA VARCHAR(64),"
-  "OBJECT_NAME VARCHAR(64),"
-  "COUNT_STAR BIGINT unsigned not null,"
-  "SUM_TIMER_WAIT BIGINT unsigned not null,"
-  "MIN_TIMER_WAIT BIGINT unsigned not null,"
-  "AVG_TIMER_WAIT BIGINT unsigned not null,"
-  "MAX_TIMER_WAIT BIGINT unsigned not null,"
-  "COUNT_READ BIGINT unsigned not null,"
-  "SUM_TIMER_READ BIGINT unsigned not null,"
-  "MIN_TIMER_READ BIGINT unsigned not null,"
-  "AVG_TIMER_READ BIGINT unsigned not null,"
-  "MAX_TIMER_READ BIGINT unsigned not null,"
-  "COUNT_WRITE BIGINT unsigned not null,"
-  "SUM_TIMER_WRITE BIGINT unsigned not null,"
-  "MIN_TIMER_WRITE BIGINT unsigned not null,"
-  "AVG_TIMER_WRITE BIGINT unsigned not null,"
-  "MAX_TIMER_WRITE BIGINT unsigned not null,"
-  "COUNT_FETCH BIGINT unsigned not null,"
-  "SUM_TIMER_FETCH BIGINT unsigned not null,"
-  "MIN_TIMER_FETCH BIGINT unsigned not null,"
-  "AVG_TIMER_FETCH BIGINT unsigned not null,"
-  "MAX_TIMER_FETCH BIGINT unsigned not null,"
-  "COUNT_INSERT BIGINT unsigned not null,"
-  "SUM_TIMER_INSERT BIGINT unsigned not null,"
-  "MIN_TIMER_INSERT BIGINT unsigned not null,"
-  "AVG_TIMER_INSERT BIGINT unsigned not null,"
-  "MAX_TIMER_INSERT BIGINT unsigned not null,"
-  "COUNT_UPDATE BIGINT unsigned not null,"
-  "SUM_TIMER_UPDATE BIGINT unsigned not null,"
-  "MIN_TIMER_UPDATE BIGINT unsigned not null,"
-  "AVG_TIMER_UPDATE BIGINT unsigned not null,"
-  "MAX_TIMER_UPDATE BIGINT unsigned not null,"
-  "COUNT_DELETE BIGINT unsigned not null,"
-  "SUM_TIMER_DELETE BIGINT unsigned not null,"
-  "MIN_TIMER_DELETE BIGINT unsigned not null,"
-  "AVG_TIMER_DELETE BIGINT unsigned not null,"
-  "MAX_TIMER_DELETE BIGINT unsigned not null"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE TABLE_LOCK_WAITS_SUMMARY_BY_TABLE
---
-
-SET @cmd="CREATE TABLE performance_schema.table_lock_waits_summary_by_table("
-  "OBJECT_TYPE VARCHAR(64),"
-  "OBJECT_SCHEMA VARCHAR(64),"
-  "OBJECT_NAME VARCHAR(64),"
-  "COUNT_STAR BIGINT unsigned not null,"
-  "SUM_TIMER_WAIT BIGINT unsigned not null,"
-  "MIN_TIMER_WAIT BIGINT unsigned not null,"
-  "AVG_TIMER_WAIT BIGINT unsigned not null,"
-  "MAX_TIMER_WAIT BIGINT unsigned not null,"
-  "COUNT_READ BIGINT unsigned not null,"
-  "SUM_TIMER_READ BIGINT unsigned not null,"
-  "MIN_TIMER_READ BIGINT unsigned not null,"
-  "AVG_TIMER_READ BIGINT unsigned not null,"
-  "MAX_TIMER_READ BIGINT unsigned not null,"
-  "COUNT_WRITE BIGINT unsigned not null,"
-  "SUM_TIMER_WRITE BIGINT unsigned not null,"
-  "MIN_TIMER_WRITE BIGINT unsigned not null,"
-  "AVG_TIMER_WRITE BIGINT unsigned not null,"
-  "MAX_TIMER_WRITE BIGINT unsigned not null,"
-  "COUNT_READ_NORMAL BIGINT unsigned not null,"
-  "SUM_TIMER_READ_NORMAL BIGINT unsigned not null,"
-  "MIN_TIMER_READ_NORMAL BIGINT unsigned not null,"
-  "AVG_TIMER_READ_NORMAL BIGINT unsigned not null,"
-  "MAX_TIMER_READ_NORMAL BIGINT unsigned not null,"
-  "COUNT_READ_WITH_SHARED_LOCKS BIGINT unsigned not null,"
-  "SUM_TIMER_READ_WITH_SHARED_LOCKS BIGINT unsigned not null,"
-  "MIN_TIMER_READ_WITH_SHARED_LOCKS BIGINT unsigned not null,"
-  "AVG_TIMER_READ_WITH_SHARED_LOCKS BIGINT unsigned not null,"
-  "MAX_TIMER_READ_WITH_SHARED_LOCKS BIGINT unsigned not null,"
-  "COUNT_READ_HIGH_PRIORITY BIGINT unsigned not null,"
-  "SUM_TIMER_READ_HIGH_PRIORITY BIGINT unsigned not null,"
-  "MIN_TIMER_READ_HIGH_PRIORITY BIGINT unsigned not null,"
-  "AVG_TIMER_READ_HIGH_PRIORITY BIGINT unsigned not null,"
-  "MAX_TIMER_READ_HIGH_PRIORITY BIGINT unsigned not null,"
-  "COUNT_READ_NO_INSERT BIGINT unsigned not null,"
-  "SUM_TIMER_READ_NO_INSERT BIGINT unsigned not null,"
-  "MIN_TIMER_READ_NO_INSERT BIGINT unsigned not null,"
-  "AVG_TIMER_READ_NO_INSERT BIGINT unsigned not null,"
-  "MAX_TIMER_READ_NO_INSERT BIGINT unsigned not null,"
-  "COUNT_READ_EXTERNAL BIGINT unsigned not null,"
-  "SUM_TIMER_READ_EXTERNAL BIGINT unsigned not null,"
-  "MIN_TIMER_READ_EXTERNAL BIGINT unsigned not null,"
-  "AVG_TIMER_READ_EXTERNAL BIGINT unsigned not null,"
-  "MAX_TIMER_READ_EXTERNAL BIGINT unsigned not null,"
-  "COUNT_WRITE_ALLOW_WRITE BIGINT unsigned not null,"
-  "SUM_TIMER_WRITE_ALLOW_WRITE BIGINT unsigned not null,"
-  "MIN_TIMER_WRITE_ALLOW_WRITE BIGINT unsigned not null,"
-  "AVG_TIMER_WRITE_ALLOW_WRITE BIGINT unsigned not null,"
-  "MAX_TIMER_WRITE_ALLOW_WRITE BIGINT unsigned not null,"
-  "COUNT_WRITE_CONCURRENT_INSERT BIGINT unsigned not null,"
-  "SUM_TIMER_WRITE_CONCURRENT_INSERT BIGINT unsigned not null,"
-  "MIN_TIMER_WRITE_CONCURRENT_INSERT BIGINT unsigned not null,"
-  "AVG_TIMER_WRITE_CONCURRENT_INSERT BIGINT unsigned not null,"
-  "MAX_TIMER_WRITE_CONCURRENT_INSERT BIGINT unsigned not null,"
-  "COUNT_WRITE_DELAYED BIGINT unsigned not null,"
-  "SUM_TIMER_WRITE_DELAYED BIGINT unsigned not null,"
-  "MIN_TIMER_WRITE_DELAYED BIGINT unsigned not null,"
-  "AVG_TIMER_WRITE_DELAYED BIGINT unsigned not null,"
-  "MAX_TIMER_WRITE_DELAYED BIGINT unsigned not null,"
-  "COUNT_WRITE_LOW_PRIORITY BIGINT unsigned not null,"
-  "SUM_TIMER_WRITE_LOW_PRIORITY BIGINT unsigned not null,"
-  "MIN_TIMER_WRITE_LOW_PRIORITY BIGINT unsigned not null,"
-  "AVG_TIMER_WRITE_LOW_PRIORITY BIGINT unsigned not null,"
-  "MAX_TIMER_WRITE_LOW_PRIORITY BIGINT unsigned not null,"
-  "COUNT_WRITE_NORMAL BIGINT unsigned not null,"
-  "SUM_TIMER_WRITE_NORMAL BIGINT unsigned not null,"
-  "MIN_TIMER_WRITE_NORMAL BIGINT unsigned not null,"
-  "AVG_TIMER_WRITE_NORMAL BIGINT unsigned not null,"
-  "MAX_TIMER_WRITE_NORMAL BIGINT unsigned not null,"
-  "COUNT_WRITE_EXTERNAL BIGINT unsigned not null,"
-  "SUM_TIMER_WRITE_EXTERNAL BIGINT unsigned not null,"
-  "MIN_TIMER_WRITE_EXTERNAL BIGINT unsigned not null,"
-  "AVG_TIMER_WRITE_EXTERNAL BIGINT unsigned not null,"
-  "MAX_TIMER_WRITE_EXTERNAL BIGINT unsigned not null"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE THREADS
---
-
-SET @cmd="CREATE TABLE performance_schema.threads("
-  "THREAD_ID BIGINT unsigned not null,"
-  "NAME VARCHAR(128) not null,"
-  "TYPE VARCHAR(10) not null,"
-  "PROCESSLIST_ID BIGINT unsigned,"
-  "PROCESSLIST_USER VARCHAR(16),"
-  "PROCESSLIST_HOST VARCHAR(60),"
-  "PROCESSLIST_DB VARCHAR(64),"
-  "PROCESSLIST_COMMAND VARCHAR(16),"
-  "PROCESSLIST_TIME BIGINT,"
-  "PROCESSLIST_STATE VARCHAR(64),"
-  "PROCESSLIST_INFO LONGTEXT,"
-  "PARENT_THREAD_ID BIGINT unsigned,"
-  "ROLE VARCHAR(64),"
-  "INSTRUMENTED ENUM ('YES', 'NO') not null"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_STAGES_CURRENT
---
-
-SET @cmd="CREATE TABLE performance_schema.events_stages_current("
-  "THREAD_ID BIGINT unsigned not null,"
-  "EVENT_ID BIGINT unsigned not null,"
-  "END_EVENT_ID BIGINT unsigned,"
-  "EVENT_NAME VARCHAR(128) not null,"
-  "SOURCE VARCHAR(64),"
-  "TIMER_START BIGINT unsigned,"
-  "TIMER_END BIGINT unsigned,"
-  "TIMER_WAIT BIGINT unsigned,"
-  "NESTING_EVENT_ID BIGINT unsigned,"
-  "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT')"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_STAGES_HISTORY
---
-
-SET @cmd="CREATE TABLE performance_schema.events_stages_history("
-  "THREAD_ID BIGINT unsigned not null,"
-  "EVENT_ID BIGINT unsigned not null,"
-  "END_EVENT_ID BIGINT unsigned,"
-  "EVENT_NAME VARCHAR(128) not null,"
-  "SOURCE VARCHAR(64),"
-  "TIMER_START BIGINT unsigned,"
-  "TIMER_END BIGINT unsigned,"
-  "TIMER_WAIT BIGINT unsigned,"
-  "NESTING_EVENT_ID BIGINT unsigned,"
-  "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT')"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_STAGES_HISTORY_LONG
---
-
-SET @cmd="CREATE TABLE performance_schema.events_stages_history_long("
-  "THREAD_ID BIGINT unsigned not null,"
-  "EVENT_ID BIGINT unsigned not null,"
-  "END_EVENT_ID BIGINT unsigned,"
-  "EVENT_NAME VARCHAR(128) not null,"
-  "SOURCE VARCHAR(64),"
-  "TIMER_START BIGINT unsigned,"
-  "TIMER_END BIGINT unsigned,"
-  "TIMER_WAIT BIGINT unsigned,"
-  "NESTING_EVENT_ID BIGINT unsigned,"
-  "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT')"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_STAGES_SUMMARY_BY_THREAD_BY_EVENT_NAME
---
-
-SET @cmd="CREATE TABLE performance_schema.events_stages_summary_by_thread_by_event_name("
-  "THREAD_ID BIGINT unsigned not null,"
-  "EVENT_NAME VARCHAR(128) not null,"
-  "COUNT_STAR BIGINT unsigned not null,"
-  "SUM_TIMER_WAIT BIGINT unsigned not null,"
-  "MIN_TIMER_WAIT BIGINT unsigned not null,"
-  "AVG_TIMER_WAIT BIGINT unsigned not null,"
-  "MAX_TIMER_WAIT BIGINT unsigned not null"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_STAGES_SUMMARY_BY_HOST_BY_EVENT_NAME
---
-
-SET @cmd="CREATE TABLE performance_schema.events_stages_summary_by_host_by_event_name("
-  "HOST CHAR(60) collate utf8_bin default null,"
-  "EVENT_NAME VARCHAR(128) not null,"
-  "COUNT_STAR BIGINT unsigned not null,"
-  "SUM_TIMER_WAIT BIGINT unsigned not null,"
-  "MIN_TIMER_WAIT BIGINT unsigned not null,"
-  "AVG_TIMER_WAIT BIGINT unsigned not null,"
-  "MAX_TIMER_WAIT BIGINT unsigned not null"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_STAGES_SUMMARY_BY_USER_BY_EVENT_NAME
---
-
-SET @cmd="CREATE TABLE performance_schema.events_stages_summary_by_user_by_event_name("
-  "USER CHAR(16) collate utf8_bin default null,"
-  "EVENT_NAME VARCHAR(128) not null,"
-  "COUNT_STAR BIGINT unsigned not null,"
-  "SUM_TIMER_WAIT BIGINT unsigned not null,"
-  "MIN_TIMER_WAIT BIGINT unsigned not null,"
-  "AVG_TIMER_WAIT BIGINT unsigned not null,"
-  "MAX_TIMER_WAIT BIGINT unsigned not null"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_STAGES_SUMMARY_BY_ACCOUNT_BY_EVENT_NAME
---
-
-SET @cmd="CREATE TABLE performance_schema.events_stages_summary_by_account_by_event_name("
-  "USER CHAR(16) collate utf8_bin default null,"
-  "HOST CHAR(60) collate utf8_bin default null,"
-  "EVENT_NAME VARCHAR(128) not null,"
-  "COUNT_STAR BIGINT unsigned not null,"
-  "SUM_TIMER_WAIT BIGINT unsigned not null,"
-  "MIN_TIMER_WAIT BIGINT unsigned not null,"
-  "AVG_TIMER_WAIT BIGINT unsigned not null,"
-  "MAX_TIMER_WAIT BIGINT unsigned not null"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_STAGES_SUMMARY_GLOBAL_BY_EVENT_NAME
---
-
-SET @cmd="CREATE TABLE performance_schema.events_stages_summary_global_by_event_name("
-  "EVENT_NAME VARCHAR(128) not null,"
-  "COUNT_STAR BIGINT unsigned not null,"
-  "SUM_TIMER_WAIT BIGINT unsigned not null,"
-  "MIN_TIMER_WAIT BIGINT unsigned not null,"
-  "AVG_TIMER_WAIT BIGINT unsigned not null,"
-  "MAX_TIMER_WAIT BIGINT unsigned not null"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_STATEMENTS_CURRENT
---
-
-SET @cmd="CREATE TABLE performance_schema.events_statements_current("
-  "THREAD_ID BIGINT unsigned not null,"
-  "EVENT_ID BIGINT unsigned not null,"
-  "END_EVENT_ID BIGINT unsigned,"
-  "EVENT_NAME VARCHAR(128) not null,"
-  "SOURCE VARCHAR(64),"
-  "TIMER_START BIGINT unsigned,"
-  "TIMER_END BIGINT unsigned,"
-  "TIMER_WAIT BIGINT unsigned,"
-  "LOCK_TIME bigint unsigned not null,"
-  "SQL_TEXT LONGTEXT,"
-  "DIGEST VARCHAR(32),"
-  "DIGEST_TEXT LONGTEXT,"
-  "CURRENT_SCHEMA VARCHAR(64),"
-  "OBJECT_TYPE VARCHAR(64),"
-  "OBJECT_SCHEMA VARCHAR(64),"
-  "OBJECT_NAME VARCHAR(64),"
-  "OBJECT_INSTANCE_BEGIN BIGINT unsigned,"
-  "MYSQL_ERRNO INTEGER,"
-  "RETURNED_SQLSTATE VARCHAR(5),"
-  "MESSAGE_TEXT VARCHAR(128),"
-  "ERRORS BIGINT unsigned not null,"
-  "WARNINGS BIGINT unsigned not null,"
-  "ROWS_AFFECTED BIGINT unsigned not null,"
-  "ROWS_SENT BIGINT unsigned not null,"
-  "ROWS_EXAMINED BIGINT unsigned not null,"
-  "CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
-  "CREATED_TMP_TABLES BIGINT unsigned not null,"
-  "SELECT_FULL_JOIN BIGINT unsigned not null,"
-  "SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
-  "SELECT_RANGE BIGINT unsigned not null,"
-  "SELECT_RANGE_CHECK BIGINT unsigned not null,"
-  "SELECT_SCAN BIGINT unsigned not null,"
-  "SORT_MERGE_PASSES BIGINT unsigned not null,"
-  "SORT_RANGE BIGINT unsigned not null,"
-  "SORT_ROWS BIGINT unsigned not null,"
-  "SORT_SCAN BIGINT unsigned not null,"
-  "NO_INDEX_USED BIGINT unsigned not null,"
-  "NO_GOOD_INDEX_USED BIGINT unsigned not null,"
-  "NESTING_EVENT_ID BIGINT unsigned,"
-  "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT')"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_STATEMENTS_HISTORY
---
-
-SET @cmd="CREATE TABLE performance_schema.events_statements_history("
-  "THREAD_ID BIGINT unsigned not null,"
-  "EVENT_ID BIGINT unsigned not null,"
-  "END_EVENT_ID BIGINT unsigned,"
-  "EVENT_NAME VARCHAR(128) not null,"
-  "SOURCE VARCHAR(64),"
-  "TIMER_START BIGINT unsigned,"
-  "TIMER_END BIGINT unsigned,"
-  "TIMER_WAIT BIGINT unsigned,"
-  "LOCK_TIME bigint unsigned not null,"
-  "SQL_TEXT LONGTEXT,"
-  "DIGEST VARCHAR(32),"
-  "DIGEST_TEXT LONGTEXT,"
-  "CURRENT_SCHEMA VARCHAR(64),"
-  "OBJECT_TYPE VARCHAR(64),"
-  "OBJECT_SCHEMA VARCHAR(64),"
-  "OBJECT_NAME VARCHAR(64),"
-  "OBJECT_INSTANCE_BEGIN BIGINT unsigned,"
-  "MYSQL_ERRNO INTEGER,"
-  "RETURNED_SQLSTATE VARCHAR(5),"
-  "MESSAGE_TEXT VARCHAR(128),"
-  "ERRORS BIGINT unsigned not null,"
-  "WARNINGS BIGINT unsigned not null,"
-  "ROWS_AFFECTED BIGINT unsigned not null,"
-  "ROWS_SENT BIGINT unsigned not null,"
-  "ROWS_EXAMINED BIGINT unsigned not null,"
-  "CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
-  "CREATED_TMP_TABLES BIGINT unsigned not null,"
-  "SELECT_FULL_JOIN BIGINT unsigned not null,"
-  "SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
-  "SELECT_RANGE BIGINT unsigned not null,"
-  "SELECT_RANGE_CHECK BIGINT unsigned not null,"
-  "SELECT_SCAN BIGINT unsigned not null,"
-  "SORT_MERGE_PASSES BIGINT unsigned not null,"
-  "SORT_RANGE BIGINT unsigned not null,"
-  "SORT_ROWS BIGINT unsigned not null,"
-  "SORT_SCAN BIGINT unsigned not null,"
-  "NO_INDEX_USED BIGINT unsigned not null,"
-  "NO_GOOD_INDEX_USED BIGINT unsigned not null,"
-  "NESTING_EVENT_ID BIGINT unsigned,"
-  "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT')"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_STATEMENTS_HISTORY_LONG
---
-
-SET @cmd="CREATE TABLE performance_schema.events_statements_history_long("
-  "THREAD_ID BIGINT unsigned not null,"
-  "EVENT_ID BIGINT unsigned not null,"
-  "END_EVENT_ID BIGINT unsigned,"
-  "EVENT_NAME VARCHAR(128) not null,"
-  "SOURCE VARCHAR(64),"
-  "TIMER_START BIGINT unsigned,"
-  "TIMER_END BIGINT unsigned,"
-  "TIMER_WAIT BIGINT unsigned,"
-  "LOCK_TIME bigint unsigned not null,"
-  "SQL_TEXT LONGTEXT,"
-  "DIGEST VARCHAR(32),"
-  "DIGEST_TEXT LONGTEXT,"
-  "CURRENT_SCHEMA VARCHAR(64),"
-  "OBJECT_TYPE VARCHAR(64),"
-  "OBJECT_SCHEMA VARCHAR(64),"
-  "OBJECT_NAME VARCHAR(64),"
-  "OBJECT_INSTANCE_BEGIN BIGINT unsigned,"
-  "MYSQL_ERRNO INTEGER,"
-  "RETURNED_SQLSTATE VARCHAR(5),"
-  "MESSAGE_TEXT VARCHAR(128),"
-  "ERRORS BIGINT unsigned not null,"
-  "WARNINGS BIGINT unsigned not null,"
-  "ROWS_AFFECTED BIGINT unsigned not null,"
-  "ROWS_SENT BIGINT unsigned not null,"
-  "ROWS_EXAMINED BIGINT unsigned not null,"
-  "CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
-  "CREATED_TMP_TABLES BIGINT unsigned not null,"
-  "SELECT_FULL_JOIN BIGINT unsigned not null,"
-  "SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
-  "SELECT_RANGE BIGINT unsigned not null,"
-  "SELECT_RANGE_CHECK BIGINT unsigned not null,"
-  "SELECT_SCAN BIGINT unsigned not null,"
-  "SORT_MERGE_PASSES BIGINT unsigned not null,"
-  "SORT_RANGE BIGINT unsigned not null,"
-  "SORT_ROWS BIGINT unsigned not null,"
-  "SORT_SCAN BIGINT unsigned not null,"
-  "NO_INDEX_USED BIGINT unsigned not null,"
-  "NO_GOOD_INDEX_USED BIGINT unsigned not null,"
-  "NESTING_EVENT_ID BIGINT unsigned,"
-  "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT')"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_STATEMENTS_SUMMARY_BY_THREAD_BY_EVENT_NAME
---
-
-SET @cmd="CREATE TABLE performance_schema.events_statements_summary_by_thread_by_event_name("
-  "THREAD_ID BIGINT unsigned not null,"
-  "EVENT_NAME VARCHAR(128) not null,"
-  "COUNT_STAR BIGINT unsigned not null,"
-  "SUM_TIMER_WAIT BIGINT unsigned not null,"
-  "MIN_TIMER_WAIT BIGINT unsigned not null,"
-  "AVG_TIMER_WAIT BIGINT unsigned not null,"
-  "MAX_TIMER_WAIT BIGINT unsigned not null,"
-  "SUM_LOCK_TIME BIGINT unsigned not null,"
-  "SUM_ERRORS BIGINT unsigned not null,"
-  "SUM_WARNINGS BIGINT unsigned not null,"
-  "SUM_ROWS_AFFECTED BIGINT unsigned not null,"
-  "SUM_ROWS_SENT BIGINT unsigned not null,"
-  "SUM_ROWS_EXAMINED BIGINT unsigned not null,"
-  "SUM_CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
-  "SUM_CREATED_TMP_TABLES BIGINT unsigned not null,"
-  "SUM_SELECT_FULL_JOIN BIGINT unsigned not null,"
-  "SUM_SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
-  "SUM_SELECT_RANGE BIGINT unsigned not null,"
-  "SUM_SELECT_RANGE_CHECK BIGINT unsigned not null,"
-  "SUM_SELECT_SCAN BIGINT unsigned not null,"
-  "SUM_SORT_MERGE_PASSES BIGINT unsigned not null,"
-  "SUM_SORT_RANGE BIGINT unsigned not null,"
-  "SUM_SORT_ROWS BIGINT unsigned not null,"
-  "SUM_SORT_SCAN BIGINT unsigned not null,"
-  "SUM_NO_INDEX_USED BIGINT unsigned not null,"
-  "SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_STATEMENTS_SUMMARY_BY_HOST_BY_EVENT_NAME
---
-
-SET @cmd="CREATE TABLE performance_schema.events_statements_summary_by_host_by_event_name("
-  "HOST CHAR(60) collate utf8_bin default null,"
-  "EVENT_NAME VARCHAR(128) not null,"
-  "COUNT_STAR BIGINT unsigned not null,"
-  "SUM_TIMER_WAIT BIGINT unsigned not null,"
-  "MIN_TIMER_WAIT BIGINT unsigned not null,"
-  "AVG_TIMER_WAIT BIGINT unsigned not null,"
-  "MAX_TIMER_WAIT BIGINT unsigned not null,"
-  "SUM_LOCK_TIME BIGINT unsigned not null,"
-  "SUM_ERRORS BIGINT unsigned not null,"
-  "SUM_WARNINGS BIGINT unsigned not null,"
-  "SUM_ROWS_AFFECTED BIGINT unsigned not null,"
-  "SUM_ROWS_SENT BIGINT unsigned not null,"
-  "SUM_ROWS_EXAMINED BIGINT unsigned not null,"
-  "SUM_CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
-  "SUM_CREATED_TMP_TABLES BIGINT unsigned not null,"
-  "SUM_SELECT_FULL_JOIN BIGINT unsigned not null,"
-  "SUM_SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
-  "SUM_SELECT_RANGE BIGINT unsigned not null,"
-  "SUM_SELECT_RANGE_CHECK BIGINT unsigned not null,"
-  "SUM_SELECT_SCAN BIGINT unsigned not null,"
-  "SUM_SORT_MERGE_PASSES BIGINT unsigned not null,"
-  "SUM_SORT_RANGE BIGINT unsigned not null,"
-  "SUM_SORT_ROWS BIGINT unsigned not null,"
-  "SUM_SORT_SCAN BIGINT unsigned not null,"
-  "SUM_NO_INDEX_USED BIGINT unsigned not null,"
-  "SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_STATEMENTS_SUMMARY_BY_USER_BY_EVENT_NAME
---
-
-SET @cmd="CREATE TABLE performance_schema.events_statements_summary_by_user_by_event_name("
-  "USER CHAR(16) collate utf8_bin default null,"
-  "EVENT_NAME VARCHAR(128) not null,"
-  "COUNT_STAR BIGINT unsigned not null,"
-  "SUM_TIMER_WAIT BIGINT unsigned not null,"
-  "MIN_TIMER_WAIT BIGINT unsigned not null,"
-  "AVG_TIMER_WAIT BIGINT unsigned not null,"
-  "MAX_TIMER_WAIT BIGINT unsigned not null,"
-  "SUM_LOCK_TIME BIGINT unsigned not null,"
-  "SUM_ERRORS BIGINT unsigned not null,"
-  "SUM_WARNINGS BIGINT unsigned not null,"
-  "SUM_ROWS_AFFECTED BIGINT unsigned not null,"
-  "SUM_ROWS_SENT BIGINT unsigned not null,"
-  "SUM_ROWS_EXAMINED BIGINT unsigned not null,"
-  "SUM_CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
-  "SUM_CREATED_TMP_TABLES BIGINT unsigned not null,"
-  "SUM_SELECT_FULL_JOIN BIGINT unsigned not null,"
-  "SUM_SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
-  "SUM_SELECT_RANGE BIGINT unsigned not null,"
-  "SUM_SELECT_RANGE_CHECK BIGINT unsigned not null,"
-  "SUM_SELECT_SCAN BIGINT unsigned not null,"
-  "SUM_SORT_MERGE_PASSES BIGINT unsigned not null,"
-  "SUM_SORT_RANGE BIGINT unsigned not null,"
-  "SUM_SORT_ROWS BIGINT unsigned not null,"
-  "SUM_SORT_SCAN BIGINT unsigned not null,"
-  "SUM_NO_INDEX_USED BIGINT unsigned not null,"
-  "SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_STATEMENTS_SUMMARY_BY_ACCOUNT_BY_EVENT_NAME
---
-
-SET @cmd="CREATE TABLE performance_schema.events_statements_summary_by_account_by_event_name("
-  "USER CHAR(16) collate utf8_bin default null,"
-  "HOST CHAR(60) collate utf8_bin default null,"
-  "EVENT_NAME VARCHAR(128) not null,"
-  "COUNT_STAR BIGINT unsigned not null,"
-  "SUM_TIMER_WAIT BIGINT unsigned not null,"
-  "MIN_TIMER_WAIT BIGINT unsigned not null,"
-  "AVG_TIMER_WAIT BIGINT unsigned not null,"
-  "MAX_TIMER_WAIT BIGINT unsigned not null,"
-  "SUM_LOCK_TIME BIGINT unsigned not null,"
-  "SUM_ERRORS BIGINT unsigned not null,"
-  "SUM_WARNINGS BIGINT unsigned not null,"
-  "SUM_ROWS_AFFECTED BIGINT unsigned not null,"
-  "SUM_ROWS_SENT BIGINT unsigned not null,"
-  "SUM_ROWS_EXAMINED BIGINT unsigned not null,"
-  "SUM_CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
-  "SUM_CREATED_TMP_TABLES BIGINT unsigned not null,"
-  "SUM_SELECT_FULL_JOIN BIGINT unsigned not null,"
-  "SUM_SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
-  "SUM_SELECT_RANGE BIGINT unsigned not null,"
-  "SUM_SELECT_RANGE_CHECK BIGINT unsigned not null,"
-  "SUM_SELECT_SCAN BIGINT unsigned not null,"
-  "SUM_SORT_MERGE_PASSES BIGINT unsigned not null,"
-  "SUM_SORT_RANGE BIGINT unsigned not null,"
-  "SUM_SORT_ROWS BIGINT unsigned not null,"
-  "SUM_SORT_SCAN BIGINT unsigned not null,"
-  "SUM_NO_INDEX_USED BIGINT unsigned not null,"
-  "SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_STATEMENTS_SUMMARY_GLOBAL_BY_EVENT_NAME
---
-
-SET @cmd="CREATE TABLE performance_schema.events_statements_summary_global_by_event_name("
-  "EVENT_NAME VARCHAR(128) not null,"
-  "COUNT_STAR BIGINT unsigned not null,"
-  "SUM_TIMER_WAIT BIGINT unsigned not null,"
-  "MIN_TIMER_WAIT BIGINT unsigned not null,"
-  "AVG_TIMER_WAIT BIGINT unsigned not null,"
-  "MAX_TIMER_WAIT BIGINT unsigned not null,"
-  "SUM_LOCK_TIME BIGINT unsigned not null,"
-  "SUM_ERRORS BIGINT unsigned not null,"
-  "SUM_WARNINGS BIGINT unsigned not null,"
-  "SUM_ROWS_AFFECTED BIGINT unsigned not null,"
-  "SUM_ROWS_SENT BIGINT unsigned not null,"
-  "SUM_ROWS_EXAMINED BIGINT unsigned not null,"
-  "SUM_CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
-  "SUM_CREATED_TMP_TABLES BIGINT unsigned not null,"
-  "SUM_SELECT_FULL_JOIN BIGINT unsigned not null,"
-  "SUM_SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
-  "SUM_SELECT_RANGE BIGINT unsigned not null,"
-  "SUM_SELECT_RANGE_CHECK BIGINT unsigned not null,"
-  "SUM_SELECT_SCAN BIGINT unsigned not null,"
-  "SUM_SORT_MERGE_PASSES BIGINT unsigned not null,"
-  "SUM_SORT_RANGE BIGINT unsigned not null,"
-  "SUM_SORT_ROWS BIGINT unsigned not null,"
-  "SUM_SORT_SCAN BIGINT unsigned not null,"
-  "SUM_NO_INDEX_USED BIGINT unsigned not null,"
-  "SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE HOSTS
---
-
-SET @cmd="CREATE TABLE performance_schema.hosts("
-  "HOST CHAR(60) collate utf8_bin default null,"
-  "CURRENT_CONNECTIONS bigint not null,"
-  "TOTAL_CONNECTIONS bigint not null"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE USERS
---
-
-SET @cmd="CREATE TABLE performance_schema.users("
-  "USER CHAR(16) collate utf8_bin default null,"
-  "CURRENT_CONNECTIONS bigint not null,"
-  "TOTAL_CONNECTIONS bigint not null"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE ACCOUNTS
---
-
-SET @cmd="CREATE TABLE performance_schema.accounts("
-  "USER CHAR(16) collate utf8_bin default null,"
-  "HOST CHAR(60) collate utf8_bin default null,"
-  "CURRENT_CONNECTIONS bigint not null,"
-  "TOTAL_CONNECTIONS bigint not null"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_STATEMENTS_SUMMARY_BY_DIGEST
---
-
-SET @cmd="CREATE TABLE performance_schema.events_statements_summary_by_digest("
-  "SCHEMA_NAME VARCHAR(64),"
-  "DIGEST VARCHAR(32),"
-  "DIGEST_TEXT LONGTEXT,"
-  "COUNT_STAR BIGINT unsigned not null,"
-  "SUM_TIMER_WAIT BIGINT unsigned not null,"
-  "MIN_TIMER_WAIT BIGINT unsigned not null,"
-  "AVG_TIMER_WAIT BIGINT unsigned not null,"
-  "MAX_TIMER_WAIT BIGINT unsigned not null,"
-  "SUM_LOCK_TIME BIGINT unsigned not null,"
-  "SUM_ERRORS BIGINT unsigned not null,"
-  "SUM_WARNINGS BIGINT unsigned not null,"
-  "SUM_ROWS_AFFECTED BIGINT unsigned not null,"
-  "SUM_ROWS_SENT BIGINT unsigned not null,"
-  "SUM_ROWS_EXAMINED BIGINT unsigned not null,"
-  "SUM_CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
-  "SUM_CREATED_TMP_TABLES BIGINT unsigned not null,"
-  "SUM_SELECT_FULL_JOIN BIGINT unsigned not null,"
-  "SUM_SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
-  "SUM_SELECT_RANGE BIGINT unsigned not null,"
-  "SUM_SELECT_RANGE_CHECK BIGINT unsigned not null,"
-  "SUM_SELECT_SCAN BIGINT unsigned not null,"
-  "SUM_SORT_MERGE_PASSES BIGINT unsigned not null,"
-  "SUM_SORT_RANGE BIGINT unsigned not null,"
-  "SUM_SORT_ROWS BIGINT unsigned not null,"
-  "SUM_SORT_SCAN BIGINT unsigned not null,"
-  "SUM_NO_INDEX_USED BIGINT unsigned not null,"
-  "SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null,"
-  "FIRST_SEEN TIMESTAMP(0) NOT NULL default 0,"
-  "LAST_SEEN TIMESTAMP(0) NOT NULL default 0"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE SESSION_CONNECT_ATTRS
---
-
-SET @cmd="CREATE TABLE performance_schema.session_connect_attrs("
-  "PROCESSLIST_ID INT NOT NULL,"
-  "ATTR_NAME VARCHAR(32) NOT NULL,"
-  "ATTR_VALUE VARCHAR(1024),"
-  "ORDINAL_POSITION INT"
-  ")ENGINE=PERFORMANCE_SCHEMA CHARACTER SET utf8 COLLATE utf8_bin;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE SESSION_ACCOUNT_CONNECT_ATTRS
---
-
-SET @cmd="CREATE TABLE performance_schema.session_account_connect_attrs "
-         " LIKE performance_schema.session_connect_attrs;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 1817d1c..0b2205b 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -5449,14 +5449,6 @@ int mysqld_main(int argc, char **argv)
 
 #ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
   initialize_performance_schema_acl(opt_bootstrap);
-  /*
-    Do not check the structure of the performance schema tables
-    during bootstrap:
-    - the tables are not supposed to exist yet, bootstrap will create them
-    - a check would print spurious error messages
-  */
-  if (! opt_bootstrap)
-    check_performance_schema();
 #endif
 
   initialize_information_schema_acl();
diff --git a/storage/perfschema/CMakeLists.txt b/storage/perfschema/CMakeLists.txt
index 718baa8..b77cae6 100644
--- a/storage/perfschema/CMakeLists.txt
+++ b/storage/perfschema/CMakeLists.txt
@@ -131,7 +131,6 @@ pfs.cc
 pfs_account.cc
 pfs_atomic.cc
 pfs_autosize.cc
-pfs_check.cc
 pfs_column_values.cc
 pfs_con_slice.cc
 pfs_defaults.cc
diff --git a/storage/perfschema/ha_perfschema.cc b/storage/perfschema/ha_perfschema.cc
index 58db8dc..8d41ff1 100644
--- a/storage/perfschema/ha_perfschema.cc
+++ b/storage/perfschema/ha_perfschema.cc
@@ -71,6 +71,23 @@ find_table_share(const char *db, const char *name)
   DBUG_RETURN(result);
 }
 
+static int pfs_discover_table(handlerton *hton, THD *thd, TABLE_SHARE *share)
+{
+  const PFS_engine_table_share *pfs_share;
+
+  if ((pfs_share= find_table_share(share->db.str, share->table_name.str)))
+    return share->init_from_sql_statement_string(thd, false,
+                                                 pfs_share->sql.str,
+                                                 pfs_share->sql.length);
+  return HA_ERR_NO_SUCH_TABLE;
+}
+
+static int pfs_discover_table_existence(handlerton *hton, const char *db,
+                                        const char *table_name)
+{
+  return MY_TEST(find_table_share(db, table_name));
+}
+
 static int pfs_init_func(void *p)
 {
   DBUG_ENTER("pfs_init_func");
@@ -99,6 +116,9 @@ static int pfs_init_func(void *p)
     the performance schema. See Bug#43039.
   */
   pfs_hton->db_type= DB_TYPE_PERFORMANCE_SCHEMA;
+  pfs_hton->discover_table= pfs_discover_table;
+  pfs_hton->discover_table_existence= pfs_discover_table_existence;
+  pfs_hton->discover_table_names= pfs_discover_table_names;
 
   PFS_engine_table_share::init_all_locks();
 
@@ -438,25 +458,10 @@ 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);
-  if (find_table_share(table_arg->s->db.str,
-                       table_arg->s->table_name.str))
-  {
-    /*
-      Attempting to create a known performance schema table.
-      Allowing the create, to create .FRM files,
-      for the initial database install, and mysql_upgrade.
-      This should fail once .FRM are removed.
-    */
-    DBUG_RETURN(0);
-  }
   /*
     This is not a general purpose engine.
     Failure to CREATE TABLE is the expected result.
   */
-  DBUG_PRINT("error", ("unknown table: %s.%s", table_arg->s->db.str,
-                       table_arg->s->table_name.str));
   DBUG_RETURN(HA_ERR_WRONG_COMMAND);
 }
 
diff --git a/storage/perfschema/pfs_check.cc b/storage/perfschema/pfs_check.cc
deleted file mode 100644
index c8800e7..0000000
--- a/storage/perfschema/pfs_check.cc
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; version 2 of the License.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program; if not, write to the Free Software Foundation,
-  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
-
-/**
-  @file storage/perfschema/pfs_check.cc
-  Check the performance schema table structure.
-  The code in this file is implemented in pfs_check.cc
-  instead of pfs_server.cc, to separate dependencies to server
-  structures (THD, ...) in a dedicated file.
-  This code organization helps a lot maintenance of the unit tests.
-*/
-
-#include "my_global.h"
-#include "pfs_server.h"
-#include "pfs_engine_table.h"
-
-/*
-*/
-
-/**
-  Check that the performance schema tables
-  have the expected structure.
-  Discrepancies are written in the server log,
-  but are not considered fatal, so this function does not
-  return an error code:
-  - some differences are compatible, and should not cause a failure
-  - some differences are not compatible, but then the DBA needs an operational
-  server to be able to DROP+CREATE the tables with the proper structure,
-  as part of the initial server installation or during an upgrade.
-  In case of discrepancies, later attempt to perform DML against
-  the performance schema will be rejected with an error.
-*/
-void check_performance_schema()
-{
-  DBUG_ENTER("check_performance_schema");
-
-  THD *thd= new THD();
-  if (thd == NULL)
-    DBUG_VOID_RETURN;
-
-  thd->thread_stack= (char*) &thd;
-  thd->store_globals();
-
-  PFS_engine_table_share::check_all_tables(thd);
-
-  thd->reset_globals();
-  delete thd;
-  DBUG_VOID_RETURN;
-}
-
diff --git a/storage/perfschema/pfs_engine_table.cc b/storage/perfschema/pfs_engine_table.cc
index 958a2bd..6f0a363 100644
--- a/storage/perfschema/pfs_engine_table.cc
+++ b/storage/perfschema/pfs_engine_table.cc
@@ -151,91 +151,6 @@ static PFS_engine_table_share *all_shares[]=
   NULL
 };
 
-/**
-  Check all the tables structure.
-  @param thd              current thread
-*/
-void PFS_engine_table_share::check_all_tables(THD *thd)
-{
-  PFS_engine_table_share **current;
-
-  DBUG_EXECUTE_IF("tampered_perfschema_table1",
-                  {
-                    /* Hack SETUP_INSTRUMENT, incompatible change. */
-                    all_shares[20]->m_field_def->count++;
-                  });
-
-  for (current= &all_shares[0]; (*current) != NULL; current++)
-    (*current)->check_one_table(thd);
-}
-
-/** Error reporting for schema integrity checks. */
-class PFS_check_intact : public Table_check_intact
-{
-protected:
-  virtual void report_error(uint code, const char *fmt, ...);
-
-public:
-  PFS_check_intact()
-  {}
-
-  ~PFS_check_intact()
-  {}
-};
-
-void PFS_check_intact::report_error(uint code, const char *fmt, ...)
-{
-  va_list args;
-  char buff[MYSQL_ERRMSG_SIZE];
-
-  va_start(args, fmt);
-  my_vsnprintf(buff, sizeof(buff), fmt, args);
-  va_end(args);
-
-  /*
-    This is an install/upgrade issue:
-    - do not report it in the user connection, there is none in main(),
-    - report it in the server error log.
-  */
-  sql_print_error("%s", buff);
-}
-
-/**
-  Check integrity of the actual table schema.
-  The actual table schema (.frm) is compared to the expected schema.
-  @param thd              current thread
-*/
-void PFS_engine_table_share::check_one_table(THD *thd)
-{
-  TABLE_LIST tables;
-
-  tables.init_one_table(PERFORMANCE_SCHEMA_str.str,
-                        PERFORMANCE_SCHEMA_str.length,
-                        m_name.str, m_name.length,
-                        m_name.str, TL_READ);
-
-  /* Work around until Bug#32115 is backported. */
-  LEX dummy_lex;
-  LEX *old_lex= thd->lex;
-  thd->lex= &dummy_lex;
-  lex_start(thd);
-
-  if (! open_and_lock_tables(thd, &tables, FALSE, MYSQL_LOCK_IGNORE_TIMEOUT))
-  {
-    PFS_check_intact checker;
-
-    if (!checker.check(tables.table, m_field_def))
-      m_checked= true;
-    close_thread_tables(thd);
-  }
-  else
-    sql_print_error(ER(ER_WRONG_NATIVE_TABLE_STRUCTURE),
-                    PERFORMANCE_SCHEMA_str.str, m_name.str);
-
-  lex_end(&dummy_lex);
-  thd->lex= old_lex;
-}
-
 /** Initialize all the table share locks. */
 void PFS_engine_table_share::init_all_locks(void)
 {
@@ -268,15 +183,6 @@ int PFS_engine_table_share::write_row(TABLE *table, unsigned char *buf,
 {
   my_bitmap_map *org_bitmap;
 
-  /*
-    Make sure the table structure is as expected before mapping
-    hard wired columns in m_write_row.
-  */
-  if (! m_checked)
-  {
-    return HA_ERR_TABLE_NEEDS_UPGRADE;
-  }
-
   if (m_write_row == NULL)
   {
     return HA_ERR_WRONG_COMMAND;
@@ -347,15 +253,6 @@ int PFS_engine_table::read_row(TABLE *table,
   Field *f;
   Field **fields_reset;
 
-  /*
-    Make sure the table structure is as expected before mapping
-    hard wired columns in read_row_values.
-  */
-  if (! m_share_ptr->m_checked)
-  {
-    return HA_ERR_TABLE_NEEDS_UPGRADE;
-  }
-
   /* We must read all columns in case a table is opened for update */
   bool read_all= !bitmap_is_clear_all(table->write_set);
 
@@ -392,15 +289,6 @@ int PFS_engine_table::update_row(TABLE *table,
 {
   my_bitmap_map *org_bitmap;
 
-  /*
-    Make sure the table structure is as expected before mapping
-    hard wired columns in update_row_values.
-  */
-  if (! m_share_ptr->m_checked)
-  {
-    return HA_ERR_TABLE_NEEDS_UPGRADE;
-  }
-
   /* We internally read from Fields to support the write interface */
   org_bitmap= dbug_tmp_use_all_columns(table, table->read_set);
   int result= update_row_values(table, old_buf, new_buf, fields);
@@ -415,15 +303,6 @@ int PFS_engine_table::delete_row(TABLE *table,
 {
   my_bitmap_map *org_bitmap;
 
-  /*
-    Make sure the table structure is as expected before mapping
-    hard wired columns in delete_row_values.
-  */
-  if (! m_share_ptr->m_checked)
-  {
-    return HA_ERR_TABLE_NEEDS_UPGRADE;
-  }
-
   /* We internally read from Fields to support the delete interface */
   org_bitmap= dbug_tmp_use_all_columns(table, table->read_set);
   int result= delete_row_values(table, buf, fields);
@@ -1440,5 +1319,17 @@ end:
   DBUG_RETURN(false);
 }
 
+int pfs_discover_table_names(handlerton *hton, LEX_STRING *db,
+                             MY_DIR *dir,
+                             handlerton::discovered_list *result)
+{
+  if (compare_table_names(db->str, PERFORMANCE_SCHEMA_str.str))
+    return 0;
+  for (size_t i= 0; i < array_elements(all_shares) - 1; i++)
+    result->add_table(all_shares[i]->m_name.str,
+                      all_shares[i]->m_name.length);
+  return 0;
+}
+
 /** @} */
 
diff --git a/storage/perfschema/pfs_engine_table.h b/storage/perfschema/pfs_engine_table.h
index 981d72e..2bbf889 100644
--- a/storage/perfschema/pfs_engine_table.h
+++ b/storage/perfschema/pfs_engine_table.h
@@ -212,8 +212,6 @@ typedef ha_rows (*pfs_get_row_count_t)(void);
 */
 struct PFS_engine_table_share
 {
-  static void check_all_tables(THD *thd);
-  void check_one_table(THD *thd);
   static void init_all_locks(void);
   static void delete_all_locks(void);
   /** Get the row count. */
@@ -244,10 +242,8 @@ struct PFS_engine_table_share
   uint m_ref_length;
   /** The lock, stored on behalf of the SQL layer. */
   THR_LOCK *m_thr_lock_ptr;
-  /** Table fields definition. */
-  TABLE_FIELD_DEF *m_field_def;
-  /** Schema integrity flag. */
-  bool m_checked;
+  /** Table definition. */
+  LEX_STRING sql;
 };
 
 /**
@@ -461,5 +457,9 @@ struct PFS_triple_index
 bool pfs_show_status(handlerton *hton, THD *thd,
                      stat_print_fn *print, enum ha_stat_type stat);
 
+int pfs_discover_table_names(handlerton *hton, LEX_STRING *db,
+                             MY_DIR *dir,
+                             handlerton::discovered_list *result);
+
 /** @} */
 #endif
diff --git a/storage/perfschema/pfs_server.h b/storage/perfschema/pfs_server.h
index 606a814..83e0d3b 100644
--- a/storage/perfschema/pfs_server.h
+++ b/storage/perfschema/pfs_server.h
@@ -231,8 +231,6 @@ void pfs_automated_sizing(PFS_global_param *param);
 */
 void initialize_performance_schema_acl(bool bootstrap);
 
-void check_performance_schema();
-
 /**
   Initialize the dynamic array holding individual instrument settings collected
   from the server configuration options.
diff --git a/storage/perfschema/table_accounts.cc b/storage/perfschema/table_accounts.cc
index eb14a0f..be18e0b 100644
--- a/storage/perfschema/table_accounts.cc
+++ b/storage/perfschema/table_accounts.cc
@@ -23,34 +23,6 @@
 
 THR_LOCK table_accounts::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("USER") },
-    { C_STRING_WITH_LEN("char(16)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("HOST") },
-    { C_STRING_WITH_LEN("char(60)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("CURRENT_CONNECTIONS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("TOTAL_CONNECTIONS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_accounts::m_field_def=
-{ 4, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_accounts::m_share=
 {
@@ -63,8 +35,11 @@ table_accounts::m_share=
   1000, /* records */
   sizeof(PFS_simple_index), /* ref length */
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE accounts("
+                      "USER CHAR(16) collate utf8_bin default null,"
+                      "HOST CHAR(60) collate utf8_bin default null,"
+                      "CURRENT_CONNECTIONS bigint not null,"
+                      "TOTAL_CONNECTIONS bigint not null)") }
 };
 
 PFS_engine_table* table_accounts::create()
diff --git a/storage/perfschema/table_accounts.h b/storage/perfschema/table_accounts.h
index 232cb9d..4c19326 100644
--- a/storage/perfschema/table_accounts.h
+++ b/storage/perfschema/table_accounts.h
@@ -67,8 +67,6 @@ private:
 
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_accounts m_row;
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 4f0fc68..a565cbb 100644
--- a/storage/perfschema/table_esgs_by_account_by_event_name.cc
+++ b/storage/perfschema/table_esgs_by_account_by_event_name.cc
@@ -29,54 +29,6 @@
 
 THR_LOCK table_esgs_by_account_by_event_name::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("USER") },
-    { C_STRING_WITH_LEN("char(16)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("HOST") },
-    { C_STRING_WITH_LEN("char(60)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("EVENT_NAME") },
-    { C_STRING_WITH_LEN("varchar(128)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_STAR") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_esgs_by_account_by_event_name::m_field_def=
-{ 8, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_esgs_by_account_by_event_name::m_share=
 {
@@ -89,8 +41,15 @@ table_esgs_by_account_by_event_name::m_share=
   1000, /* records */
   sizeof(pos_esgs_by_account_by_event_name),
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE events_stages_summary_by_account_by_event_name("
+                      "USER CHAR(16) collate utf8_bin default null,"
+                      "HOST CHAR(60) collate utf8_bin default null,"
+                      "EVENT_NAME VARCHAR(128) not null,"
+                      "COUNT_STAR BIGINT unsigned not null,"
+                      "SUM_TIMER_WAIT BIGINT unsigned not null,"
+                      "MIN_TIMER_WAIT BIGINT unsigned not null,"
+                      "AVG_TIMER_WAIT BIGINT unsigned not null,"
+                      "MAX_TIMER_WAIT BIGINT unsigned not null)") }
 };
 
 PFS_engine_table*
diff --git a/storage/perfschema/table_esgs_by_account_by_event_name.h b/storage/perfschema/table_esgs_by_account_by_event_name.h
index 2cd5178..531c487 100644
--- a/storage/perfschema/table_esgs_by_account_by_event_name.h
+++ b/storage/perfschema/table_esgs_by_account_by_event_name.h
@@ -108,8 +108,6 @@ protected:
 private:
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_esgs_by_account_by_event_name m_row;
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 904f0e2..76e60b3 100644
--- a/storage/perfschema/table_esgs_by_host_by_event_name.cc
+++ b/storage/perfschema/table_esgs_by_host_by_event_name.cc
@@ -30,49 +30,6 @@
 
 THR_LOCK table_esgs_by_host_by_event_name::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("HOST") },
-    { C_STRING_WITH_LEN("char(60)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("EVENT_NAME") },
-    { C_STRING_WITH_LEN("varchar(128)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_STAR") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_esgs_by_host_by_event_name::m_field_def=
-{ 7, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_esgs_by_host_by_event_name::m_share=
 {
@@ -85,8 +42,14 @@ table_esgs_by_host_by_event_name::m_share=
   1000, /* records */
   sizeof(pos_esgs_by_host_by_event_name),
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE events_stages_summary_by_host_by_event_name("
+                      "HOST CHAR(60) collate utf8_bin default null,"
+                      "EVENT_NAME VARCHAR(128) not null,"
+                      "COUNT_STAR BIGINT unsigned not null,"
+                      "SUM_TIMER_WAIT BIGINT unsigned not null,"
+                      "MIN_TIMER_WAIT BIGINT unsigned not null,"
+                      "AVG_TIMER_WAIT BIGINT unsigned not null,"
+                      "MAX_TIMER_WAIT BIGINT unsigned not null)") }
 };
 
 PFS_engine_table*
diff --git a/storage/perfschema/table_esgs_by_host_by_event_name.h b/storage/perfschema/table_esgs_by_host_by_event_name.h
index a8404e1..59a16c2 100644
--- a/storage/perfschema/table_esgs_by_host_by_event_name.h
+++ b/storage/perfschema/table_esgs_by_host_by_event_name.h
@@ -108,8 +108,6 @@ protected:
 private:
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_esgs_by_host_by_event_name m_row;
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 8a4d676..4fde601 100644
--- a/storage/perfschema/table_esgs_by_thread_by_event_name.cc
+++ b/storage/perfschema/table_esgs_by_thread_by_event_name.cc
@@ -29,49 +29,6 @@
 
 THR_LOCK table_esgs_by_thread_by_event_name::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("THREAD_ID") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("EVENT_NAME") },
-    { C_STRING_WITH_LEN("varchar(128)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_STAR") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_esgs_by_thread_by_event_name::m_field_def=
-{ 7, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_esgs_by_thread_by_event_name::m_share=
 {
@@ -84,8 +41,14 @@ table_esgs_by_thread_by_event_name::m_share=
   1000, /* records */
   sizeof(pos_esgs_by_thread_by_event_name),
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE events_stages_summary_by_thread_by_event_name("
+                      "THREAD_ID BIGINT unsigned not null,"
+                      "EVENT_NAME VARCHAR(128) not null,"
+                      "COUNT_STAR BIGINT unsigned not null,"
+                      "SUM_TIMER_WAIT BIGINT unsigned not null,"
+                      "MIN_TIMER_WAIT BIGINT unsigned not null,"
+                      "AVG_TIMER_WAIT BIGINT unsigned not null,"
+                      "MAX_TIMER_WAIT BIGINT unsigned not null)") }
 };
 
 PFS_engine_table*
diff --git a/storage/perfschema/table_esgs_by_thread_by_event_name.h b/storage/perfschema/table_esgs_by_thread_by_event_name.h
index 5295a9e..38c6d66 100644
--- a/storage/perfschema/table_esgs_by_thread_by_event_name.h
+++ b/storage/perfschema/table_esgs_by_thread_by_event_name.h
@@ -112,8 +112,6 @@ protected:
 private:
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_esgs_by_thread_by_event_name m_row;
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 736559d..cdb7ed6 100644
--- a/storage/perfschema/table_esgs_by_user_by_event_name.cc
+++ b/storage/perfschema/table_esgs_by_user_by_event_name.cc
@@ -30,49 +30,6 @@
 
 THR_LOCK table_esgs_by_user_by_event_name::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("USER") },
-    { C_STRING_WITH_LEN("char(16)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("EVENT_NAME") },
-    { C_STRING_WITH_LEN("varchar(128)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_STAR") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_esgs_by_user_by_event_name::m_field_def=
-{ 7, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_esgs_by_user_by_event_name::m_share=
 {
@@ -85,8 +42,14 @@ table_esgs_by_user_by_event_name::m_share=
   1000, /* records */
   sizeof(pos_esgs_by_user_by_event_name),
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE events_stages_summary_by_user_by_event_name("
+                      "USER CHAR(16) collate utf8_bin default null,"
+                      "EVENT_NAME VARCHAR(128) not null,"
+                      "COUNT_STAR BIGINT unsigned not null,"
+                      "SUM_TIMER_WAIT BIGINT unsigned not null,"
+                      "MIN_TIMER_WAIT BIGINT unsigned not null,"
+                      "AVG_TIMER_WAIT BIGINT unsigned not null,"
+                      "MAX_TIMER_WAIT BIGINT unsigned not null)") }
 };
 
 PFS_engine_table*
diff --git a/storage/perfschema/table_esgs_by_user_by_event_name.h b/storage/perfschema/table_esgs_by_user_by_event_name.h
index 9fc6603..3e1a03b 100644
--- a/storage/perfschema/table_esgs_by_user_by_event_name.h
+++ b/storage/perfschema/table_esgs_by_user_by_event_name.h
@@ -113,8 +113,6 @@ protected:
 private:
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_esgs_by_user_by_event_name m_row;
diff --git a/storage/perfschema/table_esgs_global_by_event_name.cc b/storage/perfschema/table_esgs_global_by_event_name.cc
index 1dea1f8..0d59940 100644
--- a/storage/perfschema/table_esgs_global_by_event_name.cc
+++ b/storage/perfschema/table_esgs_global_by_event_name.cc
@@ -31,44 +31,6 @@
 
 THR_LOCK table_esgs_global_by_event_name::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("EVENT_NAME") },
-    { C_STRING_WITH_LEN("varchar(128)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_STAR") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_esgs_global_by_event_name::m_field_def=
-{ 6, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_esgs_global_by_event_name::m_share=
 {
@@ -81,8 +43,13 @@ table_esgs_global_by_event_name::m_share=
   1000, /* records */
   sizeof(PFS_simple_index),
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE events_stages_summary_global_by_event_name("
+                      "EVENT_NAME VARCHAR(128) not null,"
+                      "COUNT_STAR BIGINT unsigned not null,"
+                      "SUM_TIMER_WAIT BIGINT unsigned not null,"
+                      "MIN_TIMER_WAIT BIGINT unsigned not null,"
+                      "AVG_TIMER_WAIT BIGINT unsigned not null,"
+                      "MAX_TIMER_WAIT BIGINT unsigned not null)") }
 };
 
 PFS_engine_table*
diff --git a/storage/perfschema/table_esgs_global_by_event_name.h b/storage/perfschema/table_esgs_global_by_event_name.h
index a9c1456..e6e23bf 100644
--- a/storage/perfschema/table_esgs_global_by_event_name.h
+++ b/storage/perfschema/table_esgs_global_by_event_name.h
@@ -76,8 +76,6 @@ protected:
 private:
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_esgs_global_by_event_name m_row;
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 436056e..b08c68a 100644
--- a/storage/perfschema/table_esms_by_account_by_event_name.cc
+++ b/storage/perfschema/table_esms_by_account_by_event_name.cc
@@ -29,149 +29,6 @@
 
 THR_LOCK table_esms_by_account_by_event_name::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("USER") },
-    { C_STRING_WITH_LEN("char(16)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("HOST") },
-    { C_STRING_WITH_LEN("char(60)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("EVENT_NAME") },
-    { C_STRING_WITH_LEN("varchar(128)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_STAR") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_LOCK_TIME") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_ERRORS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_WARNINGS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_ROWS_AFFECTED") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_ROWS_SENT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_ROWS_EXAMINED") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_CREATED_TMP_DISK_TABLES") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_CREATED_TMP_TABLES") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SELECT_FULL_JOIN") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SELECT_FULL_RANGE_JOIN") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SELECT_RANGE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SELECT_RANGE_CHECK") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SELECT_SCAN") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SORT_MERGE_PASSES") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SORT_RANGE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SORT_ROWS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SORT_SCAN") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NO_INDEX_USED") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NO_GOOD_INDEX_USED") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_esms_by_account_by_event_name::m_field_def=
-{ 27, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_esms_by_account_by_event_name::m_share=
 {
@@ -184,8 +41,34 @@ table_esms_by_account_by_event_name::m_share=
   1000, /* records */
   sizeof(pos_esms_by_account_by_event_name),
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE events_statements_summary_by_account_by_event_name("
+                      "USER CHAR(16) collate utf8_bin default null,"
+                      "HOST CHAR(60) collate utf8_bin default null,"
+                      "EVENT_NAME VARCHAR(128) not null,"
+                      "COUNT_STAR BIGINT unsigned not null,"
+                      "SUM_TIMER_WAIT BIGINT unsigned not null,"
+                      "MIN_TIMER_WAIT BIGINT unsigned not null,"
+                      "AVG_TIMER_WAIT BIGINT unsigned not null,"
+                      "MAX_TIMER_WAIT BIGINT unsigned not null,"
+                      "SUM_LOCK_TIME BIGINT unsigned not null,"
+                      "SUM_ERRORS BIGINT unsigned not null,"
+                      "SUM_WARNINGS BIGINT unsigned not null,"
+                      "SUM_ROWS_AFFECTED BIGINT unsigned not null,"
+                      "SUM_ROWS_SENT BIGINT unsigned not null,"
+                      "SUM_ROWS_EXAMINED BIGINT unsigned not null,"
+                      "SUM_CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
+                      "SUM_CREATED_TMP_TABLES BIGINT unsigned not null,"
+                      "SUM_SELECT_FULL_JOIN BIGINT unsigned not null,"
+                      "SUM_SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
+                      "SUM_SELECT_RANGE BIGINT unsigned not null,"
+                      "SUM_SELECT_RANGE_CHECK BIGINT unsigned not null,"
+                      "SUM_SELECT_SCAN BIGINT unsigned not null,"
+                      "SUM_SORT_MERGE_PASSES BIGINT unsigned not null,"
+                      "SUM_SORT_RANGE BIGINT unsigned not null,"
+                      "SUM_SORT_ROWS BIGINT unsigned not null,"
+                      "SUM_SORT_SCAN BIGINT unsigned not null,"
+                      "SUM_NO_INDEX_USED BIGINT unsigned not null,"
+                      "SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null)") }
 };
 
 PFS_engine_table*
diff --git a/storage/perfschema/table_esms_by_account_by_event_name.h b/storage/perfschema/table_esms_by_account_by_event_name.h
index 23168d0..4e3097e 100644
--- a/storage/perfschema/table_esms_by_account_by_event_name.h
+++ b/storage/perfschema/table_esms_by_account_by_event_name.h
@@ -108,8 +108,6 @@ protected:
 private:
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_esms_by_account_by_event_name m_row;
diff --git a/storage/perfschema/table_esms_by_digest.cc b/storage/perfschema/table_esms_by_digest.cc
index 80fa407..88860a7 100644
--- a/storage/perfschema/table_esms_by_digest.cc
+++ b/storage/perfschema/table_esms_by_digest.cc
@@ -33,159 +33,6 @@
 
 THR_LOCK table_esms_by_digest::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("SCHEMA_NAME") },
-    { C_STRING_WITH_LEN("varchar(64)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("DIGEST") },
-    { C_STRING_WITH_LEN("varchar(32)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("DIGEST_TEXT") },
-    { C_STRING_WITH_LEN("longtext") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_STAR") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_LOCK_TIME") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_ERRORS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_WARNINGS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_ROWS_AFFECTED") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_ROWS_SENT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_ROWS_EXAMINED") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_CREATED_TMP_DISK_TABLES") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_CREATED_TMP_TABLES") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SELECT_FULL_JOIN") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SELECT_FULL_RANGE_JOIN") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SELECT_RANGE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SELECT_RANGE_CHECK") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SELECT_SCAN") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SORT_MERGE_PASSES") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SORT_RANGE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SORT_ROWS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SORT_SCAN") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NO_INDEX_USED") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NO_GOOD_INDEX_USED") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("FIRST_SEEN") },
-    { C_STRING_WITH_LEN("timestamp") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("LAST_SEEN") },
-    { C_STRING_WITH_LEN("timestamp") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_esms_by_digest::m_field_def=
-{ 29, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_esms_by_digest::m_share=
 {
@@ -198,8 +45,36 @@ table_esms_by_digest::m_share=
   1000, /* records */
   sizeof(PFS_simple_index),
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE events_statements_summary_by_digest("
+                      "SCHEMA_NAME VARCHAR(64),"
+                      "DIGEST VARCHAR(32),"
+                      "DIGEST_TEXT LONGTEXT,"
+                      "COUNT_STAR BIGINT unsigned not null,"
+                      "SUM_TIMER_WAIT BIGINT unsigned not null,"
+                      "MIN_TIMER_WAIT BIGINT unsigned not null,"
+                      "AVG_TIMER_WAIT BIGINT unsigned not null,"
+                      "MAX_TIMER_WAIT BIGINT unsigned not null,"
+                      "SUM_LOCK_TIME BIGINT unsigned not null,"
+                      "SUM_ERRORS BIGINT unsigned not null,"
+                      "SUM_WARNINGS BIGINT unsigned not null,"
+                      "SUM_ROWS_AFFECTED BIGINT unsigned not null,"
+                      "SUM_ROWS_SENT BIGINT unsigned not null,"
+                      "SUM_ROWS_EXAMINED BIGINT unsigned not null,"
+                      "SUM_CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
+                      "SUM_CREATED_TMP_TABLES BIGINT unsigned not null,"
+                      "SUM_SELECT_FULL_JOIN BIGINT unsigned not null,"
+                      "SUM_SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
+                      "SUM_SELECT_RANGE BIGINT unsigned not null,"
+                      "SUM_SELECT_RANGE_CHECK BIGINT unsigned not null,"
+                      "SUM_SELECT_SCAN BIGINT unsigned not null,"
+                      "SUM_SORT_MERGE_PASSES BIGINT unsigned not null,"
+                      "SUM_SORT_RANGE BIGINT unsigned not null,"
+                      "SUM_SORT_ROWS BIGINT unsigned not null,"
+                      "SUM_SORT_SCAN BIGINT unsigned not null,"
+                      "SUM_NO_INDEX_USED BIGINT unsigned not null,"
+                      "SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null,"
+                      "FIRST_SEEN TIMESTAMP(0) NOT NULL default 0,"
+                      "LAST_SEEN TIMESTAMP(0) NOT NULL default 0)") }
 };
 
 PFS_engine_table*
diff --git a/storage/perfschema/table_esms_by_digest.h b/storage/perfschema/table_esms_by_digest.h
index 5df8ec6..196a89f 100644
--- a/storage/perfschema/table_esms_by_digest.h
+++ b/storage/perfschema/table_esms_by_digest.h
@@ -78,8 +78,6 @@ protected:
 private:
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_esms_by_digest m_row;
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 2cbe70d..78381cc 100644
--- a/storage/perfschema/table_esms_by_host_by_event_name.cc
+++ b/storage/perfschema/table_esms_by_host_by_event_name.cc
@@ -30,144 +30,6 @@
 
 THR_LOCK table_esms_by_host_by_event_name::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("HOST") },
-    { C_STRING_WITH_LEN("char(60)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("EVENT_NAME") },
-    { C_STRING_WITH_LEN("varchar(128)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_STAR") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_LOCK_TIME") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_ERRORS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_WARNINGS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_ROWS_AFFECTED") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_ROWS_SENT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_ROWS_EXAMINED") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_CREATED_TMP_DISK_TABLES") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_CREATED_TMP_TABLES") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SELECT_FULL_JOIN") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SELECT_FULL_RANGE_JOIN") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SELECT_RANGE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SELECT_RANGE_CHECK") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SELECT_SCAN") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SORT_MERGE_PASSES") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SORT_RANGE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SORT_ROWS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SORT_SCAN") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NO_INDEX_USED") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NO_GOOD_INDEX_USED") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_esms_by_host_by_event_name::m_field_def=
-{ 26, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_esms_by_host_by_event_name::m_share=
 {
@@ -180,8 +42,33 @@ table_esms_by_host_by_event_name::m_share=
   1000, /* records */
   sizeof(pos_esms_by_host_by_event_name),
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE events_statements_summary_by_host_by_event_name("
+                      "HOST CHAR(60) collate utf8_bin default null,"
+                      "EVENT_NAME VARCHAR(128) not null,"
+                      "COUNT_STAR BIGINT unsigned not null,"
+                      "SUM_TIMER_WAIT BIGINT unsigned not null,"
+                      "MIN_TIMER_WAIT BIGINT unsigned not null,"
+                      "AVG_TIMER_WAIT BIGINT unsigned not null,"
+                      "MAX_TIMER_WAIT BIGINT unsigned not null,"
+                      "SUM_LOCK_TIME BIGINT unsigned not null,"
+                      "SUM_ERRORS BIGINT unsigned not null,"
+                      "SUM_WARNINGS BIGINT unsigned not null,"
+                      "SUM_ROWS_AFFECTED BIGINT unsigned not null,"
+                      "SUM_ROWS_SENT BIGINT unsigned not null,"
+                      "SUM_ROWS_EXAMINED BIGINT unsigned not null,"
+                      "SUM_CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
+                      "SUM_CREATED_TMP_TABLES BIGINT unsigned not null,"
+                      "SUM_SELECT_FULL_JOIN BIGINT unsigned not null,"
+                      "SUM_SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
+                      "SUM_SELECT_RANGE BIGINT unsigned not null,"
+                      "SUM_SELECT_RANGE_CHECK BIGINT unsigned not null,"
+                      "SUM_SELECT_SCAN BIGINT unsigned not null,"
+                      "SUM_SORT_MERGE_PASSES BIGINT unsigned not null,"
+                      "SUM_SORT_RANGE BIGINT unsigned not null,"
+                      "SUM_SORT_ROWS BIGINT unsigned not null,"
+                      "SUM_SORT_SCAN BIGINT unsigned not null,"
+                      "SUM_NO_INDEX_USED BIGINT unsigned not null,"
+                      "SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null)") }
 };
 
 PFS_engine_table*
diff --git a/storage/perfschema/table_esms_by_host_by_event_name.h b/storage/perfschema/table_esms_by_host_by_event_name.h
index c28f17a..e1a6535 100644
--- a/storage/perfschema/table_esms_by_host_by_event_name.h
+++ b/storage/perfschema/table_esms_by_host_by_event_name.h
@@ -108,8 +108,6 @@ protected:
 private:
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_esms_by_host_by_event_name m_row;
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 9ab2a81..56a0812 100644
--- a/storage/perfschema/table_esms_by_thread_by_event_name.cc
+++ b/storage/perfschema/table_esms_by_thread_by_event_name.cc
@@ -29,144 +29,6 @@
 
 THR_LOCK table_esms_by_thread_by_event_name::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("THREAD_ID") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("EVENT_NAME") },
-    { C_STRING_WITH_LEN("varchar(128)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_STAR") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_LOCK_TIME") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_ERRORS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_WARNINGS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_ROWS_AFFECTED") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_ROWS_SENT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_ROWS_EXAMINED") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_CREATED_TMP_DISK_TABLES") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_CREATED_TMP_TABLES") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SELECT_FULL_JOIN") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SELECT_FULL_RANGE_JOIN") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SELECT_RANGE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SELECT_RANGE_CHECK") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SELECT_SCAN") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SORT_MERGE_PASSES") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SORT_RANGE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SORT_ROWS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SORT_SCAN") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NO_INDEX_USED") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NO_GOOD_INDEX_USED") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_esms_by_thread_by_event_name::m_field_def=
-{ 26, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_esms_by_thread_by_event_name::m_share=
 {
@@ -179,8 +41,33 @@ table_esms_by_thread_by_event_name::m_share=
   1000, /* records */
   sizeof(pos_esms_by_thread_by_event_name),
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE events_statements_summary_by_thread_by_event_name("
+                      "THREAD_ID BIGINT unsigned not null,"
+                      "EVENT_NAME VARCHAR(128) not null,"
+                      "COUNT_STAR BIGINT unsigned not null,"
+                      "SUM_TIMER_WAIT BIGINT unsigned not null,"
+                      "MIN_TIMER_WAIT BIGINT unsigned not null,"
+                      "AVG_TIMER_WAIT BIGINT unsigned not null,"
+                      "MAX_TIMER_WAIT BIGINT unsigned not null,"
+                      "SUM_LOCK_TIME BIGINT unsigned not null,"
+                      "SUM_ERRORS BIGINT unsigned not null,"
+                      "SUM_WARNINGS BIGINT unsigned not null,"
+                      "SUM_ROWS_AFFECTED BIGINT unsigned not null,"
+                      "SUM_ROWS_SENT BIGINT unsigned not null,"
+                      "SUM_ROWS_EXAMINED BIGINT unsigned not null,"
+                      "SUM_CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
+                      "SUM_CREATED_TMP_TABLES BIGINT unsigned not null,"
+                      "SUM_SELECT_FULL_JOIN BIGINT unsigned not null,"
+                      "SUM_SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
+                      "SUM_SELECT_RANGE BIGINT unsigned not null,"
+                      "SUM_SELECT_RANGE_CHECK BIGINT unsigned not null,"
+                      "SUM_SELECT_SCAN BIGINT unsigned not null,"
+                      "SUM_SORT_MERGE_PASSES BIGINT unsigned not null,"
+                      "SUM_SORT_RANGE BIGINT unsigned not null,"
+                      "SUM_SORT_ROWS BIGINT unsigned not null,"
+                      "SUM_SORT_SCAN BIGINT unsigned not null,"
+                      "SUM_NO_INDEX_USED BIGINT unsigned not null,"
+                      "SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null)") }
 };
 
 PFS_engine_table*
diff --git a/storage/perfschema/table_esms_by_thread_by_event_name.h b/storage/perfschema/table_esms_by_thread_by_event_name.h
index 9fb9f7c..32554c3 100644
--- a/storage/perfschema/table_esms_by_thread_by_event_name.h
+++ b/storage/perfschema/table_esms_by_thread_by_event_name.h
@@ -112,8 +112,6 @@ protected:
 private:
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_esms_by_thread_by_event_name m_row;
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 6b55fb8..7e0fce7 100644
--- a/storage/perfschema/table_esms_by_user_by_event_name.cc
+++ b/storage/perfschema/table_esms_by_user_by_event_name.cc
@@ -30,144 +30,6 @@
 
 THR_LOCK table_esms_by_user_by_event_name::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("USER") },
-    { C_STRING_WITH_LEN("char(16)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("EVENT_NAME") },
-    { C_STRING_WITH_LEN("varchar(128)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_STAR") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_LOCK_TIME") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_ERRORS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_WARNINGS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_ROWS_AFFECTED") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_ROWS_SENT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_ROWS_EXAMINED") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_CREATED_TMP_DISK_TABLES") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_CREATED_TMP_TABLES") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SELECT_FULL_JOIN") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SELECT_FULL_RANGE_JOIN") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SELECT_RANGE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SELECT_RANGE_CHECK") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SELECT_SCAN") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SORT_MERGE_PASSES") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SORT_RANGE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SORT_ROWS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SORT_SCAN") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NO_INDEX_USED") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NO_GOOD_INDEX_USED") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_esms_by_user_by_event_name::m_field_def=
-{ 26, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_esms_by_user_by_event_name::m_share=
 {
@@ -180,8 +42,33 @@ table_esms_by_user_by_event_name::m_share=
   1000, /* records */
   sizeof(pos_esms_by_user_by_event_name),
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE events_statements_summary_by_user_by_event_name("
+                      "USER CHAR(16) collate utf8_bin default null,"
+                      "EVENT_NAME VARCHAR(128) not null,"
+                      "COUNT_STAR BIGINT unsigned not null,"
+                      "SUM_TIMER_WAIT BIGINT unsigned not null,"
+                      "MIN_TIMER_WAIT BIGINT unsigned not null,"
+                      "AVG_TIMER_WAIT BIGINT unsigned not null,"
+                      "MAX_TIMER_WAIT BIGINT unsigned not null,"
+                      "SUM_LOCK_TIME BIGINT unsigned not null,"
+                      "SUM_ERRORS BIGINT unsigned not null,"
+                      "SUM_WARNINGS BIGINT unsigned not null,"
+                      "SUM_ROWS_AFFECTED BIGINT unsigned not null,"
+                      "SUM_ROWS_SENT BIGINT unsigned not null,"
+                      "SUM_ROWS_EXAMINED BIGINT unsigned not null,"
+                      "SUM_CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
+                      "SUM_CREATED_TMP_TABLES BIGINT unsigned not null,"
+                      "SUM_SELECT_FULL_JOIN BIGINT unsigned not null,"
+                      "SUM_SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
+                      "SUM_SELECT_RANGE BIGINT unsigned not null,"
+                      "SUM_SELECT_RANGE_CHECK BIGINT unsigned not null,"
+                      "SUM_SELECT_SCAN BIGINT unsigned not null,"
+                      "SUM_SORT_MERGE_PASSES BIGINT unsigned not null,"
+                      "SUM_SORT_RANGE BIGINT unsigned not null,"
+                      "SUM_SORT_ROWS BIGINT unsigned not null,"
+                      "SUM_SORT_SCAN BIGINT unsigned not null,"
+                      "SUM_NO_INDEX_USED BIGINT unsigned not null,"
+                      "SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null)") }
 };
 
 PFS_engine_table*
diff --git a/storage/perfschema/table_esms_by_user_by_event_name.h b/storage/perfschema/table_esms_by_user_by_event_name.h
index 6dc481d..beba704 100644
--- a/storage/perfschema/table_esms_by_user_by_event_name.h
+++ b/storage/perfschema/table_esms_by_user_by_event_name.h
@@ -108,8 +108,6 @@ protected:
 private:
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_esms_by_user_by_event_name m_row;
diff --git a/storage/perfschema/table_esms_global_by_event_name.cc b/storage/perfschema/table_esms_global_by_event_name.cc
index e1b6555..1e9f8f9 100644
--- a/storage/perfschema/table_esms_global_by_event_name.cc
+++ b/storage/perfschema/table_esms_global_by_event_name.cc
@@ -31,139 +31,6 @@
 
 THR_LOCK table_esms_global_by_event_name::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("EVENT_NAME") },
-    { C_STRING_WITH_LEN("varchar(128)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_STAR") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_LOCK_TIME") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_ERRORS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_WARNINGS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_ROWS_AFFECTED") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_ROWS_SENT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_ROWS_EXAMINED") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_CREATED_TMP_DISK_TABLES") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_CREATED_TMP_TABLES") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SELECT_FULL_JOIN") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SELECT_FULL_RANGE_JOIN") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SELECT_RANGE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SELECT_RANGE_CHECK") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SELECT_SCAN") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SORT_MERGE_PASSES") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SORT_RANGE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SORT_ROWS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_SORT_SCAN") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NO_INDEX_USED") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NO_GOOD_INDEX_USED") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_esms_global_by_event_name::m_field_def=
-{ 25, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_esms_global_by_event_name::m_share=
 {
@@ -176,8 +43,32 @@ table_esms_global_by_event_name::m_share=
   1000, /* records */
   sizeof(PFS_simple_index),
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE events_statements_summary_global_by_event_name("
+                      "EVENT_NAME VARCHAR(128) not null,"
+                      "COUNT_STAR BIGINT unsigned not null,"
+                      "SUM_TIMER_WAIT BIGINT unsigned not null,"
+                      "MIN_TIMER_WAIT BIGINT unsigned not null,"
+                      "AVG_TIMER_WAIT BIGINT unsigned not null,"
+                      "MAX_TIMER_WAIT BIGINT unsigned not null,"
+                      "SUM_LOCK_TIME BIGINT unsigned not null,"
+                      "SUM_ERRORS BIGINT unsigned not null,"
+                      "SUM_WARNINGS BIGINT unsigned not null,"
+                      "SUM_ROWS_AFFECTED BIGINT unsigned not null,"
+                      "SUM_ROWS_SENT BIGINT unsigned not null,"
+                      "SUM_ROWS_EXAMINED BIGINT unsigned not null,"
+                      "SUM_CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
+                      "SUM_CREATED_TMP_TABLES BIGINT unsigned not null,"
+                      "SUM_SELECT_FULL_JOIN BIGINT unsigned not null,"
+                      "SUM_SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
+                      "SUM_SELECT_RANGE BIGINT unsigned not null,"
+                      "SUM_SELECT_RANGE_CHECK BIGINT unsigned not null,"
+                      "SUM_SELECT_SCAN BIGINT unsigned not null,"
+                      "SUM_SORT_MERGE_PASSES BIGINT unsigned not null,"
+                      "SUM_SORT_RANGE BIGINT unsigned not null,"
+                      "SUM_SORT_ROWS BIGINT unsigned not null,"
+                      "SUM_SORT_SCAN BIGINT unsigned not null,"
+                      "SUM_NO_INDEX_USED BIGINT unsigned not null,"
+                      "SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null)") }
 };
 
 PFS_engine_table*
diff --git a/storage/perfschema/table_esms_global_by_event_name.h b/storage/perfschema/table_esms_global_by_event_name.h
index ed07e2b..14435fb 100644
--- a/storage/perfschema/table_esms_global_by_event_name.h
+++ b/storage/perfschema/table_esms_global_by_event_name.h
@@ -76,8 +76,6 @@ protected:
 private:
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_esms_global_by_event_name m_row;
diff --git a/storage/perfschema/table_events_stages.cc b/storage/perfschema/table_events_stages.cc
index 08a9779..f98ff60d 100644
--- a/storage/perfschema/table_events_stages.cc
+++ b/storage/perfschema/table_events_stages.cc
@@ -28,64 +28,6 @@
 
 THR_LOCK table_events_stages_current::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("THREAD_ID") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("EVENT_ID") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("END_EVENT_ID") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("EVENT_NAME") },
-    { C_STRING_WITH_LEN("varchar(128)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SOURCE") },
-    { C_STRING_WITH_LEN("varchar(64)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("TIMER_START") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("TIMER_END") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("NESTING_EVENT_ID") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("NESTING_EVENT_TYPE") },
-    { C_STRING_WITH_LEN("enum(\'STATEMENT\',\'STAGE\',\'WAIT\'") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_events_stages_current::m_field_def=
-{10 , field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_events_stages_current::m_share=
 {
@@ -98,8 +40,17 @@ table_events_stages_current::m_share=
   1000, /* records */
   sizeof(PFS_simple_index), /* ref length */
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE events_stages_current("
+                      "THREAD_ID BIGINT unsigned not null,"
+                      "EVENT_ID BIGINT unsigned not null,"
+                      "END_EVENT_ID BIGINT unsigned,"
+                      "EVENT_NAME VARCHAR(128) not null,"
+                      "SOURCE VARCHAR(64),"
+                      "TIMER_START BIGINT unsigned,"
+                      "TIMER_END BIGINT unsigned,"
+                      "TIMER_WAIT BIGINT unsigned,"
+                      "NESTING_EVENT_ID BIGINT unsigned,"
+                      "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT'))") }
 };
 
 THR_LOCK table_events_stages_history::m_table_lock;
@@ -116,8 +67,17 @@ table_events_stages_history::m_share=
   1000, /* records */
   sizeof(pos_events_stages_history), /* ref length */
   &m_table_lock,
-  &table_events_stages_current::m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE events_stages_history("
+                      "THREAD_ID BIGINT unsigned not null,"
+                      "EVENT_ID BIGINT unsigned not null,"
+                      "END_EVENT_ID BIGINT unsigned,"
+                      "EVENT_NAME VARCHAR(128) not null,"
+                      "SOURCE VARCHAR(64),"
+                      "TIMER_START BIGINT unsigned,"
+                      "TIMER_END BIGINT unsigned,"
+                      "TIMER_WAIT BIGINT unsigned,"
+                      "NESTING_EVENT_ID BIGINT unsigned,"
+                      "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT'))") }
 };
 
 THR_LOCK table_events_stages_history_long::m_table_lock;
@@ -134,8 +94,17 @@ table_events_stages_history_long::m_share=
   10000, /* records */
   sizeof(PFS_simple_index), /* ref length */
   &m_table_lock,
-  &table_events_stages_current::m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE events_stages_history_long("
+                      "THREAD_ID BIGINT unsigned not null,"
+                      "EVENT_ID BIGINT unsigned not null,"
+                      "END_EVENT_ID BIGINT unsigned,"
+                      "EVENT_NAME VARCHAR(128) not null,"
+                      "SOURCE VARCHAR(64),"
+                      "TIMER_START BIGINT unsigned,"
+                      "TIMER_END BIGINT unsigned,"
+                      "TIMER_WAIT BIGINT unsigned,"
+                      "NESTING_EVENT_ID BIGINT unsigned,"
+                      "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT'))") }
 };
 
 table_events_stages_common::table_events_stages_common
diff --git a/storage/perfschema/table_events_stages.h b/storage/perfschema/table_events_stages.h
index 09c555c8..2568a09 100644
--- a/storage/perfschema/table_events_stages.h
+++ b/storage/perfschema/table_events_stages.h
@@ -133,12 +133,6 @@ private:
 
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /**
-    Fields definition.
-    Also used by table_events_stages_history
-    and table_events_stages_history_long.
-  */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current position. */
   PFS_simple_index m_pos;
diff --git a/storage/perfschema/table_events_statements.cc b/storage/perfschema/table_events_statements.cc
index 96a79ee..c6d0bc2 100644
--- a/storage/perfschema/table_events_statements.cc
+++ b/storage/perfschema/table_events_statements.cc
@@ -31,214 +31,6 @@
 
 THR_LOCK table_events_statements_current::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("THREAD_ID") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("EVENT_ID") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("END_EVENT_ID") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("EVENT_NAME") },
-    { C_STRING_WITH_LEN("varchar(128)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SOURCE") },
-    { C_STRING_WITH_LEN("varchar(64)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("TIMER_START") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("TIMER_END") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("LOCK_TIME") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SQL_TEXT") },
-    { C_STRING_WITH_LEN("longtext") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("DIGEST") },
-    { C_STRING_WITH_LEN("varchar(32)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("DIGEST_TEXT") },
-    { C_STRING_WITH_LEN("longtext") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("CURRENT_SCHEMA") },
-    { C_STRING_WITH_LEN("varchar(64)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("OBJECT_TYPE") },
-    { C_STRING_WITH_LEN("varchar(64)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("OBJECT_SCHEMA") },
-    { C_STRING_WITH_LEN("varchar(64)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("OBJECT_NAME") },
-    { C_STRING_WITH_LEN("varchar(64)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("OBJECT_INSTANCE_BEGIN") },
-    { C_STRING_WITH_LEN("bigint") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MYSQL_ERRNO") },
-    { C_STRING_WITH_LEN("int(11)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("RETURNED_SQLSTATE") },
-    { C_STRING_WITH_LEN("varchar(5)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MESSAGE_TEXT") },
-    { C_STRING_WITH_LEN("varchar(128)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("ERRORS") },
-    { C_STRING_WITH_LEN("bigint") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("WARNINGS") },
-    { C_STRING_WITH_LEN("bigint") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("ROWS_AFFECTED") },
-    { C_STRING_WITH_LEN("bigint") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("ROWS_SENT") },
-    { C_STRING_WITH_LEN("bigint") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("ROWS_EXAMINED") },
-    { C_STRING_WITH_LEN("bigint") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("CREATED_TMP_DISK_TABLES") },
-    { C_STRING_WITH_LEN("bigint") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("CREATED_TMP_TABLES") },
-    { C_STRING_WITH_LEN("bigint") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SELECT_FULL_JOIN") },
-    { C_STRING_WITH_LEN("bigint") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SELECT_FULL_RANGE_JOIN") },
-    { C_STRING_WITH_LEN("bigint") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SELECT_RANGE") },
-    { C_STRING_WITH_LEN("bigint") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SELECT_RANGE_CHECK") },
-    { C_STRING_WITH_LEN("bigint") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SELECT_SCAN") },
-    { C_STRING_WITH_LEN("bigint") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SORT_MERGE_PASSES") },
-    { C_STRING_WITH_LEN("bigint") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SORT_RANGE") },
-    { C_STRING_WITH_LEN("bigint") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SORT_ROWS") },
-    { C_STRING_WITH_LEN("bigint") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SORT_SCAN") },
-    { C_STRING_WITH_LEN("bigint") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("NO_INDEX_USED") },
-    { C_STRING_WITH_LEN("bigint") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("NO_GOOD_INDEX_USED") },
-    { C_STRING_WITH_LEN("bigint") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("NESTING_EVENT_ID") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("NESTING_EVENT_TYPE") },
-    { C_STRING_WITH_LEN("enum(\'STATEMENT\',\'STAGE\',\'WAIT\'") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_events_statements_current::m_field_def=
-{40 , field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_events_statements_current::m_share=
 {
@@ -251,8 +43,47 @@ table_events_statements_current::m_share=
   1000, /* records */
   sizeof(PFS_simple_index), /* ref length */
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE events_statements_current("
+                      "THREAD_ID BIGINT unsigned not null,"
+                      "EVENT_ID BIGINT unsigned not null,"
+                      "END_EVENT_ID BIGINT unsigned,"
+                      "EVENT_NAME VARCHAR(128) not null,"
+                      "SOURCE VARCHAR(64),"
+                      "TIMER_START BIGINT unsigned,"
+                      "TIMER_END BIGINT unsigned,"
+                      "TIMER_WAIT BIGINT unsigned,"
+                      "LOCK_TIME bigint unsigned not null,"
+                      "SQL_TEXT LONGTEXT,"
+                      "DIGEST VARCHAR(32),"
+                      "DIGEST_TEXT LONGTEXT,"
+                      "CURRENT_SCHEMA VARCHAR(64),"
+                      "OBJECT_TYPE VARCHAR(64),"
+                      "OBJECT_SCHEMA VARCHAR(64),"
+                      "OBJECT_NAME VARCHAR(64),"
+                      "OBJECT_INSTANCE_BEGIN BIGINT unsigned,"
+                      "MYSQL_ERRNO INTEGER,"
+                      "RETURNED_SQLSTATE VARCHAR(5),"
+                      "MESSAGE_TEXT VARCHAR(128),"
+                      "ERRORS BIGINT unsigned not null,"
+                      "WARNINGS BIGINT unsigned not null,"
+                      "ROWS_AFFECTED BIGINT unsigned not null,"
+                      "ROWS_SENT BIGINT unsigned not null,"
+                      "ROWS_EXAMINED BIGINT unsigned not null,"
+                      "CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
+                      "CREATED_TMP_TABLES BIGINT unsigned not null,"
+                      "SELECT_FULL_JOIN BIGINT unsigned not null,"
+                      "SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
+                      "SELECT_RANGE BIGINT unsigned not null,"
+                      "SELECT_RANGE_CHECK BIGINT unsigned not null,"
+                      "SELECT_SCAN BIGINT unsigned not null,"
+                      "SORT_MERGE_PASSES BIGINT unsigned not null,"
+                      "SORT_RANGE BIGINT unsigned not null,"
+                      "SORT_ROWS BIGINT unsigned not null,"
+                      "SORT_SCAN BIGINT unsigned not null,"
+                      "NO_INDEX_USED BIGINT unsigned not null,"
+                      "NO_GOOD_INDEX_USED BIGINT unsigned not null,"
+                      "NESTING_EVENT_ID BIGINT unsigned,"
+                      "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT'))") }
 };
 
 THR_LOCK table_events_statements_history::m_table_lock;
@@ -269,8 +100,47 @@ table_events_statements_history::m_share=
   1000, /* records */
   sizeof(pos_events_statements_history), /* ref length */
   &m_table_lock,
-  &table_events_statements_current::m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE events_statements_history("
+                      "THREAD_ID BIGINT unsigned not null,"
+                      "EVENT_ID BIGINT unsigned not null,"
+                      "END_EVENT_ID BIGINT unsigned,"
+                      "EVENT_NAME VARCHAR(128) not null,"
+                      "SOURCE VARCHAR(64),"
+                      "TIMER_START BIGINT unsigned,"
+                      "TIMER_END BIGINT unsigned,"
+                      "TIMER_WAIT BIGINT unsigned,"
+                      "LOCK_TIME bigint unsigned not null,"
+                      "SQL_TEXT LONGTEXT,"
+                      "DIGEST VARCHAR(32),"
+                      "DIGEST_TEXT LONGTEXT,"
+                      "CURRENT_SCHEMA VARCHAR(64),"
+                      "OBJECT_TYPE VARCHAR(64),"
+                      "OBJECT_SCHEMA VARCHAR(64),"
+                      "OBJECT_NAME VARCHAR(64),"
+                      "OBJECT_INSTANCE_BEGIN BIGINT unsigned,"
+                      "MYSQL_ERRNO INTEGER,"
+                      "RETURNED_SQLSTATE VARCHAR(5),"
+                      "MESSAGE_TEXT VARCHAR(128),"
+                      "ERRORS BIGINT unsigned not null,"
+                      "WARNINGS BIGINT unsigned not null,"
+                      "ROWS_AFFECTED BIGINT unsigned not null,"
+                      "ROWS_SENT BIGINT unsigned not null,"
+                      "ROWS_EXAMINED BIGINT unsigned not null,"
+                      "CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
+                      "CREATED_TMP_TABLES BIGINT unsigned not null,"
+                      "SELECT_FULL_JOIN BIGINT unsigned not null,"
+                      "SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
+                      "SELECT_RANGE BIGINT unsigned not null,"
+                      "SELECT_RANGE_CHECK BIGINT unsigned not null,"
+                      "SELECT_SCAN BIGINT unsigned not null,"
+                      "SORT_MERGE_PASSES BIGINT unsigned not null,"
+                      "SORT_RANGE BIGINT unsigned not null,"
+                      "SORT_ROWS BIGINT unsigned not null,"
+                      "SORT_SCAN BIGINT unsigned not null,"
+                      "NO_INDEX_USED BIGINT unsigned not null,"
+                      "NO_GOOD_INDEX_USED BIGINT unsigned not null,"
+                      "NESTING_EVENT_ID BIGINT unsigned,"
+                      "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT'))") }
 };
 
 THR_LOCK table_events_statements_history_long::m_table_lock;
@@ -287,8 +157,47 @@ table_events_statements_history_long::m_share=
   10000, /* records */
   sizeof(PFS_simple_index), /* ref length */
   &m_table_lock,
-  &table_events_statements_current::m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE events_statements_history_long("
+                      "THREAD_ID BIGINT unsigned not null,"
+                      "EVENT_ID BIGINT unsigned not null,"
+                      "END_EVENT_ID BIGINT unsigned,"
+                      "EVENT_NAME VARCHAR(128) not null,"
+                      "SOURCE VARCHAR(64),"
+                      "TIMER_START BIGINT unsigned,"
+                      "TIMER_END BIGINT unsigned,"
+                      "TIMER_WAIT BIGINT unsigned,"
+                      "LOCK_TIME bigint unsigned not null,"
+                      "SQL_TEXT LONGTEXT,"
+                      "DIGEST VARCHAR(32),"
+                      "DIGEST_TEXT LONGTEXT,"
+                      "CURRENT_SCHEMA VARCHAR(64),"
+                      "OBJECT_TYPE VARCHAR(64),"
+                      "OBJECT_SCHEMA VARCHAR(64),"
+                      "OBJECT_NAME VARCHAR(64),"
+                      "OBJECT_INSTANCE_BEGIN BIGINT unsigned,"
+                      "MYSQL_ERRNO INTEGER,"
+                      "RETURNED_SQLSTATE VARCHAR(5),"
+                      "MESSAGE_TEXT VARCHAR(128),"
+                      "ERRORS BIGINT unsigned not null,"
+                      "WARNINGS BIGINT unsigned not null,"
+                      "ROWS_AFFECTED BIGINT unsigned not null,"
+                      "ROWS_SENT BIGINT unsigned not null,"
+                      "ROWS_EXAMINED BIGINT unsigned not null,"
+                      "CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
+                      "CREATED_TMP_TABLES BIGINT unsigned not null,"
+                      "SELECT_FULL_JOIN BIGINT unsigned not null,"
+                      "SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
+                      "SELECT_RANGE BIGINT unsigned not null,"
+                      "SELECT_RANGE_CHECK BIGINT unsigned not null,"
+                      "SELECT_SCAN BIGINT unsigned not null,"
+                      "SORT_MERGE_PASSES BIGINT unsigned not null,"
+                      "SORT_RANGE BIGINT unsigned not null,"
+                      "SORT_ROWS BIGINT unsigned not null,"
+                      "SORT_SCAN BIGINT unsigned not null,"
+                      "NO_INDEX_USED BIGINT unsigned not null,"
+                      "NO_GOOD_INDEX_USED BIGINT unsigned not null,"
+                      "NESTING_EVENT_ID BIGINT unsigned,"
+                      "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT'))") }
 };
 
 table_events_statements_common::table_events_statements_common
diff --git a/storage/perfschema/table_events_statements.h b/storage/perfschema/table_events_statements.h
index e33c6b5..e80a67c 100644
--- a/storage/perfschema/table_events_statements.h
+++ b/storage/perfschema/table_events_statements.h
@@ -212,12 +212,6 @@ private:
 
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /**
-    Fields definition.
-    Also used by table_events_statements_history
-    and table_events_statements_history_long.
-  */
-  static TABLE_FIELD_DEF m_field_def;
 
   void make_row(PFS_thread* pfs_thread, PFS_events_statements *statement);
 
diff --git a/storage/perfschema/table_events_waits.cc b/storage/perfschema/table_events_waits.cc
index 35b9081..8e2d006 100644
--- a/storage/perfschema/table_events_waits.cc
+++ b/storage/perfschema/table_events_waits.cc
@@ -30,109 +30,6 @@
 
 THR_LOCK table_events_waits_current::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("THREAD_ID") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("EVENT_ID") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("END_EVENT_ID") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("EVENT_NAME") },
-    { C_STRING_WITH_LEN("varchar(128)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SOURCE") },
-    { C_STRING_WITH_LEN("varchar(64)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("TIMER_START") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("TIMER_END") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SPINS") },
-    { C_STRING_WITH_LEN("int(10)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("OBJECT_SCHEMA") },
-    { C_STRING_WITH_LEN("varchar(64)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("OBJECT_NAME") },
-    { C_STRING_WITH_LEN("varchar(512)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("INDEX_NAME") },
-    { C_STRING_WITH_LEN("varchar(64)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("OBJECT_TYPE") },
-    { C_STRING_WITH_LEN("varchar(64)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("OBJECT_INSTANCE_BEGIN") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("NESTING_EVENT_ID") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("NESTING_EVENT_TYPE") },
-    { C_STRING_WITH_LEN("enum(\'STATEMENT\',\'STAGE\',\'WAIT\'") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("OPERATION") },
-    { C_STRING_WITH_LEN("varchar(32)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("NUMBER_OF_BYTES") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("FLAGS") },
-    { C_STRING_WITH_LEN("int(10)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_events_waits_current::m_field_def=
-{ 19, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_events_waits_current::m_share=
 {
@@ -145,8 +42,26 @@ table_events_waits_current::m_share=
   1000, /* records */
   sizeof(pos_events_waits_current), /* ref length */
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE events_waits_current("
+                      "THREAD_ID BIGINT unsigned not null,"
+                      "EVENT_ID BIGINT unsigned not null,"
+                      "END_EVENT_ID BIGINT unsigned,"
+                      "EVENT_NAME VARCHAR(128) not null,"
+                      "SOURCE VARCHAR(64),"
+                      "TIMER_START BIGINT unsigned,"
+                      "TIMER_END BIGINT unsigned,"
+                      "TIMER_WAIT BIGINT unsigned,"
+                      "SPINS INTEGER unsigned,"
+                      "OBJECT_SCHEMA VARCHAR(64),"
+                      "OBJECT_NAME VARCHAR(512),"
+                      "INDEX_NAME VARCHAR(64),"
+                      "OBJECT_TYPE VARCHAR(64),"
+                      "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
+                      "NESTING_EVENT_ID BIGINT unsigned,"
+                      "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT'),"
+                      "OPERATION VARCHAR(32) not null,"
+                      "NUMBER_OF_BYTES BIGINT,"
+                      "FLAGS INTEGER unsigned)") }
 };
 
 THR_LOCK table_events_waits_history::m_table_lock;
@@ -163,8 +78,26 @@ table_events_waits_history::m_share=
   1000, /* records */
   sizeof(pos_events_waits_history), /* ref length */
   &m_table_lock,
-  &table_events_waits_current::m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE events_waits_history("
+                      "THREAD_ID BIGINT unsigned not null,"
+                      "EVENT_ID BIGINT unsigned not null,"
+                      "END_EVENT_ID BIGINT unsigned,"
+                      "EVENT_NAME VARCHAR(128) not null,"
+                      "SOURCE VARCHAR(64),"
+                      "TIMER_START BIGINT unsigned,"
+                      "TIMER_END BIGINT unsigned,"
+                      "TIMER_WAIT BIGINT unsigned,"
+                      "SPINS INTEGER unsigned,"
+                      "OBJECT_SCHEMA VARCHAR(64),"
+                      "OBJECT_NAME VARCHAR(512),"
+                      "INDEX_NAME VARCHAR(64),"
+                      "OBJECT_TYPE VARCHAR(64),"
+                      "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
+                      "NESTING_EVENT_ID BIGINT unsigned,"
+                      "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT'),"
+                      "OPERATION VARCHAR(32) not null,"
+                      "NUMBER_OF_BYTES BIGINT,"
+                      "FLAGS INTEGER unsigned)") }
 };
 
 THR_LOCK table_events_waits_history_long::m_table_lock;
@@ -181,8 +114,26 @@ table_events_waits_history_long::m_share=
   10000, /* records */
   sizeof(PFS_simple_index), /* ref length */
   &m_table_lock,
-  &table_events_waits_current::m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE events_waits_history_long("
+                      "THREAD_ID BIGINT unsigned not null,"
+                      "EVENT_ID BIGINT unsigned not null,"
+                      "END_EVENT_ID BIGINT unsigned,"
+                      "EVENT_NAME VARCHAR(128) not null,"
+                      "SOURCE VARCHAR(64),"
+                      "TIMER_START BIGINT unsigned,"
+                      "TIMER_END BIGINT unsigned,"
+                      "TIMER_WAIT BIGINT unsigned,"
+                      "SPINS INTEGER unsigned,"
+                      "OBJECT_SCHEMA VARCHAR(64),"
+                      "OBJECT_NAME VARCHAR(512),"
+                      "INDEX_NAME VARCHAR(64),"
+                      "OBJECT_TYPE VARCHAR(64),"
+                      "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
+                      "NESTING_EVENT_ID BIGINT unsigned,"
+                      "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT'),"
+                      "OPERATION VARCHAR(32) not null,"
+                      "NUMBER_OF_BYTES BIGINT,"
+                      "FLAGS INTEGER unsigned)") }
 };
 
 table_events_waits_common::table_events_waits_common
diff --git a/storage/perfschema/table_events_waits.h b/storage/perfschema/table_events_waits.h
index 065bf95..6065727 100644
--- a/storage/perfschema/table_events_waits.h
+++ b/storage/perfschema/table_events_waits.h
@@ -182,12 +182,6 @@ private:
 
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /**
-    Fields definition.
-    Also used by table_events_waits_history
-    and table_events_waits_history_long.
-  */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current position. */
   pos_events_waits_current m_pos;
diff --git a/storage/perfschema/table_events_waits_summary.cc b/storage/perfschema/table_events_waits_summary.cc
index a7130c1..516b271 100644
--- a/storage/perfschema/table_events_waits_summary.cc
+++ b/storage/perfschema/table_events_waits_summary.cc
@@ -28,49 +28,6 @@
 
 THR_LOCK table_events_waits_summary_by_instance::m_table_lock;
 
-static const TABLE_FIELD_TYPE ews_by_instance_field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("EVENT_NAME") },
-    { C_STRING_WITH_LEN("varchar(128)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("OBJECT_INSTANCE_BEGIN") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_STAR") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_events_waits_summary_by_instance::m_field_def=
-{ 7, ews_by_instance_field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_events_waits_summary_by_instance::m_share=
 {
@@ -83,8 +40,14 @@ table_events_waits_summary_by_instance::m_share=
   1000, /* records */
   sizeof(pos_all_instr),
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE events_waits_summary_by_instance("
+                      "EVENT_NAME VARCHAR(128) not null,"
+                      "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
+                      "COUNT_STAR BIGINT unsigned not null,"
+                      "SUM_TIMER_WAIT BIGINT unsigned not null,"
+                      "MIN_TIMER_WAIT BIGINT unsigned not null,"
+                      "AVG_TIMER_WAIT BIGINT unsigned not null,"
+                      "MAX_TIMER_WAIT BIGINT unsigned not null)") }
 };
 
 PFS_engine_table* table_events_waits_summary_by_instance::create(void)
diff --git a/storage/perfschema/table_events_waits_summary.h b/storage/perfschema/table_events_waits_summary.h
index 7463ace..9d3a288 100644
--- a/storage/perfschema/table_events_waits_summary.h
+++ b/storage/perfschema/table_events_waits_summary.h
@@ -79,8 +79,6 @@ public:
 private:
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_events_waits_summary_by_instance m_row;
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 251fbc7..7f79fec 100644
--- a/storage/perfschema/table_ews_by_account_by_event_name.cc
+++ b/storage/perfschema/table_ews_by_account_by_event_name.cc
@@ -29,54 +29,6 @@
 
 THR_LOCK table_ews_by_account_by_event_name::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("USER") },
-    { C_STRING_WITH_LEN("char(16)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("HOST") },
-    { C_STRING_WITH_LEN("char(60)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("EVENT_NAME") },
-    { C_STRING_WITH_LEN("varchar(128)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_STAR") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_ews_by_account_by_event_name::m_field_def=
-{ 8, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_ews_by_account_by_event_name::m_share=
 {
@@ -89,8 +41,15 @@ table_ews_by_account_by_event_name::m_share=
   1000, /* records */
   sizeof(pos_ews_by_account_by_event_name),
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE events_waits_summary_by_account_by_event_name("
+                      "USER CHAR(16) collate utf8_bin default null,"
+                      "HOST CHAR(60) collate utf8_bin default null,"
+                      "EVENT_NAME VARCHAR(128) not null,"
+                      "COUNT_STAR BIGINT unsigned not null,"
+                      "SUM_TIMER_WAIT BIGINT unsigned not null,"
+                      "MIN_TIMER_WAIT BIGINT unsigned not null,"
+                      "AVG_TIMER_WAIT BIGINT unsigned not null,"
+                      "MAX_TIMER_WAIT BIGINT unsigned not null)") }
 };
 
 PFS_engine_table*
diff --git a/storage/perfschema/table_ews_by_account_by_event_name.h b/storage/perfschema/table_ews_by_account_by_event_name.h
index 8ccfee5..40283c3 100644
--- a/storage/perfschema/table_ews_by_account_by_event_name.h
+++ b/storage/perfschema/table_ews_by_account_by_event_name.h
@@ -119,8 +119,6 @@ protected:
 private:
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_ews_by_account_by_event_name m_row;
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 38f94eb..61ac784 100644
--- a/storage/perfschema/table_ews_by_host_by_event_name.cc
+++ b/storage/perfschema/table_ews_by_host_by_event_name.cc
@@ -30,49 +30,6 @@
 
 THR_LOCK table_ews_by_host_by_event_name::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("HOST") },
-    { C_STRING_WITH_LEN("char(60)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("EVENT_NAME") },
-    { C_STRING_WITH_LEN("varchar(128)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_STAR") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_ews_by_host_by_event_name::m_field_def=
-{ 7, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_ews_by_host_by_event_name::m_share=
 {
@@ -85,8 +42,14 @@ table_ews_by_host_by_event_name::m_share=
   1000, /* records */
   sizeof(pos_ews_by_host_by_event_name),
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE events_waits_summary_by_host_by_event_name("
+                      "HOST CHAR(60) collate utf8_bin default null,"
+                      "EVENT_NAME VARCHAR(128) not null,"
+                      "COUNT_STAR BIGINT unsigned not null,"
+                      "SUM_TIMER_WAIT BIGINT unsigned not null,"
+                      "MIN_TIMER_WAIT BIGINT unsigned not null,"
+                      "AVG_TIMER_WAIT BIGINT unsigned not null,"
+                      "MAX_TIMER_WAIT BIGINT unsigned not null)") }
 };
 
 PFS_engine_table*
diff --git a/storage/perfschema/table_ews_by_host_by_event_name.h b/storage/perfschema/table_ews_by_host_by_event_name.h
index 124b121..c93afaf 100644
--- a/storage/perfschema/table_ews_by_host_by_event_name.h
+++ b/storage/perfschema/table_ews_by_host_by_event_name.h
@@ -119,8 +119,6 @@ protected:
 private:
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_ews_by_host_by_event_name m_row;
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 3f21b06..833cdb3 100644
--- a/storage/perfschema/table_ews_by_thread_by_event_name.cc
+++ b/storage/perfschema/table_ews_by_thread_by_event_name.cc
@@ -29,49 +29,6 @@
 
 THR_LOCK table_ews_by_thread_by_event_name::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("THREAD_ID") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("EVENT_NAME") },
-    { C_STRING_WITH_LEN("varchar(128)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_STAR") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_ews_by_thread_by_event_name::m_field_def=
-{ 7, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_ews_by_thread_by_event_name::m_share=
 {
@@ -84,8 +41,14 @@ table_ews_by_thread_by_event_name::m_share=
   1000, /* records */
   sizeof(pos_ews_by_thread_by_event_name),
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE events_waits_summary_by_thread_by_event_name("
+                      "THREAD_ID BIGINT unsigned not null,"
+                      "EVENT_NAME VARCHAR(128) not null,"
+                      "COUNT_STAR BIGINT unsigned not null,"
+                      "SUM_TIMER_WAIT BIGINT unsigned not null,"
+                      "MIN_TIMER_WAIT BIGINT unsigned not null,"
+                      "AVG_TIMER_WAIT BIGINT unsigned not null,"
+                      "MAX_TIMER_WAIT BIGINT unsigned not null)") }
 };
 
 PFS_engine_table*
diff --git a/storage/perfschema/table_ews_by_thread_by_event_name.h b/storage/perfschema/table_ews_by_thread_by_event_name.h
index 989356b..c584b50 100644
--- a/storage/perfschema/table_ews_by_thread_by_event_name.h
+++ b/storage/perfschema/table_ews_by_thread_by_event_name.h
@@ -118,8 +118,6 @@ protected:
 private:
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_ews_by_thread_by_event_name m_row;
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 b836506..82d4768 100644
--- a/storage/perfschema/table_ews_by_user_by_event_name.cc
+++ b/storage/perfschema/table_ews_by_user_by_event_name.cc
@@ -30,49 +30,6 @@
 
 THR_LOCK table_ews_by_user_by_event_name::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("USER") },
-    { C_STRING_WITH_LEN("char(16)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("EVENT_NAME") },
-    { C_STRING_WITH_LEN("varchar(128)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_STAR") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_ews_by_user_by_event_name::m_field_def=
-{ 7, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_ews_by_user_by_event_name::m_share=
 {
@@ -85,8 +42,14 @@ table_ews_by_user_by_event_name::m_share=
   1000, /* records */
   sizeof(pos_ews_by_user_by_event_name),
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE events_waits_summary_by_user_by_event_name("
+                      "USER CHAR(16) collate utf8_bin default null,"
+                      "EVENT_NAME VARCHAR(128) not null,"
+                      "COUNT_STAR BIGINT unsigned not null,"
+                      "SUM_TIMER_WAIT BIGINT unsigned not null,"
+                      "MIN_TIMER_WAIT BIGINT unsigned not null,"
+                      "AVG_TIMER_WAIT BIGINT unsigned not null,"
+                      "MAX_TIMER_WAIT BIGINT unsigned not null)") }
 };
 
 PFS_engine_table*
diff --git a/storage/perfschema/table_ews_by_user_by_event_name.h b/storage/perfschema/table_ews_by_user_by_event_name.h
index 123ee23..4fe4613 100644
--- a/storage/perfschema/table_ews_by_user_by_event_name.h
+++ b/storage/perfschema/table_ews_by_user_by_event_name.h
@@ -119,8 +119,6 @@ protected:
 private:
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_ews_by_user_by_event_name m_row;
diff --git a/storage/perfschema/table_ews_global_by_event_name.cc b/storage/perfschema/table_ews_global_by_event_name.cc
index bc5c378..ebd855f 100644
--- a/storage/perfschema/table_ews_global_by_event_name.cc
+++ b/storage/perfschema/table_ews_global_by_event_name.cc
@@ -31,44 +31,6 @@
 
 THR_LOCK table_ews_global_by_event_name::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("EVENT_NAME") },
-    { C_STRING_WITH_LEN("varchar(128)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_STAR") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_ews_global_by_event_name::m_field_def=
-{ 6, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_ews_global_by_event_name::m_share=
 {
@@ -81,8 +43,13 @@ table_ews_global_by_event_name::m_share=
   1000, /* records */
   sizeof(pos_ews_global_by_event_name),
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE events_waits_summary_global_by_event_name("
+                      "EVENT_NAME VARCHAR(128) not null,"
+                      "COUNT_STAR BIGINT unsigned not null,"
+                      "SUM_TIMER_WAIT BIGINT unsigned not null,"
+                      "MIN_TIMER_WAIT BIGINT unsigned not null,"
+                      "AVG_TIMER_WAIT BIGINT unsigned not null,"
+                      "MAX_TIMER_WAIT BIGINT unsigned not null)") }
 };
 
 PFS_engine_table*
diff --git a/storage/perfschema/table_ews_global_by_event_name.h b/storage/perfschema/table_ews_global_by_event_name.h
index a118e53..538f1f1 100644
--- a/storage/perfschema/table_ews_global_by_event_name.h
+++ b/storage/perfschema/table_ews_global_by_event_name.h
@@ -111,8 +111,6 @@ protected:
 private:
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_ews_global_by_event_name m_row;
diff --git a/storage/perfschema/table_file_instances.cc b/storage/perfschema/table_file_instances.cc
index 5b13210..4b5ecf3 100644
--- a/storage/perfschema/table_file_instances.cc
+++ b/storage/perfschema/table_file_instances.cc
@@ -28,29 +28,6 @@
 
 THR_LOCK table_file_instances::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("FILE_NAME") },
-    { C_STRING_WITH_LEN("varchar(512)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("EVENT_NAME") },
-    { C_STRING_WITH_LEN("varchar(128)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("OPEN_COUNT") },
-    { C_STRING_WITH_LEN("int(10)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_file_instances::m_field_def=
-{ 3, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_file_instances::m_share=
 {
@@ -63,8 +40,10 @@ table_file_instances::m_share=
   1000, /* records */
   sizeof(PFS_simple_index),
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE file_instances("
+                      "FILE_NAME VARCHAR(512) not null,"
+                      "EVENT_NAME VARCHAR(128) not null,"
+                      "OPEN_COUNT INTEGER unsigned not null)") }
 };
 
 PFS_engine_table* table_file_instances::create(void)
diff --git a/storage/perfschema/table_file_instances.h b/storage/perfschema/table_file_instances.h
index f7ec167..988c03b 100644
--- a/storage/perfschema/table_file_instances.h
+++ b/storage/perfschema/table_file_instances.h
@@ -73,8 +73,6 @@ private:
 
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_file_instances m_row;
diff --git a/storage/perfschema/table_file_summary.cc b/storage/perfschema/table_file_summary.cc
deleted file mode 100644
index 104fa0f..0000000
--- a/storage/perfschema/table_file_summary.cc
+++ /dev/null
@@ -1,372 +0,0 @@
-/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; version 2 of the License.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program; if not, write to the Free Software Foundation,
-  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
-
-/**
-  @file storage/perfschema/table_file_summary.cc
-  Table FILE_SUMMARY_BY_xxx (implementation).
-*/
-
-#include "my_global.h"
-#include "my_pthread.h"
-#include "pfs_instr_class.h"
-#include "pfs_column_types.h"
-#include "pfs_column_values.h"
-#include "table_file_summary.h"
-#include "pfs_global.h"
-
-THR_LOCK table_file_summary_by_event_name::m_table_lock;
-
-static const TABLE_FIELD_TYPE fs_by_event_name_field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("EVENT_NAME") },
-    { C_STRING_WITH_LEN("varchar(128)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NUMBER_OF_BYTES_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NUMBER_OF_BYTES_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_file_summary_by_event_name::m_field_def=
-{ 5, fs_by_event_name_field_types, 0, (uint*) 0 };
-
-PFS_engine_table_share
-table_file_summary_by_event_name::m_share=
-{
-  { C_STRING_WITH_LEN("file_summary_by_event_name") },
-  &pfs_truncatable_acl,
-  &table_file_summary_by_event_name::create,
-  NULL, /* write_row */
-  table_file_summary_by_event_name::delete_all_rows,
-  1000, /* records */
-  sizeof(PFS_simple_index),
-  &m_table_lock,
-  &m_field_def,
-  false /* checked */
-};
-
-PFS_engine_table* table_file_summary_by_event_name::create(void)
-{
-  return new table_file_summary_by_event_name();
-}
-
-int table_file_summary_by_event_name::delete_all_rows(void)
-{
-  reset_file_class_io();
-  return 0;
-}
-
-table_file_summary_by_event_name::table_file_summary_by_event_name()
-  : PFS_engine_table(&m_share, &m_pos),
-  m_pos(1), m_next_pos(1)
-{}
-
-void table_file_summary_by_event_name::reset_position(void)
-{
-  m_pos.m_index= 1;
-  m_next_pos.m_index= 1;
-}
-
-int table_file_summary_by_event_name::rnd_next(void)
-{
-  PFS_file_class *file_class;
-
-  m_pos.set_at(&m_next_pos);
-
-  file_class= find_file_class(m_pos.m_index);
-  if (file_class)
-  {
-    make_row(file_class);
-    m_next_pos.set_after(&m_pos);
-    return 0;
-  }
-
-  return HA_ERR_END_OF_FILE;
-}
-
-int table_file_summary_by_event_name::rnd_pos(const void *pos)
-{
-  PFS_file_class *file_class;
-
-  set_position(pos);
-
-  file_class= find_file_class(m_pos.m_index);
-  if (file_class)
-  {
-    make_row(file_class);
-    return 0;
-  }
-
-  return HA_ERR_RECORD_DELETED;
-}
-
-/**
-  Build a row.
-  @param klass            the file class the cursor is reading
-*/
-void table_file_summary_by_event_name::make_row(PFS_file_class *klass)
-{
-  m_row.m_name= &klass->m_name[0];
-  m_row.m_name_length= klass->m_name_length;
-  m_row.m_file_stat= klass->m_file_stat;
-}
-
-int table_file_summary_by_event_name::read_row_values(TABLE *table,
-                                                      unsigned char *,
-                                                      Field **fields,
-                                                      bool read_all)
-{
-  Field *f;
-
-  /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 0);
-
-  /* The row always exists for classes */
-
-  for (; (f= *fields) ; fields++)
-  {
-    if (read_all || bitmap_is_set(table->read_set, f->field_index))
-    {
-      switch(f->field_index)
-      {
-      case 0: /* NAME */
-        set_field_varchar_utf8(f, m_row.m_name, m_row.m_name_length);
-        break;
-      case 1: /* COUNT_READ */
-        set_field_ulonglong(f, m_row.m_file_stat.m_count_read);
-        break;
-      case 2: /* COUNT_WRITE */
-        set_field_ulonglong(f, m_row.m_file_stat.m_count_write);
-        break;
-      case 3: /* READ_BYTES */
-        set_field_ulonglong(f, m_row.m_file_stat.m_read_bytes);
-        break;
-      case 4: /* WRITE_BYTES */
-        set_field_ulonglong(f, m_row.m_file_stat.m_write_bytes);
-        break;
-      default:
-        DBUG_ASSERT(false);
-      }
-    }
-  }
-
-  return 0;
-}
-
-THR_LOCK table_file_summary_by_instance::m_table_lock;
-
-static const TABLE_FIELD_TYPE fs_by_instance_field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("FILE_NAME") },
-    { C_STRING_WITH_LEN("varchar(512)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("EVENT_NAME") },
-    { C_STRING_WITH_LEN("varchar(128)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NUMBER_OF_BYTES_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NUMBER_OF_BYTES_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_file_summary_by_instance::m_field_def=
-{ 6, fs_by_instance_field_types, 0, (uint*) 0 };
-
-PFS_engine_table_share
-table_file_summary_by_instance::m_share=
-{
-  { C_STRING_WITH_LEN("file_summary_by_instance") },
-  &pfs_truncatable_acl,
-  &table_file_summary_by_instance::create,
-  NULL, /* write_row */
-  table_file_summary_by_instance::delete_all_rows,
-  1000, /* records */
-  sizeof(PFS_simple_index),
-  &m_table_lock,
-  &m_field_def,
-  false /* checked */
-};
-
-PFS_engine_table* table_file_summary_by_instance::create(void)
-{
-  return new table_file_summary_by_instance();
-}
-
-int table_file_summary_by_instance::delete_all_rows(void)
-{
-  reset_file_instance_io();
-  return 0;
-}
-
-table_file_summary_by_instance::table_file_summary_by_instance()
-  : PFS_engine_table(&m_share, &m_pos),
-  m_row_exists(false), m_pos(0), m_next_pos(0)
-{}
-
-void table_file_summary_by_instance::reset_position(void)
-{
-  m_pos.m_index= 0;
-  m_next_pos.m_index= 0;
-}
-
-int table_file_summary_by_instance::rnd_next(void)
-{
-  PFS_file *pfs;
-
-  for (m_pos.set_at(&m_next_pos);
-       m_pos.m_index < file_max;
-       m_pos.next())
-  {
-    pfs= &file_array[m_pos.m_index];
-    if (pfs->m_lock.is_populated())
-    {
-      make_row(pfs);
-      m_next_pos.set_after(&m_pos);
-      return 0;
-    }
-  }
-
-  return HA_ERR_END_OF_FILE;
-}
-
-int table_file_summary_by_instance::rnd_pos(const void *pos)
-{
-  PFS_file *pfs;
-
-  set_position(pos);
-  DBUG_ASSERT(m_pos.m_index < file_max);
-  pfs= &file_array[m_pos.m_index];
-
-  if (! pfs->m_lock.is_populated())
-    return HA_ERR_RECORD_DELETED;
-
-  make_row(pfs);
-  return 0;
-}
-
-/**
-  Build a row.
-  @param pfs              the file the cursor is reading
-*/
-void table_file_summary_by_instance::make_row(PFS_file *pfs)
-{
-  pfs_lock lock;
-  PFS_file_class *safe_class;
-
-  m_row_exists= false;
-
-  /* Protect this reader against a file delete */
-  pfs->m_lock.begin_optimistic_lock(&lock);
-
-  safe_class= sanitize_file_class(pfs->m_class);
-  if (unlikely(safe_class == NULL))
-    return;
-
-  m_row.m_filename= pfs->m_filename;
-  m_row.m_filename_length= pfs->m_filename_length;
-  m_row.m_name= safe_class->m_name;
-  m_row.m_name_length= safe_class->m_name_length;
-  m_row.m_file_stat= pfs->m_file_stat;
-
-  if (pfs->m_lock.end_optimistic_lock(&lock))
-    m_row_exists= true;
-}
-
-int table_file_summary_by_instance::read_row_values(TABLE *table,
-                                                          unsigned char *,
-                                                          Field **fields,
-                                                          bool read_all)
-{
-  Field *f;
-
-  if (unlikely(! m_row_exists))
-    return HA_ERR_RECORD_DELETED;
-
-  /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 0);
-
-  for (; (f= *fields) ; fields++)
-  {
-    if (read_all || bitmap_is_set(table->read_set, f->field_index))
-    {
-      switch(f->field_index)
-      {
-      case 0: /* FILENAME */
-        set_field_varchar_utf8(f, m_row.m_filename, m_row.m_filename_length);
-        break;
-      case 1: /* NAME */
-        set_field_varchar_utf8(f, m_row.m_name, m_row.m_name_length);
-        break;
-      case 2: /* COUNT_READ */
-        set_field_ulonglong(f, m_row.m_file_stat.m_count_read);
-        break;
-      case 3: /* COUNT_WRITE */
-        set_field_ulonglong(f, m_row.m_file_stat.m_count_write);
-        break;
-      case 4: /* READ_BYTES */
-        set_field_ulonglong(f, m_row.m_file_stat.m_read_bytes);
-        break;
-      case 5: /* WRITE_BYTES */
-        set_field_ulonglong(f, m_row.m_file_stat.m_write_bytes);
-        break;
-      default:
-        DBUG_ASSERT(false);
-      }
-    }
-  }
-
-  return 0;
-}
-
diff --git a/storage/perfschema/table_file_summary.h b/storage/perfschema/table_file_summary.h
deleted file mode 100644
index 9283718..0000000
--- a/storage/perfschema/table_file_summary.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; version 2 of the License.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program; if not, write to the Free Software Foundation,
-  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
-
-#ifndef TABLE_FILE_SUMMARY_H
-#define TABLE_FILE_SUMMARY_H
-
-/**
-  @file storage/perfschema/table_file_summary.h
-  Table FILE_SUMMARY_BY_xxx (declarations).
-*/
-
-#include "pfs_column_types.h"
-#include "pfs_engine_table.h"
-#include "pfs_instr_class.h"
-#include "pfs_instr.h"
-
-/**
-  @addtogroup Performance_schema_tables
-  @{
-*/
-
-/** A row of PERFORMANCE_SCHEMA.FILE_SUMMARY_BY_EVENT_NAME. */
-struct row_file_summary_by_event_name
-{
-  /** Column EVENT_NAME. */
-  const char *m_name;
-  /** Length in bytes of @c m_name. */
-  uint m_name_length;
-  /**
-    Columns COUNT_READ, COUNT_WRITE,
-    SUM_NUMBER_OF_BYTES_READ, SUM_NUMBER_OF_BYTES_WRITE.
-  */
-  PFS_file_stat m_file_stat;
-};
-
-/** Table PERFORMANCE_SCHEMA.FILE_SUMMARY_BY_EVENT_NAME. */
-class table_file_summary_by_event_name : public PFS_engine_table
-{
-public:
-  /** Table share */
-  static PFS_engine_table_share m_share;
-  static PFS_engine_table* create();
-  static int delete_all_rows();
-
-  virtual int rnd_next();
-  virtual int rnd_pos(const void *pos);
-  virtual void reset_position(void);
-
-protected:
-  void make_row(PFS_file_class *klass);
-
-  virtual int read_row_values(TABLE *table,
-                              unsigned char *buf,
-                              Field **fields,
-                              bool read_all);
-
-  table_file_summary_by_event_name();
-
-public:
-  ~table_file_summary_by_event_name()
-  {}
-
-private:
-  /** Table share lock. */
-  static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
-
-  /** Current row. */
-  row_file_summary_by_event_name m_row;
-  /** Current position. */
-  PFS_simple_index m_pos;
-  /** Next position. */
-  PFS_simple_index m_next_pos;
-};
-
-/** A row of PERFORMANCE_SCHEMA.FILE_SUMMARY_BY_INSTANCE. */
-struct row_file_summary_by_instance
-{
-  /** Column FILE_NAME. */
-  const char *m_filename;
-  /** Length in bytes of @c m_filename. */
-  uint m_filename_length;
-  /** Column EVENT_NAME. */
-  const char *m_name;
-  /** Length in bytes of @c m_name. */
-  uint m_name_length;
-  /**
-    Columns COUNT_READ, COUNT_WRITE,
-    SUM_NUMBER_OF_BYTES_READ, SUM_NUMBER_OF_BYTES_WRITE.
-  */
-  PFS_file_stat m_file_stat;
-};
-
-/** Table PERFORMANCE_SCHEMA.FILE_UMMARY_BY_INSTANCE. */
-class table_file_summary_by_instance : public PFS_engine_table
-{
-public:
-  /** Table share */
-  static PFS_engine_table_share m_share;
-  static PFS_engine_table* create();
-  static int delete_all_rows();
-
-  virtual int rnd_next();
-  virtual int rnd_pos(const void *pos);
-  virtual void reset_position(void);
-
-protected:
-  void make_row(PFS_file *pfs);
-
-  virtual int read_row_values(TABLE *table,
-                              unsigned char *buf,
-                              Field **fields,
-                              bool read_all);
-
-  table_file_summary_by_instance();
-
-public:
-  ~table_file_summary_by_instance()
-  {}
-
-private:
-  /** Table share lock. */
-  static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
-
-  /** Current row. */
-  row_file_summary_by_instance m_row;
-  /** True is the current row exists. */
-  bool m_row_exists;
-  /** Current position. */
-  PFS_simple_index m_pos;
-  /** Next position. */
-  PFS_simple_index m_next_pos;
-};
-
-/** @} */
-#endif
diff --git a/storage/perfschema/table_file_summary_by_event_name.cc b/storage/perfschema/table_file_summary_by_event_name.cc
index 33bee17..2e46c7c 100644
--- a/storage/perfschema/table_file_summary_by_event_name.cc
+++ b/storage/perfschema/table_file_summary_by_event_name.cc
@@ -29,135 +29,6 @@
 
 THR_LOCK table_file_summary_by_event_name::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("EVENT_NAME") },
-    { C_STRING_WITH_LEN("varchar(128)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_STAR") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-
-  /** Read */
-  {
-    { C_STRING_WITH_LEN("COUNT_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NUMBER_OF_BYTES_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-
-  /** Write */
-  {
-    { C_STRING_WITH_LEN("COUNT_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NUMBER_OF_BYTES_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-
-  /** Misc */
-  {
-    { C_STRING_WITH_LEN("COUNT_MISC") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_MISC") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_MISC") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_MISC") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_MISC") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_file_summary_by_event_name::m_field_def=
-{ 23, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_file_summary_by_event_name::m_share=
 {
@@ -170,8 +41,30 @@ table_file_summary_by_event_name::m_share=
   1000, /* records */
   sizeof(PFS_simple_index),
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE file_summary_by_event_name("
+                      "EVENT_NAME VARCHAR(128) not null,"
+                      "COUNT_STAR BIGINT unsigned not null,"
+                      "SUM_TIMER_WAIT BIGINT unsigned not null,"
+                      "MIN_TIMER_WAIT BIGINT unsigned not null,"
+                      "AVG_TIMER_WAIT BIGINT unsigned not null,"
+                      "MAX_TIMER_WAIT BIGINT unsigned not null,"
+                      "COUNT_READ BIGINT unsigned not null,"
+                      "SUM_TIMER_READ BIGINT unsigned not null,"
+                      "MIN_TIMER_READ BIGINT unsigned not null,"
+                      "AVG_TIMER_READ BIGINT unsigned not null,"
+                      "MAX_TIMER_READ BIGINT unsigned not null,"
+                      "SUM_NUMBER_OF_BYTES_READ BIGINT not null,"
+                      "COUNT_WRITE BIGINT unsigned not null,"
+                      "SUM_TIMER_WRITE BIGINT unsigned not null,"
+                      "MIN_TIMER_WRITE BIGINT unsigned not null,"
+                      "AVG_TIMER_WRITE BIGINT unsigned not null,"
+                      "MAX_TIMER_WRITE BIGINT unsigned not null,"
+                      "SUM_NUMBER_OF_BYTES_WRITE BIGINT not null,"
+                      "COUNT_MISC BIGINT unsigned not null,"
+                      "SUM_TIMER_MISC BIGINT unsigned not null,"
+                      "MIN_TIMER_MISC BIGINT unsigned not null,"
+                      "AVG_TIMER_MISC BIGINT unsigned not null,"
+                      "MAX_TIMER_MISC BIGINT unsigned not null)") }
 };
 
 PFS_engine_table* table_file_summary_by_event_name::create(void)
diff --git a/storage/perfschema/table_file_summary_by_event_name.h b/storage/perfschema/table_file_summary_by_event_name.h
index 8a51dff..2c6f3b2 100644
--- a/storage/perfschema/table_file_summary_by_event_name.h
+++ b/storage/perfschema/table_file_summary_by_event_name.h
@@ -74,8 +74,6 @@ private:
 
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_file_summary_by_event_name m_row;
diff --git a/storage/perfschema/table_file_summary_by_instance.cc b/storage/perfschema/table_file_summary_by_instance.cc
index c0bf1c2..c69aa64 100644
--- a/storage/perfschema/table_file_summary_by_instance.cc
+++ b/storage/perfschema/table_file_summary_by_instance.cc
@@ -28,145 +28,6 @@
 
 THR_LOCK table_file_summary_by_instance::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("FILE_NAME") },
-    { C_STRING_WITH_LEN("varchar(512)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("EVENT_NAME") },
-    { C_STRING_WITH_LEN("varchar(128)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("OBJECT_INSTANCE_BEGIN") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_STAR") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-
-  /** Read */
-  {
-    { C_STRING_WITH_LEN("COUNT_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NUMBER_OF_BYTES_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-
-  /** Write */
-  {
-    { C_STRING_WITH_LEN("COUNT_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NUMBER_OF_BYTES_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-
-  /** Misc */
-  {
-    { C_STRING_WITH_LEN("COUNT_MISC") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_MISC") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_MISC") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_MISC") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_MISC") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_file_summary_by_instance::m_field_def=
-{ 25, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_file_summary_by_instance::m_share=
 {
@@ -179,8 +40,32 @@ table_file_summary_by_instance::m_share=
   1000, /* records */
   sizeof(PFS_simple_index),
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE file_summary_by_instance("
+                      "FILE_NAME VARCHAR(512) not null,"
+                      "EVENT_NAME VARCHAR(128) not null,"
+                      "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
+                      "COUNT_STAR BIGINT unsigned not null,"
+                      "SUM_TIMER_WAIT BIGINT unsigned not null,"
+                      "MIN_TIMER_WAIT BIGINT unsigned not null,"
+                      "AVG_TIMER_WAIT BIGINT unsigned not null,"
+                      "MAX_TIMER_WAIT BIGINT unsigned not null,"
+                      "COUNT_READ BIGINT unsigned not null,"
+                      "SUM_TIMER_READ BIGINT unsigned not null,"
+                      "MIN_TIMER_READ BIGINT unsigned not null,"
+                      "AVG_TIMER_READ BIGINT unsigned not null,"
+                      "MAX_TIMER_READ BIGINT unsigned not null,"
+                      "SUM_NUMBER_OF_BYTES_READ BIGINT not null,"
+                      "COUNT_WRITE BIGINT unsigned not null,"
+                      "SUM_TIMER_WRITE BIGINT unsigned not null,"
+                      "MIN_TIMER_WRITE BIGINT unsigned not null,"
+                      "AVG_TIMER_WRITE BIGINT unsigned not null,"
+                      "MAX_TIMER_WRITE BIGINT unsigned not null,"
+                      "SUM_NUMBER_OF_BYTES_WRITE BIGINT not null,"
+                      "COUNT_MISC BIGINT unsigned not null,"
+                      "SUM_TIMER_MISC BIGINT unsigned not null,"
+                      "MIN_TIMER_MISC BIGINT unsigned not null,"
+                      "AVG_TIMER_MISC BIGINT unsigned not null,"
+                      "MAX_TIMER_MISC BIGINT unsigned not null)") }
 };
 
 PFS_engine_table* table_file_summary_by_instance::create(void)
diff --git a/storage/perfschema/table_file_summary_by_instance.h b/storage/perfschema/table_file_summary_by_instance.h
index d9f4069..4bc1f9a 100644
--- a/storage/perfschema/table_file_summary_by_instance.h
+++ b/storage/perfschema/table_file_summary_by_instance.h
@@ -82,8 +82,6 @@ private:
 
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_file_summary_by_instance m_row;
diff --git a/storage/perfschema/table_host_cache.cc b/storage/perfschema/table_host_cache.cc
index 70efcd4..df13207 100644
--- a/storage/perfschema/table_host_cache.cc
+++ b/storage/perfschema/table_host_cache.cc
@@ -25,159 +25,6 @@
 
 THR_LOCK table_host_cache::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("IP") },
-    { C_STRING_WITH_LEN("varchar(64)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("HOST") },
-    { C_STRING_WITH_LEN("varchar(255)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("HOST_VALIDATED") },
-    { C_STRING_WITH_LEN("enum(\'YES\',\'NO\')") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_CONNECT_ERRORS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_HOST_BLOCKED_ERRORS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_NAMEINFO_TRANSIENT_ERRORS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_NAMEINFO_PERMANENT_ERRORS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_FORMAT_ERRORS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_ADDRINFO_TRANSIENT_ERRORS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_ADDRINFO_PERMANENT_ERRORS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_FCRDNS_ERRORS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_HOST_ACL_ERRORS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_NO_AUTH_PLUGIN_ERRORS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_AUTH_PLUGIN_ERRORS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_HANDSHAKE_ERRORS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_PROXY_USER_ERRORS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_PROXY_USER_ACL_ERRORS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_AUTHENTICATION_ERRORS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_SSL_ERRORS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_MAX_USER_CONNECTIONS_ERRORS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_DEFAULT_DATABASE_ERRORS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_INIT_CONNECT_ERRORS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_LOCAL_ERRORS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_UNKNOWN_ERRORS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("FIRST_SEEN") },
-    { C_STRING_WITH_LEN("timestamp") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("LAST_SEEN") },
-    { C_STRING_WITH_LEN("timestamp") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("FIRST_ERROR_SEEN") },
-    { C_STRING_WITH_LEN("timestamp") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("LAST_ERROR_SEEN") },
-    { C_STRING_WITH_LEN("timestamp") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_host_cache::m_field_def=
-{ 29, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_host_cache::m_share=
 {
@@ -190,8 +37,36 @@ table_host_cache::m_share=
   1000, /* records */
   sizeof(PFS_simple_index), /* ref length */
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE host_cache("
+                      "IP VARCHAR(64) not null,"
+                      "HOST VARCHAR(255) collate utf8_bin,"
+                      "HOST_VALIDATED ENUM ('YES', 'NO') not null,"
+                      "SUM_CONNECT_ERRORS BIGINT not null,"
+                      "COUNT_HOST_BLOCKED_ERRORS BIGINT not null,"
+                      "COUNT_NAMEINFO_TRANSIENT_ERRORS BIGINT not null,"
+                      "COUNT_NAMEINFO_PERMANENT_ERRORS BIGINT not null,"
+                      "COUNT_FORMAT_ERRORS BIGINT not null,"
+                      "COUNT_ADDRINFO_TRANSIENT_ERRORS BIGINT not null,"
+                      "COUNT_ADDRINFO_PERMANENT_ERRORS BIGINT not null,"
+                      "COUNT_FCRDNS_ERRORS BIGINT not null,"
+                      "COUNT_HOST_ACL_ERRORS BIGINT not null,"
+                      "COUNT_NO_AUTH_PLUGIN_ERRORS BIGINT not null,"
+                      "COUNT_AUTH_PLUGIN_ERRORS BIGINT not null,"
+                      "COUNT_HANDSHAKE_ERRORS BIGINT not null,"
+                      "COUNT_PROXY_USER_ERRORS BIGINT not null,"
+                      "COUNT_PROXY_USER_ACL_ERRORS BIGINT not null,"
+                      "COUNT_AUTHENTICATION_ERRORS BIGINT not null,"
+                      "COUNT_SSL_ERRORS BIGINT not null,"
+                      "COUNT_MAX_USER_CONNECTIONS_ERRORS BIGINT not null,"
+                      "COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS BIGINT not null,"
+                      "COUNT_DEFAULT_DATABASE_ERRORS BIGINT not null,"
+                      "COUNT_INIT_CONNECT_ERRORS BIGINT not null,"
+                      "COUNT_LOCAL_ERRORS BIGINT not null,"
+                      "COUNT_UNKNOWN_ERRORS BIGINT not null,"
+                      "FIRST_SEEN TIMESTAMP(0) NOT NULL default 0,"
+                      "LAST_SEEN TIMESTAMP(0) NOT NULL default 0,"
+                      "FIRST_ERROR_SEEN TIMESTAMP(0) null default 0,"
+                      "LAST_ERROR_SEEN TIMESTAMP(0) null default 0)") }
 };
 
 PFS_engine_table* table_host_cache::create(void)
diff --git a/storage/perfschema/table_host_cache.h b/storage/perfschema/table_host_cache.h
index 7479570..6a100cc 100644
--- a/storage/perfschema/table_host_cache.h
+++ b/storage/perfschema/table_host_cache.h
@@ -127,8 +127,6 @@ private:
 
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   row_host_cache *m_all_rows;
   uint m_row_count;
diff --git a/storage/perfschema/table_hosts.cc b/storage/perfschema/table_hosts.cc
index c91193e..8ddc34f 100644
--- a/storage/perfschema/table_hosts.cc
+++ b/storage/perfschema/table_hosts.cc
@@ -24,29 +24,6 @@
 
 THR_LOCK table_hosts::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("HOST") },
-    { C_STRING_WITH_LEN("char(60)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("CURRENT_CONNECTIONS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("TOTAL_CONNECTIONS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_hosts::m_field_def=
-{ 3, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_hosts::m_share=
 {
@@ -59,8 +36,10 @@ table_hosts::m_share=
   1000, /* records */
   sizeof(PFS_simple_index), /* ref length */
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE hosts("
+                      "HOST CHAR(60) collate utf8_bin default null,"
+                      "CURRENT_CONNECTIONS bigint not null,"
+                      "TOTAL_CONNECTIONS bigint not null)") }
 };
 
 PFS_engine_table* table_hosts::create()
diff --git a/storage/perfschema/table_hosts.h b/storage/perfschema/table_hosts.h
index 6fdbf1b..9f44dd3 100644
--- a/storage/perfschema/table_hosts.h
+++ b/storage/perfschema/table_hosts.h
@@ -67,8 +67,6 @@ private:
 
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_hosts m_row;
diff --git a/storage/perfschema/table_os_global_by_type.cc b/storage/perfschema/table_os_global_by_type.cc
index f6c9a85..2f7bf5e 100644
--- a/storage/perfschema/table_os_global_by_type.cc
+++ b/storage/perfschema/table_os_global_by_type.cc
@@ -28,54 +28,6 @@
 
 THR_LOCK table_os_global_by_type::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("OBJECT_TYPE") },
-    { C_STRING_WITH_LEN("varchar(64)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("OBJECT_SCHEMA") },
-    { C_STRING_WITH_LEN("varchar(64)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("OBJECT_NAME") },
-    { C_STRING_WITH_LEN("varchar(64)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_STAR") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_os_global_by_type::m_field_def=
-{ 8, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_os_global_by_type::m_share=
 {
@@ -88,8 +40,15 @@ table_os_global_by_type::m_share=
   1000, /* records */
   sizeof(pos_os_global_by_type),
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE objects_summary_global_by_type("
+                      "OBJECT_TYPE VARCHAR(64),"
+                      "OBJECT_SCHEMA VARCHAR(64),"
+                      "OBJECT_NAME VARCHAR(64),"
+                      "COUNT_STAR BIGINT unsigned not null,"
+                      "SUM_TIMER_WAIT BIGINT unsigned not null,"
+                      "MIN_TIMER_WAIT BIGINT unsigned not null,"
+                      "AVG_TIMER_WAIT BIGINT unsigned not null,"
+                      "MAX_TIMER_WAIT BIGINT unsigned not null)") }
 };
 
 PFS_engine_table*
diff --git a/storage/perfschema/table_os_global_by_type.h b/storage/perfschema/table_os_global_by_type.h
index 888e376..7968b85 100644
--- a/storage/perfschema/table_os_global_by_type.h
+++ b/storage/perfschema/table_os_global_by_type.h
@@ -112,8 +112,6 @@ protected:
 private:
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_os_global_by_type m_row;
diff --git a/storage/perfschema/table_performance_timers.cc b/storage/perfschema/table_performance_timers.cc
index 473ea8b..780d507 100644
--- a/storage/perfschema/table_performance_timers.cc
+++ b/storage/perfschema/table_performance_timers.cc
@@ -26,35 +26,6 @@
 
 THR_LOCK table_performance_timers::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("TIMER_NAME") },
-    { C_STRING_WITH_LEN("enum(\'CYCLE\',\'NANOSECOND\',\'MICROSECOND\',"
-                        "\'MILLISECOND\',\'TICK\')") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("TIMER_FREQUENCY") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("TIMER_RESOLUTION") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("TIMER_OVERHEAD") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_performance_timers::m_field_def=
-{ 4, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_performance_timers::m_share=
 {
@@ -67,8 +38,11 @@ table_performance_timers::m_share=
   COUNT_TIMER_NAME, /* records */
   sizeof(PFS_simple_index), /* ref length */
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE performance_timers("
+                      "TIMER_NAME ENUM ('CYCLE', 'NANOSECOND', 'MICROSECOND', 'MILLISECOND', 'TICK') not null,"
+                      "TIMER_FREQUENCY BIGINT,"
+                      "TIMER_RESOLUTION BIGINT,"
+                      "TIMER_OVERHEAD BIGINT)") }
 };
 
 PFS_engine_table* table_performance_timers::create(void)
diff --git a/storage/perfschema/table_performance_timers.h b/storage/perfschema/table_performance_timers.h
index dbd4766..79e9f54 100644
--- a/storage/perfschema/table_performance_timers.h
+++ b/storage/perfschema/table_performance_timers.h
@@ -70,8 +70,6 @@ public:
 private:
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_performance_timers *m_row;
diff --git a/storage/perfschema/table_session_account_connect_attrs.cc b/storage/perfschema/table_session_account_connect_attrs.cc
index 4a3fcc2..2aed519 100644
--- a/storage/perfschema/table_session_account_connect_attrs.cc
+++ b/storage/perfschema/table_session_account_connect_attrs.cc
@@ -29,8 +29,12 @@ table_session_account_connect_attrs::m_share=
   1000, /* records */
   sizeof(pos_connect_attr_by_thread_by_attr), /* ref length */
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE session_account_connect_attrs("
+                      "PROCESSLIST_ID INT NOT NULL,"
+                      "ATTR_NAME VARCHAR(32) NOT NULL,"
+                      "ATTR_VALUE VARCHAR(1024),"
+                      "ORDINAL_POSITION INT"
+                      ") CHARACTER SET utf8 COLLATE utf8_bin") }
 };
 
 PFS_engine_table* table_session_account_connect_attrs::create()
diff --git a/storage/perfschema/table_session_connect.cc b/storage/perfschema/table_session_connect.cc
index df3337b..a5c557b 100644
--- a/storage/perfschema/table_session_connect.cc
+++ b/storage/perfschema/table_session_connect.cc
@@ -15,33 +15,6 @@
 
 #include "table_session_connect.h"
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("PROCESSLIST_ID") },
-    { C_STRING_WITH_LEN("int(11)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("ATTR_NAME") },
-    { C_STRING_WITH_LEN("varchar(32)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("ATTR_VALUE") },
-    { C_STRING_WITH_LEN("varchar(1024)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("ORDINAL_POSITION") },
-    { C_STRING_WITH_LEN("int(11)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF table_session_connect::m_field_def=
-{ 4, field_types, 0, (uint*) 0 };
-
 table_session_connect::table_session_connect(const PFS_engine_table_share *share)
  : cursor_by_thread_connect_attr(share)
 {
diff --git a/storage/perfschema/table_session_connect.h b/storage/perfschema/table_session_connect.h
index e6faa28..7e06f8a 100644
--- a/storage/perfschema/table_session_connect.h
+++ b/storage/perfschema/table_session_connect.h
@@ -66,8 +66,6 @@ protected:
   virtual int read_row_values(TABLE *table, unsigned char *buf,
                               Field **fields, bool read_all);
 protected:
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
   /** Current row. */
   row_session_connect_attrs m_row;
   /** Safe copy of @c PFS_thread::m_session_connect_attrs. */
diff --git a/storage/perfschema/table_session_connect_attrs.cc b/storage/perfschema/table_session_connect_attrs.cc
index 9e1804b..840167a 100644
--- a/storage/perfschema/table_session_connect_attrs.cc
+++ b/storage/perfschema/table_session_connect_attrs.cc
@@ -29,8 +29,12 @@ table_session_connect_attrs::m_share=
   1000, /* records */
   sizeof(pos_connect_attr_by_thread_by_attr), /* ref length */
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE session_connect_attrs("
+                      "PROCESSLIST_ID INT NOT NULL,"
+                      "ATTR_NAME VARCHAR(32) NOT NULL,"
+                      "ATTR_VALUE VARCHAR(1024),"
+                      "ORDINAL_POSITION INT"
+                      ") CHARACTER SET utf8 COLLATE utf8_bin") }
 };
 
 PFS_engine_table* table_session_connect_attrs::create()
diff --git a/storage/perfschema/table_setup_actors.cc b/storage/perfschema/table_setup_actors.cc
index a73ec45..c82d67f 100644
--- a/storage/perfschema/table_setup_actors.cc
+++ b/storage/perfschema/table_setup_actors.cc
@@ -29,29 +29,6 @@
 
 THR_LOCK table_setup_actors::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("HOST") },
-    { C_STRING_WITH_LEN("char(60)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("USER") },
-    { C_STRING_WITH_LEN("char(16)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("ROLE") },
-    { C_STRING_WITH_LEN("char(16)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_setup_actors::m_field_def=
-{ 3, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_setup_actors::m_share=
 {
@@ -64,8 +41,10 @@ table_setup_actors::m_share=
   1000, /* records */
   sizeof(PFS_simple_index),
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE setup_actors("
+                      "HOST CHAR(60) collate utf8_bin default '%' not null,"
+                      "USER CHAR(16) collate utf8_bin default '%' not null,"
+                      "ROLE CHAR(16) collate utf8_bin default '%' not null)") }
 };
 
 PFS_engine_table* table_setup_actors::create()
diff --git a/storage/perfschema/table_setup_actors.h b/storage/perfschema/table_setup_actors.h
index be3ab1b..2a9395d 100644
--- a/storage/perfschema/table_setup_actors.h
+++ b/storage/perfschema/table_setup_actors.h
@@ -89,8 +89,6 @@ private:
 
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_setup_actors m_row;
diff --git a/storage/perfschema/table_setup_consumers.cc b/storage/perfschema/table_setup_consumers.cc
index 563307f..c09853f 100644
--- a/storage/perfschema/table_setup_consumers.cc
+++ b/storage/perfschema/table_setup_consumers.cc
@@ -92,24 +92,6 @@ static row_setup_consumers all_setup_consumers_data[COUNT_SETUP_CONSUMERS]=
 
 THR_LOCK table_setup_consumers::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("NAME") },
-    { C_STRING_WITH_LEN("varchar(64)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("ENABLED") },
-    { C_STRING_WITH_LEN("enum(\'YES\',\'NO\')") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_setup_consumers::m_field_def=
-{ 2, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_setup_consumers::m_share=
 {
@@ -122,8 +104,9 @@ table_setup_consumers::m_share=
   COUNT_SETUP_CONSUMERS, /* records */
   sizeof(PFS_simple_index), /* ref length */
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE setup_consumers("
+                      "NAME VARCHAR(64) not null,"
+                      "ENABLED ENUM ('YES', 'NO') not null)") }
 };
 
 PFS_engine_table* table_setup_consumers::create(void)
diff --git a/storage/perfschema/table_setup_consumers.h b/storage/perfschema/table_setup_consumers.h
index bc7e9d5..e59033c 100644
--- a/storage/perfschema/table_setup_consumers.h
+++ b/storage/perfschema/table_setup_consumers.h
@@ -72,8 +72,6 @@ public:
 private:
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_setup_consumers *m_row;
diff --git a/storage/perfschema/table_setup_instruments.cc b/storage/perfschema/table_setup_instruments.cc
index 060857c..d911128 100644
--- a/storage/perfschema/table_setup_instruments.cc
+++ b/storage/perfschema/table_setup_instruments.cc
@@ -30,29 +30,6 @@
 
 THR_LOCK table_setup_instruments::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("NAME") },
-    { C_STRING_WITH_LEN("varchar(128)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("ENABLED") },
-    { C_STRING_WITH_LEN("enum(\'YES\',\'NO\')") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("TIMED") },
-    { C_STRING_WITH_LEN("enum(\'YES\',\'NO\')") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_setup_instruments::m_field_def=
-{ 3, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_setup_instruments::m_share=
 {
@@ -65,8 +42,10 @@ table_setup_instruments::m_share=
   1000, /* records */
   sizeof(pos_setup_instruments),
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE setup_instruments("
+                      "NAME VARCHAR(128) not null,"
+                      "ENABLED ENUM ('YES', 'NO') not null,"
+                      "TIMED ENUM ('YES', 'NO') not null)") }
 };
 
 PFS_engine_table* table_setup_instruments::create(void)
diff --git a/storage/perfschema/table_setup_instruments.h b/storage/perfschema/table_setup_instruments.h
index cb4c6a0..2e70a52 100644
--- a/storage/perfschema/table_setup_instruments.h
+++ b/storage/perfschema/table_setup_instruments.h
@@ -106,8 +106,6 @@ private:
 
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_setup_instruments m_row;
diff --git a/storage/perfschema/table_setup_objects.cc b/storage/perfschema/table_setup_objects.cc
index 4753285..5321271 100644
--- a/storage/perfschema/table_setup_objects.cc
+++ b/storage/perfschema/table_setup_objects.cc
@@ -30,39 +30,6 @@
 
 THR_LOCK table_setup_objects::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("OBJECT_TYPE") },
-    { C_STRING_WITH_LEN("enum(\'TABLE\')") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("OBJECT_SCHEMA") },
-    { C_STRING_WITH_LEN("varchar(64)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("OBJECT_NAME") },
-    { C_STRING_WITH_LEN("varchar(64)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("ENABLED") },
-    { C_STRING_WITH_LEN("enum(\'YES\',\'NO\')") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("TIMED") },
-    { C_STRING_WITH_LEN("enum(\'YES\',\'NO\')") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_setup_objects::m_field_def=
-{ 5, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_setup_objects::m_share=
 {
@@ -75,8 +42,12 @@ table_setup_objects::m_share=
   1000, /* records */
   sizeof(PFS_simple_index),
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE setup_objects("
+                      "OBJECT_TYPE ENUM ('TABLE') not null default 'TABLE',"
+                      "OBJECT_SCHEMA VARCHAR(64) default '%',"
+                      "OBJECT_NAME VARCHAR(64) not null default '%',"
+                      "ENABLED ENUM ('YES', 'NO') not null default 'YES',"
+                      "TIMED ENUM ('YES', 'NO') not null default 'YES')") }
 };
 
 int update_derived_flags()
diff --git a/storage/perfschema/table_setup_objects.h b/storage/perfschema/table_setup_objects.h
index 4b31fa6..55423ff 100644
--- a/storage/perfschema/table_setup_objects.h
+++ b/storage/perfschema/table_setup_objects.h
@@ -92,8 +92,6 @@ private:
 
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_setup_objects m_row;
diff --git a/storage/perfschema/table_setup_timers.cc b/storage/perfschema/table_setup_timers.cc
index 1176f1f..911fa12 100644
--- a/storage/perfschema/table_setup_timers.cc
+++ b/storage/perfschema/table_setup_timers.cc
@@ -48,25 +48,6 @@ static row_setup_timers all_setup_timers_data[COUNT_SETUP_TIMERS]=
 
 THR_LOCK table_setup_timers::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("NAME") },
-    { C_STRING_WITH_LEN("varchar(64)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("TIMER_NAME") },
-    { C_STRING_WITH_LEN("enum(\'CYCLE\',\'NANOSECOND\',\'MICROSECOND\',"
-                        "\'MILLISECOND\',\'TICK\')") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_setup_timers::m_field_def=
-{ 2, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_setup_timers::m_share=
 {
@@ -79,8 +60,9 @@ table_setup_timers::m_share=
   COUNT_SETUP_TIMERS,
   sizeof(PFS_simple_index),
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE setup_timers("
+                      "NAME VARCHAR(64) not null,"
+                      "TIMER_NAME ENUM ('CYCLE', 'NANOSECOND', 'MICROSECOND', 'MILLISECOND', 'TICK') not null)") }
 };
 
 PFS_engine_table* table_setup_timers::create(void)
diff --git a/storage/perfschema/table_setup_timers.h b/storage/perfschema/table_setup_timers.h
index a81e6fe..46af68b 100644
--- a/storage/perfschema/table_setup_timers.h
+++ b/storage/perfschema/table_setup_timers.h
@@ -70,8 +70,6 @@ public:
 private:
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_setup_timers *m_row;
diff --git a/storage/perfschema/table_socket_instances.cc b/storage/perfschema/table_socket_instances.cc
index 6dfea0b..e47a97c 100644
--- a/storage/perfschema/table_socket_instances.cc
+++ b/storage/perfschema/table_socket_instances.cc
@@ -28,49 +28,6 @@
 
 THR_LOCK table_socket_instances::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("EVENT_NAME") },
-    { C_STRING_WITH_LEN("varchar(128)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("OBJECT_INSTANCE_BEGIN") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("THREAD_ID") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SOCKET_ID") },
-    { C_STRING_WITH_LEN("int(11)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("IP") },
-    { C_STRING_WITH_LEN("varchar(64)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("PORT") },
-    { C_STRING_WITH_LEN("int(11)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("STATE") },
-    { C_STRING_WITH_LEN("enum('IDLE','ACTIVE')") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_socket_instances::m_field_def=
-{ 7, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_socket_instances::m_share=
 {
@@ -83,8 +40,14 @@ table_socket_instances::m_share=
   1000, /* records */
   sizeof(PFS_simple_index),
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE socket_instances("
+                      "EVENT_NAME VARCHAR(128) not null,"
+                      "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
+                      "THREAD_ID BIGINT unsigned,"
+                      "SOCKET_ID INTEGER not null,"
+                      "IP VARCHAR(64) not null,"
+                      "PORT INTEGER not null,"
+                      "STATE ENUM('IDLE','ACTIVE') not null)") }
 };
 
 PFS_engine_table* table_socket_instances::create(void)
diff --git a/storage/perfschema/table_socket_instances.h b/storage/perfschema/table_socket_instances.h
index 080f11c..76ed8c4 100644
--- a/storage/perfschema/table_socket_instances.h
+++ b/storage/perfschema/table_socket_instances.h
@@ -85,8 +85,6 @@ private:
 
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_socket_instances m_row;
diff --git a/storage/perfschema/table_socket_summary_by_event_name.cc b/storage/perfschema/table_socket_summary_by_event_name.cc
index 07bc9c9..512fe8e 100644
--- a/storage/perfschema/table_socket_summary_by_event_name.cc
+++ b/storage/perfschema/table_socket_summary_by_event_name.cc
@@ -29,135 +29,6 @@
 
 THR_LOCK table_socket_summary_by_event_name::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("EVENT_NAME") },
-    { C_STRING_WITH_LEN("varchar(128)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_STAR") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-
-  /** Read */
-  {
-    { C_STRING_WITH_LEN("COUNT_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NUMBER_OF_BYTES_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-
-  /** Write */
-  {
-    { C_STRING_WITH_LEN("COUNT_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NUMBER_OF_BYTES_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-
-  /** Misc */
-  {
-    { C_STRING_WITH_LEN("COUNT_MISC") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_MISC") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_MISC") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_MISC") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_MISC") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_socket_summary_by_event_name::m_field_def=
-{ 23, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_socket_summary_by_event_name::m_share=
 {
@@ -170,8 +41,30 @@ table_socket_summary_by_event_name::m_share=
   1000, /* records */
   sizeof(PFS_simple_index),
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE socket_summary_by_event_name("
+                      "EVENT_NAME VARCHAR(128) not null,"
+                      "COUNT_STAR BIGINT unsigned not null,"
+                      "SUM_TIMER_WAIT BIGINT unsigned not null,"
+                      "MIN_TIMER_WAIT BIGINT unsigned not null,"
+                      "AVG_TIMER_WAIT BIGINT unsigned not null,"
+                      "MAX_TIMER_WAIT BIGINT unsigned not null,"
+                      "COUNT_READ BIGINT unsigned not null,"
+                      "SUM_TIMER_READ BIGINT unsigned not null,"
+                      "MIN_TIMER_READ BIGINT unsigned not null,"
+                      "AVG_TIMER_READ BIGINT unsigned not null,"
+                      "MAX_TIMER_READ BIGINT unsigned not null,"
+                      "SUM_NUMBER_OF_BYTES_READ BIGINT unsigned not null,"
+                      "COUNT_WRITE BIGINT unsigned not null,"
+                      "SUM_TIMER_WRITE BIGINT unsigned not null,"
+                      "MIN_TIMER_WRITE BIGINT unsigned not null,"
+                      "AVG_TIMER_WRITE BIGINT unsigned not null,"
+                      "MAX_TIMER_WRITE BIGINT unsigned not null,"
+                      "SUM_NUMBER_OF_BYTES_WRITE BIGINT unsigned not null,"
+                      "COUNT_MISC BIGINT unsigned not null,"
+                      "SUM_TIMER_MISC BIGINT unsigned not null,"
+                      "MIN_TIMER_MISC BIGINT unsigned not null,"
+                      "AVG_TIMER_MISC BIGINT unsigned not null,"
+                      "MAX_TIMER_MISC BIGINT unsigned not null)") }
 };
 
 PFS_engine_table* table_socket_summary_by_event_name::create(void)
diff --git a/storage/perfschema/table_socket_summary_by_event_name.h b/storage/perfschema/table_socket_summary_by_event_name.h
index b34bed4..72a1e54 100644
--- a/storage/perfschema/table_socket_summary_by_event_name.h
+++ b/storage/perfschema/table_socket_summary_by_event_name.h
@@ -75,8 +75,6 @@ private:
 
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_socket_summary_by_event_name m_row;
diff --git a/storage/perfschema/table_socket_summary_by_instance.cc b/storage/perfschema/table_socket_summary_by_instance.cc
index 3d092b9..4ab600d 100644
--- a/storage/perfschema/table_socket_summary_by_instance.cc
+++ b/storage/perfschema/table_socket_summary_by_instance.cc
@@ -28,140 +28,6 @@
 
 THR_LOCK table_socket_summary_by_instance::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("EVENT_NAME") },
-    { C_STRING_WITH_LEN("varchar(128)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("OBJECT_INSTANCE_BEGIN") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_STAR") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-
-  /** Read */
-  {
-    { C_STRING_WITH_LEN("COUNT_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NUMBER_OF_BYTES_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-
-  /** Write */
-  {
-    { C_STRING_WITH_LEN("COUNT_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NUMBER_OF_BYTES_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-
-  /** Misc */
-  {
-    { C_STRING_WITH_LEN("COUNT_MISC") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_MISC") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_MISC") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_MISC") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_MISC") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_socket_summary_by_instance::m_field_def=
-{ 24, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_socket_summary_by_instance::m_share=
 {
@@ -174,8 +40,31 @@ table_socket_summary_by_instance::m_share=
   1000, /* records */
   sizeof(PFS_simple_index),
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE socket_summary_by_instance("
+                      "EVENT_NAME VARCHAR(128) not null,"
+                      "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
+                      "COUNT_STAR BIGINT unsigned not null,"
+                      "SUM_TIMER_WAIT BIGINT unsigned not null,"
+                      "MIN_TIMER_WAIT BIGINT unsigned not null,"
+                      "AVG_TIMER_WAIT BIGINT unsigned not null,"
+                      "MAX_TIMER_WAIT BIGINT unsigned not null,"
+                      "COUNT_READ BIGINT unsigned not null,"
+                      "SUM_TIMER_READ BIGINT unsigned not null,"
+                      "MIN_TIMER_READ BIGINT unsigned not null,"
+                      "AVG_TIMER_READ BIGINT unsigned not null,"
+                      "MAX_TIMER_READ BIGINT unsigned not null,"
+                      "SUM_NUMBER_OF_BYTES_READ BIGINT unsigned not null,"
+                      "COUNT_WRITE BIGINT unsigned not null,"
+                      "SUM_TIMER_WRITE BIGINT unsigned not null,"
+                      "MIN_TIMER_WRITE BIGINT unsigned not null,"
+                      "AVG_TIMER_WRITE BIGINT unsigned not null,"
+                      "MAX_TIMER_WRITE BIGINT unsigned not null,"
+                      "SUM_NUMBER_OF_BYTES_WRITE BIGINT unsigned not null,"
+                      "COUNT_MISC BIGINT unsigned not null,"
+                      "SUM_TIMER_MISC BIGINT unsigned not null,"
+                      "MIN_TIMER_MISC BIGINT unsigned not null,"
+                      "AVG_TIMER_MISC BIGINT unsigned not null,"
+                      "MAX_TIMER_MISC BIGINT unsigned not null)") }
 };
 
 PFS_engine_table* table_socket_summary_by_instance::create(void)
diff --git a/storage/perfschema/table_socket_summary_by_instance.h b/storage/perfschema/table_socket_summary_by_instance.h
index f4c8ea4..949e99b 100644
--- a/storage/perfschema/table_socket_summary_by_instance.h
+++ b/storage/perfschema/table_socket_summary_by_instance.h
@@ -78,8 +78,6 @@ private:
 
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_socket_summary_by_instance m_row;
diff --git a/storage/perfschema/table_sync_instances.cc b/storage/perfschema/table_sync_instances.cc
index 9b53eb3..4bf5ae6 100644
--- a/storage/perfschema/table_sync_instances.cc
+++ b/storage/perfschema/table_sync_instances.cc
@@ -29,29 +29,6 @@
 
 THR_LOCK table_mutex_instances::m_table_lock;
 
-static const TABLE_FIELD_TYPE mutex_field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("NAME") },
-    { C_STRING_WITH_LEN("varchar(128)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("OBJECT_INSTANCE_BEGIN") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("LOCKED_BY_THREAD_ID") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_mutex_instances::m_field_def=
-{ 3, mutex_field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_mutex_instances::m_share=
 {
@@ -64,8 +41,10 @@ table_mutex_instances::m_share=
   1000, /* records */
   sizeof(PFS_simple_index),
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE mutex_instances("
+                      "NAME VARCHAR(128) not null,"
+                      "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
+                      "LOCKED_BY_THREAD_ID BIGINT unsigned)") }
 };
 
 PFS_engine_table* table_mutex_instances::create(void)
@@ -193,34 +172,6 @@ int table_mutex_instances::read_row_values(TABLE *table,
 
 THR_LOCK table_rwlock_instances::m_table_lock;
 
-static const TABLE_FIELD_TYPE rwlock_field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("NAME") },
-    { C_STRING_WITH_LEN("varchar(128)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("OBJECT_INSTANCE_BEGIN") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("WRITE_LOCKED_BY_THREAD_ID") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("READ_LOCKED_BY_COUNT") },
-    { C_STRING_WITH_LEN("int(10)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_rwlock_instances::m_field_def=
-{ 4, rwlock_field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_rwlock_instances::m_share=
 {
@@ -233,8 +184,11 @@ table_rwlock_instances::m_share=
   1000, /* records */
   sizeof(PFS_simple_index),
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE rwlock_instances("
+                      "NAME VARCHAR(128) not null,"
+                      "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
+                      "WRITE_LOCKED_BY_THREAD_ID BIGINT unsigned,"
+                      "READ_LOCKED_BY_COUNT INTEGER unsigned not null)") }
 };
 
 PFS_engine_table* table_rwlock_instances::create(void)
@@ -369,24 +323,6 @@ int table_rwlock_instances::read_row_values(TABLE *table,
 
 THR_LOCK table_cond_instances::m_table_lock;
 
-static const TABLE_FIELD_TYPE cond_field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("NAME") },
-    { C_STRING_WITH_LEN("varchar(128)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("OBJECT_INSTANCE_BEGIN") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_cond_instances::m_field_def=
-{ 2, cond_field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_cond_instances::m_share=
 {
@@ -399,8 +335,9 @@ table_cond_instances::m_share=
   1000, /* records */
   sizeof(PFS_simple_index),
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE cond_instances("
+                      "NAME VARCHAR(128) not null,"
+                      "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null)") }
 };
 
 PFS_engine_table* table_cond_instances::create(void)
diff --git a/storage/perfschema/table_sync_instances.h b/storage/perfschema/table_sync_instances.h
index ff7b276..da45926 100644
--- a/storage/perfschema/table_sync_instances.h
+++ b/storage/perfschema/table_sync_instances.h
@@ -77,8 +77,6 @@ private:
 
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_mutex_instances m_row;
@@ -136,8 +134,6 @@ private:
 
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_rwlock_instances m_row;
@@ -189,8 +185,6 @@ private:
 
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_cond_instances m_row;
diff --git a/storage/perfschema/table_threads.cc b/storage/perfschema/table_threads.cc
index 1fd2486..5c78b56 100644
--- a/storage/perfschema/table_threads.cc
+++ b/storage/perfschema/table_threads.cc
@@ -22,84 +22,6 @@
 
 THR_LOCK table_threads::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("THREAD_ID") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("NAME") },
-    { C_STRING_WITH_LEN("varchar(128)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("TYPE") },
-    { C_STRING_WITH_LEN("varchar(10)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("PROCESSLIST_ID") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("PROCESSLIST_USER") },
-    { C_STRING_WITH_LEN("varchar(16)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("PROCESSLIST_HOST") },
-    { C_STRING_WITH_LEN("varchar(60)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("PROCESSLIST_DB") },
-    { C_STRING_WITH_LEN("varchar(64)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("PROCESSLIST_COMMAND") },
-    { C_STRING_WITH_LEN("varchar(16)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("PROCESSLIST_TIME") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("PROCESSLIST_STATE") },
-    { C_STRING_WITH_LEN("varchar(64)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("PROCESSLIST_INFO") },
-    { C_STRING_WITH_LEN("longtext") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("PARENT_THREAD_ID") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("ROLE") },
-    { C_STRING_WITH_LEN("varchar(64)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("INSTRUMENTED") },
-    { C_STRING_WITH_LEN("enum(\'YES\',\'NO\')") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_threads::m_field_def=
-{ 14, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_threads::m_share=
 {
@@ -112,8 +34,21 @@ table_threads::m_share=
   1000, /* records */
   sizeof(PFS_simple_index), /* ref length */
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE threads("
+                      "THREAD_ID BIGINT unsigned not null,"
+                      "NAME VARCHAR(128) not null,"
+                      "TYPE VARCHAR(10) not null,"
+                      "PROCESSLIST_ID BIGINT unsigned,"
+                      "PROCESSLIST_USER VARCHAR(16),"
+                      "PROCESSLIST_HOST VARCHAR(60),"
+                      "PROCESSLIST_DB VARCHAR(64),"
+                      "PROCESSLIST_COMMAND VARCHAR(16),"
+                      "PROCESSLIST_TIME BIGINT,"
+                      "PROCESSLIST_STATE VARCHAR(64),"
+                      "PROCESSLIST_INFO LONGTEXT,"
+                      "PARENT_THREAD_ID BIGINT unsigned,"
+                      "ROLE VARCHAR(64),"
+                      "INSTRUMENTED ENUM ('YES', 'NO') not null)") }
 };
 
 PFS_engine_table* table_threads::create()
diff --git a/storage/perfschema/table_threads.h b/storage/perfschema/table_threads.h
index bce45c0..10afbe1 100644
--- a/storage/perfschema/table_threads.h
+++ b/storage/perfschema/table_threads.h
@@ -102,8 +102,6 @@ private:
 
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_threads m_row;
diff --git a/storage/perfschema/table_tiws_by_index_usage.cc b/storage/perfschema/table_tiws_by_index_usage.cc
index 5f6d0cd..382b2f8 100644
--- a/storage/perfschema/table_tiws_by_index_usage.cc
+++ b/storage/perfschema/table_tiws_by_index_usage.cc
@@ -29,209 +29,6 @@
 
 THR_LOCK table_tiws_by_index_usage::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("OBJECT_TYPE") },
-    { C_STRING_WITH_LEN("varchar(64)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("OBJECT_SCHEMA") },
-    { C_STRING_WITH_LEN("varchar(64)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("OBJECT_NAME") },
-    { C_STRING_WITH_LEN("varchar(64)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("INDEX_NAME") },
-    { C_STRING_WITH_LEN("varchar(64)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_STAR") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_FETCH") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_FETCH") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_FETCH") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_FETCH") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_FETCH") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_INSERT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_INSERT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_INSERT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_INSERT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_INSERT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_UPDATE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_UPDATE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_UPDATE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_UPDATE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_UPDATE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_DELETE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_DELETE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_DELETE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_DELETE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_DELETE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_tiws_by_index_usage::m_field_def=
-{ 39, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_tiws_by_index_usage::m_share=
 {
@@ -244,8 +41,46 @@ table_tiws_by_index_usage::m_share=
   1000, /* records */
   sizeof(pos_tiws_by_index_usage),
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE table_io_waits_summary_by_index_usage("
+                      "OBJECT_TYPE VARCHAR(64),"
+                      "OBJECT_SCHEMA VARCHAR(64),"
+                      "OBJECT_NAME VARCHAR(64),"
+                      "INDEX_NAME VARCHAR(64),"
+                      "COUNT_STAR BIGINT unsigned not null,"
+                      "SUM_TIMER_WAIT BIGINT unsigned not null,"
+                      "MIN_TIMER_WAIT BIGINT unsigned not null,"
+                      "AVG_TIMER_WAIT BIGINT unsigned not null,"
+                      "MAX_TIMER_WAIT BIGINT unsigned not null,"
+                      "COUNT_READ BIGINT unsigned not null,"
+                      "SUM_TIMER_READ BIGINT unsigned not null,"
+                      "MIN_TIMER_READ BIGINT unsigned not null,"
+                      "AVG_TIMER_READ BIGINT unsigned not null,"
+                      "MAX_TIMER_READ BIGINT unsigned not null,"
+                      "COUNT_WRITE BIGINT unsigned not null,"
+                      "SUM_TIMER_WRITE BIGINT unsigned not null,"
+                      "MIN_TIMER_WRITE BIGINT unsigned not null,"
+                      "AVG_TIMER_WRITE BIGINT unsigned not null,"
+                      "MAX_TIMER_WRITE BIGINT unsigned not null,"
+                      "COUNT_FETCH BIGINT unsigned not null,"
+                      "SUM_TIMER_FETCH BIGINT unsigned not null,"
+                      "MIN_TIMER_FETCH BIGINT unsigned not null,"
+                      "AVG_TIMER_FETCH BIGINT unsigned not null,"
+                      "MAX_TIMER_FETCH BIGINT unsigned not null,"
+                      "COUNT_INSERT BIGINT unsigned not null,"
+                      "SUM_TIMER_INSERT BIGINT unsigned not null,"
+                      "MIN_TIMER_INSERT BIGINT unsigned not null,"
+                      "AVG_TIMER_INSERT BIGINT unsigned not null,"
+                      "MAX_TIMER_INSERT BIGINT unsigned not null,"
+                      "COUNT_UPDATE BIGINT unsigned not null,"
+                      "SUM_TIMER_UPDATE BIGINT unsigned not null,"
+                      "MIN_TIMER_UPDATE BIGINT unsigned not null,"
+                      "AVG_TIMER_UPDATE BIGINT unsigned not null,"
+                      "MAX_TIMER_UPDATE BIGINT unsigned not null,"
+                      "COUNT_DELETE BIGINT unsigned not null,"
+                      "SUM_TIMER_DELETE BIGINT unsigned not null,"
+                      "MIN_TIMER_DELETE BIGINT unsigned not null,"
+                      "AVG_TIMER_DELETE BIGINT unsigned not null,"
+                      "MAX_TIMER_DELETE BIGINT unsigned not null)") }
 };
 
 PFS_engine_table*
diff --git a/storage/perfschema/table_tiws_by_index_usage.h b/storage/perfschema/table_tiws_by_index_usage.h
index b5f589d..1528de2 100644
--- a/storage/perfschema/table_tiws_by_index_usage.h
+++ b/storage/perfschema/table_tiws_by_index_usage.h
@@ -106,8 +106,6 @@ protected:
 private:
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_tiws_by_index_usage m_row;
diff --git a/storage/perfschema/table_tiws_by_table.cc b/storage/perfschema/table_tiws_by_table.cc
index 7eeebcc..ab1e9b1 100644
--- a/storage/perfschema/table_tiws_by_table.cc
+++ b/storage/perfschema/table_tiws_by_table.cc
@@ -29,204 +29,6 @@
 
 THR_LOCK table_tiws_by_table::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("OBJECT_TYPE") },
-    { C_STRING_WITH_LEN("varchar(64)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("OBJECT_SCHEMA") },
-    { C_STRING_WITH_LEN("varchar(64)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("OBJECT_NAME") },
-    { C_STRING_WITH_LEN("varchar(64)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_STAR") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_FETCH") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_FETCH") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_FETCH") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_FETCH") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_FETCH") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_INSERT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_INSERT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_INSERT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_INSERT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_INSERT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_UPDATE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_UPDATE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_UPDATE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_UPDATE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_UPDATE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_DELETE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_DELETE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_DELETE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_DELETE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_DELETE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_tiws_by_table::m_field_def=
-{ 38, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_tiws_by_table::m_share=
 {
@@ -239,8 +41,45 @@ table_tiws_by_table::m_share=
   1000, /* records */
   sizeof(PFS_simple_index),
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE table_io_waits_summary_by_table("
+                      "OBJECT_TYPE VARCHAR(64),"
+                      "OBJECT_SCHEMA VARCHAR(64),"
+                      "OBJECT_NAME VARCHAR(64),"
+                      "COUNT_STAR BIGINT unsigned not null,"
+                      "SUM_TIMER_WAIT BIGINT unsigned not null,"
+                      "MIN_TIMER_WAIT BIGINT unsigned not null,"
+                      "AVG_TIMER_WAIT BIGINT unsigned not null,"
+                      "MAX_TIMER_WAIT BIGINT unsigned not null,"
+                      "COUNT_READ BIGINT unsigned not null,"
+                      "SUM_TIMER_READ BIGINT unsigned not null,"
+                      "MIN_TIMER_READ BIGINT unsigned not null,"
+                      "AVG_TIMER_READ BIGINT unsigned not null,"
+                      "MAX_TIMER_READ BIGINT unsigned not null,"
+                      "COUNT_WRITE BIGINT unsigned not null,"
+                      "SUM_TIMER_WRITE BIGINT unsigned not null,"
+                      "MIN_TIMER_WRITE BIGINT unsigned not null,"
+                      "AVG_TIMER_WRITE BIGINT unsigned not null,"
+                      "MAX_TIMER_WRITE BIGINT unsigned not null,"
+                      "COUNT_FETCH BIGINT unsigned not null,"
+                      "SUM_TIMER_FETCH BIGINT unsigned not null,"
+                      "MIN_TIMER_FETCH BIGINT unsigned not null,"
+                      "AVG_TIMER_FETCH BIGINT unsigned not null,"
+                      "MAX_TIMER_FETCH BIGINT unsigned not null,"
+                      "COUNT_INSERT BIGINT unsigned not null,"
+                      "SUM_TIMER_INSERT BIGINT unsigned not null,"
+                      "MIN_TIMER_INSERT BIGINT unsigned not null,"
+                      "AVG_TIMER_INSERT BIGINT unsigned not null,"
+                      "MAX_TIMER_INSERT BIGINT unsigned not null,"
+                      "COUNT_UPDATE BIGINT unsigned not null,"
+                      "SUM_TIMER_UPDATE BIGINT unsigned not null,"
+                      "MIN_TIMER_UPDATE BIGINT unsigned not null,"
+                      "AVG_TIMER_UPDATE BIGINT unsigned not null,"
+                      "MAX_TIMER_UPDATE BIGINT unsigned not null,"
+                      "COUNT_DELETE BIGINT unsigned not null,"
+                      "SUM_TIMER_DELETE BIGINT unsigned not null,"
+                      "MIN_TIMER_DELETE BIGINT unsigned not null,"
+                      "AVG_TIMER_DELETE BIGINT unsigned not null,"
+                      "MAX_TIMER_DELETE BIGINT unsigned not null)") }
 };
 
 PFS_engine_table*
diff --git a/storage/perfschema/table_tiws_by_table.h b/storage/perfschema/table_tiws_by_table.h
index ea52b52..d110431 100644
--- a/storage/perfschema/table_tiws_by_table.h
+++ b/storage/perfschema/table_tiws_by_table.h
@@ -76,8 +76,6 @@ protected:
 private:
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_tiws_by_table m_row;
diff --git a/storage/perfschema/table_tlws_by_table.cc b/storage/perfschema/table_tlws_by_table.cc
index 6537e70..bae1202 100644
--- a/storage/perfschema/table_tlws_by_table.cc
+++ b/storage/perfschema/table_tlws_by_table.cc
@@ -29,379 +29,6 @@
 
 THR_LOCK table_tlws_by_table::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("OBJECT_TYPE") },
-    { C_STRING_WITH_LEN("varchar(64)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("OBJECT_SCHEMA") },
-    { C_STRING_WITH_LEN("varchar(64)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("OBJECT_NAME") },
-    { C_STRING_WITH_LEN("varchar(64)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_STAR") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_READ_NORMAL") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_READ_NORMAL") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_READ_NORMAL") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_READ_NORMAL") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_READ_NORMAL") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_READ_WITH_SHARED_LOCKS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_READ_WITH_SHARED_LOCKS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_READ_WITH_SHARED_LOCKS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_READ_WITH_SHARED_LOCKS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_READ_WITH_SHARED_LOCKS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_READ_HIGH_PRIORITY") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_READ_HIGH_PRIORITY") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_READ_HIGH_PRIORITY") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_READ_HIGH_PRIORITY") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_READ_HIGH_PRIORITY") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_READ_NO_INSERT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_READ_NO_INSERT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_READ_NO_INSERT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_READ_NO_INSERT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_READ_NO_INSERT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_READ_EXTERNAL") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_READ_EXTERNAL") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_READ_EXTERNAL") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_READ_EXTERNAL") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_READ_EXTERNAL") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_WRITE_ALLOW_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WRITE_ALLOW_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WRITE_ALLOW_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WRITE_ALLOW_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WRITE_ALLOW_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_WRITE_CONCURRENT_INSERT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WRITE_CONCURRENT_INSERT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WRITE_CONCURRENT_INSERT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WRITE_CONCURRENT_INSERT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WRITE_CONCURRENT_INSERT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_WRITE_DELAYED") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WRITE_DELAYED") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WRITE_DELAYED") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WRITE_DELAYED") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WRITE_DELAYED") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_WRITE_LOW_PRIORITY") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WRITE_LOW_PRIORITY") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WRITE_LOW_PRIORITY") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WRITE_LOW_PRIORITY") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WRITE_LOW_PRIORITY") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_WRITE_NORMAL") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WRITE_NORMAL") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WRITE_NORMAL") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WRITE_NORMAL") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WRITE_NORMAL") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_WRITE_EXTERNAL") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WRITE_EXTERNAL") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WRITE_EXTERNAL") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WRITE_EXTERNAL") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WRITE_EXTERNAL") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_tlws_by_table::m_field_def=
-{ 73, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_tlws_by_table::m_share=
 {
@@ -414,8 +41,80 @@ table_tlws_by_table::m_share=
   1000, /* records */
   sizeof(PFS_simple_index),
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE table_lock_waits_summary_by_table("
+                      "OBJECT_TYPE VARCHAR(64),"
+                      "OBJECT_SCHEMA VARCHAR(64),"
+                      "OBJECT_NAME VARCHAR(64),"
+                      "COUNT_STAR BIGINT unsigned not null,"
+                      "SUM_TIMER_WAIT BIGINT unsigned not null,"
+                      "MIN_TIMER_WAIT BIGINT unsigned not null,"
+                      "AVG_TIMER_WAIT BIGINT unsigned not null,"
+                      "MAX_TIMER_WAIT BIGINT unsigned not null,"
+                      "COUNT_READ BIGINT unsigned not null,"
+                      "SUM_TIMER_READ BIGINT unsigned not null,"
+                      "MIN_TIMER_READ BIGINT unsigned not null,"
+                      "AVG_TIMER_READ BIGINT unsigned not null,"
+                      "MAX_TIMER_READ BIGINT unsigned not null,"
+                      "COUNT_WRITE BIGINT unsigned not null,"
+                      "SUM_TIMER_WRITE BIGINT unsigned not null,"
+                      "MIN_TIMER_WRITE BIGINT unsigned not null,"
+                      "AVG_TIMER_WRITE BIGINT unsigned not null,"
+                      "MAX_TIMER_WRITE BIGINT unsigned not null,"
+                      "COUNT_READ_NORMAL BIGINT unsigned not null,"
+                      "SUM_TIMER_READ_NORMAL BIGINT unsigned not null,"
+                      "MIN_TIMER_READ_NORMAL BIGINT unsigned not null,"
+                      "AVG_TIMER_READ_NORMAL BIGINT unsigned not null,"
+                      "MAX_TIMER_READ_NORMAL BIGINT unsigned not null,"
+                      "COUNT_READ_WITH_SHARED_LOCKS BIGINT unsigned not null,"
+                      "SUM_TIMER_READ_WITH_SHARED_LOCKS BIGINT unsigned not null,"
+                      "MIN_TIMER_READ_WITH_SHARED_LOCKS BIGINT unsigned not null,"
+                      "AVG_TIMER_READ_WITH_SHARED_LOCKS BIGINT unsigned not null,"
+                      "MAX_TIMER_READ_WITH_SHARED_LOCKS BIGINT unsigned not null,"
+                      "COUNT_READ_HIGH_PRIORITY BIGINT unsigned not null,"
+                      "SUM_TIMER_READ_HIGH_PRIORITY BIGINT unsigned not null,"
+                      "MIN_TIMER_READ_HIGH_PRIORITY BIGINT unsigned not null,"
+                      "AVG_TIMER_READ_HIGH_PRIORITY BIGINT unsigned not null,"
+                      "MAX_TIMER_READ_HIGH_PRIORITY BIGINT unsigned not null,"
+                      "COUNT_READ_NO_INSERT BIGINT unsigned not null,"
+                      "SUM_TIMER_READ_NO_INSERT BIGINT unsigned not null,"
+                      "MIN_TIMER_READ_NO_INSERT BIGINT unsigned not null,"
+                      "AVG_TIMER_READ_NO_INSERT BIGINT unsigned not null,"
+                      "MAX_TIMER_READ_NO_INSERT BIGINT unsigned not null,"
+                      "COUNT_READ_EXTERNAL BIGINT unsigned not null,"
+                      "SUM_TIMER_READ_EXTERNAL BIGINT unsigned not null,"
+                      "MIN_TIMER_READ_EXTERNAL BIGINT unsigned not null,"
+                      "AVG_TIMER_READ_EXTERNAL BIGINT unsigned not null,"
+                      "MAX_TIMER_READ_EXTERNAL BIGINT unsigned not null,"
+                      "COUNT_WRITE_ALLOW_WRITE BIGINT unsigned not null,"
+                      "SUM_TIMER_WRITE_ALLOW_WRITE BIGINT unsigned not null,"
+                      "MIN_TIMER_WRITE_ALLOW_WRITE BIGINT unsigned not null,"
+                      "AVG_TIMER_WRITE_ALLOW_WRITE BIGINT unsigned not null,"
+                      "MAX_TIMER_WRITE_ALLOW_WRITE BIGINT unsigned not null,"
+                      "COUNT_WRITE_CONCURRENT_INSERT BIGINT unsigned not null,"
+                      "SUM_TIMER_WRITE_CONCURRENT_INSERT BIGINT unsigned not null,"
+                      "MIN_TIMER_WRITE_CONCURRENT_INSERT BIGINT unsigned not null,"
+                      "AVG_TIMER_WRITE_CONCURRENT_INSERT BIGINT unsigned not null,"
+                      "MAX_TIMER_WRITE_CONCURRENT_INSERT BIGINT unsigned not null,"
+                      "COUNT_WRITE_DELAYED BIGINT unsigned not null,"
+                      "SUM_TIMER_WRITE_DELAYED BIGINT unsigned not null,"
+                      "MIN_TIMER_WRITE_DELAYED BIGINT unsigned not null,"
+                      "AVG_TIMER_WRITE_DELAYED BIGINT unsigned not null,"
+                      "MAX_TIMER_WRITE_DELAYED BIGINT unsigned not null,"
+                      "COUNT_WRITE_LOW_PRIORITY BIGINT unsigned not null,"
+                      "SUM_TIMER_WRITE_LOW_PRIORITY BIGINT unsigned not null,"
+                      "MIN_TIMER_WRITE_LOW_PRIORITY BIGINT unsigned not null,"
+                      "AVG_TIMER_WRITE_LOW_PRIORITY BIGINT unsigned not null,"
+                      "MAX_TIMER_WRITE_LOW_PRIORITY BIGINT unsigned not null,"
+                      "COUNT_WRITE_NORMAL BIGINT unsigned not null,"
+                      "SUM_TIMER_WRITE_NORMAL BIGINT unsigned not null,"
+                      "MIN_TIMER_WRITE_NORMAL BIGINT unsigned not null,"
+                      "AVG_TIMER_WRITE_NORMAL BIGINT unsigned not null,"
+                      "MAX_TIMER_WRITE_NORMAL BIGINT unsigned not null,"
+                      "COUNT_WRITE_EXTERNAL BIGINT unsigned not null,"
+                      "SUM_TIMER_WRITE_EXTERNAL BIGINT unsigned not null,"
+                      "MIN_TIMER_WRITE_EXTERNAL BIGINT unsigned not null,"
+                      "AVG_TIMER_WRITE_EXTERNAL BIGINT unsigned not null,"
+                      "MAX_TIMER_WRITE_EXTERNAL BIGINT unsigned not null)") }
 };
 
 PFS_engine_table*
diff --git a/storage/perfschema/table_tlws_by_table.h b/storage/perfschema/table_tlws_by_table.h
index fc39644..f5bf6a9 100644
--- a/storage/perfschema/table_tlws_by_table.h
+++ b/storage/perfschema/table_tlws_by_table.h
@@ -76,8 +76,6 @@ protected:
 private:
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_tlws_by_table m_row;
diff --git a/storage/perfschema/table_users.cc b/storage/perfschema/table_users.cc
index 1f6b861..134ebb0 100644
--- a/storage/perfschema/table_users.cc
+++ b/storage/perfschema/table_users.cc
@@ -24,29 +24,6 @@
 
 THR_LOCK table_users::m_table_lock;
 
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("USER") },
-    { C_STRING_WITH_LEN("char(16)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("CURRENT_CONNECTIONS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("TOTAL_CONNECTIONS") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_users::m_field_def=
-{ 3, field_types, 0, (uint*) 0 };
-
 PFS_engine_table_share
 table_users::m_share=
 {
@@ -59,8 +36,10 @@ table_users::m_share=
   1000, /* records */
   sizeof(PFS_simple_index), /* ref length */
   &m_table_lock,
-  &m_field_def,
-  false /* checked */
+  { C_STRING_WITH_LEN("CREATE TABLE users("
+                      "USER CHAR(16) collate utf8_bin default null,"
+                      "CURRENT_CONNECTIONS bigint not null,"
+                      "TOTAL_CONNECTIONS bigint not null)") }
 };
 
 PFS_engine_table* table_users::create()
diff --git a/storage/perfschema/table_users.h b/storage/perfschema/table_users.h
index 94ea448..5d673cb 100644
--- a/storage/perfschema/table_users.h
+++ b/storage/perfschema/table_users.h
@@ -67,8 +67,6 @@ private:
 
   /** Table share lock. */
   static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
 
   /** Current row. */
   row_users m_row;


More information about the commits mailing list