MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Marc Alff Date:July 24 2009 1:20am
Subject:bzr push into mysql-5.4-perfschema branch (marc.alff:2835 to 2836)
View as plain text  
 2836 Marc Alff	2009-07-23
      Implemented TRUNCATE for FILE_SUMMARY_BY_INSTANCE, FILE_SUMMARY_BY_EVENT_NAME
      added:
        mysql-test/suite/perfschema/r/ddl_fs_by_event_name.result
        mysql-test/suite/perfschema/r/ddl_fs_by_instance.result
        mysql-test/suite/perfschema/t/ddl_fs_by_event_name.test
        mysql-test/suite/perfschema/t/ddl_fs_by_instance.test
      modified:
        storage/perfschema/pfs_instr.cc
        storage/perfschema/pfs_instr.h
        storage/perfschema/pfs_instr_class.cc
        storage/perfschema/pfs_instr_class.h
        storage/perfschema/pfs_stat.h
        storage/perfschema/table_file_summary.cc
        storage/perfschema/table_file_summary.h

 2835 Marc Alff	2009-07-23 [merge]
      Merge mysql-azalea --> mysql-azalea-perfschema
      removed:
        mysql-test/suite/rpl/r/rpl_row_stop_middle_update.result
        mysql-test/suite/rpl/t/rpl_row_stop_middle_update-master.opt
        mysql-test/suite/rpl/t/rpl_row_stop_middle_update-slave.opt
      added:
        mysql-test/suite/rpl/r/rpl_stop_middle_group.result
      renamed:
        mysql-test/suite/rpl/t/rpl_row_stop_middle_update.test => mysql-test/suite/rpl/t/rpl_stop_middle_group.test
      modified:
        include/my_base.h
        mysql-test/extra/scripts/monitor_disabled_tests/comments.txt
        mysql-test/r/lock.result
        mysql-test/suite/rpl/r/rpl_innodb.result
        mysql-test/suite/rpl/r/rpl_semi_sync.result
        mysql-test/suite/rpl/t/disabled.def
        mysql-test/suite/rpl/t/rpl_innodb.test
        mysql-test/suite/rpl/t/rpl_semi_sync.test
        mysql-test/t/disabled.def
        mysql-test/t/lock.test
        netware/BUILD/compile-netware-START
        plugin/semisync/semisync_master.cc
        plugin/semisync/semisync_master_plugin.cc
        plugin/semisync/semisync_slave_plugin.cc
        scripts/make_binary_distribution.sh
        sql-bench/README*
        sql/derror.cc
        sql/log.cc
        sql/log_event.cc
        sql/log_event_old.cc
        sql/mysqld.cc
        sql/rpl_rli.cc
        sql/rpl_rli.h
        sql/slave.cc
        support-files/mysql.server.sh
        tests/grant.pl*
        mysql-test/suite/rpl/t/rpl_stop_middle_group.test

=== added file 'mysql-test/suite/perfschema/r/ddl_fs_by_event_name.result'
--- a/mysql-test/suite/perfschema/r/ddl_fs_by_event_name.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/r/ddl_fs_by_event_name.result	2009-07-23 18:52:52 +0000
@@ -0,0 +1,3 @@
+alter table performance_schema.FILE_SUMMARY_BY_EVENT_NAME add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+truncate table performance_schema.FILE_SUMMARY_BY_EVENT_NAME;

=== added file 'mysql-test/suite/perfschema/r/ddl_fs_by_instance.result'
--- a/mysql-test/suite/perfschema/r/ddl_fs_by_instance.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/r/ddl_fs_by_instance.result	2009-07-23 18:52:52 +0000
@@ -0,0 +1,3 @@
+alter table performance_schema.FILE_SUMMARY_BY_INSTANCE add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+truncate table performance_schema.FILE_SUMMARY_BY_INSTANCE;

=== added file 'mysql-test/suite/perfschema/t/ddl_fs_by_event_name.test'
--- a/mysql-test/suite/perfschema/t/ddl_fs_by_event_name.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/ddl_fs_by_event_name.test	2009-07-23 18:52:52 +0000
@@ -0,0 +1,24 @@
+# Copyright (C) 2008-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
+# 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
+
+--source include/not_embedded.inc
+
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.FILE_SUMMARY_BY_EVENT_NAME add column foo integer;
+
+truncate table performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
+

=== added file 'mysql-test/suite/perfschema/t/ddl_fs_by_instance.test'
--- a/mysql-test/suite/perfschema/t/ddl_fs_by_instance.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/ddl_fs_by_instance.test	2009-07-23 18:52:52 +0000
@@ -0,0 +1,24 @@
+# Copyright (C) 2008-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
+# 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
+
+--source include/not_embedded.inc
+
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.FILE_SUMMARY_BY_INSTANCE add column foo integer;
+
+truncate table performance_schema.FILE_SUMMARY_BY_INSTANCE;
+

=== modified file 'storage/perfschema/pfs_instr.cc'
--- a/storage/perfschema/pfs_instr.cc	2009-07-21 21:55:48 +0000
+++ b/storage/perfschema/pfs_instr.cc	2009-07-23 18:52:52 +0000
@@ -945,4 +945,14 @@ void reset_events_waits_by_instance(void
   reset_file_waits_by_instance();
 }
 
+/** Reset the io statistics per file instance. */
+void reset_file_instance_io(void)
+{
+  PFS_file *pfs= file_array;
+  PFS_file *pfs_last= file_array + file_max;
+
+  for ( ; pfs < pfs_last; pfs++)
+    reset_file_stat(& pfs->m_file_stat);
+}
+
 /** @} */

