List:Commits« Previous MessageNext Message »
From:Inaam Rana Date:October 27 2011 11:10am
Subject:bzr commit into mysql-trunk branch (inaam.rana:3529)
View as plain text  
#At file:///home/inaam/w/mysql-trunk/ based on revid:inaam.rana@stripped

 3529 Inaam Rana	2011-10-27 [merge]
      merge from parent

    modified:
      mysql-test/r/compare.result
      mysql-test/r/index_merge_innodb.result
      mysql-test/r/plugin.result
      mysql-test/r/sp-error.result
      mysql-test/r/user_var.result
      mysql-test/suite/perfschema/r/func_file_io.result
      mysql-test/suite/perfschema/r/pfs_upgrade.result
      mysql-test/suite/perfschema/r/schema.result
      mysql-test/suite/perfschema/r/start_server_nothing.result
      mysql-test/suite/perfschema/r/table_schema.result
      mysql-test/t/compare.test
      mysql-test/t/index_merge_innodb.test
      mysql-test/t/plugin.test
      mysql-test/t/sp-error.test
      mysql-test/t/user_var.test
      scripts/mysql_system_tables.sql
      sql/event_db_repository.cc
      sql/events.cc
      sql/item_cmpfunc.cc
      sql/opt_range.cc
      sql/records.cc
      sql/records.h
      sql/sp_rcontext.cc
      sql/sql_acl.cc
      sql/sql_class.h
      sql/sql_delete.cc
      sql/sql_help.cc
      sql/sql_plugin.cc
      sql/sql_select.cc
      sql/sql_servers.cc
      sql/sql_table.cc
      sql/sql_udf.cc
      sql/sql_update.cc
      storage/innobase/dict/dict0dict.c
      storage/innobase/handler/ha_innodb.cc
      storage/perfschema/pfs.cc
      storage/perfschema/pfs_events.h
      storage/perfschema/pfs_instr.cc
      storage/perfschema/table_events_stages.cc
      storage/perfschema/table_events_stages.h
      storage/perfschema/table_events_statements.cc
      storage/perfschema/table_events_statements.h
      storage/perfschema/table_events_waits.cc
      storage/perfschema/table_events_waits.h
=== modified file 'mysql-test/r/compare.result'
--- a/mysql-test/r/compare.result	revid:inaam.rana@stripped
+++ b/mysql-test/r/compare.result	revid:inaam.rana@stripped
@@ -96,3 +96,7 @@ SELECT * FROM t1 WHERE a > '2008-01-01'
 a
 DROP TABLE t1;
 End of 5.0 tests
+CREATE TABLE t1(a INT ZEROFILL);
+SELECT 1 FROM t1 WHERE t1.a IN (1, t1.a) AND t1.a=2;
+1
+DROP TABLE t1;

=== modified file 'mysql-test/r/index_merge_innodb.result'
--- a/mysql-test/r/index_merge_innodb.result	revid:inaam.rana@stripped
+++ b/mysql-test/r/index_merge_innodb.result	revid:inaam.rana@stripped
@@ -273,3 +273,21 @@ id	select_type	table	type	possible_keys
 1	PRIMARY	t1	const	PRIMARY	PRIMARY	4	const	1	Using index
 2	DEPENDENT SUBQUERY	t2	index_merge	f2,f3	f3,f2	2,5	NULL	1	Using intersect(f3,f2); Using where; Using index
 DROP TABLE t1,t2;
+#
+# Bug#11747423 32254: INDEX MERGE USED UNNECESSARILY
+#
+CREATE TABLE t1 (
+id INT NOT NULL PRIMARY KEY,
+id2 INT NOT NULL,
+id3 INT NOT NULL,
+KEY (id2),
+KEY (id3),
+KEY covering_index (id2,id3)
+) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (0, 0, 0), (1, 1, 1), (2, 2, 2), (3, 3, 3), (4, 4, 4), (5, 5, 5), (6, 6, 6), (7, 7, 7);
+INSERT INTO t1 SELECT id + 8, id2 + 8, id3 +8 FROM t1;
+INSERT INTO t1 SELECT id + 16, 7, 0 FROM t1;
+EXPLAIN SELECT SQL_NO_CACHE count(*) FROM t1 WHERE id2=7 AND id3=0;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ref	id2,id3,covering_index	covering_index	8	const,const	16	Using index
+DROP TABLE t1;

=== modified file 'mysql-test/r/plugin.result'
--- a/mysql-test/r/plugin.result	revid:inaam.rana@stripped
+++ b/mysql-test/r/plugin.result	revid:inaam.rana@stripped
@@ -10,7 +10,7 @@ UNINSTALL PLUGIN example;
 INSTALL PLUGIN example SONAME 'ha_example.so';
 CREATE TABLE t1(a int) ENGINE=EXAMPLE;
 SELECT * FROM t1;
-a
+ERROR HY000: Table storage engine for 't1' doesn't have this option
 DROP TABLE t1;
 set global example_ulong_var=500;
 set global example_enum_var= e1;

=== modified file 'mysql-test/r/sp-error.result'
--- a/mysql-test/r/sp-error.result	revid:inaam.rana@stripped
+++ b/mysql-test/r/sp-error.result	revid:inaam.rana@stripped
@@ -2820,3 +2820,29 @@ H2
 
 DROP PROCEDURE p1;
 DROP PROCEDURE p2;
+#
+# Bug#13113222 RQG_SIGNAL_RESIGNAL FAILED WITH ASSERTION.
+#
+DROP PROCEDURE IF EXISTS p1;
+DROP PROCEDURE IF EXISTS p2;
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SELECT 'triggered p1';
+# This will trigger an error.
+SIGNAL SQLSTATE 'HY000';
+END|
+CREATE PROCEDURE p2()
+BEGIN
+DECLARE CONTINUE HANDLER FOR SQLWARNING SELECT 'triggered p2';
+# This will trigger a warning.
+SIGNAL SQLSTATE '01000';
+END|
+SET @old_max_error_count=  @@session.max_error_count;
+SET SESSION max_error_count= 0;
+CALL p1();
+triggered p1
+triggered p1
+CALL p2();
+SET SESSION max_error_count= @old_max_error_count;
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;

=== modified file 'mysql-test/r/user_var.result'
--- a/mysql-test/r/user_var.result	revid:inaam.rana@stripped
+++ b/mysql-test/r/user_var.result	revid:inaam.rana@stripped
@@ -486,3 +486,10 @@ f1	f2
 DROP TRIGGER trg1;
 DROP TABLE t1;
 End of 5.5 tests
+CREATE TABLE t1(a int);
+INSERT INTO t1 VALUES (1), (2);
+SELECT DISTINCT @a:=MIN(t1.a) FROM t1, t1 AS t2
+GROUP BY @b:=(SELECT COUNT(*) > t2.a);
+@a:=MIN(t1.a)
+1
+DROP TABLE t1;

=== modified file 'mysql-test/suite/perfschema/r/func_file_io.result'
--- a/mysql-test/suite/perfschema/r/func_file_io.result	revid:inaam.rana@stripped
+++ b/mysql-test/suite/perfschema/r/func_file_io.result	revid:inaam.rana@stripped
@@ -67,17 +67,17 @@ SELECT * FROM performance_schema.events_
 WHERE TIMER_WAIT != NULL
 OR TIMER_START != NULL
 OR TIMER_END != NULL;
-THREAD_ID	EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	SPINS	OBJECT_SCHEMA	OBJECT_NAME	INDEX_NAME	OBJECT_TYPE	OBJECT_INSTANCE_BEGIN	NESTING_EVENT_ID	NESTING_EVENT_TYPE	OPERATION	NUMBER_OF_BYTES	FLAGS
+THREAD_ID	EVENT_ID	END_EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	SPINS	OBJECT_SCHEMA	OBJECT_NAME	INDEX_NAME	OBJECT_TYPE	OBJECT_INSTANCE_BEGIN	NESTING_EVENT_ID	NESTING_EVENT_TYPE	OPERATION	NUMBER_OF_BYTES	FLAGS
 SELECT * FROM performance_schema.events_waits_history
 WHERE TIMER_WAIT != NULL
 OR TIMER_START != NULL
 OR TIMER_END != NULL;
-THREAD_ID	EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	SPINS	OBJECT_SCHEMA	OBJECT_NAME	INDEX_NAME	OBJECT_TYPE	OBJECT_INSTANCE_BEGIN	NESTING_EVENT_ID	NESTING_EVENT_TYPE	OPERATION	NUMBER_OF_BYTES	FLAGS
+THREAD_ID	EVENT_ID	END_EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	SPINS	OBJECT_SCHEMA	OBJECT_NAME	INDEX_NAME	OBJECT_TYPE	OBJECT_INSTANCE_BEGIN	NESTING_EVENT_ID	NESTING_EVENT_TYPE	OPERATION	NUMBER_OF_BYTES	FLAGS
 SELECT * FROM performance_schema.events_waits_current
 WHERE TIMER_WAIT != NULL
 OR TIMER_START != NULL
 OR TIMER_END != NULL;
-THREAD_ID	EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	SPINS	OBJECT_SCHEMA	OBJECT_NAME	INDEX_NAME	OBJECT_TYPE	OBJECT_INSTANCE_BEGIN	NESTING_EVENT_ID	NESTING_EVENT_TYPE	OPERATION	NUMBER_OF_BYTES	FLAGS
+THREAD_ID	EVENT_ID	END_EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	SPINS	OBJECT_SCHEMA	OBJECT_NAME	INDEX_NAME	OBJECT_TYPE	OBJECT_INSTANCE_BEGIN	NESTING_EVENT_ID	NESTING_EVENT_TYPE	OPERATION	NUMBER_OF_BYTES	FLAGS
 UPDATE performance_schema.setup_instruments SET timed = 'YES';
 SELECT * FROM t1 WHERE id < 4;
 id	b

=== modified file 'mysql-test/suite/perfschema/r/pfs_upgrade.result'
--- a/mysql-test/suite/perfschema/r/pfs_upgrade.result	revid:inaam.rana@stripped
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade.result	revid:inaam.rana@stripped
@@ -9,54 +9,54 @@ show tables like "user_table";
 Tables_in_performance_schema (user_table)
 user_table
 ERROR 1050 (42S01) at line 100: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 124: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 148: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 172: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 185: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 198: Table 'events_waits_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 211: Table 'events_waits_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 225: Table 'events_waits_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 238: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 250: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 259: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 270: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 282: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 295: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line 325: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 354: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 363: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 377: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 387: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 397: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 406: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 414: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 423: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 434: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 442: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 487: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 531: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 610: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 630: Table 'threads' already exists
-ERROR 1050 (42S01) at line 645: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 660: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 675: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 688: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 701: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 714: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 728: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 740: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 783: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 826: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 869: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 901: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 933: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 965: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 998: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 1029: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 1038: Table 'hosts' already exists
-ERROR 1050 (42S01) at line 1047: Table 'users' already exists
-ERROR 1050 (42S01) at line 1057: Table 'accounts' already exists
-ERROR 1644 (HY000) at line 1477: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 125: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 150: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 175: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 188: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 201: Table 'events_waits_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 214: Table 'events_waits_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 228: Table 'events_waits_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 241: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 253: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 262: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 273: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 285: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 298: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line 328: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 357: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 366: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 380: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 390: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 400: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 409: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 417: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 426: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 437: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 445: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 490: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 534: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 613: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 633: Table 'threads' already exists
+ERROR 1050 (42S01) at line 649: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 665: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 681: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 694: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 707: Table 'events_stages_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 720: Table 'events_stages_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 734: Table 'events_stages_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 746: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 790: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 834: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 878: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 910: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 942: Table 'events_statements_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 974: Table 'events_statements_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 1007: Table 'events_statements_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 1038: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 1047: Table 'hosts' already exists
+ERROR 1050 (42S01) at line 1056: Table 'users' already exists
+ERROR 1050 (42S01) at line 1066: Table 'accounts' already exists
+ERROR 1644 (HY000) at line 1486: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 show tables like "user_table";
 Tables_in_performance_schema (user_table)
@@ -70,54 +70,54 @@ show tables like "user_view";
 Tables_in_performance_schema (user_view)
 user_view
 ERROR 1050 (42S01) at line 100: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 124: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 148: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 172: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 185: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 198: Table 'events_waits_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 211: Table 'events_waits_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 225: Table 'events_waits_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 238: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 250: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 259: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 270: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 282: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 295: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line 325: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 354: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 363: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 377: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 387: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 397: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 406: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 414: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 423: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 434: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 442: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 487: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 531: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 610: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 630: Table 'threads' already exists
-ERROR 1050 (42S01) at line 645: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 660: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 675: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 688: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 701: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 714: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 728: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 740: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 783: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 826: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 869: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 901: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 933: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 965: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 998: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 1029: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 1038: Table 'hosts' already exists
-ERROR 1050 (42S01) at line 1047: Table 'users' already exists
-ERROR 1050 (42S01) at line 1057: Table 'accounts' already exists
-ERROR 1644 (HY000) at line 1477: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 125: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 150: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 175: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 188: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 201: Table 'events_waits_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 214: Table 'events_waits_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 228: Table 'events_waits_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 241: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 253: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 262: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 273: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 285: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 298: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line 328: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 357: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 366: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 380: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 390: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 400: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 409: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 417: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 426: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 437: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 445: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 490: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 534: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 613: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 633: Table 'threads' already exists
+ERROR 1050 (42S01) at line 649: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 665: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 681: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 694: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 707: Table 'events_stages_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 720: Table 'events_stages_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 734: Table 'events_stages_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 746: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 790: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 834: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 878: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 910: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 942: Table 'events_statements_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 974: Table 'events_statements_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 1007: Table 'events_statements_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 1038: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 1047: Table 'hosts' already exists
+ERROR 1050 (42S01) at line 1056: Table 'users' already exists
+ERROR 1050 (42S01) at line 1066: Table 'accounts' already exists
+ERROR 1644 (HY000) at line 1486: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 show tables like "user_view";
 Tables_in_performance_schema (user_view)
@@ -129,54 +129,54 @@ 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 100: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 124: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 148: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 172: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 185: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 198: Table 'events_waits_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 211: Table 'events_waits_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 225: Table 'events_waits_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 238: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 250: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 259: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 270: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 282: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 295: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line 325: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 354: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 363: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 377: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 387: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 397: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 406: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 414: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 423: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 434: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 442: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 487: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 531: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 610: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 630: Table 'threads' already exists
-ERROR 1050 (42S01) at line 645: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 660: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 675: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 688: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 701: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 714: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 728: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 740: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 783: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 826: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 869: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 901: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 933: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 965: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 998: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 1029: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 1038: Table 'hosts' already exists
-ERROR 1050 (42S01) at line 1047: Table 'users' already exists
-ERROR 1050 (42S01) at line 1057: Table 'accounts' already exists
-ERROR 1644 (HY000) at line 1477: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 125: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 150: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 175: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 188: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 201: Table 'events_waits_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 214: Table 'events_waits_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 228: Table 'events_waits_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 241: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 253: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 262: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 273: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 285: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 298: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line 328: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 357: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 366: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 380: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 390: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 400: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 409: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 417: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 426: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 437: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 445: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 490: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 534: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 613: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 633: Table 'threads' already exists
+ERROR 1050 (42S01) at line 649: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 665: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 681: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 694: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 707: Table 'events_stages_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 720: Table 'events_stages_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 734: Table 'events_stages_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 746: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 790: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 834: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 878: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 910: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 942: Table 'events_statements_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 974: Table 'events_statements_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 1007: Table 'events_statements_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 1038: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 1047: Table 'hosts' already exists
+ERROR 1050 (42S01) at line 1056: Table 'users' already exists
+ERROR 1050 (42S01) at line 1066: Table 'accounts' already exists
+ERROR 1644 (HY000) at line 1486: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.proc where db='performance_schema';
 name
@@ -188,54 +188,54 @@ create function test.user_func() returns
 return 0;
 update mysql.proc set db='performance_schema' where name='user_func';
 ERROR 1050 (42S01) at line 100: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 124: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 148: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 172: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 185: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 198: Table 'events_waits_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 211: Table 'events_waits_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 225: Table 'events_waits_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 238: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 250: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 259: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 270: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 282: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 295: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line 325: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 354: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 363: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 377: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 387: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 397: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 406: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 414: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 423: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 434: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 442: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 487: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 531: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 610: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 630: Table 'threads' already exists
-ERROR 1050 (42S01) at line 645: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 660: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 675: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 688: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 701: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 714: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 728: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 740: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 783: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 826: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 869: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 901: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 933: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 965: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 998: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 1029: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 1038: Table 'hosts' already exists
-ERROR 1050 (42S01) at line 1047: Table 'users' already exists
-ERROR 1050 (42S01) at line 1057: Table 'accounts' already exists
-ERROR 1644 (HY000) at line 1477: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 125: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 150: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 175: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 188: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 201: Table 'events_waits_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 214: Table 'events_waits_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 228: Table 'events_waits_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 241: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 253: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 262: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 273: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 285: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 298: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line 328: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 357: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 366: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 380: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 390: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 400: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 409: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 417: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 426: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 437: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 445: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 490: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 534: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 613: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 633: Table 'threads' already exists
+ERROR 1050 (42S01) at line 649: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 665: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 681: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 694: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 707: Table 'events_stages_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 720: Table 'events_stages_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 734: Table 'events_stages_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 746: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 790: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 834: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 878: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 910: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 942: Table 'events_statements_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 974: Table 'events_statements_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 1007: Table 'events_statements_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 1038: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 1047: Table 'hosts' already exists
+ERROR 1050 (42S01) at line 1056: Table 'users' already exists
+ERROR 1050 (42S01) at line 1066: Table 'accounts' already exists
+ERROR 1644 (HY000) at line 1486: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.proc where db='performance_schema';
 name
