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 */
18
18
/* class for the the heap Cursor */
20
#ifndef PLUGIN_MEMORY_HA_HEAP_H
21
#define PLUGIN_MEMORY_HA_HEAP_H
20
#ifndef PLUGIN_HEAP_HA_HEAP_H
21
#define PLUGIN_HEAP_HA_HEAP_H
23
23
#include <drizzled/cursor.h>
24
24
#include <drizzled/thr_lock.h>
30
30
class ha_heap: public drizzled::Cursor
33
drizzled::key_map btree_keys;
33
34
/* number of records changed since last statistics update */
34
35
uint32_t records_changed;
35
36
uint32_t key_stat_version;
36
37
bool internal_table;
38
ha_heap(drizzled::plugin::StorageEngine &engine, drizzled::Table &table);
39
ha_heap(drizzled::plugin::StorageEngine &engine, drizzled::TableShare &table);
40
41
Cursor *clone(drizzled::memory::Root *mem_root);
42
43
const char *index_type(uint32_t inx);
44
drizzled::row_type get_row_type() const;
45
const drizzled::key_map *keys_to_use_for_scanning() { return &btree_keys; }
45
47
{ return (double) (stats.records+stats.deleted) / 20.0+10; }
46
48
double read_time(uint32_t, uint32_t,
47
49
drizzled::ha_rows rows)
48
50
{ return (double) rows / 20.0+1; }
50
int doOpen(const drizzled::identifier::Table &identifier, int mode, uint32_t test_if_locked);
52
int open(const char *name, int mode, uint32_t test_if_locked);
52
54
void set_keys_for_scanning(void);
53
int doInsertRecord(unsigned char * buf);
54
int doUpdateRecord(const unsigned char * old_data, unsigned char * new_data);
55
int doDeleteRecord(const unsigned char * buf);
55
int write_row(unsigned char * buf);
56
int update_row(const unsigned char * old_data, unsigned char * new_data);
57
int delete_row(const unsigned char * buf);
56
58
virtual void get_auto_increment(uint64_t offset, uint64_t increment,
57
59
uint64_t nb_desired_values,
58
60
uint64_t *first_value,
70
72
int index_prev(unsigned char * buf);
71
73
int index_first(unsigned char * buf);
72
74
int index_last(unsigned char * buf);
73
int doStartTableScan(bool scan);
75
int rnd_init(bool scan);
74
76
int rnd_next(unsigned char *buf);
75
77
int rnd_pos(unsigned char * buf, unsigned char *pos);
76
78
void position(const unsigned char *record);
89
91
int cmp_ref(const unsigned char *ref1, const unsigned char *ref2);
90
92
int reset_auto_increment(uint64_t value)
92
file->getShare()->auto_increment= value;
94
file->s->auto_increment= value;
96
98
void update_key_stats();
99
#endif /* PLUGIN_MEMORY_HA_HEAP_H */
101
#endif /* PLUGIN_HEAP_HA_HEAP_H */