List:Commits« Previous MessageNext Message »
From:Marc Alff Date:April 28 2010 9:59am
Subject:bzr push into mysql-next-mr-wl5291 branch (marc.alff:3142 to 3143)
WL#5291
View as plain text  
 3143 Marc Alff	2010-04-28
      WL#5291 MySQL Install / Upgrade script format
      
      Implemented ';' as a delimiter, removed the previous code.
      Modified the pfs_upgrade test to cover different lowercase table names values.

    removed:
      mysql-test/suite/perfschema/t/pfs_upgrade.test
    added:
      mysql-test/suite/perfschema/include/pfs_upgrade.inc
      mysql-test/suite/perfschema/r/pfs_upgrade_lc0.result
      mysql-test/suite/perfschema/r/pfs_upgrade_lc1.result
      mysql-test/suite/perfschema/r/pfs_upgrade_lc2.result
      mysql-test/suite/perfschema/t/pfs_upgrade_lc0.test
      mysql-test/suite/perfschema/t/pfs_upgrade_lc1.test
      mysql-test/suite/perfschema/t/pfs_upgrade_lc2.test
    modified:
      scripts/mysql_system_tables.sql
      scripts/mysql_system_tables_fix.sql
      sql/sql_bootstrap.cc
 3142 Marc Alff	2010-04-28 [merge]
      Merge mysql-next-mr --> mysql-next-mr-wl5291

    removed:
      sql/mysql_priv.h.pp
      strings/dtoa.c
    added:
      include/sha2.h
      mysql-test/include/have_archive_plugin.inc
      mysql-test/include/have_blackhole_plugin.inc
      mysql-test/include/have_ssl_crypto_functs.inc
      mysql-test/r/archive_plugin.result
      mysql-test/r/blackhole_plugin.result
      mysql-test/r/func_digest.result
      mysql-test/r/have_ssl_is_yes_or_disabled_only.require
      mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result
      mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result
      mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result
      mysql-test/suite/rpl/r/rpl_temp_temporary.result
      mysql-test/suite/rpl/t/rpl_non_direct_mixed_mixing_engines.test
      mysql-test/suite/rpl/t/rpl_non_direct_row_mixing_engines.test
      mysql-test/suite/rpl/t/rpl_non_direct_stm_mixing_engines.test
      mysql-test/suite/rpl/t/rpl_temp_temporary.test
      mysql-test/t/archive_plugin-master.opt
      mysql-test/t/archive_plugin.test
      mysql-test/t/blackhole_plugin-master.opt
      mysql-test/t/blackhole_plugin.test
      mysql-test/t/func_digest.test
      sql/sha2.cc
      strings/dtoa.c
    modified:
      .bzrignore
      BUILD/choose_configure.sh
      Makefile.am
      client/mysql.cc
      client/mysqltest.cc
      cmake/abi_check.cmake
      cmake/install_macros.cmake
      cmake/libutils.cmake
      cmake/mysql_add_executable.cmake
      cmake/mysql_version.cmake
      cmake/os/WindowsCache.cmake
      cmake/plugin.cmake
      configure.cmake
      dbug/dbug.c
      include/Makefile.am
      include/my_global.h
      include/mysql/innodb_priv.h
      include/mysql/plugin_audit.h
      include/mysql_embed.h
      include/sslopt-case.h
      include/sslopt-longopts.h
      include/sslopt-vars.h
      include/violite.h
      libmysqld/CMakeLists.txt
      libmysqld/Makefile.am
      libmysqld/examples/Makefile.am
      libmysqld/lib_sql.cc
      mysql-test/collections/default.experimental
      mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test
      mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test
      mysql-test/extra/rpl_tests/rpl_innodb.test
      mysql-test/extra/rpl_tests/rpl_loaddata.test
      mysql-test/extra/rpl_tests/rpl_mixing_engines.test
      mysql-test/include/commit.inc
      mysql-test/include/ctype_utf8_table.inc
      mysql-test/r/commit_1innodb.result
      mysql-test/r/count_distinct.result
      mysql-test/r/ctype_cp932_binlog_stm.result
      mysql-test/r/func_encrypt_nossl.result
      mysql-test/r/func_group.result
      mysql-test/r/func_misc.result
      mysql-test/r/grant.result
      mysql-test/r/innodb_mysql_sync.result
      mysql-test/r/insert_notembedded.result
      mysql-test/r/lock_sync.result
      mysql-test/r/myisam.result
      mysql-test/r/mysqldump.result
      mysql-test/r/show_check.result
      mysql-test/r/sp-lock.result
      mysql-test/r/sp.result
      mysql-test/r/sp_sync.result
      mysql-test/r/trigger_notembedded.result
      mysql-test/suite/binlog/r/binlog_database.result
      mysql-test/suite/binlog/r/binlog_innodb_row.result
      mysql-test/suite/binlog/r/binlog_multi_engine.result
      mysql-test/suite/binlog/r/binlog_row_binlog.result
      mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result
      mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
      mysql-test/suite/binlog/r/binlog_stm_binlog.result
      mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
      mysql-test/suite/binlog/r/binlog_switch_inside_trans.result
      mysql-test/suite/binlog/t/binlog_switch_inside_trans.test
      mysql-test/suite/binlog/t/binlog_tmp_table.test
      mysql-test/suite/ndb/r/ndb_binlog_format.result
      mysql-test/suite/perfschema/r/dml_cond_instances.result
      mysql-test/suite/perfschema/r/dml_events_waits_current.result
      mysql-test/suite/perfschema/r/dml_events_waits_history.result
      mysql-test/suite/perfschema/r/dml_events_waits_history_long.result
      mysql-test/suite/perfschema/r/dml_ews_by_event_name.result
      mysql-test/suite/perfschema/r/dml_ews_by_instance.result
      mysql-test/suite/perfschema/r/dml_ews_by_thread_by_event_name.result
      mysql-test/suite/perfschema/r/dml_file_instances.result
      mysql-test/suite/perfschema/r/dml_file_summary_by_event_name.result
      mysql-test/suite/perfschema/r/dml_file_summary_by_instance.result
      mysql-test/suite/perfschema/r/dml_mutex_instances.result
      mysql-test/suite/perfschema/r/dml_performance_timers.result
      mysql-test/suite/perfschema/r/dml_processlist.result
      mysql-test/suite/perfschema/r/dml_rwlock_instances.result
      mysql-test/suite/perfschema/r/misc.result
      mysql-test/suite/perfschema/r/pfs_upgrade.result
      mysql-test/suite/perfschema/r/privilege.result
      mysql-test/suite/perfschema/r/tampered_perfschema_table1.result
      mysql-test/suite/perfschema/t/misc.test
      mysql-test/suite/perfschema/t/tampered_perfschema_table1.test
      mysql-test/suite/rpl/r/rpl_concurrency_error.result
      mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result
      mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result
      mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result
      mysql-test/suite/rpl/r/rpl_mixed_row_innodb.result
      mysql-test/suite/rpl/r/rpl_row_drop.result
      mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result
      mysql-test/suite/rpl/r/rpl_row_mixing_engines.result
      mysql-test/suite/rpl/r/rpl_sp.result
      mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result
      mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result
      mysql-test/suite/rpl/r/rpl_stm_innodb.result
      mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result
      mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result
      mysql-test/suite/rpl/t/rpl000013.test
      mysql-test/suite/rpl/t/rpl_misc_functions.test
      mysql-test/suite/rpl/t/rpl_semi_sync.test
      mysql-test/suite/rpl/t/rpl_sp.test
      mysql-test/suite/rpl/t/rpl_ssl.test
      mysql-test/suite/rpl/t/rpl_ssl1.test
      mysql-test/suite/rpl/t/rpl_temp_table.test
      mysql-test/suite/rpl/t/rpl_temporary.test
      mysql-test/suite/rpl_ndb/r/rpl_ndb_mixed_engines_transactions.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_row_implicit_commit_binlog.result
      mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result
      mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions.test
      mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb.test
      mysql-test/suite/sys_vars/r/large_files_support_basic.result
      mysql-test/t/count_distinct.test
      mysql-test/t/create_select_tmp.test
      mysql-test/t/ctype_cp932_binlog_stm.test
      mysql-test/t/disabled.def
      mysql-test/t/events_1.test
      mysql-test/t/func_des_encrypt.test
      mysql-test/t/func_encrypt.test
      mysql-test/t/func_group.test
      mysql-test/t/func_misc.test
      mysql-test/t/innodb_mysql_sync.test
      mysql-test/t/lock_sync.test
      mysql-test/t/myisam.test
      mysql-test/t/mysqlbinlog.test
      mysql-test/t/openssl_1.test
      mysql-test/t/show_check.test
      mysql-test/t/sp-destruct.test
      mysql-test/t/sp-lock.test
      mysql-test/t/sp.test
      mysql-test/t/sp_sync.test
      mysql-test/t/ssl-big.test
      mysql-test/t/ssl.test
      mysql-test/t/ssl_8k_key.test
      mysql-test/t/ssl_compress.test
      mysql-test/t/ssl_connect.test
      mysys/typelib.c
      plugin/audit_null/audit_null.c
      scripts/CMakeLists.txt
      scripts/make_win_bin_dist
      scripts/mysql_system_tables.sql
      scripts/mysql_system_tables_fix.sql
      sql-common/client.c
      sql/CMakeLists.txt
      sql/Makefile.am
      sql/event_db_repository.cc
      sql/event_scheduler.cc
      sql/handler.cc
      sql/item.cc
      sql/item.h
      sql/item_create.cc
      sql/item_strfunc.cc
      sql/item_strfunc.h
      sql/item_sum.cc
      sql/item_sum.h
      sql/log.cc
      sql/log.h
      sql/log_event.cc
      sql/log_event_old.cc
      sql/mdl.h
      sql/mysqld.cc
      sql/share/errmsg-utf8.txt
      sql/sp.cc
      sql/sp_head.cc
      sql/sql_acl.cc
      sql/sql_audit.cc
      sql/sql_base.cc
      sql/sql_class.cc
      sql/sql_class.h
      sql/sql_connect.cc
      sql/sql_lex.cc
      sql/sql_lex.h
      sql/sql_parse.cc
      sql/sql_priv.h
      sql/sql_select.cc
      sql/sql_show.cc
      sql/sql_string.cc
      sql/sql_string.h
      sql/sql_table.cc
      sql/sql_update.cc
      sql/sql_yacc.yy
      sql/sys_vars.cc
      sql/table.cc
      storage/archive/Makefile.am
      storage/archive/azlib.h
      storage/blackhole/Makefile.am
      storage/example/Makefile.am
      storage/innobase/handler/ha_innodb.cc
      storage/innobase/handler/i_s.cc
      storage/innobase/trx/trx0i_s.c
      storage/myisam/ha_myisam.h
      storage/perfschema/CMakeLists.txt
      storage/perfschema/Makefile.am
      storage/perfschema/ha_perfschema.cc
      storage/perfschema/ha_perfschema.h
      storage/perfschema/pfs.cc
      storage/perfschema/pfs.h
      storage/perfschema/pfs_atomic.cc
      storage/perfschema/pfs_atomic.h
      storage/perfschema/pfs_check.cc
      storage/perfschema/pfs_column_types.h
      storage/perfschema/pfs_column_values.cc
      storage/perfschema/pfs_column_values.h
      storage/perfschema/pfs_engine_table.cc
      storage/perfschema/pfs_engine_table.h
      storage/perfschema/pfs_events_waits.cc
      storage/perfschema/pfs_events_waits.h
      storage/perfschema/pfs_global.cc
      storage/perfschema/pfs_global.h
      storage/perfschema/pfs_instr.cc
      storage/perfschema/pfs_instr.h
      storage/perfschema/pfs_instr_class.cc
      storage/perfschema/pfs_instr_class.h
      storage/perfschema/pfs_lock.h
      storage/perfschema/pfs_server.cc
      storage/perfschema/pfs_server.h
      storage/perfschema/pfs_stat.h
      storage/perfschema/pfs_timer.cc
      storage/perfschema/pfs_timer.h
      storage/perfschema/plug.in
      storage/perfschema/table_all_instr.cc
      storage/perfschema/table_all_instr.h
      storage/perfschema/table_events_waits.cc
      storage/perfschema/table_events_waits.h
      storage/perfschema/table_events_waits_summary.cc
      storage/perfschema/table_events_waits_summary.h
      storage/perfschema/table_file_instances.cc
      storage/perfschema/table_file_instances.h
      storage/perfschema/table_file_summary.cc
      storage/perfschema/table_file_summary.h
      storage/perfschema/table_performance_timers.cc
      storage/perfschema/table_performance_timers.h
      storage/perfschema/table_processlist.cc
      storage/perfschema/table_processlist.h
      storage/perfschema/table_setup_consumers.cc
      storage/perfschema/table_setup_consumers.h
      storage/perfschema/table_setup_instruments.cc
      storage/perfschema/table_setup_instruments.h
      storage/perfschema/table_setup_objects.cc
      storage/perfschema/table_setup_objects.h
      storage/perfschema/table_setup_timers.cc
      storage/perfschema/table_setup_timers.h
      storage/perfschema/table_sync_instances.cc
      storage/perfschema/table_sync_instances.h
      storage/perfschema/unittest/pfs-t.cc
      storage/perfschema/unittest/pfs_instr-oom-t.cc
      storage/perfschema/unittest/pfs_instr-t.cc
      storage/perfschema/unittest/pfs_instr_class-oom-t.cc
      storage/perfschema/unittest/pfs_instr_class-t.cc
      support-files/mysql.spec.sh
