List:Commits« Previous MessageNext Message »
From:vasil.dimov Date:June 9 2011 6:52am
Subject:bzr push into mysql-trunk branch (vasil.dimov:3169 to 3170)
View as plain text  
 3170 Vasil Dimov	2011-06-09
      Install InnoDB persistent stats tables from inside mysql_install_db.
      Previously users had to manually run the .sql script. Remove files
      that are not necessary anymore.

    removed:
      mysql-test/suite/innodb/include/innodb_stats_bootstrap.inc
      storage/innobase/scripts/
      storage/innobase/scripts/persistent_storage.sql
    modified:
      mysql-test/r/1st.result
      mysql-test/r/connect.result
      mysql-test/r/log_tables_upgrade.result
      mysql-test/r/lowercase_table4.result
      mysql-test/r/mysql_upgrade.result
      mysql-test/r/mysql_upgrade_ssl.result
      mysql-test/r/mysqlcheck.result
      mysql-test/r/plugin_auth.result
      mysql-test/r/system_mysql_db.result
      mysql-test/suite/funcs_1/r/is_columns_mysql.result
      mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result
      mysql-test/suite/funcs_1/r/is_key_column_usage.result
      mysql-test/suite/funcs_1/r/is_statistics.result
      mysql-test/suite/funcs_1/r/is_statistics_mysql.result
      mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result
      mysql-test/suite/funcs_1/r/is_table_constraints.result
      mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result
      mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result
      mysql-test/suite/funcs_1/r/is_tables_mysql.result
      mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result
      mysql-test/suite/innodb/r/innodb-system-table-view.result
      mysql-test/suite/innodb/r/innodb-zip.result
      mysql-test/suite/innodb/r/innodb_bug57904.result
      mysql-test/suite/innodb/t/innodb-system-table-view.test
      mysql-test/suite/innodb/t/innodb-zip.test
      mysql-test/suite/innodb/t/innodb_bug11933790.test
      mysql-test/suite/innodb/t/innodb_bug57904.test
      mysql-test/suite/innodb/t/innodb_bug60049.test
      mysql-test/suite/innodb/t/innodb_stats.test
      mysql-test/suite/innodb/t/innodb_stats_drop_locked.test
      mysql-test/suite/perfschema/r/pfs_upgrade.result
      mysql-test/t/system_mysql_db_fix40123.test
      mysql-test/t/system_mysql_db_fix50030.test
      mysql-test/t/system_mysql_db_fix50117.test
      scripts/mysql_install_db.pl.in
      scripts/mysql_install_db.sh
      scripts/mysql_system_tables.sql
 3169 Olav Sandstaa	2011-06-09
      Fix for bug Bug#12355958 "FAILING ASSERTION: TRX->LOCK.N_ACTIVE_THRS == 1".
      
      The assert that crashes in InnoDB is caused by the ICP code pushing
      down an index condition that contains a subquery. When InnoDB
      evaluates this index condition the subquery is executed and this results in
      a second access to data in InnoDB. InnoDB does not allow a transaction
      to have more than one concurrent executing table operation and this 
      causes the assert to trigger.
      
      The ICP code should not have pushed down this index condition to InnoDB
      since it contains a subquery. The existing ICP code checks for subqueries in
      the condition by checking the value of the condition's with_subselect
      member. In this case the value for the Item_func condition's with_subselect
      is false even though one of the arguments for the Item_func is a subquery.
      This situation can occur when we initially create the item tree
      for a condition and then later substitutes non-subquery parts of it
      with a subquery. In the test case for this bug this occurs when
      optimize_conds() replaces a field reference with a subquery due to the
      subquery will be const when it is evaluated. This replacement is done
      without updating the Item_func node's with_subselect to true.
      
      The fix for this would be easy if it was possible to update the 
      with_subselect member locally when doing changes. What makes this
      more complex is that this information needs to be propagated 
      upwards in the item tree. Since we have no "parent reference" in
      the item tree this can not be done locally. In order to be able
      to propagate this information upwards in the item tree this patch
      extends Item::update_used_tables() to also update
      the value of with_subselect when traversing the item tree.
     @ mysql-test/include/icp_tests.inc
        Test for Bug#12355958 "FAILING ASSERTION: TRX->LOCK.N_ACTIVE_THRS == 1".
     @ mysql-test/r/innodb_icp.result
        Test for Bug#12355958 "FAILING ASSERTION: TRX->LOCK.N_ACTIVE_THRS == 1".
     @ mysql-test/r/innodb_icp_all.result
        Test for Bug#12355958 "FAILING ASSERTION: TRX->LOCK.N_ACTIVE_THRS == 1".
     @ mysql-test/r/innodb_icp_none.result
        Test for Bug#12355958 "FAILING ASSERTION: TRX->LOCK.N_ACTIVE_THRS == 1".
     @ mysql-test/r/myisam_icp.result
        Test for Bug#12355958 "FAILING ASSERTION: TRX->LOCK.N_ACTIVE_THRS == 1".
     @ mysql-test/r/myisam_icp_all.result
        Test for Bug#12355958 "FAILING ASSERTION: TRX->LOCK.N_ACTIVE_THRS == 1".
     @ mysql-test/r/myisam_icp_none.result
        Test for Bug#12355958 "FAILING ASSERTION: TRX->LOCK.N_ACTIVE_THRS == 1".
     @ sql/item.h
        Add Item_ref::has_subquery() that calls has_subquery() on the
        item it has a ref pointer to.
     @ sql/item_cmpfunc.cc
        Extend Item_cond::update_used_tables(), 
        Item_is_not_null_test::update_used_tables(), and 
        Item_equal::update_used_tables() to update its value
        for with_subselect based on the value in its arguments.
     @ sql/item_cmpfunc.h
        Extend Item_func_isnull::update_used_tables() to propagate
        the value of with_subselect in the item tree.
     @ sql/item_func.cc
        Extend Item_func::update_used_tables() to update its value
        for with_subselect based on the value in its arguments.
     @ sql/item_row.cc
        Extend Item_row::update_used_tables() to update its value
        for with_subselect based on the value in its arguments.
     @ sql/item_strfunc.cc
        Extend Item_func_make_set::update_used_tables() to update its 
        value for with_subselect based on the value in its item object.
     @ sql/item_sum.cc
        Extend Item_sum::update_used_tables() to update its value
        for with_subselect based on the value in its arguments.

    modified:
      mysql-test/include/icp_tests.inc
      mysql-test/r/innodb_icp.result
      mysql-test/r/innodb_icp_all.result
      mysql-test/r/innodb_icp_none.result
      mysql-test/r/myisam_icp.result
      mysql-test/r/myisam_icp_all.result
      mysql-test/r/myisam_icp_none.result
      sql/item.h
      sql/item_cmpfunc.cc
      sql/item_cmpfunc.h
      sql/item_func.cc
      sql/item_row.cc
      sql/item_strfunc.cc
      sql/item_sum.cc
=== modified file 'mysql-test/r/1st.result'
--- a/mysql-test/r/1st.result	revid:olav.sandstaa@stripped
+++ b/mysql-test/r/1st.result	revid:vasil.dimov@stripped
@@ -17,6 +17,8 @@ help_keyword
 help_relation
 help_topic
 host
+innodb_index_stats
+innodb_table_stats
 ndb_binlog_index
 plugin
 proc

=== modified file 'mysql-test/r/connect.result'
--- a/mysql-test/r/connect.result	revid:olav.sandstaa@stripped
+++ b/mysql-test/r/connect.result	revid:vasil.dimov@stripped
@@ -11,6 +11,8 @@ help_keyword
 help_relation
 help_topic
 host
+innodb_index_stats
+innodb_table_stats
 ndb_binlog_index
 plugin
 proc
@@ -47,6 +49,8 @@ help_keyword
 help_relation
 help_topic
 host
+innodb_index_stats
+innodb_table_stats
 ndb_binlog_index
 plugin
 proc
@@ -91,6 +95,8 @@ help_keyword
 help_relation
 help_topic
 host
+innodb_index_stats
+innodb_table_stats
 ndb_binlog_index
 plugin
 proc

=== modified file 'mysql-test/r/log_tables_upgrade.result'
--- a/mysql-test/r/log_tables_upgrade.result	revid:olav.sandstaa@stripped
+++ b/mysql-test/r/log_tables_upgrade.result	revid:vasil.dimov@stripped
@@ -23,6 +23,8 @@ mysql.help_keyword                      
 mysql.help_relation                                OK
 mysql.help_topic                                   OK
 mysql.host                                         OK
+mysql.innodb_index_stats                           OK
+mysql.innodb_table_stats                           OK
 mysql.ndb_binlog_index                             OK
 mysql.plugin                                       OK
 mysql.proc                                         OK

