~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to plugin/myisam/ha_myisam.h

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-03-18 12:12:31 UTC
  • Revision ID: james.westby@ubuntu.com-20100318121231-k6g1xe6cshbwa0f8
Tags: upstream-2010.03.1347
ImportĀ upstreamĀ versionĀ 2010.03.1347

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
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
 
28
{
 
29
  MI_INFO *file;
 
30
  char    *data_file_name, *index_file_name;
 
31
  bool can_enable_indexes;
 
32
  bool is_ordered;
 
33
  int repair(drizzled::Session *session, MI_CHECK &param, bool optimize);
 
34
 
 
35
 public:
 
36
  ha_myisam(drizzled::plugin::StorageEngine &engine,
 
37
            drizzled::TableShare &table_arg);
 
38
  ~ha_myisam() {}
 
39
  Cursor *clone(drizzled::memory::Root *mem_root);
 
40
  const char *index_type(uint32_t key_number);
 
41
  int index_init(uint32_t idx, bool sorted);
 
42
  int index_end();
 
43
  uint32_t checksum() const;
 
44
 
 
45
  int open(const char *name, int mode, uint32_t test_if_locked);
 
46
  int close(void);
 
47
  int write_row(unsigned char * buf);
 
48
  int update_row(const unsigned char * old_data, unsigned char * new_data);
 
49
  int delete_row(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);
 
52
  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);
 
56
  int index_next(unsigned char * buf);
 
57
  int index_prev(unsigned char * buf);
 
58
  int index_first(unsigned char * buf);
 
59
  int index_last(unsigned char * buf);
 
60
  int index_next_same(unsigned char *buf, const unsigned char *key, uint32_t keylen);
 
61
  int rnd_init(bool scan);
 
62
  int rnd_next(unsigned char *buf);
 
63
  int rnd_pos(unsigned char * buf, unsigned char *pos);
 
64
  int restart_rnd_next(unsigned char *buf, unsigned char *pos);
 
65
  void position(const unsigned char *record);
 
66
  int info(uint);
 
67
  int extra(enum drizzled::ha_extra_function operation);
 
68
  int extra_opt(enum drizzled::ha_extra_function operation, uint32_t cache_size);
 
69
  int reset(void);
 
70
  int external_lock(drizzled::Session *session, int lock_type);
 
71
  int delete_all_rows(void);
 
72
  int disable_indexes(uint32_t mode);
 
73
  int enable_indexes(uint32_t mode);
 
74
  int indexes_are_disabled(void);
 
75
  void start_bulk_insert(drizzled::ha_rows rows);
 
76
  int end_bulk_insert();
 
77
  drizzled::ha_rows records_in_range(uint32_t inx, drizzled::key_range *min_key, drizzled::key_range *max_key);
 
78
  virtual void get_auto_increment(uint64_t offset, uint64_t increment,
 
79
                                  uint64_t nb_desired_values,
 
80
                                  uint64_t *first_value,
 
81
                                  uint64_t *nb_reserved_values);
 
82
  MI_INFO *file_ptr(void)
 
83
  {
 
84
    return file;
 
85
  }
 
86
  int read_range_first(const drizzled::key_range *start_key, const drizzled::key_range *end_key,
 
87
                       bool eq_range_arg, bool sorted);
 
88
  int read_range_next();
 
89
  int reset_auto_increment(uint64_t value);
 
90
 
 
91
  virtual bool isOrdered(void)
 
92
  {
 
93
    return false;
 
94
  }
 
95
 
 
96
private:
 
97
  drizzled::key_map keys_with_parts;
 
98
};
 
99
 
 
100
#endif /* PLUGIN_MYISAM_HA_MYISAM_H */