=== added file 'mysql-test/suite/perfschema/include/pfs_upgrade.inc'
--- a/mysql-test/suite/perfschema/include/pfs_upgrade.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/include/pfs_upgrade.inc	2010-04-28 09:58:50 +0000
@@ -0,0 +1,134 @@
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.   
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+# Tests for PERFORMANCE_SCHEMA
+# Make sure mysql_upgrade does not destroy data in a 'performance_schema'
+# database.
+# 
+
+--disable_warnings
+drop table if exists test.user_table;
+drop procedure if exists test.user_proc;
+drop function if exists test.user_func;
+drop event if exists test.user_event;
+--enable_warnings
+
+--echo "Testing mysql_upgrade with TABLE performance_schema.user_table"
+
+create table test.user_table(a int);
+
+let $MYSQLD_DATADIR= `SELECT @@datadir`;
+--copy_file $MYSQLD_DATADIR/test/user_table.frm $MYSQLD_DATADIR/performance_schema/user_table.frm
+
+# Make sure the table is visible
+use performance_schema;
+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
+
+# Make sure the table is still visible
+show tables like "user_table";
+
+use test;
+
+--remove_file $MYSQLD_DATADIR/performance_schema/user_table.frm
+drop table test.user_table;
+
+--echo "Testing mysql_upgrade with VIEW performance_schema.user_view"
+
+create view test.user_view as select "Not supposed to be here";
+
+let $MYSQLD_DATADIR= `SELECT @@datadir`;
+--copy_file $MYSQLD_DATADIR/test/user_view.frm $MYSQLD_DATADIR/performance_schema/user_view.frm
+
+# Make sure the view is visible
+use performance_schema;
+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
+
+# Make sure the view is still visible
+show tables like "user_view";
+
+use test;
+
+--remove_file $MYSQLD_DATADIR/performance_schema/user_view.frm
+drop view test.user_view;
+
+--echo "Testing mysql_upgrade with PROCEDURE performance_schema.user_proc"
+
+create procedure test.user_proc()
+  select "Not supposed to be here";
+
+update mysql.proc set db='performance_schema' where name='user_proc';
+
+--error 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
+
+select name from mysql.proc where db='performance_schema';
+
+update mysql.proc set db='test' where name='user_proc';
+drop procedure test.user_proc;
+
+--echo "Testing mysql_upgrade with FUNCTION performance_schema.user_func"
+
+create function test.user_func() returns integer
+  return 0;
+
+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
+
+select name from mysql.proc where db='performance_schema';
+
+update mysql.proc set db='test' where name='user_func';
+drop function test.user_func;
+
+--echo "Testing mysql_upgrade with EVENT performance_schema.user_event"
+
+create event test.user_event on schedule every 1 day do
+  select "not supposed to be here";
+
+update mysql.event set db='performance_schema' where name='user_event';
+
+--error 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
+
+select name from mysql.event where db='performance_schema';
+
+update mysql.event set db='test' where name='user_event';
+drop event test.user_event;
+
+--remove_file $MYSQLTEST_VARDIR/tmp/pfs_upgrade.out
+--remove_file $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err
+

