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_MYISAM_HA_MYISAM_H
18
#define PLUGIN_MYISAM_HA_MYISAM_H
20
#include <drizzled/cursor.h>
21
#include <drizzled/thr_lock.h>
23
/* class for the the myisam Cursor */
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
17
#ifndef STORAGE_MYISAM_HA_MYISAM_H
18
#define STORAGE_MYISAM_HA_MYISAM_H
20
#include <drizzled/handler.h>
21
#include <mysys/thr_lock.h>
23
/* class for the the myisam handler */
25
25
#include <plugin/myisam/myisam.h>
27
class ha_myisam: public drizzled::Cursor
27
#define HA_RECOVER_NONE 0 /* No automatic recover */
28
#define HA_RECOVER_DEFAULT 1 /* Automatic recover active */
29
#define HA_RECOVER_BACKUP 2 /* Make a backupfile on recover */
30
#define HA_RECOVER_FORCE 4 /* Recover even if we loose rows */
31
#define HA_RECOVER_QUICK 8 /* Don't check rows in data file */
33
extern TYPELIB myisam_recover_typelib;
34
extern ulong myisam_recover_options;
40
bool index_cond_func_myisam(void *arg);
46
class ha_myisam: public handler
49
uint64_t int_table_flags;
30
50
char *data_file_name, *index_file_name;
31
51
bool can_enable_indexes;
33
int repair(drizzled::Session *session, MI_CHECK ¶m, bool optimize);
52
int repair(Session *session, MI_CHECK ¶m, bool optimize);
36
ha_myisam(drizzled::plugin::StorageEngine &engine,
37
drizzled::Table &table_arg);
55
ha_myisam(StorageEngine *engine, TableShare *table_arg);
39
Cursor *clone(drizzled::memory::Root *mem_root);
57
handler *clone(MEM_ROOT *mem_root);
40
58
const char *index_type(uint32_t key_number);
41
int doStartIndexScan(uint32_t idx, bool sorted);
59
uint64_t table_flags() const { return int_table_flags; }
60
int index_init(uint32_t idx, bool sorted);
62
uint32_t index_flags(uint32_t inx, uint32_t part, bool all_parts) const;
63
uint32_t max_supported_keys() const { return MI_MAX_KEY; }
64
uint32_t max_supported_key_length() const { return MI_MAX_KEY_LENGTH; }
65
uint32_t max_supported_key_part_length() const { return MI_MAX_KEY_LENGTH; }
43
66
uint32_t checksum() const;
45
int doOpen(const drizzled::identifier::Table &identifier, int mode, uint32_t test_if_locked);
68
int open(const char *name, int mode, uint32_t test_if_locked);
47
int doInsertRecord(unsigned char * buf);
48
int doUpdateRecord(const unsigned char * old_data, unsigned char * new_data);
49
int doDeleteRecord(const unsigned char * buf);
50
int index_read_map(unsigned char *buf, const unsigned char *key, drizzled::key_part_map keypart_map,
51
enum drizzled::ha_rkey_function find_flag);
70
int write_row(unsigned char * buf);
71
int update_row(const unsigned char * old_data, unsigned char * new_data);
72
int delete_row(const unsigned char * buf);
73
int index_read_map(unsigned char *buf, const unsigned char *key, key_part_map keypart_map,
74
enum ha_rkey_function find_flag);
52
75
int index_read_idx_map(unsigned char *buf, uint32_t index, const unsigned char *key,
53
drizzled::key_part_map keypart_map,
54
enum drizzled::ha_rkey_function find_flag);
55
int index_read_last_map(unsigned char *buf, const unsigned char *key, drizzled::key_part_map keypart_map);
76
key_part_map keypart_map,
77
enum ha_rkey_function find_flag);
78
int index_read_last_map(unsigned char *buf, const unsigned char *key, key_part_map keypart_map);
56
79
int index_next(unsigned char * buf);
57
80
int index_prev(unsigned char * buf);
58
81
int index_first(unsigned char * buf);
59
82
int index_last(unsigned char * buf);
60
83
int index_next_same(unsigned char *buf, const unsigned char *key, uint32_t keylen);
61
int doStartTableScan(bool scan);
84
int rnd_init(bool scan);
62
85
int rnd_next(unsigned char *buf);
63
86
int rnd_pos(unsigned char * buf, unsigned char *pos);
87
int restart_rnd_next(unsigned char *buf, unsigned char *pos);
64
88
void position(const unsigned char *record);
66
int extra(enum drizzled::ha_extra_function operation);
67
int extra_opt(enum drizzled::ha_extra_function operation, uint32_t cache_size);
90
int extra(enum ha_extra_function operation);
91
int extra_opt(enum ha_extra_function operation, uint32_t cache_size);
69
int external_lock(drizzled::Session *session, int lock_type);
93
int external_lock(Session *session, int lock_type);
70
94
int delete_all_rows(void);
71
95
int disable_indexes(uint32_t mode);
72
96
int enable_indexes(uint32_t mode);
73
97
int indexes_are_disabled(void);
74
void start_bulk_insert(drizzled::ha_rows rows);
98
void start_bulk_insert(ha_rows rows);
75
99
int end_bulk_insert();
76
drizzled::ha_rows records_in_range(uint32_t inx, drizzled::key_range *min_key, drizzled::key_range *max_key);
100
ha_rows records_in_range(uint32_t inx, key_range *min_key, key_range *max_key);
101
void update_create_info(HA_CREATE_INFO *create_info);
102
int create(const char *name, Table *form, HA_CREATE_INFO *create_info);
103
THR_LOCK_DATA **store_lock(Session *session, THR_LOCK_DATA **to,
104
enum thr_lock_type lock_type);
77
105
virtual void get_auto_increment(uint64_t offset, uint64_t increment,
78
106
uint64_t nb_desired_values,
79
107
uint64_t *first_value,
80
108
uint64_t *nb_reserved_values);
109
int check(Session* session, HA_CHECK_OPT* check_opt);
110
int analyze(Session* session,HA_CHECK_OPT* check_opt);
111
int repair(Session* session, HA_CHECK_OPT* check_opt);
112
bool check_and_repair(Session *session);
113
bool is_crashed() const;
114
bool auto_repair() const { return myisam_recover_options != 0; }
115
int optimize(Session* session, HA_CHECK_OPT* check_opt);
116
int assign_to_keycache(Session* session, HA_CHECK_OPT* check_opt);
81
117
MI_INFO *file_ptr(void)
85
int read_range_first(const drizzled::key_range *start_key, const drizzled::key_range *end_key,
121
int read_range_first(const key_range *start_key, const key_range *end_key,
86
122
bool eq_range_arg, bool sorted);
87
123
int read_range_next();
88
int reset_auto_increment(uint64_t value);
90
virtual bool isOrdered(void)
125
/* Index condition pushdown implementation */
126
Item *idx_cond_push(uint32_t keyno, Item* idx_cond);
96
drizzled::key_map keys_with_parts;
128
key_map keys_with_parts;
129
friend bool index_cond_func_myisam(void *arg);
99
#endif /* PLUGIN_MYISAM_HA_MYISAM_H */
132
#endif /* STORAGE_MYISAM_HA_MYISAM_H */