Skip to content

Commit f16681d

Browse files
committed
Bug#53148 Remove PFS_readonly_table
This fix is for cleanup, to resolve a remaining code review item. Backport from mysql-next-mr (5.6) to mysql-trunk (5.5).
1 parent bb9505a commit f16681d

18 files changed

+93
-114
lines changed

storage/perfschema/pfs_engine_table.cc

+4-5
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
Performance schema tables (implementation).
1919
*/
2020

21-
#include "sql_priv.h"
2221
#include "pfs_engine_table.h"
2322

2423
#include "table_events_waits.h"
@@ -327,10 +326,10 @@ ulonglong PFS_engine_table::get_field_enum(Field *f)
327326
return f2->val_int();
328327
}
329328

330-
int PFS_readonly_table::update_row_values(TABLE *,
331-
const unsigned char *,
332-
unsigned char *,
333-
Field **)
329+
int PFS_engine_table::update_row_values(TABLE *,
330+
const unsigned char *,
331+
unsigned char *,
332+
Field **)
334333
{
335334
my_error(ER_WRONG_PERFSCHEMA_USAGE, MYF(0));
336335
return HA_ERR_WRONG_COMMAND;

storage/perfschema/pfs_engine_table.h

+4-25
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (C) 2008-2009 Sun Microsystems, Inc
1+
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -10,8 +10,8 @@
1010
GNU General Public License for more details.
1111
1212
You should have received a copy of the GNU General Public License
13-
along with this program; if not, write to the Free Software
14-
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
13+
along with this program; if not, write to the Free Software Foundation,
14+
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
1515

1616
#ifndef PFS_ENGINE_TABLE_H
1717
#define PFS_ENGINE_TABLE_H
@@ -81,7 +81,7 @@ class PFS_engine_table
8181
@param fields Table fields
8282
*/
8383
virtual int update_row_values(TABLE *table, const unsigned char *old_buf,
84-
unsigned char *new_buf, Field **fields)= 0;
84+
unsigned char *new_buf, Field **fields);
8585

