19 changed files with 892 additions and 131 deletions
-
4cmake/build_configurations/mysql_release.cmake
-
4cmake/os/Windows.cmake
-
282include/mysql/psi/mysql_thread.h
-
8libmysql_r/Makefile.am
-
115mysql-test/lib/v1/mysql-test-run.pl
-
16mysql-test/r/type_timestamp.result
-
3mysql-test/suite/perfschema/r/dml_setup_instruments.result
-
153mysql-test/suite/perfschema/r/pfs_upgrade.result
-
138mysql-test/suite/perfschema/t/pfs_upgrade.test
-
14mysql-test/t/type_timestamp.test
-
7plugin/Makefile.am
-
84scripts/mysql_system_tables.sql
-
8scripts/mysqld_safe.sh
-
11sql/item.h
-
127sql/mdl.cc
-
10sql/mdl.h
-
2storage/innobase/CMakeLists.txt
-
22storage/perfschema/pfs_instr.cc
-
15storage/perfschema/unittest/pfs-t.cc
@ -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 1644 (HY000) at line 178: Unexpected content found in the performance_schema database. |
|||
ERROR 1050 (42S01) at line 203: Table 'COND_INSTANCES' already exists |
|||
ERROR 1050 (42S01) at line 233: Table 'EVENTS_WAITS_CURRENT' already exists |
|||
ERROR 1050 (42S01) at line 247: Table 'EVENTS_WAITS_HISTORY' already exists |
|||
ERROR 1050 (42S01) at line 261: Table 'EVENTS_WAITS_HISTORY_LONG' already exists |
|||
ERROR 1050 (42S01) at line 281: Table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME' already exists |
|||
ERROR 1050 (42S01) at line 302: Table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' already exists |
|||
ERROR 1050 (42S01) at line 323: Table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' already exists |
|||
ERROR 1050 (42S01) at line 340: Table 'FILE_INSTANCES' already exists |
|||
ERROR 1050 (42S01) at line 359: Table 'FILE_SUMMARY_BY_EVENT_NAME' already exists |
|||
ERROR 1050 (42S01) at line 379: Table 'FILE_SUMMARY_BY_INSTANCE' already exists |
|||
ERROR 1050 (42S01) at line 396: Table 'MUTEX_INSTANCES' already exists |
|||
ERROR 1050 (42S01) at line 414: Table 'PERFORMANCE_TIMERS' already exists |
|||
ERROR 1050 (42S01) at line 431: Table 'PROCESSLIST' already exists |
|||
ERROR 1050 (42S01) at line 449: Table 'RWLOCK_INSTANCES' already exists |
|||
ERROR 1050 (42S01) at line 465: Table 'SETUP_CONSUMERS' already exists |
|||
ERROR 1050 (42S01) at line 482: Table 'SETUP_INSTRUMENTS' already exists |
|||
ERROR 1050 (42S01) at line 502: Table 'SETUP_OBJECTS' already exists |
|||
ERROR 1050 (42S01) at line 518: Table 'SETUP_TIMERS' already exists |
|||
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 1644 (HY000) at line 178: Unexpected content found in the performance_schema database. |
|||
ERROR 1050 (42S01) at line 203: Table 'COND_INSTANCES' already exists |
|||
ERROR 1050 (42S01) at line 233: Table 'EVENTS_WAITS_CURRENT' already exists |
|||
ERROR 1050 (42S01) at line 247: Table 'EVENTS_WAITS_HISTORY' already exists |
|||
ERROR 1050 (42S01) at line 261: Table 'EVENTS_WAITS_HISTORY_LONG' already exists |
|||
ERROR 1050 (42S01) at line 281: Table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME' already exists |
|||
ERROR 1050 (42S01) at line 302: Table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' already exists |
|||
ERROR 1050 (42S01) at line 323: Table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' already exists |
|||
ERROR 1050 (42S01) at line 340: Table 'FILE_INSTANCES' already exists |
|||
ERROR 1050 (42S01) at line 359: Table 'FILE_SUMMARY_BY_EVENT_NAME' already exists |
|||
ERROR 1050 (42S01) at line 379: Table 'FILE_SUMMARY_BY_INSTANCE' already exists |
|||
ERROR 1050 (42S01) at line 396: Table 'MUTEX_INSTANCES' already exists |
|||
ERROR 1050 (42S01) at line 414: Table 'PERFORMANCE_TIMERS' already exists |
|||
ERROR 1050 (42S01) at line 431: Table 'PROCESSLIST' already exists |
|||
ERROR 1050 (42S01) at line 449: Table 'RWLOCK_INSTANCES' already exists |
|||
ERROR 1050 (42S01) at line 465: Table 'SETUP_CONSUMERS' already exists |
|||
ERROR 1050 (42S01) at line 482: Table 'SETUP_INSTRUMENTS' already exists |
|||
ERROR 1050 (42S01) at line 502: Table 'SETUP_OBJECTS' already exists |
|||
ERROR 1050 (42S01) at line 518: Table 'SETUP_TIMERS' already exists |
|||
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 1644 (HY000) at line 178: Unexpected content found in the performance_schema database. |
|||
ERROR 1050 (42S01) at line 203: Table 'COND_INSTANCES' already exists |
|||
ERROR 1050 (42S01) at line 233: Table 'EVENTS_WAITS_CURRENT' already exists |
|||
ERROR 1050 (42S01) at line 247: Table 'EVENTS_WAITS_HISTORY' already exists |
|||
ERROR 1050 (42S01) at line 261: Table 'EVENTS_WAITS_HISTORY_LONG' already exists |
|||
ERROR 1050 (42S01) at line 281: Table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME' already exists |
|||
ERROR 1050 (42S01) at line 302: Table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' already exists |
|||
ERROR 1050 (42S01) at line 323: Table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' already exists |
|||
ERROR 1050 (42S01) at line 340: Table 'FILE_INSTANCES' already exists |
|||
ERROR 1050 (42S01) at line 359: Table 'FILE_SUMMARY_BY_EVENT_NAME' already exists |
|||
ERROR 1050 (42S01) at line 379: Table 'FILE_SUMMARY_BY_INSTANCE' already exists |
|||
ERROR 1050 (42S01) at line 396: Table 'MUTEX_INSTANCES' already exists |
|||
ERROR 1050 (42S01) at line 414: Table 'PERFORMANCE_TIMERS' already exists |
|||
ERROR 1050 (42S01) at line 431: Table 'PROCESSLIST' already exists |
|||
ERROR 1050 (42S01) at line 449: Table 'RWLOCK_INSTANCES' already exists |
|||
ERROR 1050 (42S01) at line 465: Table 'SETUP_CONSUMERS' already exists |
|||
ERROR 1050 (42S01) at line 482: Table 'SETUP_INSTRUMENTS' already exists |
|||
ERROR 1050 (42S01) at line 502: Table 'SETUP_OBJECTS' already exists |
|||
ERROR 1050 (42S01) at line 518: Table 'SETUP_TIMERS' already exists |
|||
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 1644 (HY000) at line 178: Unexpected content found in the performance_schema database. |
|||
ERROR 1050 (42S01) at line 203: Table 'COND_INSTANCES' already exists |
|||
ERROR 1050 (42S01) at line 233: Table 'EVENTS_WAITS_CURRENT' already exists |
|||
ERROR 1050 (42S01) at line 247: Table 'EVENTS_WAITS_HISTORY' already exists |
|||
ERROR 1050 (42S01) at line 261: Table 'EVENTS_WAITS_HISTORY_LONG' already exists |
|||
ERROR 1050 (42S01) at line 281: Table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME' already exists |
|||
ERROR 1050 (42S01) at line 302: Table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' already exists |
|||
ERROR 1050 (42S01) at line 323: Table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' already exists |
|||
ERROR 1050 (42S01) at line 340: Table 'FILE_INSTANCES' already exists |
|||
ERROR 1050 (42S01) at line 359: Table 'FILE_SUMMARY_BY_EVENT_NAME' already exists |
|||
ERROR 1050 (42S01) at line 379: Table 'FILE_SUMMARY_BY_INSTANCE' already exists |
|||
ERROR 1050 (42S01) at line 396: Table 'MUTEX_INSTANCES' already exists |
|||
ERROR 1050 (42S01) at line 414: Table 'PERFORMANCE_TIMERS' already exists |
|||
ERROR 1050 (42S01) at line 431: Table 'PROCESSLIST' already exists |
|||
ERROR 1050 (42S01) at line 449: Table 'RWLOCK_INSTANCES' already exists |
|||
ERROR 1050 (42S01) at line 465: Table 'SETUP_CONSUMERS' already exists |
|||
ERROR 1050 (42S01) at line 482: Table 'SETUP_INSTRUMENTS' already exists |
|||
ERROR 1050 (42S01) at line 502: Table 'SETUP_OBJECTS' already exists |
|||
ERROR 1050 (42S01) at line 518: Table 'SETUP_TIMERS' already exists |
|||
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 1644 (HY000) at line 178: Unexpected content found in the performance_schema database. |
|||
ERROR 1050 (42S01) at line 203: Table 'COND_INSTANCES' already exists |
|||
ERROR 1050 (42S01) at line 233: Table 'EVENTS_WAITS_CURRENT' already exists |
|||
ERROR 1050 (42S01) at line 247: Table 'EVENTS_WAITS_HISTORY' already exists |
|||
ERROR 1050 (42S01) at line 261: Table 'EVENTS_WAITS_HISTORY_LONG' already exists |
|||
ERROR 1050 (42S01) at line 281: Table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME' already exists |
|||
ERROR 1050 (42S01) at line 302: Table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' already exists |
|||
ERROR 1050 (42S01) at line 323: Table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' already exists |
|||
ERROR 1050 (42S01) at line 340: Table 'FILE_INSTANCES' already exists |
|||
ERROR 1050 (42S01) at line 359: Table 'FILE_SUMMARY_BY_EVENT_NAME' already exists |
|||
ERROR 1050 (42S01) at line 379: Table 'FILE_SUMMARY_BY_INSTANCE' already exists |
|||
ERROR 1050 (42S01) at line 396: Table 'MUTEX_INSTANCES' already exists |
|||
ERROR 1050 (42S01) at line 414: Table 'PERFORMANCE_TIMERS' already exists |
|||
ERROR 1050 (42S01) at line 431: Table 'PROCESSLIST' already exists |
|||
ERROR 1050 (42S01) at line 449: Table 'RWLOCK_INSTANCES' already exists |
|||
ERROR 1050 (42S01) at line 465: Table 'SETUP_CONSUMERS' already exists |
|||
ERROR 1050 (42S01) at line 482: Table 'SETUP_INSTRUMENTS' already exists |
|||
ERROR 1050 (42S01) at line 502: Table 'SETUP_OBJECTS' already exists |
|||
ERROR 1050 (42S01) at line 518: Table 'SETUP_TIMERS' already exists |
|||
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; |
|||
@ -0,0 +1,138 @@ |
|||
# 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 |
|||
|
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue