~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
1802.10.2 by Monty Taylor
Update all of the copyright headers to include the correct address.
14
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
1 by brian
clean slate
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
2234 by Brian Aker
Mass removal of ifdef/endif in favor of pragma once.
20
#pragma once
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.
21
1183.1.2 by Brian Aker
Rename of handler to Cursor. You would not believe how long I have wanted
22
#include <drizzled/cursor.h>
1241.9.43 by Monty Taylor
Merged trunk. Also renamed thr_lock. Doh. I hate it when I do both.
23
#include <drizzled/thr_lock.h>
685.1.3 by Monty Taylor
Turned off stdinc - and then fixed the carnage.
24
25
typedef struct st_heap_info HP_INFO;
26
typedef unsigned char *HEAP_PTR;
27
2409.2.2 by Olaf van der Spek
cppcheck
28
class ha_heap : public drizzled::Cursor
1 by brian
clean slate
29
{
30
  HP_INFO *file;
31
  /* number of records changed since last statistics update */
482 by Brian Aker
Remove uint.
32
  uint32_t    records_changed;
33
  uint32_t    key_stat_version;
280 by Brian Aker
Removed my_bool from heap engine.
34
  bool internal_table;
1 by brian
clean slate
35
public:
1869.1.4 by Brian Aker
TableShare is no longer in the house (i.e. we no longer directly have a copy
36
  ha_heap(drizzled::plugin::StorageEngine &engine, drizzled::Table &table);
1 by brian
clean slate
37
  ~ha_heap() {}
1253.1.3 by Monty Taylor
MEM_ROOT == memory::Root
38
  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()
39
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.
40
  const char *index_type(uint32_t inx);
1638.2.1 by Stewart Smith
remove unused row_type from table proto (although referenced in a bunch of places)
41
1 by brian
clean slate
42
  double scan_time()
43
  { return (double) (stats.records+stats.deleted) / 20.0+10; }
653 by Brian Aker
More solaris bits
44
  double read_time(uint32_t, uint32_t,
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
45
                   drizzled::ha_rows rows)
1 by brian
clean slate
46
  { return (double) rows /  20.0+1; }
47
2087.4.2 by Brian Aker
Modify TableIdentifier to fit with the rest of the identifiers.
48
  int doOpen(const drizzled::identifier::Table &identifier, int mode, uint32_t test_if_locked);
1 by brian
clean slate
49
  int close(void);
50
  void set_keys_for_scanning(void);
1491.1.2 by Jay Pipes
Cursor::write_row() -> Cursor::doInsertRecord(). Cursor::ha_write_row() -> Cursor::insertRecord()
51
  int doInsertRecord(unsigned char * buf);
1491.1.3 by Jay Pipes
Cursor::update_row() changed to doUpdateRecord() and updateRecord()
52
  int doUpdateRecord(const unsigned char * old_data, unsigned char * new_data);
1491.1.4 by Jay Pipes
delete_row() is now deleteRecord() and doDeleteRecord() in Cursor
53
  int doDeleteRecord(const unsigned char * buf);
1 by brian
clean slate
54
  virtual void get_auto_increment(uint64_t offset, uint64_t increment,
55
                                  uint64_t nb_desired_values,
56
                                  uint64_t *first_value,
57
                                  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.
58
  int index_read_map(unsigned char * buf, const unsigned char * key,
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
59
                     drizzled::key_part_map keypart_map,
60
                     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.
61
  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.
62
                          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.
63
  int index_read_idx_map(unsigned char * buf, uint32_t index,
64
                         const unsigned char * key,
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
65
                         drizzled::key_part_map keypart_map,
66
                         enum drizzled::ha_rkey_function find_flag);
481 by Brian Aker
Remove all of uchar.
67
  int index_next(unsigned char * buf);
68
  int index_prev(unsigned char * buf);
69
  int index_first(unsigned char * buf);
70
  int index_last(unsigned char * buf);
1491.1.10 by Jay Pipes
ha_rnd_init -> startTableScan, rnd_init -> doStartTableScan, ha_rnd_end -> endTableScan, rnd_end -> doEndTableScan
71
  int doStartTableScan(bool scan);
481 by Brian Aker
Remove all of uchar.
72
  int rnd_next(unsigned char *buf);
73
  int rnd_pos(unsigned char * buf, unsigned char *pos);
74
  void position(const unsigned char *record);
1 by brian
clean slate
75
  int info(uint);
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
76
  int extra(enum drizzled::ha_extra_function operation);
1 by brian
clean slate
77
  int reset();
78
  int delete_all_rows(void);
482 by Brian Aker
Remove uint.
79
  int disable_indexes(uint32_t mode);
80
  int enable_indexes(uint32_t mode);
1 by brian
clean slate
81
  int indexes_are_disabled(void);
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
82
  drizzled::ha_rows records_in_range(uint32_t inx,
83
                                     drizzled::key_range *min_key,
84
                                     drizzled::key_range *max_key);
2385.2.5 by Olaf van der Spek
Refactor
85
  void drop_table();
1 by brian
clean slate
86
685.1.3 by Monty Taylor
Turned off stdinc - and then fixed the carnage.
87
  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
88
  int reset_auto_increment(uint64_t value)
89
  {
1697.2.1 by Brian Aker
Encapsulate the internal share for HEAP.
90
    file->getShare()->auto_increment= value;
1210 by Brian Aker
Merge new Truncate
91
    return 0;
1208.2.2 by Brian Aker
Merge Truncate patch. This fixes all of the "half setup" of Truncate. Still
92
  }
1 by brian
clean slate
93
private:
94
  void update_key_stats();
95
};
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.
96