12
12
You should have received a copy of the GNU General Public License
13
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>
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
17
#ifndef STORAGE_BLACKHOLE_HA_BLACKHOLE_H
18
#define STORAGE_BLACKHOLE_HA_BLACKHOLE_H
20
#include <drizzled/handler.h>
21
#include <mysys/thr_lock.h>
23
23
#define BLACKHOLE_MAX_KEY 64 /* Max allowed keys */
24
#define BLACKHOLE_MAX_KEY_SEG 16 /* Max segments for key */
24
25
#define BLACKHOLE_MAX_KEY_LENGTH 1000
27
28
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;
30
struct st_blackhole_share {
38
32
uint32_t use_count;
39
const std::string table_name;
33
uint32_t table_name_length;
44
39
Class definition for the blackhole storage engine
45
40
"Dumbest named feature ever"
47
class ha_blackhole: public drizzled::Cursor
42
class ha_blackhole: public handler
49
drizzled::THR_LOCK_DATA lock; /* MySQL lock */
50
BlackholeShare *share;
44
THR_LOCK_DATA lock; /* MySQL lock */
45
st_blackhole_share *share;
53
ha_blackhole(drizzled::plugin::StorageEngine &engine,
54
drizzled::Table &table_arg);
48
ha_blackhole(handlerton *hton, TABLE_SHARE *table_arg);
52
/* The name that will be used for display purposes */
53
const char *table_type() const { return "BLACKHOLE"; }
59
55
The name of the index type that will be used for display
60
56
don't implement this method unless you really have indexes
62
58
const char *index_type(uint32_t key_number);
63
uint32_t index_flags(uint32_t inx) const;
59
const char **bas_ext() const;
60
uint64_t table_flags() const
62
return(HA_NULL_IN_KEY |
63
HA_BINLOG_STMT_CAPABLE |
68
uint32_t index_flags(uint32_t inx, uint32_t part, bool all_parts) const;
69
/* The following defines can be increased if necessary */
70
uint32_t max_supported_keys() const { return BLACKHOLE_MAX_KEY; }
71
uint32_t max_supported_key_length() const { return BLACKHOLE_MAX_KEY_LENGTH; }
72
uint32_t max_supported_key_part_length() const { return BLACKHOLE_MAX_KEY_LENGTH; }
64
73
int open(const char *name, int mode, uint32_t test_if_locked);
66
int doInsertRecord(unsigned char * buf);
67
int doStartTableScan(bool scan);
75
int write_row(unsigned char * buf);
76
int rnd_init(bool scan);
68
77
int rnd_next(unsigned char *buf);
69
78
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);
79
int index_read_map(unsigned char * buf, const unsigned char * key, key_part_map keypart_map,
80
enum ha_rkey_function find_flag);
75
81
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);
82
key_part_map keypart_map,
83
enum ha_rkey_function find_flag);
84
int index_read_last_map(unsigned char * buf, const unsigned char * key, key_part_map keypart_map);
80
85
int index_next(unsigned char * buf);
81
86
int index_prev(unsigned char * buf);
82
87
int index_first(unsigned char * buf);
83
88
int index_last(unsigned char * buf);
84
89
void position(const unsigned char *record);
85
90
int info(uint32_t flag);
87
void get_auto_increment(uint64_t, uint64_t,
91
int external_lock(Session *session, int lock_type);
92
int create(const char *name, Table *table_arg,
93
HA_CREATE_INFO *create_info);
94
THR_LOCK_DATA **store_lock(Session *session,
96
enum thr_lock_type lock_type);
95
#endif /* PLUGIN_BLACKHOLE_HA_BLACKHOLE_H */
99
#endif /* STORAGE_BLACKHOLE_HA_BLACKHOLE_H */