MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ha_ndbinfo.h
1 /*
2  Copyright (C) 2009 Sun Microsystems Inc.
3  All rights reserved. Use is subject to license terms.
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; version 2 of the License.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 
19 #ifndef HA_NDBINFO_H
20 #define HA_NDBINFO_H
21 
22 #include <mysql/plugin.h>
23 
24 int ndbinfo_init(void *plugin);
25 int ndbinfo_deinit(void *plugin);
26 
27 class ha_ndbinfo: public handler
28 {
29 public:
30  ha_ndbinfo(handlerton *hton, TABLE_SHARE *table_arg);
31  ~ha_ndbinfo();
32 
33  const char *table_type() const { return "NDBINFO"; }
34  const char **bas_ext() const {
35  static const char *null[] = { NullS };
36  return null;
37  }
38  ulonglong table_flags() const {
39  return HA_REC_NOT_IN_SEQ | HA_NO_TRANSACTIONS |
40  HA_NO_BLOBS | HA_NO_AUTO_INCREMENT;
41  }
42  ulong index_flags(uint inx, uint part, bool all_parts) const {
43  return 0;
44  }
45 
46  int create(const char *name, TABLE *form,
47  HA_CREATE_INFO *create_info);
48 
49  int open(const char *name, int mode, uint test_if_locked);
50  int close(void);
51 
52  int rnd_init(bool scan);
53  int rnd_end();
54  int rnd_next(uchar *buf);
55  int rnd_pos(uchar *buf, uchar *pos);
56  void position(const uchar *record);
57  int info(uint);
58 
60  enum thr_lock_type lock_type) {
61  return to;
62  }
63 
64  bool low_byte_first() const {
65  // Data will be returned in machine format
66 #ifdef WORDS_BIGENDIAN
67  return false;
68 #else
69  return true;
70 #endif
71  }
72 
73  bool get_error_message(int error, String *buf);
74 
75  uint8 table_cache_type() {
76  // Don't put ndbinfo results in query cache
77  return HA_CACHE_TBL_NOCACHE;
78  }
79 
80 private:
81  void unpack_record(uchar *dst_row);
82 
83  bool is_open(void) const;
84  bool is_closed(void) const { return ! is_open(); };
85 
86  bool is_offline(void) const;
87 
88  struct ha_ndbinfo_impl& m_impl;
89 
90 };
91 
92 #endif