=== modified file 'mysql-test/r/lowercase_table4.result'
--- a/mysql-test/r/lowercase_table4.result	revid:olav.sandstaa@stripped
+++ b/mysql-test/r/lowercase_table4.result	revid:vasil.dimov@stripped
@@ -30,6 +30,17 @@ Create Table	CREATE TABLE `Table2` (
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1
 SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS;
 CONSTRAINT_CATALOG	def
+CONSTRAINT_SCHEMA	mysql
+CONSTRAINT_NAME	innodb_index_stats_ibfk_1
+UNIQUE_CONSTRAINT_CATALOG	def
+UNIQUE_CONSTRAINT_SCHEMA	mysql
+UNIQUE_CONSTRAINT_NAME	PRIMARY
+MATCH_OPTION	NONE
+UPDATE_RULE	RESTRICT
+DELETE_RULE	RESTRICT
+TABLE_NAME	innodb_index_stats
+REFERENCED_TABLE_NAME	innodb_table_stats
+CONSTRAINT_CATALOG	def
 CONSTRAINT_SCHEMA	test
 CONSTRAINT_NAME	fk1
 UNIQUE_CONSTRAINT_CATALOG	def
@@ -89,6 +100,17 @@ Create Table	CREATE TABLE `Customer` (
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1
 SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS;
 CONSTRAINT_CATALOG	def
+CONSTRAINT_SCHEMA	mysql
+CONSTRAINT_NAME	innodb_index_stats_ibfk_1
+UNIQUE_CONSTRAINT_CATALOG	def
+UNIQUE_CONSTRAINT_SCHEMA	mysql
+UNIQUE_CONSTRAINT_NAME	PRIMARY
+MATCH_OPTION	NONE
+UPDATE_RULE	RESTRICT
+DELETE_RULE	RESTRICT
+TABLE_NAME	innodb_index_stats
+REFERENCED_TABLE_NAME	innodb_table_stats
+CONSTRAINT_CATALOG	def
 CONSTRAINT_SCHEMA	test
 CONSTRAINT_NAME	product_order_ibfk_1
 UNIQUE_CONSTRAINT_CATALOG	def

=== modified file 'mysql-test/r/mysql_upgrade.result'
--- a/mysql-test/r/mysql_upgrade.result	revid:olav.sandstaa@stripped
+++ b/mysql-test/r/mysql_upgrade.result	revid:vasil.dimov@stripped
@@ -11,6 +11,8 @@ mysql.help_keyword                      
 mysql.help_relation                                OK
 mysql.help_topic                                   OK
 mysql.host                                         OK
+mysql.innodb_index_stats                           OK
+mysql.innodb_table_stats                           OK
 mysql.ndb_binlog_index                             OK
 mysql.plugin                                       OK
 mysql.proc                                         OK
@@ -42,6 +44,8 @@ mysql.help_keyword                      
 mysql.help_relation                                OK
 mysql.help_topic                                   OK
 mysql.host                                         OK
+mysql.innodb_index_stats                           OK
+mysql.innodb_table_stats                           OK
 mysql.ndb_binlog_index                             OK
 mysql.plugin                                       OK
 mysql.proc                                         OK
@@ -73,6 +77,8 @@ mysql.help_keyword                      
 mysql.help_relation                                OK
 mysql.help_topic                                   OK
 mysql.host                                         OK
+mysql.innodb_index_stats                           OK
+mysql.innodb_table_stats                           OK
 mysql.ndb_binlog_index                             OK
 mysql.plugin                                       OK
 mysql.proc                                         OK
@@ -106,6 +112,8 @@ mysql.help_keyword                      
 mysql.help_relation                                OK
 mysql.help_topic                                   OK
 mysql.host                                         OK
+mysql.innodb_index_stats                           OK
+mysql.innodb_table_stats                           OK
 mysql.ndb_binlog_index                             OK
 mysql.plugin                                       OK
 mysql.proc                                         OK
@@ -143,6 +151,8 @@ mysql.help_keyword                      
 mysql.help_relation                                OK
 mysql.help_topic                                   OK
 mysql.host                                         OK
+mysql.innodb_index_stats                           OK
+mysql.innodb_table_stats                           OK
 mysql.ndb_binlog_index                             OK
 mysql.plugin                                       OK
 mysql.proc                                         OK
@@ -183,6 +193,8 @@ mysql.help_keyword                      
 mysql.help_relation                                OK
 mysql.help_topic                                   OK
 mysql.host                                         OK
+mysql.innodb_index_stats                           OK
+mysql.innodb_table_stats                           OK
 mysql.ndb_binlog_index                             OK
 mysql.plugin                                       OK
 mysql.proc                                         OK

=== modified file 'mysql-test/r/mysql_upgrade_ssl.result'
--- a/mysql-test/r/mysql_upgrade_ssl.result	revid:olav.sandstaa@stripped
+++ b/mysql-test/r/mysql_upgrade_ssl.result	revid:vasil.dimov@stripped
@@ -13,6 +13,8 @@ mysql.help_keyword                      
 mysql.help_relation                                OK
 mysql.help_topic                                   OK
 mysql.host                                         OK
+mysql.innodb_index_stats                           OK
+mysql.innodb_table_stats                           OK
 mysql.ndb_binlog_index                             OK
 mysql.plugin                                       OK
 mysql.proc                                         OK

=== modified file 'mysql-test/r/mysqlcheck.result'
--- a/mysql-test/r/mysqlcheck.result	revid:olav.sandstaa@stripped
+++ b/mysql-test/r/mysqlcheck.result	revid:vasil.dimov@stripped
@@ -14,6 +14,8 @@ mysql.help_keyword                      
 mysql.help_relation                                OK
 mysql.help_topic                                   OK
 mysql.host                                         OK
+mysql.innodb_index_stats                           OK
+mysql.innodb_table_stats                           OK
 mysql.ndb_binlog_index                             OK
 mysql.plugin                                       OK
 mysql.proc                                         OK
@@ -44,6 +46,12 @@ mysql.help_keyword                      
 mysql.help_relation                                OK
 mysql.help_topic                                   OK
 mysql.host                                         OK
+mysql.innodb_index_stats
+note     : Table does not support optimize, doing recreate + analyze instead
+status   : OK
+mysql.innodb_table_stats
+note     : Table does not support optimize, doing recreate + analyze instead
+status   : OK
 mysql.ndb_binlog_index                             OK
 mysql.plugin                                       OK
 mysql.proc                                         OK
@@ -72,6 +80,8 @@ mysql.help_keyword                      
 mysql.help_relation                                OK
 mysql.help_topic                                   OK
 mysql.host                                         OK
+mysql.innodb_index_stats                           OK
+mysql.innodb_table_stats                           OK
 mysql.ndb_binlog_index                             OK
 mysql.plugin                                       OK
 mysql.proc                                         OK
@@ -100,6 +110,12 @@ mysql.help_keyword                      
 mysql.help_relation                                Table is already up to date
 mysql.help_topic                                   Table is already up to date
 mysql.host                                         Table is already up to date
+mysql.innodb_index_stats
+note     : Table does not support optimize, doing recreate + analyze instead
+status   : OK
+mysql.innodb_table_stats
+note     : Table does not support optimize, doing recreate + analyze instead
+status   : OK
 mysql.ndb_binlog_index                             Table is already up to date
 mysql.plugin                                       Table is already up to date
 mysql.proc                                         Table is already up to date

=== modified file 'mysql-test/r/plugin_auth.result'
--- a/mysql-test/r/plugin_auth.result	revid:olav.sandstaa@stripped
+++ b/mysql-test/r/plugin_auth.result	revid:vasil.dimov@stripped
@@ -299,6 +299,8 @@ mysql.help_keyword                      
 mysql.help_relation                                OK
 mysql.help_topic                                   OK
 mysql.host                                         OK
+mysql.innodb_index_stats                           OK
+mysql.innodb_table_stats                           OK
 mysql.ndb_binlog_index                             OK
 mysql.plugin                                       OK
 mysql.proc                                         OK
@@ -429,6 +431,8 @@ mysql.help_keyword                      
 mysql.help_relation                                OK
 mysql.help_topic                                   OK
 mysql.host                                         OK
+mysql.innodb_index_stats                           OK
+mysql.innodb_table_stats                           OK
 mysql.ndb_binlog_index                             OK
 mysql.plugin                                       OK
 mysql.proc                                         OK

=== modified file 'mysql-test/r/system_mysql_db.result'
--- a/mysql-test/r/system_mysql_db.result	revid:olav.sandstaa@stripped
+++ b/mysql-test/r/system_mysql_db.result	revid:vasil.dimov@stripped
@@ -10,6 +10,8 @@ help_keyword
 help_relation
 help_topic
 host
+innodb_index_stats
+innodb_table_stats
 ndb_binlog_index
 plugin
 proc

=== modified file 'mysql-test/suite/funcs_1/r/is_columns_mysql.result'
--- a/mysql-test/suite/funcs_1/r/is_columns_mysql.result	revid:olav.sandstaa@stripped
+++ b/mysql-test/suite/funcs_1/r/is_columns_mysql.result	revid:vasil.dimov@stripped
@@ -97,6 +97,20 @@ def	mysql	host	Select_priv	3	N	NO	enum	1
 def	mysql	host	Show_view_priv	16	N	NO	enum	1	3	NULL	NULL	utf8	utf8_general_ci	enum('N','Y')			select,insert,update,references	
 def	mysql	host	Trigger_priv	20	N	NO	enum	1	3	NULL	NULL	utf8	utf8_general_ci	enum('N','Y')			select,insert,update,references	
 def	mysql	host	Update_priv	5	N	NO	enum	1	3	NULL	NULL	utf8	utf8_general_ci	enum('N','Y')			select,insert,update,references	
+def	mysql	innodb_index_stats	database_name	1	NULL	NO	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)	PRI		select,insert,update,references	
+def	mysql	innodb_index_stats	index_name	3	NULL	NO	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)	PRI		select,insert,update,references	
+def	mysql	innodb_index_stats	sample_size	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	mysql	innodb_index_stats	stat_description	8	NULL	NO	varchar	1024	3072	NULL	NULL	utf8	utf8_general_ci	varchar(1024)			select,insert,update,references	
+def	mysql	innodb_index_stats	stat_name	5	NULL	NO	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)	PRI		select,insert,update,references	
+def	mysql	innodb_index_stats	stat_timestamp	4	CURRENT_TIMESTAMP	NO	timestamp	NULL	NULL	NULL	NULL	NULL	NULL	timestamp		on update CURRENT_TIMESTAMP	select,insert,update,references	
+def	mysql	innodb_index_stats	stat_value	6	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	mysql	innodb_index_stats	table_name	2	NULL	NO	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)	PRI		select,insert,update,references	
+def	mysql	innodb_table_stats	clustered_index_size	5	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	mysql	innodb_table_stats	database_name	1	NULL	NO	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)	PRI		select,insert,update,references	
+def	mysql	innodb_table_stats	n_rows	4	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	mysql	innodb_table_stats	stats_timestamp	3	CURRENT_TIMESTAMP	NO	timestamp	NULL	NULL	NULL	NULL	NULL	NULL	timestamp		on update CURRENT_TIMESTAMP	select,insert,update,references	
+def	mysql	innodb_table_stats	sum_of_other_index_sizes	6	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	mysql	innodb_table_stats	table_name	2	NULL	NO	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)	PRI		select,insert,update,references	
 def	mysql	ndb_binlog_index	deletes	6	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
 def	mysql	ndb_binlog_index	epoch	3	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned	PRI		select,insert,update,references	
 def	mysql	ndb_binlog_index	File	2	NULL	NO	varchar	255	255	NULL	NULL	latin1	latin1_swedish_ci	varchar(255)			select,insert,update,references	
@@ -420,6 +434,20 @@ NULL	mysql	help_topic	help_category_id	s
 3.0000	mysql	host	Alter_routine_priv	enum	1	3	utf8	utf8_general_ci	enum('N','Y')
 3.0000	mysql	host	Execute_priv	enum	1	3	utf8	utf8_general_ci	enum('N','Y')
 3.0000	mysql	host	Trigger_priv	enum	1	3	utf8	utf8_general_ci	enum('N','Y')
