drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
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
26class ha_myisam: public drizzled::Cursor
27{
28 MI_INFO *file;
29 bool can_enable_indexes;
30 bool is_ordered;
31 int repair(drizzled::Session *session, MI_CHECK &param, bool optimize);
32
33 public:
34 ha_myisam(drizzled::plugin::StorageEngine &engine,
35 drizzled::Table &table_arg);
36 ~ha_myisam() {}
37 Cursor *clone(drizzled::memory::Root *mem_root);
38 const char *index_type(uint32_t key_number);
39 int doStartIndexScan(uint32_t idx, bool sorted);
40 int doEndIndexScan();
41 uint32_t checksum() const;
42
43 int doOpen(const drizzled::identifier::Table &identifier, int mode, uint32_t test_if_locked);
44 int close(void);
45 int doInsertRecord(unsigned char * buf);
46 int doUpdateRecord(const unsigned char * old_data, unsigned char * new_data);
47 int doDeleteRecord(const unsigned char * buf);
48 int index_read_map(unsigned char *buf, const unsigned char *key, drizzled::key_part_map keypart_map,
49 enum drizzled::ha_rkey_function find_flag);
50 int index_read_idx_map(unsigned char *buf, uint32_t index, const unsigned char *key,
51 drizzled::key_part_map keypart_map,
52 enum drizzled::ha_rkey_function find_flag);
53 int index_read_last_map(unsigned char *buf, const unsigned char *key, drizzled::key_part_map keypart_map);
54 int index_next(unsigned char * buf);
55 int index_prev(unsigned char * buf);
56 int index_first(unsigned char * buf);
57 int index_last(unsigned char * buf);
58 int index_next_same(unsigned char *buf, const unsigned char *key, uint32_t keylen);
59 int doStartTableScan(bool scan);
60 int rnd_next(unsigned char *buf);
61 int rnd_pos(unsigned char * buf, unsigned char *pos);
62 void position(const unsigned char *record);
63 int info(uint);
64 int extra(enum drizzled::ha_extra_function operation);
65 int extra_opt(enum drizzled::ha_extra_function operation, uint32_t cache_size);
66 int reset(void);
67 int external_lock(drizzled::Session *session, int lock_type);
68 int delete_all_rows(void);
69 int disable_indexes(uint32_t mode);
70 int enable_indexes(uint32_t mode);
71 int indexes_are_disabled(void);
72 void start_bulk_insert(drizzled::ha_rows rows);
73 int end_bulk_insert();
74 drizzled::ha_rows records_in_range(uint32_t inx, drizzled::key_range *min_key, drizzled::key_range *max_key);
75 virtual void get_auto_increment(uint64_t offset, uint64_t increment,
76 uint64_t nb_desired_values,
77 uint64_t *first_value,
78 uint64_t *nb_reserved_values);
79 MI_INFO *file_ptr(void)
80 {
81 return file;
82 }
83 int read_range_first(const drizzled::key_range *start_key, const drizzled::key_range *end_key,
84 bool eq_range_arg, bool sorted);
85 int read_range_next();
86 int reset_auto_increment(uint64_t value);
87
88 virtual bool isOrdered(void)
89 {
90 return false;
91 }
92
93private:
94 drizzled::key_map keys_with_parts;
95};
96
int index_read_idx_map(unsigned char *buf, uint32_t index, const unsigned char *key, drizzled::key_part_map keypart_map, enum drizzled::ha_rkey_function find_flag)
Positions an index cursor to the index specified in the handle. Fetches the row if available....
int read_range_first(const drizzled::key_range *start_key, const drizzled::key_range *end_key, bool eq_range_arg, bool sorted)
int doStartTableScan(bool scan)
int delete_all_rows(void)
int read_range_next()
int index_read_map(unsigned char *buf, const unsigned char *key, drizzled::key_part_map keypart_map, enum drizzled::ha_rkey_function find_flag)
Positions an index cursor to the index specified in the handle. Fetches the row if available....
int reset_auto_increment(uint64_t value)
Definition ha_myisam.cc:350
int reset(void)
int external_lock(drizzled::Session *session, int lock_type)
int index_read_last_map(unsigned char *buf, const unsigned char *key, drizzled::key_part_map keypart_map)
The following functions works like index_read, but it find the last row with the current key value or...