=== added file 'mysql-test/suite/perfschema/r/pfs_upgrade_lc0.result'
--- a/mysql-test/suite/perfschema/r/pfs_upgrade_lc0.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade_lc0.result	2010-04-28 09:58:50 +0000
@@ -0,0 +1,153 @@
+drop table if exists test.user_table;
+drop procedure if exists test.user_proc;
+drop function if exists test.user_func;
+drop event if exists test.user_event;
+"Testing mysql_upgrade with TABLE performance_schema.user_table"
+create table test.user_table(a int);
+use performance_schema;
+show tables like "user_table";
+Tables_in_performance_schema (user_table)
+user_table
+ERROR 1050 (42S01) at line 67: Table 'COND_INSTANCES' already exists
+ERROR 1050 (42S01) at line 89: Table 'EVENTS_WAITS_CURRENT' already exists
+ERROR 1050 (42S01) at line 111: Table 'EVENTS_WAITS_HISTORY' already exists
+ERROR 1050 (42S01) at line 133: Table 'EVENTS_WAITS_HISTORY_LONG' already exists
+ERROR 1050 (42S01) at line 145: Table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME' already exists
+ERROR 1050 (42S01) at line 158: Table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' already exists
+ERROR 1050 (42S01) at line 171: Table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' already exists
+ERROR 1050 (42S01) at line 180: Table 'FILE_INSTANCES' already exists
+ERROR 1050 (42S01) at line 191: Table 'FILE_SUMMARY_BY_EVENT_NAME' already exists
+ERROR 1050 (42S01) at line 203: Table 'FILE_SUMMARY_BY_INSTANCE' already exists
+ERROR 1050 (42S01) at line 212: Table 'MUTEX_INSTANCES' already exists
+ERROR 1050 (42S01) at line 222: Table 'PERFORMANCE_TIMERS' already exists
+ERROR 1050 (42S01) at line 231: Table 'PROCESSLIST' already exists
+ERROR 1050 (42S01) at line 241: Table 'RWLOCK_INSTANCES' already exists
+ERROR 1050 (42S01) at line 249: Table 'SETUP_CONSUMERS' already exists
+ERROR 1050 (42S01) at line 261: Table 'SETUP_OBJECTS' already exists
+ERROR 1050 (42S01) at line 270: Table 'SETUP_INSTRUMENTS' already exists
+ERROR 1050 (42S01) at line 278: Table 'SETUP_TIMERS' already exists
+ERROR 1644 (HY000) at line 695: Unexpected content found in the performance_schema database.
+FATAL ERROR: Upgrade failed
+show tables like "user_table";
+Tables_in_performance_schema (user_table)
+user_table
+use test;
+drop table test.user_table;
+"Testing mysql_upgrade with VIEW performance_schema.user_view"
+create view test.user_view as select "Not supposed to be here";
+use performance_schema;
+show tables like "user_view";
+Tables_in_performance_schema (user_view)
+user_view
+ERROR 1050 (42S01) at line 67: Table 'COND_INSTANCES' already exists
+ERROR 1050 (42S01) at line 89: Table 'EVENTS_WAITS_CURRENT' already exists
+ERROR 1050 (42S01) at line 111: Table 'EVENTS_WAITS_HISTORY' already exists
+ERROR 1050 (42S01) at line 133: Table 'EVENTS_WAITS_HISTORY_LONG' already exists
+ERROR 1050 (42S01) at line 145: Table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME' already exists
+ERROR 1050 (42S01) at line 158: Table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' already exists
+ERROR 1050 (42S01) at line 171: Table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' already exists
+ERROR 1050 (42S01) at line 180: Table 'FILE_INSTANCES' already exists
+ERROR 1050 (42S01) at line 191: Table 'FILE_SUMMARY_BY_EVENT_NAME' already exists
+ERROR 1050 (42S01) at line 203: Table 'FILE_SUMMARY_BY_INSTANCE' already exists
+ERROR 1050 (42S01) at line 212: Table 'MUTEX_INSTANCES' already exists
+ERROR 1050 (42S01) at line 222: Table 'PERFORMANCE_TIMERS' already exists
+ERROR 1050 (42S01) at line 231: Table 'PROCESSLIST' already exists
+ERROR 1050 (42S01) at line 241: Table 'RWLOCK_INSTANCES' already exists
+ERROR 1050 (42S01) at line 249: Table 'SETUP_CONSUMERS' already exists
+ERROR 1050 (42S01) at line 261: Table 'SETUP_OBJECTS' already exists
+ERROR 1050 (42S01) at line 270: Table 'SETUP_INSTRUMENTS' already exists
+ERROR 1050 (42S01) at line 278: Table 'SETUP_TIMERS' already exists
+ERROR 1644 (HY000) at line 695: Unexpected content found in the performance_schema database.
+FATAL ERROR: Upgrade failed
+show tables like "user_view";
+Tables_in_performance_schema (user_view)
+user_view
+use test;
+drop view test.user_view;
+"Testing mysql_upgrade with PROCEDURE performance_schema.user_proc"
+create procedure test.user_proc()
+select "Not supposed to be here";
+update mysql.proc set db='performance_schema' where name='user_proc';
+ERROR 1050 (42S01) at line 67: Table 'COND_INSTANCES' already exists
+ERROR 1050 (42S01) at line 89: Table 'EVENTS_WAITS_CURRENT' already exists
+ERROR 1050 (42S01) at line 111: Table 'EVENTS_WAITS_HISTORY' already exists
+ERROR 1050 (42S01) at line 133: Table 'EVENTS_WAITS_HISTORY_LONG' already exists
+ERROR 1050 (42S01) at line 145: Table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME' already exists
+ERROR 1050 (42S01) at line 158: Table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' already exists
+ERROR 1050 (42S01) at line 171: Table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' already exists
+ERROR 1050 (42S01) at line 180: Table 'FILE_INSTANCES' already exists
+ERROR 1050 (42S01) at line 191: Table 'FILE_SUMMARY_BY_EVENT_NAME' already exists
+ERROR 1050 (42S01) at line 203: Table 'FILE_SUMMARY_BY_INSTANCE' already exists
+ERROR 1050 (42S01) at line 212: Table 'MUTEX_INSTANCES' already exists
+ERROR 1050 (42S01) at line 222: Table 'PERFORMANCE_TIMERS' already exists
+ERROR 1050 (42S01) at line 231: Table 'PROCESSLIST' already exists
+ERROR 1050 (42S01) at line 241: Table 'RWLOCK_INSTANCES' already exists
+ERROR 1050 (42S01) at line 249: Table 'SETUP_CONSUMERS' already exists
+ERROR 1050 (42S01) at line 261: Table 'SETUP_OBJECTS' already exists
+ERROR 1050 (42S01) at line 270: Table 'SETUP_INSTRUMENTS' already exists
+ERROR 1050 (42S01) at line 278: Table 'SETUP_TIMERS' already exists
+ERROR 1644 (HY000) at line 695: Unexpected content found in the performance_schema database.
+FATAL ERROR: Upgrade failed
+select name from mysql.proc where db='performance_schema';
+name
+user_proc
+update mysql.proc set db='test' where name='user_proc';
+drop procedure test.user_proc;
+"Testing mysql_upgrade with FUNCTION performance_schema.user_func"
+create function test.user_func() returns integer
+return 0;
+update mysql.proc set db='performance_schema' where name='user_func';
+ERROR 1050 (42S01) at line 67: Table 'COND_INSTANCES' already exists
+ERROR 1050 (42S01) at line 89: Table 'EVENTS_WAITS_CURRENT' already exists
+ERROR 1050 (42S01) at line 111: Table 'EVENTS_WAITS_HISTORY' already exists
+ERROR 1050 (42S01) at line 133: Table 'EVENTS_WAITS_HISTORY_LONG' already exists
+ERROR 1050 (42S01) at line 145: Table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME' already exists
+ERROR 1050 (42S01) at line 158: Table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' already exists
+ERROR 1050 (42S01) at line 171: Table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' already exists
+ERROR 1050 (42S01) at line 180: Table 'FILE_INSTANCES' already exists
+ERROR 1050 (42S01) at line 191: Table 'FILE_SUMMARY_BY_EVENT_NAME' already exists
+ERROR 1050 (42S01) at line 203: Table 'FILE_SUMMARY_BY_INSTANCE' already exists
+ERROR 1050 (42S01) at line 212: Table 'MUTEX_INSTANCES' already exists
+ERROR 1050 (42S01) at line 222: Table 'PERFORMANCE_TIMERS' already exists
+ERROR 1050 (42S01) at line 231: Table 'PROCESSLIST' already exists
+ERROR 1050 (42S01) at line 241: Table 'RWLOCK_INSTANCES' already exists
+ERROR 1050 (42S01) at line 249: Table 'SETUP_CONSUMERS' already exists
+ERROR 1050 (42S01) at line 261: Table 'SETUP_OBJECTS' already exists
+ERROR 1050 (42S01) at line 270: Table 'SETUP_INSTRUMENTS' already exists
+ERROR 1050 (42S01) at line 278: Table 'SETUP_TIMERS' already exists
+ERROR 1644 (HY000) at line 695: Unexpected content found in the performance_schema database.
+FATAL ERROR: Upgrade failed
+select name from mysql.proc where db='performance_schema';
+name
+user_func
+update mysql.proc set db='test' where name='user_func';
+drop function test.user_func;
+"Testing mysql_upgrade with EVENT performance_schema.user_event"
+create event test.user_event on schedule every 1 day do
+select "not supposed to be here";
+update mysql.event set db='performance_schema' where name='user_event';
+ERROR 1050 (42S01) at line 67: Table 'COND_INSTANCES' already exists
+ERROR 1050 (42S01) at line 89: Table 'EVENTS_WAITS_CURRENT' already exists
+ERROR 1050 (42S01) at line 111: Table 'EVENTS_WAITS_HISTORY' already exists
+ERROR 1050 (42S01) at line 133: Table 'EVENTS_WAITS_HISTORY_LONG' already exists
+ERROR 1050 (42S01) at line 145: Table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME' already exists
+ERROR 1050 (42S01) at line 158: Table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' already exists
+ERROR 1050 (42S01) at line 171: Table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' already exists
+ERROR 1050 (42S01) at line 180: Table 'FILE_INSTANCES' already exists
+ERROR 1050 (42S01) at line 191: Table 'FILE_SUMMARY_BY_EVENT_NAME' already exists
+ERROR 1050 (42S01) at line 203: Table 'FILE_SUMMARY_BY_INSTANCE' already exists
+ERROR 1050 (42S01) at line 212: Table 'MUTEX_INSTANCES' already exists
+ERROR 1050 (42S01) at line 222: Table 'PERFORMANCE_TIMERS' already exists
+ERROR 1050 (42S01) at line 231: Table 'PROCESSLIST' already exists
+ERROR 1050 (42S01) at line 241: Table 'RWLOCK_INSTANCES' already exists
+ERROR 1050 (42S01) at line 249: Table 'SETUP_CONSUMERS' already exists
+ERROR 1050 (42S01) at line 261: Table 'SETUP_OBJECTS' already exists
+ERROR 1050 (42S01) at line 270: Table 'SETUP_INSTRUMENTS' already exists
+ERROR 1050 (42S01) at line 278: Table 'SETUP_TIMERS' already exists
+ERROR 1644 (HY000) at line 695: Unexpected content found in the performance_schema database.
+FATAL ERROR: Upgrade failed
+select name from mysql.event where db='performance_schema';
+name
+user_event
+update mysql.event set db='test' where name='user_event';
+drop event test.user_event;