+3.0000	mysql	innodb_index_stats	database_name	varchar	64	192	utf8	utf8_general_ci	varchar(64)
+3.0000	mysql	innodb_index_stats	table_name	varchar	64	192	utf8	utf8_general_ci	varchar(64)
+3.0000	mysql	innodb_index_stats	index_name	varchar	64	192	utf8	utf8_general_ci	varchar(64)
+NULL	mysql	innodb_index_stats	stat_timestamp	timestamp	NULL	NULL	NULL	NULL	timestamp
+3.0000	mysql	innodb_index_stats	stat_name	varchar	64	192	utf8	utf8_general_ci	varchar(64)
+NULL	mysql	innodb_index_stats	stat_value	bigint	NULL	NULL	NULL	NULL	bigint(20) unsigned
+NULL	mysql	innodb_index_stats	sample_size	bigint	NULL	NULL	NULL	NULL	bigint(20) unsigned
+3.0000	mysql	innodb_index_stats	stat_description	varchar	1024	3072	utf8	utf8_general_ci	varchar(1024)
+3.0000	mysql	innodb_table_stats	database_name	varchar	64	192	utf8	utf8_general_ci	varchar(64)
+3.0000	mysql	innodb_table_stats	table_name	varchar	64	192	utf8	utf8_general_ci	varchar(64)
+NULL	mysql	innodb_table_stats	stats_timestamp	timestamp	NULL	NULL	NULL	NULL	timestamp
+NULL	mysql	innodb_table_stats	n_rows	bigint	NULL	NULL	NULL	NULL	bigint(20) unsigned
+NULL	mysql	innodb_table_stats	clustered_index_size	bigint	NULL	NULL	NULL	NULL	bigint(20) unsigned
+NULL	mysql	innodb_table_stats	sum_of_other_index_sizes	bigint	NULL	NULL	NULL	NULL	bigint(20) unsigned
 NULL	mysql	ndb_binlog_index	Position	bigint	NULL	NULL	NULL	NULL	bigint(20) unsigned
 1.0000	mysql	ndb_binlog_index	File	varchar	255	255	latin1	latin1_swedish_ci	varchar(255)
 NULL	mysql	ndb_binlog_index	epoch	bigint	NULL	NULL	NULL	NULL	bigint(20) unsigned

=== modified file 'mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result'
--- a/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result	revid:olav.sandstaa@stripped
+++ b/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result	revid:vasil.dimov@stripped
@@ -97,6 +97,20 @@ def	mysql	host	Select_priv	3	N	NO	enum	1
 def	mysql	host	Show_view_priv	16	N	NO	enum	1	3	NULL	NULL	utf8	utf8_general_ci	enum('N','Y')				
 def	mysql	host	Trigger_priv	20	N	NO	enum	1	3	NULL	NULL	utf8	utf8_general_ci	enum('N','Y')				
 def	mysql	host	Update_priv	5	N	NO	enum	1	3	NULL	NULL	utf8	utf8_general_ci	enum('N','Y')				
+def	mysql	innodb_index_stats	database_name	1	NULL	NO	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)	PRI			
+def	mysql	innodb_index_stats	index_name	3	NULL	NO	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)	PRI			
+def	mysql	innodb_index_stats	sample_size	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned				
+def	mysql	innodb_index_stats	stat_description	8	NULL	NO	varchar	1024	3072	NULL	NULL	utf8	utf8_general_ci	varchar(1024)				
+def	mysql	innodb_index_stats	stat_name	5	NULL	NO	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)	PRI			
+def	mysql	innodb_index_stats	stat_timestamp	4	CURRENT_TIMESTAMP	NO	timestamp	NULL	NULL	NULL	NULL	NULL	NULL	timestamp		on update CURRENT_TIMESTAMP		
+def	mysql	innodb_index_stats	stat_value	6	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned				
+def	mysql	innodb_index_stats	table_name	2	NULL	NO	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)	PRI			
+def	mysql	innodb_table_stats	clustered_index_size	5	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned				
+def	mysql	innodb_table_stats	database_name	1	NULL	NO	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)	PRI			
+def	mysql	innodb_table_stats	n_rows	4	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned				
+def	mysql	innodb_table_stats	stats_timestamp	3	CURRENT_TIMESTAMP	NO	timestamp	NULL	NULL	NULL	NULL	NULL	NULL	timestamp		on update CURRENT_TIMESTAMP		
+def	mysql	innodb_table_stats	sum_of_other_index_sizes	6	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned				
+def	mysql	innodb_table_stats	table_name	2	NULL	NO	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)	PRI			
 def	mysql	ndb_binlog_index	deletes	6	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned				
 def	mysql	ndb_binlog_index	epoch	3	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned	PRI			
 def	mysql	ndb_binlog_index	File	2	NULL	NO	varchar	255	255	NULL	NULL	latin1	latin1_swedish_ci	varchar(255)				
@@ -420,6 +434,20 @@ NULL	mysql	help_topic	help_category_id	s
 3.0000	mysql	host	Alter_routine_priv	enum	1	3	utf8	utf8_general_ci	enum('N','Y')
 3.0000	mysql	host	Execute_priv	enum	1	3	utf8	utf8_general_ci	enum('N','Y')
 3.0000	mysql	host	Trigger_priv	enum	1	3	utf8	utf8_general_ci	enum('N','Y')
+3.0000	mysql	innodb_index_stats	database_name	varchar	64	192	utf8	utf8_general_ci	varchar(64)
+3.0000	mysql	innodb_index_stats	table_name	varchar	64	192	utf8	utf8_general_ci	varchar(64)
+3.0000	mysql	innodb_index_stats	index_name	varchar	64	192	utf8	utf8_general_ci	varchar(64)
+NULL	mysql	innodb_index_stats	stat_timestamp	timestamp	NULL	NULL	NULL	NULL	timestamp
+3.0000	mysql	innodb_index_stats	stat_name	varchar	64	192	utf8	utf8_general_ci	varchar(64)
+NULL	mysql	innodb_index_stats	stat_value	bigint	NULL	NULL	NULL	NULL	bigint(20) unsigned
+NULL	mysql	innodb_index_stats	sample_size	bigint	NULL	NULL	NULL	NULL	bigint(20) unsigned
+3.0000	mysql	innodb_index_stats	stat_description	varchar	1024	3072	utf8	utf8_general_ci	varchar(1024)
+3.0000	mysql	innodb_table_stats	database_name	varchar	64	192	utf8	utf8_general_ci	varchar(64)
+3.0000	mysql	innodb_table_stats	table_name	varchar	64	192	utf8	utf8_general_ci	varchar(64)
+NULL	mysql	innodb_table_stats	stats_timestamp	timestamp	NULL	NULL	NULL	NULL	timestamp
+NULL	mysql	innodb_table_stats	n_rows	bigint	NULL	NULL	NULL	NULL	bigint(20) unsigned
+NULL	mysql	innodb_table_stats	clustered_index_size	bigint	NULL	NULL	NULL	NULL	bigint(20) unsigned
+NULL	mysql	innodb_table_stats	sum_of_other_index_sizes	bigint	NULL	NULL	NULL	NULL	bigint(20) unsigned
 NULL	mysql	ndb_binlog_index	Position	bigint	NULL	NULL	NULL	NULL	bigint(20) unsigned
 1.0000	mysql	ndb_binlog_index	File	varchar	255	255	latin1	latin1_swedish_ci	varchar(255)
 NULL	mysql	ndb_binlog_index	epoch	bigint	NULL	NULL	NULL	NULL	bigint(20) unsigned

=== modified file 'mysql-test/suite/funcs_1/r/is_key_column_usage.result'
--- a/mysql-test/suite/funcs_1/r/is_key_column_usage.result	revid:olav.sandstaa@stripped
+++ b/mysql-test/suite/funcs_1/r/is_key_column_usage.result	revid:vasil.dimov@stripped
@@ -96,6 +96,14 @@ def	mysql	PRIMARY	def	mysql	help_topic	h
 def	mysql	name	def	mysql	help_topic	name
 def	mysql	PRIMARY	def	mysql	host	Host
 def	mysql	PRIMARY	def	mysql	host	Db
+def	mysql	PRIMARY	def	mysql	innodb_index_stats	database_name
+def	mysql	PRIMARY	def	mysql	innodb_index_stats	table_name
+def	mysql	PRIMARY	def	mysql	innodb_index_stats	index_name
+def	mysql	PRIMARY	def	mysql	innodb_index_stats	stat_name
+def	mysql	innodb_index_stats_ibfk_1	def	mysql	innodb_index_stats	database_name
+def	mysql	innodb_index_stats_ibfk_1	def	mysql	innodb_index_stats	table_name
+def	mysql	PRIMARY	def	mysql	innodb_table_stats	database_name
+def	mysql	PRIMARY	def	mysql	innodb_table_stats	table_name
 def	mysql	PRIMARY	def	mysql	ndb_binlog_index	epoch
 def	mysql	PRIMARY	def	mysql	plugin	name
 def	mysql	PRIMARY	def	mysql	proc	db

=== modified file 'mysql-test/suite/funcs_1/r/is_statistics.result'
--- a/mysql-test/suite/funcs_1/r/is_statistics.result	revid:olav.sandstaa@stripped
+++ b/mysql-test/suite/funcs_1/r/is_statistics.result	revid:vasil.dimov@stripped
@@ -107,6 +107,12 @@ def	mysql	help_topic	mysql	PRIMARY
 def	mysql	help_topic	mysql	name
 def	mysql	host	mysql	PRIMARY
 def	mysql	host	mysql	PRIMARY
+def	mysql	innodb_index_stats	mysql	PRIMARY
+def	mysql	innodb_index_stats	mysql	PRIMARY
+def	mysql	innodb_index_stats	mysql	PRIMARY
+def	mysql	innodb_index_stats	mysql	PRIMARY
+def	mysql	innodb_table_stats	mysql	PRIMARY
+def	mysql	innodb_table_stats	mysql	PRIMARY
 def	mysql	ndb_binlog_index	mysql	PRIMARY
 def	mysql	plugin	mysql	PRIMARY
 def	mysql	proc	mysql	PRIMARY

=== modified file 'mysql-test/suite/funcs_1/r/is_statistics_mysql.result'
--- a/mysql-test/suite/funcs_1/r/is_statistics_mysql.result	revid:olav.sandstaa@stripped
+++ b/mysql-test/suite/funcs_1/r/is_statistics_mysql.result	revid:vasil.dimov@stripped
@@ -29,6 +29,12 @@ def	mysql	help_topic	0	mysql	name	1	name
 def	mysql	help_topic	0	mysql	PRIMARY	1	help_topic_id	A	#CARD#	NULL	NULL		BTREE		
 def	mysql	host	0	mysql	PRIMARY	1	Host	A	#CARD#	NULL	NULL		BTREE		
 def	mysql	host	0	mysql	PRIMARY	2	Db	A	#CARD#	NULL	NULL		BTREE		
