1
/* Copyright (C) 2008 PrimeBase Technologies GmbH, Germany
3
* PrimeBase Media Stream for MySQL
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
19
* Original author: Paul McCullagh
20
* Continued development: Barry Leslie
34
#include "engine_ms.h"
36
#ifdef USE_PRAGMA_INTERFACE
37
#pragma interface /* gcc class implementation */
40
#if MYSQL_VERSION_ID >= 50120
45
#include <drizzled/cursor.h>
46
#include <drizzled/thr_lock.h>
48
class PBMSStorageEngine;
49
#define handlerton PBMSStorageEngine
50
#define handler Cursor
52
using namespace drizzled;
55
extern handlerton *pbms_hton;
58
class MSOpenSystemTable;
60
class ha_pbms: public handler
62
THR_LOCK_DATA ha_lock; ///< MySQL lock
63
MSOpenSystemTable *ha_open_tab;
65
PBMSResultRec ha_result;
66
//MS_SHARE *ha_share; ///< Shared lock info
70
ha_pbms(handlerton *hton, Table& table_arg);
72
ha_pbms(handlerton *hton, TABLE_SHARE *table_arg);
76
const char *table_type() const { return "PBMS"; }
78
const char *index_type(uint inx) { UNUSED(inx); return "NONE"; }
81
const char **bas_ext() const;
83
MX_TABLE_TYPES_T table_flags() const;
86
MX_ULONG_T index_flags(uint inx, uint part , bool all_parts ) const
91
return (HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE | HA_KEYREAD_ONLY);
93
uint max_supported_keys() const { return 512; }
94
uint max_supported_key_length() const { return 1024; }
95
uint max_supported_key_part_length() const { return 1024; }
97
int open(const char *name, int mode, uint test_if_locked);
102
int doInsertRecord(byte * buf);
103
int doUpdateRecord(const byte * old_data, byte * new_data);
104
int doDeleteRecord(const byte * buf);
107
int write_row(unsigned char * buf);
108
int update_row(const unsigned char * old_data, unsigned char * new_data);
109
int delete_row(const unsigned char * buf);
112
/* Sequential scan functions: */
114
int doStartTableScan(bool scan);
116
int rnd_init(bool scan);
118
int rnd_next(byte *buf);
119
int rnd_pos(byte * buf, byte *pos);
120
void position(const byte *record);
124
/* Index access functions: */
125
int index_init(uint idx, bool sorted);
127
int index_read(byte * buf, const byte * key,
128
uint key_len, enum ha_rkey_function find_flag);
129
int index_read_idx(byte * buf, uint idx, const byte * key,
130
uint key_len, enum ha_rkey_function find_flag);
131
int index_next(byte * buf);
132
int index_prev(byte * buf);
133
int index_first(byte * buf);
134
int index_last(byte * buf);
135
int index_read_last(byte * buf, const byte * key, uint key_len);
138
int external_lock(THD *thd, int lock_type);
140
int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info);
142
void get_auto_increment(uint64_t, uint64_t,
148
THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, enum thr_lock_type lock_type);
150
bool get_error_message(int error, String *buf);