List:Commits« Previous MessageNext Message »
From:Marc Alff Date:September 15 2010 8:46pm
Subject:bzr commit into mysql-trunk-bugfixing branch (marc.alff:3267)
View as plain text  
#At file:///home/malff/BZR_TREE/mysql-trunk-bugfixing-merge/ based on revid:olav.sandstaa@stripped

 3267 Marc Alff	2010-09-15 [merge]
      Merge mysql-5.5-bugfixing --> mysql-trunk-bugfixing

    added:
      mysql-test/suite/perfschema/r/checksum.result
      mysql-test/suite/perfschema/t/checksum.test
    modified:
      storage/perfschema/table_events_waits.cc
      storage/perfschema/table_events_waits.h
=== added file 'mysql-test/suite/perfschema/r/checksum.result'
--- a/mysql-test/suite/perfschema/r/checksum.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/r/checksum.result	2010-09-15 18:20:48 +0000
@@ -0,0 +1,34 @@
+checksum table performance_schema.COND_INSTANCES;
+checksum table performance_schema.EVENTS_WAITS_CURRENT;
+checksum table performance_schema.EVENTS_WAITS_HISTORY;
+checksum table performance_schema.EVENTS_WAITS_HISTORY_LONG;
+checksum table performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
+checksum table performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
+checksum table performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
+checksum table performance_schema.FILE_INSTANCES;
+checksum table performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
+checksum table performance_schema.FILE_SUMMARY_BY_INSTANCE;
+checksum table performance_schema.MUTEX_INSTANCES;
+checksum table performance_schema.PERFORMANCE_TIMERS;
+checksum table performance_schema.RWLOCK_INSTANCES;
+checksum table performance_schema.SETUP_CONSUMERS;
+checksum table performance_schema.SETUP_INSTRUMENTS;
+checksum table performance_schema.SETUP_TIMERS;
+checksum table performance_schema.THREADS;
+checksum table performance_schema.COND_INSTANCES extended;
+checksum table performance_schema.EVENTS_WAITS_CURRENT extended;
+checksum table performance_schema.EVENTS_WAITS_HISTORY extended;
+checksum table performance_schema.EVENTS_WAITS_HISTORY_LONG extended;
+checksum table performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE extended;
+checksum table performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME extended;
+checksum table performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME extended;
+checksum table performance_schema.FILE_INSTANCES extended;
+checksum table performance_schema.FILE_SUMMARY_BY_EVENT_NAME extended;
+checksum table performance_schema.FILE_SUMMARY_BY_INSTANCE extended;
+checksum table performance_schema.MUTEX_INSTANCES extended;
+checksum table performance_schema.PERFORMANCE_TIMERS extended;
+checksum table performance_schema.RWLOCK_INSTANCES extended;
+checksum table performance_schema.SETUP_CONSUMERS extended;
+checksum table performance_schema.SETUP_INSTRUMENTS extended;
+checksum table performance_schema.SETUP_TIMERS extended;
+checksum table performance_schema.THREADS extended;

=== added file 'mysql-test/suite/perfschema/t/checksum.test'
--- a/mysql-test/suite/perfschema/t/checksum.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/checksum.test	2010-09-15 18:20:48 +0000
@@ -0,0 +1,64 @@
+# 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,
+# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
+
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+#
+# The checksum value itself is random (data is volatile),
+# just testing that this does not crash
+#
+--disable_result_log
+
+checksum table performance_schema.COND_INSTANCES;
+checksum table performance_schema.EVENTS_WAITS_CURRENT;
+checksum table performance_schema.EVENTS_WAITS_HISTORY;
+checksum table performance_schema.EVENTS_WAITS_HISTORY_LONG;
+checksum table performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
+checksum table performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
+checksum table performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
+checksum table performance_schema.FILE_INSTANCES;
+checksum table performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
+checksum table performance_schema.FILE_SUMMARY_BY_INSTANCE;
+checksum table performance_schema.MUTEX_INSTANCES;
+checksum table performance_schema.PERFORMANCE_TIMERS;
+checksum table performance_schema.RWLOCK_INSTANCES;
+checksum table performance_schema.SETUP_CONSUMERS;
+checksum table performance_schema.SETUP_INSTRUMENTS;
+checksum table performance_schema.SETUP_TIMERS;
+checksum table performance_schema.THREADS;
+
+checksum table performance_schema.COND_INSTANCES extended;
+checksum table performance_schema.EVENTS_WAITS_CURRENT extended;
+checksum table performance_schema.EVENTS_WAITS_HISTORY extended;
+checksum table performance_schema.EVENTS_WAITS_HISTORY_LONG extended;
+checksum table performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE extended;
+checksum table performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME extended;
+checksum table performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME extended;
+checksum table performance_schema.FILE_INSTANCES extended;
+checksum table performance_schema.FILE_SUMMARY_BY_EVENT_NAME extended;
+checksum table performance_schema.FILE_SUMMARY_BY_INSTANCE extended;
+checksum table performance_schema.MUTEX_INSTANCES extended;
+checksum table performance_schema.PERFORMANCE_TIMERS extended;
+checksum table performance_schema.RWLOCK_INSTANCES extended;
+checksum table performance_schema.SETUP_CONSUMERS extended;
+checksum table performance_schema.SETUP_INSTRUMENTS extended;
+checksum table performance_schema.SETUP_TIMERS extended;
+checksum table performance_schema.THREADS extended;
+
+--enable_result_log
+

