~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/ha_myisam.h

  • Committer: Monty Taylor
  • Date: 2008-07-05 22:08:52 UTC
  • mto: This revision was merged to the branch mainline in revision 77.
  • Revision ID: monty@inaugust.com-20080705220852-cqd9t6tfkhvlcf73
Removed HAVE_LONG_LONG, as this is now assumed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
16
 
 
17
#ifdef USE_PRAGMA_INTERFACE
 
18
#pragma interface                       /* gcc class implementation */
 
19
#endif
17
20
 
18
21
/* class for the the myisam handler */
19
22
 
20
 
#include <storage/myisam/myisam.h>
 
23
#include <myisam.h>
 
24
#include <ft_global.h>
21
25
 
22
26
#define HA_RECOVER_NONE         0       /* No automatic recover */
23
27
#define HA_RECOVER_DEFAULT      1       /* Automatic recover active */
29
33
extern TYPELIB myisam_recover_typelib;
30
34
extern ulong myisam_recover_options;
31
35
 
32
 
#ifdef __cplusplus
33
 
extern "C" {
34
 
#endif
35
 
 
36
 
bool index_cond_func_myisam(void *arg);
37
 
 
38
 
#ifdef __cplusplus
39
 
}
40
 
#endif
 
36
C_MODE_START
 
37
my_bool index_cond_func_myisam(void *arg);
 
38
C_MODE_END
41
39
 
42
40
class ha_myisam: public handler
43
41
{
52
50
  ~ha_myisam() {}
53
51
  handler *clone(MEM_ROOT *mem_root);
54
52
  const char *table_type() const { return "MyISAM"; }
55
 
  const char *index_type(uint32_t key_number);
 
53
  const char *index_type(uint key_number);
56
54
  const char **bas_ext() const;
57
55
  uint64_t table_flags() const { return int_table_flags; }
58
 
  int index_init(uint32_t idx, bool sorted);
 
56
  int index_init(uint idx, bool sorted);
59
57
  int index_end();
60
 
  uint32_t index_flags(uint32_t inx, uint32_t part __attribute__((unused)),
61
 
                       bool all_parts __attribute__((unused))) const
 
58
  ulong index_flags(uint inx, uint part, bool all_parts) const
62
59
  {
63
60
    return ((table_share->key_info[inx].algorithm == HA_KEY_ALG_FULLTEXT) ?
64
61
            0 : HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE |
65
62
            HA_READ_ORDER | HA_KEYREAD_ONLY | 
66
63
            (keys_with_parts.is_set(inx)?0:HA_DO_INDEX_COND_PUSHDOWN));
67
64
  }
68
 
  uint32_t max_supported_keys()          const { return MI_MAX_KEY; }
69
 
  uint32_t max_supported_key_length()    const { return MI_MAX_KEY_LENGTH; }
70
 
  uint32_t max_supported_key_part_length() const { return MI_MAX_KEY_LENGTH; }
71
 
  uint32_t checksum() const;
 
65
  uint max_supported_keys()          const { return MI_MAX_KEY; }
 
66
  uint max_supported_key_length()    const { return MI_MAX_KEY_LENGTH; }
 
67
  uint max_supported_key_part_length() const { return MI_MAX_KEY_LENGTH; }
 
68
  uint checksum() const;
72
69
 
73
 
  int open(const char *name, int mode, uint32_t test_if_locked);
 
70
  int open(const char *name, int mode, uint test_if_locked);
74
71
  int close(void);
75
 
  int write_row(unsigned char * buf);
76
 
  int update_row(const unsigned char * old_data, unsigned char * new_data);
77
 
  int delete_row(const unsigned char * buf);
78
 
  int index_read_map(unsigned char *buf, const unsigned char *key, key_part_map keypart_map,
 
72
  int write_row(uchar * buf);
 
73
  int update_row(const uchar * old_data, uchar * new_data);
 
74
  int delete_row(const uchar * buf);
 
75
  int index_read_map(uchar *buf, const uchar *key, key_part_map keypart_map,
79
76
                     enum ha_rkey_function find_flag);
80
 
  int index_read_idx_map(unsigned char *buf, uint32_t index, const unsigned char *key,
 
77
  int index_read_idx_map(uchar *buf, uint index, const uchar *key,
81
78
                         key_part_map keypart_map,
82
79
                         enum ha_rkey_function find_flag);
83
 
  int index_read_last_map(unsigned char *buf, const unsigned char *key, key_part_map keypart_map);
84
 
  int index_next(unsigned char * buf);
85
 
  int index_prev(unsigned char * buf);
86
 
  int index_first(unsigned char * buf);
87
 
  int index_last(unsigned char * buf);
88
 
  int index_next_same(unsigned char *buf, const unsigned char *key, uint32_t keylen);
 
80
  int index_read_last_map(uchar *buf, const uchar *key, key_part_map keypart_map);
 
81
  int index_next(uchar * buf);
 
82
  int index_prev(uchar * buf);
 
83
  int index_first(uchar * buf);
 
84
  int index_last(uchar * buf);
 
85
  int index_next_same(uchar *buf, const uchar *key, uint keylen);
 
86
  int ft_init()
 
87
  {
 
88
    if (!ft_handler)
 
89
      return 1;
 
90
    ft_handler->please->reinit_search(ft_handler);
 
91
    return 0;
 
92
  }
 
93
  FT_INFO *ft_init_ext(uint flags, uint inx,String *key)
 
94
  {
 
95
    return ft_init_search(flags,file,inx,
 
96
                          (uchar *)key->ptr(), key->length(), key->charset(),
 
97
                          table->record[0]);
 
98
  }
 
99
  int ft_read(uchar *buf);
89
100
  int rnd_init(bool scan);
90
 
  int rnd_next(unsigned char *buf);
91
 
  int rnd_pos(unsigned char * buf, unsigned char *pos);
92
 
  int restart_rnd_next(unsigned char *buf, unsigned char *pos);
93
 
  void position(const unsigned char *record);
 
101
  int rnd_next(uchar *buf);
 
102
  int rnd_pos(uchar * buf, uchar *pos);
 
103
  int restart_rnd_next(uchar *buf, uchar *pos);
 
104
  void position(const uchar *record);
94
105
  int info(uint);
95
106
  int extra(enum ha_extra_function operation);
96
 
  int extra_opt(enum ha_extra_function operation, uint32_t cache_size);
 
107
  int extra_opt(enum ha_extra_function operation, ulong cache_size);
97
108
  int reset(void);
98
109
  int external_lock(THD *thd, int lock_type);
99
110
  int delete_all_rows(void);
100
 
  int disable_indexes(uint32_t mode);
101
 
  int enable_indexes(uint32_t mode);
 
111
  int disable_indexes(uint mode);
 
112
  int enable_indexes(uint mode);
102
113
  int indexes_are_disabled(void);
103
114
  void start_bulk_insert(ha_rows rows);
104
115
  int end_bulk_insert();
105
 
  ha_rows records_in_range(uint32_t inx, key_range *min_key, key_range *max_key);
 
116
  ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key);
106
117
  void update_create_info(HA_CREATE_INFO *create_info);
107
 
  int create(const char *name, Table *form, HA_CREATE_INFO *create_info);
 
118
  int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info);
108
119
  THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to,
109
120
                             enum thr_lock_type lock_type);
