~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/ha_myisam.h

  • Committer: Brian Aker
  • Date: 2008-10-12 01:59:02 UTC
  • Revision ID: brian@tangent.org-20081012015902-prhy6wsimdqr28om
Dead code around unsigned (first pass)

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
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 */
15
 
 
16
 
 
17
 
#ifndef PLUGIN_MYISAM_HA_MYISAM_H
18
 
#define PLUGIN_MYISAM_HA_MYISAM_H
19
 
 
20
 
#include <drizzled/cursor.h>
21
 
#include <drizzled/thr_lock.h>
22
 
 
23
 
/* class for the the myisam Cursor */
24
 
 
25
 
#include <plugin/myisam/myisam.h>
26
 
 
27
 
class ha_myisam: public drizzled::Cursor
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
15
 
 
16
 
 
17
 
 
18
/* class for the the myisam handler */
 
19
 
 
20
#include <storage/myisam/myisam.h>
 
21
 
 
22
#define HA_RECOVER_NONE         0       /* No automatic recover */
 
23
#define HA_RECOVER_DEFAULT      1       /* Automatic recover active */
 
24
#define HA_RECOVER_BACKUP       2       /* Make a backupfile on recover */
 
25
#define HA_RECOVER_FORCE        4       /* Recover even if we loose rows */
 
26
#define HA_RECOVER_QUICK        8       /* Don't check rows in data file */
 
27
 
 
28
extern ulong myisam_sort_buffer_size;
 
29
extern TYPELIB myisam_recover_typelib;
 
30
extern ulong myisam_recover_options;
 
31
 
 
32
#ifdef __cplusplus
 
33
extern "C" {
 
34
#endif
 
35
 
 
36
bool index_cond_func_myisam(void *arg);
 
37
 
 
38
#ifdef __cplusplus
 
39
}
 
40
#endif
 
41
 
 
42
class ha_myisam: public handler
28
43
{
29
44
  MI_INFO *file;
 
45
  uint64_t int_table_flags;
30
46
  char    *data_file_name, *index_file_name;
31
47
  bool can_enable_indexes;
32
 
  bool is_ordered;
33
 
  int repair(drizzled::Session *session, MI_CHECK &param, bool optimize);
 
48
  int repair(THD *thd, MI_CHECK &param, bool optimize);
34
49
 
35
50
 public:
36
 
  ha_myisam(drizzled::plugin::StorageEngine &engine,
37
 
            drizzled::Table &table_arg);
 
51
  ha_myisam(handlerton *hton, TABLE_SHARE *table_arg);
38
52
  ~ha_myisam() {}
39
 
  Cursor *clone(drizzled::memory::Root *mem_root);
 
53
  handler *clone(MEM_ROOT *mem_root);
 
54
  const char *table_type() const { return "MyISAM"; }
40
55
  const char *index_type(uint32_t key_number);
41
 
  int doStartIndexScan(uint32_t idx, bool sorted);
42
 
  int doEndIndexScan();
 
56
  const char **bas_ext() const;
 
57
  uint64_t table_flags() const { return int_table_flags; }
 
58
  int index_init(uint32_t idx, bool sorted);
 
59
  int index_end();
 
60
  uint32_t index_flags(uint32_t inx, uint32_t part __attribute__((unused)),
 
61
                       bool all_parts __attribute__((unused))) const
 
62
  {
 
63
    return ((table_share->key_info[inx].algorithm == HA_KEY_ALG_FULLTEXT) ?
 
64
            0 : HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE |
 
65
            HA_READ_ORDER | HA_KEYREAD_ONLY | 
 
66
            (keys_with_parts.is_set(inx)?0:HA_DO_INDEX_COND_PUSHDOWN));
 
67
  }
 
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; }
43
71
  uint32_t checksum() const;
44
72
 
45
 
  int doOpen(const drizzled::TableIdentifier &identifier, int mode, uint32_t test_if_locked);
 
73
  int open(const char *name, int mode, uint32_t test_if_locked);
46
74
  int close(void);
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);
 
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,
 
79
                     enum ha_rkey_function find_flag);
52
80
  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);
 
81
                         key_part_map keypart_map,
 
82
                         enum ha_rkey_function find_flag);
 
83
  int index_read_last_map(unsigned char *buf, const unsigned char *key, key_part_map keypart_map);
56
84
  int index_next(unsigned char * buf);
57
85
  int index_prev(unsigned char * buf);
58
86
  int index_first(unsigned char * buf);
59
87
  int index_last(unsigned char * buf);
