~drizzle-trunk/drizzle/development

1 by brian
clean slate
1
/* Copyright (C) 2000-2006 MySQL AB
2
3
   This program is free software; you can redistribute it and/or modify
4
   it under the terms of the GNU General Public License as published by
5
   the Free Software Foundation; version 2 of the License.
6
7
   This program is distributed in the hope that it will be useful,
8
   but WITHOUT ANY WARRANTY; without even the implied warranty of
9
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10
   GNU General Public License for more details.
11
12
   You should have received a copy of the GNU General Public License
13
   along with this program; if not, write to the Free Software
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
16
584.1.15 by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes.
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>
1 by brian
clean slate
22
23
/* class for the the myisam handler */
24
212.4.2 by Monty Taylor
Fixed the includes in places to make the myisam header file move work.
25
#include <storage/myisam/myisam.h>
1 by brian
clean slate
26
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 */
32
33
extern TYPELIB myisam_recover_typelib;
34
extern ulong myisam_recover_options;
35
398.1.9 by Monty Taylor
Cleaned up stuff out of global.h.
36
#ifdef __cplusplus
37
extern "C" {
38
#endif
39
281 by Brian Aker
Converted myisam away from my_bool
40
bool index_cond_func_myisam(void *arg);
398.1.9 by Monty Taylor
Cleaned up stuff out of global.h.
41
42
#ifdef __cplusplus
43
}
44
#endif
1 by brian
clean slate
45
46
class ha_myisam: public handler
47
{
48
  MI_INFO *file;
49
  uint64_t int_table_flags;
50
  char    *data_file_name, *index_file_name;
51
  bool can_enable_indexes;
520.1.22 by Brian Aker
Second pass of thd cleanup
52
  int repair(Session *session, MI_CHECK &param, bool optimize);
1 by brian
clean slate
53
54
 public:
1000.1.3 by Brian Aker
Renamed TABLE_SHARE to TableShare
55
  ha_myisam(StorageEngine *engine, TableShare *table_arg);
1 by brian
clean slate
56
  ~ha_myisam() {}
57
  handler *clone(MEM_ROOT *mem_root);
58
  const char *table_type() const { return "MyISAM"; }
482 by Brian Aker
Remove uint.
59
  const char *index_type(uint32_t key_number);
1 by brian
clean slate
60
  const char **bas_ext() const;
61
  uint64_t table_flags() const { return int_table_flags; }
482 by Brian Aker
Remove uint.
62
  int index_init(uint32_t idx, bool sorted);
1 by brian
clean slate
63
  int index_end();
584.1.15 by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes.
64
  uint32_t index_flags(uint32_t inx, uint32_t part, bool all_parts) const;
482 by Brian Aker
Remove uint.
65
  uint32_t max_supported_keys()          const { return MI_MAX_KEY; }
66
  uint32_t max_supported_key_length()    const { return MI_MAX_KEY_LENGTH; }
67
  uint32_t max_supported_key_part_length() const { return MI_MAX_KEY_LENGTH; }
68
  uint32_t checksum() const;
1 by brian
clean slate
69
482 by Brian Aker
Remove uint.
70
  int open(const char *name, int mode, uint32_t test_if_locked);
1 by brian
clean slate
71
  int close(void);
481 by Brian Aker
Remove all of uchar.
72
  int write_row(unsigned char * buf);
73
  int update_row(const unsigned char * old_data, unsigned char * new_data);
74
  int delete_row(const unsigned char * buf);
75
  int index_read_map(unsigned char *buf, const unsigned char *key, key_part_map keypart_map,
1 by brian
clean slate
76
                     enum ha_rkey_function find_flag);
482 by Brian Aker
Remove uint.
77
  int index_read_idx_map(unsigned char *buf, uint32_t index, const unsigned char *key,
1 by brian
clean slate
78
                         key_part_map keypart_map,
79
                         enum ha_rkey_function find_flag);
481 by Brian Aker
Remove all of uchar.
80
  int index_read_last_map(unsigned char *buf, const unsigned char *key, key_part_map keypart_map);
81
  int index_next(unsigned char * buf);
82
  int index_prev(unsigned char * buf);
83
  int index_first(unsigned char * buf);
84
  int index_last(unsigned char * buf);
482 by Brian Aker
Remove uint.
85
  int index_next_same(unsigned char *buf, const unsigned char *key, uint32_t keylen);
1 by brian
clean slate
86
  int rnd_init(bool scan);
481 by Brian Aker
Remove all of uchar.
87
  int rnd_next(unsigned char *buf);
88
  int rnd_pos(unsigned char * buf, unsigned char *pos);
89
  int restart_rnd_next(unsigned char *buf, unsigned char *pos);
90
  void position(const unsigned char *record);
1 by brian
clean slate
91
  int info(uint);
92
  int extra(enum ha_extra_function operation);
61 by Brian Aker
Conversion of handler type.
93
  int extra_opt(enum ha_extra_function operation, uint32_t cache_size);
1 by brian
clean slate
94
  int reset(void);
520.1.22 by Brian Aker
Second pass of thd cleanup
95
  int external_lock(Session *session, int lock_type);
1 by brian
clean slate
96
  int delete_all_rows(void);
482 by Brian Aker
Remove uint.
97
  int disable_indexes(uint32_t mode);
98
  int enable_indexes(uint32_t mode);
1 by brian
clean slate
99
  int indexes_are_disabled(void);
100
  void start_bulk_insert(ha_rows rows);
101
  int end_bulk_insert();
482 by Brian Aker
Remove uint.
102
  ha_rows records_in_range(uint32_t inx, key_range *min_key, key_range *max_key);
1 by brian
clean slate
103
  void update_create_info(HA_CREATE_INFO *create_info);
327.1.5 by Brian Aker
Refactor around classes. TABLE_LIST has been factored out of table.h
104
  int create(const char *name, Table *form, HA_CREATE_INFO *create_info);
520.1.22 by Brian Aker
Second pass of thd cleanup
105
  THR_LOCK_DATA **store_lock(Session *session, THR_LOCK_DATA **to,
1 by brian
clean slate
106
			     enum thr_lock_type lock_type);
107
  virtual void get_auto_increment(uint64_t offset, uint64_t increment,
108
                                  uint64_t nb_desired_values,
109
                                  uint64_t *first_value,
110
                                  uint64_t *nb_reserved_values);
111
  int rename_table(const char * from, const char * to);
112
  int delete_table(const char *name);
520.1.22 by Brian Aker
Second pass of thd cleanup
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);
1 by brian
clean slate
117
  bool is_crashed() const;