=== added file 'mysql-test/suite/perfschema/r/pfs_upgrade_lc1.result'
--- a/mysql-test/suite/perfschema/r/pfs_upgrade_lc1.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade_lc1.result	2010-04-28 09:58:50 +0000
@@ -0,0 +1,153 @@
+drop table if exists test.user_table;
+drop procedure if exists test.user_proc;
+drop function if exists test.user_func;
+drop event if exists test.user_event;
+"Testing mysql_upgrade with TABLE performance_schema.user_table"
+create table test.user_table(a int);
+use performance_schema;
+show tables like "user_table";
+Tables_in_performance_schema (user_table)
+user_table
+ERROR 1050 (42S01) at line 67: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 89: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 111: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 133: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 145: Table 'events_waits_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 158: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 171: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 180: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 191: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 203: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 212: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 222: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 231: Table 'processlist' already exists
+ERROR 1050 (42S01) at line 241: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 249: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 261: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 270: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 278: Table 'setup_timers' already exists
+ERROR 1644 (HY000) at line 695: Unexpected content found in the performance_schema database.
+FATAL ERROR: Upgrade failed
+show tables like "user_table";
+Tables_in_performance_schema (user_table)
+user_table
+use test;
+drop table test.user_table;
+"Testing mysql_upgrade with VIEW performance_schema.user_view"
+create view test.user_view as select "Not supposed to be here";
+use performance_schema;
+show tables like "user_view";
+Tables_in_performance_schema (user_view)
+user_view
+ERROR 1050 (42S01) at line 67: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 89: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 111: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 133: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 145: Table 'events_waits_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 158: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 171: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 180: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 191: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 203: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 212: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 222: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 231: Table 'processlist' already exists
+ERROR 1050 (42S01) at line 241: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 249: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 261: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 270: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 278: Table 'setup_timers' already exists
+ERROR 1644 (HY000) at line 695: Unexpected content found in the performance_schema database.
+FATAL ERROR: Upgrade failed
+show tables like "user_view";
+Tables_in_performance_schema (user_view)
+user_view
+use test;
+drop view test.user_view;
+"Testing mysql_upgrade with PROCEDURE performance_schema.user_proc"
+create procedure test.user_proc()
+select "Not supposed to be here";
+update mysql.proc set db='performance_schema' where name='user_proc';
+ERROR 1050 (42S01) at line 67: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 89: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 111: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 133: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 145: Table 'events_waits_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 158: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 171: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 180: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 191: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 203: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 212: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 222: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 231: Table 'processlist' already exists
+ERROR 1050 (42S01) at line 241: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 249: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 261: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 270: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 278: Table 'setup_timers' already exists
+ERROR 1644 (HY000) at line 695: Unexpected content found in the performance_schema database.
+FATAL ERROR: Upgrade failed
+select name from mysql.proc where db='performance_schema';
+name
+user_proc
+update mysql.proc set db='test' where name='user_proc';
+drop procedure test.user_proc;
+"Testing mysql_upgrade with FUNCTION performance_schema.user_func"
+create function test.user_func() returns integer
+return 0;
+update mysql.proc set db='performance_schema' where name='user_func';
+ERROR 1050 (42S01) at line 67: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 89: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 111: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 133: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 145: Table 'events_waits_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 158: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 171: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 180: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 191: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 203: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 212: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 222: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 231: Table 'processlist' already exists
+ERROR 1050 (42S01) at line 241: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 249: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 261: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 270: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 278: Table 'setup_timers' already exists
+ERROR 1644 (HY000) at line 695: Unexpected content found in the performance_schema database.
+FATAL ERROR: Upgrade failed
+select name from mysql.proc where db='performance_schema';
+name
+user_func
+update mysql.proc set db='test' where name='user_func';
+drop function test.user_func;
+"Testing mysql_upgrade with EVENT performance_schema.user_event"
+create event test.user_event on schedule every 1 day do
+select "not supposed to be here";
+update mysql.event set db='performance_schema' where name='user_event';
+ERROR 1050 (42S01) at line 67: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 89: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 111: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 133: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 145: Table 'events_waits_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 158: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 171: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 180: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 191: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 203: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 212: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 222: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 231: Table 'processlist' already exists
+ERROR 1050 (42S01) at line 241: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 249: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 261: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 270: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 278: Table 'setup_timers' already exists
+ERROR 1644 (HY000) at line 695: Unexpected content found in the performance_schema database.
+FATAL ERROR: Upgrade failed
+select name from mysql.event where db='performance_schema';
+name
+user_event
+update mysql.event set db='test' where name='user_event';
+drop event test.user_event;

