~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/heap/ha_heap.h

Merge Joe, plus I updated the tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
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 */
15
15
 
16
16
 
17
17
 
18
18
/* class for the the heap Cursor */
19
19
 
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
22
22
 
23
23
#include <drizzled/cursor.h>
24
24
#include <drizzled/thr_lock.h>
30
30
class ha_heap: public drizzled::Cursor
31
31
{
32
32
  HP_INFO *file;
 
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;
37
38
public:
38
 
  ha_heap(drizzled::plugin::StorageEngine &engine, drizzled::Table &table);
 
39
  ha_heap(drizzled::plugin::StorageEngine &engine, drizzled::TableShare &table);
39
40
  ~ha_heap() {}
40
41
  Cursor *clone(drizzled::memory::Root *mem_root);
41
42
 
42
43
  const char *index_type(uint32_t inx);
43
 
 
 
44
  drizzled::row_type get_row_type() const;
 
45
  const drizzled::key_map *keys_to_use_for_scanning() { return &btree_keys; }
44
46
  double scan_time()
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; }
49
51
 
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);
51
53
  int close(void);
52
54
  void set_keys_for_scanning(void);
53
55
  int doInsertRecord(unsigned char * buf);
89
91
  int cmp_ref(const unsigned char *ref1, const unsigned char *ref2);
90
92
  int reset_auto_increment(uint64_t value)
91
93
  {
92
 
    file->getShare()->auto_increment= value;
 
94
    file->s->auto_increment= value;
93
95
    return 0;
94
96
  }
95
97
private:
96
98
  void update_key_stats();
97
99
};
98
100
 
99
 
#endif /* PLUGIN_MEMORY_HA_HEAP_H */
 
101
#endif /* PLUGIN_HEAP_HA_HEAP_H */