~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/blackhole/ha_blackhole.cc

  • Committer: Monty Taylor
  • Date: 2008-08-02 01:03:15 UTC
  • mto: (236.1.42 codestyle)
  • mto: This revision was merged to the branch mainline in revision 261.
  • Revision ID: monty@inaugust.com-20080802010315-65h5938pymg9d99z
Moved m4 macros to top-level m4 dir, per GNU standards (and where gettext wanted it :)

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
#pragma implementation                          // gcc: Class implementation
19
19
#endif
20
20
 
21
 
#include "mysql_priv.h"
 
21
#include <drizzled/mysql_priv.h>
22
22
#include "ha_blackhole.h"
23
23
 
24
24
/* Static declarations for handlerton */
58
58
  return ha_blackhole_exts;
59
59
}
60
60
 
61
 
int ha_blackhole::open(const char *name, int mode __attribute__((__unused__)),
62
 
                       uint test_if_locked __attribute__((__unused__)))
 
61
int ha_blackhole::open(const char *name, int mode __attribute__((unused)),
 
62
                       uint test_if_locked __attribute__((unused)))
63
63
{
64
64
  if (!(share= get_share(name)))
65
65
    return(HA_ERR_OUT_OF_MEM);
74
74
  return(0);
75
75
}
76
76
 
77
 
int ha_blackhole::create(const char *name __attribute__((__unused__)),
78
 
                         TABLE *table_arg __attribute__((__unused__)),
79
 
                         HA_CREATE_INFO *create_info __attribute__((__unused__)))
 
77
int ha_blackhole::create(const char *name __attribute__((unused)),
 
78
                         TABLE *table_arg __attribute__((unused)),
 
79
                         HA_CREATE_INFO *create_info __attribute__((unused)))
80
80
{
81
81
  return(0);
82
82
}
83
83
 
84
 
const char *ha_blackhole::index_type(uint key_number)
 
84
const char *ha_blackhole::index_type(uint key_number __attribute__((unused)))
85
85
{
86
 
  return((table_share->key_info[key_number].flags & HA_FULLTEXT) ? 
87
 
              "FULLTEXT" :
88
 
              (table_share->key_info[key_number].flags & HA_SPATIAL) ?
89
 
              "SPATIAL" :
90
 
              (table_share->key_info[key_number].algorithm ==
91
 
               HA_KEY_ALG_RTREE) ? "RTREE" : "BTREE");
 
86
  return("BTREE");
92
87
}
93
88
 
94
 
int ha_blackhole::write_row(uchar * buf __attribute__((__unused__)))
 
89
int ha_blackhole::write_row(uchar * buf __attribute__((unused)))
95
90
{
96
91
  return(table->next_number_field ? update_auto_increment() : 0);
97
92
}
98
93
 
99
 
int ha_blackhole::rnd_init(bool scan __attribute__((__unused__)))
 
94
int ha_blackhole::rnd_init(bool scan __attribute__((unused)))
100
95
{
101
96
  return(0);
102
97
}
103
98
 
104
99
 
105
 
int ha_blackhole::rnd_next(uchar *buf __attribute__((__unused__)))
 
100
int ha_blackhole::rnd_next(uchar *buf __attribute__((unused)))
106
101
{
107
102
  return(HA_ERR_END_OF_FILE);
108
103
}
109
104
 
110
105
 
111
 
int ha_blackhole::rnd_pos(uchar * buf __attribute__((__unused__)),
112
 
                          uchar *pos __attribute__((__unused__)))
 
106
int ha_blackhole::rnd_pos(uchar * buf __attribute__((unused)),
 
107
                          uchar *pos __attribute__((unused)))
113
108
{
114
109
  assert(0);
115
110
  return(0);
116
111
}
117
112
 
118
113
 
119
 
void ha_blackhole::position(const uchar *record __attribute__((__unused__)))
 
114
void ha_blackhole::position(const uchar *record __attribute__((unused)))
120
115
{
121
116
  assert(0);
122
117
  return;
125
120
 
126
121
int ha_blackhole::info(uint flag)
127
122
{
128
 
  bzero((char*) &stats, sizeof(stats));
 
123
  memset((char*) &stats, 0, sizeof(stats));
129
124
  if (flag & HA_STATUS_AUTO)
130
125
    stats.auto_increment_value= 1;
131
126
  return(0);
132
127
}
133
128
 
134
 
int ha_blackhole::external_lock(THD *thd __attribute__((__unused__)),
135
 
                                int lock_type __attribute__((__unused__)))
 
129
int ha_blackhole::external_lock(THD *thd __attribute__((unused)),
 
130
                                int lock_type __attribute__((unused)))
136
131
{
137
132
  return(0);
138
133
}
174
169
}
175
170
 
