1/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; version 2 of the License.
6
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 GNU General Public License for more details.
11
12 You should have received a copy of the GNU General Public License
13 along with this program; if not, write to the Free Software Foundation,
14 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
15
16#ifndef TABLE_SETUP_TIMERS_H
17#define TABLE_SETUP_TIMERS_H
18
19/**
20 @file storage/perfschema/table_setup_timers.h
21 Table SETUP_TIMERS (declarations).
22*/
23
24#include "pfs_column_types.h"
25#include "pfs_engine_table.h"
26
27/**
28 @addtogroup Performance_schema_tables
29 @{
30*/
31
32/** A row of table PERFORMANCE_SCHEMA.SETUP_TIMERS. */
33struct row_setup_timers
34{
35 /** Column NAME. */
36 LEX_STRING m_name;
37 /** Column TIMER_NAME. */
38 enum_timer_name *m_timer_name_ptr;
39};
40
41/** Table PERFORMANCE_SCHEMA.SETUP_TIMERS. */
42class table_setup_timers : public PFS_engine_table
43{
44public:
45 /** Table share. */
46 static PFS_engine_table_share m_share;
47 static PFS_engine_table* create();
48
49 virtual int rnd_next();
50 virtual int rnd_pos(const void *pos);
51 virtual void reset_position(void);
52
53protected:
54 virtual int read_row_values(TABLE *table,
55 unsigned char *buf,
56 Field **fields,
57 bool read_all);
58
59 virtual int update_row_values(TABLE *table,
60 const unsigned char *old_buf,
61 const unsigned char *new_buf,
62 Field **fields);
63
64 table_setup_timers();
65
66public:
67 ~table_setup_timers()
68 {}
69
70private:
71 /** Table share lock. */
72 static THR_LOCK m_table_lock;
73
74 /** Current row. */
75 row_setup_timers *m_row;
76 /** Current position. */
77 PFS_simple_index m_pos;
78 /** Next position. */
79 PFS_simple_index m_next_pos;
80};
81
82/** @} */
83#endif
84