=== modified file 'storage/perfschema/table_events_waits.cc'
--- a/storage/perfschema/table_events_waits.cc	2010-08-12 10:21:22 +0000
+++ b/storage/perfschema/table_events_waits.cc	2010-09-15 20:46:26 +0000
@@ -187,7 +187,7 @@ void table_events_waits_common::clear_ob
 */
 void table_events_waits_common::make_row(bool thread_own_wait,
                                          PFS_thread *pfs_thread,
-                                         PFS_events_waits *wait)
+                                         volatile PFS_events_waits *wait)
 {
   pfs_lock lock;
   PFS_thread *safe_thread;
@@ -260,21 +260,27 @@ void table_events_waits_common::make_row
       m_row.m_object_type= "TEMPORARY TABLE";
       m_row.m_object_type_length= 15;
     }
-    memcpy(m_row.m_object_schema, wait->m_schema_name,
-           wait->m_schema_name_length);
     m_row.m_object_schema_length= wait->m_schema_name_length;
-    memcpy(m_row.m_object_name, wait->m_object_name,
-           wait->m_object_name_length);
+    if (unlikely((m_row.m_object_schema_length == 0) ||
+                 (m_row.m_object_schema_length > sizeof(m_row.m_object_schema))))
+      return;
+    memcpy(m_row.m_object_schema, wait->m_schema_name, m_row.m_object_schema_length);
     m_row.m_object_name_length= wait->m_object_name_length;
+    if (unlikely((m_row.m_object_name_length == 0) ||
+                 (m_row.m_object_name_length > sizeof(m_row.m_object_name))))
+      return;
+    memcpy(m_row.m_object_name, wait->m_object_name, m_row.m_object_name_length);
     safe_class= &global_table_class;
     break;
   case WAIT_CLASS_FILE:
     m_row.m_object_type= "FILE";
     m_row.m_object_type_length= 4;
     m_row.m_object_schema_length= 0;
-    memcpy(m_row.m_object_name, wait->m_object_name,
-           wait->m_object_name_length);
     m_row.m_object_name_length= wait->m_object_name_length;
+    if (unlikely((m_row.m_object_name_length == 0) ||
+                 (m_row.m_object_name_length > sizeof(m_row.m_object_name))))
+      return;
+    memcpy(m_row.m_object_name, wait->m_object_name, m_row.m_object_name_length);
     safe_class= sanitize_file_class((PFS_file_class*) wait->m_class);
     break;
   case NO_WAIT_CLASS:

=== modified file 'storage/perfschema/table_events_waits.h'
--- a/storage/perfschema/table_events_waits.h	2010-07-23 17:08:41 +0000
+++ b/storage/perfschema/table_events_waits.h	2010-09-15 20:46:26 +0000
@@ -139,7 +139,7 @@ protected:
   void clear_object_columns();
 
   void make_row(bool thread_own_wait, PFS_thread *pfs_thread,
-                PFS_events_waits *wait);
+                volatile PFS_events_waits *wait);
 
   /** Current row. */
   row_events_waits m_row;


Attachment: [text/bzr-bundle] bzr/marc.alff@oracle.com-20100915204626-k78so974pjkpinux.bundle
Thread
bzr commit into mysql-trunk-bugfixing branch (marc.alff:3267) Marc Alff15 Sep