~drizzle-trunk/drizzle/development

1 by brian
clean slate
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
1183.1.2 by Brian Aker
Rename of handler to Cursor. You would not believe how long I have wanted
18
/* class for the the heap Cursor */
1 by brian
clean slate
19
1122.2.10 by Monty Taylor
Fixed all of the include guards.
20
#ifndef PLUGIN_HEAP_HA_HEAP_H
21
#define PLUGIN_HEAP_HA_HEAP_H
584.1.15 by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes.
22
1183.1.2 by Brian Aker
Rename of handler to Cursor. You would not believe how long I have wanted
23
#include <drizzled/cursor.h>
1241.9.43 by Monty Taylor
Merged trunk. Also renamed thr_lock. Doh. I hate it when I do both.
24
#include <drizzled/thr_lock.h>
685.1.3 by Monty Taylor
Turned off stdinc - and then fixed the carnage.
25
26
typedef struct st_heap_info HP_INFO;
27
typedef unsigned char *HEAP_PTR;
28
1 by brian
clean slate
29
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
30
class ha_heap: public drizzled::Cursor
1 by brian
clean slate
31
{
32
  HP_INFO *file;
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
33
  drizzled::key_map btree_keys;
1 by brian
clean slate
34
  /* number of records changed since last statistics update */
482 by Brian Aker
Remove uint.
35
  uint32_t    records_changed;
36
  uint32_t    key_stat_version;
280 by Brian Aker
Removed my_bool from heap engine.
37
  bool internal_table;
1 by brian
clean slate
38
public:
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
39
  ha_heap(drizzled::plugin::StorageEngine &engine, drizzled::TableShare &table);
1 by brian
clean slate
40
  ~ha_heap() {}
1253.1.3 by Monty Taylor
MEM_ROOT == memory::Root
41
  Cursor *clone(drizzled::memory::Root *mem_root);
1008.3.26 by Stewart Smith
remove handler::table_type() as same information can be retrieved from handler::engine->getName()
42
584.1.15 by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes.
43
  const char *index_type(uint32_t inx);
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
44
  drizzled::row_type get_row_type() const;
45
  const drizzled::key_map *keys_to_use_for_scanning() { return &btree_keys; }
1 by brian
clean slate
46
  double scan_time()
47
  { return (double) (stats.records+stats.deleted) / 20.0+10; }
653 by Brian Aker
More solaris bits
48
  double read_time(uint32_t, uint32_t,
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
49
                   drizzled::ha_rows rows)
1 by brian
clean slate
50
  { return (double) rows /  20.0+1; }
51
482 by Brian Aker
Remove uint.
52
  int open(const char *name, int mode, uint32_t test_if_locked);
1 by brian
clean slate
53
  int close(void);
54
  void set_keys_for_scanning(void);
481 by Brian Aker
Remove all of uchar.
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);
1 by brian
clean slate
58
  virtual void get_auto_increment(uint64_t offset, uint64_t increment,
59
                                  uint64_t nb_desired_values,
60
                                  uint64_t *first_value,
61
                                  uint64_t *nb_reserved_values);
584.1.15 by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes.
62
  int index_read_map(unsigned char * buf, const unsigned char * key,
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
63
                     drizzled::key_part_map keypart_map,
64
                     enum drizzled::ha_rkey_function find_flag);
584.1.15 by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes.
65
  int index_read_last_map(unsigned char *buf, const unsigned char *key,
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
66
                          drizzled::key_part_map keypart_map);
584.1.15 by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes.
67
  int index_read_idx_map(unsigned char * buf, uint32_t index,
68
                         const unsigned char * key,
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
69
                         drizzled::key_part_map keypart_map,
70
                         enum drizzled::ha_rkey_function find_flag);
481 by Brian Aker
Remove all of uchar.
71
  int index_next(unsigned char * buf);
72
  int index_prev(unsigned char * buf);
73
  int index_first(unsigned char * buf);
74
  int index_last(unsigned char * buf);
1 by brian
clean slate
75
  int rnd_init(bool scan);
481 by Brian Aker
Remove all of uchar.
76
  int rnd_next(unsigned char *buf);
77
  int rnd_pos(unsigned char * buf, unsigned char *pos);
78
  void position(const unsigned char *record);
1 by brian
clean slate
79
  int info(uint);
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
80
  int extra(enum drizzled::ha_extra_function operation);
1 by brian
clean slate
81
  int reset();
82
  int delete_all_rows(void);
482 by Brian Aker
Remove uint.
83
  int disable_indexes(uint32_t mode);
84
  int enable_indexes(uint32_t mode);
1 by brian
clean slate
85
  int indexes_are_disabled(void);
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
86
  drizzled::ha_rows records_in_range(uint32_t inx,
87
                                     drizzled::key_range *min_key,
88
                                     drizzled::key_range *max_key);
1 by brian
clean slate
89
  void drop_table(const char *name);
90
685.1.3 by Monty Taylor
Turned off stdinc - and then fixed the carnage.
91
  int cmp_ref(const unsigned char *ref1, const unsigned char *ref2);
1208.2.2 by Brian Aker
Merge Truncate patch. This fixes all of the "half setup" of Truncate. Still
92
  int reset_auto_increment(uint64_t value)
93
  {
1210 by Brian Aker
Merge new Truncate
94
    file->s->auto_increment= value;
95
    return 0;
1208.2.2 by Brian Aker
Merge Truncate patch. This fixes all of the "half setup" of Truncate. Still
96
  }
1 by brian
clean slate
97
private:
98
  void update_key_stats();
99
};
584.1.15 by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes.
100
1122.2.10 by Monty Taylor
Fixed all of the include guards.
101
#endif /* PLUGIN_HEAP_HA_HEAP_H */