=== added file 'mysql-test/suite/perfschema/r/pfs_upgrade_lc2.result'
--- a/mysql-test/suite/perfschema/r/pfs_upgrade_lc2.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade_lc2.result	2010-04-28 09:58:50 +0000
@@ -0,0 +1,153 @@
+drop table if exists test.user_table;
+drop procedure if exists test.user_proc;
+drop function if exists test.user_func;
+drop event if exists test.user_event;
+"Testing mysql_upgrade with TABLE performance_schema.user_table"
+create table test.user_table(a int);
+use performance_schema;
+show tables like "user_table";
+Tables_in_performance_schema (user_table)
+user_table
+ERROR 1050 (42S01) at line 67: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 89: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 111: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 133: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 145: Table 'events_waits_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 158: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 171: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 180: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 191: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 203: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 212: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 222: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 231: Table 'processlist' already exists
+ERROR 1050 (42S01) at line 241: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 249: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 261: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 270: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 278: Table 'setup_timers' already exists
+ERROR 1644 (HY000) at line 695: Unexpected content found in the performance_schema database.
+FATAL ERROR: Upgrade failed
+show tables like "user_table";
+Tables_in_performance_schema (user_table)
+user_table
+use test;
+drop table test.user_table;
+"Testing mysql_upgrade with VIEW performance_schema.user_view"
+create view test.user_view as select "Not supposed to be here";
+use performance_schema;
+show tables like "user_view";
+Tables_in_performance_schema (user_view)
+user_view
+ERROR 1050 (42S01) at line 67: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 89: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 111: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 133: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 145: Table 'events_waits_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 158: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 171: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 180: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 191: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 203: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 212: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 222: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 231: Table 'processlist' already exists
+ERROR 1050 (42S01) at line 241: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 249: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 261: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 270: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 278: Table 'setup_timers' already exists
+ERROR 1644 (HY000) at line 695: Unexpected content found in the performance_schema database.
+FATAL ERROR: Upgrade failed
+show tables like "user_view";
+Tables_in_performance_schema (user_view)
+user_view
+use test;
+drop view test.user_view;
+"Testing mysql_upgrade with PROCEDURE performance_schema.user_proc"
+create procedure test.user_proc()
+select "Not supposed to be here";
+update mysql.proc set db='performance_schema' where name='user_proc';
+ERROR 1050 (42S01) at line 67: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 89: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 111: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 133: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 145: Table 'events_waits_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 158: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 171: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 180: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 191: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 203: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 212: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 222: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 231: Table 'processlist' already exists
+ERROR 1050 (42S01) at line 241: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 249: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 261: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 270: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 278: Table 'setup_timers' already exists
+ERROR 1644 (HY000) at line 695: Unexpected content found in the performance_schema database.
+FATAL ERROR: Upgrade failed
+select name from mysql.proc where db='performance_schema';
+name
+user_proc
+update mysql.proc set db='test' where name='user_proc';
+drop procedure test.user_proc;
+"Testing mysql_upgrade with FUNCTION performance_schema.user_func"
+create function test.user_func() returns integer
+return 0;
+update mysql.proc set db='performance_schema' where name='user_func';
+ERROR 1050 (42S01) at line 67: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 89: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 111: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 133: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 145: Table 'events_waits_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 158: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 171: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 180: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 191: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 203: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 212: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 222: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 231: Table 'processlist' already exists
+ERROR 1050 (42S01) at line 241: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 249: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 261: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 270: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 278: Table 'setup_timers' already exists
+ERROR 1644 (HY000) at line 695: Unexpected content found in the performance_schema database.
+FATAL ERROR: Upgrade failed
+select name from mysql.proc where db='performance_schema';
+name
+user_func
+update mysql.proc set db='test' where name='user_func';
+drop function test.user_func;
+"Testing mysql_upgrade with EVENT performance_schema.user_event"
+create event test.user_event on schedule every 1 day do
+select "not supposed to be here";
+update mysql.event set db='performance_schema' where name='user_event';
+ERROR 1050 (42S01) at line 67: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 89: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 111: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 133: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 145: Table 'events_waits_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 158: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 171: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 180: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 191: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 203: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 212: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 222: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 231: Table 'processlist' already exists
+ERROR 1050 (42S01) at line 241: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 249: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 261: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 270: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 278: Table 'setup_timers' already exists
+ERROR 1644 (HY000) at line 695: Unexpected content found in the performance_schema database.
+FATAL ERROR: Upgrade failed
+select name from mysql.event where db='performance_schema';
+name
+user_event
+update mysql.event set db='test' where name='user_event';
+drop event test.user_event;

=== removed file 'mysql-test/suite/perfschema/t/pfs_upgrade.test'
--- a/mysql-test/suite/perfschema/t/pfs_upgrade.test	2010-03-09 15:05:19 +0000
+++ b/mysql-test/suite/perfschema/t/pfs_upgrade.test	1970-01-01 00:00:00 +0000
@@ -1,138 +0,0 @@
-# Copyright (C) 2010 Oracle and/or its affiliates. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-# Tests for PERFORMANCE_SCHEMA
-# Make sure mysql_upgrade does not destroy data in a 'performance_schema'
-# database.
-# 
-
---source include/not_embedded.inc
---source include/have_perfschema.inc
---source include/have_lowercase0.inc
-
---disable_warnings
-drop table if exists test.user_table;
-drop procedure if exists test.user_proc;
-drop function if exists test.user_func;
-drop event if exists test.user_event;
---enable_warnings
-
---echo "Testing mysql_upgrade with TABLE performance_schema.user_table"
-
-create table test.user_table(a int);
-
-let $MYSQLD_DATADIR= `SELECT @@datadir`;
---copy_file $MYSQLD_DATADIR/test/user_table.frm $MYSQLD_DATADIR/performance_schema/user_table.frm
-
-# Make sure the table is visible
-use performance_schema;
-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
-
-# Make sure the table is still visible
-show tables like "user_table";
-
-use test;
-
---remove_file $MYSQLD_DATADIR/performance_schema/user_table.frm
-drop table test.user_table;
-
---echo "Testing mysql_upgrade with VIEW performance_schema.user_view"
-
-create view test.user_view as select "Not supposed to be here";
-
-let $MYSQLD_DATADIR= `SELECT @@datadir`;
---copy_file $MYSQLD_DATADIR/test/user_view.frm $MYSQLD_DATADIR/performance_schema/user_view.frm
-
-# Make sure the view is visible
-use performance_schema;
-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
-
-# Make sure the view is still visible
-show tables like "user_view";
-
-use test;
-
---remove_file $MYSQLD_DATADIR/performance_schema/user_view.frm
-drop view test.user_view;
-
---echo "Testing mysql_upgrade with PROCEDURE performance_schema.user_proc"
-
-create procedure test.user_proc()
-  select "Not supposed to be here";
-
-update mysql.proc set db='performance_schema' where name='user_proc';
-
---error 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
-
-select name from mysql.proc where db='performance_schema';
-
-update mysql.proc set db='test' where name='user_proc';
-drop procedure test.user_proc;
-
---echo "Testing mysql_upgrade with FUNCTION performance_schema.user_func"
-
-create function test.user_func() returns integer
-  return 0;
-
-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
-
-select name from mysql.proc where db='performance_schema';
-
-update mysql.proc set db='test' where name='user_func';
-drop function test.user_func;
-
---echo "Testing mysql_upgrade with EVENT performance_schema.user_event"
-
-create event test.user_event on schedule every 1 day do
-  select "not supposed to be here";
-
-update mysql.event set db='performance_schema' where name='user_event';
-
---error 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
-
-select name from mysql.event where db='performance_schema';
-
-update mysql.event set db='test' where name='user_event';
-drop event test.user_event;
-
---remove_file $MYSQLTEST_VARDIR/tmp/pfs_upgrade.out
---remove_file $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err
-

