2848 Marc Alff 2009-08-04
Bug#45496 Performance schema: assertion fails in ha_perfschema::rnd_init:223
Implemented review comments for rnd_init(),
which also resolves bug 45496
added:
mysql-test/suite/perfschema/r/misc.result
mysql-test/suite/perfschema/t/misc.test
modified:
storage/perfschema/ha_perfschema.cc
2847 Marc Alff 2009-08-04
Fixed memory leak in pfs_spawn_thread,
fixed minor review comments
modified:
storage/perfschema/pfs.cc
storage/perfschema/pfs_instr.cc
storage/perfschema/table_events_waits.cc
=== added file 'mysql-test/suite/perfschema/r/misc.result'
--- a/mysql-test/suite/perfschema/r/misc.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/r/misc.result 2009-08-04 18:14:07 +0000
@@ -0,0 +1,7 @@
+SELECT EVENT_ID FROM performance_schema.EVENTS_WAITS_CURRENT
+WHERE THREAD_ID IN
+(SELECT THREAD_ID FROM performance_schema.PROCESSLIST)
+AND EVENT_NAME IN
+(SELECT NAME FROM performance_schema.SETUP_INSTRUMENTS
+WHERE NAME LIKE "wait/synch/%")
+LIMIT 1;
=== added file 'mysql-test/suite/perfschema/t/misc.test'
--- a/mysql-test/suite/perfschema/t/misc.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/misc.test 2009-08-04 18:14:07 +0000
@@ -0,0 +1,33 @@
+# 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
+# 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
+# Miscelaneous
+
+#
+# Bug#45496 Performance schema: assertion fails in
+# ha_perfschema::rnd_init:223
+#
+
+--disable_result_log
+SELECT EVENT_ID FROM performance_schema.EVENTS_WAITS_CURRENT
+WHERE THREAD_ID IN
+ (SELECT THREAD_ID FROM performance_schema.PROCESSLIST)
+AND EVENT_NAME IN
+ (SELECT NAME FROM performance_schema.SETUP_INSTRUMENTS
+ WHERE NAME LIKE "wait/synch/%")
+LIMIT 1;
+--enable_result_log
+
=== modified file 'storage/perfschema/ha_perfschema.cc'
--- a/storage/perfschema/ha_perfschema.cc 2009-07-21 21:55:48 +0000
+++ b/storage/perfschema/ha_perfschema.cc 2009-08-04 18:14:07 +0000
@@ -245,10 +245,10 @@ int ha_perfschema::rnd_init(bool scan)
DBUG_ASSERT(m_table_share);
DBUG_ASSERT(m_table_share->m_open_table != NULL);
- DBUG_ASSERT(m_table == NULL);
stats.records= 0;
- m_table= m_table_share->m_open_table();
+ if (m_table == NULL)
+ m_table= m_table_share->m_open_table();
if (m_table)
{
/* Unsafe for binlog */
@@ -264,6 +264,7 @@ int ha_perfschema::rnd_init(bool scan)
int ha_perfschema::rnd_end(void)
{
DBUG_ENTER("ha_perfschema::rnd_end");
+ DBUG_ASSERT(m_table);
delete m_table;
m_table= NULL;
DBUG_RETURN(0);
| Thread |
|---|
| • bzr push into mysql-5.4-perfschema branch (marc.alff:2847 to 2848) Bug#45496 | Marc Alff | 4 Aug |