~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/myisam/mi_check.cc

Merge Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
using namespace std;
61
61
 
62
62
 
 
63
#define my_off_t2double(A)  ((double) (my_off_t) (A))
 
64
 
63
65
/* Functions defined in this file */
64
66
 
65
67
static int check_k_link(MI_CHECK *param, MI_INFO *info,uint32_t nr);
70
72
static ha_checksum calc_checksum(ha_rows count);
71
73
static int writekeys(MI_SORT_PARAM *sort_param);
72
74
static int sort_one_index(MI_CHECK *param, MI_INFO *info,MI_KEYDEF *keyinfo,
73
 
                          my_off_t pagepos, File new_file);
 
75
                          my_off_t pagepos, int new_file);
74
76
extern "C"
75
77
{
76
78
  int sort_key_read(MI_SORT_PARAM *sort_param,void *key);
1404
1406
  int error,got_error;
1405
1407
  ha_rows start_records,new_header_length;
1406
1408
  my_off_t del;
1407
 
  File new_file;
 
1409
  int new_file;
1408
1410
  MYISAM_SHARE *share=info->s;
1409
1411
  char llbuff[22],llbuff2[22];
1410
1412
  SORT_INFO sort_info;
1768
1770
 
1769
1771
        /* Flush all changed blocks to disk */
1770
1772
 
1771
 
int flush_blocks(MI_CHECK *param, KEY_CACHE *key_cache, File file)
 
1773
int flush_blocks(MI_CHECK *param, KEY_CACHE *key_cache, int file)
1772
1774
{
1773
1775
  if (flush_key_blocks(key_cache, file, FLUSH_RELEASE))
1774
1776
  {
1787
1789
{
1788
1790
  register uint32_t key;
1789
1791
  register MI_KEYDEF *keyinfo;
1790
 
  File new_file;
 
1792
  int new_file;
1791
1793
  my_off_t index_pos[HA_MAX_POSSIBLE_KEY];
1792
1794
  uint32_t r_locks,w_locks;
1793
1795
  int old_lock;
1881
1883
         /* Sort records recursive using one index */
1882
1884
 
1883
1885
static int sort_one_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
1884
 
                          my_off_t pagepos, File new_file)
 
1886
                          my_off_t pagepos, int new_file)
1885
1887
{
1886
1888
  uint32_t length,nod_flag,used_length, key_length;
1887
1889
  unsigned char *buff,*keypos,*endpos;
1970
1972
 
1971
1973
        /* Copy a block between two files */
1972
1974
 
1973
 
int filecopy(MI_CHECK *param, File to,File from,my_off_t start,
 
1975
int filecopy(MI_CHECK *param, int to,int from,my_off_t start,
1974
1976
             my_off_t length, const char *type)
1975
1977
{
1976
1978
  char tmp_buff[IO_SIZE],*buff;
2028
2030
  ulong length;
2029
2031
  ha_rows start_records;
2030
2032
  my_off_t new_header_length,del;
2031
 
  File new_file;
 
2033
  int new_file;
2032
2034
  MI_SORT_PARAM sort_param;
2033
2035
  MYISAM_SHARE *share=info->s;
2034
2036
  HA_KEYSEG *keyseg;
2405
2407
  ulong rec_length;
2406
2408
  ha_rows start_records;
2407
2409
  my_off_t new_header_length,del;
2408
 
  File new_file;
 
2410
  int new_file;
2409
2411
  MI_SORT_PARAM *sort_param=0;
2410
2412
  MYISAM_SHARE *share=info->s;
2411
2413
  ulong   *rec_per_key_part;