=== added file 'mysql-test/suite/perfschema/t/pfs_upgrade_lc0.test'
--- a/mysql-test/suite/perfschema/t/pfs_upgrade_lc0.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/pfs_upgrade_lc0.test	2010-04-28 09:58:50 +0000
@@ -0,0 +1,26 @@
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.   
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+# Tests for PERFORMANCE_SCHEMA
+# Make sure mysql_upgrade does not destroy data in a 'performance_schema'
+# database.
+# 
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+--source include/have_lowercase0.inc
+--source ../include/pfs_upgrade.inc
+
+

=== added file 'mysql-test/suite/perfschema/t/pfs_upgrade_lc1.test'
--- a/mysql-test/suite/perfschema/t/pfs_upgrade_lc1.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/pfs_upgrade_lc1.test	2010-04-28 09:58:50 +0000
@@ -0,0 +1,26 @@
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.   
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+# Tests for PERFORMANCE_SCHEMA
+# Make sure mysql_upgrade does not destroy data in a 'performance_schema'
+# database.
+# 
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+--source include/have_lowercase1.inc
+--source ../include/pfs_upgrade.inc
+
+

=== added file 'mysql-test/suite/perfschema/t/pfs_upgrade_lc2.test'
--- a/mysql-test/suite/perfschema/t/pfs_upgrade_lc2.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/pfs_upgrade_lc2.test	2010-04-28 09:58:50 +0000
@@ -0,0 +1,26 @@
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.   
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+# Tests for PERFORMANCE_SCHEMA
+# Make sure mysql_upgrade does not destroy data in a 'performance_schema'
+# database.
+# 
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+--source include/have_lowercase2.inc
+--source ../include/pfs_upgrade.inc
+
+

