MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pfs_setup_object.h
Go to the documentation of this file.
1 /* Copyright (c) 2010, 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
14  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
15 
16 #ifndef PFS_SETUP_OBJECT_H
17 #define PFS_SETUP_OBJECT_H
18 
24 #include "pfs_lock.h"
25 #include "lf.h"
26 
27 class String;
28 struct PFS_global_param;
29 
37 {
43  char m_hash_key[1 + NAME_LEN + 1 + NAME_LEN + 1];
44  uint m_key_length;
45 };
46 
48 struct PFS_ALIGNED PFS_setup_object
49 {
50  enum_object_type get_object_type()
51  {
52  return (enum_object_type) m_key.m_hash_key[0];
53  }
54 
60  const char *m_schema_name;
64  const char *m_object_name;
68  bool m_enabled;
70  bool m_timed;
71 };
72 
73 int init_setup_object(const PFS_global_param *param);
74 void cleanup_setup_object(void);
75 int init_setup_object_hash(void);
76 void cleanup_setup_object_hash(void);
77 
78 int insert_setup_object(enum_object_type object_type, const String *schema,
79  const String *object, bool enabled, bool timed);
80 int delete_setup_object(enum_object_type object_type, const String *schema,
81  const String *object);
82 int reset_setup_object(void);
83 long setup_object_count(void);
84 
85 void lookup_setup_object(PFS_thread *thread,
86  enum_object_type object_type,
87  const char *schema_name, int schema_name_length,
88  const char *object_name, int object_name_length,
89  bool *enabled, bool *timed);
90 
91 /* For iterators and show status. */
92 
93 extern ulong setup_object_max;
94 
95 /* Exposing the data directly, for iterators. */
96 
97 extern PFS_setup_object *setup_object_array;
98 
99 extern LF_HASH setup_object_hash;
100 
102 #endif
103