| 
					
					
						
							
						
					
					
				 | 
				@ -22,6 +22,15 @@ | 
			
		
		
	
		
			
				 | 
				 | 
				--source include/have_perfschema.inc | 
				 | 
				 | 
				--source include/have_perfschema.inc | 
			
		
		
	
		
			
				 | 
				 | 
				--source include/have_lowercase0.inc | 
				 | 
				 | 
				--source include/have_lowercase0.inc | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				# Some initial settings + Preemptive cleanup | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				let $MYSQLD_DATADIR= `SELECT @@datadir`; | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				let $err_file= $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err; | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				let $out_file= $MYSQLTEST_VARDIR/tmp/pfs_upgrade.out; | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				--error 0,1 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				--remove_file $out_file | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				--error 0,1 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				--remove_file $err_file | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				--disable_warnings | 
				 | 
				 | 
				--disable_warnings | 
			
		
		
	
		
			
				 | 
				 | 
				drop table if exists test.user_table; | 
				 | 
				 | 
				drop table if exists test.user_table; | 
			
		
		
	
		
			
				 | 
				 | 
				drop procedure if exists test.user_proc; | 
				 | 
				 | 
				drop procedure if exists test.user_proc; | 
			
		
		
	
	
		
			
				| 
					
					
					
						
							
						
					
				 | 
				@ -29,22 +38,20 @@ drop function if exists test.user_func; | 
			
		
		
	
		
			
				 | 
				 | 
				drop event if exists test.user_event; | 
				 | 
				 | 
				drop event if exists test.user_event; | 
			
		
		
	
		
			
				 | 
				 | 
				--enable_warnings | 
				 | 
				 | 
				--enable_warnings | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				--echo "Testing mysql_upgrade with TABLE performance_schema.user_table" | 
				 | 
				 | 
				--echo "Testing mysql_upgrade with TABLE performance_schema.user_table" | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				create table test.user_table(a int); | 
				 | 
				 | 
				create table test.user_table(a int); | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				let $MYSQLD_DATADIR= `SELECT @@datadir`; | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				--error 0,1 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				--remove_file $MYSQLD_DATADIR/performance_schema/user_table.frm | 
			
		
		
	
		
			
				 | 
				 | 
				--copy_file $MYSQLD_DATADIR/test/user_table.frm $MYSQLD_DATADIR/performance_schema/user_table.frm | 
				 | 
				 | 
				--copy_file $MYSQLD_DATADIR/test/user_table.frm $MYSQLD_DATADIR/performance_schema/user_table.frm | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				# Make sure the table is visible | 
				 | 
				 | 
				# Make sure the table is visible | 
			
		
		
	
		
			
				 | 
				 | 
				use performance_schema; | 
				 | 
				 | 
				use performance_schema; | 
			
		
		
	
		
			
				 | 
				 | 
				show tables like "user_table"; | 
				 | 
				 | 
				show tables like "user_table"; | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				--error 1 | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				--exec $MYSQL_UPGRADE --skip-verbose > $MYSQLTEST_VARDIR/tmp/pfs_upgrade.out 2> $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				# Verify that mysql_upgrade complained about the performance_schema | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				--cat_file $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				--source suite/perfschema/include/upgrade_check.inc | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				# Make sure the table is still visible | 
				 | 
				 | 
				# Make sure the table is still visible | 
			
		
		
	
		
			
				 | 
				 | 
				show tables like "user_table"; | 
				 | 
				 | 
				show tables like "user_table"; | 
			
		
		
	
	
		
			
				| 
					
					
					
						
							
						
					
				 | 
				@ -54,22 +61,20 @@ use test; | 
			
		
		
	
		
			
				 | 
				 | 
				--remove_file $MYSQLD_DATADIR/performance_schema/user_table.frm | 
				 | 
				 | 
				--remove_file $MYSQLD_DATADIR/performance_schema/user_table.frm | 
			
		
		
	
		
			
				 | 
				 | 
				drop table test.user_table; | 
				 | 
				 | 
				drop table test.user_table; | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				--echo "Testing mysql_upgrade with VIEW performance_schema.user_view" | 
				 | 
				 | 
				--echo "Testing mysql_upgrade with VIEW performance_schema.user_view" | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				create view test.user_view as select "Not supposed to be here"; | 
				 | 
				 | 
				create view test.user_view as select "Not supposed to be here"; | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				let $MYSQLD_DATADIR= `SELECT @@datadir`; | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				--error 0,1 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				--remove_file $MYSQLD_DATADIR/performance_schema/user_view.frm | 
			
		
		
	
		
			
				 | 
				 | 
				--copy_file $MYSQLD_DATADIR/test/user_view.frm $MYSQLD_DATADIR/performance_schema/user_view.frm | 
				 | 
				 | 
				--copy_file $MYSQLD_DATADIR/test/user_view.frm $MYSQLD_DATADIR/performance_schema/user_view.frm | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				# Make sure the view is visible | 
				 | 
				 | 
				# Make sure the view is visible | 
			
		
		
	
		
			
				 | 
				 | 
				use performance_schema; | 
				 | 
				 | 
				use performance_schema; | 
			
		
		
	
		
			
				 | 
				 | 
				show tables like "user_view"; | 
				 | 
				 | 
				show tables like "user_view"; | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				--error 1 | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				--exec $MYSQL_UPGRADE --skip-verbose > $MYSQLTEST_VARDIR/tmp/pfs_upgrade.out 2> $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				# Verify that mysql_upgrade complained about the performance_schema | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				--cat_file $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				--source suite/perfschema/include/upgrade_check.inc | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				# Make sure the view is still visible | 
				 | 
				 | 
				# Make sure the view is still visible | 
			
		
		
	
		
			
				 | 
				 | 
				show tables like "user_view"; | 
				 | 
				 | 
				show tables like "user_view"; | 
			
		
		
	
	
		
			
				| 
					
					
					
						
							
						
					
				 | 
				@ -79,6 +84,7 @@ use test; | 
			
		
		
	
		
			
				 | 
				 | 
				--remove_file $MYSQLD_DATADIR/performance_schema/user_view.frm | 
				 | 
				 | 
				--remove_file $MYSQLD_DATADIR/performance_schema/user_view.frm | 
			
		
		
	
		
			
				 | 
				 | 
				drop view test.user_view; | 
				 | 
				 | 
				drop view test.user_view; | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				--echo "Testing mysql_upgrade with PROCEDURE performance_schema.user_proc" | 
				 | 
				 | 
				--echo "Testing mysql_upgrade with PROCEDURE performance_schema.user_proc" | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				create procedure test.user_proc() | 
				 | 
				 | 
				create procedure test.user_proc() | 
			
		
		
	
	
		
			
				| 
					
					
					
						
							
						
					
				 | 
				@ -86,17 +92,14 @@ create procedure test.user_proc() | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				update mysql.proc set db='performance_schema' where name='user_proc'; | 
				 | 
				 | 
				update mysql.proc set db='performance_schema' where name='user_proc'; | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				--error 1 | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				--exec $MYSQL_UPGRADE --skip-verbose > $MYSQLTEST_VARDIR/tmp/pfs_upgrade.out 2> $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				# Verify that mysql_upgrade complained about the performance_schema | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				--cat_file $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				--source suite/perfschema/include/upgrade_check.inc | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				select name from mysql.proc where db='performance_schema'; | 
				 | 
				 | 
				select name from mysql.proc where db='performance_schema'; | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				update mysql.proc set db='test' where name='user_proc'; | 
				 | 
				 | 
				update mysql.proc set db='test' where name='user_proc'; | 
			
		
		
	
		
			
				 | 
				 | 
				drop procedure test.user_proc; | 
				 | 
				 | 
				drop procedure test.user_proc; | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				--echo "Testing mysql_upgrade with FUNCTION performance_schema.user_func" | 
				 | 
				 | 
				--echo "Testing mysql_upgrade with FUNCTION performance_schema.user_func" | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				create function test.user_func() returns integer | 
				 | 
				 | 
				create function test.user_func() returns integer | 
			
		
		
	
	
		
			
				| 
					
					
					
						
							
						
					
				 | 
				@ -104,17 +107,14 @@ create function test.user_func() returns integer | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				update mysql.proc set db='performance_schema' where name='user_func'; | 
				 | 
				 | 
				update mysql.proc set db='performance_schema' where name='user_func'; | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				--error 1 | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				--exec $MYSQL_UPGRADE --skip-verbose > $MYSQLTEST_VARDIR/tmp/pfs_upgrade.out 2> $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				# Verify that mysql_upgrade complained about the performance_schema | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				--cat_file $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				--source suite/perfschema/include/upgrade_check.inc | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				select name from mysql.proc where db='performance_schema'; | 
				 | 
				 | 
				select name from mysql.proc where db='performance_schema'; | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				update mysql.proc set db='test' where name='user_func'; | 
				 | 
				 | 
				update mysql.proc set db='test' where name='user_func'; | 
			
		
		
	
		
			
				 | 
				 | 
				drop function test.user_func; | 
				 | 
				 | 
				drop function test.user_func; | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				--echo "Testing mysql_upgrade with EVENT performance_schema.user_event" | 
				 | 
				 | 
				--echo "Testing mysql_upgrade with EVENT performance_schema.user_event" | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				create event test.user_event on schedule every 1 day do | 
				 | 
				 | 
				create event test.user_event on schedule every 1 day do | 
			
		
		
	
	
		
			
				| 
					
					
					
						
							
						
					
				 | 
				@ -122,17 +122,10 @@ create event test.user_event on schedule every 1 day do | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				update mysql.event set db='performance_schema' where name='user_event'; | 
				 | 
				 | 
				update mysql.event set db='performance_schema' where name='user_event'; | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				--error 1 | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				--exec $MYSQL_UPGRADE --skip-verbose > $MYSQLTEST_VARDIR/tmp/pfs_upgrade.out 2> $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				# Verify that mysql_upgrade complained about the performance_schema | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				--cat_file $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				--source suite/perfschema/include/upgrade_check.inc | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				select name from mysql.event where db='performance_schema'; | 
				 | 
				 | 
				select name from mysql.event where db='performance_schema'; | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				update mysql.event set db='test' where name='user_event'; | 
				 | 
				 | 
				update mysql.event set db='test' where name='user_event'; | 
			
		
		
	
		
			
				 | 
				 | 
				drop event test.user_event; | 
				 | 
				 | 
				drop event test.user_event; | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				--remove_file $MYSQLTEST_VARDIR/tmp/pfs_upgrade.out | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				--remove_file $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				 |