176
171
 
177
 
int ha_blackhole::index_read_map(uchar * buf __attribute__((__unused__)),
178
 
                                 const uchar * key __attribute__((__unused__)),
179
 
                                 key_part_map keypart_map  __attribute__((__unused__)),
180
 
                                 enum ha_rkey_function find_flag __attribute__((__unused__)))
181
 
{
182
 
  return(HA_ERR_END_OF_FILE);
183
 
}
184
 
 
185
 
 
186
 
int ha_blackhole::index_read_idx_map(uchar * buf __attribute__((__unused__)),
187
 
                                     uint idx __attribute__((__unused__)),
188
 
                                     const uchar * key __attribute__((__unused__)),
189
 
                                     key_part_map keypart_map __attribute__((__unused__)),
190
 
                                     enum ha_rkey_function find_flag __attribute__((__unused__)))
191
 
{
192
 
  return(HA_ERR_END_OF_FILE);
193
 
}
194
 
 
195
 
 
196
 
int ha_blackhole::index_read_last_map(uchar * buf __attribute__((__unused__)),
197
 
                                      const uchar * key __attribute__((__unused__)),
198
 
                                      key_part_map keypart_map __attribute__((__unused__)))
199
 
{
200
 
  return(HA_ERR_END_OF_FILE);
201
 
}
202
 
 
203
 
 
204
 
int ha_blackhole::index_next(uchar * buf __attribute__((__unused__)))
205
 
{
206
 
  return(HA_ERR_END_OF_FILE);
207
 
}
208
 
 
209
 
 
210
 
int ha_blackhole::index_prev(uchar * buf __attribute__((__unused__)))
211
 
{
212
 
  return(HA_ERR_END_OF_FILE);
213
 
}
214
 
 
215
 
 
216
 
int ha_blackhole::index_first(uchar * buf __attribute__((__unused__)))
217
 
{
218
 
  return(HA_ERR_END_OF_FILE);
219
 
}
220
 
 
221
 
 
222
 
int ha_blackhole::index_last(uchar * buf __attribute__((__unused__)))
 
172
int ha_blackhole::index_read_map(uchar * buf __attribute__((unused)),
 
173
                                 const uchar * key __attribute__((unused)),
 
174
                                 key_part_map keypart_map  __attribute__((unused)),
 
175
                                 enum ha_rkey_function find_flag __attribute__((unused)))
 
176
{
 
177
  return(HA_ERR_END_OF_FILE);
 
178
}
 
179
 
 
180
 
 
181
int ha_blackhole::index_read_idx_map(uchar * buf __attribute__((unused)),
 
182
                                     uint idx __attribute__((unused)),
 
183
                                     const uchar * key __attribute__((unused)),
 
184
                                     key_part_map keypart_map __attribute__((unused)),
 
185
                                     enum ha_rkey_function find_flag __attribute__((unused)))
 
186
{
 
187
  return(HA_ERR_END_OF_FILE);
 
188
}
 
189
 
 
190
 
 
191
int ha_blackhole::index_read_last_map(uchar * buf __attribute__((unused)),
 
192
                                      const uchar * key __attribute__((unused)),
 
193
                                      key_part_map keypart_map __attribute__((unused)))
 
194
{
 
195
  return(HA_ERR_END_OF_FILE);
 
196
}
 
197
 
 
198
 
 
199
int ha_blackhole::index_next(uchar * buf __attribute__((unused)))
 
200
{
 
201
  return(HA_ERR_END_OF_FILE);
 
202
}
 
203
 
 
204
 
 
205
int ha_blackhole::index_prev(uchar * buf __attribute__((unused)))
 
206
{
 
207
  return(HA_ERR_END_OF_FILE);
 
208
}
 
209
 
 
210
 
 
211
int ha_blackhole::index_first(uchar * buf __attribute__((unused)))
 
212
{
 
213
  return(HA_ERR_END_OF_FILE);
 
214
}
 
215
 
 
216
 
 
217
int ha_blackhole::index_last(uchar * buf __attribute__((unused)))
223
218
{
224
219
  return(HA_ERR_END_OF_FILE);
225
220
}
298
293
  return 0;
299
294
}
300
295
 
301
 
static int blackhole_fini(void *p __attribute__((__unused__)))
 
296
static int blackhole_fini(void *p __attribute__((unused)))
302
297
{
303
298
  hash_free(&blackhole_open_tables);
304
299
  pthread_mutex_destroy(&blackhole_mutex);