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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
* Original author: Paul McCullagh
20
* Continued development: Barry Leslie
33
#include "engine_ms.h"
35
#ifdef USE_PRAGMA_INTERFACE
36
#pragma interface /* gcc class implementation */
39
#if MYSQL_VERSION_ID >= 50120
44
#include <drizzled/cursor.h>
45
#include <drizzled/thr_lock.h>
47
class PBMSStorageEngine;
48
#define handlerton PBMSStorageEngine
49
#define handler Cursor
51
using namespace drizzled;
54
extern handlerton *pbms_hton;
57
class MSOpenSystemTable;
59
class ha_pbms: public handler
61
THR_LOCK_DATA ha_lock; ///< MySQL lock
62
MSOpenSystemTable *ha_open_tab;
64
PBMSResultRec ha_result;
65
//MS_SHARE *ha_share; ///< Shared lock info
69
ha_pbms(handlerton *hton, TableShare& table_arg);
71
ha_pbms(handlerton *hton, TABLE_SHARE *table_arg);
75
const char *table_type() const { return "PBMS"; }
77
const char *index_type(uint inx) { UNUSED(inx); return "NONE"; }
80
const char **bas_ext() const;
82
MX_TABLE_TYPES_T table_flags() const;
85
MX_ULONG_T index_flags(uint inx, uint part , bool all_parts ) const
90
return (HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE | HA_KEYREAD_ONLY);
92
uint max_supported_keys() const { return 512; }
93
uint max_supported_key_length() const { return 1024; }
94
uint max_supported_key_part_length() const { return 1024; }
96
int open(const char *name, int mode, uint test_if_locked);
97
void drop_table(const char *name) {UNUSED(name);}
101
int doInsertRecord(byte * buf);
102
int doUpdateRecord(const byte * old_data, byte * new_data);
103
int doDeleteRecord(const byte * buf);
106
int write_row(unsigned char * buf);
107
int update_row(const unsigned char * old_data, unsigned char * new_data);
108
int delete_row(const unsigned char * buf);
111
/* Sequential scan functions: */
113
int doStartTableScan(bool scan);
115
int rnd_init(bool scan);
117
int rnd_next(byte *buf);
118
int rnd_pos(byte * buf, byte *pos);
119
void position(const byte *record);
123
/* Index access functions: */
124
int index_init(uint idx, bool sorted);
126
int index_read(byte * buf, const byte * key,
127
uint key_len, enum ha_rkey_function find_flag);
128
int index_read_idx(byte * buf, uint idx, const byte * key,
129
uint key_len, enum ha_rkey_function find_flag);
130
int index_next(byte * buf);
131
int index_prev(byte * buf);
132
int index_first(byte * buf);
133
int index_last(byte * buf);
134
int index_read_last(byte * buf, const byte * key, uint key_len);
137
int external_lock(THD *thd, int lock_type);
139
int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info);
141
void get_auto_increment(uint64_t, uint64_t,
147
THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, enum thr_lock_type lock_type);
149
bool get_error_message(int error, String *buf);