List:Commits« Previous MessageNext Message »
From:Matthias Leich Date:July 26 2010 5:00pm
Subject:bzr commit into mysql-trunk-bugfixing branch (matthias.leich:3152)
Bug#53102
View as plain text  
#At file:///work2/repo/mysql-trunk-bugfixing-push/ based on revid:alik@stripped

 3152 Matthias Leich	2010-07-26 [merge]
      Merge of fix for Bug#53102 perfschema.pfs_upgrade fails on sol10 sparc64 max in parallel mode
      into actual tree. No conflicts.

    added:
      mysql-test/suite/perfschema/include/upgrade_check.inc
      mysql-test/suite/perfschema/t/selects-master.opt
    modified:
      mysql-test/collections/default.experimental
      mysql-test/suite/perfschema/r/query_cache.result
      mysql-test/suite/perfschema/r/selects.result
      mysql-test/suite/perfschema/t/bad_option_1.test
      mysql-test/suite/perfschema/t/bad_option_2.test
      mysql-test/suite/perfschema/t/global_read_lock.test
      mysql-test/suite/perfschema/t/pfs_upgrade.test
      mysql-test/suite/perfschema/t/privilege.test
      mysql-test/suite/perfschema/t/query_cache.test
      mysql-test/suite/perfschema/t/read_only.test
      mysql-test/suite/perfschema/t/selects.test
=== modified file 'mysql-test/collections/default.experimental'
--- a/mysql-test/collections/default.experimental	2010-07-26 08:47:30 +0000
+++ b/mysql-test/collections/default.experimental	2010-07-26 17:00:01 +0000
@@ -26,7 +26,6 @@ main.type_float @freebsd
 main.wait_timeout @solaris               # Bug#51244 2010-04-26 alik wait_timeout fails on OpenSolaris
 
 parts.partition_alter4_innodb            # Bug#45299 2010-06-28 alik Test "partition_alter4_innodb" is taking too long, timeout
-perfschema.pfs_upgrade                   # Bug#53102 2010-06-15 alik perfschema.pfs_upgrade fails on sol10 sparc64 max in parallel mode
 
 rpl.rpl_heartbeat_basic                  # BUG#54820 2010-06-26 alik rpl.rpl_heartbeat_basic fails sporadically again
 rpl.rpl_heartbeat_2slaves                # BUG#43828 2009-10-22 luis fails sporadically

=== added file 'mysql-test/suite/perfschema/include/upgrade_check.inc'
--- a/mysql-test/suite/perfschema/include/upgrade_check.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/include/upgrade_check.inc	2010-07-20 19:15:29 +0000
@@ -0,0 +1,29 @@
+# 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
+
+# Routine to be called by pfs_upgrade.test
+# $out_file and $err_file must be set within pfs_upgrade.test.
+#
+
+--error 1
+--exec $MYSQL_UPGRADE --skip-verbose > $out_file 2> $err_file
+
+# Verify that mysql_upgrade complained about the performance_schema
+--cat_file $err_file
+--error 0,1
+--remove_file $out_file
+--error 0,1
+--remove_file $err_file
+

=== modified file 'mysql-test/suite/perfschema/r/query_cache.result'
--- a/mysql-test/suite/perfschema/r/query_cache.result	2010-07-16 14:28:19 +0000
+++ b/mysql-test/suite/perfschema/r/query_cache.result	2010-07-20 19:15:29 +0000
@@ -65,3 +65,4 @@ Variable_name	Value
 Qcache_hits	1
 SET GLOBAL query_cache_size= default;
 drop table t1;
+flush status;

=== modified file 'mysql-test/suite/perfschema/r/selects.result'
--- a/mysql-test/suite/perfschema/r/selects.result	2010-01-12 01:47:27 +0000
+++ b/mysql-test/suite/perfschema/r/selects.result	2010-07-20 19:15:29 +0000
@@ -55,14 +55,21 @@ THREAD_ID	EVENT_ID
 [THREAD_ID]	[EVENT_ID]
 [THREAD_ID]	[EVENT_ID]
 [THREAD_ID]	[EVENT_ID]
+DROP TABLE IF EXISTS t_event;
+DROP EVENT IF EXISTS t_ps_event;
+CREATE TABLE t_event AS
+SELECT EVENT_ID FROM performance_schema.EVENTS_WAITS_CURRENT
+WHERE 1 = 2;
 CREATE EVENT t_ps_event
 ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 SECOND
-DO SELECT DISTINCT EVENT_ID
+DO INSERT INTO t_event
+SELECT DISTINCT EVENT_ID
 FROM performance_schema.EVENTS_WAITS_CURRENT
 JOIN performance_schema.EVENTS_WAITS_HISTORY USING (EVENT_ID)
 ORDER BY EVENT_ID
 LIMIT 1;
 ALTER TABLE t1 ADD COLUMN c INT;