8686
/**
8787
Constructor.
@@ -151,27 +151,6 @@ struct PFS_engine_table_share
151151
bool m_checked;
152152
};
153153

154-
/** Adapter for read only PERFORMANCE_SCHEMA tables. */
155-
class PFS_readonly_table : public PFS_engine_table
156-
{
157-
protected:
158-
/**
159-
Constructor.
160-
@param share table share
161-
@param pos address of the m_pos position member
162-
*/
163-
PFS_readonly_table(const PFS_engine_table_share *share, void *pos)
164-
: PFS_engine_table(share, pos)
165-
{}
166-
167-
~PFS_readonly_table()
168-
{}
169-
170-
virtual int update_row_values(TABLE *table, const unsigned char *old_buf,
171-
unsigned char *new_buf, Field **fields);
172-
173-
};
174-
175154
class PFS_readonly_acl : public ACL_internal_table_access
176155
{
177156
public:

storage/perfschema/table_all_instr.cc

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (C) 2008-2009 Sun Microsystems, Inc
1+
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -10,22 +10,21 @@
1010
GNU General Public License for more details.
1111
1212
You should have received a copy of the GNU General Public License
13-
along with this program; if not, write to the Free Software
14-
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
13+
along with this program; if not, write to the Free Software Foundation,
14+
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
1515

1616
/**
1717
@file storage/perfschema/table_all_instr.cc
1818
Abstract tables for all instruments (implementation).
1919
*/
2020

21-
#include "sql_priv.h"
2221
#include "my_global.h"
2322
#include "my_pthread.h"
2423
#include "table_all_instr.h"
2524
#include "pfs_global.h"
2625

2726
table_all_instr::table_all_instr(const PFS_engine_table_share *share)
28-
: PFS_readonly_table(share, &m_pos),
27+
: PFS_engine_table(share, &m_pos),
2928
m_pos(), m_next_pos()
3029
{}
3130

@@ -154,7 +153,7 @@ int table_all_instr::rnd_pos(const void *pos)
154153

155154
table_all_instr_class::table_all_instr_class
156155
(const PFS_engine_table_share *share)
157-
: PFS_readonly_table(share, &m_pos),
156+
: PFS_engine_table(share, &m_pos),
158157
m_pos(), m_next_pos()
159158
{}
160159

storage/perfschema/table_all_instr.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (C) 2008-2009 Sun Microsystems, Inc
1+
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -10,8 +10,8 @@
1010
GNU General Public License for more details.
1111
1212
You should have received a copy of the GNU General Public License
13-
along with this program; if not, write to the Free Software
14-
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
13+
along with this program; if not, write to the Free Software Foundation,
14+
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
1515

1616
#ifndef TABLE_ALL_INSTR_H
1717
#define TABLE_ALL_INSTR_H
@@ -63,7 +63,7 @@ struct pos_all_instr_class : public PFS_double_index,
6363
- a view on all cond classes,
6464
- a view on all file classes
6565
*/
66-
class table_all_instr_class : public PFS_readonly_table
66+
class table_all_instr_class : public PFS_engine_table
6767
{
6868
public:
6969
virtual int rnd_next();
@@ -122,7 +122,7 @@ struct pos_all_instr : public PFS_double_index,
122122
- a view on all cond instances,
123123
- a view on all file instances
124124
*/
125-
class table_all_instr : public PFS_readonly_table
125+
class table_all_instr : public PFS_engine_table
126126
{
127127
public:
128128
virtual int rnd_next();

storage/perfschema/table_events_waits.cc

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (C) 2008-2009 Sun Microsystems, Inc
1+
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -10,15 +10,16 @@
1010
GNU General Public License for more details.
1111
1212
You should have received a copy of the GNU General Public License
13-
along with this program; if not, write to the Free Software
14-
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
13+
along with this program; if not, write to the Free Software Foundation,
14+
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
1515

1616
/**
1717
@file storage/perfschema/table_events_waits.cc
1818
Table EVENTS_WAITS_xxx (implementation).
1919
*/
2020

21-
#include "sql_priv.h"
21+
#include "my_global.h"
22+
#include "my_pthread.h"
2223
#include "table_events_waits.h"
2324
#include "pfs_instr_class.h"
2425
#include "pfs_instr.h"
@@ -165,7 +166,7 @@ table_events_waits_history_long::m_share=
165166

166167
table_events_waits_common::table_events_waits_common
167168
(const PFS_engine_table_share *share, void *pos)
168-
: PFS_readonly_table(share, pos),
169+
: PFS_engine_table(share, pos),
169170
m_row_exists(false)
170171
{}
171172

storage/perfschema/table_events_waits.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (C) 2008-2009 Sun Microsystems, Inc
1+
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -10,8 +10,8 @@
1010
GNU General Public License for more details.
1111
1212
You should have received a copy of the GNU General Public License
13-
along with this program; if not, write to the Free Software
14-
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
13+
along with this program; if not, write to the Free Software Foundation,
14+
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
1515

1616
#ifndef TABLE_EVENTS_WAITS_H
1717
#define TABLE_EVENTS_WAITS_H
@@ -121,7 +121,7 @@ struct pos_events_waits_history : public PFS_double_index
121121
Adapter, for table sharing the structure of
122122
PERFORMANCE_SCHEMA.EVENTS_WAITS_CURRENT.
123123
*/
124-
class table_events_waits_common : public PFS_readonly_table
124+
class table_events_waits_common : public PFS_engine_table
125125
{
126126
protected:
127127
virtual int read_row_values(TABLE *table,

storage/perfschema/table_events_waits_summary.cc

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (C) 2008-2009 Sun Microsystems, Inc
1+
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -10,16 +10,16 @@
1010
GNU General Public License for more details.
1111
1212
You should have received a copy of the GNU General Public License
13-
along with this program; if not, write to the Free Software
14-
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
13+
along with this program; if not, write to the Free Software Foundation,
14+
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
1515

1616
/**
1717
@file storage/perfschema/table_events_waits_summary.cc
1818
Table EVENTS_WAITS_SUMMARY_BY_xxx (implementation).
1919
*/
2020

21-
#include "sql_priv.h"
22-
#include "unireg.h"
21+
#include "my_global.h"
22+
#include "my_pthread.h"
2323
#include "pfs_instr_class.h"
2424
#include "pfs_column_types.h"
2525
#include "pfs_column_values.h"
@@ -101,7 +101,7 @@ table_events_waits_summary_by_thread_by_event_name::delete_all_rows(void)
101101

102102
table_events_waits_summary_by_thread_by_event_name
103103
::table_events_waits_summary_by_thread_by_event_name()
104-
: PFS_readonly_table(&m_share, &m_pos),
104+
: PFS_engine_table(&m_share, &m_pos),
105105
m_row_exists(false), m_pos(), m_next_pos()
106106
{}
107107

storage/perfschema/table_events_waits_summary.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (C) 2008-2009 Sun Microsystems, Inc
1+
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -10,8 +10,8 @@
1010
GNU General Public License for more details.
1111
1212
You should have received a copy of the GNU General Public License
13-
along with this program; if not, write to the Free Software
14-
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
13+
along with this program; if not, write to the Free Software Foundation,
14+
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
1515

1616
#ifndef TABLE_EVENTS_WAITS_SUMMARY_H
1717
#define TABLE_EVENTS_WAITS_SUMMARY_H
@@ -96,7 +96,7 @@ struct pos_events_waits_summary_by_thread_by_event_name
9696

9797
/** Table PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME. */
9898
class table_events_waits_summary_by_thread_by_event_name
99-
: public PFS_readonly_table
99+
: public PFS_engine_table
100100
{
101101
public:
102102
/** Table share */

storage/perfschema/table_file_instances.cc

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (C) 2008-2009 Sun Microsystems, Inc
1+
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -10,16 +10,16 @@
1010
GNU General Public License for more details.
1111
1212
You should have received a copy of the GNU General Public License
13-
along with this program; if not, write to the Free Software
14-
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
13+
along with this program; if not, write to the Free Software Foundation,
14+
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
1515

1616
/**
1717
@file storage/perfschema/table_file_instances.cc
1818
Table FILE_INSTANCES (implementation).
1919
*/
2020

21-
#include "sql_priv.h"
22-
#include "unireg.h"
21+
#include "my_global.h"
22+
#include "my_pthread.h"
2323
#include "pfs_instr.h"
2424
#include "pfs_column_types.h"
2525
#include "pfs_column_values.h"
@@ -72,7 +72,7 @@ PFS_engine_table* table_file_instances::create(void)
7272
}
7373

7474
table_file_instances::table_file_instances()
75-
: PFS_readonly_table(&m_share, &m_pos),
75+
: PFS_engine_table(&m_share, &m_pos),
7676
m_row_exists(false), m_pos(0), m_next_pos(0)
7777
{}
7878

storage/perfschema/table_file_instances.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (C) 2008-2009 Sun Microsystems, Inc
1+
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -10,8 +10,8 @@
1010
GNU General Public License for more details.
1111
1212
You should have received a copy of the GNU General Public License
13-
along with this program; if not, write to the Free Software
14-
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
13+
along with this program; if not, write to the Free Software Foundation,
14+
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
1515

1616
#ifndef TABLE_FILE_INSTANCES_H
1717
#define TABLE_FILE_INSTANCES_H
@@ -45,7 +45,7 @@ struct row_file_instances
4545
};
4646

4747
/** Table PERFORMANCE_SCHEMA.FILE_INSTANCES. */
48-
class table_file_instances : public PFS_readonly_table
48+
class table_file_instances : public PFS_engine_table
4949
{
5050
public:
5151
/** Table share */

storage/perfschema/table_file_summary.cc

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (C) 2008-2009 Sun Microsystems, Inc
1+
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -10,16 +10,16 @@
1010
GNU General Public License for more details.
1111
1212
You should have received a copy of the GNU General Public License
13-
along with this program; if not, write to the Free Software
14-
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
13+
along with this program; if not, write to the Free Software Foundation,
14+
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
1515

1616
/**
1717
@file storage/perfschema/table_file_summary.cc
1818
Table FILE_SUMMARY_BY_xxx (implementation).
1919
*/
2020

21-
#include "sql_priv.h"
22-
#include "unireg.h"
21+
#include "my_global.h"
22+
#include "my_pthread.h"
2323
#include "pfs_instr_class.h"
2424
#include "pfs_column_types.h"
2525
#include "pfs_column_values.h"
@@ -88,7 +88,7 @@ int table_file_summary_by_event_name::delete_all_rows(void)
8888
}
8989

9090
table_file_summary_by_event_name::table_file_summary_by_event_name()
91-
: PFS_readonly_table(&m_share, &m_pos),
91+
: PFS_engine_table(&m_share, &m_pos),
9292
m_pos(1), m_next_pos(1)
9393
{}
9494

@@ -251,7 +251,7 @@ int table_file_summary_by_instance::delete_all_rows(void)
251251
}
252252

253253
table_file_summary_by_instance::table_file_summary_by_instance()
254-
: PFS_readonly_table(&m_share, &m_pos),
254+
: PFS_engine_table(&m_share, &m_pos),
255255
m_row_exists(false), m_pos(0), m_next_pos(0)
256256
{}
257257

0 commit comments

Comments
 (0)