118
  bool auto_repair() const { return myisam_recover_options != 0; }
520.1.22 by Brian Aker
Second pass of thd cleanup
119
  int optimize(Session* session, HA_CHECK_OPT* check_opt);
120
  int assign_to_keycache(Session* session, HA_CHECK_OPT* check_opt);
482 by Brian Aker
Remove uint.
121
  bool check_if_incompatible_data(HA_CREATE_INFO *info, uint32_t table_changes);
1 by brian
clean slate
122
#ifdef HAVE_QUERY_CACHE
520.1.22 by Brian Aker
Second pass of thd cleanup
123
  bool register_query_cache_table(Session *session, char *table_key,
482 by Brian Aker
Remove uint.
124
                                     uint32_t key_length,
1 by brian
clean slate
125
                                     qc_engine_callback
126
                                     *engine_callback,
127
                                     uint64_t *engine_data);
128
#endif
129
  MI_INFO *file_ptr(void)
130
  {
131
    return file;
132
  }
133
  int read_range_first(const key_range *start_key, const key_range *end_key,
134
                       bool eq_range_arg, bool sorted);
135
  int read_range_next();
136
public:
137
  /**
138
   * Multi Range Read interface
139
   */
140
  int multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param,
482 by Brian Aker
Remove uint.
141
                            uint32_t n_ranges, uint32_t mode, HANDLER_BUFFER *buf);
1 by brian
clean slate
142
  int multi_range_read_next(char **range_info);
482 by Brian Aker
Remove uint.
143
  ha_rows multi_range_read_info_const(uint32_t keyno, RANGE_SEQ_IF *seq,
660.1.3 by Eric Herman
removed trailing whitespace with simple script:
144
                                      void *seq_init_param,
482 by Brian Aker
Remove uint.
145
                                      uint32_t n_ranges, uint32_t *bufsz,
146
                                      uint32_t *flags, COST_VECT *cost);
147
  int multi_range_read_info(uint32_t keyno, uint32_t n_ranges, uint32_t keys,
148
                            uint32_t *bufsz, uint32_t *flags, COST_VECT *cost);
660.1.3 by Eric Herman
removed trailing whitespace with simple script:
149
1 by brian
clean slate
150
  /* Index condition pushdown implementation */
482 by Brian Aker
Remove uint.
151
  Item *idx_cond_push(uint32_t keyno, Item* idx_cond);
383.7.1 by Andrey Zhakov
Initial submit of code and tests
152
  bool check_if_supported_virtual_columns(void) { return true; }
1 by brian
clean slate
153
private:
154
  DsMrr_impl ds_mrr;
155
  key_map keys_with_parts;
281 by Brian Aker
Converted myisam away from my_bool
156
  friend bool index_cond_func_myisam(void *arg);
1 by brian
clean slate
157
};
158
584.1.15 by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes.
159
#endif /* STORAGE_MYISAM_HA_MYISAM_H */