MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
table_threads.h
1 /* Copyright (c) 2008, 2011, 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_THREADS_H
17 #define TABLE_THREADS_H
18 
19 #include "pfs_column_types.h"
20 #include "cursor_by_thread.h"
21 
22 struct PFS_thread;
23 
33 {
37  ulonglong m_processlist_id;
39  const char* m_name;
43  char m_username[USERNAME_LENGTH];
47  char m_hostname[HOSTNAME_LENGTH];
51  char m_dbname[NAME_LEN];
55  int m_command;
57  time_t m_start_time;
70 };
71 
74 {
75 public:
79  static PFS_engine_table* create();
80 
81 protected:
82  virtual int read_row_values(TABLE *table,
83  unsigned char *buf,
84  Field **fields,
85  bool read_all);
86 
87 
88  virtual int update_row_values(TABLE *table,
89  const unsigned char *old_buf,
90  unsigned char *new_buf,
91  Field **fields);
92 
93 protected:
94  table_threads();
95 
96 public:
97  ~table_threads()
98  {}
99 
100 private:
101  virtual void make_row(PFS_thread *pfs);
102 
104  static THR_LOCK m_table_lock;
106  static TABLE_FIELD_DEF m_field_def;
107 
109  row_threads m_row;
111  bool m_row_exists;
112 };
113 
115 #endif