=== modified file 'scripts/mysql_system_tables.sql'
--- a/scripts/mysql_system_tables.sql	2010-04-28 08:41:00 +0000
+++ b/scripts/mysql_system_tables.sql	2010-04-28 09:58:50 +0000
@@ -115,7 +115,6 @@ set @have_old_pfs= (select count(*) from
 
 SET @cmd="SET @broken_tables = (select count(*) from information_schema.tables"
   " where engine != \'PERFORMANCE_SCHEMA\' and table_schema=\'performance_schema\')";
-GO
 
 -- Work around for bug#49542
 SET @str = IF(@have_old_pfs = 1, @cmd, 'SET @broken_tables = 0');
@@ -125,7 +124,6 @@ DROP PREPARE stmt;
 
 SET @cmd="SET @broken_views = (select count(*) from information_schema.views"
   " where table_schema='performance_schema')";
-GO
 
 -- Work around for bug#49542
 SET @str = IF(@have_old_pfs = 1, @cmd, 'SET @broken_views = 0');
@@ -175,7 +173,6 @@ SET @cmd="CREATE TABLE performance_schem
   "NAME VARCHAR(128) not null,"
   "OBJECT_INSTANCE_BEGIN BIGINT not null"
   ")ENGINE=PERFORMANCE_SCHEMA;";
-GO
 
 SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
 PREPARE stmt FROM @str;
@@ -204,7 +201,6 @@ SET @cmd="CREATE TABLE performance_schem
   "NUMBER_OF_BYTES BIGINT unsigned,"
   "FLAGS INTEGER unsigned"
   ")ENGINE=PERFORMANCE_SCHEMA;";
-GO
 
 SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
 PREPARE stmt FROM @str;
@@ -233,7 +229,6 @@ SET @cmd="CREATE TABLE performance_schem
   "NUMBER_OF_BYTES BIGINT unsigned,"
   "FLAGS INTEGER unsigned"
   ")ENGINE=PERFORMANCE_SCHEMA;";
-GO
 
 SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
 PREPARE stmt FROM @str;
@@ -262,7 +257,6 @@ SET @cmd="CREATE TABLE performance_schem
   "NUMBER_OF_BYTES BIGINT unsigned,"
   "FLAGS INTEGER unsigned"
   ")ENGINE=PERFORMANCE_SCHEMA;";
-GO
 
 SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
 PREPARE stmt FROM @str;
@@ -281,7 +275,6 @@ SET @cmd="CREATE TABLE performance_schem
   "AVG_TIMER_WAIT BIGINT unsigned not null,"
   "MAX_TIMER_WAIT BIGINT unsigned not null"
   ")ENGINE=PERFORMANCE_SCHEMA;";
-GO
 
 SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
 PREPARE stmt FROM @str;
@@ -301,7 +294,6 @@ SET @cmd="CREATE TABLE performance_schem
   "AVG_TIMER_WAIT BIGINT unsigned not null,"
   "MAX_TIMER_WAIT BIGINT unsigned not null"
   ")ENGINE=PERFORMANCE_SCHEMA;";
-GO
 
 SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
 PREPARE stmt FROM @str;
@@ -321,7 +313,6 @@ SET @cmd="CREATE TABLE performance_schem
   "AVG_TIMER_WAIT BIGINT unsigned not null,"
   "MAX_TIMER_WAIT BIGINT unsigned not null"
   ")ENGINE=PERFORMANCE_SCHEMA;";
-GO
 
 SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
 PREPARE stmt FROM @str;
@@ -337,7 +328,6 @@ SET @cmd="CREATE TABLE performance_schem
   "EVENT_NAME VARCHAR(128) not null,"
   "OPEN_COUNT INTEGER unsigned not null"
   ")ENGINE=PERFORMANCE_SCHEMA;";
-GO
 
 SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
 PREPARE stmt FROM @str;
@@ -355,7 +345,6 @@ SET @cmd="CREATE TABLE performance_schem
   "SUM_NUMBER_OF_BYTES_READ BIGINT unsigned not null,"
   "SUM_NUMBER_OF_BYTES_WRITE BIGINT unsigned not null"
   ")ENGINE=PERFORMANCE_SCHEMA;";
-GO
 
 SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
 PREPARE stmt FROM @str;
@@ -374,7 +363,6 @@ SET @cmd="CREATE TABLE performance_schem
   "SUM_NUMBER_OF_BYTES_READ BIGINT unsigned not null,"
   "SUM_NUMBER_OF_BYTES_WRITE BIGINT unsigned not null"
   ")ENGINE=PERFORMANCE_SCHEMA;";
-GO
 
 SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
 PREPARE stmt FROM @str;
@@ -390,7 +378,6 @@ SET @cmd="CREATE TABLE performance_schem
   "OBJECT_INSTANCE_BEGIN BIGINT not null,"
   "LOCKED_BY_THREAD_ID INTEGER"
   ")ENGINE=PERFORMANCE_SCHEMA;";
-GO
 
 SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
 PREPARE stmt FROM @str;
@@ -407,7 +394,6 @@ SET @cmd="CREATE TABLE performance_schem
   "TIMER_RESOLUTION BIGINT,"
   "TIMER_OVERHEAD BIGINT"
   ") ENGINE=PERFORMANCE_SCHEMA;";
-GO
 
 SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
 PREPARE stmt FROM @str;
@@ -423,7 +409,6 @@ SET @cmd="CREATE TABLE performance_schem
   "ID INTEGER not null,"
   "NAME VARCHAR(64) not null"
   ")ENGINE=PERFORMANCE_SCHEMA;";
-GO
 
 SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
 PREPARE stmt FROM @str;
@@ -440,7 +425,6 @@ SET @cmd="CREATE TABLE performance_schem
   "WRITE_LOCKED_BY_THREAD_ID INTEGER,"
   "READ_LOCKED_BY_COUNT INTEGER unsigned not null"
   ")ENGINE=PERFORMANCE_SCHEMA;";
-GO
 
 SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
 PREPARE stmt FROM @str;
@@ -455,7 +439,6 @@ SET @cmd="CREATE TABLE performance_schem
   "NAME VARCHAR(64) not null,"
   "ENABLED ENUM ('YES', 'NO') not null"
   ")ENGINE=PERFORMANCE_SCHEMA;";
-GO
 
 SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
 PREPARE stmt FROM @str;
@@ -474,7 +457,6 @@ SET @cmd="CREATE TABLE performance_schem
   "TIMED ENUM ('YES', 'NO') not null,"
   "AGGREGATED ENUM ('YES', 'NO') not null"
   ")ENGINE=PERFORMANCE_SCHEMA;";
-GO
 
 SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
 PREPARE stmt FROM @str;
@@ -490,7 +472,6 @@ SET @cmd="CREATE TABLE performance_schem
   "ENABLED ENUM ('YES', 'NO') not null,"
   "TIMED ENUM ('YES', 'NO') not null"
   ")ENGINE=PERFORMANCE_SCHEMA;";
-GO
 
 SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
 PREPARE stmt FROM @str;
@@ -505,7 +486,6 @@ SET @cmd="CREATE TABLE performance_schem
   "NAME VARCHAR(64) not null,"
   "TIMER_NAME ENUM ('CYCLE', 'NANOSECOND', 'MICROSECOND', 'MILLISECOND', 'TICK') not null"
   ")ENGINE=PERFORMANCE_SCHEMA;";
-GO
 
 SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
 PREPARE stmt FROM @str;

=== modified file 'scripts/mysql_system_tables_fix.sql'
--- a/scripts/mysql_system_tables_fix.sql	2010-04-28 08:41:00 +0000
+++ b/scripts/mysql_system_tables_fix.sql	2010-04-28 09:58:50 +0000
@@ -29,21 +29,9 @@ ALTER TABLE user add File_priv enum('N',
 SET @hadGrantPriv:=0;
 SELECT @hadGrantPriv:=1 FROM user WHERE Grant_priv LIKE '%';
 
-ALTER TABLE user add Grant_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,
-  add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,
-  add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,
-  add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL;
-GO
-ALTER TABLE host add Grant_priv enum('N','Y') NOT NULL,
-  add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,
-  add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,
-  add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL;
-GO
-ALTER TABLE db add Grant_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,
-  add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,
-  add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,
-  add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL;
-GO
+ALTER TABLE user add Grant_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL;
+ALTER TABLE host add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL;
+ALTER TABLE db add Grant_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL;
 
 # Fix privileges for old tables
 UPDATE user SET Grant_priv=File_priv,References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0;
@@ -59,7 +47,6 @@ ADD ssl_type enum('','ANY','X509', 'SPEC
 ADD ssl_cipher BLOB NOT NULL,
 ADD x509_issuer BLOB NOT NULL,
 ADD x509_subject BLOB NOT NULL;
-GO
 ALTER TABLE user MODIFY ssl_type enum('','ANY','X509', 'SPECIFIED') NOT NULL;
 
 #
@@ -67,7 +54,6 @@ ALTER TABLE user MODIFY ssl_type enum(''
 #
 ALTER TABLE tables_priv
   ADD KEY Grantor (Grantor);
-GO
 
 ALTER TABLE tables_priv
   MODIFY Host char(60) NOT NULL default '',
@@ -77,7 +63,6 @@ ALTER TABLE tables_priv
   MODIFY Grantor char(77) NOT NULL default '',
   ENGINE=MyISAM,
   CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
-GO
 
 ALTER TABLE tables_priv
   MODIFY Column_priv set('Select','Insert','Update','References')
@@ -87,7 +72,6 @@ ALTER TABLE tables_priv
                         'Create View','Show view')
     COLLATE utf8_general_ci DEFAULT '' NOT NULL,
   COMMENT='Table privileges';
-GO
 
 #
 # columns_priv
@@ -98,7 +82,6 @@ GO
 ALTER TABLE columns_priv
   CHANGE Type Column_priv set('Select','Insert','Update','References')
     COLLATE utf8_general_ci DEFAULT '' NOT NULL;
-GO
 
 ALTER TABLE columns_priv
   MODIFY Host char(60) NOT NULL default '',
@@ -109,12 +92,10 @@ ALTER TABLE columns_priv
   ENGINE=MyISAM,
   CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin,
   COMMENT='Column privileges';
-GO
 
 ALTER TABLE columns_priv
   MODIFY Column_priv set('Select','Insert','Update','References')
     COLLATE utf8_general_ci DEFAULT '' NOT NULL;
-GO
 
 #
 #  Add the new 'type' column to the func table.
@@ -138,14 +119,10 @@ ADD Lock_tables_priv enum('N','Y') COLLA
 ADD Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Lock_tables_priv,
 ADD Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Execute_priv,
 ADD Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Repl_slave_priv;
-GO
 
 # Convert privileges so that users have similar privileges as before
 
-UPDATE user SET Show_db_priv= Select_priv, Super_priv=Process_priv, Execute_priv=Process_priv,
-  Create_tmp_table_priv='Y', Lock_tables_priv='Y', Repl_slave_priv=file_priv, Repl_client_priv=File_priv
-  where user<>"" AND @hadShowDbPriv = 0;
-GO
+UPDATE user SET Show_db_priv= Select_priv, Super_priv=Process_priv, Execute_priv=Process_priv, Create_tmp_table_priv='Y', Lock_tables_priv='Y', Repl_slave_priv=file_priv, Repl_client_priv=File_priv where user<>"" AND @hadShowDbPriv = 0;
 
 
 #  Add fields that can be used to limit number of questions and connections
@@ -155,7 +132,6 @@ ALTER TABLE user
 ADD max_questions int(11) NOT NULL DEFAULT 0 AFTER x509_subject,
 ADD max_updates   int(11) unsigned NOT NULL DEFAULT 0 AFTER max_questions,
 ADD max_connections int(11) unsigned NOT NULL DEFAULT 0 AFTER max_updates;
-GO
 
 
 #
@@ -165,11 +141,9 @@ GO
 ALTER TABLE db
 ADD Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
 ADD Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL;
-GO
 ALTER TABLE host
 ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,
 ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL;
-GO
 
 alter table user change max_questions max_questions int(11) unsigned DEFAULT 0  NOT NULL;
 
@@ -185,7 +159,6 @@ ALTER TABLE user
   MODIFY Host char(60) NOT NULL default '',
   MODIFY User char(16) NOT NULL default '',
   ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
-GO
 ALTER TABLE user
   MODIFY Password char(41) character set latin1 collate latin1_bin NOT NULL default '',
   MODIFY Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
@@ -210,14 +183,12 @@ ALTER TABLE user
   MODIFY Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
   MODIFY Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
   MODIFY ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL;
-GO
 
 ALTER TABLE db
   MODIFY Host char(60) NOT NULL default '',
   MODIFY Db char(64) NOT NULL default '',
   MODIFY User char(16) NOT NULL default '',
   ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
-GO
 ALTER TABLE db
   MODIFY  Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
   MODIFY  Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
@@ -231,13 +202,11 @@ ALTER TABLE db
   MODIFY  Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
   MODIFY  Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
   MODIFY  Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL;
-GO
 
 ALTER TABLE host
   MODIFY Host char(60) NOT NULL default '',
   MODIFY Db char(64) NOT NULL default '',
   ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
-GO
 ALTER TABLE host
   MODIFY Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
   MODIFY Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
@@ -251,14 +220,11 @@ ALTER TABLE host
   MODIFY Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
   MODIFY Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
   MODIFY Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL;
-GO
 
 ALTER TABLE func
   ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
-GO
 ALTER TABLE func
   MODIFY type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL;
-GO
 
 #
 # Modify log tables.
@@ -295,7 +261,6 @@ ALTER TABLE plugin
   MODIFY name varchar(64) COLLATE utf8_general_ci NOT NULL DEFAULT '',
   MODIFY dl varchar(128) COLLATE utf8_general_ci NOT NULL DEFAULT '',
   CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
-GO
 
 #
 # Detect whether we had Create_view_priv
@@ -392,7 +357,6 @@ ALTER TABLE user MODIFY Create_user_priv
 UPDATE user LEFT JOIN db USING (Host,User) SET Create_user_priv='Y'
   WHERE @hadCreateUserPriv = 0 AND
         (user.Grant_priv = 'Y' OR db.Grant_priv = 'Y');
-GO
 
 #
 # procs_priv
@@ -401,26 +365,21 @@ GO
 ALTER TABLE procs_priv
   ENGINE=MyISAM,
   CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
-GO
 
 ALTER TABLE procs_priv
   MODIFY Proc_priv set('Execute','Alter Routine','Grant')
     COLLATE utf8_general_ci DEFAULT '' NOT NULL;
-GO
 
 ALTER IGNORE TABLE procs_priv
   MODIFY Routine_name char(64)
     COLLATE utf8_general_ci DEFAULT '' NOT NULL;
-GO
 
 ALTER TABLE procs_priv
   ADD Routine_type enum('FUNCTION','PROCEDURE')
     COLLATE utf8_general_ci NOT NULL AFTER Routine_name;
-GO
 
 ALTER TABLE procs_priv
   MODIFY Timestamp timestamp AFTER Proc_priv;
-GO
 
 #
 # proc
@@ -472,7 +431,6 @@ ALTER TABLE proc MODIFY name char(64) DE
                             'PAD_CHAR_TO_FULL_LENGTH'
                             ) DEFAULT '' NOT NULL,
                  DEFAULT CHARACTER SET utf8;
-GO
 
 # Correct the character set and collation
 ALTER TABLE proc CONVERT TO CHARACTER SET utf8;
@@ -483,77 +441,62 @@ ALTER TABLE proc  MODIFY db
                          char(77) collate utf8_bin DEFAULT '' NOT NULL,
                   MODIFY comment
                          char(64) collate utf8_bin DEFAULT '' NOT NULL;
-GO
 
 ALTER TABLE proc ADD character_set_client
                      char(32) collate utf8_bin DEFAULT NULL
                      AFTER comment;
-GO
 ALTER TABLE proc MODIFY character_set_client
                         char(32) collate utf8_bin DEFAULT NULL;
-GO
 
 SELECT CASE WHEN COUNT(*) > 0 THEN 
 CONCAT ("WARNING: NULL values of the 'character_set_client' column ('mysql.proc' table) have been updated with a default value (", @@character_set_client, "). Please verify if necessary.")
 ELSE NULL 
 END 
 AS value FROM proc WHERE character_set_client IS NULL;
-GO
 
 UPDATE proc SET character_set_client = @@character_set_client 
                      WHERE character_set_client IS NULL;
-GO
 
 ALTER TABLE proc ADD collation_connection
                      char(32) collate utf8_bin DEFAULT NULL
                      AFTER character_set_client;
-GO
 ALTER TABLE proc MODIFY collation_connection
                         char(32) collate utf8_bin DEFAULT NULL;
-GO
 
 SELECT CASE WHEN COUNT(*) > 0 THEN 
 CONCAT ("WARNING: NULL values of the 'collation_connection' column ('mysql.proc' table) have been updated with a default value (", @@collation_connection, "). Please verify if necessary.")
 ELSE NULL 
 END 
 AS value FROM proc WHERE collation_connection IS NULL;
-GO
 
 UPDATE proc SET collation_connection = @@collation_connection
                      WHERE collation_connection IS NULL;
-GO
 
 ALTER TABLE proc ADD db_collation
                      char(32) collate utf8_bin DEFAULT NULL
                      AFTER collation_connection;
-GO
 ALTER TABLE proc MODIFY db_collation
                         char(32) collate utf8_bin DEFAULT NULL;
-GO
 
 SELECT CASE WHEN COUNT(*) > 0 THEN 
 CONCAT ("WARNING: NULL values of the 'db_collation' column ('mysql.proc' table) have been updated with default values. Please verify if necessary.")
 ELSE NULL
 END
 AS value FROM proc WHERE db_collation IS NULL;
-GO
 
 UPDATE proc AS p SET db_collation  = 
                      ( SELECT DEFAULT_COLLATION_NAME 
                        FROM INFORMATION_SCHEMA.SCHEMATA 
                        WHERE SCHEMA_NAME = p.db)
                      WHERE db_collation IS NULL;
-GO
 
 ALTER TABLE proc ADD body_utf8 longblob DEFAULT NULL
                      AFTER db_collation;
-GO
 ALTER TABLE proc MODIFY body_utf8 longblob DEFAULT NULL;
 
 # Change comment from char(64) to text
 ALTER TABLE proc MODIFY comment
                         text collate utf8_bin NOT NULL;
-GO
 
 #
 # EVENT privilege
@@ -611,7 +554,6 @@ ALTER TABLE event MODIFY sql_mode
                             'NO_ENGINE_SUBSTITUTION',
                             'PAD_CHAR_TO_FULL_LENGTH'
                             ) DEFAULT '' NOT NULL AFTER on_completion;
-GO
 ALTER TABLE event MODIFY name char(64) CHARACTER SET utf8 NOT NULL default '';
 
 ALTER TABLE event MODIFY COLUMN originator INT UNSIGNED NOT NULL;
@@ -621,35 +563,27 @@ ALTER TABLE event MODIFY COLUMN status E
 
 ALTER TABLE event ADD COLUMN time_zone char(64) CHARACTER SET latin1
         NOT NULL DEFAULT 'SYSTEM' AFTER originator;
-GO
 
 ALTER TABLE event ADD character_set_client
                       char(32) collate utf8_bin DEFAULT NULL
                       AFTER time_zone;
-GO
 ALTER TABLE event MODIFY character_set_client
                          char(32) collate utf8_bin DEFAULT NULL;
-GO
 
 ALTER TABLE event ADD collation_connection
                       char(32) collate utf8_bin DEFAULT NULL
                       AFTER character_set_client;
-GO
 ALTER TABLE event MODIFY collation_connection
                          char(32) collate utf8_bin DEFAULT NULL;
-GO
 
 ALTER TABLE event ADD db_collation
                       char(32) collate utf8_bin DEFAULT NULL
                       AFTER collation_connection;
-GO
 ALTER TABLE event MODIFY db_collation
                          char(32) collate utf8_bin DEFAULT NULL;
-GO
 
 ALTER TABLE event ADD body_utf8 longblob DEFAULT NULL
                       AFTER db_collation;
-GO
 ALTER TABLE event MODIFY body_utf8 longblob DEFAULT NULL;
 
 
@@ -669,10 +603,7 @@ ALTER TABLE host MODIFY Trigger_priv enu
 ALTER TABLE db ADD Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL;
 ALTER TABLE db MODIFY Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL;
 
-ALTER TABLE tables_priv MODIFY Table_priv set('Select','Insert','Update','Delete','Create','Drop',
-                                              'Grant','References','Index','Alter','Create View','Show view','Trigger')
-  COLLATE utf8_general_ci DEFAULT '' NOT NULL;
-GO
+ALTER TABLE tables_priv MODIFY Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') COLLATE utf8_general_ci DEFAULT '' NOT NULL;
 
 UPDATE user SET Trigger_priv=Super_priv WHERE @hadTriggerPriv = 0;
 

=== modified file 'sql/sql_bootstrap.cc'
--- a/sql/sql_bootstrap.cc	2010-04-27 07:18:34 +0000
+++ b/sql/sql_bootstrap.cc	2010-04-28 09:58:50 +0000
@@ -67,35 +67,8 @@ int read_bootstrap_query(char *query, in
     if (strncmp(line, "delimiter", 9) == 0)
       continue;
 
-    if (query_len == 0)
-    {
-      if (line[len - 1] == ';')
-      {
-        /*
-          The first line is terminated by ';'.
-          This is a valid single line query.
-        */
-        memcpy(query, line, len);
-        *query_length= len;
-        query[len]= '\0';
-        return 0;
-      }
-    }
-    else
-    {
-      if ((len >= 2) && (line[0] == 'G') && (line[1] == 'O'))
-      {
-        /*
-          Found the multiline 'GO' delimiter.
-          This is a valid multi line query.
-        */
-        *query_length= query_len;
-        query[query_len]= '\0';
-        return 0;
-      }
-    }
-
     /* Append the current line to a multi line query. */
+
     if (query_len + len + 1 >= MAX_BOOTSTRAP_QUERY_SIZE)
       return READ_BOOTSTRAP_ERROR;
 
@@ -110,6 +83,17 @@ int read_bootstrap_query(char *query, in
     }
     memcpy(query + query_len, line, len);
     query_len+= len;
+
+    if (line[len - 1] == ';')
+    {
+      /*
+        The last line is terminated by ';'.
+        Return the query found.
+      */
+      query[query_len]= '\0';
+      *query_length= query_len;
+      return 0;
+    }
   }
 }
 


Attachment: [text/bzr-bundle] bzr/marc.alff@oracle.com-20100428095850-xk725qg7cgr045td.bundle
Thread
bzr push into mysql-next-mr-wl5291 branch (marc.alff:3142 to 3143)WL#5291Marc Alff28 Apr