+def	mysql	innodb_index_stats	0	mysql	PRIMARY	1	database_name	A	#CARD#	NULL	NULL		BTREE		
+def	mysql	innodb_index_stats	0	mysql	PRIMARY	2	table_name	A	#CARD#	NULL	NULL		BTREE		
+def	mysql	innodb_index_stats	0	mysql	PRIMARY	3	index_name	A	#CARD#	NULL	NULL		BTREE		
+def	mysql	innodb_index_stats	0	mysql	PRIMARY	4	stat_name	A	#CARD#	NULL	NULL		BTREE		
+def	mysql	innodb_table_stats	0	mysql	PRIMARY	1	database_name	A	#CARD#	NULL	NULL		BTREE		
+def	mysql	innodb_table_stats	0	mysql	PRIMARY	2	table_name	A	#CARD#	NULL	NULL		BTREE		
 def	mysql	ndb_binlog_index	0	mysql	PRIMARY	1	epoch	A	#CARD#	NULL	NULL		BTREE		
 def	mysql	plugin	0	mysql	PRIMARY	1	name	A	#CARD#	NULL	NULL		BTREE		
 def	mysql	proc	0	mysql	PRIMARY	1	db	A	#CARD#	NULL	NULL		BTREE		

=== modified file 'mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result'
--- a/mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result	revid:olav.sandstaa@stripped
+++ b/mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result	revid:vasil.dimov@stripped
@@ -29,6 +29,12 @@ def	mysql	help_topic	0	mysql	name	1	name
 def	mysql	help_topic	0	mysql	PRIMARY	1	help_topic_id	A	#CARD#	NULL	NULL		BTREE		
 def	mysql	host	0	mysql	PRIMARY	1	Host	A	#CARD#	NULL	NULL		BTREE		
 def	mysql	host	0	mysql	PRIMARY	2	Db	A	#CARD#	NULL	NULL		BTREE		
+def	mysql	innodb_index_stats	0	mysql	PRIMARY	1	database_name	A	#CARD#	NULL	NULL		BTREE		
+def	mysql	innodb_index_stats	0	mysql	PRIMARY	2	table_name	A	#CARD#	NULL	NULL		BTREE		
+def	mysql	innodb_index_stats	0	mysql	PRIMARY	3	index_name	A	#CARD#	NULL	NULL		BTREE		
+def	mysql	innodb_index_stats	0	mysql	PRIMARY	4	stat_name	A	#CARD#	NULL	NULL		BTREE		
+def	mysql	innodb_table_stats	0	mysql	PRIMARY	1	database_name	A	#CARD#	NULL	NULL		BTREE		
+def	mysql	innodb_table_stats	0	mysql	PRIMARY	2	table_name	A	#CARD#	NULL	NULL		BTREE		
 def	mysql	ndb_binlog_index	0	mysql	PRIMARY	1	epoch	A	#CARD#	NULL	NULL		BTREE		
 def	mysql	plugin	0	mysql	PRIMARY	1	name	A	#CARD#	NULL	NULL		BTREE		
 def	mysql	proc	0	mysql	PRIMARY	1	db	A	#CARD#	NULL	NULL		BTREE		
@@ -89,6 +95,12 @@ def	mysql	help_topic	0	mysql	name	1	name
 def	mysql	help_topic	0	mysql	PRIMARY	1	help_topic_id	A	#CARD#	NULL	NULL		BTREE		
 def	mysql	host	0	mysql	PRIMARY	1	Host	A	#CARD#	NULL	NULL		BTREE		
 def	mysql	host	0	mysql	PRIMARY	2	Db	A	#CARD#	NULL	NULL		BTREE		
+def	mysql	innodb_index_stats	0	mysql	PRIMARY	1	database_name	A	#CARD#	NULL	NULL		BTREE		
+def	mysql	innodb_index_stats	0	mysql	PRIMARY	2	table_name	A	#CARD#	NULL	NULL		BTREE		
+def	mysql	innodb_index_stats	0	mysql	PRIMARY	3	index_name	A	#CARD#	NULL	NULL		BTREE		
+def	mysql	innodb_index_stats	0	mysql	PRIMARY	4	stat_name	A	#CARD#	NULL	NULL		BTREE		
+def	mysql	innodb_table_stats	0	mysql	PRIMARY	1	database_name	A	#CARD#	NULL	NULL		BTREE		
+def	mysql	innodb_table_stats	0	mysql	PRIMARY	2	table_name	A	#CARD#	NULL	NULL		BTREE		
 def	mysql	ndb_binlog_index	0	mysql	PRIMARY	1	epoch	A	#CARD#	NULL	NULL		BTREE		
 def	mysql	plugin	0	mysql	PRIMARY	1	name	A	#CARD#	NULL	NULL		BTREE		
 def	mysql	proc	0	mysql	PRIMARY	1	db	A	#CARD#	NULL	NULL		BTREE		

=== modified file 'mysql-test/suite/funcs_1/r/is_table_constraints.result'
--- a/mysql-test/suite/funcs_1/r/is_table_constraints.result	revid:olav.sandstaa@stripped
+++ b/mysql-test/suite/funcs_1/r/is_table_constraints.result	revid:vasil.dimov@stripped
@@ -69,6 +69,9 @@ def	mysql	PRIMARY	mysql	help_relation
 def	mysql	PRIMARY	mysql	help_topic
 def	mysql	name	mysql	help_topic
 def	mysql	PRIMARY	mysql	host
+def	mysql	PRIMARY	mysql	innodb_index_stats
+def	mysql	innodb_index_stats_ibfk_1	mysql	innodb_index_stats
+def	mysql	PRIMARY	mysql	innodb_table_stats
 def	mysql	PRIMARY	mysql	ndb_binlog_index
 def	mysql	PRIMARY	mysql	plugin
 def	mysql	PRIMARY	mysql	proc

=== modified file 'mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result'
--- a/mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result	revid:olav.sandstaa@stripped
+++ b/mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result	revid:vasil.dimov@stripped
@@ -19,6 +19,9 @@ def	mysql	PRIMARY	mysql	help_relation	PR
 def	mysql	name	mysql	help_topic	UNIQUE
 def	mysql	PRIMARY	mysql	help_topic	PRIMARY KEY
 def	mysql	PRIMARY	mysql	host	PRIMARY KEY
+def	mysql	innodb_index_stats_ibfk_1	mysql	innodb_index_stats	FOREIGN KEY
+def	mysql	PRIMARY	mysql	innodb_index_stats	PRIMARY KEY
+def	mysql	PRIMARY	mysql	innodb_table_stats	PRIMARY KEY
 def	mysql	PRIMARY	mysql	ndb_binlog_index	PRIMARY KEY
 def	mysql	PRIMARY	mysql	plugin	PRIMARY KEY
 def	mysql	PRIMARY	mysql	proc	PRIMARY KEY

=== modified file 'mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result'
--- a/mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result	revid:olav.sandstaa@stripped
+++ b/mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result	revid:vasil.dimov@stripped
@@ -19,6 +19,9 @@ def	mysql	PRIMARY	mysql	help_relation	PR
 def	mysql	name	mysql	help_topic	UNIQUE
 def	mysql	PRIMARY	mysql	help_topic	PRIMARY KEY
 def	mysql	PRIMARY	mysql	host	PRIMARY KEY
+def	mysql	innodb_index_stats_ibfk_1	mysql	innodb_index_stats	FOREIGN KEY
+def	mysql	PRIMARY	mysql	innodb_index_stats	PRIMARY KEY
+def	mysql	PRIMARY	mysql	innodb_table_stats	PRIMARY KEY
 def	mysql	PRIMARY	mysql	ndb_binlog_index	PRIMARY KEY
 def	mysql	PRIMARY	mysql	plugin	PRIMARY KEY
 def	mysql	PRIMARY	mysql	proc	PRIMARY KEY
@@ -51,6 +54,9 @@ def	mysql	PRIMARY	mysql	help_relation	PR
 def	mysql	name	mysql	help_topic	UNIQUE
 def	mysql	PRIMARY	mysql	help_topic	PRIMARY KEY
 def	mysql	PRIMARY	mysql	host	PRIMARY KEY
+def	mysql	innodb_index_stats_ibfk_1	mysql	innodb_index_stats	FOREIGN KEY
+def	mysql	PRIMARY	mysql	innodb_index_stats	PRIMARY KEY
+def	mysql	PRIMARY	mysql	innodb_table_stats	PRIMARY KEY
 def	mysql	PRIMARY	mysql	ndb_binlog_index	PRIMARY KEY
 def	mysql	PRIMARY	mysql	plugin	PRIMARY KEY
 def	mysql	PRIMARY	mysql	proc	PRIMARY KEY

=== modified file 'mysql-test/suite/funcs_1/r/is_tables_mysql.result'
--- a/mysql-test/suite/funcs_1/r/is_tables_mysql.result	revid:olav.sandstaa@stripped
+++ b/mysql-test/suite/funcs_1/r/is_tables_mysql.result	revid:vasil.dimov@stripped
@@ -244,6 +244,52 @@ user_comment	Host privileges;  Merged wi
 Separator	-----------------------------------------------------
 TABLE_CATALOG	def
 TABLE_SCHEMA	mysql
+TABLE_NAME	innodb_index_stats
+TABLE_TYPE	BASE TABLE
+ENGINE	InnoDB
+VERSION	10
+ROW_FORMAT	Compact
+TABLE_ROWS	#TBLR#
+AVG_ROW_LENGTH	#ARL#
+DATA_LENGTH	#DL#
+MAX_DATA_LENGTH	#MDL#
+INDEX_LENGTH	#IL#
+DATA_FREE	#DF#
+AUTO_INCREMENT	NULL
+CREATE_TIME	#CRT#
+UPDATE_TIME	#UT#
+CHECK_TIME	#CT#
+TABLE_COLLATION	utf8_general_ci
+CHECKSUM	NULL
+CREATE_OPTIONS	#CO#
+TABLE_COMMENT	#TC#
+user_comment	
+Separator	-----------------------------------------------------
+TABLE_CATALOG	def
+TABLE_SCHEMA	mysql
+TABLE_NAME	innodb_table_stats
+TABLE_TYPE	BASE TABLE
+ENGINE	InnoDB
+VERSION	10
+ROW_FORMAT	Compact
+TABLE_ROWS	#TBLR#
+AVG_ROW_LENGTH	#ARL#
+DATA_LENGTH	#DL#
+MAX_DATA_LENGTH	#MDL#
+INDEX_LENGTH	#IL#
+DATA_FREE	#DF#
+AUTO_INCREMENT	NULL
+CREATE_TIME	#CRT#
+UPDATE_TIME	#UT#
+CHECK_TIME	#CT#
+TABLE_COLLATION	utf8_general_ci
+CHECKSUM	NULL
+CREATE_OPTIONS	#CO#
+TABLE_COMMENT	#TC#
+user_comment	
+Separator	-----------------------------------------------------
+TABLE_CATALOG	def
+TABLE_SCHEMA	mysql
 TABLE_NAME	ndb_binlog_index
 TABLE_TYPE	BASE TABLE
 ENGINE	MyISAM

