~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/myisam/ha_myisam.h

  • Committer: Brian Aker
  • Date: 2009-12-03 04:18:00 UTC
  • mto: (1237.3.3 push)
  • mto: This revision was merged to the branch mainline in revision 1238.
  • Revision ID: brian@gaz-20091203041800-rxbans14m0bo0xcs
Final move of index flags up to Engine (new interface still needed).

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 */
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
16
 
17
17
#ifndef PLUGIN_MYISAM_HA_MYISAM_H
18
18
#define PLUGIN_MYISAM_HA_MYISAM_H
19
19
 
20
20
#include <drizzled/cursor.h>
21
 
#include <drizzled/thr_lock.h>
 
21
#include <mysys/thr_lock.h>
22
22
 
23
23
/* class for the the myisam Cursor */
24
24
 
25
25
#include <plugin/myisam/myisam.h>
26
26
 
27
 
class ha_myisam: public drizzled::Cursor
 
27
#ifdef __cplusplus
 
28
extern "C" {
 
29
#endif
 
30
 
 
31
#ifdef __cplusplus
 
32
}
 
33
#endif
 
34
 
 
35
class ha_myisam: public Cursor
28
36
{
29
37
  MI_INFO *file;
30
38
  char    *data_file_name, *index_file_name;
31
39
  bool can_enable_indexes;
32
40
  bool is_ordered;
33
 
  int repair(drizzled::Session *session, MI_CHECK &param, bool optimize);
 
41
  int repair(Session *session, MI_CHECK &param, bool optimize);
34
42
 
35
43
 public:
36
 
  ha_myisam(drizzled::plugin::StorageEngine &engine,
37
 
            drizzled::Table &table_arg);
 
44
  ha_myisam(drizzled::plugin::StorageEngine &engine, TableShare &table_arg);
38
45
  ~ha_myisam() {}
39
 
  Cursor *clone(drizzled::memory::Root *mem_root);
 
46
  Cursor *clone(MEM_ROOT *mem_root);
40
47
  const char *index_type(uint32_t key_number);
41
 
  int doStartIndexScan(uint32_t idx, bool sorted);
42
 
  int doEndIndexScan();
 
48
  int index_init(uint32_t idx, bool sorted);
 
49
  int index_end();
43
50
  uint32_t checksum() const;
44
51
 
45
 
  int doOpen(const drizzled::TableIdentifier &identifier, int mode, uint32_t test_if_locked);
 
52
  int open(const char *name, int mode, uint32_t test_if_locked);
46
53
  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);
 
54
  int write_row(unsigned char * buf);
 
55
  int update_row(const unsigned char * old_data, unsigned char * new_data);
 
56
  int delete_row(const unsigned char * buf);
 
57
  int index_read_map(unsigned char *buf, const unsigned char *key, key_part_map keypart_map,
 
58
                     enum ha_rkey_function find_flag);
52
59
  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);
 
60
                         key_part_map keypart_map,
 
61
                         enum ha_rkey_function find_flag);
 
62
  int index_read_last_map(unsigned char *buf, const unsigned char *key, key_part_map keypart_map);
56
63
  int index_next(unsigned char * buf);
57
64
  int index_prev(unsigned char * buf);
58
65
  int index_first(unsigned char * buf);
59
66
  int index_last(unsigned char * buf);
60
67
  int index_next_same(unsigned char *buf, const unsigned char *key, uint32_t keylen);
61
 
  int doStartTableScan(bool scan);
 
68
  int rnd_init(bool scan);
62
69
  int rnd_next(unsigned char *buf);
63
70
  int rnd_pos(unsigned char * buf, unsigned char *pos);
 
71
  int restart_rnd_next(unsigned char *buf, unsigned char *pos);
64
72
  void position(const unsigned char *record);
65
73
  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);
 
74
  int extra(enum ha_extra_function operation);
 
75
  int extra_opt(enum ha_extra_function operation, uint32_t cache_size);
68
76
  int reset(void);
69
 
  int external_lock(drizzled::Session *session, int lock_type);
 
77
  int external_lock(Session *session, int lock_type);
70
78
  int delete_all_rows(void);
71
79
  int disable_indexes(uint32_t mode);
72
80
  int enable_indexes(uint32_t mode);
73
81
  int indexes_are_disabled(void);
74
 
  void start_bulk_insert(drizzled::ha_rows rows);
 
82
  void start_bulk_insert(ha_rows rows);
75
83
  int end_bulk_insert();
76
 
  drizzled::ha_rows records_in_range(uint32_t inx, drizzled::key_range *min_key, drizzled::key_range *max_key);
 
84
  ha_rows records_in_range(uint32_t inx, key_range *min_key, key_range *max_key);
77
85
  virtual void get_auto_increment(uint64_t offset, uint64_t increment,
78
86
                                  uint64_t nb_desired_values,
79
87
                                  uint64_t *first_value,
82
90
  {
83
91
    return file;
84
92
  }
85
 
  int read_range_first(const drizzled::key_range *start_key, const drizzled::key_range *end_key,
 
93
  int read_range_first(const key_range *start_key, const key_range *end_key,
86
94
                       bool eq_range_arg, bool sorted);
87
95
  int read_range_next();
88
96
  int reset_auto_increment(uint64_t value);
93
101
  }
94
102
 
95
103
private:
96
 
  drizzled::key_map keys_with_parts;
 
104
  key_map keys_with_parts;
97
105
};
98
106
 
99
107
#endif /* PLUGIN_MYISAM_HA_MYISAM_H */