+DROP TRIGGER IF EXISTS t_ps_trigger;
 CREATE TRIGGER t_ps_trigger BEFORE INSERT ON t1
 FOR EACH ROW BEGIN
 SET NEW.c = (SELECT MAX(EVENT_ID)
@@ -76,6 +83,7 @@ id	c
 12	[EVENT_ID]
 13	[EVENT_ID]
 DROP TRIGGER t_ps_trigger;
+DROP PROCEDURE IF EXISTS t_ps_proc;
 CREATE PROCEDURE t_ps_proc(IN tid INT, OUT pid INT)
 BEGIN
 SELECT id FROM performance_schema.PROCESSLIST
@@ -83,6 +91,7 @@ WHERE THREAD_ID = tid INTO pid;
 END;
 |
 CALL t_ps_proc(0, @p_id);
+DROP FUNCTION IF EXISTS t_ps_proc;
 CREATE FUNCTION t_ps_func(tid INT) RETURNS int
 BEGIN
 return (SELECT id FROM performance_schema.PROCESSLIST
@@ -92,6 +101,10 @@ END;
 SELECT t_ps_func(0) = @p_id;
 t_ps_func(0) = @p_id
 1
+SELECT * FROM t_event;
+EVENT_ID
+[EVENT_ID]
 DROP PROCEDURE t_ps_proc;
 DROP FUNCTION t_ps_func;
 DROP TABLE t1;
+DROP TABLE t_event;

=== modified file 'mysql-test/suite/perfschema/t/bad_option_1.test'
--- a/mysql-test/suite/perfschema/t/bad_option_1.test	2010-01-12 01:47:27 +0000
+++ b/mysql-test/suite/perfschema/t/bad_option_1.test	2010-07-20 19:15:29 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 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
@@ -10,8 +10,8 @@
 # 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
+# along with this program; if not, write to the Free Software Foundation,
+# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
 
 # Tests for PERFORMANCE_SCHEMA
 # Check error handling for invalid server start options
@@ -19,8 +19,11 @@
 --source include/not_embedded.inc
 --source include/have_perfschema.inc
 
+let $outfile= $MYSQLTEST_VARDIR/tmp/bad_option_1.txt;
+--error 0,1
+--remove_file $outfile
 --error 7
---exec $MYSQLD_BOOTSTRAP_CMD --loose-console --performance-schema-enabled=maybe > $MYSQLTEST_VARDIR/tmp/bad_option_1.txt 2>&1
+--exec $MYSQLD_BOOTSTRAP_CMD --loose-console --performance-schema-enabled=maybe > $outfile 2>&1
 
 perl;
     use strict;
@@ -42,4 +45,5 @@ perl;
     }
     close FILE;
 EOF
+--remove_file $outfile
 

=== modified file 'mysql-test/suite/perfschema/t/bad_option_2.test'
--- a/mysql-test/suite/perfschema/t/bad_option_2.test	2010-01-12 01:47:27 +0000
+++ b/mysql-test/suite/perfschema/t/bad_option_2.test	2010-07-20 19:15:29 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 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
@@ -10,8 +10,8 @@
 # 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
+# along with this program; if not, write to the Free Software Foundation,
+# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
 
 # Tests for PERFORMANCE_SCHEMA
 # Check error handling for ambiguous server start options
@@ -19,8 +19,11 @@
 --source include/not_embedded.inc
 --source include/have_perfschema.inc
 
+let $outfile= $MYSQLTEST_VARDIR/tmp/bad_option_2.txt;
+--error 0,1
+--remove_file $outfile
 --error 3
---exec $MYSQLD_BOOTSTRAP_CMD --loose-console --performance-schema-max_=12 > $MYSQLTEST_VARDIR/tmp/bad_option_2.txt 2>&1
+--exec $MYSQLD_BOOTSTRAP_CMD --loose-console --performance-schema-max_=12 > $outfile 2>&1
 
 perl;
     use strict;
@@ -41,4 +44,5 @@ perl;
     }
     close FILE;
 EOF
+--remove_file $outfile
 

=== modified file 'mysql-test/suite/perfschema/t/global_read_lock.test'
--- a/mysql-test/suite/perfschema/t/global_read_lock.test	2010-01-12 01:47:27 +0000
+++ b/mysql-test/suite/perfschema/t/global_read_lock.test	2010-07-20 19:15:29 +0000
@@ -81,6 +81,7 @@ update performance_schema.SETUP_INSTRUME
 unlock tables;
 
 disconnect con1;
+--source include/wait_until_disconnected.inc
 
 --echo connection default;
 connection default;

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

=== modified file 'mysql-test/suite/perfschema/t/privilege.test'
--- a/mysql-test/suite/perfschema/t/privilege.test	2010-01-12 01:47:27 +0000
+++ b/mysql-test/suite/perfschema/t/privilege.test	2010-07-20 19:15:29 +0000
@@ -350,9 +350,9 @@ TRUNCATE TABLE performance_schema.EVENTS
 TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT;
 
 --echo # Clean up
-
---connection default
 --disconnect pfs_user_4
+--source include/wait_until_disconnected.inc
+--connection default
 REVOKE ALL PRIVILEGES, GRANT OPTION FROM pfs_user_4;
 DROP USER pfs_user_4;
 flush privileges;