=== modified file 'mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result'
--- a/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result	revid:olav.sandstaa@stripped
+++ b/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result	revid:vasil.dimov@stripped
@@ -244,6 +244,52 @@ user_comment	Host privileges;  Merged wi
 Separator	-----------------------------------------------------
 TABLE_CATALOG	def
 TABLE_SCHEMA	mysql
+TABLE_NAME	innodb_index_stats
+TABLE_TYPE	BASE TABLE
+ENGINE	InnoDB
+VERSION	10
+ROW_FORMAT	Compact
+TABLE_ROWS	#TBLR#
+AVG_ROW_LENGTH	#ARL#
+DATA_LENGTH	#DL#
+MAX_DATA_LENGTH	#MDL#
+INDEX_LENGTH	#IL#
+DATA_FREE	#DF#
+AUTO_INCREMENT	NULL
+CREATE_TIME	#CRT#
+UPDATE_TIME	#UT#
+CHECK_TIME	#CT#
+TABLE_COLLATION	utf8_general_ci
+CHECKSUM	NULL
+CREATE_OPTIONS	#CO#
+TABLE_COMMENT	#TC#
+user_comment	
+Separator	-----------------------------------------------------
+TABLE_CATALOG	def
+TABLE_SCHEMA	mysql
+TABLE_NAME	innodb_table_stats
+TABLE_TYPE	BASE TABLE
+ENGINE	InnoDB
+VERSION	10
+ROW_FORMAT	Compact
+TABLE_ROWS	#TBLR#
+AVG_ROW_LENGTH	#ARL#
+DATA_LENGTH	#DL#
+MAX_DATA_LENGTH	#MDL#
+INDEX_LENGTH	#IL#
+DATA_FREE	#DF#
+AUTO_INCREMENT	NULL
+CREATE_TIME	#CRT#
+UPDATE_TIME	#UT#
+CHECK_TIME	#CT#
+TABLE_COLLATION	utf8_general_ci
+CHECKSUM	NULL
+CREATE_OPTIONS	#CO#
+TABLE_COMMENT	#TC#
+user_comment	
+Separator	-----------------------------------------------------
+TABLE_CATALOG	def
+TABLE_SCHEMA	mysql
 TABLE_NAME	ndb_binlog_index
 TABLE_TYPE	BASE TABLE
 ENGINE	MyISAM
@@ -858,6 +904,52 @@ user_comment	Host privileges;  Merged wi
 Separator	-----------------------------------------------------
 TABLE_CATALOG	def
 TABLE_SCHEMA	mysql
+TABLE_NAME	innodb_index_stats
+TABLE_TYPE	BASE TABLE
+ENGINE	InnoDB
+VERSION	10
+ROW_FORMAT	Compact
+TABLE_ROWS	#TBLR#
+AVG_ROW_LENGTH	#ARL#
+DATA_LENGTH	#DL#
+MAX_DATA_LENGTH	#MDL#
+INDEX_LENGTH	#IL#
+DATA_FREE	#DF#
+AUTO_INCREMENT	NULL
+CREATE_TIME	#CRT#
+UPDATE_TIME	#UT#
+CHECK_TIME	#CT#
+TABLE_COLLATION	utf8_general_ci
+CHECKSUM	NULL
+CREATE_OPTIONS	#CO#
+TABLE_COMMENT	#TC#
+user_comment	
+Separator	-----------------------------------------------------
+TABLE_CATALOG	def
+TABLE_SCHEMA	mysql
+TABLE_NAME	innodb_table_stats
+TABLE_TYPE	BASE TABLE
+ENGINE	InnoDB
+VERSION	10
+ROW_FORMAT	Compact
+TABLE_ROWS	#TBLR#
+AVG_ROW_LENGTH	#ARL#
+DATA_LENGTH	#DL#
+MAX_DATA_LENGTH	#MDL#
+INDEX_LENGTH	#IL#
+DATA_FREE	#DF#
+AUTO_INCREMENT	NULL
+CREATE_TIME	#CRT#
+UPDATE_TIME	#UT#
+CHECK_TIME	#CT#
+TABLE_COLLATION	utf8_general_ci
+CHECKSUM	NULL
+CREATE_OPTIONS	#CO#
+TABLE_COMMENT	#TC#
+user_comment	
+Separator	-----------------------------------------------------
+TABLE_CATALOG	def
+TABLE_SCHEMA	mysql
 TABLE_NAME	ndb_binlog_index
 TABLE_TYPE	BASE TABLE
 ENGINE	MyISAM

=== removed file 'mysql-test/suite/innodb/include/innodb_stats_bootstrap.inc'
--- a/mysql-test/suite/innodb/include/innodb_stats_bootstrap.inc	revid:olav.sandstaa@stripped
+++ b/mysql-test/suite/innodb/include/innodb_stats_bootstrap.inc	1970-01-01 00:00:00 +0000
@@ -1,35 +0,0 @@
--- disable_warnings
--- disable_query_log
-
-DROP TABLE IF EXISTS mysql.innodb_table_stats;
-CREATE TABLE mysql.innodb_table_stats (
-	database_name			VARCHAR(64) NOT NULL,
-	table_name			VARCHAR(64) NOT NULL,
-	stats_timestamp			TIMESTAMP NOT NULL,
-	n_rows				BIGINT UNSIGNED NOT NULL,
-	clustered_index_size		BIGINT UNSIGNED NOT NULL,
-	sum_of_other_index_sizes	BIGINT UNSIGNED NOT NULL,
-	PRIMARY KEY (database_name, table_name)
-) ENGINE=INNODB DEFAULT CHARSET=utf8;
-
-DROP TABLE IF EXISTS mysql.innodb_index_stats;
-CREATE TABLE mysql.innodb_index_stats (
-	database_name			VARCHAR(64) NOT NULL,
-	table_name			VARCHAR(64) NOT NULL,
-	index_name			VARCHAR(64) NOT NULL,
-	stat_timestamp			TIMESTAMP NOT NULL,
-	/* there are at least:
-	stat_name='size'
-	stat_name='n_leaf_pages'
-	stat_name='n_diff_pfx%' */
-	stat_name			VARCHAR(64) NOT NULL,
-	stat_value			BIGINT UNSIGNED NOT NULL,
-	sample_size			BIGINT UNSIGNED,
-	stat_description		VARCHAR(1024) NOT NULL,
-	PRIMARY KEY (database_name, table_name, index_name, stat_name),
-	FOREIGN KEY (database_name, table_name)
-	  REFERENCES mysql.innodb_table_stats (database_name, table_name)
-) ENGINE=INNODB DEFAULT CHARSET=utf8;
-
--- enable_warnings
--- enable_query_log

=== modified file 'mysql-test/suite/innodb/r/innodb-system-table-view.result'
--- a/mysql-test/suite/innodb/r/innodb-system-table-view.result	revid:olav.sandstaa@stripped
+++ b/mysql-test/suite/innodb/r/innodb-system-table-view.result	revid:vasil.dimov@stripped
@@ -1,14 +1,11 @@
-SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES;
 TABLE_ID	NAME	FLAG	N_COLS	SPACE
 11	SYS_FOREIGN	0	7	0
 12	SYS_FOREIGN_COLS	0	7	0
-SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES;
 INDEX_ID	NAME	TABLE_ID	TYPE	N_FIELDS	PAGE_NO	SPACE
 11	ID_IND	11	3	1	302	0
 12	FOR_IND	11	0	1	303	0
 13	REF_IND	11	0	1	304	0
 14	ID_IND	12	3	2	305	0
-SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS;
 TABLE_ID	NAME	POS	MTYPE	PRTYPE	LEN
 11	ID	0	1	524292	0
 11	FOR_NAME	1	1	524292	0
@@ -18,7 +15,7 @@ TABLE_ID	NAME	POS	MTYPE	PRTYPE	LEN
 12	POS	1	6	0	4
 12	FOR_COL_NAME	2	1	524292	0
 12	REF_COL_NAME	3	1	524292	0
-SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FIELDS;
+SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FIELDS WHERE name NOT IN ('database_name', 'table_name', 'index_name', 'stat_name');
 INDEX_ID	NAME	POS
 11	ID	0
 12	FOR_NAME	0
@@ -27,11 +24,14 @@ INDEX_ID	NAME	POS
 14	POS	1
 SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN;
 ID	FOR_NAME	REF_NAME	N_COLS	TYPE
+mysql/innodb_index_stats_ibfk_1	mysql/innodb_index_stats	mysql/innodb_table_stats	2	0
 SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS;
 ID	FOR_COL_NAME	REF_COL_NAME	POS
+mysql/innodb_index_stats_ibfk_1	database_name	database_name	0
+mysql/innodb_index_stats_ibfk_1	table_name	table_name	1
 SELECT count(*) FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS;
 count(*)
-2
+4
 CREATE TABLE parent (id INT NOT NULL,
 PRIMARY KEY (id)) ENGINE=INNODB;
 CREATE TABLE child (id INT, parent_id INT,
@@ -41,9 +41,12 @@ FOREIGN KEY (parent_id) REFERENCES paren
 ON DELETE CASCADE) ENGINE=INNODB;
 SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN;
 ID	FOR_NAME	REF_NAME	N_COLS	TYPE
+mysql/innodb_index_stats_ibfk_1	mysql/innodb_index_stats	mysql/innodb_table_stats	2	0
 test/constraint_test	test/child	test/parent	1	1
 SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS;
 ID	FOR_COL_NAME	REF_COL_NAME	POS