@@ -247,54 +247,54 @@ create event test.user_event on schedule
 select "not supposed to be here";
 update mysql.event set db='performance_schema' where name='user_event';
 ERROR 1050 (42S01) at line 100: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 124: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 148: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 172: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 185: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 198: Table 'events_waits_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 211: Table 'events_waits_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 225: Table 'events_waits_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 238: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 250: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 259: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 270: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 282: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 295: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line 325: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 354: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 363: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 377: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 387: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 397: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 406: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 414: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 423: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 434: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 442: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 487: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 531: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 610: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 630: Table 'threads' already exists
-ERROR 1050 (42S01) at line 645: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 660: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 675: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 688: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 701: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 714: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 728: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 740: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 783: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 826: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 869: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 901: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 933: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 965: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 998: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 1029: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 1038: Table 'hosts' already exists
-ERROR 1050 (42S01) at line 1047: Table 'users' already exists
-ERROR 1050 (42S01) at line 1057: Table 'accounts' already exists
-ERROR 1644 (HY000) at line 1477: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 125: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 150: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 175: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 188: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 201: Table 'events_waits_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 214: Table 'events_waits_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 228: Table 'events_waits_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 241: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 253: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 262: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 273: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 285: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 298: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line 328: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 357: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 366: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 380: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 390: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 400: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 409: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 417: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 426: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 437: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 445: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 490: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 534: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 613: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 633: Table 'threads' already exists
+ERROR 1050 (42S01) at line 649: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 665: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 681: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 694: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 707: Table 'events_stages_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 720: Table 'events_stages_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 734: Table 'events_stages_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 746: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 790: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 834: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 878: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 910: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 942: Table 'events_statements_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 974: Table 'events_statements_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 1007: Table 'events_statements_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 1038: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 1047: Table 'hosts' already exists
+ERROR 1050 (42S01) at line 1056: Table 'users' already exists
+ERROR 1050 (42S01) at line 1066: Table 'accounts' already exists
+ERROR 1644 (HY000) at line 1486: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.event where db='performance_schema';
 name

