From: Marc Alff Date: January 9 2012 8:29am Subject: bzr push into mysql-trunk-pfs-tuning branch (marc.alff:3462 to 3463) List-Archive: http://lists.mysql.com/commits/142337 Message-Id: <201201090829.q098TqPL030079@acsmt356.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3463 Marc Alff 2012-01-09 [merge] Merge mysql-trunk --> mysql-trunk-pfs-tuning modified: mysql-test/r/myisampack.result mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test mysql-test/suite/engines/funcs/r/tc_rename_error.result mysql-test/suite/perfschema/r/misc.result mysql-test/suite/perfschema/t/misc.test mysql-test/t/myisampack.test sql/sql_db.cc storage/perfschema/pfs.cc 3462 Marc Alff 2012-01-06 Code cleanup modified: storage/perfschema/pfs_instr.h === modified file 'mysql-test/r/myisampack.result' --- a/mysql-test/r/myisampack.result 2011-11-28 07:42:18 +0000 +++ b/mysql-test/r/myisampack.result 2012-01-09 07:26:17 +0000 @@ -150,3 +150,10 @@ CHECK TABLE t1; Table Op Msg_type Msg_text test.t1 check status OK DROP TABLE t1; +# +# BUG#11751736: DROP DATABASE STATEMENT SHOULD REMOVE .OLD SUFFIX FROM +# DATABASE DIRECTORY +# +CREATE DATABASE db1; +CREATE TABLE db1.t1(c1 INT) ENGINE=MyISAM; +DROP DATABASE db1; === modified file 'mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result' --- a/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result 2010-08-10 11:58:46 +0000 +++ b/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result 2012-01-06 10:28:00 +0000 @@ -54,13 +54,13 @@ USE test; # SET @old_log_warnings = @@log_warnings; DROP TABLE IF EXISTS t1; -CREATE TABLE t1 (a VARCHAR(36), b VARCHAR(10)); +CREATE TABLE t1 (a VARCHAR(36), b VARCHAR(15)); SET GLOBAL LOG_WARNINGS = 0; -INSERT INTO t1 VALUES(UUID(), 'Bug#46265'); +INSERT INTO t1 VALUES(UUID(), 'timestamp'); Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. SET GLOBAL LOG_WARNINGS = 1; -INSERT INTO t1 VALUES(UUID(), 'Bug#46265'); +INSERT INTO t1 VALUES(UUID(), 'timestamp'); Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. DROP TABLE t1; === modified file 'mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test' --- a/mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test 2010-11-17 10:23:22 +0000 +++ b/mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test 2012-01-06 10:28:00 +0000 @@ -102,16 +102,24 @@ eval USE $old_db; --echo # Bug#46265: Can not disable warning about unsafe statements for binary logging --echo # +let BINLOG_COUNTER1= `select CONVERT(NOW(),UNSIGNED) as timestmap from dual`; + SET @old_log_warnings = @@log_warnings; --disable_warnings DROP TABLE IF EXISTS t1; --enable_warnings -CREATE TABLE t1 (a VARCHAR(36), b VARCHAR(10)); +CREATE TABLE t1 (a VARCHAR(36), b VARCHAR(15)); + SET GLOBAL LOG_WARNINGS = 0; -INSERT INTO t1 VALUES(UUID(), 'Bug#46265'); +# Replacing the result file content here. +# Instead of writing $BINLOG_COUNTER1 value to result file, +# writing a fixed string timestamp to it. +--replace_result $BINLOG_COUNTER1 timestamp +eval INSERT INTO t1 VALUES(UUID(), '$BINLOG_COUNTER1'); SET GLOBAL LOG_WARNINGS = 1; -INSERT INTO t1 VALUES(UUID(), 'Bug#46265'); +--replace_result $BINLOG_COUNTER1 timestamp +eval INSERT INTO t1 VALUES(UUID(), '$BINLOG_COUNTER1'); DROP TABLE t1; SET GLOBAL log_warnings = @old_log_warnings; @@ -133,13 +141,14 @@ perl; use strict; my $log_error= $ENV{'LOG_ERROR'} or die "LOG_ERROR not set"; open(FILE, "$log_error") or die("Unable to open $log_error: $!\n"); - my $count = () = grep(/Bug#46265/g,); + my $binlog_counter= $ENV{'BINLOG_COUNTER1'} or die "BINLOG_COUNTER1 not set"; + my $count = () = grep(/$binlog_counter/g,); + # Grep the timestamp value from the error file. print "Occurrences: $count\n"; close(FILE); EOF # bug#50192: diplaying the unsafe warning comes out to the user warning stack - -- disable_warnings DROP TABLE IF EXISTS t1, t2; -- enable_warnings === modified file 'mysql-test/suite/engines/funcs/r/tc_rename_error.result' --- a/mysql-test/suite/engines/funcs/r/tc_rename_error.result 2010-03-18 06:42:07 +0000 +++ b/mysql-test/suite/engines/funcs/r/tc_rename_error.result 2012-01-06 11:49:46 +0000 @@ -15,7 +15,7 @@ ERROR 42S01: Table 't1' already exists RENAME TABLE t3 TO t1; ERROR 42S01: Table 't1' already exists RENAME TABLE t3 TO doesnotexist.t1; -ERROR HY000: Can't find file: './test/t3.frm' (errno: 2) +ERROR HY000: Can't find file: './test/t3.frm' (errno: 2 - No such file or directory) SHOW TABLES; Tables_in_test t1 === modified file 'mysql-test/suite/perfschema/r/misc.result' --- a/mysql-test/suite/perfschema/r/misc.result 2012-01-04 18:29:43 +0000 +++ b/mysql-test/suite/perfschema/r/misc.result 2012-01-06 15:54:45 +0000 @@ -19,6 +19,21 @@ DROP TABLE test.t_after; SELECT object_schema, object_name FROM performance_schema.objects_summary_global_by_type WHERE object_schema='test'; object_schema object_name +CREATE TABLE test.t1(a INT); +INSERT INTO test.t1 VALUES (1); +CREATE VIEW test.v1 AS SELECT * FROM test.t1; +SELECT COUNT(*) FROM test.v1; +COUNT(*) +1 +SELECT object_schema, object_name FROM performance_schema.objects_summary_global_by_type +WHERE object_schema='test'; +object_schema object_name +test t1 +DROP VIEW test.v1; +DROP TABLE test.t1; +SELECT object_schema, object_name FROM performance_schema.objects_summary_global_by_type +WHERE object_schema='test'; +object_schema object_name SELECT EVENT_ID FROM performance_schema.events_waits_current WHERE THREAD_ID IN (SELECT THREAD_ID FROM performance_schema.threads) === modified file 'mysql-test/suite/perfschema/t/misc.test' --- a/mysql-test/suite/perfschema/t/misc.test 2012-01-04 18:29:43 +0000 +++ b/mysql-test/suite/perfschema/t/misc.test 2012-01-06 15:54:45 +0000 @@ -39,6 +39,26 @@ SELECT object_schema, object_name FROM p WHERE object_schema='test'; # +# Verify table views are ignored by the table io instrumentation. +# + +CREATE TABLE test.t1(a INT); +INSERT INTO test.t1 VALUES (1); +CREATE VIEW test.v1 AS SELECT * FROM test.t1; +SELECT COUNT(*) FROM test.v1; + +# Verify that a PFS table share was not created for the view. +SELECT object_schema, object_name FROM performance_schema.objects_summary_global_by_type + WHERE object_schema='test'; + +DROP VIEW test.v1; +DROP TABLE test.t1; + +SELECT object_schema, object_name FROM performance_schema.objects_summary_global_by_type + WHERE object_schema='test'; + + +# # Bug#45496 Performance schema: assertion fails in # ha_perfschema::rnd_init:223 # === modified file 'mysql-test/t/myisampack.test' --- a/mysql-test/t/myisampack.test 2011-09-16 12:21:05 +0000 +++ b/mysql-test/t/myisampack.test 2012-01-09 07:26:17 +0000 @@ -265,3 +265,15 @@ FLUSH TABLE t1; --exec $MYISAMCHK -soq $MYSQLD_DATADIR/test/t1 CHECK TABLE t1; DROP TABLE t1; + +--echo # +--echo # BUG#11751736: DROP DATABASE STATEMENT SHOULD REMOVE .OLD SUFFIX FROM +--echo # DATABASE DIRECTORY +--echo # +CREATE DATABASE db1; +CREATE TABLE db1.t1(c1 INT) ENGINE=MyISAM; +## Added -f to force pack db in any case regardless the size of database +## being packed +let $MYSQLD_DATADIR = `SELECT @@datadir`; +--exec $MYISAMPACK -b -f $MYSQLD_DATADIR/db1/t1 +DROP DATABASE db1; === modified file 'sql/sql_db.cc' --- a/sql/sql_db.cc 2011-11-28 07:13:03 +0000 +++ b/sql/sql_db.cc 2012-01-09 07:26:17 +0000 @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2012, 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 @@ -45,7 +45,7 @@ #define MAX_DROP_TABLE_Q_LEN 1024 -const char *del_exts[]= {".frm", ".BAK", ".TMD",".opt", NullS}; +const char *del_exts[]= {".frm", ".BAK", ".TMD", ".opt", ".OLD", NullS}; static TYPELIB deletable_extentions= {array_elements(del_exts)-1,"del_exts", del_exts, NULL}; === modified file 'storage/perfschema/pfs.cc' --- a/storage/perfschema/pfs.cc 2012-01-06 08:33:36 +0000 +++ b/storage/perfschema/pfs.cc 2012-01-09 08:24:27 +0000 @@ -1479,8 +1479,8 @@ static void destroy_cond_v1(PSI_cond* co static PSI_table_share* get_table_share_v1(my_bool temporary, TABLE_SHARE *share) { - /* Ignore temporary tables. */ - if (temporary) + /* Ignore temporary tables and views. */ + if (temporary || share->is_view) return NULL; /* An instrumented thread is required, for LF_PINS. */ PFS_thread *pfs_thread= my_pthread_getspecific_ptr(PFS_thread*, THR_PFS); No bundle (reason: useless for push emails).