+mysql/innodb_index_stats_ibfk_1	database_name	database_name	0
+mysql/innodb_index_stats_ibfk_1	table_name	table_name	1
 test/constraint_test	parent_id	id	0
 INSERT INTO parent VALUES(1);
 SELECT name, num_rows, ref_count 
@@ -55,6 +58,8 @@ SELECT NAME, FLAG, N_COLS, SPACE FROM IN
 NAME	FLAG	N_COLS	SPACE
 SYS_FOREIGN	0	7	0
 SYS_FOREIGN_COLS	0	7	0
+mysql/innodb_index_stats	1	11	0
+mysql/innodb_table_stats	1	9	0
 test/child	1	5	0
 test/parent	1	4	0
 SELECT name, n_fields
@@ -91,9 +96,12 @@ FOREIGN KEY (id, parent_id) REFERENCES p
 ON DELETE CASCADE) ENGINE=INNODB;
 SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN;
 ID	FOR_NAME	REF_NAME	N_COLS	TYPE
+mysql/innodb_index_stats_ibfk_1	mysql/innodb_index_stats	mysql/innodb_table_stats	2	0
 test/constraint_test	test/child	test/parent	2	1
 SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS;
 ID	FOR_COL_NAME	REF_COL_NAME	POS
+mysql/innodb_index_stats_ibfk_1	database_name	database_name	0
+mysql/innodb_index_stats_ibfk_1	table_name	table_name	1
 test/constraint_test	id	id	0
 test/constraint_test	parent_id	newid	1
 INSERT INTO parent VALUES(1, 9);

=== modified file 'mysql-test/suite/innodb/r/innodb-zip.result'
--- a/mysql-test/suite/innodb/r/innodb-zip.result	revid:olav.sandstaa@stripped
+++ b/mysql-test/suite/innodb/r/innodb-zip.result	revid:vasil.dimov@stripped
@@ -63,8 +63,7 @@ row_format=compressed;
 create table t14(a int primary key) engine=innodb key_block_size=9;
 Warnings:
 Warning	1478	InnoDB: ignoring KEY_BLOCK_SIZE=9.
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
+SELECT table_schema, table_name, row_format FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql';
 table_schema	table_name	row_format
 test	t0	Compact
 test	t00	Compact
@@ -85,18 +84,15 @@ test	t9	Compact
 drop table t0,t00,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14;
 alter table t1 key_block_size=0;
 alter table t1 row_format=dynamic;
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
+SELECT table_schema, table_name, row_format FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql';
 table_schema	table_name	row_format
 test	t1	Dynamic
 alter table t1 row_format=compact;
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
+SELECT table_schema, table_name, row_format FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql';
 table_schema	table_name	row_format
 test	t1	Compact
 alter table t1 row_format=redundant;
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
+SELECT table_schema, table_name, row_format FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql';
 table_schema	table_name	row_format
 test	t1	Redundant
 drop table t1;
@@ -115,8 +111,7 @@ rollback;
 select a,left(b,40) from t1 natural join t2;
 a	left(b,40)
 1	1abcdefghijklmnopqrstuvwxyzAAAAAAAAAAAAA
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
+SELECT table_schema, table_name, row_format FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql';
 table_schema	table_name	row_format
 test	t1	Compressed
 test	t2	Compact
@@ -207,8 +202,7 @@ create table t8 (id int primary key) eng
 create table t9 (id int primary key) engine = innodb row_format = dynamic;
 create table t10(id int primary key) engine = innodb row_format = compact;
 create table t11(id int primary key) engine = innodb row_format = redundant;
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
+SELECT table_schema, table_name, row_format FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql';
 table_schema	table_name	row_format
 test	t1	Compact
 test	t10	Compact
@@ -246,8 +240,7 @@ Warning	1478	InnoDB: cannot specify ROW_
 Error	1005	Can't create table 'test.t4' (errno: 1478)
 create table t5 (id int primary key) engine = innodb
 key_block_size = 8 row_format = default;
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
+SELECT table_schema, table_name, row_format FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql';
 table_schema	table_name	row_format
 test	t1	Compressed
 test	t5	Compressed
@@ -276,8 +269,7 @@ Level	Code	Message
 Warning	1478	InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
 Warning	1478	InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
 Error	1005	Can't create table 'test.t2' (errno: 1478)
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
+SELECT table_schema, table_name, row_format FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql';
 table_schema	table_name	row_format
 set global innodb_file_per_table = off;
 create table t1 (id int primary key) engine = innodb key_block_size = 1;
@@ -324,8 +316,7 @@ Warning	1478	InnoDB: ROW_FORMAT=DYNAMIC 
 Error	1005	Can't create table 'test.t7' (errno: 1478)
 create table t8 (id int primary key) engine = innodb row_format = compact;
 create table t9 (id int primary key) engine = innodb row_format = redundant;
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
+SELECT table_schema, table_name, row_format FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql';
 table_schema	table_name	row_format
 test	t8	Compact
 test	t9	Redundant
@@ -376,8 +367,7 @@ Warning	1478	InnoDB: ROW_FORMAT=DYNAMIC 
 Error	1005	Can't create table 'test.t7' (errno: 1478)
 create table t8 (id int primary key) engine = innodb row_format = compact;
 create table t9 (id int primary key) engine = innodb row_format = redundant;
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
+SELECT table_schema, table_name, row_format FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql';
 table_schema	table_name	row_format
 test	t8	Compact
 test	t9	Redundant

=== modified file 'mysql-test/suite/innodb/r/innodb_bug57904.result'
--- a/mysql-test/suite/innodb/r/innodb_bug57904.result	revid:olav.sandstaa@stripped
+++ b/mysql-test/suite/innodb/r/innodb_bug57904.result	revid:vasil.dimov@stripped
@@ -13,7 +13,8 @@ INDEX (customer_id),
 FOREIGN KEY (customer_id)
 REFERENCES customer(id)
 ) ENGINE=INNODB;
-SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS;
+SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS
+WHERE table_name = 'product_order';
 CONSTRAINT_CATALOG	def
 CONSTRAINT_SCHEMA	test
 CONSTRAINT_NAME	product_order_ibfk_1

=== modified file 'mysql-test/suite/innodb/t/innodb-system-table-view.test'
--- a/mysql-test/suite/innodb/t/innodb-system-table-view.test	revid:olav.sandstaa@stripped
+++ b/mysql-test/suite/innodb/t/innodb-system-table-view.test	revid:vasil.dimov@stripped
@@ -4,13 +4,25 @@
 
 --source include/have_innodb.inc
 
-SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES;
+# The IDs of mysql.innodb_table_stats and mysql.innodb_index_stats are
+# unpredictable, probably they on whether mtr has created the database for
+# this test from scratch or is using a previously created database where
+# those tables have been dropped and recreated. If we can force mtr to
+# use a freshly created database for this test then the following
+# complications can be removed and the test be reverted to the version
+# it was before the patch that adds this comment.
+--let table_stats_id = `SELECT table_id FROM information_schema.innodb_sys_tables WHERE name = 'mysql/innodb_table_stats'`
+--let index_stats_id = `SELECT table_id FROM information_schema.innodb_sys_tables WHERE name = 'mysql/innodb_index_stats'`
+
+--disable_query_log
+--eval SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE table_id NOT IN ($table_stats_id, $index_stats_id)
 
-SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES;
+--eval SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES WHERE table_id NOT IN ($table_stats_id, $index_stats_id)
 
-SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS;
+--eval SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS WHERE table_id NOT IN ($table_stats_id, $index_stats_id)
+--enable_query_log
 
-SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FIELDS;
+SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FIELDS WHERE name NOT IN ('database_name', 'table_name', 'index_name', 'stat_name');
 
 SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN;
 