=== modified file 'storage/perfschema/pfs_instr.h'
--- a/storage/perfschema/pfs_instr.h	2009-07-20 18:59:18 +0000
+++ b/storage/perfschema/pfs_instr.h	2009-07-23 18:52:52 +0000
@@ -223,6 +223,7 @@ extern PFS_table *table_array;
 
 void reset_events_waits_by_instance();
 void reset_per_thread_wait_stat();
+void reset_file_instance_io();
 
 /** @} */
 #endif

=== modified file 'storage/perfschema/pfs_instr_class.cc'
--- a/storage/perfschema/pfs_instr_class.cc	2009-07-21 21:55:48 +0000
+++ b/storage/perfschema/pfs_instr_class.cc	2009-07-23 18:52:52 +0000
@@ -890,5 +890,15 @@ void reset_instrument_class_waits(void)
   reset_file_class_waits();
 }
 
+/** Reset the io statistics per file class. */
+void reset_file_class_io(void)
+{
+  PFS_file_class *pfs= file_class_array;
+  PFS_file_class *pfs_last= file_class_array + file_class_max;
+
+  for ( ; pfs < pfs_last; pfs++)
+    reset_file_stat(& pfs->m_file_stat);
+}
+
 /** @} */
 

=== modified file 'storage/perfschema/pfs_instr_class.h'
--- a/storage/perfschema/pfs_instr_class.h	2009-07-21 21:55:48 +0000
+++ b/storage/perfschema/pfs_instr_class.h	2009-07-23 18:52:52 +0000
@@ -245,6 +245,7 @@ extern ulong table_share_lost;
 extern PFS_table_share *table_share_array;
 
 void reset_instrument_class_waits();
+void reset_file_class_io();
 
 /** @} */
 #endif

=== modified file 'storage/perfschema/pfs_stat.h'
--- a/storage/perfschema/pfs_stat.h	2009-07-08 23:52:29 +0000
+++ b/storage/perfschema/pfs_stat.h	2009-07-23 18:52:52 +0000
@@ -107,6 +107,19 @@ struct PFS_file_stat
   ulonglong m_write_bytes;
 };
 
+/**
+  Reset file statistic.
+  @param stat                         the statistics to reset
+*/
+inline void reset_file_stat(PFS_file_stat *stat)
+{
+  stat->m_open_count= 0;
+  stat->m_count_read= 0;
+  stat->m_count_write= 0;
+  stat->m_read_bytes= 0;
+  stat->m_write_bytes= 0;
+}
+
 /** @} */
 #endif
 

=== modified file 'storage/perfschema/table_file_summary.cc'
--- a/storage/perfschema/table_file_summary.cc	2009-07-21 21:55:48 +0000
+++ b/storage/perfschema/table_file_summary.cc	2009-07-23 18:52:52 +0000
@@ -34,7 +34,7 @@ table_file_summary_by_event_name::m_shar
   & pfs_truncatable_acl,
   & table_file_summary_by_event_name::create,
   NULL, /* write_row */
-  NULL, /* delete_all_rows */
+  table_file_summary_by_event_name::delete_all_rows,
   1000, /* records */
   sizeof(PFS_simple_index),
   & m_table_lock
@@ -45,6 +45,12 @@ PFS_engine_table* table_file_summary_by_
   return new table_file_summary_by_event_name();
 }
 
+int table_file_summary_by_event_name::delete_all_rows(void)
+{
+  reset_file_class_io();
+  return 0;
+}
+
 table_file_summary_by_event_name::table_file_summary_by_event_name()
   : PFS_readonly_table(& m_share, & m_pos),
   m_pos(1), m_next_pos(1)
@@ -169,7 +175,7 @@ table_file_summary_by_instance::m_share=
   & pfs_truncatable_acl,
   & table_file_summary_by_instance::create,
   NULL, /* write_row */
-  NULL, /* delete_all_rows */
+  table_file_summary_by_instance::delete_all_rows,
   1000, /* records */
   sizeof(PFS_simple_index),
   & m_table_lock
@@ -180,6 +186,12 @@ PFS_engine_table* table_file_summary_by_
   return new table_file_summary_by_instance();
 }
 
+int table_file_summary_by_instance::delete_all_rows(void)
+{
+  reset_file_instance_io();
+  return 0;
+}
+
 table_file_summary_by_instance::table_file_summary_by_instance()
   : PFS_readonly_table(& m_share, & m_pos),
   m_row_exists(false), m_pos(0), m_next_pos(0)

=== modified file 'storage/perfschema/table_file_summary.h'
--- a/storage/perfschema/table_file_summary.h	2009-07-08 23:52:29 +0000
+++ b/storage/perfschema/table_file_summary.h	2009-07-23 18:52:52 +0000
@@ -55,6 +55,7 @@ public:
   /** Table share */
   static PFS_engine_table_share m_share;
   static PFS_engine_table* create();
+  static int delete_all_rows();
 
   virtual int rnd_next();
   virtual int rnd_pos(const void *pos);
@@ -112,8 +113,8 @@ class table_file_summary_by_instance : p
 public:
   /** Table share */
   static PFS_engine_table_share m_share;
-  /** Table builder */
   static PFS_engine_table* create();
+  static int delete_all_rows();
 
   virtual int rnd_next();
   virtual int rnd_pos(const void *pos);

Thread
bzr push into mysql-5.4-perfschema branch (marc.alff:2835 to 2836) Marc Alff24 Jul