=== modified file 'mysql-test/suite/perfschema/t/query_cache.test'
--- a/mysql-test/suite/perfschema/t/query_cache.test	2010-07-16 14:28:19 +0000
+++ b/mysql-test/suite/perfschema/t/query_cache.test	2010-07-20 19:15:29 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (C) 2009 Sun Microsystems, Inc
 #
 # 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
@@ -10,8 +10,8 @@
 # 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,
-# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
+# 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
 
@@ -33,7 +33,6 @@ SET GLOBAL query_cache_size=1355776;
 
 flush query cache;
 reset query cache;
-# Reset Qcache_* to a known state
 flush status;
 
 select * from t1;
@@ -67,4 +66,5 @@ show status like "Qcache_hits";
 SET GLOBAL query_cache_size= default;
 
 drop table t1;
+flush status;
 

=== modified file 'mysql-test/suite/perfschema/t/read_only.test'
--- a/mysql-test/suite/perfschema/t/read_only.test	2010-01-12 01:47:27 +0000
+++ b/mysql-test/suite/perfschema/t/read_only.test	2010-07-20 19:15:29 +0000
@@ -85,6 +85,7 @@ update performance_schema.SETUP_INSTRUME
 --enable_result_log
 
 disconnect con1;
+--source include/wait_until_disconnected.inc
 
 --echo connection default;
 connection default;

=== added file 'mysql-test/suite/perfschema/t/selects-master.opt'
--- a/mysql-test/suite/perfschema/t/selects-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/selects-master.opt	2010-07-20 19:15:29 +0000
@@ -0,0 +1 @@
+--event-scheduler

=== modified file 'mysql-test/suite/perfschema/t/selects.test'
--- a/mysql-test/suite/perfschema/t/selects.test	2010-01-12 01:47:27 +0000
+++ b/mysql-test/suite/perfschema/t/selects.test	2010-07-20 19:15:29 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2009 Sun Microsystems, Inc
+# Copyright (c) 2008, 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
@@ -10,8 +10,8 @@
 # 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
+# along with this program; if not, write to the Free Software Foundation,
+# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
 
 --source include/not_embedded.inc
 --source include/have_perfschema.inc
@@ -85,20 +85,32 @@ LIMIT 5;
 
 # EVENT
 
+# Check that the event_scheduler is really running
+--source include/running_event_scheduler.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t_event;
+DROP EVENT IF EXISTS t_ps_event;
+--enable_warnings
+CREATE TABLE t_event AS
+SELECT EVENT_ID FROM performance_schema.EVENTS_WAITS_CURRENT
+WHERE 1 = 2;
 CREATE EVENT t_ps_event
 ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 SECOND
-DO SELECT DISTINCT EVENT_ID
+DO INSERT INTO t_event
+   SELECT DISTINCT EVENT_ID
    FROM performance_schema.EVENTS_WAITS_CURRENT
    JOIN performance_schema.EVENTS_WAITS_HISTORY USING (EVENT_ID)
    ORDER BY EVENT_ID
    LIMIT 1;
 
---sleep 2
-
 # TRIGGER
 
 ALTER TABLE t1 ADD COLUMN c INT;
 
+--disable_warnings
+DROP TRIGGER IF EXISTS t_ps_trigger;
+--enable_warnings
 delimiter |;
 
 CREATE TRIGGER t_ps_trigger BEFORE INSERT ON t1
@@ -119,6 +131,9 @@ DROP TRIGGER t_ps_trigger;
 
 # PROCEDURE
 
+--disable_warnings
+DROP PROCEDURE IF EXISTS t_ps_proc;
+--enable_warnings
 delimiter |;
 
 CREATE PROCEDURE t_ps_proc(IN tid INT, OUT pid INT)
@@ -135,6 +150,9 @@ CALL t_ps_proc(0, @p_id);
 
 # FUNCTION
 
+--disable_warnings
+DROP FUNCTION IF EXISTS t_ps_proc;
+--enable_warnings
 delimiter |;
 
 CREATE FUNCTION t_ps_func(tid INT) RETURNS int
@@ -149,8 +167,17 @@ delimiter ;|
 
 SELECT t_ps_func(0) = @p_id;
 
-DROP PROCEDURE t_ps_proc;
-DROP FUNCTION t_ps_func;
+# We might reach this point too early which means the event scheduler has not
+# execute our "t_ps_event". Therefore we poll till the record was inserted
+# and run our test statement afterwards.
+let $wait_timeout= 20;
+let $wait_condition= SELECT COUNT(*) = 1 FROM t_event;
+--source include/wait_condition.inc
+--replace_column 1 [EVENT_ID]
+SELECT * FROM t_event;
 
 # Clean up
+DROP PROCEDURE t_ps_proc;
+DROP FUNCTION t_ps_func;
 DROP TABLE t1;
+DROP TABLE t_event;


Attachment: [text/bzr-bundle] bzr/matthias.leich@sun.com-20100726170001-9k5on5s2qmcd1e9p.bundle
Thread
bzr commit into mysql-trunk-bugfixing branch (matthias.leich:3152)Bug#53102Matthias Leich26 Jul