=== modified file 'mysql-test/suite/innodb/t/innodb-zip.test'
--- a/mysql-test/suite/innodb/t/innodb-zip.test	revid:olav.sandstaa@stripped
+++ b/mysql-test/suite/innodb/t/innodb-zip.test	revid:vasil.dimov@stripped
@@ -5,6 +5,8 @@ let $format=`select @@innodb_file_format
 let $innodb_file_format_max_orig=`select @@innodb_file_format_max`;
 let $innodb_strict_mode_orig=`select @@session.innodb_strict_mode`;
 
+-- let $query_i_s = SELECT table_schema, table_name, row_format FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql'
+
 set session innodb_strict_mode=0;
 set global innodb_file_per_table=off;
 set global innodb_file_format=`0`;
@@ -39,20 +41,16 @@ create table t13(a int primary key) engi
 row_format=compressed;
 create table t14(a int primary key) engine=innodb key_block_size=9;
 
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
+-- eval $query_i_s
 
 drop table t0,t00,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14;
 alter table t1 key_block_size=0;
 alter table t1 row_format=dynamic;
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
+-- eval $query_i_s
 alter table t1 row_format=compact;
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
+-- eval $query_i_s
 alter table t1 row_format=redundant;
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
+-- eval $query_i_s
 drop table t1;
 
 create table t1(a int not null, b text, index(b(10))) engine=innodb
@@ -84,8 +82,7 @@ connection default;
 disconnect a;
 disconnect b;
 
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
+-- eval $query_i_s
 drop table t1,t2;
 
 # The following should fail in non-strict mode too.
@@ -195,8 +192,7 @@ create table t9 (id int primary key) eng
 create table t10(id int primary key) engine = innodb row_format = compact;
 create table t11(id int primary key) engine = innodb row_format = redundant;
 
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
+-- eval $query_i_s
 drop table t1, t3, t4, t5, t6, t7, t8, t9, t10, t11;
 
 #test different values of ROW_FORMAT with KEY_BLOCK_SIZE
@@ -221,8 +217,7 @@ show warnings;
 create table t5 (id int primary key) engine = innodb
 key_block_size = 8 row_format = default;
 
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
+-- eval $query_i_s
 drop table t1, t5;
 
 #test multiple errors
@@ -241,8 +236,7 @@ create table t2 (id int primary key) eng
 key_block_size = 9 row_format = dynamic;
 show warnings;
 
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
+-- eval $query_i_s
 
 #test valid values with innodb_file_per_table unset
 set global innodb_file_per_table = off;
@@ -271,8 +265,7 @@ show warnings;
 create table t8 (id int primary key) engine = innodb row_format = compact;
 create table t9 (id int primary key) engine = innodb row_format = redundant;
 
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
+-- eval $query_i_s
 drop table t8, t9;
 
 #test valid values with innodb_file_format unset
@@ -303,8 +296,7 @@ show warnings;
 create table t8 (id int primary key) engine = innodb row_format = compact;
 create table t9 (id int primary key) engine = innodb row_format = redundant;
 
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
+-- eval $query_i_s
 drop table t8, t9;
 
 eval set global innodb_file_per_table=$per_table;

=== modified file 'mysql-test/suite/innodb/t/innodb_bug11933790.test'
--- a/mysql-test/suite/innodb/t/innodb_bug11933790.test	revid:olav.sandstaa@stripped
+++ b/mysql-test/suite/innodb/t/innodb_bug11933790.test	revid:vasil.dimov@stripped
@@ -4,7 +4,6 @@
 #
 
 -- source include/have_innodb.inc
--- source suite/innodb/include/innodb_stats_bootstrap.inc
 
 call mtr.add_suppression("InnoDB: Error while trying to save table statistics for table .+bug11933790: Lock wait timeout");
 
@@ -16,12 +15,12 @@ SET SESSION innodb_analyze_is_persistent
 
 CREATE TABLE bug11933790 (c INT) ENGINE=INNODB;
 
-# add some records to innodb.table_stats
+# add some records to mysql.innodb_table_stats
 ANALYZE TABLE bug11933790;
 
 SET autocommit=0;
 
-# lock the records in innodb.table_stats
+# lock the records in mysql.innodb_table_stats
 SELECT * FROM mysql.innodb_table_stats FOR UPDATE;
 
 -- connect (con1,localhost,root,,)
@@ -45,5 +44,3 @@ ANALYZE TABLE bug11933790;
 COMMIT;
 
 DROP TABLE bug11933790;
-DROP TABLE mysql.innodb_index_stats;
-DROP TABLE mysql.innodb_table_stats;

=== modified file 'mysql-test/suite/innodb/t/innodb_bug57904.test'
--- a/mysql-test/suite/innodb/t/innodb_bug57904.test	revid:olav.sandstaa@stripped
+++ b/mysql-test/suite/innodb/t/innodb_bug57904.test	revid:vasil.dimov@stripped
@@ -19,7 +19,8 @@ CREATE TABLE product_order (no INT NOT N
 		REFERENCES customer(id)
 	) ENGINE=INNODB;
 
-query_vertical SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS;
+query_vertical SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS
+WHERE table_name = 'product_order';
 
 DROP TABLE product_order;
 DROP TABLE product;

=== modified file 'mysql-test/suite/innodb/t/innodb_bug60049.test'
--- a/mysql-test/suite/innodb/t/innodb_bug60049.test	revid:olav.sandstaa@stripped
+++ b/mysql-test/suite/innodb/t/innodb_bug60049.test	revid:vasil.dimov@stripped
@@ -5,6 +5,13 @@
 -- source include/not_embedded.inc
 -- source include/have_innodb.inc
 
+-- disable_query_log
+let $create1 = query_get_value(SHOW CREATE TABLE mysql.innodb_table_stats, Create Table, 1);
+let $create2 = query_get_value(SHOW CREATE TABLE mysql.innodb_index_stats, Create Table, 1);
+DROP TABLE mysql.innodb_index_stats;
+DROP TABLE mysql.innodb_table_stats;
+-- enable_query_log
+
 CREATE TABLE t(a INT)ENGINE=InnoDB;
 RENAME TABLE t TO u;
 DROP TABLE u;
@@ -37,3 +44,8 @@ EOF
 -- exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
 -- enable_reconnect
 -- source include/wait_until_connected_again.inc
+
+-- disable_query_log
+USE mysql;
+eval $create1;
+eval $create2;

=== modified file 'mysql-test/suite/innodb/t/innodb_stats.test'
--- a/mysql-test/suite/innodb/t/innodb_stats.test	revid:olav.sandstaa@stripped
+++ b/mysql-test/suite/innodb/t/innodb_stats.test	revid:vasil.dimov@stripped
@@ -3,7 +3,6 @@
 #
 
 -- source include/have_innodb.inc
--- source suite/innodb/include/innodb_stats_bootstrap.inc
 
 -- disable_warnings
 -- disable_query_log
@@ -62,6 +61,3 @@ CREATE TABLE test_innodb_stats (
 
 -- disable_query_log
 DROP TABLE test_innodb_stats;
-
-DROP TABLE mysql.innodb_index_stats;
-DROP TABLE mysql.innodb_table_stats;

=== modified file 'mysql-test/suite/innodb/t/innodb_stats_drop_locked.test'
--- a/mysql-test/suite/innodb/t/innodb_stats_drop_locked.test	revid:olav.sandstaa@stripped
+++ b/mysql-test/suite/innodb/t/innodb_stats_drop_locked.test	revid:vasil.dimov@stripped
@@ -4,7 +4,6 @@
 #
 
 -- source include/have_innodb.inc
--- source suite/innodb/include/innodb_stats_bootstrap.inc
 
 -- disable_warnings
 -- disable_query_log
@@ -57,7 +56,3 @@ WHERE table_name='innodb_stats_drop_lock
 
 SELECT table_name FROM mysql.innodb_index_stats
 WHERE table_name='innodb_stats_drop_locked';
-
--- disable_query_log
-DROP TABLE mysql.innodb_index_stats;
-DROP TABLE mysql.innodb_table_stats;

=== modified file 'mysql-test/suite/perfschema/r/pfs_upgrade.result'
--- a/mysql-test/suite/perfschema/r/pfs_upgrade.result	revid:olav.sandstaa@stripped
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade.result	revid:vasil.dimov@stripped
@@ -8,40 +8,40 @@ use performance_schema;
 show tables like "user_table";
 Tables_in_performance_schema (user_table)
 user_table
-ERROR 1050 (42S01) at line 70: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 94: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 118: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 142: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 155: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 168: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 180: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 189: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 200: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 212: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 221: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 235: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 245: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 255: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 264: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 272: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 281: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 291: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 299: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 344: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 388: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 467: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 487: Table 'threads' already exists
-ERROR 1050 (42S01) at line 502: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 517: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 532: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 545: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 557: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 600: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 643: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 686: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 718: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 749: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1644 (HY000) at line 1169: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 96: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 120: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 144: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 168: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 181: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 194: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 206: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 215: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 226: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 238: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 247: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 261: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 271: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 281: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 290: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 298: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 307: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 317: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 325: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 370: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 414: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 493: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 513: Table 'threads' already exists
+ERROR 1050 (42S01) at line 528: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 543: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 558: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 571: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 583: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 626: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 669: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 712: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 744: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 775: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1644 (HY000) at line 1195: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 show tables like "user_table";
 Tables_in_performance_schema (user_table)
@@ -54,40 +54,40 @@ use performance_schema;
 show tables like "user_view";
 Tables_in_performance_schema (user_view)
 user_view
-ERROR 1050 (42S01) at line 70: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 94: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 118: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 142: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 155: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 168: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 180: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 189: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 200: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 212: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 221: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 235: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 245: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 255: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 264: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 272: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 281: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 291: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 299: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 344: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 388: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 467: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 487: Table 'threads' already exists
-ERROR 1050 (42S01) at line 502: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 517: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 532: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 545: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 557: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 600: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 643: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 686: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 718: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 749: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1644 (HY000) at line 1169: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 96: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 120: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 144: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 168: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 181: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 194: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 206: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 215: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 226: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 238: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 247: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 261: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 271: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 281: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 290: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 298: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 307: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 317: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 325: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 370: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 414: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 493: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 513: Table 'threads' already exists
+ERROR 1050 (42S01) at line 528: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 543: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 558: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 571: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 583: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 626: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 669: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 712: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 744: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 775: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1644 (HY000) at line 1195: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 show tables like "user_view";
 Tables_in_performance_schema (user_view)
@@ -98,40 +98,40 @@ drop view test.user_view;
 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 70: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 94: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 118: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 142: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 155: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 168: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 180: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 189: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 200: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 212: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 221: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 235: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 245: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 255: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 264: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 272: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 281: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 291: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 299: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 344: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 388: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 467: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 487: Table 'threads' already exists
-ERROR 1050 (42S01) at line 502: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 517: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 532: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 545: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 557: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 600: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 643: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 686: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 718: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 749: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1644 (HY000) at line 1169: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 96: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 120: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 144: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 168: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 181: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 194: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 206: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 215: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 226: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 238: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 247: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 261: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 271: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 281: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 290: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 298: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 307: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 317: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 325: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 370: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 414: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 493: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 513: Table 'threads' already exists
+ERROR 1050 (42S01) at line 528: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 543: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 558: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 571: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 583: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 626: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 669: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 712: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 744: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 775: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1644 (HY000) at line 1195: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.proc where db='performance_schema';
 name
@@ -142,40 +142,40 @@ drop procedure test.user_proc;
 create function test.user_func() returns integer
 return 0;
 update mysql.proc set db='performance_schema' where name='user_func';
-ERROR 1050 (42S01) at line 70: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 94: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 118: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 142: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 155: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 168: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 180: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 189: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 200: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 212: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 221: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 235: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 245: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 255: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 264: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 272: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 281: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 291: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 299: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 344: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 388: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 467: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 487: Table 'threads' already exists
-ERROR 1050 (42S01) at line 502: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 517: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 532: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 545: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 557: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 600: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 643: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 686: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 718: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 749: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1644 (HY000) at line 1169: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 96: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 120: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 144: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 168: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 181: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 194: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 206: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 215: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 226: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 238: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 247: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 261: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 271: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 281: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 290: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 298: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 307: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 317: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 325: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 370: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 414: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 493: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 513: Table 'threads' already exists
+ERROR 1050 (42S01) at line 528: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 543: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 558: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 571: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 583: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 626: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 669: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 712: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 744: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 775: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1644 (HY000) at line 1195: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.proc where db='performance_schema';
 name
@@ -186,40 +186,40 @@ drop function test.user_func;
 create event test.user_event on schedule every 1 day do
 select "not supposed to be here";
 update mysql.event set db='performance_schema' where name='user_event';
-ERROR 1050 (42S01) at line 70: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 94: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 118: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 142: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 155: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 168: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 180: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 189: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 200: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 212: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 221: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 235: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 245: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 255: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 264: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 272: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 281: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 291: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 299: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 344: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 388: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 467: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 487: Table 'threads' already exists
-ERROR 1050 (42S01) at line 502: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 517: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 532: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 545: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 557: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 600: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 643: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 686: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 718: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 749: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1644 (HY000) at line 1169: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 96: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 120: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 144: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 168: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 181: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 194: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 206: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 215: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 226: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 238: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 247: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 261: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 271: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 281: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 290: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 298: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 307: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 317: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 325: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 370: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 414: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 493: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 513: Table 'threads' already exists
+ERROR 1050 (42S01) at line 528: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 543: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 558: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 571: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 583: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 626: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 669: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 712: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 744: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 775: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1644 (HY000) at line 1195: 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/t/system_mysql_db_fix40123.test'
--- a/mysql-test/t/system_mysql_db_fix40123.test	revid:olav.sandstaa@stripped
+++ b/mysql-test/t/system_mysql_db_fix40123.test	revid:vasil.dimov@stripped
@@ -72,7 +72,7 @@ CREATE TABLE time_zone_leap_second (   T
 -- disable_query_log
 
 # Drop all tables created by this test
-DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv, procs_priv, servers, help_category, help_keyword, help_relation, help_topic, proc, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type, general_log, slow_log, event, ndb_binlog_index, proxies_priv, slave_master_info, slave_relay_log_info;
+DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv, procs_priv, servers, help_category, help_keyword, help_relation, help_topic, proc, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type, general_log, slow_log, event, ndb_binlog_index, proxies_priv, slave_master_info, slave_relay_log_info, innodb_index_stats, innodb_table_stats;
 
 -- enable_query_log
 

=== modified file 'mysql-test/t/system_mysql_db_fix50030.test'
--- a/mysql-test/t/system_mysql_db_fix50030.test	revid:olav.sandstaa@stripped
+++ b/mysql-test/t/system_mysql_db_fix50030.test	revid:vasil.dimov@stripped
@@ -78,7 +78,7 @@ INSERT INTO servers VALUES ('test','loca
 -- disable_query_log
 
 # Drop all tables created by this test
-DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv, procs_priv, servers, help_category, help_keyword, help_relation, help_topic, proc, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type, general_log, slow_log, event, ndb_binlog_index, proxies_priv, slave_master_info, slave_relay_log_info;
+DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv, procs_priv, servers, help_category, help_keyword, help_relation, help_topic, proc, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type, general_log, slow_log, event, ndb_binlog_index, proxies_priv, slave_master_info, slave_relay_log_info, innodb_index_stats, innodb_table_stats;
 
 -- enable_query_log
 

=== modified file 'mysql-test/t/system_mysql_db_fix50117.test'
--- a/mysql-test/t/system_mysql_db_fix50117.test	revid:olav.sandstaa@stripped
+++ b/mysql-test/t/system_mysql_db_fix50117.test	revid:vasil.dimov@stripped
@@ -97,7 +97,7 @@ CREATE TABLE IF NOT EXISTS ndb_binlog_in
 -- disable_query_log
 
 # Drop all tables created by this test
-DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv, procs_priv, servers, help_category, help_keyword, help_relation, help_topic, proc, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type, general_log, slow_log, event, ndb_binlog_index, proxies_priv, slave_master_info, slave_relay_log_info;
+DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv, procs_priv, servers, help_category, help_keyword, help_relation, help_topic, proc, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type, general_log, slow_log, event, ndb_binlog_index, proxies_priv, slave_master_info, slave_relay_log_info, innodb_index_stats, innodb_table_stats;
 
 -- enable_query_log
 

=== modified file 'scripts/mysql_install_db.pl.in'
--- a/scripts/mysql_install_db.pl.in	revid:olav.sandstaa@stripped
+++ b/scripts/mysql_install_db.pl.in	revid:vasil.dimov@stripped
@@ -418,7 +418,6 @@ my $mysqld_install_cmd_line = quote_opti
                                             "--bootstrap",
                                             "--basedir=$opt->{basedir}",
                                             "--datadir=$opt->{ldata}",
-                                            "--skip-innodb",
                                             "--skip-bdb",
                                             "--skip-ndbcluster",
                                             "--max_allowed_packet=8M",

=== modified file 'scripts/mysql_install_db.sh'
--- a/scripts/mysql_install_db.sh	revid:olav.sandstaa@stripped
+++ b/scripts/mysql_install_db.sh	revid:vasil.dimov@stripped
@@ -388,7 +388,7 @@ fi
 # Configure mysqld command line
 mysqld_bootstrap="${MYSQLD_BOOTSTRAP-$mysqld}"
 mysqld_install_cmd_line="$mysqld_bootstrap $defaults $mysqld_opt --bootstrap \
-  --basedir=$basedir --datadir=$ldata --log-warnings=0 --loose-skip-innodb \
+  --basedir=$basedir --datadir=$ldata --log-warnings=0 \
   --loose-skip-ndbcluster $args --max_allowed_packet=8M \
   --default-storage-engine=myisam \
   --net_buffer_length=16K"

=== modified file 'scripts/mysql_system_tables.sql'
--- a/scripts/mysql_system_tables.sql	revid:olav.sandstaa@stripped
+++ b/scripts/mysql_system_tables.sql	revid:vasil.dimov@stripped
@@ -104,6 +104,34 @@ CREATE TABLE IF NOT EXISTS slave_relay_l
 
 CREATE TABLE IF NOT EXISTS slave_master_info (Master_id INTEGER UNSIGNED NOT NULL, Number_of_lines INTEGER UNSIGNED NOT NULL COMMENT 'Number of lines in the file.', Master_log_name TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'The name of the master binary log currently being read from the master.', Master_log_pos BIGINT UNSIGNED NOT NULL COMMENT 'The master log position of the last read event.', Host TEXT CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The host name of the master.', User_name TEXT CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The user name used to connect to the master.', User_password TEXT CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The password used to connect to the master.', Port INTEGER UNSIGNED NOT NULL COMMENT 'The network port used to connect to the master.', Connect_retry INTEGER UNSIGNED NOT NULL COMMENT 'The period (in seconds) that the slave will wait before trying to reconnect to the master.', Enabled_ssl BOOLEAN NOT NULL COMMENT 'Ind
 icates whether the server supports SSL connections.', Ssl_ca TEXT CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The file used for the Certificate Authority (CA) certificate.', Ssl_capath TEXT CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The path to the Certificate Authority (CA) certificates.', Ssl_cert TEXT CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The name of the SSL certificate file.', Ssl_cipher TEXT CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The name of the cipher in use for the SSL connection.', Ssl_key TEXT CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The name of the SSL key file.', Ssl_verify_server_cert BOOLEAN NOT NULL COMMENT 'Whether to verify the server certificate.', Heartbeat FLOAT NOT NULL COMMENT '', Bind TEXT CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'Displays which interface is employed when connecting to the MySQL server', Ignored_server_ids TEXT CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The number of server IDs to be ignored, followed by the act
 ual server IDs', Uuid TEXT CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The master server uuid.', Retry_count BIGINT UNSIGNED NOT NULL COMMENT 'Number of reconnect attempts, to the master, before giving up.', PRIMARY KEY(Master_id)) ENGINE=MYISAM DEFAULT CHARSET=utf8 COMMENT 'Master Information';
 
+CREATE TABLE IF NOT EXISTS innodb_table_stats (
+	database_name			VARCHAR(64) NOT NULL,
+	table_name			VARCHAR(64) NOT NULL,
+	stats_timestamp			TIMESTAMP NOT NULL,
+	n_rows				BIGINT UNSIGNED NOT NULL,
+	clustered_index_size		BIGINT UNSIGNED NOT NULL,
+	sum_of_other_index_sizes	BIGINT UNSIGNED NOT NULL,
+	PRIMARY KEY (database_name, table_name)
+) ENGINE=INNODB DEFAULT CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS innodb_index_stats (
+	database_name			VARCHAR(64) NOT NULL,
+	table_name			VARCHAR(64) NOT NULL,
+	index_name			VARCHAR(64) NOT NULL,
+	stat_timestamp			TIMESTAMP NOT NULL,
+	/* there are at least:
+	stat_name='size'
+	stat_name='n_leaf_pages'
+	stat_name='n_diff_pfx%' */
+	stat_name			VARCHAR(64) NOT NULL,
+	stat_value			BIGINT UNSIGNED NOT NULL,
+	sample_size			BIGINT UNSIGNED,
+	stat_description		VARCHAR(1024) NOT NULL,
+	PRIMARY KEY (database_name, table_name, index_name, stat_name),
+	FOREIGN KEY (database_name, table_name)
+	  REFERENCES innodb_table_stats (database_name, table_name)
+) ENGINE=INNODB DEFAULT CHARSET=utf8;
+
 --
 -- PERFORMANCE SCHEMA INSTALLATION
 -- Note that this script is also reused by mysql_upgrade,

=== removed directory 'storage/innobase/scripts'
=== removed file 'storage/innobase/scripts/persistent_storage.sql'
--- a/storage/innobase/scripts/persistent_storage.sql	revid:olav.sandstaa@stripped
+++ b/storage/innobase/scripts/persistent_storage.sql	1970-01-01 00:00:00 +0000
@@ -1,29 +0,0 @@
-DROP TABLE IF EXISTS mysql.innodb_table_stats;
-CREATE TABLE mysql.innodb_table_stats (
-	database_name			VARCHAR(64) NOT NULL,
-	table_name			VARCHAR(64) NOT NULL,
-	stats_timestamp			TIMESTAMP NOT NULL,
-	n_rows				BIGINT UNSIGNED NOT NULL,
-	clustered_index_size		BIGINT UNSIGNED NOT NULL,
-	sum_of_other_index_sizes	BIGINT UNSIGNED NOT NULL,
-	PRIMARY KEY (database_name, table_name)
-) ENGINE=INNODB DEFAULT CHARSET=utf8;
-
-DROP TABLE IF EXISTS mysql.innodb_index_stats;
-CREATE TABLE mysql.innodb_index_stats (
-	database_name			VARCHAR(64) NOT NULL,
-	table_name			VARCHAR(64) NOT NULL,
-	index_name			VARCHAR(64) NOT NULL,
-	stat_timestamp			TIMESTAMP NOT NULL,
-	/* there are at least:
-	stat_name='size'
-	stat_name='n_leaf_pages'
-	stat_name='n_diff_pfx%' */
-	stat_name			VARCHAR(64) NOT NULL,
-	stat_value			BIGINT UNSIGNED NOT NULL,
-	sample_size			BIGINT UNSIGNED,
-	stat_description		VARCHAR(1024) NOT NULL,
-	PRIMARY KEY (database_name, table_name, index_name, stat_name),
-	FOREIGN KEY (database_name, table_name)
-	  REFERENCES mysql.innodb_table_stats (database_name, table_name)
-) ENGINE=INNODB DEFAULT CHARSET=utf8;

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (vasil.dimov:3169 to 3170) vasil.dimov9 Jun