~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/blackhole/ha_blackhole.h

  • Committer: Brian Aker
  • Date: 2008-12-23 07:19:26 UTC
  • Revision ID: brian@tangent.org-20081223071926-69z2ugpftfz1lfnm
Remove dead variables.

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 */
15
 
 
16
 
 
17
 
#ifndef PLUGIN_BLACKHOLE_HA_BLACKHOLE_H
18
 
#define PLUGIN_BLACKHOLE_HA_BLACKHOLE_H
19
 
 
20
 
#include <drizzled/cursor.h>
21
 
#include <drizzled/thr_lock.h>
 
14
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
15
 
 
16
 
 
17
#ifndef STORAGE_BLACKHOLE_HA_BLACKHOLE_H
 
18
#define STORAGE_BLACKHOLE_HA_BLACKHOLE_H
 
19
 
 
20
#include <drizzled/handler.h>
 
21
#include <mysys/thr_lock.h>
22
22
 
23
23
#define BLACKHOLE_MAX_KEY       64              /* Max allowed keys */
 
24
#define BLACKHOLE_MAX_KEY_SEG   16              /* Max segments for key */
24
25
#define BLACKHOLE_MAX_KEY_LENGTH 1000
25
26
 
26
27
/*
27
28
  Shared structure for correct LOCK operation
28
29
*/
29
 
class BlackholeShare
30
 
{
31
 
  BlackholeShare();
32
 
  BlackholeShare(const BlackholeShare &);
33
 
  BlackholeShare& operator=(const BlackholeShare &);
34
 
public:
35
 
  explicit BlackholeShare(const std::string table_name_arg);
36
 
  ~BlackholeShare();
37
 
  drizzled::THR_LOCK lock;
 
30
struct st_blackhole_share {
 
31
  THR_LOCK lock;
38
32
  uint32_t use_count;
39
 
  const std::string table_name;
 
33
  uint32_t table_name_length;
 
34
  char table_name[1];
40
35
};
41
36
 
42
37
 
44
39
  Class definition for the blackhole storage engine
45
40
  "Dumbest named feature ever"
46
41
*/
47
 
class ha_blackhole: public drizzled::Cursor
 
42
class ha_blackhole: public handler
48
43
{
49
 
  drizzled::THR_LOCK_DATA lock;      /* MySQL lock */
50
 
  BlackholeShare *share;
 
44
  THR_LOCK_DATA lock;      /* MySQL lock */
 
45
  st_blackhole_share *share;
51
46
 
52
47
public:
53
 
  ha_blackhole(drizzled::plugin::StorageEngine &engine,
54
 
               drizzled::Table &table_arg);
 
48
  ha_blackhole(handlerton *hton, TABLE_SHARE *table_arg);
55
49
  ~ha_blackhole()
56
 
  {}
57
 
 
 
50
  {
 
51
  }
 
52
  /* The name that will be used for display purposes */
 
53
  const char *table_type() const { return "BLACKHOLE"; }
58
54
  /*
59
55
    The name of the index type that will be used for display
60
56
    don't implement this method unless you really have indexes
61
57
  */
62
58
  const char *index_type(uint32_t key_number);
63
 
  uint32_t index_flags(uint32_t inx) const;
 
59
  const char **bas_ext() const;
 
60
  uint64_t table_flags() const
 
61
  {
 
62
    return(HA_NULL_IN_KEY |
 
63
           HA_BINLOG_STMT_CAPABLE |
 
64
           HA_CAN_INDEX_BLOBS |
 
65
           HA_AUTO_PART_KEY |
 
66
           HA_FILE_BASED);
 
67
  }
 
68
  uint32_t index_flags(uint32_t inx, uint32_t part, bool all_parts) const;
 
69
  /* The following defines can be increased if necessary */
 
70
  uint32_t max_supported_keys()          const { return BLACKHOLE_MAX_KEY; }
 
71
  uint32_t max_supported_key_length()    const { return BLACKHOLE_MAX_KEY_LENGTH; }
 
72
  uint32_t max_supported_key_part_length() const { return BLACKHOLE_MAX_KEY_LENGTH; }
64
73
  int open(const char *name, int mode, uint32_t test_if_locked);
65
74
  int close(void);
66
 
  int doInsertRecord(unsigned char * buf);
67
 
  int doStartTableScan(bool scan);
 
75
  int write_row(unsigned char * buf);
 
76
  int rnd_init(bool scan);
68
77
  int rnd_next(unsigned char *buf);
69
78
  int rnd_pos(unsigned char * buf, unsigned char *pos);
70
 
  BlackholeShare *get_share(const char *table_name);
71
 
  void free_share();
72
 
  int index_read_map(unsigned char * buf, const unsigned char * key,
73
 
                     drizzled::key_part_map keypart_map,
74
 
                     drizzled::ha_rkey_function find_flag);
 
79
  int index_read_map(unsigned char * buf, const unsigned char * key, key_part_map keypart_map,
 
80
                     enum ha_rkey_function find_flag);
75
81
  int index_read_idx_map(unsigned char * buf, uint32_t idx, const unsigned char * key,
76
 
                         drizzled::key_part_map keypart_map,
77
 
                         drizzled::ha_rkey_function find_flag);
78
 
  int index_read_last_map(unsigned char * buf, const unsigned char * key,
79
 
                          drizzled::key_part_map keypart_map);
 
82
                         key_part_map keypart_map,
 
83
                         enum ha_rkey_function find_flag);
 
84
  int index_read_last_map(unsigned char * buf, const unsigned char * key, key_part_map keypart_map);
80
85
  int index_next(unsigned char * buf);
81
86
  int index_prev(unsigned char * buf);
82
87
  int index_first(unsigned char * buf);
83
88
  int index_last(unsigned char * buf);
84
89
  void position(const unsigned char *record);
85
90
  int info(uint32_t flag);
86
 
 
87
 
  void get_auto_increment(uint64_t, uint64_t,
88
 
                          uint64_t,
89
 
                          uint64_t *,
90
 
                          uint64_t *)
91
 
  {}
92
 
 
 
91
  int external_lock(Session *session, int lock_type);
 
92
  int create(const char *name, Table *table_arg,
 
93
             HA_CREATE_INFO *create_info);
 
94
  THR_LOCK_DATA **store_lock(Session *session,
 
95
                             THR_LOCK_DATA **to,
 
96
                             enum thr_lock_type lock_type);
93
97
};
94
98
 
95
 
#endif /* PLUGIN_BLACKHOLE_HA_BLACKHOLE_H */
 
99
#endif /* STORAGE_BLACKHOLE_HA_BLACKHOLE_H */