1
/* Copyright (C) 2008 PrimeBase Technologies GmbH, Germany
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; either version 2 of the License, or
8
* (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
* PBXT System Table handler.
28
#ifndef __HA_XTSYS_H__
29
#define __HA_XTSYS_H__
32
#include <drizzled/common.h>
33
#include <drizzled/handler_structs.h>
34
#include <drizzled/current_session.h>
35
#include <drizzled/plugin/storage_engine.h>
36
#include <drizzled/cursor.h>
37
using namespace drizzled;
38
using namespace drizzled::plugin;
40
#include "mysql_priv.h"
45
#ifdef USE_PRAGMA_INTERFACE
46
#pragma interface /* gcc class implementation */
49
#if MYSQL_VERSION_ID >= 50120
53
class XTOpenSystemTable;
55
class ha_xtsys: public handler
57
THR_LOCK_DATA ha_lock; ///< MySQL lock
58
XTOpenSystemTable *ha_open_tab;
62
ha_xtsys(handlerton *hton, Table& table_arg);
64
ha_xtsys(handlerton *hton, TABLE_SHARE *table_arg);
68
const char *table_type() const { return "PBXT"; }
70
const char *index_type(uint XT_UNUSED(inx)) {
74
const char **bas_ext() const;
76
MX_TABLE_TYPES_T table_flags() const {
77
return HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE;
80
MX_ULONG_T index_flags(uint XT_UNUSED(inx), uint XT_UNUSED(part), bool XT_UNUSED(all_parts)) const {
81
return (HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE | HA_KEYREAD_ONLY);
83
uint max_supported_keys() const { return 512; }
84
uint max_supported_key_part_length() const { return 1024; }
86
int open(const char *name, int mode, uint test_if_locked);
89
int doStartTableScan(bool scan);
91
int rnd_init(bool scan);
93
int rnd_next(byte *buf);
94
int rnd_pos(byte * buf, byte *pos);
95
void position(const byte *record);
98
int external_lock(THD *thd, int lock_type);
99
int delete_table(const char *from);
100
int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info);
102
THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, enum thr_lock_type lock_type);
103
bool get_error_message(int error, String *buf);
105
// dummy implmentation
106
void get_auto_increment(MX_ULONGLONG_T XT_UNUSED(offset), MX_ULONGLONG_T XT_UNUSED(increment),
107
MX_ULONGLONG_T XT_UNUSED(nb_desired_values),
108
MX_ULONGLONG_T *first_value,
109
MX_ULONGLONG_T *nb_reserved_values)
112
*nb_reserved_values = 1;