110
121
  virtual void get_auto_increment(uint64_t offset, uint64_t increment,
121
132
  bool auto_repair() const { return myisam_recover_options != 0; }
122
133
  int optimize(THD* thd, HA_CHECK_OPT* check_opt);
123
134
  int assign_to_keycache(THD* thd, HA_CHECK_OPT* check_opt);
124
 
  bool check_if_incompatible_data(HA_CREATE_INFO *info, uint32_t table_changes);
 
135
  bool check_if_incompatible_data(HA_CREATE_INFO *info, uint table_changes);
125
136
#ifdef HAVE_QUERY_CACHE
126
 
  bool register_query_cache_table(THD *thd, char *table_key,
127
 
                                     uint32_t key_length,
 
137
  my_bool register_query_cache_table(THD *thd, char *table_key,
 
138
                                     uint key_length,
128
139
                                     qc_engine_callback
129
140
                                     *engine_callback,
130
141
                                     uint64_t *engine_data);
141
152
   * Multi Range Read interface
142
153
   */
143
154
  int multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param,
144
 
                            uint32_t n_ranges, uint32_t mode, HANDLER_BUFFER *buf);
 
155
                            uint n_ranges, uint mode, HANDLER_BUFFER *buf);
145
156
  int multi_range_read_next(char **range_info);
146
 
  ha_rows multi_range_read_info_const(uint32_t keyno, RANGE_SEQ_IF *seq,
 
157
  ha_rows multi_range_read_info_const(uint keyno, RANGE_SEQ_IF *seq,
147
158
                                      void *seq_init_param, 
148
 
                                      uint32_t n_ranges, uint32_t *bufsz,
149
 
                                      uint32_t *flags, COST_VECT *cost);
150
 
  int multi_range_read_info(uint32_t keyno, uint32_t n_ranges, uint32_t keys,
151
 
                            uint32_t *bufsz, uint32_t *flags, COST_VECT *cost);
 
159
                                      uint n_ranges, uint *bufsz,
 
160
                                      uint *flags, COST_VECT *cost);
 
161
  int multi_range_read_info(uint keyno, uint n_ranges, uint keys,
 
162
                            uint *bufsz, uint *flags, COST_VECT *cost);
152
163
  
153
164
  /* Index condition pushdown implementation */
154
 
  Item *idx_cond_push(uint32_t keyno, Item* idx_cond);
155
 
  bool check_if_supported_virtual_columns(void) { return true; }
 
165
  Item *idx_cond_push(uint keyno, Item* idx_cond);
156
166
private:
157
167
  DsMrr_impl ds_mrr;
158
168
  key_map keys_with_parts;
159
 
  friend bool index_cond_func_myisam(void *arg);
 
169
  friend my_bool index_cond_func_myisam(void *arg);
160
170
};
161
171