3247 Christopher Powers 2011-03-10 [merge]
Merge with mysql-trunk
added:
mysql-test/suite/perfschema/r/relaylog.result
mysql-test/suite/perfschema/t/relaylog.test
modified:
include/my_sys.h
mysql-test/collections/default.weekly
mysql-test/r/sp.result
mysql-test/r/trigger.result
mysql-test/t/disabled.def
mysql-test/t/sp.test
mysql-test/t/trigger.test
mysys/my_conio.c
sql/binlog.cc
sql/binlog.h
sql/item_strfunc.cc
sql/item_strfunc.h
sql/mysqld.cc
sql/mysqld.h
sql/rpl_rli.cc
sql/sql_trigger.cc
3246 Christopher Powers 2011-03-09
WL#4896 "Performance Schema Net IO"
- Fixed build warnings
modified:
include/mysql/psi/mysql_socket.h
include/mysql/psi/psi.h
include/mysql/psi/psi_abi_v1.h.pp
mysql-test/suite/perfschema/r/start_server_nothing.result
sql/mysqld.cc
storage/perfschema/pfs.cc
=== modified file 'include/my_sys.h'
--- a/include/my_sys.h 2011-03-09 20:54:55 +0000
+++ b/include/my_sys.h 2011-03-10 08:49:21 +0000
@@ -947,12 +947,12 @@ void my_security_attr_free(SECURITY_ATTR
/* implemented in my_conio.c */
my_bool my_win_is_console(FILE *file);
-char *my_win_console_readline(CHARSET_INFO *cs, char *mbbuf, size_t mbbufsize);
-void my_win_console_write(CHARSET_INFO *cs, const char *data, size_t datalen);
-void my_win_console_fputs(CHARSET_INFO *cs, const char *data);
-void my_win_console_putc(CHARSET_INFO *cs, int c);
-void my_win_console_vfprintf(CHARSET_INFO *cs, const char *fmt, va_list args);
-int my_win_translate_command_line_args(CHARSET_INFO *cs, int *ac, char ***av);
+char *my_win_console_readline(const CHARSET_INFO *cs, char *mbbuf, size_t mbbufsize);
+void my_win_console_write(const CHARSET_INFO *cs, const char *data, size_t datalen);
+void my_win_console_fputs(const CHARSET_INFO *cs, const char *data);
+void my_win_console_putc(const CHARSET_INFO *cs, int c);
+void my_win_console_vfprintf(const CHARSET_INFO *cs, const char *fmt, va_list args);
+int my_win_translate_command_line_args(const CHARSET_INFO *cs, int *ac, char ***av);
#endif /* __WIN__ */
#include <mysql/psi/psi.h>
=== modified file 'mysql-test/collections/default.weekly'
--- a/mysql-test/collections/default.weekly 2011-02-08 13:56:25 +0000
+++ b/mysql-test/collections/default.weekly 2011-03-10 04:29:36 +0000
@@ -1,8 +1,8 @@
-perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=big-tests --experimental=collections/default.experimental --vardir=var-big-tests --big-test --testcase-timeout=60 --suite-timeout=600 main.alter_table-big main.archive-big main.count_distinct3 main.create-big main.events_stress main.events_time_zone main.information_schema-big main.log_tables-big main.merge-big main.mysqlbinlog_row_big main.read_many_rows_innodb main.ssl-big main.sum_distinct-big main.type_newdecimal-big main.variables-big parts.part_supported_sql_func_innodb parts.partition_alter1_1_2_innodb parts.partition_alter1_2_innodb parts.partition_alter2_1_1_innodb parts.partition_alter2_1_2_innodb parts.partition_alter2_2_2_innodb parts.partition_alter4_innodb funcs_1.myisam_views-big
-perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-stmt-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam
-perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-row-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-binlog-row-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam --do-test=rpl --mysqld=--binlog-format=row
-perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-mixed-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-binlog-mixed-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam --do-test=rpl --mysqld=--binlog-format=mixed
-perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-stmt-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb
-perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-row-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-binlog-row-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --do-test=rpl --mysqld=--binlog-format=row
-perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-mixed-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-binlog-mixed-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --do-test=rpl --mysqld=--binlog-format=mixed
-perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=all_binlog_checksum --experimental=collections/default.experimental --mysqld=--binlog-checksum=CRC32 --vardir=var-all_binlog_checksum --suite=main,binlog,innodb,federated,rpl,sys_vars,perfschema
+perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=big-tests --experimental=collections/default.experimental --vardir=var-big-tests --big-test --testcase-timeout=60 --suite-timeout=600 main.alter_table-big main.archive-big main.count_distinct3 main.create-big main.events_stress main.events_time_zone main.information_schema-big main.log_tables-big main.merge-big main.mysqlbinlog_row_big main.read_many_rows_innodb main.ssl-big main.sum_distinct-big main.type_newdecimal-big main.variables-big parts.part_supported_sql_func_innodb parts.partition_alter1_1_2_innodb parts.partition_alter1_2_innodb parts.partition_alter2_1_1_innodb parts.partition_alter2_1_2_innodb parts.partition_alter2_2_2_innodb parts.partition_alter4_innodb funcs_1.myisam_views-big --skip-test-list=collections/disabled-weekly.list
+perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-stmt-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam --skip-test-list=collections/disabled-weekly.list
+perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-row-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-binlog-row-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam --do-test=rpl --mysqld=--binlog-format=row --skip-test-list=collections/disabled-weekly.list
+perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-mixed-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-binlog-mixed-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam --do-test=rpl --mysqld=--binlog-format=mixed --skip-test-list=collections/disabled-weekly.list
+perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-stmt-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --skip-test-list=collections/disabled-weekly.list
+perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-row-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-binlog-row-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --do-test=rpl --mysqld=--binlog-format=row --skip-test-list=collections/disabled-weekly.list
+perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-mixed-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-binlog-mixed-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --do-test=rpl --mysqld=--binlog-format=mixed --skip-test-list=collections/disabled-weekly.list
+perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=all_binlog_checksum --experimental=collections/default.experimental --mysqld=--binlog-checksum=CRC32 --vardir=var-all_binlog_checksum --suite=main,binlog,innodb,federated,rpl,sys_vars,perfschema --skip-test-list=collections/disabled-weekly.list
=== modified file 'mysql-test/r/sp.result'
--- a/mysql-test/r/sp.result 2010-11-10 11:26:45 +0000
+++ b/mysql-test/r/sp.result 2011-03-10 08:33:54 +0000
@@ -7452,4 +7452,34 @@ c1
# Cleanup
drop table t1;
drop procedure p1;
+
+# --
+# -- Bug 11765684 - 58674: SP-cache does not detect changes in
+# -- pre-locking list caused by triggers
+# ---
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+DROP TABLE IF EXISTS t3;
+DROP PROCEDURE IF EXISTS p1;
+CREATE TABLE t1(a INT);
+CREATE TABLE t2(a INT);
+CREATE TABLE t3(a INT);
+CREATE PROCEDURE p1()
+INSERT INTO t1(a) VALUES (1);
+
+CREATE TRIGGER t1_ai AFTER INSERT ON t1
+FOR EACH ROW
+INSERT INTO t2(a) VALUES (new.a);
+
+CALL p1();
+
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1
+FOR EACH ROW
+INSERT INTO t3(a) VALUES (new.a);
+
+CALL p1();
+
+DROP TABLE t1, t2, t3;
+DROP PROCEDURE p1;
+
# End of 5.5 test
=== modified file 'mysql-test/r/trigger.result'
--- a/mysql-test/r/trigger.result 2011-02-15 11:47:33 +0000
+++ b/mysql-test/r/trigger.result 2011-03-10 08:33:54 +0000
@@ -809,7 +809,6 @@ drop trigger t1_bi;
create trigger t1_bi after insert on t1 for each row insert into t3 values (new.id);
execute stmt1;
call p1();
-ERROR 42S02: Table 'test.t3' doesn't exist
deallocate prepare stmt1;
drop procedure p1;
drop table t1, t2, t3;
=== added file 'mysql-test/suite/perfschema/r/relaylog.result'
--- a/mysql-test/suite/perfschema/r/relaylog.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/r/relaylog.result 2011-03-10 12:30:05 +0000
@@ -0,0 +1,161 @@
+include/master-slave.inc
+[connection master]
+drop table if exists test.t1;
+reset master;
+create table test.t1(a int);
+drop table test.t1;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 # Query # # use `test`; create table test.t1(a int)
+slave-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+"============ Performance schema on master ============"
+select
+substring(file_name, locate("master-", file_name)) as FILE_NAME,
+EVENT_NAME,
+if (count_read > 0, "MANY", "NONE") as COUNT_READ,
+if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
+if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
+if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
+from performance_schema.file_summary_by_instance
+where file_name like "%master-%" order by file_name;
+FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
+master-bin.000001 wait/io/file/sql/binlog MANY MANY MANY MANY
+master-bin.index wait/io/file/sql/binlog_index NONE NONE NONE NONE
+select * from performance_schema.file_summary_by_instance
+where file_name like "%slave-%" order by file_name;
+FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
+"Expect a master binlog + binlog_index"
+select
+substring(file_name, locate("master-", file_name)) as FILE_NAME,
+EVENT_NAME,
+if (count_read > 0, "MANY", "NONE") as COUNT_READ,
+if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
+if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
+if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
+from performance_schema.file_summary_by_instance
+where event_name like "%binlog%" order by file_name;
+FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
+master-bin.000001 wait/io/file/sql/binlog MANY MANY MANY MANY
+master-bin.index wait/io/file/sql/binlog_index NONE NONE NONE NONE
+select
+EVENT_NAME,
+if (count_read > 0, "MANY", "NONE") as COUNT_READ,
+if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
+if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
+if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
+from performance_schema.file_summary_by_event_name
+where event_name like "%binlog%" order by event_name;
+EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
+wait/io/file/sql/binlog MANY MANY MANY MANY
+wait/io/file/sql/binlog_index MANY NONE NONE NONE
+select
+EVENT_NAME,
+if (count_star > 0, "MANY", "NONE") as COUNT_STAR
+from performance_schema.events_waits_summary_global_by_event_name
+where event_name like "%MYSQL_BIN_LOG%" order by event_name;
+EVENT_NAME COUNT_STAR
+wait/synch/cond/sql/MYSQL_BIN_LOG::COND_prep_xids NONE
+wait/synch/cond/sql/MYSQL_BIN_LOG::update_cond MANY
+wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index MANY
+wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_prep_xids NONE
+"Expect no slave relay log"
+select * from performance_schema.file_summary_by_instance
+where event_name like "%relaylog%" order by file_name;
+FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
+select * from performance_schema.file_summary_by_event_name
+where event_name like "%relaylog%" order by event_name;
+EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
+wait/io/file/sql/relaylog 0 0 0 0
+wait/io/file/sql/relaylog_index 0 0 0 0
+select * from performance_schema.events_waits_summary_global_by_event_name
+where event_name like "%MYSQL_RELAY_LOG%" order by event_name;
+EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+wait/synch/cond/sql/MYSQL_RELAY_LOG::update_cond 0 0 0 0 0
+wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_index 0 0 0 0 0
+"============ Performance schema on slave ============"
+select * from performance_schema.file_summary_by_instance
+where file_name like "%master-%" order by file_name;
+FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
+select
+substring(file_name, locate("slave-", file_name)) as FILE_NAME,
+EVENT_NAME,
+if (count_read > 0, "MANY", "NONE") as COUNT_READ,
+if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
+if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
+if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
+from performance_schema.file_summary_by_instance
+where file_name like "%slave-%" order by file_name;
+FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
+slave-bin.000001 wait/io/file/sql/binlog MANY MANY MANY MANY
+slave-bin.index wait/io/file/sql/binlog_index NONE NONE NONE NONE
+slave-relay-bin.000001 wait/io/file/sql/relaylog MANY MANY MANY MANY
+slave-relay-bin.000002 wait/io/file/sql/relaylog MANY MANY MANY MANY
+slave-relay-bin.index wait/io/file/sql/binlog_index NONE NONE NONE NONE
+"Expect a slave binlog + binlog_index"
+select
+substring(file_name, locate("slave-", file_name)) as FILE_NAME,
+EVENT_NAME,
+if (count_read > 0, "MANY", "NONE") as COUNT_READ,
+if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
+if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
+if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
+from performance_schema.file_summary_by_instance
+where event_name like "%binlog%" order by file_name;
+FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
+slave-bin.000001 wait/io/file/sql/binlog MANY MANY MANY MANY
+slave-bin.index wait/io/file/sql/binlog_index NONE NONE NONE NONE
+slave-relay-bin.index wait/io/file/sql/binlog_index NONE NONE NONE NONE
+select
+EVENT_NAME,
+if (count_read > 0, "MANY", "NONE") as COUNT_READ,
+if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
+if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
+if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
+from performance_schema.file_summary_by_event_name
+where event_name like "%binlog%" order by event_name;
+EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
+wait/io/file/sql/binlog MANY MANY MANY MANY
+wait/io/file/sql/binlog_index MANY NONE MANY NONE
+select
+EVENT_NAME,
+if (count_star > 0, "MANY", "NONE") as COUNT_STAR
+from performance_schema.events_waits_summary_global_by_event_name
+where event_name like "%MYSQL_BIN_LOG%" order by event_name;
+EVENT_NAME COUNT_STAR
+wait/synch/cond/sql/MYSQL_BIN_LOG::COND_prep_xids NONE
+wait/synch/cond/sql/MYSQL_BIN_LOG::update_cond NONE
+wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index MANY
+wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_prep_xids NONE
+"Expect a slave relay log"
+select
+substring(file_name, locate("slave-", file_name)) as FILE_NAME,
+EVENT_NAME,
+if (count_read > 0, "MANY", "NONE") as COUNT_READ,
+if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
+if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
+if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
+from performance_schema.file_summary_by_instance
+where event_name like "%relaylog%" order by file_name;
+FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
+slave-relay-bin.000001 wait/io/file/sql/relaylog MANY MANY MANY MANY
+slave-relay-bin.000002 wait/io/file/sql/relaylog MANY MANY MANY MANY
+select
+EVENT_NAME,
+if (count_read > 0, "MANY", "NONE") as COUNT_READ,
+if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
+if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
+if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
+from performance_schema.file_summary_by_event_name
+where event_name like "%relaylog%" order by event_name;
+EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
+wait/io/file/sql/relaylog MANY MANY MANY MANY
+wait/io/file/sql/relaylog_index MANY NONE NONE NONE
+select
+EVENT_NAME,
+if (count_star > 0, "MANY", "NONE") as COUNT_STAR
+from performance_schema.events_waits_summary_global_by_event_name
+where event_name like "%MYSQL_RELAY_LOG%" order by event_name;
+EVENT_NAME COUNT_STAR
+wait/synch/cond/sql/MYSQL_RELAY_LOG::update_cond MANY
+wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_index MANY
+include/stop_slave.inc
=== added file 'mysql-test/suite/perfschema/t/relaylog.test'
--- a/mysql-test/suite/perfschema/t/relaylog.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/relaylog.test 2011-03-10 12:02:28 +0000
@@ -0,0 +1,159 @@
+# Copyright (c) 2011, 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,
+# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
+
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/have_log_bin.inc
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+--source include/master-slave.inc
+
+--disable_warnings
+drop table if exists test.t1;
+--sync_slave_with_master
+reset master;
+--enable_warnings
+
+create table test.t1(a int);
+drop table test.t1;
+
+--source include/show_binlog_events.inc
+
+connection master;
+-- echo "============ Performance schema on master ============"
+
+select
+ substring(file_name, locate("master-", file_name)) as FILE_NAME,
+ EVENT_NAME,
+ if (count_read > 0, "MANY", "NONE") as COUNT_READ,
+ if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
+ if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
+ if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
+ from performance_schema.file_summary_by_instance
+ where file_name like "%master-%" order by file_name;
+
+select * from performance_schema.file_summary_by_instance
+ where file_name like "%slave-%" order by file_name;
+
+-- echo "Expect a master binlog + binlog_index"
+
+select
+ substring(file_name, locate("master-", file_name)) as FILE_NAME,
+ EVENT_NAME,
+ if (count_read > 0, "MANY", "NONE") as COUNT_READ,
+ if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
+ if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
+ if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
+ from performance_schema.file_summary_by_instance
+ where event_name like "%binlog%" order by file_name;
+
+select
+ EVENT_NAME,
+ if (count_read > 0, "MANY", "NONE") as COUNT_READ,
+ if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
+ if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
+ if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
+ from performance_schema.file_summary_by_event_name
+ where event_name like "%binlog%" order by event_name;
+
+select
+ EVENT_NAME,
+ if (count_star > 0, "MANY", "NONE") as COUNT_STAR
+ from performance_schema.events_waits_summary_global_by_event_name
+ where event_name like "%MYSQL_BIN_LOG%" order by event_name;
+
+-- echo "Expect no slave relay log"
+
+select * from performance_schema.file_summary_by_instance
+ where event_name like "%relaylog%" order by file_name;
+
+select * from performance_schema.file_summary_by_event_name
+ where event_name like "%relaylog%" order by event_name;
+
+select * from performance_schema.events_waits_summary_global_by_event_name
+ where event_name like "%MYSQL_RELAY_LOG%" order by event_name;
+
+sync_slave_with_master;
+-- echo "============ Performance schema on slave ============"
+
+select * from performance_schema.file_summary_by_instance
+ where file_name like "%master-%" order by file_name;
+
+select
+ substring(file_name, locate("slave-", file_name)) as FILE_NAME,
+ EVENT_NAME,
+ if (count_read > 0, "MANY", "NONE") as COUNT_READ,
+ if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
+ if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
+ if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
+ from performance_schema.file_summary_by_instance
+ where file_name like "%slave-%" order by file_name;
+
+-- echo "Expect a slave binlog + binlog_index"
+
+select
+ substring(file_name, locate("slave-", file_name)) as FILE_NAME,
+ EVENT_NAME,
+ if (count_read > 0, "MANY", "NONE") as COUNT_READ,
+ if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
+ if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
+ if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
+ from performance_schema.file_summary_by_instance
+ where event_name like "%binlog%" order by file_name;
+
+select
+ EVENT_NAME,
+ if (count_read > 0, "MANY", "NONE") as COUNT_READ,
+ if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
+ if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
+ if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
+ from performance_schema.file_summary_by_event_name
+ where event_name like "%binlog%" order by event_name;
+
+select
+ EVENT_NAME,
+ if (count_star > 0, "MANY", "NONE") as COUNT_STAR
+ from performance_schema.events_waits_summary_global_by_event_name
+ where event_name like "%MYSQL_BIN_LOG%" order by event_name;
+
+-- echo "Expect a slave relay log"
+
+select
+ substring(file_name, locate("slave-", file_name)) as FILE_NAME,
+ EVENT_NAME,
+ if (count_read > 0, "MANY", "NONE") as COUNT_READ,
+ if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
+ if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
+ if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
+ from performance_schema.file_summary_by_instance
+ where event_name like "%relaylog%" order by file_name;
+
+select
+ EVENT_NAME,
+ if (count_read > 0, "MANY", "NONE") as COUNT_READ,
+ if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
+ if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
+ if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
+ from performance_schema.file_summary_by_event_name
+ where event_name like "%relaylog%" order by event_name;
+
+select
+ EVENT_NAME,
+ if (count_star > 0, "MANY", "NONE") as COUNT_STAR
+ from performance_schema.events_waits_summary_global_by_event_name
+ where event_name like "%MYSQL_RELAY_LOG%" order by event_name;
+
+--source include/stop_slave.inc
+
=== modified file 'mysql-test/t/disabled.def'
--- a/mysql-test/t/disabled.def 2011-03-01 14:47:01 +0000
+++ b/mysql-test/t/disabled.def 2011-03-10 04:19:54 +0000
@@ -16,3 +16,4 @@ read_many_rows_innodb : Bug#37635 201
sum_distinct-big : Bug#56927 2010-11-15 mattiasj was not tested
alter_table-big : Bug#37248 2010-11-15 mattiasj was not tested
create-big : Bug#37248 2010-11-15 mattiasj was not tested
+archive-big : Bug#11817185 2011-03-10 Anitha Disabled since this leads to timeout on Solaris Sparc
=== modified file 'mysql-test/t/sp.test'
--- a/mysql-test/t/sp.test 2010-08-04 10:34:01 +0000
+++ b/mysql-test/t/sp.test 2011-03-10 08:33:54 +0000
@@ -8713,4 +8713,45 @@ call p1(3, 2);
drop table t1;
drop procedure p1;
+--echo
+--echo # --
+--echo # -- Bug 11765684 - 58674: SP-cache does not detect changes in
+--echo # -- pre-locking list caused by triggers
+--echo # ---
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+DROP TABLE IF EXISTS t3;
+DROP PROCEDURE IF EXISTS p1;
+--enable_warnings
+
+CREATE TABLE t1(a INT);
+CREATE TABLE t2(a INT);
+CREATE TABLE t3(a INT);
+
+CREATE PROCEDURE p1()
+ INSERT INTO t1(a) VALUES (1);
+
+--echo
+CREATE TRIGGER t1_ai AFTER INSERT ON t1
+ FOR EACH ROW
+ INSERT INTO t2(a) VALUES (new.a);
+
+--echo
+CALL p1();
+
+--echo
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1
+ FOR EACH ROW
+ INSERT INTO t3(a) VALUES (new.a);
+
+--echo
+CALL p1();
+
+--echo
+DROP TABLE t1, t2, t3;
+DROP PROCEDURE p1;
+--echo
+
--echo # End of 5.5 test
=== modified file 'mysql-test/t/trigger.test'
--- a/mysql-test/t/trigger.test 2011-02-15 11:47:33 +0000
+++ b/mysql-test/t/trigger.test 2011-03-10 08:33:54 +0000
@@ -984,10 +984,6 @@ call p1();
drop trigger t1_bi;
create trigger t1_bi after insert on t1 for each row insert into t3 values (new.id);
execute stmt1;
-# Until we implement proper mechanism for invalidation of SP statements
-# invoked whenever a table used in SP changes, this statement will fail with
-# 'Table ... does not exist' error.
---error ER_NO_SUCH_TABLE
call p1();
deallocate prepare stmt1;
drop procedure p1;
=== modified file 'mysys/my_conio.c'
--- a/mysys/my_conio.c 2011-02-23 04:53:07 +0000
+++ b/mysys/my_conio.c 2011-03-10 08:49:21 +0000
@@ -59,7 +59,7 @@ my_win_is_console(FILE *file)
@rerval Pointer to mbbuf, or NULL on I/0 error.
*/
char *
-my_win_console_readline(CHARSET_INFO *cs, char *mbbuf, size_t mbbufsize)
+my_win_console_readline(const CHARSET_INFO *cs, char *mbbuf, size_t mbbufsize)
{
uint dummy_errors;
static wchar_t u16buf[MAX_CONSOLE_LINE_SIZE + 1], *pos;
@@ -109,10 +109,10 @@ my_win_console_readline(CHARSET_INFO *cs
@param to_chars Number of characters available in "to"
*/
static size_t
-my_mbstou16s(CHARSET_INFO *cs, const uchar * from, size_t from_length,
+my_mbstou16s(const CHARSET_INFO *cs, const uchar * from, size_t from_length,
wchar_t *to, size_t to_chars)
{
- CHARSET_INFO *to_cs= &my_charset_utf16le_bin;
+ const CHARSET_INFO *to_cs= &my_charset_utf16le_bin;
const uchar *from_end= from + from_length;
wchar_t *to_orig= to, *to_end= to + to_chars;
my_charset_conv_mb_wc mb_wc= cs->cset->mb_wc;
@@ -179,7 +179,7 @@ outp:
@param datalen Length of input string in bytes
*/
void
-my_win_console_write(CHARSET_INFO *cs, const char *data, size_t datalen)
+my_win_console_write(const CHARSET_INFO *cs, const char *data, size_t datalen)
{
static wchar_t u16buf[MAX_CONSOLE_LINE_SIZE + 1];
size_t nchars= my_mbstou16s(cs, (const uchar *) data, datalen,
@@ -200,7 +200,7 @@ my_win_console_write(CHARSET_INFO *cs, c
@param c Character (single byte)
*/
void
-my_win_console_putc(CHARSET_INFO *cs, int c)
+my_win_console_putc(const CHARSET_INFO *cs, int c)
{
char ch= (char) c;
my_win_console_write(cs, &ch, 1);
@@ -214,7 +214,7 @@ my_win_console_putc(CHARSET_INFO *cs, in
@param data String to print
*/
void
-my_win_console_fputs(CHARSET_INFO *cs, const char *data)
+my_win_console_fputs(const CHARSET_INFO *cs, const char *data)
{
my_win_console_write(cs, data, strlen(data));
}
@@ -224,7 +224,7 @@ my_win_console_fputs(CHARSET_INFO *cs, c
Handle formatted output on the Windows console.
*/
void
-my_win_console_vfprintf(CHARSET_INFO *cs, const char *fmt, va_list args)
+my_win_console_vfprintf(const CHARSET_INFO *cs, const char *fmt, va_list args)
{
static char buff[MAX_CONSOLE_LINE_SIZE + 1];
size_t len= vsnprintf(buff, sizeof(buff) - 1, fmt, args);
@@ -244,7 +244,7 @@ my_win_console_vfprintf(CHARSET_INFO *cs
@param[OUT] argv Write pointer to allocated parameters here.
*/
int
-my_win_translate_command_line_args(CHARSET_INFO *cs, int *argc, char ***argv)
+my_win_translate_command_line_args(const CHARSET_INFO *cs, int *argc, char ***argv)
{
int i, ac;
char **av;
=== modified file 'sql/binlog.cc'
--- a/sql/binlog.cc 2011-01-10 06:17:31 +0000
+++ b/sql/binlog.cc 2011-03-10 10:08:09 +0000
@@ -1602,11 +1602,9 @@ void MYSQL_BIN_LOG::init(bool no_auto_ev
void MYSQL_BIN_LOG::init_pthread_objects()
{
- DBUG_ASSERT(inited == 0);
- inited= 1;
- mysql_mutex_init(key_LOG_LOCK_log, &LOCK_log, MY_MUTEX_INIT_SLOW);
- mysql_mutex_init(key_BINLOG_LOCK_index, &LOCK_index, MY_MUTEX_INIT_SLOW);
- mysql_cond_init(key_BINLOG_update_cond, &update_cond, 0);
+ MYSQL_LOG::init_pthread_objects();
+ mysql_mutex_init(m_key_LOCK_index, &LOCK_index, MY_MUTEX_INIT_SLOW);
+ mysql_cond_init(m_key_update_cond, &update_cond, 0);
}
@@ -1650,7 +1648,7 @@ bool MYSQL_BIN_LOG::open_index_file(cons
return TRUE;
}
- if ((index_file_nr= mysql_file_open(key_file_binlog_index,
+ if ((index_file_nr= mysql_file_open(m_key_file_log_index,
index_file_name,
O_RDWR | O_CREAT | O_BINARY,
MYF(MY_WME))) < 0 ||
@@ -1766,7 +1764,7 @@ bool MYSQL_BIN_LOG::open(const char *log
/* open the main log file */
if (MYSQL_LOG::open(
#ifdef HAVE_PSI_INTERFACE
- key_file_binlog,
+ m_key_file_log,
#endif
log_name, log_type_arg, new_name, io_cache_type_arg))
{
@@ -2909,7 +2907,7 @@ int MYSQL_BIN_LOG::purge_index_entry(THD
/* Get rid of the trailing '\n' */
log_info.log_file_name[length-1]= 0;
- if (!mysql_file_stat(key_file_binlog, log_info.log_file_name, &s, MYF(0)))
+ if (!mysql_file_stat(m_key_file_log, log_info.log_file_name, &s, MYF(0)))
{
if (my_errno == ENOENT)
{
@@ -3084,7 +3082,7 @@ int MYSQL_BIN_LOG::purge_logs_before_dat
!is_active(log_info.log_file_name) &&
!log_in_use(log_info.log_file_name))
{
- if (!mysql_file_stat(key_file_binlog,
+ if (!mysql_file_stat(m_key_file_log,
log_info.log_file_name, &stat_area, MYF(0)))
{
if (my_errno == ENOENT)
=== modified file 'sql/binlog.h'
--- a/sql/binlog.h 2011-01-10 06:17:31 +0000
+++ b/sql/binlog.h 2011-03-10 10:08:09 +0000
@@ -26,6 +26,16 @@ class Format_description_log_event;
class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG
{
private:
+#ifdef HAVE_PSI_INTERFACE
+ /** The instrumentation key to use for @ LOCK_index. */
+ PSI_mutex_key m_key_LOCK_index;
+ /** The instrumentation key to use for @ update_cond. */
+ PSI_cond_key m_key_update_cond;
+ /** The instrumentation key to use for opening the log file. */
+ PSI_file_key m_key_file_log;
+ /** The instrumentation key to use for opening the log index file. */
+ PSI_file_key m_key_file_log_index;
+#endif
/* LOCK_log and LOCK_index are inited by init_pthread_objects() */
mysql_mutex_t LOCK_index;
mysql_mutex_t LOCK_prep_xids;
@@ -155,6 +165,19 @@ public:
on exit() - but only during the correct shutdown process
*/
+#ifdef HAVE_PSI_INTERFACE
+ void set_psi_keys(PSI_mutex_key key_LOCK_index,
+ PSI_cond_key key_update_cond,
+ PSI_file_key key_file_log,
+ PSI_file_key key_file_log_index)
+ {
+ m_key_LOCK_index= key_LOCK_index;
+ m_key_update_cond= key_update_cond;
+ m_key_file_log= key_file_log;
+ m_key_file_log_index= key_file_log_index;
+ }
+#endif
+
int open(const char *opt_name);
void close();
int log_xid(THD *thd, my_xid xid);
=== modified file 'sql/item_strfunc.cc'
--- a/sql/item_strfunc.cc 2011-03-09 20:54:55 +0000
+++ b/sql/item_strfunc.cc 2011-03-10 08:23:14 +0000
@@ -2075,7 +2075,7 @@ void Item_func_decode::crypto_transform(
}
-Item *Item_func_sysconst::safe_charset_converter(CHARSET_INFO *tocs)
+Item *Item_func_sysconst::safe_charset_converter(const CHARSET_INFO *tocs)
{
Item_string *conv;
uint conv_errors;
=== modified file 'sql/item_strfunc.h'
--- a/sql/item_strfunc.h 2011-03-09 20:54:55 +0000
+++ b/sql/item_strfunc.h 2011-03-10 08:23:14 +0000
@@ -454,7 +454,7 @@ class Item_func_sysconst :public Item_st
public:
Item_func_sysconst()
{ collation.set(system_charset_info,DERIVATION_SYSCONST); }
- Item *safe_charset_converter(CHARSET_INFO *tocs);
+ Item *safe_charset_converter(const CHARSET_INFO *tocs);
/*
Used to create correct Item name in new converted item in
safe_charset_converter, return string representation of this function
=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc 2011-03-09 23:28:32 +0000
+++ b/sql/mysqld.cc 2011-03-10 15:04:18 +0000
@@ -3179,6 +3179,18 @@ int init_common_variables()
*/
global_system_variables.time_zone= my_tz_SYSTEM;
+#ifdef HAVE_PSI_INTERFACE
+ /*
+ Complete the mysql_bin_log initialization.
+ Instrumentation keys are known only after the performance schema initialization,
+ and can not be set in the MYSQL_BIN_LOG constructor (called before main()).
+ */
+ mysql_bin_log.set_psi_keys(key_BINLOG_LOCK_index,
+ key_BINLOG_update_cond,
+ key_file_binlog,
+ key_file_binlog_index);
+#endif
+
/*
Init mutexes for the global MYSQL_BIN_LOG objects.
As safe_mutex depends on what MY_INIT() does, we can't init the mutexes of
@@ -7968,6 +7980,7 @@ PSI_mutex_key key_BINLOG_LOCK_index, key
key_structure_guard_mutex, key_TABLE_SHARE_LOCK_ha_data,
key_LOCK_error_messages, key_LOG_INFO_lock, key_LOCK_thread_count,
key_PARTITION_LOCK_auto_inc;
+PSI_mutex_key key_RELAYLOG_LOCK_index;
static PSI_mutex_info all_server_mutexes[]=
{
@@ -7984,6 +7997,7 @@ static PSI_mutex_info all_server_mutexes
{ &key_BINLOG_LOCK_index, "MYSQL_BIN_LOG::LOCK_index", 0},
{ &key_BINLOG_LOCK_prep_xids, "MYSQL_BIN_LOG::LOCK_prep_xids", 0},
+ { &key_RELAYLOG_LOCK_index, "MYSQL_RELAY_LOG::LOCK_index", 0},
{ &key_delayed_insert_mutex, "Delayed_insert::mutex", 0},
{ &key_hash_filo_lock, "hash_filo::lock", 0},
{ &key_LOCK_active_mi, "LOCK_active_mi", PSI_FLAG_GLOBAL},
@@ -8050,6 +8064,7 @@ PSI_cond_key key_BINLOG_COND_prep_xids,
key_relay_log_info_start_cond, key_relay_log_info_stop_cond,
key_TABLE_SHARE_cond, key_user_level_lock_cond,
key_COND_thread_count, key_COND_thread_cache, key_COND_flush_thread_cache;
+PSI_cond_key key_RELAYLOG_update_cond;
static PSI_cond_info all_server_conds[]=
{
@@ -8063,6 +8078,7 @@ static PSI_cond_info all_server_conds[]=
#endif /* HAVE_MMAP */
{ &key_BINLOG_COND_prep_xids, "MYSQL_BIN_LOG::COND_prep_xids", 0},
{ &key_BINLOG_update_cond, "MYSQL_BIN_LOG::update_cond", 0},
+ { &key_RELAYLOG_update_cond, "MYSQL_RELAY_LOG::update_cond", 0},
{ &key_COND_cache_status_changed, "Query_cache::COND_cache_status_changed", 0},
{ &key_COND_manager, "COND_manager", PSI_FLAG_GLOBAL},
{ &key_COND_server_started, "COND_server_started", PSI_FLAG_GLOBAL},
@@ -8125,6 +8141,7 @@ PSI_file_key key_file_binlog, key_file_b
key_file_pid, key_file_relay_log_info, key_file_send_file, key_file_tclog,
key_file_trg, key_file_trn, key_file_init;
PSI_file_key key_file_query_log, key_file_slow_log;
+PSI_file_key key_file_relaylog, key_file_relaylog_index;
static PSI_file_info all_server_files[]=
{
@@ -8133,6 +8150,8 @@ static PSI_file_info all_server_files[]=
#endif /* HAVE_MMAP */
{ &key_file_binlog, "binlog", 0},
{ &key_file_binlog_index, "binlog_index", 0},
+ { &key_file_relaylog, "relaylog", 0},
+ { &key_file_relaylog_index, "relaylog_index", 0},
{ &key_file_casetest, "casetest", 0},
{ &key_file_dbopt, "dbopt", 0},
{ &key_file_des_key_file, "des_key_file", 0},
=== modified file 'sql/mysqld.h'
--- a/sql/mysqld.h 2011-03-09 21:42:42 +0000
+++ b/sql/mysqld.h 2011-03-10 15:04:18 +0000
@@ -254,6 +254,7 @@ extern PSI_mutex_key key_BINLOG_LOCK_ind
key_relay_log_info_log_space_lock, key_relay_log_info_run_lock,
key_structure_guard_mutex, key_TABLE_SHARE_LOCK_ha_data,
key_LOCK_error_messages, key_LOCK_thread_count, key_PARTITION_LOCK_auto_inc;
+extern PSI_mutex_key key_RELAYLOG_LOCK_index;
extern PSI_rwlock_key key_rwlock_LOCK_grant, key_rwlock_LOCK_logger,
key_rwlock_LOCK_sys_init_connect, key_rwlock_LOCK_sys_init_slave,
@@ -273,6 +274,7 @@ extern PSI_cond_key key_BINLOG_COND_prep
key_relay_log_info_start_cond, key_relay_log_info_stop_cond,
key_TABLE_SHARE_cond, key_user_level_lock_cond,
key_COND_thread_count, key_COND_thread_cache, key_COND_flush_thread_cache;
+extern PSI_cond_key key_RELAYLOG_update_cond;
extern PSI_thread_key key_thread_bootstrap, key_thread_delayed_insert,
key_thread_handle_manager, key_thread_kill_server, key_thread_main,
@@ -290,6 +292,7 @@ extern PSI_file_key key_file_binlog, key
key_file_pid, key_file_relay_log_info, key_file_send_file, key_file_tclog,
key_file_trg, key_file_trn, key_file_init;
extern PSI_file_key key_file_query_log, key_file_slow_log;
+extern PSI_file_key key_file_relaylog, key_file_relaylog_index;
extern PSI_socket_key key_socket_tcpip, key_socket_unix, key_socket_client_connection;
void init_server_psi_keys();
=== modified file 'sql/rpl_rli.cc'
--- a/sql/rpl_rli.cc 2010-12-21 09:33:41 +0000
+++ b/sql/rpl_rli.cc 2011-03-10 10:08:09 +0000
@@ -77,6 +77,13 @@ Relay_log_info::Relay_log_info(bool is_s
{
DBUG_ENTER("Relay_log_info::Relay_log_info");
+#ifdef HAVE_PSI_INTERFACE
+ relay_log.set_psi_keys(key_RELAYLOG_LOCK_index,
+ key_RELAYLOG_update_cond,
+ key_file_relaylog,
+ key_file_relaylog_index);
+#endif
+
group_relay_log_name[0]= event_relay_log_name[0]=
group_master_log_name[0]= 0;
until_log_name[0]= ign_master_log_name_end[0]= 0;
@@ -104,7 +111,7 @@ static inline int add_relay_log(Relay_lo
{
MY_STAT s;
DBUG_ENTER("add_relay_log");
- if (!mysql_file_stat(key_file_binlog,
+ if (!mysql_file_stat(key_file_relaylog,
linfo->log_file_name, &s, MYF(0)))
{
sql_print_error("log %s listed in the index, but failed to stat",
=== modified file 'sql/sql_trigger.cc'
--- a/sql/sql_trigger.cc 2011-03-09 20:54:55 +0000
+++ b/sql/sql_trigger.cc 2011-03-10 08:33:54 +0000
@@ -30,6 +30,7 @@
#include "sql_db.h" // get_default_db_collation
#include "sql_acl.h" // *_ACL, is_acl_user
#include "sql_handler.h" // mysql_ha_rm_tables
+#include "sp_cache.h" // sp_invalidate_cache
/*************************************************************************/
@@ -517,6 +518,12 @@ bool mysql_create_or_drop_trigger(THD *t
*/
thd->locked_tables_list.reopen_tables(thd);
+ /*
+ Invalidate SP-cache. That's needed because triggers may change list of
+ pre-locking tables.
+ */
+ sp_cache_invalidate();
+
end:
if (!result)
{
Attachment: [text/bzr-bundle] bzr/chris.powers@oracle.com-20110310150418-nki1danejz5x0pud.bundle
| Thread |
|---|
| • bzr push into mysql-trunk branch (chris.powers:3246 to 3247) | Christopher Powers | 10 Mar |