1
/* Copyright (C) 2005 MySQL AB
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.
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.
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 */
17
#ifndef PLUGIN_BLACKHOLE_HA_BLACKHOLE_H
18
#define PLUGIN_BLACKHOLE_HA_BLACKHOLE_H
20
#include <drizzled/cursor.h>
21
#include <drizzled/thr_lock.h>
23
#define BLACKHOLE_MAX_KEY 64 /* Max allowed keys */
24
#define BLACKHOLE_MAX_KEY_LENGTH 1000
27
Shared structure for correct LOCK operation
32
BlackholeShare(const BlackholeShare &);
33
BlackholeShare& operator=(const BlackholeShare &);
35
explicit BlackholeShare(const std::string table_name_arg);
37
drizzled::THR_LOCK lock;
39
const std::string table_name;
44
Class definition for the blackhole storage engine
45
"Dumbest named feature ever"
47
class ha_blackhole: public drizzled::Cursor
49
drizzled::THR_LOCK_DATA lock; /* MySQL lock */
50
BlackholeShare *share;
53
ha_blackhole(drizzled::plugin::StorageEngine &engine,
54
drizzled::Table &table_arg);
59
The name of the index type that will be used for display
60
don't implement this method unless you really have indexes
62
const char *index_type(uint32_t key_number);
63
uint32_t index_flags(uint32_t inx) const;
64
int open(const char *name, int mode, uint32_t test_if_locked);
66
int doInsertRecord(unsigned char * buf);
67
int doStartTableScan(bool scan);
68
int rnd_next(unsigned char *buf);
69
int rnd_pos(unsigned char * buf, unsigned char *pos);
70
BlackholeShare *get_share(const char *table_name);
72
int index_read_map(unsigned char * buf, const unsigned char * key,
73
drizzled::key_part_map keypart_map,
74
drizzled::ha_rkey_function find_flag);
75
int index_read_idx_map(unsigned char * buf, uint32_t idx, const unsigned char * key,
76
drizzled::key_part_map keypart_map,
77
drizzled::ha_rkey_function find_flag);
78
int index_read_last_map(unsigned char * buf, const unsigned char * key,
79
drizzled::key_part_map keypart_map);
80
int index_next(unsigned char * buf);
81
int index_prev(unsigned char * buf);
82
int index_first(unsigned char * buf);
83
int index_last(unsigned char * buf);
84
void position(const unsigned char *record);
85
int info(uint32_t flag);
87
void get_auto_increment(uint64_t, uint64_t,
95
#endif /* PLUGIN_BLACKHOLE_HA_BLACKHOLE_H */