~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/myisam/ha_myisam.h

  • Committer: Brian Aker
  • Date: 2009-05-11 17:50:22 UTC
  • Revision ID: brian@gaz-20090511175022-y35q9ky6uh9ldcjt
Replacing Sun employee copyright headers (aka... anything done by a Sun
employee is copyright by Sun).

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
#ifndef STORAGE_MYISAM_HA_MYISAM_H
 
18
#define STORAGE_MYISAM_HA_MYISAM_H
 
19
 
 
20
#include <drizzled/handler.h>
 
21
#include <mysys/thr_lock.h>
20
22
 
21
23
/* class for the the myisam handler */
22
24
 
23
 
#include <storage/myisam/myisam.h>
 
25
#include <plugin/myisam/myisam.h>
24
26
 
25
27
#define HA_RECOVER_NONE         0       /* No automatic recover */
26
28
#define HA_RECOVER_DEFAULT      1       /* Automatic recover active */
28
30
#define HA_RECOVER_FORCE        4       /* Recover even if we loose rows */
29
31
#define HA_RECOVER_QUICK        8       /* Don't check rows in data file */
30
32
 
31
 
extern ulong myisam_sort_buffer_size;
32
33
extern TYPELIB myisam_recover_typelib;
33
34
extern ulong myisam_recover_options;
34
35
 
48
49
  uint64_t int_table_flags;
49
50
  char    *data_file_name, *index_file_name;
50
51
  bool can_enable_indexes;
51
 
  int repair(THD *thd, MI_CHECK &param, bool optimize);
 
52
  int repair(Session *session, MI_CHECK &param, bool optimize);
52
53
 
53
54
 public:
54
 
  ha_myisam(handlerton *hton, TABLE_SHARE *table_arg);
 
55
  ha_myisam(StorageEngine *engine, TableShare *table_arg);
55
56
  ~ha_myisam() {}
56
57
  handler *clone(MEM_ROOT *mem_root);
57
58
  const char *table_type() const { return "MyISAM"; }
60
61
  uint64_t table_flags() const { return int_table_flags; }
61
62
  int index_init(uint32_t idx, bool sorted);
62
63
  int index_end();
63
 
  uint32_t index_flags(uint32_t inx, uint32_t part __attribute__((unused)),
64
 
                       bool all_parts __attribute__((unused))) const
65
 
  {
66
 
    return ((table_share->key_info[inx].algorithm == HA_KEY_ALG_FULLTEXT) ?
67
 
            0 : HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE |
68
 
            HA_READ_ORDER | HA_KEYREAD_ONLY | 
69
 
            (keys_with_parts.is_set(inx)?0:HA_DO_INDEX_COND_PUSHDOWN));
70
 
  }
 
64
  uint32_t index_flags(uint32_t inx, uint32_t part, bool all_parts) const;
71
65
  uint32_t max_supported_keys()          const { return MI_MAX_KEY; }
72
66
  uint32_t max_supported_key_length()    const { return MI_MAX_KEY_LENGTH; }
73
67
  uint32_t max_supported_key_part_length() const { return MI_MAX_KEY_LENGTH; }
98
92
  int extra(enum ha_extra_function operation);
99
93
  int extra_opt(enum ha_extra_function operation, uint32_t cache_size);
100
94
  int reset(void);
101
 
  int external_lock(THD *thd, int lock_type);
 
95
  int external_lock(Session *session, int lock_type);
102
96
  int delete_all_rows(void);
103
97
  int disable_indexes(uint32_t mode);
104
98
  int enable_indexes(uint32_t mode);
108
102
  ha_rows records_in_range(uint32_t inx, key_range *min_key, key_range *max_key);
109
103
  void update_create_info(HA_CREATE_INFO *create_info);
110
104
  int create(const char *name, Table *form, HA_CREATE_INFO *create_info);
111
 
  THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to,
 
105
  THR_LOCK_DATA **store_lock(Session *session, THR_LOCK_DATA **to,
112
106
                             enum thr_lock_type lock_type);
113
107
  virtual void get_auto_increment(uint64_t offset, uint64_t increment,
114
108
                                  uint64_t nb_desired_values,
116
110
                                  uint64_t *nb_reserved_values);
117
111
  int rename_table(const char * from, const char * to);
118
112
  int delete_table(const char *name);
119
 
  int check(THD* thd, HA_CHECK_OPT* check_opt);
120
 
  int analyze(THD* thd,HA_CHECK_OPT* check_opt);
121
 
  int repair(THD* thd, HA_CHECK_OPT* check_opt);
122
 
  bool check_and_repair(THD *thd);
 
113
  int check(Session* session, HA_CHECK_OPT* check_opt);
 
114
  int analyze(Session* session,HA_CHECK_OPT* check_opt);
 
115
  int repair(Session* session, HA_CHECK_OPT* check_opt);
 
116
  bool check_and_repair(Session *session);
123
117
  bool is_crashed() const;
124
118
  bool auto_repair() const { return myisam_recover_options != 0; }
125
 
  int optimize(THD* thd, HA_CHECK_OPT* check_opt);
126
 
  int assign_to_keycache(THD* thd, HA_CHECK_OPT* check_opt);
127
 
  bool check_if_incompatible_data(HA_CREATE_INFO *info, uint32_t table_changes);
128
 
#ifdef HAVE_QUERY_CACHE
129
 
  bool register_query_cache_table(THD *thd, char *table_key,
130
 
                                     uint32_t key_length,
131
 
                                     qc_engine_callback
132
 
                                     *engine_callback,
133
 
                                     uint64_t *engine_data);
134
 
#endif
 
119
  int optimize(Session* session, HA_CHECK_OPT* check_opt);
 
120
  int assign_to_keycache(Session* session, HA_CHECK_OPT* check_opt);
135
121
  MI_INFO *file_ptr(void)
136
122
  {
137
123
    return file;
147
133
                            uint32_t n_ranges, uint32_t mode, HANDLER_BUFFER *buf);
148
134
  int multi_range_read_next(char **range_info);
149
135
  ha_rows multi_range_read_info_const(uint32_t keyno, RANGE_SEQ_IF *seq,
150
 
                                      void *seq_init_param, 
 
136
                                      void *seq_init_param,
151
137
                                      uint32_t n_ranges, uint32_t *bufsz,
152
138
                                      uint32_t *flags, COST_VECT *cost);
153
139
  int multi_range_read_info(uint32_t keyno, uint32_t n_ranges, uint32_t keys,
154
140
                            uint32_t *bufsz, uint32_t *flags, COST_VECT *cost);
155
 
  
 
141
 
156
142
  /* Index condition pushdown implementation */
157
143
  Item *idx_cond_push(uint32_t keyno, Item* idx_cond);
158
144
private:
161
147
  friend bool index_cond_func_myisam(void *arg);
162
148
};
163
149
 
 
150
#endif /* STORAGE_MYISAM_HA_MYISAM_H */