~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/myisam/myisam.h

  • Committer: Brian Aker
  • Date: 2009-05-11 17:50:22 UTC
  • Revision ID: brian@gaz-20090511175022-y35q9ky6uh9ldcjt
Replacing Sun employee copyright headers (aka... anything done by a Sun
employee is copyright by Sun).

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
#ifndef _myisam_h
19
19
#define _myisam_h
 
20
 
 
21
#include <drizzled/key_map.h>
 
22
 
20
23
#ifdef  __cplusplus
21
24
extern "C" {
22
25
#endif
23
26
 
24
27
#include <drizzled/base.h>
25
28
#ifndef _m_ctype_h
26
 
#include <m_ctype.h>
 
29
#include <mystrings/m_ctype.h>
27
30
#endif
28
31
#ifndef _keycache_h
29
32
#include "keycache.h"
30
33
#endif
31
 
#include <mysys/my_handler.h>
32
 
#include <drizzled/plugin.h>
 
34
#include <plugin/myisam/my_handler.h>
 
35
#include <mysys/iocache.h>
33
36
 
34
37
/*
35
38
  Limit max keys according to HA_MAX_POSSIBLE_KEY
69
72
  This means that clearing of high keys is ignored, setting one high key
70
73
  sets all high keys.
71
74
*/
72
 
#define MI_KEYMAP_BITS      (8 * SIZEOF_LONG_LONG)
 
75
#define MI_KEYMAP_BITS      (64)
73
76
#define MI_KEYMAP_HIGH_MASK (1UL << (MI_KEYMAP_BITS - 1))
74
77
#define mi_get_mask_all_keys_active(_keys_) \
75
78
                            (((_keys_) < MI_KEYMAP_BITS) ? \
252
255
extern uint32_t myisam_concurrent_insert;
253
256
extern bool myisam_flush,myisam_delay_key_write,myisam_single_user;
254
257
extern my_off_t myisam_max_temp_length;
255
 
extern uint32_t myisam_bulk_insert_tree_size, myisam_data_pointer_size;
 
258
extern uint32_t myisam_bulk_insert_tree_size; 
 
259
extern uint32_t data_pointer_size;
256
260
 
257
261
        /* Prototypes for myisam-functions */
258
262
 
348
352
 
349
353
#define T_REP_ANY               (T_REP | T_REP_BY_SORT | T_REP_PARALLEL)
350
354
 
351
 
/*
352
 
  Flags used by myisamchk.c or/and ha_myisam.cc that are NOT passed
353
 
  to mi_check.c follows:
354
 
*/
355
 
 
356
 
#define TT_USEFRM               1
357
 
#define TT_FOR_UPGRADE          2
358
 
 
359
355
#define O_NEW_INDEX     1               /* Bits set in out_flag */
360
356
#define O_NEW_DATA      2
361
357
#define O_DATA_LOST     4
371
367
} SORT_KEY_BLOCKS;
372
368
 
373
369
 
374
 
/* 
375
 
  MyISAM supports several statistics collection methods. Currently statistics 
376
 
  collection method is not stored in MyISAM file and has to be specified for 
 
370
/*
 
371
  MyISAM supports several statistics collection methods. Currently statistics
 
372
  collection method is not stored in MyISAM file and has to be specified for
377
373
  each table analyze/repair operation in  MI_CHECK::stats_method.
378
374
*/
379
375
 
380
 
typedef enum 
 
376
typedef enum
381
377
{
382
378
  /* Treat NULLs as inequal when collecting statistics (default for 4.1/5.0) */
383
379
  MI_STATS_METHOD_NULLS_NOT_EQUAL,
398
394
  my_off_t keydata,totaldata,key_blocks,start_check_pos;
399
395
  ha_rows total_records,total_deleted;
400
396
  ha_checksum record_checksum,glob_crc;
401
 
  ulong use_buffers,read_buffer_length,write_buffer_length,
402
 
        sort_buffer_length,sort_key_blocks;
 
397
  uint64_t use_buffers;
 
398
  size_t read_buffer_length, write_buffer_length,
 
399
         sort_buffer_length, sort_key_blocks;
403
400
  uint32_t out_flag,warning_printed,error_printed,verbose;
404
401
  uint32_t opt_sort_key,total_files,max_level;
405
402
  uint32_t testflag, key_cache_block_size;
407
404
  bool using_global_keycache, opt_lock_memory, opt_follow_links;
408
405
  bool retry_repair, force_sort;
409
406
  char temp_filename[FN_REFLEN],*isam_file_name;
410
 
  MY_TMPDIR *tmpdir;
411
407
  int tmpfile_createflag;
412
408
  myf myf_rw;
413
409
  IO_CACHE read_cache;
414
 
  
415
 
  /* 
 
410
 
 
411
  /*
416
412
    The next two are used to collect statistics, see update_key_parts for
417
413
    description.
418
414
  */
419
415
  uint64_t unique_count[MI_MAX_KEY_SEG+1];
420
416
  uint64_t notnull_count[MI_MAX_KEY_SEG+1];
421
 
  
 
417
 
422
418
  ha_checksum key_crc[HA_MAX_POSSIBLE_KEY];
423
419
  ulong rec_per_key_part[MI_MAX_KEY_SEG*HA_MAX_POSSIBLE_KEY];
424
 
  void *thd;
 
420
  void *session;
425
421
  const char *db_name, *table_name;
426
422
  const char *op_name;
427
423
  enum_mi_stats_method stats_method;
466
462
                               bool repair);
467
463
int update_state_info(MI_CHECK *param, MI_INFO *info,uint32_t update);
468
464
void update_key_parts(MI_KEYDEF *keyinfo, ulong *rec_per_key_part,
469
 
                      uint64_t *unique, uint64_t *notnull, 
 
465
                      uint64_t *unique, uint64_t *notnull,
470
466
                      uint64_t records);
471
467
int filecopy(MI_CHECK *param, File to,File from,my_off_t start,
472
468
             my_off_t length, const char *type);
481
477
int mi_init_bulk_insert(MI_INFO *info, uint32_t cache_size, ha_rows rows);
482
478
void mi_flush_bulk_insert(MI_INFO *info, uint32_t inx);
483
479
void mi_end_bulk_insert(MI_INFO *info);
484
 
int mi_assign_to_key_cache(MI_INFO *info, uint64_t key_map, 
485
 
                           KEY_CACHE *key_cache);
 
480
int mi_assign_to_key_cache(MI_INFO *info, KEY_CACHE *key_cache); 
486
481
void mi_change_key_cache(KEY_CACHE *old_key_cache,
487
482
                         KEY_CACHE *new_key_cache);
488
483
int mi_preload(MI_INFO *info, uint64_t key_map, bool ignore_leaves);