60
88
  int index_next_same(unsigned char *buf, const unsigned char *key, uint32_t keylen);
61
 
  int doStartTableScan(bool scan);
 
89
  int rnd_init(bool scan);
62
90
  int rnd_next(unsigned char *buf);
63
91
  int rnd_pos(unsigned char * buf, unsigned char *pos);
 
92
  int restart_rnd_next(unsigned char *buf, unsigned char *pos);
64
93
  void position(const unsigned char *record);
65
94
  int info(uint);
66
 
  int extra(enum drizzled::ha_extra_function operation);
67
 
  int extra_opt(enum drizzled::ha_extra_function operation, uint32_t cache_size);
 
95
  int extra(enum ha_extra_function operation);
 
96
  int extra_opt(enum ha_extra_function operation, uint32_t cache_size);
68
97
  int reset(void);
69
 
  int external_lock(drizzled::Session *session, int lock_type);
 
98
  int external_lock(THD *thd, int lock_type);
70
99
  int delete_all_rows(void);
71
100
  int disable_indexes(uint32_t mode);
72
101
  int enable_indexes(uint32_t mode);
73
102
  int indexes_are_disabled(void);
74
 
  void start_bulk_insert(drizzled::ha_rows rows);
 
103
  void start_bulk_insert(ha_rows rows);
75
104
  int end_bulk_insert();
76
 
  drizzled::ha_rows records_in_range(uint32_t inx, drizzled::key_range *min_key, drizzled::key_range *max_key);
 
105
  ha_rows records_in_range(uint32_t inx, key_range *min_key, key_range *max_key);
 
106
  void update_create_info(HA_CREATE_INFO *create_info);
 
107
  int create(const char *name, Table *form, HA_CREATE_INFO *create_info);
 
108
  THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to,
 
109
                             enum thr_lock_type lock_type);
77
110
  virtual void get_auto_increment(uint64_t offset, uint64_t increment,
78
111
                                  uint64_t nb_desired_values,
79
112
                                  uint64_t *first_value,
80
113
                                  uint64_t *nb_reserved_values);
 
114
  int rename_table(const char * from, const char * to);
 
115
  int delete_table(const char *name);
 
116
  int check(THD* thd, HA_CHECK_OPT* check_opt);
 
117
  int analyze(THD* thd,HA_CHECK_OPT* check_opt);
 
118
  int repair(THD* thd, HA_CHECK_OPT* check_opt);
 
119
  bool check_and_repair(THD *thd);
 
120
  bool is_crashed() const;
 
121
  bool auto_repair() const { return myisam_recover_options != 0; }
 
122
  int optimize(THD* thd, HA_CHECK_OPT* check_opt);
 
123
  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);
 
125
#ifdef HAVE_QUERY_CACHE
 
126
  bool register_query_cache_table(THD *thd, char *table_key,
 
127
                                     uint32_t key_length,
 
128
                                     qc_engine_callback
 
129
                                     *engine_callback,
 
130
                                     uint64_t *engine_data);
 
131
#endif
81
132
  MI_INFO *file_ptr(void)
82
133
  {
83
134
    return file;
84
135
  }
85
 
  int read_range_first(const drizzled::key_range *start_key, const drizzled::key_range *end_key,
 
136
  int read_range_first(const key_range *start_key, const key_range *end_key,
86
137
                       bool eq_range_arg, bool sorted);
87
138
  int read_range_next();
88
 
  int reset_auto_increment(uint64_t value);
89
 
 
90
 
  virtual bool isOrdered(void)
91
 
  {
92
 
    return false;
93
 
  }
94
 
 
 
139
public:
 
140
  /**
 
141
   * Multi Range Read interface
 
142
   */
 
143
  int multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param,
 
144
                            uint32_t n_ranges, uint32_t mode, HANDLER_BUFFER *buf);
 
145
  int multi_range_read_next(char **range_info);
 
146
  ha_rows multi_range_read_info_const(uint32_t keyno, RANGE_SEQ_IF *seq,
 
147
                                      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);
 
152
  
 
153
  /* Index condition pushdown implementation */
 
154
  Item *idx_cond_push(uint32_t keyno, Item* idx_cond);
95
155
private:
96
 
  drizzled::key_map keys_with_parts;
 
156
  DsMrr_impl ds_mrr;
 
157
  key_map keys_with_parts;
 
158
  friend bool index_cond_func_myisam(void *arg);
97
159
};
98
160
 
99
 
#endif /* PLUGIN_MYISAM_HA_MYISAM_H */