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 */
16
16
/* This file should be included when using myisam_funktions */
18
#ifndef PLUGIN_MYISAM_MYISAM_H
19
#define PLUGIN_MYISAM_MYISAM_H
21
#include "drizzled/identifier.h"
23
21
#include <drizzled/key_map.h>
25
27
#include <drizzled/base.h>
27
#include "drizzled/charset_info.h"
29
#include <mystrings/m_ctype.h>
29
31
#ifndef _keycache_h
30
32
#include "keycache.h"
32
34
#include <plugin/myisam/my_handler.h>
33
#include "drizzled/internal/iocache.h"
35
#include <mysys/iocache.h>
36
38
Limit max keys according to HA_MAX_POSSIBLE_KEY
125
127
typedef struct st_mi_isaminfo /* Struct from h_info */
127
drizzled::ha_rows records; /* Records in database */
128
drizzled::ha_rows deleted; /* Deleted records in database */
129
drizzled::internal::my_off_t recpos; /* Pos for last used record */
130
drizzled::internal::my_off_t newrecpos; /* Pos if we write new record */
131
drizzled::internal::my_off_t dupp_key_pos; /* Position to record with dupp key */
132
drizzled::internal::my_off_t data_file_length, /* Length of data file */
129
ha_rows records; /* Records in database */
130
ha_rows deleted; /* Deleted records in database */
131
my_off_t recpos; /* Pos for last used record */
132
my_off_t newrecpos; /* Pos if we write new record */
133
my_off_t dupp_key_pos; /* Position to record with dupp key */
134
my_off_t data_file_length, /* Length of data file */
133
135
max_data_file_length,
134
136
index_file_length,
135
137
max_index_file_length,
278
261
extern int mi_close(struct st_myisam_info *file);
279
262
extern int mi_delete(struct st_myisam_info *file,const unsigned char *buff);
280
extern struct st_myisam_info *mi_open(const drizzled::identifier::Table &identifier,
263
extern struct st_myisam_info *mi_open(const char *name,int mode,
282
264
uint32_t wait_if_locked);
283
extern int mi_panic(enum drizzled::ha_panic_function function);
265
extern int mi_panic(enum ha_panic_function function);
284
266
extern int mi_rfirst(struct st_myisam_info *file,unsigned char *buf,int inx);
285
267
extern int mi_rkey(MI_INFO *info, unsigned char *buf, int inx, const unsigned char *key,
286
drizzled::key_part_map keypart_map, enum drizzled::ha_rkey_function search_flag);
268
key_part_map keypart_map, enum ha_rkey_function search_flag);
287
269
extern int mi_rlast(struct st_myisam_info *file,unsigned char *buf,int inx);
288
270
extern int mi_rnext(struct st_myisam_info *file,unsigned char *buf,int inx);
289
271
extern int mi_rnext_same(struct st_myisam_info *info, unsigned char *buf);
290
272
extern int mi_rprev(struct st_myisam_info *file,unsigned char *buf,int inx);
291
extern int mi_rrnd(struct st_myisam_info *file,unsigned char *buf, drizzled::internal::my_off_t pos);
273
extern int mi_rrnd(struct st_myisam_info *file,unsigned char *buf, my_off_t pos);
292
274
extern int mi_scan_init(struct st_myisam_info *file);
293
275
extern int mi_scan(struct st_myisam_info *file,unsigned char *buf);
294
276
extern int mi_rsame(struct st_myisam_info *file,unsigned char *record,int inx);
277
extern int mi_rsame_with_pos(struct st_myisam_info *file,unsigned char *record,
278
int inx, my_off_t pos);
295
279
extern int mi_update(struct st_myisam_info *file,const unsigned char *old,
296
280
unsigned char *new_record);
297
281
extern int mi_write(struct st_myisam_info *file,unsigned char *buff);
298
extern drizzled::internal::my_off_t mi_position(struct st_myisam_info *file);
282
extern my_off_t mi_position(struct st_myisam_info *file);
299
283
extern int mi_status(struct st_myisam_info *info, MI_ISAMINFO *x, uint32_t flag);
300
284
extern int mi_lock_database(struct st_myisam_info *file,int lock_type);
301
285
extern int mi_create(const char *name,uint32_t keys,MI_KEYDEF *keydef,
302
uint32_t columns, drizzled::MI_COLUMNDEF *columndef,
286
uint32_t columns, MI_COLUMNDEF *columndef,
303
287
uint32_t uniques, MI_UNIQUEDEF *uniquedef,
304
288
MI_CREATE_INFO *create_info, uint32_t flags);
305
289
extern int mi_delete_table(const char *name);
306
290
extern int mi_rename(const char *from, const char *to);
307
291
extern int mi_extra(struct st_myisam_info *file,
308
enum drizzled::ha_extra_function function,
292
enum ha_extra_function function,
309
293
void *extra_arg);
310
294
extern int mi_reset(struct st_myisam_info *file);
311
extern drizzled::ha_rows mi_records_in_range(MI_INFO *info, int inx,
312
drizzled::key_range *min_key, drizzled::key_range *max_key);
295
extern ha_rows mi_records_in_range(MI_INFO *info, int inx,
296
key_range *min_key, key_range *max_key);
313
297
extern int mi_log(int activate_log);
298
extern int mi_is_changed(struct st_myisam_info *info);
314
299
extern int mi_delete_all_rows(struct st_myisam_info *info);
315
300
extern ulong _mi_calc_blob_length(uint32_t length , const unsigned char *pos);
316
301
extern uint32_t mi_get_pointer_length(uint64_t file_length, uint32_t def);
402
387
uint64_t max_data_file_length;
403
388
uint64_t keys_in_use;
404
389
uint64_t max_record_length;
405
drizzled::internal::my_off_t search_after_block;
406
drizzled::internal::my_off_t new_file_pos,key_file_blocks;
407
drizzled::internal::my_off_t keydata,totaldata,key_blocks,start_check_pos;
408
drizzled::ha_rows total_records,total_deleted;
409
drizzled::internal::ha_checksum record_checksum,glob_crc;
390
my_off_t search_after_block;
391
my_off_t new_file_pos,key_file_blocks;
392
my_off_t keydata,totaldata,key_blocks,start_check_pos;
393
ha_rows total_records,total_deleted;
394
ha_checksum record_checksum,glob_crc;
410
395
uint64_t use_buffers;
411
396
size_t read_buffer_length, write_buffer_length,
412
397
sort_buffer_length, sort_key_blocks;
465
450
int mi_sort_index(MI_CHECK *param, register MI_INFO *info, char * name);
466
451
int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
467
452
const char * name, int rep_quick);
453
int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
454
const char * name, int rep_quick);
468
455
int change_to_newfile(const char * filename, const char * old_ext,
469
456
const char * new_ext, uint32_t raid_chunks,
470
drizzled::myf myflags);
471
458
void lock_memory(MI_CHECK *param);
472
459
void update_auto_increment_key(MI_CHECK *param, MI_INFO *info,
475
462
void update_key_parts(MI_KEYDEF *keyinfo, ulong *rec_per_key_part,
476
463
uint64_t *unique, uint64_t *notnull,
477
464
uint64_t records);
478
int filecopy(MI_CHECK *param, int to,int from,drizzled::internal::my_off_t start,
479
drizzled::internal::my_off_t length, const char *type);
480
int movepoint(MI_INFO *info,unsigned char *record,drizzled::internal::my_off_t oldpos,
481
drizzled::internal::my_off_t newpos, uint32_t prot_key);
465
int filecopy(MI_CHECK *param, File to,File from,my_off_t start,
466
my_off_t length, const char *type);
467
int movepoint(MI_INFO *info,unsigned char *record,my_off_t oldpos,
468
my_off_t newpos, uint32_t prot_key);
482
469
int write_data_suffix(SORT_INFO *sort_info, bool fix_datafile);
483
470
int test_if_almost_full(MI_INFO *info);
484
bool mi_test_if_sort_rep(MI_INFO *info, drizzled::ha_rows rows, uint64_t key_map,
471
int recreate_table(MI_CHECK *param, MI_INFO **org_info, char *filename);
472
bool mi_test_if_sort_rep(MI_INFO *info, ha_rows rows, uint64_t key_map,
487
int mi_init_bulk_insert(MI_INFO *info, uint32_t cache_size, drizzled::ha_rows rows);
475
int mi_init_bulk_insert(MI_INFO *info, uint32_t cache_size, ha_rows rows);
488
476
void mi_flush_bulk_insert(MI_INFO *info, uint32_t inx);
489
477
void mi_end_bulk_insert(MI_INFO *info);
478
int mi_assign_to_key_cache(MI_INFO *info, KEY_CACHE *key_cache);
479
void mi_change_key_cache(KEY_CACHE *old_key_cache,
480
KEY_CACHE *new_key_cache);
490
481
int mi_preload(MI_INFO *info, uint64_t key_map, bool ignore_leaves);
492
#endif /* PLUGIN_MYISAM_MYISAM_H */