21
21
#define PLUGIN_HEAP_HA_HEAP_H
23
23
#include <drizzled/cursor.h>
24
#include <drizzled/thr_lock.h>
24
#include <mysys/thr_lock.h>
26
26
typedef struct st_heap_info HP_INFO;
27
27
typedef unsigned char *HEAP_PTR;
30
class ha_heap: public drizzled::Cursor
30
class ha_heap: public Cursor
33
drizzled::key_map btree_keys;
34
34
/* number of records changed since last statistics update */
35
35
uint32_t records_changed;
36
36
uint32_t key_stat_version;
37
37
bool internal_table;
39
ha_heap(drizzled::plugin::StorageEngine &engine, drizzled::TableShare &table);
39
ha_heap(drizzled::plugin::StorageEngine &engine, TableShare &table);
41
Cursor *clone(drizzled::memory::Root *mem_root);
41
Cursor *clone(MEM_ROOT *mem_root);
43
43
const char *index_type(uint32_t inx);
44
drizzled::row_type get_row_type() const;
45
const drizzled::key_map *keys_to_use_for_scanning() { return &btree_keys; }
44
enum row_type get_row_type() const;
45
const key_map *keys_to_use_for_scanning() { return &btree_keys; }
47
47
{ return (double) (stats.records+stats.deleted) / 20.0+10; }
48
48
double read_time(uint32_t, uint32_t,
49
drizzled::ha_rows rows)
50
50
{ return (double) rows / 20.0+1; }
52
52
int open(const char *name, int mode, uint32_t test_if_locked);
60
60
uint64_t *first_value,
61
61
uint64_t *nb_reserved_values);
62
62
int index_read_map(unsigned char * buf, const unsigned char * key,
63
drizzled::key_part_map keypart_map,
64
enum drizzled::ha_rkey_function find_flag);
63
key_part_map keypart_map,
64
enum ha_rkey_function find_flag);
65
65
int index_read_last_map(unsigned char *buf, const unsigned char *key,
66
drizzled::key_part_map keypart_map);
66
key_part_map keypart_map);
67
67
int index_read_idx_map(unsigned char * buf, uint32_t index,
68
68
const unsigned char * key,
69
drizzled::key_part_map keypart_map,
70
enum drizzled::ha_rkey_function find_flag);
69
key_part_map keypart_map,
70
enum ha_rkey_function find_flag);
71
71
int index_next(unsigned char * buf);
72
72
int index_prev(unsigned char * buf);
73
73
int index_first(unsigned char * buf);
77
77
int rnd_pos(unsigned char * buf, unsigned char *pos);
78
78
void position(const unsigned char *record);
80
int extra(enum drizzled::ha_extra_function operation);
80
int extra(enum ha_extra_function operation);
82
82
int delete_all_rows(void);
83
83
int disable_indexes(uint32_t mode);
84
84
int enable_indexes(uint32_t mode);
85
85
int indexes_are_disabled(void);
86
drizzled::ha_rows records_in_range(uint32_t inx,
87
drizzled::key_range *min_key,
88
drizzled::key_range *max_key);
86
ha_rows records_in_range(uint32_t inx, key_range *min_key, key_range *max_key);
89
87
void drop_table(const char *name);
91
89
int cmp_ref(const unsigned char *ref1, const unsigned char *ref2);