Drizzled Public API Documentation

ha_myisam.h
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
15 
16 
17 #pragma once
18 
19 #include <drizzled/cursor.h>
20 #include <drizzled/thr_lock.h>
21 
22 /* class for the the myisam Cursor */
23 
24 #include <plugin/myisam/myisam.h>
25 
27 {
28  MI_INFO *file;
29  char *data_file_name, *index_file_name;
30  bool can_enable_indexes;
31  bool is_ordered;
32  int repair(drizzled::Session *session, MI_CHECK &param, bool optimize);
33 
34  public:
36  drizzled::Table &table_arg);
37  ~ha_myisam() {}
38  Cursor *clone(drizzled::memory::Root *mem_root);
39  const char *index_type(uint32_t key_number);
40  int doStartIndexScan(uint32_t idx, bool sorted);
41  int doEndIndexScan();
42  uint32_t checksum() const;
43 
44  int doOpen(const drizzled::identifier::Table &identifier, int mode, uint32_t test_if_locked);
45  int close(void);
46  int doInsertRecord(unsigned char * buf);
47  int doUpdateRecord(const unsigned char * old_data, unsigned char * new_data);
48  int doDeleteRecord(const unsigned char * buf);
49  int index_read_map(unsigned char *buf, const unsigned char *key, drizzled::key_part_map keypart_map,
50  enum drizzled::ha_rkey_function find_flag);
51  int index_read_idx_map(unsigned char *buf, uint32_t index, const unsigned char *key,
52  drizzled::key_part_map keypart_map,
53  enum drizzled::ha_rkey_function find_flag);
54  int index_read_last_map(unsigned char *buf, const unsigned char *key, drizzled::key_part_map keypart_map);
55  int index_next(unsigned char * buf);
56  int index_prev(unsigned char * buf);
57  int index_first(unsigned char * buf);
58  int index_last(unsigned char * buf);
59  int index_next_same(unsigned char *buf, const unsigned char *key, uint32_t keylen);
60  int doStartTableScan(bool scan);
61  int rnd_next(unsigned char *buf);
62  int rnd_pos(unsigned char * buf, unsigned char *pos);
63  void position(const unsigned char *record);
64  int info(uint);
65  int extra(enum drizzled::ha_extra_function operation);
66  int extra_opt(enum drizzled::ha_extra_function operation, uint32_t cache_size);
67  int reset(void);
68  int external_lock(drizzled::Session *session, int lock_type);
69  int delete_all_rows(void);
70  int disable_indexes(uint32_t mode);
71  int enable_indexes(uint32_t mode);
72  int indexes_are_disabled(void);
73  void start_bulk_insert(drizzled::ha_rows rows);
74  int end_bulk_insert();
75  drizzled::ha_rows records_in_range(uint32_t inx, drizzled::key_range *min_key, drizzled::key_range *max_key);
76  virtual void get_auto_increment(uint64_t offset, uint64_t increment,
77  uint64_t nb_desired_values,
78  uint64_t *first_value,
79  uint64_t *nb_reserved_values);
80  MI_INFO *file_ptr(void)
81  {
82  return file;
83  }
84  int read_range_first(const drizzled::key_range *start_key, const drizzled::key_range *end_key,
85  bool eq_range_arg, bool sorted);
86  int read_range_next();
87  int reset_auto_increment(uint64_t value);
88 
89  virtual bool isOrdered(void)
90  {
91  return false;
92  }
93 
94 private:
95  drizzled::key_map keys_with_parts;
96 };
97