~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/blackhole/ha_blackhole.h

  • Committer: Brian Aker
  • Date: 2009-12-03 01:17:53 UTC
  • mto: (1237.3.2 push)
  • mto: This revision was merged to the branch mainline in revision 1238.
  • Revision ID: brian@gaz-20091203011753-159h2no5m5c5dt9b
Small cleanups, did in MERGE table only engine flag.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
#define PLUGIN_BLACKHOLE_HA_BLACKHOLE_H
19
19
 
20
20
#include <drizzled/cursor.h>
21
 
#include <drizzled/thr_lock.h>
 
21
#include <mysys/thr_lock.h>
22
22
 
23
23
#define BLACKHOLE_MAX_KEY       64              /* Max allowed keys */
24
24
#define BLACKHOLE_MAX_KEY_LENGTH 1000
26
26
/*
27
27
  Shared structure for correct LOCK operation
28
28
*/
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;
 
29
struct st_blackhole_share {
 
30
  THR_LOCK lock;
38
31
  uint32_t use_count;
39
 
  const std::string table_name;
 
32
  uint32_t table_name_length;
 
33
  char table_name[1];
40
34
};
41
35
 
42
36
 
44
38
  Class definition for the blackhole storage engine
45
39
  "Dumbest named feature ever"
46
40
*/
47
 
class ha_blackhole: public drizzled::Cursor
 
41
class ha_blackhole: public Cursor
48
42
{
49
 
  drizzled::THR_LOCK_DATA lock;      /* MySQL lock */
50
 
  BlackholeShare *share;
 
43
  THR_LOCK_DATA lock;      /* MySQL lock */
 
44
  st_blackhole_share *share;
51
45
 
52
46
public:
53
 
  ha_blackhole(drizzled::plugin::StorageEngine &engine,
54
 
               drizzled::TableShare &table_arg);
 
47
  ha_blackhole(drizzled::plugin::StorageEngine &engine, TableShare &table_arg);
55
48
  ~ha_blackhole()
56
49
  {}
57
50
 
60
53
    don't implement this method unless you really have indexes
61
54
  */
62
55
  const char *index_type(uint32_t key_number);
63
 
  uint32_t index_flags(uint32_t inx) const;
 
56
  uint32_t index_flags(uint32_t inx, uint32_t part, bool all_parts) const;
64
57
  int open(const char *name, int mode, uint32_t test_if_locked);
65
58
  int close(void);
66
59
  int write_row(unsigned char * buf);
67
60
  int rnd_init(bool scan);
68
61
  int rnd_next(unsigned char *buf);
69
62
  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);
 
63
  int index_read_map(unsigned char * buf, const unsigned char * key, key_part_map keypart_map,
 
64
                     enum ha_rkey_function find_flag);
75
65
  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);
 
66
                         key_part_map keypart_map,
 
67
                         enum ha_rkey_function find_flag);
 
68
  int index_read_last_map(unsigned char * buf, const unsigned char * key, key_part_map keypart_map);
80
69
  int index_next(unsigned char * buf);
81
70
  int index_prev(unsigned char * buf);
82
71
  int index_first(unsigned char * buf);
83
72
  int index_last(unsigned char * buf);
84
73
  void position(const unsigned char *record);
85
74
  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
 
 
 
75
  THR_LOCK_DATA **store_lock(Session *session,
 
76
                             THR_LOCK_DATA **to,
 
77
                             enum thr_lock_type lock_type);
93
78
};
94
79
 
95
80
#endif /* PLUGIN_BLACKHOLE_HA_BLACKHOLE_H */