#At file:///Users/malff/BZR_TREE/mysql-next-mr-wl5291/ based on revid:marc.alff@stripped
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
=== 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 commit into mysql-next-mr-wl5291 branch (marc.alff:3143) WL#5291 | Marc Alff | 28 Apr |