=== modified file 'mysql-test/suite/perfschema/r/schema.result'
--- a/mysql-test/suite/perfschema/r/schema.result	revid:inaam.rana@stripped
+++ b/mysql-test/suite/perfschema/r/schema.result	revid:inaam.rana@stripped
@@ -74,6 +74,7 @@ Table	Create Table
 events_stages_current	CREATE TABLE `events_stages_current` (
   `THREAD_ID` int(11) NOT NULL,
   `EVENT_ID` bigint(20) unsigned NOT NULL,
+  `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
   `EVENT_NAME` varchar(128) NOT NULL,
   `SOURCE` varchar(64) DEFAULT NULL,
   `TIMER_START` bigint(20) unsigned DEFAULT NULL,
@@ -87,6 +88,7 @@ Table	Create Table
 events_stages_history	CREATE TABLE `events_stages_history` (
   `THREAD_ID` int(11) NOT NULL,
   `EVENT_ID` bigint(20) unsigned NOT NULL,
+  `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
   `EVENT_NAME` varchar(128) NOT NULL,
   `SOURCE` varchar(64) DEFAULT NULL,
   `TIMER_START` bigint(20) unsigned DEFAULT NULL,
@@ -100,6 +102,7 @@ Table	Create Table
 events_stages_history_long	CREATE TABLE `events_stages_history_long` (
   `THREAD_ID` int(11) NOT NULL,
   `EVENT_ID` bigint(20) unsigned NOT NULL,
+  `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
   `EVENT_NAME` varchar(128) NOT NULL,
   `SOURCE` varchar(64) DEFAULT NULL,
   `TIMER_START` bigint(20) unsigned DEFAULT NULL,
@@ -168,6 +171,7 @@ Table	Create Table
 events_statements_current	CREATE TABLE `events_statements_current` (
   `THREAD_ID` int(11) NOT NULL,
   `EVENT_ID` bigint(20) unsigned NOT NULL,
+  `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
   `EVENT_NAME` varchar(128) NOT NULL,
   `SOURCE` varchar(64) DEFAULT NULL,
   `TIMER_START` bigint(20) unsigned DEFAULT NULL,
@@ -209,6 +213,7 @@ Table	Create Table
 events_statements_history	CREATE TABLE `events_statements_history` (
   `THREAD_ID` int(11) NOT NULL,
   `EVENT_ID` bigint(20) unsigned NOT NULL,
+  `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
   `EVENT_NAME` varchar(128) NOT NULL,
   `SOURCE` varchar(64) DEFAULT NULL,
   `TIMER_START` bigint(20) unsigned DEFAULT NULL,
@@ -250,6 +255,7 @@ Table	Create Table
 events_statements_history_long	CREATE TABLE `events_statements_history_long` (
   `THREAD_ID` int(11) NOT NULL,
   `EVENT_ID` bigint(20) unsigned NOT NULL,
+  `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
   `EVENT_NAME` varchar(128) NOT NULL,
   `SOURCE` varchar(64) DEFAULT NULL,
   `TIMER_START` bigint(20) unsigned DEFAULT NULL,
@@ -441,6 +447,7 @@ Table	Create Table
 events_waits_current	CREATE TABLE `events_waits_current` (
   `THREAD_ID` int(11) NOT NULL,
   `EVENT_ID` bigint(20) unsigned NOT NULL,
+  `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
   `EVENT_NAME` varchar(128) NOT NULL,
   `SOURCE` varchar(64) DEFAULT NULL,
   `TIMER_START` bigint(20) unsigned DEFAULT NULL,
@@ -463,6 +470,7 @@ Table	Create Table
 events_waits_history	CREATE TABLE `events_waits_history` (
   `THREAD_ID` int(11) NOT NULL,
   `EVENT_ID` bigint(20) unsigned NOT NULL,
+  `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
   `EVENT_NAME` varchar(128) NOT NULL,
   `SOURCE` varchar(64) DEFAULT NULL,
   `TIMER_START` bigint(20) unsigned DEFAULT NULL,
@@ -485,6 +493,7 @@ Table	Create Table
 events_waits_history_long	CREATE TABLE `events_waits_history_long` (
   `THREAD_ID` int(11) NOT NULL,
   `EVENT_ID` bigint(20) unsigned NOT NULL,
+  `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
   `EVENT_NAME` varchar(128) NOT NULL,
   `SOURCE` varchar(64) DEFAULT NULL,
   `TIMER_START` bigint(20) unsigned DEFAULT NULL,

=== modified file 'mysql-test/suite/perfschema/r/start_server_nothing.result'
--- a/mysql-test/suite/perfschema/r/start_server_nothing.result	revid:inaam.rana@stripped
+++ b/mysql-test/suite/perfschema/r/start_server_nothing.result	revid:inaam.rana@stripped
@@ -165,11 +165,11 @@ USER	HOST	CURRENT_CONNECTIONS	TOTAL_CONN
 select * from performance_schema.cond_instances;
 NAME	OBJECT_INSTANCE_BEGIN
 select * from performance_schema.events_stages_current;
-THREAD_ID	EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	NESTING_EVENT_ID	NESTING_EVENT_TYPE
+THREAD_ID	EVENT_ID	END_EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	NESTING_EVENT_ID	NESTING_EVENT_TYPE
 select * from performance_schema.events_stages_history;
-THREAD_ID	EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	NESTING_EVENT_ID	NESTING_EVENT_TYPE
+THREAD_ID	EVENT_ID	END_EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	NESTING_EVENT_ID	NESTING_EVENT_TYPE
 select * from performance_schema.events_stages_history_long;
-THREAD_ID	EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	NESTING_EVENT_ID	NESTING_EVENT_TYPE
+THREAD_ID	EVENT_ID	END_EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	NESTING_EVENT_ID	NESTING_EVENT_TYPE
 select * from performance_schema.events_stages_summary_by_account_by_event_name;
 USER	HOST	EVENT_NAME	COUNT_STAR	SUM_TIMER_WAIT	MIN_TIMER_WAIT	AVG_TIMER_WAIT	MAX_TIMER_WAIT
 select * from performance_schema.events_stages_summary_by_host_by_event_name;
@@ -181,11 +181,11 @@ USER	EVENT_NAME	COUNT_STAR	SUM_TIMER_WAI
 select * from performance_schema.events_stages_summary_global_by_event_name;
 EVENT_NAME	COUNT_STAR	SUM_TIMER_WAIT	MIN_TIMER_WAIT	AVG_TIMER_WAIT	MAX_TIMER_WAIT
 select * from performance_schema.events_statements_current;
-THREAD_ID	EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	LOCK_TIME	SQL_TEXT	CURRENT_SCHEMA	OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	OBJECT_INSTANCE_BEGIN	MYSQL_ERRNO	RETURNED_SQLSTATE	MESSAGE_TEXT	ERRORS	WARNINGS	ROWS_AFFECTED	ROWS_SENT	ROWS_EXAMINED	CREATED_TMP_DISK_TABLES	CREATED_TMP_TABLES	SELECT_FULL_JOIN	SELECT_FULL_RANGE_JOIN	SELECT_RANGE	SELECT_RANGE_CHECK	SELECT_SCAN	SORT_MERGE_PASSES	SORT_RANGE	SORT_ROWS	SORT_SCAN	NO_INDEX_USED	NO_GOOD_INDEX_USED	NESTING_EVENT_ID	NESTING_EVENT_TYPE
+THREAD_ID	EVENT_ID	END_EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	LOCK_TIME	SQL_TEXT	CURRENT_SCHEMA	OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	OBJECT_INSTANCE_BEGIN	MYSQL_ERRNO	RETURNED_SQLSTATE	MESSAGE_TEXT	ERRORS	WARNINGS	ROWS_AFFECTED	ROWS_SENT	ROWS_EXAMINED	CREATED_TMP_DISK_TABLES	CREATED_TMP_TABLES	SELECT_FULL_JOIN	SELECT_FULL_RANGE_JOIN	SELECT_RANGE	SELECT_RANGE_CHECK	SELECT_SCAN	SORT_MERGE_PASSES	SORT_RANGE	SORT_ROWS	SORT_SCAN	NO_INDEX_USED	NO_GOOD_INDEX_USED	NESTING_EVENT_ID	NESTING_EVENT_TYPE
 select * from performance_schema.events_statements_history;
-THREAD_ID	EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	LOCK_TIME	SQL_TEXT	CURRENT_SCHEMA	OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	OBJECT_INSTANCE_BEGIN	MYSQL_ERRNO	RETURNED_SQLSTATE	MESSAGE_TEXT	ERRORS	WARNINGS	ROWS_AFFECTED	ROWS_SENT	ROWS_EXAMINED	CREATED_TMP_DISK_TABLES	CREATED_TMP_TABLES	SELECT_FULL_JOIN	SELECT_FULL_RANGE_JOIN	SELECT_RANGE	SELECT_RANGE_CHECK	SELECT_SCAN	SORT_MERGE_PASSES	SORT_RANGE	SORT_ROWS	SORT_SCAN	NO_INDEX_USED	NO_GOOD_INDEX_USED	NESTING_EVENT_ID	NESTING_EVENT_TYPE
+THREAD_ID	EVENT_ID	END_EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	LOCK_TIME	SQL_TEXT	CURRENT_SCHEMA	OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	OBJECT_INSTANCE_BEGIN	MYSQL_ERRNO	RETURNED_SQLSTATE	MESSAGE_TEXT	ERRORS	WARNINGS	ROWS_AFFECTED	ROWS_SENT	ROWS_EXAMINED	CREATED_TMP_DISK_TABLES	CREATED_TMP_TABLES	SELECT_FULL_JOIN	SELECT_FULL_RANGE_JOIN	SELECT_RANGE	SELECT_RANGE_CHECK	SELECT_SCAN	SORT_MERGE_PASSES	SORT_RANGE	SORT_ROWS	SORT_SCAN	NO_INDEX_USED	NO_GOOD_INDEX_USED	NESTING_EVENT_ID	NESTING_EVENT_TYPE
 select * from performance_schema.events_statements_history_long;
-THREAD_ID	EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	LOCK_TIME	SQL_TEXT	CURRENT_SCHEMA	OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	OBJECT_INSTANCE_BEGIN	MYSQL_ERRNO	RETURNED_SQLSTATE	MESSAGE_TEXT	ERRORS	WARNINGS	ROWS_AFFECTED	ROWS_SENT	ROWS_EXAMINED	CREATED_TMP_DISK_TABLES	CREATED_TMP_TABLES	SELECT_FULL_JOIN	SELECT_FULL_RANGE_JOIN	SELECT_RANGE	SELECT_RANGE_CHECK	SELECT_SCAN	SORT_MERGE_PASSES	SORT_RANGE	SORT_ROWS	SORT_SCAN	NO_INDEX_USED	NO_GOOD_INDEX_USED	NESTING_EVENT_ID	NESTING_EVENT_TYPE
+THREAD_ID	EVENT_ID	END_EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	LOCK_TIME	SQL_TEXT	CURRENT_SCHEMA	OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	OBJECT_INSTANCE_BEGIN	MYSQL_ERRNO	RETURNED_SQLSTATE	MESSAGE_TEXT	ERRORS	WARNINGS	ROWS_AFFECTED	ROWS_SENT	ROWS_EXAMINED	CREATED_TMP_DISK_TABLES	CREATED_TMP_TABLES	SELECT_FULL_JOIN	SELECT_FULL_RANGE_JOIN	SELECT_RANGE	SELECT_RANGE_CHECK	SELECT_SCAN	SORT_MERGE_PASSES	SORT_RANGE	SORT_ROWS	SORT_SCAN	NO_INDEX_USED	NO_GOOD_INDEX_USED	NESTING_EVENT_ID	NESTING_EVENT_TYPE
 select * from performance_schema.events_statements_summary_by_account_by_event_name;
 USER	HOST	EVENT_NAME	COUNT_STAR	SUM_TIMER_WAIT	MIN_TIMER_WAIT	AVG_TIMER_WAIT	MAX_TIMER_WAIT	SUM_LOCK_TIME	SUM_ERRORS	SUM_WARNINGS	SUM_ROWS_AFFECTED	SUM_ROWS_SENT	SUM_ROWS_EXAMINED	SUM_CREATED_TMP_DISK_TABLES	SUM_CREATED_TMP_TABLES	SUM_SELECT_FULL_JOIN	SUM_SELECT_FULL_RANGE_JOIN	SUM_SELECT_RANGE	SUM_SELECT_RANGE_CHECK	SUM_SELECT_SCAN	SUM_SORT_MERGE_PASSES	SUM_SORT_RANGE	SUM_SORT_ROWS	SUM_SORT_SCAN	SUM_NO_INDEX_USED	SUM_NO_GOOD_INDEX_USED
 select * from performance_schema.events_statements_summary_by_host_by_event_name;
@@ -197,11 +197,11 @@ USER	EVENT_NAME	COUNT_STAR	SUM_TIMER_WAI
 select * from performance_schema.events_statements_summary_global_by_event_name;
 EVENT_NAME	COUNT_STAR	SUM_TIMER_WAIT	MIN_TIMER_WAIT	AVG_TIMER_WAIT	MAX_TIMER_WAIT	SUM_LOCK_TIME	SUM_ERRORS	SUM_WARNINGS	SUM_ROWS_AFFECTED	SUM_ROWS_SENT	SUM_ROWS_EXAMINED	SUM_CREATED_TMP_DISK_TABLES	SUM_CREATED_TMP_TABLES	SUM_SELECT_FULL_JOIN	SUM_SELECT_FULL_RANGE_JOIN	SUM_SELECT_RANGE	SUM_SELECT_RANGE_CHECK	SUM_SELECT_SCAN	SUM_SORT_MERGE_PASSES	SUM_SORT_RANGE	SUM_SORT_ROWS	SUM_SORT_SCAN	SUM_NO_INDEX_USED	SUM_NO_GOOD_INDEX_USED
 select * from performance_schema.events_waits_current;
-THREAD_ID	EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	SPINS	OBJECT_SCHEMA	OBJECT_NAME	INDEX_NAME	OBJECT_TYPE	OBJECT_INSTANCE_BEGIN	NESTING_EVENT_ID	NESTING_EVENT_TYPE	OPERATION	NUMBER_OF_BYTES	FLAGS
+THREAD_ID	EVENT_ID	END_EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	SPINS	OBJECT_SCHEMA	OBJECT_NAME	INDEX_NAME	OBJECT_TYPE	OBJECT_INSTANCE_BEGIN	NESTING_EVENT_ID	NESTING_EVENT_TYPE	OPERATION	NUMBER_OF_BYTES	FLAGS
 select * from performance_schema.events_waits_history;
-THREAD_ID	EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	SPINS	OBJECT_SCHEMA	OBJECT_NAME	INDEX_NAME	OBJECT_TYPE	OBJECT_INSTANCE_BEGIN	NESTING_EVENT_ID	NESTING_EVENT_TYPE	OPERATION	NUMBER_OF_BYTES	FLAGS
+THREAD_ID	EVENT_ID	END_EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	SPINS	OBJECT_SCHEMA	OBJECT_NAME	INDEX_NAME	OBJECT_TYPE	OBJECT_INSTANCE_BEGIN	NESTING_EVENT_ID	NESTING_EVENT_TYPE	OPERATION	NUMBER_OF_BYTES	FLAGS
 select * from performance_schema.events_waits_history_long;
-THREAD_ID	EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	SPINS	OBJECT_SCHEMA	OBJECT_NAME	INDEX_NAME	OBJECT_TYPE	OBJECT_INSTANCE_BEGIN	NESTING_EVENT_ID	NESTING_EVENT_TYPE	OPERATION	NUMBER_OF_BYTES	FLAGS
+THREAD_ID	EVENT_ID	END_EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	SPINS	OBJECT_SCHEMA	OBJECT_NAME	INDEX_NAME	OBJECT_TYPE	OBJECT_INSTANCE_BEGIN	NESTING_EVENT_ID	NESTING_EVENT_TYPE	OPERATION	NUMBER_OF_BYTES	FLAGS
 select * from performance_schema.events_waits_summary_by_account_by_event_name;
 USER	HOST	EVENT_NAME	COUNT_STAR	SUM_TIMER_WAIT	MIN_TIMER_WAIT	AVG_TIMER_WAIT	MAX_TIMER_WAIT
 select * from performance_schema.events_waits_summary_by_host_by_event_name;

=== modified file 'mysql-test/suite/perfschema/r/table_schema.result'
--- a/mysql-test/suite/perfschema/r/table_schema.result	revid:inaam.rana@stripped
+++ b/mysql-test/suite/perfschema/r/table_schema.result	revid:inaam.rana@stripped
@@ -9,31 +9,34 @@ def	performance_schema	cond_instances	NA
 def	performance_schema	cond_instances	OBJECT_INSTANCE_BEGIN	2	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
 def	performance_schema	events_stages_current	THREAD_ID	1	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(11)			select,insert,update,references	
 def	performance_schema	events_stages_current	EVENT_ID	2	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_stages_current	EVENT_NAME	3	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
-def	performance_schema	events_stages_current	SOURCE	4	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_stages_current	TIMER_START	5	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_stages_current	TIMER_END	6	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_stages_current	TIMER_WAIT	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_stages_current	NESTING_EVENT_ID	8	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_stages_current	NESTING_EVENT_TYPE	9	NULL	YES	enum	9	27	NULL	NULL	utf8	utf8_general_ci	enum('STATEMENT','STAGE','WAIT')			select,insert,update,references	
+def	performance_schema	events_stages_current	END_EVENT_ID	3	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_stages_current	EVENT_NAME	4	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
+def	performance_schema	events_stages_current	SOURCE	5	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_stages_current	TIMER_START	6	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_stages_current	TIMER_END	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_stages_current	TIMER_WAIT	8	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_stages_current	NESTING_EVENT_ID	9	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_stages_current	NESTING_EVENT_TYPE	10	NULL	YES	enum	9	27	NULL	NULL	utf8	utf8_general_ci	enum('STATEMENT','STAGE','WAIT')			select,insert,update,references	
 def	performance_schema	events_stages_history	THREAD_ID	1	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(11)			select,insert,update,references	
 def	performance_schema	events_stages_history	EVENT_ID	2	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_stages_history	EVENT_NAME	3	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
-def	performance_schema	events_stages_history	SOURCE	4	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_stages_history	TIMER_START	5	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_stages_history	TIMER_END	6	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_stages_history	TIMER_WAIT	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_stages_history	NESTING_EVENT_ID	8	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_stages_history	NESTING_EVENT_TYPE	9	NULL	YES	enum	9	27	NULL	NULL	utf8	utf8_general_ci	enum('STATEMENT','STAGE','WAIT')			select,insert,update,references	
+def	performance_schema	events_stages_history	END_EVENT_ID	3	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_stages_history	EVENT_NAME	4	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
+def	performance_schema	events_stages_history	SOURCE	5	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_stages_history	TIMER_START	6	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_stages_history	TIMER_END	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_stages_history	TIMER_WAIT	8	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_stages_history	NESTING_EVENT_ID	9	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_stages_history	NESTING_EVENT_TYPE	10	NULL	YES	enum	9	27	NULL	NULL	utf8	utf8_general_ci	enum('STATEMENT','STAGE','WAIT')			select,insert,update,references	
 def	performance_schema	events_stages_history_long	THREAD_ID	1	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(11)			select,insert,update,references	
 def	performance_schema	events_stages_history_long	EVENT_ID	2	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_stages_history_long	EVENT_NAME	3	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
-def	performance_schema	events_stages_history_long	SOURCE	4	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_stages_history_long	TIMER_START	5	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_stages_history_long	TIMER_END	6	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_stages_history_long	TIMER_WAIT	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_stages_history_long	NESTING_EVENT_ID	8	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_stages_history_long	NESTING_EVENT_TYPE	9	NULL	YES	enum	9	27	NULL	NULL	utf8	utf8_general_ci	enum('STATEMENT','STAGE','WAIT')			select,insert,update,references	
+def	performance_schema	events_stages_history_long	END_EVENT_ID	3	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_stages_history_long	EVENT_NAME	4	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
+def	performance_schema	events_stages_history_long	SOURCE	5	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_stages_history_long	TIMER_START	6	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_stages_history_long	TIMER_END	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_stages_history_long	TIMER_WAIT	8	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_stages_history_long	NESTING_EVENT_ID	9	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_stages_history_long	NESTING_EVENT_TYPE	10	NULL	YES	enum	9	27	NULL	NULL	utf8	utf8_general_ci	enum('STATEMENT','STAGE','WAIT')			select,insert,update,references	
 def	performance_schema	events_stages_summary_by_account_by_event_name	USER	1	NULL	YES	char	16	48	NULL	NULL	utf8	utf8_bin	char(16)			select,insert,update,references	
 def	performance_schema	events_stages_summary_by_account_by_event_name	HOST	2	NULL	YES	char	60	180	NULL	NULL	utf8	utf8_bin	char(60)			select,insert,update,references	
 def	performance_schema	events_stages_summary_by_account_by_event_name	EVENT_NAME	3	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
@@ -71,115 +74,118 @@ def	performance_schema	events_stages_sum
 def	performance_schema	events_stages_summary_global_by_event_name	MAX_TIMER_WAIT	6	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
 def	performance_schema	events_statements_current	THREAD_ID	1	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(11)			select,insert,update,references	
 def	performance_schema	events_statements_current	EVENT_ID	2	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	EVENT_NAME	3	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
-def	performance_schema	events_statements_current	SOURCE	4	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_statements_current	TIMER_START	5	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	TIMER_END	6	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	TIMER_WAIT	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	LOCK_TIME	8	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	SQL_TEXT	9	NULL	YES	longtext	4294967295	4294967295	NULL	NULL	utf8	utf8_general_ci	longtext			select,insert,update,references	
-def	performance_schema	events_statements_current	CURRENT_SCHEMA	10	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_statements_current	OBJECT_TYPE	11	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_statements_current	OBJECT_SCHEMA	12	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_statements_current	OBJECT_NAME	13	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_statements_current	OBJECT_INSTANCE_BEGIN	14	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	MYSQL_ERRNO	15	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	int(11)			select,insert,update,references	
-def	performance_schema	events_statements_current	RETURNED_SQLSTATE	16	NULL	YES	varchar	5	15	NULL	NULL	utf8	utf8_general_ci	varchar(5)			select,insert,update,references	
-def	performance_schema	events_statements_current	MESSAGE_TEXT	17	NULL	YES	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
-def	performance_schema	events_statements_current	ERRORS	18	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	WARNINGS	19	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	ROWS_AFFECTED	20	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	ROWS_SENT	21	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	ROWS_EXAMINED	22	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	CREATED_TMP_DISK_TABLES	23	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	CREATED_TMP_TABLES	24	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	SELECT_FULL_JOIN	25	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	SELECT_FULL_RANGE_JOIN	26	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	SELECT_RANGE	27	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	SELECT_RANGE_CHECK	28	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	SELECT_SCAN	29	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	SORT_MERGE_PASSES	30	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	SORT_RANGE	31	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	SORT_ROWS	32	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	SORT_SCAN	33	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	NO_INDEX_USED	34	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	NO_GOOD_INDEX_USED	35	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	NESTING_EVENT_ID	36	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	NESTING_EVENT_TYPE	37	NULL	YES	enum	9	27	NULL	NULL	utf8	utf8_general_ci	enum('STATEMENT','STAGE','WAIT')			select,insert,update,references	
+def	performance_schema	events_statements_current	END_EVENT_ID	3	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	EVENT_NAME	4	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
+def	performance_schema	events_statements_current	SOURCE	5	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_statements_current	TIMER_START	6	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	TIMER_END	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	TIMER_WAIT	8	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	LOCK_TIME	9	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	SQL_TEXT	10	NULL	YES	longtext	4294967295	4294967295	NULL	NULL	utf8	utf8_general_ci	longtext			select,insert,update,references	
+def	performance_schema	events_statements_current	CURRENT_SCHEMA	11	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_statements_current	OBJECT_TYPE	12	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_statements_current	OBJECT_SCHEMA	13	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_statements_current	OBJECT_NAME	14	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_statements_current	OBJECT_INSTANCE_BEGIN	15	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	MYSQL_ERRNO	16	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	int(11)			select,insert,update,references	
+def	performance_schema	events_statements_current	RETURNED_SQLSTATE	17	NULL	YES	varchar	5	15	NULL	NULL	utf8	utf8_general_ci	varchar(5)			select,insert,update,references	
+def	performance_schema	events_statements_current	MESSAGE_TEXT	18	NULL	YES	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
+def	performance_schema	events_statements_current	ERRORS	19	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	WARNINGS	20	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	ROWS_AFFECTED	21	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	ROWS_SENT	22	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	ROWS_EXAMINED	23	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	CREATED_TMP_DISK_TABLES	24	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	CREATED_TMP_TABLES	25	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	SELECT_FULL_JOIN	26	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	SELECT_FULL_RANGE_JOIN	27	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	SELECT_RANGE	28	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	SELECT_RANGE_CHECK	29	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	SELECT_SCAN	30	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	SORT_MERGE_PASSES	31	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	SORT_RANGE	32	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	SORT_ROWS	33	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	SORT_SCAN	34	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	NO_INDEX_USED	35	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	NO_GOOD_INDEX_USED	36	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	NESTING_EVENT_ID	37	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	NESTING_EVENT_TYPE	38	NULL	YES	enum	9	27	NULL	NULL	utf8	utf8_general_ci	enum('STATEMENT','STAGE','WAIT')			select,insert,update,references	
 def	performance_schema	events_statements_history	THREAD_ID	1	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(11)			select,insert,update,references	
 def	performance_schema	events_statements_history	EVENT_ID	2	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	EVENT_NAME	3	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
-def	performance_schema	events_statements_history	SOURCE	4	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_statements_history	TIMER_START	5	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	TIMER_END	6	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	TIMER_WAIT	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	LOCK_TIME	8	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	SQL_TEXT	9	NULL	YES	longtext	4294967295	4294967295	NULL	NULL	utf8	utf8_general_ci	longtext			select,insert,update,references	
-def	performance_schema	events_statements_history	CURRENT_SCHEMA	10	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_statements_history	OBJECT_TYPE	11	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_statements_history	OBJECT_SCHEMA	12	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_statements_history	OBJECT_NAME	13	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_statements_history	OBJECT_INSTANCE_BEGIN	14	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	MYSQL_ERRNO	15	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	int(11)			select,insert,update,references	
-def	performance_schema	events_statements_history	RETURNED_SQLSTATE	16	NULL	YES	varchar	5	15	NULL	NULL	utf8	utf8_general_ci	varchar(5)			select,insert,update,references	
-def	performance_schema	events_statements_history	MESSAGE_TEXT	17	NULL	YES	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
-def	performance_schema	events_statements_history	ERRORS	18	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	WARNINGS	19	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	ROWS_AFFECTED	20	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	ROWS_SENT	21	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	ROWS_EXAMINED	22	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	CREATED_TMP_DISK_TABLES	23	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	CREATED_TMP_TABLES	24	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	SELECT_FULL_JOIN	25	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	SELECT_FULL_RANGE_JOIN	26	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	SELECT_RANGE	27	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	SELECT_RANGE_CHECK	28	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	SELECT_SCAN	29	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	SORT_MERGE_PASSES	30	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	SORT_RANGE	31	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	SORT_ROWS	32	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	SORT_SCAN	33	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	NO_INDEX_USED	34	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	NO_GOOD_INDEX_USED	35	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	NESTING_EVENT_ID	36	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	NESTING_EVENT_TYPE	37	NULL	YES	enum	9	27	NULL	NULL	utf8	utf8_general_ci	enum('STATEMENT','STAGE','WAIT')			select,insert,update,references	
+def	performance_schema	events_statements_history	END_EVENT_ID	3	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	EVENT_NAME	4	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
+def	performance_schema	events_statements_history	SOURCE	5	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_statements_history	TIMER_START	6	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	TIMER_END	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	TIMER_WAIT	8	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	LOCK_TIME	9	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	SQL_TEXT	10	NULL	YES	longtext	4294967295	4294967295	NULL	NULL	utf8	utf8_general_ci	longtext			select,insert,update,references	
+def	performance_schema	events_statements_history	CURRENT_SCHEMA	11	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_statements_history	OBJECT_TYPE	12	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_statements_history	OBJECT_SCHEMA	13	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_statements_history	OBJECT_NAME	14	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_statements_history	OBJECT_INSTANCE_BEGIN	15	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	MYSQL_ERRNO	16	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	int(11)			select,insert,update,references	
+def	performance_schema	events_statements_history	RETURNED_SQLSTATE	17	NULL	YES	varchar	5	15	NULL	NULL	utf8	utf8_general_ci	varchar(5)			select,insert,update,references	
+def	performance_schema	events_statements_history	MESSAGE_TEXT	18	NULL	YES	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
+def	performance_schema	events_statements_history	ERRORS	19	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	WARNINGS	20	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	ROWS_AFFECTED	21	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	ROWS_SENT	22	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	ROWS_EXAMINED	23	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	CREATED_TMP_DISK_TABLES	24	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	CREATED_TMP_TABLES	25	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	SELECT_FULL_JOIN	26	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	SELECT_FULL_RANGE_JOIN	27	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	SELECT_RANGE	28	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	SELECT_RANGE_CHECK	29	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	SELECT_SCAN	30	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	SORT_MERGE_PASSES	31	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	SORT_RANGE	32	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	SORT_ROWS	33	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	SORT_SCAN	34	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	NO_INDEX_USED	35	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	NO_GOOD_INDEX_USED	36	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	NESTING_EVENT_ID	37	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	NESTING_EVENT_TYPE	38	NULL	YES	enum	9	27	NULL	NULL	utf8	utf8_general_ci	enum('STATEMENT','STAGE','WAIT')			select,insert,update,references	
 def	performance_schema	events_statements_history_long	THREAD_ID	1	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(11)			select,insert,update,references	
 def	performance_schema	events_statements_history_long	EVENT_ID	2	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	EVENT_NAME	3	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
-def	performance_schema	events_statements_history_long	SOURCE	4	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_statements_history_long	TIMER_START	5	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	TIMER_END	6	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	TIMER_WAIT	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	LOCK_TIME	8	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	SQL_TEXT	9	NULL	YES	longtext	4294967295	4294967295	NULL	NULL	utf8	utf8_general_ci	longtext			select,insert,update,references	
-def	performance_schema	events_statements_history_long	CURRENT_SCHEMA	10	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_statements_history_long	OBJECT_TYPE	11	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_statements_history_long	OBJECT_SCHEMA	12	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_statements_history_long	OBJECT_NAME	13	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_statements_history_long	OBJECT_INSTANCE_BEGIN	14	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	MYSQL_ERRNO	15	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	int(11)			select,insert,update,references	
-def	performance_schema	events_statements_history_long	RETURNED_SQLSTATE	16	NULL	YES	varchar	5	15	NULL	NULL	utf8	utf8_general_ci	varchar(5)			select,insert,update,references	
-def	performance_schema	events_statements_history_long	MESSAGE_TEXT	17	NULL	YES	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
-def	performance_schema	events_statements_history_long	ERRORS	18	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	WARNINGS	19	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	ROWS_AFFECTED	20	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	ROWS_SENT	21	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	ROWS_EXAMINED	22	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	CREATED_TMP_DISK_TABLES	23	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	CREATED_TMP_TABLES	24	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	SELECT_FULL_JOIN	25	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	SELECT_FULL_RANGE_JOIN	26	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	SELECT_RANGE	27	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	SELECT_RANGE_CHECK	28	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	SELECT_SCAN	29	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	SORT_MERGE_PASSES	30	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	SORT_RANGE	31	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	SORT_ROWS	32	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	SORT_SCAN	33	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	NO_INDEX_USED	34	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	NO_GOOD_INDEX_USED	35	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	NESTING_EVENT_ID	36	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	NESTING_EVENT_TYPE	37	NULL	YES	enum	9	27	NULL	NULL	utf8	utf8_general_ci	enum('STATEMENT','STAGE','WAIT')			select,insert,update,references	
+def	performance_schema	events_statements_history_long	END_EVENT_ID	3	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	EVENT_NAME	4	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
+def	performance_schema	events_statements_history_long	SOURCE	5	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_statements_history_long	TIMER_START	6	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	TIMER_END	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	TIMER_WAIT	8	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	LOCK_TIME	9	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	SQL_TEXT	10	NULL	YES	longtext	4294967295	4294967295	NULL	NULL	utf8	utf8_general_ci	longtext			select,insert,update,references	
+def	performance_schema	events_statements_history_long	CURRENT_SCHEMA	11	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_statements_history_long	OBJECT_TYPE	12	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_statements_history_long	OBJECT_SCHEMA	13	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_statements_history_long	OBJECT_NAME	14	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_statements_history_long	OBJECT_INSTANCE_BEGIN	15	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	MYSQL_ERRNO	16	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	int(11)			select,insert,update,references	
+def	performance_schema	events_statements_history_long	RETURNED_SQLSTATE	17	NULL	YES	varchar	5	15	NULL	NULL	utf8	utf8_general_ci	varchar(5)			select,insert,update,references	
+def	performance_schema	events_statements_history_long	MESSAGE_TEXT	18	NULL	YES	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
+def	performance_schema	events_statements_history_long	ERRORS	19	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	WARNINGS	20	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	ROWS_AFFECTED	21	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	ROWS_SENT	22	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	ROWS_EXAMINED	23	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	CREATED_TMP_DISK_TABLES	24	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	CREATED_TMP_TABLES	25	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	SELECT_FULL_JOIN	26	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	SELECT_FULL_RANGE_JOIN	27	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	SELECT_RANGE	28	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	SELECT_RANGE_CHECK	29	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	SELECT_SCAN	30	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	SORT_MERGE_PASSES	31	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	SORT_RANGE	32	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	SORT_ROWS	33	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	SORT_SCAN	34	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	NO_INDEX_USED	35	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	NO_GOOD_INDEX_USED	36	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	NESTING_EVENT_ID	37	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	NESTING_EVENT_TYPE	38	NULL	YES	enum	9	27	NULL	NULL	utf8	utf8_general_ci	enum('STATEMENT','STAGE','WAIT')			select,insert,update,references	
 def	performance_schema	events_statements_summary_by_account_by_event_name	USER	1	NULL	YES	char	16	48	NULL	NULL	utf8	utf8_bin	char(16)			select,insert,update,references	
 def	performance_schema	events_statements_summary_by_account_by_event_name	HOST	2	NULL	YES	char	60	180	NULL	NULL	utf8	utf8_bin	char(60)			select,insert,update,references	
 def	performance_schema	events_statements_summary_by_account_by_event_name	EVENT_NAME	3	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
@@ -312,58 +318,61 @@ def	performance_schema	events_statements
 def	performance_schema	events_statements_summary_global_by_event_name	SUM_NO_GOOD_INDEX_USED	25	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
 def	performance_schema	events_waits_current	THREAD_ID	1	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(11)			select,insert,update,references	
 def	performance_schema	events_waits_current	EVENT_ID	2	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_current	EVENT_NAME	3	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
-def	performance_schema	events_waits_current	SOURCE	4	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_waits_current	TIMER_START	5	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_current	TIMER_END	6	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_current	TIMER_WAIT	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_current	SPINS	8	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_current	OBJECT_SCHEMA	9	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_waits_current	OBJECT_NAME	10	NULL	YES	varchar	512	1536	NULL	NULL	utf8	utf8_general_ci	varchar(512)			select,insert,update,references	
-def	performance_schema	events_waits_current	INDEX_NAME	11	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_waits_current	OBJECT_TYPE	12	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_waits_current	OBJECT_INSTANCE_BEGIN	13	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_current	NESTING_EVENT_ID	14	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_current	NESTING_EVENT_TYPE	15	NULL	YES	enum	9	27	NULL	NULL	utf8	utf8_general_ci	enum('STATEMENT','STAGE','WAIT')			select,insert,update,references	
-def	performance_schema	events_waits_current	OPERATION	16	NULL	NO	varchar	32	96	NULL	NULL	utf8	utf8_general_ci	varchar(32)			select,insert,update,references	
-def	performance_schema	events_waits_current	NUMBER_OF_BYTES	17	NULL	YES	bigint	NULL	NULL	19	0	NULL	NULL	bigint(20)			select,insert,update,references	
-def	performance_schema	events_waits_current	FLAGS	18	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_current	END_EVENT_ID	3	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_current	EVENT_NAME	4	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
+def	performance_schema	events_waits_current	SOURCE	5	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_waits_current	TIMER_START	6	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_current	TIMER_END	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_current	TIMER_WAIT	8	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_current	SPINS	9	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_current	OBJECT_SCHEMA	10	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_waits_current	OBJECT_NAME	11	NULL	YES	varchar	512	1536	NULL	NULL	utf8	utf8_general_ci	varchar(512)			select,insert,update,references	
+def	performance_schema	events_waits_current	INDEX_NAME	12	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_waits_current	OBJECT_TYPE	13	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_waits_current	OBJECT_INSTANCE_BEGIN	14	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_current	NESTING_EVENT_ID	15	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_current	NESTING_EVENT_TYPE	16	NULL	YES	enum	9	27	NULL	NULL	utf8	utf8_general_ci	enum('STATEMENT','STAGE','WAIT')			select,insert,update,references	
+def	performance_schema	events_waits_current	OPERATION	17	NULL	NO	varchar	32	96	NULL	NULL	utf8	utf8_general_ci	varchar(32)			select,insert,update,references	
+def	performance_schema	events_waits_current	NUMBER_OF_BYTES	18	NULL	YES	bigint	NULL	NULL	19	0	NULL	NULL	bigint(20)			select,insert,update,references	
+def	performance_schema	events_waits_current	FLAGS	19	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned			select,insert,update,references	
 def	performance_schema	events_waits_history	THREAD_ID	1	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(11)			select,insert,update,references	
 def	performance_schema	events_waits_history	EVENT_ID	2	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_history	EVENT_NAME	3	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
-def	performance_schema	events_waits_history	SOURCE	4	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_waits_history	TIMER_START	5	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_history	TIMER_END	6	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_history	TIMER_WAIT	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_history	SPINS	8	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_history	OBJECT_SCHEMA	9	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_waits_history	OBJECT_NAME	10	NULL	YES	varchar	512	1536	NULL	NULL	utf8	utf8_general_ci	varchar(512)			select,insert,update,references	
-def	performance_schema	events_waits_history	INDEX_NAME	11	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_waits_history	OBJECT_TYPE	12	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_waits_history	OBJECT_INSTANCE_BEGIN	13	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_history	NESTING_EVENT_ID	14	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_history	NESTING_EVENT_TYPE	15	NULL	YES	enum	9	27	NULL	NULL	utf8	utf8_general_ci	enum('STATEMENT','STAGE','WAIT')			select,insert,update,references	
-def	performance_schema	events_waits_history	OPERATION	16	NULL	NO	varchar	32	96	NULL	NULL	utf8	utf8_general_ci	varchar(32)			select,insert,update,references	
-def	performance_schema	events_waits_history	NUMBER_OF_BYTES	17	NULL	YES	bigint	NULL	NULL	19	0	NULL	NULL	bigint(20)			select,insert,update,references	
-def	performance_schema	events_waits_history	FLAGS	18	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_history	END_EVENT_ID	3	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_history	EVENT_NAME	4	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
+def	performance_schema	events_waits_history	SOURCE	5	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_waits_history	TIMER_START	6	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_history	TIMER_END	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_history	TIMER_WAIT	8	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_history	SPINS	9	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_history	OBJECT_SCHEMA	10	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_waits_history	OBJECT_NAME	11	NULL	YES	varchar	512	1536	NULL	NULL	utf8	utf8_general_ci	varchar(512)			select,insert,update,references	
+def	performance_schema	events_waits_history	INDEX_NAME	12	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_waits_history	OBJECT_TYPE	13	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_waits_history	OBJECT_INSTANCE_BEGIN	14	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_history	NESTING_EVENT_ID	15	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_history	NESTING_EVENT_TYPE	16	NULL	YES	enum	9	27	NULL	NULL	utf8	utf8_general_ci	enum('STATEMENT','STAGE','WAIT')			select,insert,update,references	
+def	performance_schema	events_waits_history	OPERATION	17	NULL	NO	varchar	32	96	NULL	NULL	utf8	utf8_general_ci	varchar(32)			select,insert,update,references	
+def	performance_schema	events_waits_history	NUMBER_OF_BYTES	18	NULL	YES	bigint	NULL	NULL	19	0	NULL	NULL	bigint(20)			select,insert,update,references	
+def	performance_schema	events_waits_history	FLAGS	19	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned			select,insert,update,references	
 def	performance_schema	events_waits_history_long	THREAD_ID	1	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(11)			select,insert,update,references	
 def	performance_schema	events_waits_history_long	EVENT_ID	2	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_history_long	EVENT_NAME	3	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
-def	performance_schema	events_waits_history_long	SOURCE	4	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_waits_history_long	TIMER_START	5	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_history_long	TIMER_END	6	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_history_long	TIMER_WAIT	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_history_long	SPINS	8	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_history_long	OBJECT_SCHEMA	9	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_waits_history_long	OBJECT_NAME	10	NULL	YES	varchar	512	1536	NULL	NULL	utf8	utf8_general_ci	varchar(512)			select,insert,update,references	
-def	performance_schema	events_waits_history_long	INDEX_NAME	11	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_waits_history_long	OBJECT_TYPE	12	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_waits_history_long	OBJECT_INSTANCE_BEGIN	13	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_history_long	NESTING_EVENT_ID	14	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_history_long	NESTING_EVENT_TYPE	15	NULL	YES	enum	9	27	NULL	NULL	utf8	utf8_general_ci	enum('STATEMENT','STAGE','WAIT')			select,insert,update,references	
-def	performance_schema	events_waits_history_long	OPERATION	16	NULL	NO	varchar	32	96	NULL	NULL	utf8	utf8_general_ci	varchar(32)			select,insert,update,references	
-def	performance_schema	events_waits_history_long	NUMBER_OF_BYTES	17	NULL	YES	bigint	NULL	NULL	19	0	NULL	NULL	bigint(20)			select,insert,update,references	
-def	performance_schema	events_waits_history_long	FLAGS	18	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_history_long	END_EVENT_ID	3	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_history_long	EVENT_NAME	4	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
+def	performance_schema	events_waits_history_long	SOURCE	5	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_waits_history_long	TIMER_START	6	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_history_long	TIMER_END	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_history_long	TIMER_WAIT	8	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_history_long	SPINS	9	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_history_long	OBJECT_SCHEMA	10	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_waits_history_long	OBJECT_NAME	11	NULL	YES	varchar	512	1536	NULL	NULL	utf8	utf8_general_ci	varchar(512)			select,insert,update,references	
+def	performance_schema	events_waits_history_long	INDEX_NAME	12	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_waits_history_long	OBJECT_TYPE	13	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_waits_history_long	OBJECT_INSTANCE_BEGIN	14	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_history_long	NESTING_EVENT_ID	15	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_history_long	NESTING_EVENT_TYPE	16	NULL	YES	enum	9	27	NULL	NULL	utf8	utf8_general_ci	enum('STATEMENT','STAGE','WAIT')			select,insert,update,references	
+def	performance_schema	events_waits_history_long	OPERATION	17	NULL	NO	varchar	32	96	NULL	NULL	utf8	utf8_general_ci	varchar(32)			select,insert,update,references	
+def	performance_schema	events_waits_history_long	NUMBER_OF_BYTES	18	NULL	YES	bigint	NULL	NULL	19	0	NULL	NULL	bigint(20)			select,insert,update,references	
+def	performance_schema	events_waits_history_long	FLAGS	19	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned			select,insert,update,references	
 def	performance_schema	events_waits_summary_by_account_by_event_name	USER	1	NULL	YES	char	16	48	NULL	NULL	utf8	utf8_bin	char(16)			select,insert,update,references	
 def	performance_schema	events_waits_summary_by_account_by_event_name	HOST	2	NULL	YES	char	60	180	NULL	NULL	utf8	utf8_bin	char(60)			select,insert,update,references	
 def	performance_schema	events_waits_summary_by_account_by_event_name	EVENT_NAME	3	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	

=== modified file 'mysql-test/t/compare.test'
--- a/mysql-test/t/compare.test	revid:inaam.rana@stripped
+++ b/mysql-test/t/compare.test	revid:inaam.rana@stripped
@@ -86,3 +86,11 @@ SELECT * FROM t1 WHERE a > '2008-01-01'
 DROP TABLE t1;
 
 --echo End of 5.0 tests
+
+#
+# Bug #11764818 57692: Crash in item_func_in::val_int() with ZEROFILL
+#
+
+CREATE TABLE t1(a INT ZEROFILL);
+SELECT 1 FROM t1 WHERE t1.a IN (1, t1.a) AND t1.a=2;
+DROP TABLE t1;

=== modified file 'mysql-test/t/index_merge_innodb.test'
--- a/mysql-test/t/index_merge_innodb.test	revid:inaam.rana@stripped
+++ b/mysql-test/t/index_merge_innodb.test	revid:inaam.rana@stripped
@@ -28,3 +28,24 @@ let $merge_table_support= 0;
 
 --source include/index_merge_2sweeps.inc
 --source include/index_merge_ror_cpk.inc
+
+
+--echo #
+--echo # Bug#11747423 32254: INDEX MERGE USED UNNECESSARILY
+--echo #
+CREATE TABLE t1 (
+  id INT NOT NULL PRIMARY KEY,
+  id2 INT NOT NULL,
+  id3 INT NOT NULL,
+  KEY (id2),
+  KEY (id3),
+  KEY covering_index (id2,id3)
+) ENGINE=InnoDB;
+
+INSERT INTO t1 VALUES (0, 0, 0), (1, 1, 1), (2, 2, 2), (3, 3, 3), (4, 4, 4), (5, 5, 5), (6, 6, 6), (7, 7, 7);
+INSERT INTO t1 SELECT id + 8, id2 + 8, id3 +8 FROM t1;
+INSERT INTO t1 SELECT id + 16, 7, 0 FROM t1;
+
+EXPLAIN SELECT SQL_NO_CACHE count(*) FROM t1 WHERE id2=7 AND id3=0;
+
+DROP TABLE t1;

=== modified file 'mysql-test/t/plugin.test'
--- a/mysql-test/t/plugin.test	revid:inaam.rana@stripped
+++ b/mysql-test/t/plugin.test	revid:inaam.rana@stripped
@@ -17,7 +17,7 @@ eval INSTALL PLUGIN example SONAME '$EXA
 
 CREATE TABLE t1(a int) ENGINE=EXAMPLE;
 
-# Let's do some advanced ops with the example engine :)
+--error ER_ILLEGAL_HA
 SELECT * FROM t1;
 
 DROP TABLE t1;

=== modified file 'mysql-test/t/sp-error.test'
--- a/mysql-test/t/sp-error.test	revid:inaam.rana@stripped
+++ b/mysql-test/t/sp-error.test	revid:inaam.rana@stripped
@@ -3776,3 +3776,38 @@ delimiter ;|
 --echo
 DROP PROCEDURE p1;
 DROP PROCEDURE p2;
+
+
+--echo #
+--echo # Bug#13113222 RQG_SIGNAL_RESIGNAL FAILED WITH ASSERTION.
+--echo #
+
+--disable_warnings
+DROP PROCEDURE IF EXISTS p1;
+DROP PROCEDURE IF EXISTS p2;
+--enable_warnings
+
+delimiter |;
+CREATE PROCEDURE p1()
+BEGIN
+  DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SELECT 'triggered p1';
+  # This will trigger an error.
+  SIGNAL SQLSTATE 'HY000';
+END|
+
+CREATE PROCEDURE p2()
+BEGIN
+  DECLARE CONTINUE HANDLER FOR SQLWARNING SELECT 'triggered p2';
+  # This will trigger a warning.
+  SIGNAL SQLSTATE '01000';
+END|
+delimiter ;|
+
+SET @old_max_error_count=  @@session.max_error_count;
+SET SESSION max_error_count= 0;
+CALL p1();
+CALL p2();
+SET SESSION max_error_count= @old_max_error_count;
+
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;

=== modified file 'mysql-test/t/user_var.test'
--- a/mysql-test/t/user_var.test	revid:inaam.rana@stripped
+++ b/mysql-test/t/user_var.test	revid:inaam.rana@stripped
@@ -405,3 +405,13 @@ DROP TRIGGER trg1;
 DROP TABLE t1;
 
 --echo End of 5.5 tests
+
+#
+# Bug #11764372 57197: EVEN MORE USER VARIABLE CRASHING FUN
+#
+
+CREATE TABLE t1(a int);
+INSERT INTO t1 VALUES (1), (2);
+SELECT DISTINCT @a:=MIN(t1.a) FROM t1, t1 AS t2
+GROUP BY @b:=(SELECT COUNT(*) > t2.a);
+DROP TABLE t1;

=== modified file 'scripts/mysql_system_tables.sql'
--- a/scripts/mysql_system_tables.sql	revid:inaam.rana@stripped
+++ b/scripts/mysql_system_tables.sql	revid:inaam.rana@stripped
@@ -225,6 +225,7 @@ DROP PREPARE stmt;
 SET @cmd="CREATE TABLE performance_schema.events_waits_current("
   "THREAD_ID INTEGER 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,"
@@ -255,6 +256,7 @@ DROP PREPARE stmt;
 SET @cmd="CREATE TABLE performance_schema.events_waits_history("
   "THREAD_ID INTEGER 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,"
@@ -285,6 +287,7 @@ DROP PREPARE stmt;
 SET @cmd="CREATE TABLE performance_schema.events_waits_history_long("
   "THREAD_ID INTEGER 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,"
@@ -923,6 +926,7 @@ DROP PREPARE stmt;
 SET @cmd="CREATE TABLE performance_schema.events_stages_current("
   "THREAD_ID INTEGER 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,"
@@ -944,6 +948,7 @@ DROP PREPARE stmt;
 SET @cmd="CREATE TABLE performance_schema.events_stages_history("
   "THREAD_ID INTEGER 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,"
@@ -965,6 +970,7 @@ DROP PREPARE stmt;
 SET @cmd="CREATE TABLE performance_schema.events_stages_history_long("
   "THREAD_ID INTEGER 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,"
@@ -1081,6 +1087,7 @@ DROP PREPARE stmt;
 SET @cmd="CREATE TABLE performance_schema.events_statements_current("
   "THREAD_ID INTEGER 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,"
@@ -1130,6 +1137,7 @@ DROP PREPARE stmt;
 SET @cmd="CREATE TABLE performance_schema.events_statements_history("
   "THREAD_ID INTEGER 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,"
@@ -1179,6 +1187,7 @@ DROP PREPARE stmt;
 SET @cmd="CREATE TABLE performance_schema.events_statements_history_long("
   "THREAD_ID INTEGER 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,"

=== modified file 'sql/event_db_repository.cc'
--- a/sql/event_db_repository.cc	revid:inaam.rana@stripped
+++ b/sql/event_db_repository.cc	revid:inaam.rana@stripped
@@ -490,7 +490,8 @@ Event_db_repository::table_scan_all_for_
   READ_RECORD read_record_info;
   DBUG_ENTER("Event_db_repository::table_scan_all_for_i_s");
 
-  init_read_record(&read_record_info, thd, event_table, NULL, 1, 0, FALSE);
+  if (init_read_record(&read_record_info, thd, event_table, NULL, 1, 1, FALSE))
+    DBUG_RETURN(TRUE);
 
   /*
     rr_sequential, in read_record(), returns 137==HA_ERR_END_OF_FILE,
@@ -508,7 +509,7 @@ Event_db_repository::table_scan_all_for_
   end_read_record(&read_record_info);
 
   /*  ret is guaranteed to be != 0 */
-  DBUG_RETURN(ret == -1? FALSE:TRUE);
+  DBUG_RETURN(ret == -1 ? FALSE : TRUE);
 }
 
 
@@ -994,7 +995,8 @@ Event_db_repository::drop_schema_events(
     DBUG_VOID_RETURN;
 
   /* only enabled events are in memory, so we go now and delete the rest */
-  init_read_record(&read_record_info, thd, table, NULL, 1, 0, FALSE);
+  if (init_read_record(&read_record_info, thd, table, NULL, 1, 1, FALSE))
+    DBUG_VOID_RETURN;
   while (!ret && !(read_record_info.read_record(&read_record_info)) )
   {
     char *et_field= get_field(thd->mem_root, table->field[field]);

=== modified file 'sql/events.cc'
--- a/sql/events.cc	revid:inaam.rana@stripped
+++ b/sql/events.cc	revid:inaam.rana@stripped
@@ -1100,7 +1100,11 @@ Events::load_events_from_db(THD *thd)
     DBUG_RETURN(TRUE);
   }
 
-  init_read_record(&read_record_info, thd, table, NULL, 0, 1, FALSE);
+  if (init_read_record(&read_record_info, thd, table, NULL, 0, 1, FALSE))
+  {
+    sql_print_error("Event Scheduler: Error while starting read of mysql.event");
+    DBUG_RETURN(TRUE);
+  }
   while (!(read_record_info.read_record(&read_record_info)))
   {
     Event_queue_element *et;

=== modified file 'sql/item_cmpfunc.cc'
--- a/sql/item_cmpfunc.cc	revid:inaam.rana@stripped
+++ b/sql/item_cmpfunc.cc	revid:inaam.rana@stripped
@@ -4242,6 +4242,16 @@ void Item_func_in::fix_length_and_dec()
       }
     }
   }
+  /*
+    Set cmp_context of all arguments. This prevents
+    Item_field::equal_fields_propagator() from transforming a zerofill integer
+    argument into a string constant. Such a change would require rebuilding
+    cmp_itmes.
+   */
+  for (arg= args + 1, arg_end= args + arg_count; arg != arg_end ; arg++)
+  {
+    arg[0]->cmp_context= item_cmp_type(left_result_type, arg[0]->result_type());
+  }
   max_length= 1;
 }
 

=== modified file 'sql/opt_range.cc'
--- a/sql/opt_range.cc	revid:inaam.rana@stripped
+++ b/sql/opt_range.cc	revid:inaam.rana@stripped
@@ -9350,7 +9350,8 @@ int QUICK_INDEX_MERGE_SELECT::read_keys_
   doing_pk_scan= FALSE;
   /* index_merge currently doesn't support "using index" at all */
   head->set_keyread(FALSE);
-  init_read_record(&read_record, thd, head, (SQL_SELECT*) 0, 1 , 1, TRUE);
+  if (init_read_record(&read_record, thd, head, (SQL_SELECT*) 0, 1, 1, TRUE))
+    DBUG_RETURN(1);
   DBUG_RETURN(result);
 }
 

=== modified file 'sql/records.cc'
--- a/sql/records.cc	revid:inaam.rana@stripped
+++ b/sql/records.cc	revid:inaam.rana@stripped
@@ -58,11 +58,15 @@ static int rr_index_desc(READ_RECORD *in
                       occurs (except for end-of-records error)
   @param idx          index to scan
   @param reverse      Scan in the reverse direction
+
+  @retval true   error
+  @retval false  success
 */
 
-void init_read_record_idx(READ_RECORD *info, THD *thd, TABLE *table,
+bool init_read_record_idx(READ_RECORD *info, THD *thd, TABLE *table,
                           bool print_error, uint idx, bool reverse)
 {
+  int error;
   empty_record(table);
   memset(info, 0, sizeof(*info));
   info->thd= thd;
@@ -72,10 +76,17 @@ void init_read_record_idx(READ_RECORD *i
   info->unlock_row= rr_unlock_row;
 
   table->status=0;			/* And it's always found */
-  if (!table->file->inited)
-    table->file->ha_index_init(idx, 1);
+  if (!table->file->inited &&
+      (error= table->file->ha_index_init(idx, 1)))
+  {
+    if (print_error)
+     table->file->print_error(error, MYF(0));
+    return true;
+  }
+
   /* read_record will be changed to rr_index in rr_index_first */
   info->read_record= reverse ? rr_index_last : rr_index_first;
+  return false;
 }
 
 
@@ -163,12 +174,16 @@ void init_read_record_idx(READ_RECORD *i
   --------------
     This is the most basic access method of a table using rnd_init,
     ha_rnd_next and rnd_end. No indexes are used.
+
+  @retval true   error
+  @retval false  success
 */
-void init_read_record(READ_RECORD *info,THD *thd, TABLE *table,
+bool init_read_record(READ_RECORD *info,THD *thd, TABLE *table,
 		      SQL_SELECT *select,
 		      int use_record_cache, bool print_error, 
                       bool disable_rr_cache)
 {
+  int error= 0;
   IO_CACHE *tempfile;
   DBUG_ENTER("init_read_record");
 
@@ -219,8 +234,9 @@ void init_read_record(READ_RECORD *info,
     info->io_cache=tempfile;
     reinit_io_cache(info->io_cache,READ_CACHE,0L,0,0);
     info->ref_pos=table->file->ref;
-    if (!table->file->inited)
-      table->file->ha_rnd_init(0);
+    if (!table->file->inited &&
+        (error= table->file->ha_rnd_init(0)))
+      goto err;
 
     /*
       table->sort.addon_field is checked because if we use addon fields,
@@ -242,11 +258,10 @@ void init_read_record(READ_RECORD *info,
 	!table->s->blob_fields &&
         info->ref_length <= MAX_REFLENGTH)
     {
-      if (! init_rr_cache(thd, info))
-      {
-	DBUG_PRINT("info",("using rr_from_cache"));
-	info->read_record=rr_from_cache;
-      }
+      if (init_rr_cache(thd, info))
+        DBUG_RETURN(true);
+      DBUG_PRINT("info",("using rr_from_cache"));
+      info->read_record=rr_from_cache;
     }
   }
   else if (select && select->quick)
@@ -257,7 +272,8 @@ void init_read_record(READ_RECORD *info,
   else if (table->sort.record_pointers)
   {
     DBUG_PRINT("info",("using record_pointers"));
-    table->file->ha_rnd_init(0);
+    if ((error= table->file->ha_rnd_init(0)))
+      goto err;
     info->cache_pos=table->sort.record_pointers;
     info->cache_end=info->cache_pos+ 
                     table->sort.found_records*info->ref_length;
@@ -268,7 +284,8 @@ void init_read_record(READ_RECORD *info,
   {
     DBUG_PRINT("info",("using rr_sequential"));
     info->read_record=rr_sequential;
-    table->file->ha_rnd_init(1);
+    if ((error= table->file->ha_rnd_init(1)))
+      goto err;
     /* We can use record cache if we don't update dynamic length tables */
     if (!table->no_cache &&
 	(use_record_cache > 0 ||
@@ -290,7 +307,12 @@ void init_read_record(READ_RECORD *info,
       !table->file->pushed_cond)
     table->file->cond_push(select->cond);
 
-  DBUG_VOID_RETURN;
+  DBUG_RETURN(false);
+
+err:
+  if (print_error)
+    table->file->print_error(error, MYF(0));     
+  DBUG_RETURN(true);
 } /* init_read_record */
 
 

=== modified file 'sql/records.h'
--- a/sql/records.h	revid:inaam.rana@stripped
+++ b/sql/records.h	revid:inaam.rana@stripped
@@ -28,13 +28,16 @@ class SQL_SELECT;
   index read, scan, etc, use of cache, etc.
 
   Use by:
+@code
   READ_RECORD read_record;
-  init_read_record(&read_record, ...);
+  if (init_read_record(&read_record, ...))
+    return TRUE;
   while (read_record.read_record())
   {
     ...
   }
   end_read_record();
+@endcode
 */
 
 class Copy_field;
@@ -70,10 +73,10 @@ public:
   READ_RECORD() {}
 };
 
-void init_read_record(READ_RECORD *info, THD *thd, TABLE *reg_form,
+bool init_read_record(READ_RECORD *info, THD *thd, TABLE *reg_form,
 		      SQL_SELECT *select, int use_record_cache,
                       bool print_errors, bool disable_rr_cache);
-void init_read_record_idx(READ_RECORD *info, THD *thd, TABLE *table,
+bool init_read_record_idx(READ_RECORD *info, THD *thd, TABLE *table,
                           bool print_error, uint idx, bool reverse);
 void end_read_record(READ_RECORD *info);
 

=== modified file 'sql/sp_rcontext.cc'
--- a/sql/sp_rcontext.cc	revid:inaam.rana@stripped
+++ b/sql/sp_rcontext.cc	revid:inaam.rana@stripped
@@ -230,6 +230,23 @@ bool sp_rcontext::handle_sql_condition(T
 
     if (found_handler)
       found_condition= da->get_error_condition();
+
+    /*
+      Found condition can be NULL if the diagnostics area was full
+      when the error was raised. It can also be NULL if
+      Diagnostics_area::set_error_status(uint sql_error) was used.
+      In these cases, make a temporary Sql_condition here so the
+      error can be handled.
+    */
+    if (!found_condition)
+    {
+      Sql_condition *condition=
+        new (callers_arena->mem_root) Sql_condition(callers_arena->mem_root);
+      condition->set(da->sql_errno(), da->get_sqlstate(),
+                     Sql_condition::WARN_LEVEL_ERROR,
+                     da->message());
+      found_condition= condition;
+    }
   }
   else if (da->current_statement_warn_count())
   {

=== modified file 'sql/sql_acl.cc'
--- a/sql/sql_acl.cc	revid:inaam.rana@stripped
+++ b/sql/sql_acl.cc	revid:inaam.rana@stripped
@@ -713,8 +713,9 @@ static my_bool acl_load(THD *thd, TABLE_
   acl_cache->clear(1);				// Clear locked hostname cache
 
   init_sql_alloc(&mem, ACL_ALLOC_BLOCK_SIZE, 0);
-  init_read_record(&read_record_info,thd,table= tables[0].table,NULL,1,0, 
-                   FALSE);
+  if (init_read_record(&read_record_info, thd, table= tables[0].table,
+                       NULL, 1, 1, FALSE))
+    goto end;
   table->use_all_columns();
   (void) my_init_dynamic_array(&acl_hosts,sizeof(ACL_HOST),20,50);
   while (!(read_record_info.read_record(&read_record_info)))
@@ -763,7 +764,9 @@ static my_bool acl_load(THD *thd, TABLE_
   end_read_record(&read_record_info);
   freeze_size(&acl_hosts);
 
-  init_read_record(&read_record_info,thd,table=tables[1].table,NULL,1,0,FALSE);
+  if (init_read_record(&read_record_info, thd, table=tables[1].table,
+                       NULL, 1, 1, FALSE))
+    goto end;
   table->use_all_columns();
   (void) my_init_dynamic_array(&acl_users,sizeof(ACL_USER),50,100);
   password_length= table->field[2]->field_length /
@@ -968,7 +971,9 @@ static my_bool acl_load(THD *thd, TABLE_
   end_read_record(&read_record_info);
   freeze_size(&acl_users);
 
-  init_read_record(&read_record_info,thd,table=tables[2].table,NULL,1,0,FALSE);
+  if (init_read_record(&read_record_info, thd, table=tables[2].table,
+                       NULL, 1, 1, FALSE))
+    goto end;
   table->use_all_columns();
   (void) my_init_dynamic_array(&acl_dbs,sizeof(ACL_DB),50,100);
   while (!(read_record_info.read_record(&read_record_info)))
@@ -1031,8 +1036,9 @@ static my_bool acl_load(THD *thd, TABLE_
                                50, 100);
   if (tables[3].table)
   {
-    init_read_record(&read_record_info, thd, table= tables[3].table, NULL, 1, 
-                     0, FALSE);
+    if (init_read_record(&read_record_info, thd, table= tables[3].table,
+                         NULL, 1, 1, FALSE))
+      goto end;
     table->use_all_columns();
     while (!(read_record_info.read_record(&read_record_info)))
     {

=== modified file 'sql/sql_class.h'
--- a/sql/sql_class.h	revid:inaam.rana@stripped
+++ b/sql/sql_class.h	revid:inaam.rana@stripped
@@ -3722,7 +3722,8 @@ public:
     if (copy_field)				/* Fix for Intel compiler */
     {
       delete [] copy_field;
-      save_copy_field= copy_field= 0;
+      save_copy_field= copy_field= NULL;
+      save_copy_field_end= copy_field_end= NULL;
     }
   }
 };

=== modified file 'sql/sql_delete.cc'
--- a/sql/sql_delete.cc	revid:inaam.rana@stripped
+++ b/sql/sql_delete.cc	revid:inaam.rana@stripped
@@ -311,10 +311,22 @@ bool mysql_delete(THD *thd, TABLE_LIST *
     free_underlaid_joins(thd, select_lex);
     DBUG_RETURN(TRUE);
   }
+
   if (usable_index==MAX_KEY || (select && select->quick))
-    init_read_record(&info, thd, table, select, 1, 1, FALSE);
+    error= init_read_record(&info, thd, table, select, 1, 1, FALSE);
   else
-    init_read_record_idx(&info, thd, table, 1, usable_index, reverse);
+    error= init_read_record_idx(&info, thd, table, 1, usable_index, reverse);
+
+  if (error)
+  {
+    if (select)
+    {
+      delete select;
+      select= 0;
+    }
+    free_underlaid_joins(thd, select_lex);
+    DBUG_RETURN(TRUE);
+  }
 
   init_ftfuncs(thd, select_lex, 1);
   THD_STAGE_INFO(thd, stage_updating);
@@ -935,7 +947,8 @@ int multi_delete::do_table_deletes(TABLE
   READ_RECORD info;
   ha_rows last_deleted= deleted;
   DBUG_ENTER("do_deletes_for_table");
-  init_read_record(&info, thd, table, NULL, 0, 1, FALSE);
+  if (init_read_record(&info, thd, table, NULL, 0, 1, FALSE))
+    DBUG_RETURN(1);
   /*
     Ignore any rows not found in reference tables as they may already have
     been deleted by foreign key handling

=== modified file 'sql/sql_help.cc'
--- a/sql/sql_help.cc	revid:inaam.rana@stripped
+++ b/sql/sql_help.cc	revid:inaam.rana@stripped
@@ -189,11 +189,13 @@ int search_topics(THD *thd, TABLE *topic
 		  SQL_SELECT *select, List<String> *names,
 		  String *name, String *description, String *example)
 {
-  DBUG_ENTER("search_topics");
   int count= 0;
-
   READ_RECORD read_record_info;
-  init_read_record(&read_record_info, thd, topics, select, 1, 0, FALSE);
+  DBUG_ENTER("search_topics");
+
+  if (init_read_record(&read_record_info, thd, topics, select, 1, 0, FALSE))
+    DBUG_RETURN(0);
+
   while (!read_record_info.read_record(&read_record_info))
   {
     if (!select->cond->val_int())		// Doesn't match like
@@ -229,11 +231,13 @@ int search_topics(THD *thd, TABLE *topic
 int search_keyword(THD *thd, TABLE *keywords, struct st_find_field *find_fields,
                    SQL_SELECT *select, int *key_id)
 {
-  DBUG_ENTER("search_keyword");
   int count= 0;
-
   READ_RECORD read_record_info;
-  init_read_record(&read_record_info, thd, keywords, select, 1, 0, FALSE);
+  DBUG_ENTER("search_keyword");
+
+  if (init_read_record(&read_record_info, thd, keywords, select, 1, 0, FALSE))
+    DBUG_RETURN(0);
+
   while (!read_record_info.read_record(&read_record_info) && count<2)
   {
     if (!select->cond->val_int())		// Dosn't match like
@@ -359,7 +363,10 @@ int search_categories(THD *thd, TABLE *c
 
   DBUG_ENTER("search_categories");
 
-  init_read_record(&read_record_info, thd, categories, select,1,0,FALSE);
+  if (init_read_record(&read_record_info, thd, categories, select,
+                       1, 0, FALSE))
+    DBUG_RETURN(0);
+    
   while (!read_record_info.read_record(&read_record_info))
   {
     if (select && !select->cond->val_int())
@@ -390,10 +397,12 @@ int search_categories(THD *thd, TABLE *c
 void get_all_items_for_category(THD *thd, TABLE *items, Field *pfname,
 				SQL_SELECT *select, List<String> *res)
 {
+  READ_RECORD read_record_info;
   DBUG_ENTER("get_all_items_for_category");
 
-  READ_RECORD read_record_info;
-  init_read_record(&read_record_info, thd, items, select,1,0,FALSE);
+  if (init_read_record(&read_record_info, thd, items, select,
+                       1, 0, FALSE))
+    DBUG_VOID_RETURN;
   while (!read_record_info.read_record(&read_record_info))
   {
     if (!select->cond->val_int())

=== modified file 'sql/sql_plugin.cc'
--- a/sql/sql_plugin.cc	revid:inaam.rana@stripped
+++ b/sql/sql_plugin.cc	revid:inaam.rana@stripped
@@ -1493,7 +1493,8 @@ static void plugin_load(MEM_ROOT *tmp_ro
     goto end;
   }
   table= tables.table;
-  init_read_record(&read_record_info, new_thd, table, NULL, 1, 0, FALSE);
+  if (init_read_record(&read_record_info, new_thd, table, NULL, 1, 1, FALSE))
+    goto end;
   table->use_all_columns();
   /*
     there're no other threads running yet, so we don't need a mutex.

=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	revid:inaam.rana@stripped
+++ b/sql/sql_select.cc	revid:inaam.rana@stripped
@@ -8018,7 +8018,10 @@ best_access_path(JOIN      *join,
     Don't do a table scan on InnoDB tables, if we can read the used
     parts of the row from any of the used index.
     This is because table scans uses index and we would not win
-    anything by using a table scan.
+    anything by using a table scan. The only exception is INDEX_MERGE
+    quick select. We can not say for sure that INDEX_MERGE quick select
+    is always faster than ref access. So it's necessary to check if
+    ref access is more expensive.
 
     A word for word translation of the below if-statement in sergefp's
     understanding: we check if we should use table scan if:
@@ -8058,8 +8061,11 @@ best_access_path(JOIN      *join,
     goto skip_table_scan;
   }
 
-  if (((s->table->file->ha_table_flags() & HA_TABLE_SCAN_ON_INDEX) &&    //(3)
-       !s->table->covering_keys.is_clear_all() && best_key && !s->quick))//(3)
+  if ((s->table->file->ha_table_flags() & HA_TABLE_SCAN_ON_INDEX) &&    //(3)
+      !s->table->covering_keys.is_clear_all() && best_key &&            //(3)
+      (!s->quick ||                                                     //(3)
+       !(s->quick->get_type() == QUICK_SELECT_I::QS_TYPE_INDEX_MERGE && //(3)
+         best > s->quick->read_time)))                                  //(3)
   {
     trace_access_scan.add_alnum("access_type", s->quick ? "range" : "scan").
       add_alnum("cause", "covering_index_better_than_full_scan");
@@ -18833,8 +18839,9 @@ sub_select_sjm(JOIN *join, JOIN_TAB *joi
     const READ_RECORD::Setup_func saved_rfr= last_tab->read_first_record;
 
     // Initialize full scan
-    init_read_record(&last_tab->read_record, join->thd,
-                     sjm->table, NULL, TRUE, TRUE, FALSE);
+    if (init_read_record(&last_tab->read_record, join->thd,
+                         sjm->table, NULL, TRUE, TRUE, FALSE))
+      DBUG_RETURN(NESTED_LOOP_ERROR);
 
     last_tab->read_first_record= join_read_record_no_init;
     last_tab->read_record.copy_field= sjm->copy_field;
@@ -20076,8 +20083,9 @@ int join_init_read_record(JOIN_TAB *tab)
     report_error(tab->table, error);
     return 1;
   }
-  init_read_record(&tab->read_record, tab->join->thd, tab->table,
-		   tab->select,1,1, FALSE);
+  if (init_read_record(&tab->read_record, tab->join->thd, tab->table,
+                       tab->select, 1, 1, FALSE))
+    return 1;
   return (*tab->read_record.read_record)(&tab->read_record);
 }
 
@@ -23622,7 +23630,9 @@ copy_fields(TMP_TABLE_PARAM *param)
   Copy_field *ptr=param->copy_field;
   Copy_field *end=param->copy_field_end;
 
-  for (; ptr != end; ptr++)
+  DBUG_ASSERT((ptr != NULL && end >= ptr) || (ptr == NULL && end == NULL));
+
+  for (; ptr < end; ptr++)
     (*ptr->do_copy)(ptr);
 
   List_iterator_fast<Item> it(param->copy_funcs);

=== modified file 'sql/sql_servers.cc'
--- a/sql/sql_servers.cc	revid:inaam.rana@stripped
+++ b/sql/sql_servers.cc	revid:inaam.rana@stripped
@@ -208,8 +208,10 @@ static bool servers_load(THD *thd, TABLE
   free_root(&mem, MYF(0));
   init_sql_alloc(&mem, ACL_ALLOC_BLOCK_SIZE, 0);
 
-  init_read_record(&read_record_info,thd,table=tables[0].table,NULL,1,0, 
-                   FALSE);
+  if (init_read_record(&read_record_info, thd, table=tables[0].table,
+                       NULL, 1, 1, FALSE))
+    DBUG_RETURN(TRUE);
+
   while (!(read_record_info.read_record(&read_record_info)))
   {
     /* return_val is already TRUE, so no need to set */

=== modified file 'sql/sql_table.cc'
--- a/sql/sql_table.cc	revid:inaam.rana@stripped
+++ b/sql/sql_table.cc	revid:inaam.rana@stripped
@@ -7367,7 +7367,11 @@ copy_data_between_tables(TABLE *from,TAB
 
   /* Tell handler that we have values for all columns in the to table */
   to->use_all_columns();
-  init_read_record(&info, thd, from, (SQL_SELECT *) 0, 1, 1, FALSE);
+  if (init_read_record(&info, thd, from, (SQL_SELECT *) 0, 1, 1, FALSE))
+  {
+    error= 1;
+    goto err;
+  }
   if (ignore)
     to->file->extra(HA_EXTRA_IGNORE_DUP_KEY);
   thd->get_stmt_da()->reset_current_row_for_warning();

=== modified file 'sql/sql_udf.cc'
--- a/sql/sql_udf.cc	revid:inaam.rana@stripped
+++ b/sql/sql_udf.cc	revid:inaam.rana@stripped
@@ -171,7 +171,8 @@ void udf_init()
   }
 
   table= tables.table;
-  init_read_record(&read_record_info, new_thd, table, NULL,1,0,FALSE);
+  if (init_read_record(&read_record_info, new_thd, table, NULL, 1, 1, FALSE))
+    goto end;
   table->use_all_columns();
   while (!(error= read_record_info.read_record(&read_record_info)))
   {

=== modified file 'sql/sql_update.cc'
--- a/sql/sql_update.cc	revid:inaam.rana@stripped
+++ b/sql/sql_update.cc	revid:inaam.rana@stripped
@@ -567,9 +567,12 @@ int mysql_update(THD *thd,
       */
 
       if (used_index == MAX_KEY || (select && select->quick))
-        init_read_record(&info, thd, table, select, 0, 1, FALSE);
+        error= init_read_record(&info, thd, table, select, 0, 1, FALSE);
       else
-        init_read_record_idx(&info, thd, table, 1, used_index, reverse);
+        error= init_read_record_idx(&info, thd, table, 1, used_index, reverse);
+
+      if (error)
+        goto exit_without_my_ok;
 
       THD_STAGE_INFO(thd, stage_searching_rows_for_update);
       ha_rows tmp_limit= limit;
@@ -640,7 +643,8 @@ int mysql_update(THD *thd,
   if (select && select->quick && select->quick->reset())
     goto exit_without_my_ok;
   table->file->try_semi_consistent_read(1);
-  init_read_record(&info, thd, table, select, 0, 1, FALSE);
+  if ((error= init_read_record(&info, thd, table, select, 0, 1, FALSE)))
+    goto exit_without_my_ok;
 
   updated= found= 0;
   /*

=== modified file 'storage/innobase/dict/dict0dict.c'
--- a/storage/innobase/dict/dict0dict.c	revid:inaam.rana@stripped
+++ b/storage/innobase/dict/dict0dict.c	revid:inaam.rana@stripped
@@ -839,9 +839,22 @@ dict_table_open_on_name_low(
 	ut_ad(!table || table->cached);
 
 	if (table != NULL) {
+		/* If table is corrupted, return NULL */
+		if (ignore_err == DICT_ERR_IGNORE_NONE
+		    && table->corrupted) {
+			if (!dict_locked) {
+				mutex_exit(&dict_sys->mutex);
+			}
+
+			ut_print_timestamp(stderr);
 
-		ut_ad(ignore_err != DICT_ERR_IGNORE_NONE
-		      || table->corrupted == FALSE);
+			fprintf(stderr, "  InnoDB: table ");
+			ut_print_name(stderr, NULL, TRUE, table->name);
+			fprintf(stderr, "is corrupted. Please drop the table "
+				"and recreate\n");
+
+			return(NULL);
+		}
 
 		if (table->can_be_evicted) {
 			dict_move_to_mru(table);
@@ -5201,9 +5214,9 @@ dict_set_corrupted(
 		index->table->corrupted = TRUE;
 	}
 
-	if (UNIV_UNLIKELY(dict_index_is_corrupted(index))) {
+	if (index->type & DICT_CORRUPT) {
 		/* The index was already flagged corrupted. */
-		ut_ad(index->table->corrupted);
+		ut_ad(!dict_index_is_clust(index) || index->table->corrupted);
 		return;
 	}
 

=== modified file 'storage/innobase/handler/ha_innodb.cc'
--- a/storage/innobase/handler/ha_innodb.cc	revid:inaam.rana@stripped
+++ b/storage/innobase/handler/ha_innodb.cc	revid:inaam.rana@stripped
@@ -3565,18 +3565,29 @@ ha_innobase::primary_key_is_clustered()
 	return(true);
 }
 
+/** Always normalize table name to lower case on Windows */
+#ifdef __WIN__
+#define normalize_table_name(norm_name, name)		\
+	normalize_table_name_low(norm_name, name, TRUE)
+#else
+#define normalize_table_name(norm_name, name)           \
+        normalize_table_name_low(norm_name, name, FALSE)
+#endif /* __WIN__ */
+
 /*****************************************************************//**
 Normalizes a table name string. A normalized name consists of the
 database name catenated to '/' and table name. An example:
 test/mytable. On Windows normalization puts both the database name and the
-table name always to lower case. */
+table name always to lower case if "set_lower_case" is set to TRUE. */
 static
 void
-normalize_table_name(
-/*=================*/
+normalize_table_name_low(
+/*=====================*/
 	char*		norm_name,	/*!< out: normalized name as a
 					null-terminated string */
-	const char*	name)		/*!< in: table name string */
+	const char*	name,		/*!< in: table name string */
+	ibool		set_lower_case)	/*!< in: TRUE if we want to set name
+					to lower case */
 {
 	char*	name_ptr;
 	char*	db_ptr;
@@ -3606,9 +3617,9 @@ normalize_table_name(
 
 	norm_name[name_ptr - db_ptr - 1] = '/';
 
-#ifdef __WIN__
-	innobase_casedn_str(norm_name);
-#endif
+	if (set_lower_case) {
+		innobase_casedn_str(norm_name);
+	}
 }
 
 /********************************************************************//**
@@ -4012,6 +4023,8 @@ ha_innobase::open(
 	THD*		thd;
 	ulint		retries = 0;
 	char*		is_part = NULL;
+	ibool		par_case_name_set = FALSE;
+	char		par_case_name[MAX_FULL_NAME_LEN + 1];
 
 	DBUG_ENTER("ha_innobase::open");
 
@@ -4058,16 +4071,88 @@ ha_innobase::open(
 	workaround for http://bugs.mysql.com/bug.php?id=33349. Look
 	at support issue https://support.mysql.com/view.php?id=21080
 	for more details. */
+#ifdef __WIN__
+	is_part = strstr(norm_name, "#p#");
+#else
 	is_part = strstr(norm_name, "#P#");
+#endif /* __WIN__ */
+
 retry:
 	/* Get pointer to a table object in InnoDB dictionary cache */
 	ib_table = dict_table_open_on_name(norm_name, FALSE);
 
 	if (NULL == ib_table) {
 		if (is_part && retries < 10) {
-			++retries;
-			os_thread_sleep(100000);
-			goto retry;
+			/* MySQL partition engine hard codes the file name
+			separator as "#P#". The text case is fixed even if
+			lower_case_table_names is set to 1 or 2. This is true
+			for sub-partition names as well. InnoDB always
+			normalises file names to lower case on Windows, this
+			can potentially cause problems when copying/moving
+			tables between platforms.
+
+			1) If boot against an installation from Windows
+			platform, then its partition table name could
+			be all be in lower case in system tables. So we
+			will need to check lower case name when load table.
+
+			2) If  we boot an installation from other case
+			sensitive platform in Windows, we might need to
+			check the existence of table name without lowering
+			case them in the system table. */
+			if (innobase_get_lower_case_table_names() == 1) {
+
+				if (!par_case_name_set) {
+#ifndef __WIN__
+					/* Check for the table using lower
+					case name, including the partition
+					separator "P" */
+					memcpy(par_case_name, norm_name,
+					       strlen(norm_name));
+					par_case_name[strlen(norm_name)] = 0;
+					innobase_casedn_str(par_case_name);
+#else
+					/* On Windows platfrom, check
+					whether there exists table name in
+					system table whose name is
+					not being normalized to lower case */
+					normalize_table_name_low(
+						par_case_name, name, FALSE);
+#endif
+					par_case_name_set = TRUE;
+				}
+
+				ib_table = dict_table_open_on_name(
+					par_case_name, FALSE);
+			}
+
+			if (!ib_table) {
+				++retries;
+				os_thread_sleep(100000);
+				goto retry;
+			} else {
+#ifndef __WIN__
+				sql_print_warning("Partition table %s opened "
+						  "after converting to lower "
+						  "case. The table may have "
+						  "been moved from a case "
+						  "in-sensitive file system. "
+						  "Please recreate table in "
+						  "the current file system\n",
+						  norm_name);
+#else
+				sql_print_warning("Partition table %s opened "
+						  "after skipping the step to "
+						  "lower case the table name. "
+						  "The table may have been "
+						  "moved from a case sensitive "
+						  "file system. Please "
+						  "recreate table in the "
+						  "current file system\n",
+						  norm_name);
+#endif
+				goto table_opened;
+			}
 		}
 
 		if (is_part) {
@@ -4098,6 +4183,8 @@ retry:
 		DBUG_RETURN(HA_ERR_NO_SUCH_TABLE);
 	}
 
+table_opened:
+
 	MONITOR_INC(MONITOR_TABLE_OPEN);
 
 	if (ib_table->ibd_file_missing && !thd_tablespace_op(thd)) {
@@ -6333,13 +6420,13 @@ ha_innobase::innobase_get_index(
 			table. Only print message if the index translation
 			table exists */
 			if (share->idx_trans_tbl.index_mapping) {
-				sql_print_error("InnoDB could not find "
-						"index %s key no %u for "
-						"table %s through its "
-						"index translation table",
-						key ? key->name : "NULL",
-						keynr,
-						prebuilt->table->name);
+				sql_print_warning("InnoDB could not find "
+						  "index %s key no %u for "
+						  "table %s through its "
+						  "index translation table",
+						  key ? key->name : "NULL",
+						  keynr,
+						  prebuilt->table->name);
 			}
 
 			index = dict_table_get_index_on_name(prebuilt->table,
@@ -7820,6 +7907,39 @@ ha_innobase::delete_table(
 					 thd_sql_command(thd)
 					 == SQLCOM_DROP_DB);
 
+
+	if (error == DB_TABLE_NOT_FOUND
+	    && innobase_get_lower_case_table_names() == 1) {
+		char*	is_part = NULL;
+#ifdef __WIN__
+		is_part = strstr(norm_name, "#p#");
+#else
+		is_part = strstr(norm_name, "#P#");
+#endif /* __WIN__ */
+
+		if (is_part) {
+			char	par_case_name[MAX_FULL_NAME_LEN + 1];
+
+#ifndef __WIN__
+			/* Check for the table using lower
+			case name, including the partition
+			separator "P" */
+			memcpy(par_case_name, norm_name, strlen(norm_name));
+			par_case_name[strlen(norm_name)] = 0;
+			innobase_casedn_str(par_case_name);
+#else
+			/* On Windows platfrom, check
+			whether there exists table name in
+			system table whose name is
+			not being normalized to lower case */
+			normalize_table_name_low(par_case_name, name, FALSE);
+#endif
+			error = row_drop_table_for_mysql(par_case_name, trx,
+							 thd_sql_command(thd)
+							 == SQLCOM_DROP_DB);
+		}
+	}
+
 	/* Flush the log to reduce probability that the .frm files and
 	the InnoDB data dictionary get out-of-sync if the user runs
 	with innodb_flush_log_at_trx_commit = 0 */
@@ -7945,13 +8065,67 @@ innobase_rename_table(
 		norm_from, norm_to, trx, lock_and_commit);
 
 	if (error != DB_SUCCESS) {
-		FILE* ef = dict_foreign_err_file;
+		if (error == DB_TABLE_NOT_FOUND
+		    && innobase_get_lower_case_table_names() == 1) {
+			char*	is_part = NULL;
+#ifdef __WIN__
+			is_part = strstr(norm_from, "#p#");
+#else
+			is_part = strstr(norm_from, "#P#");
+#endif /* __WIN__ */
+
+			if (is_part) {
+				char	par_case_name[MAX_FULL_NAME_LEN + 1];
+
+#ifndef __WIN__
+				/* Check for the table using lower
+				case name, including the partition
+				separator "P" */
+				memcpy(par_case_name, norm_from,
+				       strlen(norm_from));
+				par_case_name[strlen(norm_from)] = 0;
+				innobase_casedn_str(par_case_name);
+#else
+				/* On Windows platfrom, check
+				whether there exists table name in
+				system table whose name is
+				not being normalized to lower case */
+				normalize_table_name_low(par_case_name,
+							 from, FALSE);
+#endif
+				error = row_rename_table_for_mysql(
+					par_case_name, norm_to, trx,
+					lock_and_commit);
+
+			}
+		}
 
-		fputs("InnoDB: Renaming table ", ef);
-		ut_print_name(ef, trx, TRUE, norm_from);
-		fputs(" to ", ef);
-		ut_print_name(ef, trx, TRUE, norm_to);
-		fputs(" failed!\n", ef);
+		if (error != DB_SUCCESS) {
+			FILE* ef = dict_foreign_err_file;
+
+			fputs("InnoDB: Renaming table ", ef);
+			ut_print_name(ef, trx, TRUE, norm_from);
+			fputs(" to ", ef);
+			ut_print_name(ef, trx, TRUE, norm_to);
+			fputs(" failed!\n", ef);
+		} else {
+#ifndef __WIN__
+			sql_print_warning("Rename partition table %s "
+					  "succeeds after converting to lower "
+					  "case. The table may have "
+					  "been moved from a case "
+					  "in-sensitive file system.\n",
+					  norm_from);
+#else
+			sql_print_warning("Rename partition table %s "
+					  "succeeds after skipping the step to "
+					  "lower case the table name. "
+					  "The table may have been "
+					  "moved from a case sensitive "
+					  "file system.\n",
+					  norm_from);
+#endif /* __WIN__ */
+		}
 	}
 
 	if (lock_and_commit) {
@@ -8842,7 +9016,10 @@ ha_innobase::check(
 		putc('\n', stderr);
 #endif
 
-		if (!btr_validate_index(index, prebuilt->trx)) {
+		/* If this is an index being created, break */
+		if (*index->name == TEMP_INDEX_PREFIX) {
+			break;
+		}  else if (!btr_validate_index(index, prebuilt->trx)) {
 			is_ok = FALSE;
 
 			innobase_format_name(

=== modified file 'storage/perfschema/pfs.cc'
--- a/storage/perfschema/pfs.cc	revid:inaam.rana@stripped
+++ b/storage/perfschema/pfs.cc	revid:inaam.rana@stripped
@@ -2092,6 +2092,7 @@ get_thread_mutex_locker_v1(PSI_mutex_loc
       wait->m_timer_end= 0;
       wait->m_object_instance_addr= pfs_mutex->m_identity;
       wait->m_event_id= pfs_thread->m_event_id++;
+      wait->m_end_event_id= 0;
       wait->m_operation= mutex_operation_map[(int) op];
       wait->m_wait_class= WAIT_CLASS_MUTEX;
 
@@ -2179,6 +2180,7 @@ get_thread_rwlock_locker_v1(PSI_rwlock_l
       wait->m_timer_end= 0;
       wait->m_object_instance_addr= pfs_rwlock->m_identity;
       wait->m_event_id= pfs_thread->m_event_id++;
+      wait->m_end_event_id= 0;
       wait->m_operation= rwlock_operation_map[static_cast<int> (op)];
       wait->m_wait_class= WAIT_CLASS_RWLOCK;
 
@@ -2283,6 +2285,7 @@ get_thread_cond_locker_v1(PSI_cond_locke
       wait->m_timer_end= 0;
       wait->m_object_instance_addr= pfs_cond->m_identity;
       wait->m_event_id= pfs_thread->m_event_id++;
+      wait->m_end_event_id= 0;
       wait->m_operation= cond_operation_map[static_cast<int> (op)];
       wait->m_wait_class= WAIT_CLASS_COND;
 
@@ -2412,6 +2415,7 @@ get_thread_table_io_locker_v1(PSI_table_
       wait->m_timer_end= 0;
       wait->m_object_instance_addr= pfs_table->m_identity;
       wait->m_event_id= pfs_thread->m_event_id++;
+      wait->m_end_event_id= 0;
       wait->m_operation= table_io_operation_map[static_cast<int> (op)];
       wait->m_flags= 0;
       wait->m_object_type= share->get_object_type();
@@ -2525,6 +2529,7 @@ get_thread_table_lock_locker_v1(PSI_tabl
       wait->m_timer_end= 0;
       wait->m_object_instance_addr= pfs_table->m_identity;
       wait->m_event_id= pfs_thread->m_event_id++;
+      wait->m_end_event_id= 0;
       wait->m_operation= table_lock_operation_map[lock_type];
       wait->m_flags= 0;
       wait->m_object_type= share->get_object_type();
@@ -2623,6 +2628,7 @@ get_thread_file_name_locker_v1(PSI_file_
     wait->m_weak_file= pfs_file;
     wait->m_weak_version= pfs_file->get_version();
     wait->m_event_id= pfs_thread->m_event_id++;
+    wait->m_end_event_id= 0;
     wait->m_operation= file_operation_map[static_cast<int> (op)];
     wait->m_wait_class= WAIT_CLASS_FILE;
 
@@ -2694,6 +2700,7 @@ get_thread_file_stream_locker_v1(PSI_fil
       wait->m_weak_file= pfs_file;
       wait->m_weak_version= pfs_file->get_version();
       wait->m_event_id= pfs_thread->m_event_id++;
+      wait->m_end_event_id= 0;
       wait->m_operation= file_operation_map[static_cast<int> (op)];
       wait->m_wait_class= WAIT_CLASS_FILE;
 
@@ -2794,6 +2801,7 @@ get_thread_file_descriptor_locker_v1(PSI
       wait->m_weak_file= pfs_file;
       wait->m_weak_version= pfs_file->get_version();
       wait->m_event_id= pfs_thread->m_event_id++;
+      wait->m_end_event_id= 0;
       wait->m_operation= file_operation_map[static_cast<int> (op)];
       wait->m_wait_class= WAIT_CLASS_FILE;
 
@@ -2888,6 +2896,7 @@ get_thread_socket_locker_v1(PSI_socket_l
       wait->m_weak_socket=  pfs_socket;
       wait->m_weak_version= pfs_socket->get_version();
       wait->m_event_id=     pfs_thread->m_event_id++;
+      wait->m_end_event_id= 0;
       wait->m_operation=    socket_operation_map[static_cast<int>(op)];
       wait->m_wait_class=   WAIT_CLASS_SOCKET;
 
@@ -3149,6 +3158,7 @@ start_idle_wait_v1(PSI_idle_locker_state
       wait->m_timer_start= timer_start;
       wait->m_timer_end= 0;
       wait->m_event_id= pfs_thread->m_event_id++;
+      wait->m_end_event_id= 0;
       wait->m_operation= OPERATION_TYPE_IDLE;
       wait->m_source_file= src_file;
       wait->m_source_line= src_line;
@@ -3214,6 +3224,7 @@ static void end_idle_wait_v1(PSI_idle_lo
       DBUG_ASSERT(wait != NULL);
 
       wait->m_timer_end= timer_end;
+      wait->m_end_event_id= thread->m_event_id;
       if (flag_events_waits_history)
         insert_events_waits_history(thread, wait);
       if (flag_events_waits_history_long)
@@ -3312,6 +3323,7 @@ static void end_mutex_wait_v1(PSI_mutex_
       DBUG_ASSERT(wait != NULL);
 
       wait->m_timer_end= timer_end;
+      wait->m_end_event_id= thread->m_event_id;
       if (flag_events_waits_history)
         insert_events_waits_history(thread, wait);
       if (flag_events_waits_history_long)
@@ -3416,6 +3428,7 @@ static void end_rwlock_rdwait_v1(PSI_rwl
       DBUG_ASSERT(wait != NULL);
 
       wait->m_timer_end= timer_end;
+      wait->m_end_event_id= thread->m_event_id;
       if (flag_events_waits_history)
         insert_events_waits_history(thread, wait);
       if (flag_events_waits_history_long)
@@ -3513,6 +3526,7 @@ static void end_rwlock_wrwait_v1(PSI_rwl
       DBUG_ASSERT(wait != NULL);
 
       wait->m_timer_end= timer_end;
+      wait->m_end_event_id= thread->m_event_id;
       if (flag_events_waits_history)
         insert_events_waits_history(thread, wait);
       if (flag_events_waits_history_long)
@@ -3603,6 +3617,7 @@ static void end_cond_wait_v1(PSI_cond_lo
       DBUG_ASSERT(wait != NULL);
 
       wait->m_timer_end= timer_end;
+      wait->m_end_event_id= thread->m_event_id;
       if (flag_events_waits_history)
         insert_events_waits_history(thread, wait);
       if (flag_events_waits_history_long)
@@ -3704,6 +3719,7 @@ static void end_table_io_wait_v1(PSI_tab
     DBUG_ASSERT(wait != NULL);
 
     wait->m_timer_end= timer_end;
+    wait->m_end_event_id= thread->m_event_id;
     if (flag_events_waits_history)
       insert_events_waits_history(thread, wait);
     if (flag_events_waits_history_long)
@@ -3783,6 +3799,7 @@ static void end_table_lock_wait_v1(PSI_t
     DBUG_ASSERT(wait != NULL);
 
     wait->m_timer_end= timer_end;
+    wait->m_end_event_id= thread->m_event_id;
     if (flag_events_waits_history)
       insert_events_waits_history(thread, wait);
     if (flag_events_waits_history_long)
@@ -3944,6 +3961,7 @@ static void end_file_wait_v1(PSI_file_lo
       DBUG_ASSERT(wait != NULL);
 
       wait->m_timer_end= timer_end;
+      wait->m_end_event_id= thread->m_event_id;
       wait->m_number_of_bytes= count;
       if (flag_events_waits_history)
         insert_events_waits_history(thread, wait);
@@ -4019,6 +4037,7 @@ static void start_stage_v1(PSI_stage_key
 
     if (flag_events_stages_current)
     {
+      pfs->m_end_event_id= pfs_thread->m_event_id;
       if (flag_events_stages_history)
         insert_events_stages_history(pfs_thread, pfs);
       if (flag_events_stages_history_long)
@@ -4060,6 +4079,7 @@ static void start_stage_v1(PSI_stage_key
     /* m_thread_internal_id is immutable and already set */
     DBUG_ASSERT(pfs->m_thread_internal_id == pfs_thread->m_thread_internal_id);
     pfs->m_event_id= pfs_thread->m_event_id++;
+    pfs->m_end_event_id= 0;
     pfs->m_source_file= src_file;
     pfs->m_source_line= src_line;
 
@@ -4110,6 +4130,7 @@ static void end_stage_v1()
 
     if (flag_events_stages_current)
     {
+      pfs->m_end_event_id= pfs_thread->m_event_id;
       if (flag_events_stages_history)
         insert_events_stages_history(pfs_thread, pfs);
       if (flag_events_stages_history_long)
@@ -4168,6 +4189,7 @@ get_thread_statement_locker_v1(PSI_state
       /* m_thread_internal_id is immutable and already set */
       DBUG_ASSERT(pfs->m_thread_internal_id == pfs_thread->m_thread_internal_id);
       pfs->m_event_id= event_id;
+      pfs->m_end_event_id= 0;
       pfs->m_class= klass;
       pfs->m_timer_start= 0;
       pfs->m_timer_end= 0;
@@ -4538,6 +4560,7 @@ static void end_statement_v1(PSI_stateme
       }
 
       pfs->m_timer_end= timer_end;
+      pfs->m_end_event_id= thread->m_event_id;
       if (flag_events_statements_history)
         insert_events_statements_history(thread, pfs);
       if (flag_events_statements_history_long)
@@ -4717,6 +4740,7 @@ static void end_socket_wait_v1(PSI_socke
     DBUG_ASSERT(wait != NULL);
 
     wait->m_timer_end= timer_end;
+    wait->m_end_event_id= thread->m_event_id;
     wait->m_number_of_bytes= bytes;
 
     if (flag_events_waits_history)

=== modified file 'storage/perfschema/pfs_events.h'
--- a/storage/perfschema/pfs_events.h	revid:inaam.rana@stripped
+++ b/storage/perfschema/pfs_events.h	revid:inaam.rana@stripped
@@ -32,6 +32,8 @@ struct PFS_events
   ulong m_thread_internal_id;
   /** EVENT_ID. */
   ulonglong m_event_id;
+  /** END_EVENT_ID. */
+  ulonglong m_end_event_id;
   /** (EVENT_TYPE) */
   enum_event_type m_event_type;
   /** NESTING_EVENT_ID. */

=== modified file 'storage/perfschema/pfs_instr.cc'
--- a/storage/perfschema/pfs_instr.cc	revid:inaam.rana@stripped
+++ b/storage/perfschema/pfs_instr.cc	revid:inaam.rana@stripped
@@ -860,6 +860,7 @@ PFS_thread* create_thread(PFS_thread_cla
           child_wait= & pfs->m_events_waits_stack[index];
           child_wait->m_thread_internal_id= pfs->m_thread_internal_id;
           child_wait->m_event_id= 0;
+          child_wait->m_end_event_id= 0;
           child_wait->m_event_type= EVENT_TYPE_STATEMENT;
           child_wait->m_wait_class= NO_WAIT_CLASS;
         }
@@ -867,6 +868,7 @@ PFS_thread* create_thread(PFS_thread_cla
         PFS_events_stages *child_stage= & pfs->m_stage_current;
         child_stage->m_thread_internal_id= pfs->m_thread_internal_id;
         child_stage->m_event_id= 0;
+        child_stage->m_end_event_id= 0;
         child_stage->m_event_type= EVENT_TYPE_STATEMENT;
         child_stage->m_class= NULL;
         child_stage->m_timer_start= 0;
@@ -880,6 +882,7 @@ PFS_thread* create_thread(PFS_thread_cla
           child_statement= & pfs->m_statement_stack[index];
           child_statement->m_thread_internal_id= pfs->m_thread_internal_id;
           child_statement->m_event_id= 0;
+          child_statement->m_end_event_id= 0;
           child_statement->m_event_type= EVENT_TYPE_STATEMENT;
           child_statement->m_class= NULL;
           child_statement->m_timer_start= 0;

=== modified file 'storage/perfschema/table_events_stages.cc'
--- a/storage/perfschema/table_events_stages.cc	revid:inaam.rana@stripped
+++ b/storage/perfschema/table_events_stages.cc	revid:inaam.rana@stripped
@@ -41,6 +41,11 @@ static const TABLE_FIELD_TYPE field_type
     { 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}
@@ -79,7 +84,7 @@ static const TABLE_FIELD_TYPE field_type
 
 TABLE_FIELD_DEF
 table_events_stages_current::m_field_def=
-{9 , field_types };
+{10 , field_types };
 
 PFS_engine_table_share
 table_events_stages_current::m_share=
@@ -157,6 +162,7 @@ void table_events_stages_common::make_ro
 
   m_row.m_thread_internal_id= stage->m_thread_internal_id;
   m_row.m_event_id= stage->m_event_id;
+  m_row.m_end_event_id= stage->m_end_event_id;
   m_row.m_nesting_event_id= stage->m_nesting_event_id;
   m_row.m_nesting_event_type= stage->m_nesting_event_type;
 
@@ -207,37 +213,43 @@ int table_events_stages_common::read_row
       case 1: /* EVENT_ID */
         set_field_ulonglong(f, m_row.m_event_id);
         break;
-      case 2: /* EVENT_NAME */
+      case 2: /* END_EVENT_ID */
+        if (m_row.m_end_event_id > 0)
+          set_field_ulonglong(f, m_row.m_end_event_id - 1);
+        else
+          f->set_null();
+        break;
+      case 3: /* EVENT_NAME */
         set_field_varchar_utf8(f, m_row.m_name, m_row.m_name_length);
         break;
-      case 3: /* SOURCE */
+      case 4: /* SOURCE */
         set_field_varchar_utf8(f, m_row.m_source, m_row.m_source_length);
         break;
-      case 4: /* TIMER_START */
+      case 5: /* TIMER_START */
         if (m_row.m_timer_start != 0)
           set_field_ulonglong(f, m_row.m_timer_start);
         else
           f->set_null();
         break;
-      case 5: /* TIMER_END */
+      case 6: /* TIMER_END */
         if (m_row.m_timer_end != 0)
           set_field_ulonglong(f, m_row.m_timer_end);
         else
           f->set_null();
         break;
-      case 6: /* TIMER_WAIT */
+      case 7: /* TIMER_WAIT */
         if (m_row.m_timer_wait != 0)
           set_field_ulonglong(f, m_row.m_timer_wait);
         else
           f->set_null();
         break;
-      case 7: /* NESTING_EVENT_ID */
+      case 8: /* NESTING_EVENT_ID */
         if (m_row.m_nesting_event_id != 0)
           set_field_ulonglong(f, m_row.m_nesting_event_id);
         else
           f->set_null();
         break;
-      case 8: /* NESTING_EVENT_TYPE */
+      case 9: /* NESTING_EVENT_TYPE */
         if (m_row.m_nesting_event_id != 0)
           set_field_enum(f, m_row.m_nesting_event_type);
         else

=== modified file 'storage/perfschema/table_events_stages.h'
--- a/storage/perfschema/table_events_stages.h	revid:inaam.rana@stripped
+++ b/storage/perfschema/table_events_stages.h	revid:inaam.rana@stripped
@@ -39,6 +39,8 @@ struct row_events_stages
   ulong m_thread_internal_id;
   /** Column EVENT_ID. */
   ulonglong m_event_id;
+  /** Column END_EVENT_ID. */
+  ulonglong m_end_event_id;
   /** Column NESTING_EVENT_ID. */
   ulonglong m_nesting_event_id;
   /** Column NESTING_EVENT_TYPE. */

=== modified file 'storage/perfschema/table_events_statements.cc'
--- a/storage/perfschema/table_events_statements.cc	revid:inaam.rana@stripped
+++ b/storage/perfschema/table_events_statements.cc	revid:inaam.rana@stripped
@@ -43,6 +43,11 @@ static const TABLE_FIELD_TYPE field_type
     { 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}
@@ -221,7 +226,7 @@ static const TABLE_FIELD_TYPE field_type
 
 TABLE_FIELD_DEF
 table_events_statements_current::m_field_def=
-{37 , field_types };
+{38 , field_types };
 
 PFS_engine_table_share
 table_events_statements_current::m_share=
@@ -299,6 +304,7 @@ void table_events_statements_common::mak
 
   m_row.m_thread_internal_id= statement->m_thread_internal_id;
   m_row.m_event_id= statement->m_event_id;
+  m_row.m_end_event_id= statement->m_end_event_id;
   m_row.m_nesting_event_id= statement->m_nesting_event_id;
   m_row.m_nesting_event_type= statement->m_nesting_event_type;
 
@@ -383,137 +389,143 @@ int table_events_statements_common::read
       case 1: /* EVENT_ID */
         set_field_ulonglong(f, m_row.m_event_id);
         break;
-      case 2: /* EVENT_NAME */
+      case 2: /* END_EVENT_ID */
+        if (m_row.m_end_event_id > 0)
+          set_field_ulonglong(f, m_row.m_end_event_id - 1);
+        else
+          f->set_null();
+        break;
+      case 3: /* EVENT_NAME */
         set_field_varchar_utf8(f, m_row.m_name, m_row.m_name_length);
         break;
-      case 3: /* SOURCE */
+      case 4: /* SOURCE */
         set_field_varchar_utf8(f, m_row.m_source, m_row.m_source_length);
         break;
-      case 4: /* TIMER_START */
+      case 5: /* TIMER_START */
         if (m_row.m_timer_start != 0)
           set_field_ulonglong(f, m_row.m_timer_start);
         else
           f->set_null();
         break;
-      case 5: /* TIMER_END */
+      case 6: /* TIMER_END */
         if (m_row.m_timer_end != 0)
           set_field_ulonglong(f, m_row.m_timer_end);
         else
           f->set_null();
         break;
-      case 6: /* TIMER_WAIT */
+      case 7: /* TIMER_WAIT */
         if (m_row.m_timer_wait != 0)
           set_field_ulonglong(f, m_row.m_timer_wait);
         else
           f->set_null();
         break;
-      case 7: /* LOCK_TIME */
+      case 8: /* LOCK_TIME */
         if (m_row.m_lock_time != 0)
           set_field_ulonglong(f, m_row.m_lock_time);
         else
           f->set_null();
         break;
-      case 8: /* SQL_TEXT */
+      case 9: /* SQL_TEXT */
         if (m_row.m_sqltext_length)
           set_field_longtext_utf8(f, m_row.m_sqltext, m_row.m_sqltext_length);
         else
           f->set_null();
         break;
-      case 9: /* CURRENT_SCHEMA */
+      case 10: /* CURRENT_SCHEMA */
         if (m_row.m_current_schema_name_length)
           set_field_varchar_utf8(f, m_row.m_current_schema_name, m_row.m_current_schema_name_length);
         else
           f->set_null();
         break;
-      case 10: /* OBJECT_TYPE */
+      case 11: /* OBJECT_TYPE */
         f->set_null();
         break;
-      case 11: /* OBJECT_SCHEMA */
+      case 12: /* OBJECT_SCHEMA */
         f->set_null();
         break;
-      case 12: /* OBJECT_NAME */
+      case 13: /* OBJECT_NAME */
         f->set_null();
         break;
-      case 13: /* OBJECT_INSTANCE_BEGIN */
+      case 14: /* OBJECT_INSTANCE_BEGIN */
         f->set_null();
         break;
-      case 14: /* MYSQL_ERRNO */
+      case 15: /* MYSQL_ERRNO */
         set_field_ulong(f, m_row.m_sql_errno);
         break;
-      case 15: /* RETURNED_SQLSTATE */
+      case 16: /* RETURNED_SQLSTATE */
         if (m_row.m_sqlstate[0] != 0)
           set_field_varchar_utf8(f, m_row.m_sqlstate, SQLSTATE_LENGTH);
         else
           f->set_null();
         break;
-      case 16: /* MESSAGE_TEXT */
+      case 17: /* MESSAGE_TEXT */
         len= strlen(m_row.m_message_text);
         if (len)
           set_field_varchar_utf8(f, m_row.m_message_text, len);
         else
           f->set_null();
         break;
-      case 17: /* ERRORS */
+      case 18: /* ERRORS */
         set_field_ulonglong(f, m_row.m_error_count);
         break;
-      case 18: /* WARNINGS */
+      case 19: /* WARNINGS */
         set_field_ulonglong(f, m_row.m_warning_count);
         break;
-      case 19: /* ROWS_AFFECTED */
+      case 20: /* ROWS_AFFECTED */
         set_field_ulonglong(f, m_row.m_rows_affected);
         break;
-      case 20: /* ROWS_SENT */
+      case 21: /* ROWS_SENT */
         set_field_ulonglong(f, m_row.m_rows_sent);
         break;
-      case 21: /* ROWS_EXAMINED */
+      case 22: /* ROWS_EXAMINED */
         set_field_ulonglong(f, m_row.m_rows_examined);
         break;
-      case 22: /* CREATED_TMP_DISK_TABLES */
+      case 23: /* CREATED_TMP_DISK_TABLES */
         set_field_ulonglong(f, m_row.m_created_tmp_disk_tables);
         break;
-      case 23: /* CREATED_TMP_TABLES */
+      case 24: /* CREATED_TMP_TABLES */
         set_field_ulonglong(f, m_row.m_created_tmp_tables);
         break;
-      case 24: /* SELECT_FULL_JOIN */
+      case 25: /* SELECT_FULL_JOIN */
         set_field_ulonglong(f, m_row.m_select_full_join);
         break;
-      case 25: /* SELECT_FULL_RANGE_JOIN */
+      case 26: /* SELECT_FULL_RANGE_JOIN */
         set_field_ulonglong(f, m_row.m_select_full_range_join);
         break;
-      case 26: /* SELECT_RANGE */
+      case 27: /* SELECT_RANGE */
         set_field_ulonglong(f, m_row.m_select_range);
         break;
-      case 27: /* SELECT_RANGE_CHECK */
+      case 28: /* SELECT_RANGE_CHECK */
         set_field_ulonglong(f, m_row.m_select_range_check);
         break;
-      case 28: /* SELECT_SCAN */
+      case 29: /* SELECT_SCAN */
         set_field_ulonglong(f, m_row.m_select_scan);
         break;
-      case 29: /* SORT_MERGE_PASSES */
+      case 30: /* SORT_MERGE_PASSES */
         set_field_ulonglong(f, m_row.m_sort_merge_passes);
         break;
-      case 30: /* SORT_RANGE */
+      case 31: /* SORT_RANGE */
         set_field_ulonglong(f, m_row.m_sort_range);
         break;
-      case 31: /* SORT_ROWS */
+      case 32: /* SORT_ROWS */
         set_field_ulonglong(f, m_row.m_sort_rows);
         break;
-      case 32: /* SORT_SCAN */
+      case 33: /* SORT_SCAN */
         set_field_ulonglong(f, m_row.m_sort_scan);
         break;
-      case 33: /* NO_INDEX_USED */
+      case 34: /* NO_INDEX_USED */
         set_field_ulonglong(f, m_row.m_no_index_used);
         break;
-      case 34: /* NO_GOOD_INDEX_USED */
+      case 35: /* NO_GOOD_INDEX_USED */
         set_field_ulonglong(f, m_row.m_no_good_index_used);
         break;
-      case 35: /* NESTING_EVENT_ID */
+      case 36: /* NESTING_EVENT_ID */
         if (m_row.m_nesting_event_id != 0)
           set_field_ulonglong(f, m_row.m_nesting_event_id);
         else
           f->set_null();
         break;
-      case 36: /* NESTING_EVENT_TYPE */
+      case 37: /* NESTING_EVENT_TYPE */
         if (m_row.m_nesting_event_id != 0)
           set_field_enum(f, m_row.m_nesting_event_type);
         else

=== modified file 'storage/perfschema/table_events_statements.h'
--- a/storage/perfschema/table_events_statements.h	revid:inaam.rana@stripped
+++ b/storage/perfschema/table_events_statements.h	revid:inaam.rana@stripped
@@ -39,6 +39,8 @@ struct row_events_statements
   ulong m_thread_internal_id;
   /** Column EVENT_ID. */
   ulonglong m_event_id;
+  /** Column END_EVENT_ID. */
+  ulonglong m_end_event_id;
   /** Column NESTING_EVENT_ID. */
   ulonglong m_nesting_event_id;
   /** Column NESTING_EVENT_TYPE. */

=== modified file 'storage/perfschema/table_events_waits.cc'
--- a/storage/perfschema/table_events_waits.cc	revid:inaam.rana@stripped
+++ b/storage/perfschema/table_events_waits.cc	revid:inaam.rana@stripped
@@ -43,6 +43,11 @@ static const TABLE_FIELD_TYPE field_type
     { 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}
@@ -126,7 +131,7 @@ static const TABLE_FIELD_TYPE field_type
 
 TABLE_FIELD_DEF
 table_events_waits_current::m_field_def=
-{ 18, field_types };
+{ 19, field_types };
 
 PFS_engine_table_share
 table_events_waits_current::m_share=
@@ -433,6 +438,7 @@ void table_events_waits_common::make_row
 
   m_row.m_thread_internal_id= safe_thread->m_thread_internal_id;
   m_row.m_event_id= wait->m_event_id;
+  m_row.m_end_event_id= wait->m_end_event_id;
   m_row.m_nesting_event_id= wait->m_nesting_event_id;
   m_row.m_nesting_event_type= wait->m_nesting_event_type;
 
@@ -601,34 +607,40 @@ int table_events_waits_common::read_row_
       case 1: /* EVENT_ID */
         set_field_ulonglong(f, m_row.m_event_id);
         break;
-      case 2: /* EVENT_NAME */
+      case 2: /* END_EVENT_ID */
+        if (m_row.m_end_event_id > 0)
+          set_field_ulonglong(f, m_row.m_end_event_id - 1);
+        else
+          f->set_null();
+        break;
+      case 3: /* EVENT_NAME */
         set_field_varchar_utf8(f, m_row.m_name, m_row.m_name_length);
         break;
-      case 3: /* SOURCE */
+      case 4: /* SOURCE */
         set_field_varchar_utf8(f, m_row.m_source, m_row.m_source_length);
         break;
-      case 4: /* TIMER_START */
+      case 5: /* TIMER_START */
         if (m_row.m_timer_start != 0)
           set_field_ulonglong(f, m_row.m_timer_start);
         else
           f->set_null();
         break;
-      case 5: /* TIMER_END */
+      case 6: /* TIMER_END */
         if (m_row.m_timer_end != 0)
           set_field_ulonglong(f, m_row.m_timer_end);
         else
           f->set_null();
         break;
-      case 6: /* TIMER_WAIT */
+      case 7: /* TIMER_WAIT */
         if (m_row.m_timer_wait != 0)
           set_field_ulonglong(f, m_row.m_timer_wait);
         else
           f->set_null();
         break;
-      case 7: /* SPINS */
+      case 8: /* SPINS */
         f->set_null();
         break;
-      case 8: /* OBJECT_SCHEMA */
+      case 9: /* OBJECT_SCHEMA */
         if (m_row.m_object_schema_length > 0)
         {
           set_field_varchar_utf8(f, m_row.m_object_schema,
@@ -637,7 +649,7 @@ int table_events_waits_common::read_row_
         else
           f->set_null();
         break;
-      case 9: /* OBJECT_NAME */
+      case 10: /* OBJECT_NAME */
         if (m_row.m_object_name_length > 0)
         {
           set_field_varchar_utf8(f, m_row.m_object_name,
@@ -646,7 +658,7 @@ int table_events_waits_common::read_row_
         else
           f->set_null();
         break;
-      case 10: /* INDEX_NAME */
+      case 11: /* INDEX_NAME */
         if (m_row.m_index_name_length > 0)
         {
           set_field_varchar_utf8(f, m_row.m_index_name,
@@ -655,7 +667,7 @@ int table_events_waits_common::read_row_
         else
           f->set_null();
         break;
-      case 11: /* OBJECT_TYPE */
+      case 12: /* OBJECT_TYPE */
         if (m_row.m_object_type)
         {
           set_field_varchar_utf8(f, m_row.m_object_type,
@@ -664,26 +676,26 @@ int table_events_waits_common::read_row_
         else
           f->set_null();
         break;
-      case 12: /* OBJECT_INSTANCE */
+      case 13: /* OBJECT_INSTANCE */
         set_field_ulonglong(f, m_row.m_object_instance_addr);
         break;
-      case 13: /* NESTING_EVENT_ID */
+      case 14: /* NESTING_EVENT_ID */
         if (m_row.m_nesting_event_id != 0)
           set_field_ulonglong(f, m_row.m_nesting_event_id);
         else
           f->set_null();
         break;
-      case 14: /* NESTING_EVENT_TYPE */
+      case 15: /* NESTING_EVENT_TYPE */
         if (m_row.m_nesting_event_id != 0)
           set_field_enum(f, m_row.m_nesting_event_type);
         else
           f->set_null();
         break;
-      case 15: /* OPERATION */
+      case 16: /* OPERATION */
         operation= &operation_names_map[(int) m_row.m_operation - 1];
         set_field_varchar_utf8(f, operation->str, operation->length);
         break;
-      case 16: /* NUMBER_OF_BYTES */
+      case 17: /* NUMBER_OF_BYTES */
         if ((m_row.m_operation == OPERATION_TYPE_FILEREAD) ||
             (m_row.m_operation == OPERATION_TYPE_FILEWRITE) ||
             (m_row.m_operation == OPERATION_TYPE_FILECHSIZE) ||
@@ -695,7 +707,7 @@ int table_events_waits_common::read_row_
         else
           f->set_null();
         break;
-      case 17: /* FLAGS */
+      case 18: /* FLAGS */
         f->set_null();
         break;
       default:

=== modified file 'storage/perfschema/table_events_waits.h'
--- a/storage/perfschema/table_events_waits.h	revid:inaam.rana@stripped
+++ b/storage/perfschema/table_events_waits.h	revid:inaam.rana@stripped
@@ -39,6 +39,8 @@ struct row_events_waits
   ulong m_thread_internal_id;
   /** Column EVENT_ID. */
   ulonglong m_event_id;
+  /** Column END_EVENT_ID. */
+  ulonglong m_end_event_id;
   /** Column NESTING_EVENT_ID. */
   ulonglong m_nesting_event_id;
   /** Column NESTING_EVENT_TYPE. */


Attachment: [text/bzr-bundle] bzr/inaam.rana@oracle.com-20111027110944-m7gd8vzmvzqsqv0a.bundle
Thread
bzr commit into mysql-trunk branch (inaam.rana:3529) Inaam Rana27 Oct