~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mi_check.c

  • Committer: Monty Taylor
  • Date: 2008-12-08 10:34:49 UTC
  • mto: This revision was merged to the branch mainline in revision 670.
  • Revision ID: monty@inaugust.com-20081208103449-4rz1ffja67yfcdgc
Removed my_seek, my_tell, my_fwrite, my_fseek.

Show diffs side-by-side

added added

removed removed

Lines of Context:
328
328
  flush_key_blocks(info->s->key_cache,
329
329
                   info->s->kfile, FLUSH_FORCE_WRITE);
330
330
 
331
 
  size= my_seek(info->s->kfile, 0L, MY_SEEK_END, MYF(MY_THREADSAFE));
 
331
  size= lseek(info->s->kfile, 0, SEEK_END);
332
332
  if ((skr=(my_off_t) info->state->key_file_length) != size)
333
333
  {
334
334
    /* Don't give error if file generated by myisampack */
352
352
                           llstr(info->state->key_file_length,buff),
353
353
                           llstr(info->s->base.max_key_file_length-1,buff));
354
354
 
355
 
  size=my_seek(info->dfile,0L,MY_SEEK_END,MYF(0));
 
355
  size=lseek(info->dfile,0L,SEEK_END);
356
356
  skr=(my_off_t) info->state->data_file_length;
357
357
  if (info->s->options & HA_OPTION_COMPRESS_RECORD)
358
358
    skr+= MEMMAP_EXTRA_MARGIN;
584
584
  {
585
585
    /* purecov: begin tested */
586
586
    /* Give it a chance to fit in the real file size. */
587
 
    my_off_t max_length= my_seek(info->s->kfile, 0L, MY_SEEK_END,
588
 
                                 MYF(MY_THREADSAFE));
 
587
    my_off_t max_length= lseek(info->s->kfile, 0, SEEK_END);
589
588
    mi_check_print_error(param, "Invalid key block position: %s  "
590
589
                         "key block size: %u  file_length: %s",
591
590
                         llstr(page, llbuff), keyinfo->block_length,
1490
1489
  sort_param.pos=sort_param.max_pos=share->pack.header_length;
1491
1490
  sort_param.filepos=new_header_length;
1492
1491
  param->read_cache.end_of_file=sort_info.filelength=
1493
 
    my_seek(info->dfile,0L,MY_SEEK_END,MYF(0));
 
1492
    lseek(info->dfile,0L,SEEK_END);
1494
1493
  sort_info.dupp=0;
1495
1494
  sort_param.fix_datafile= (bool) (! rep_quick);
1496
1495
  sort_param.master=1;
1985
1984
    buff=tmp_buff; buff_length=IO_SIZE;
1986
1985
  }
1987
1986
 
1988
 
  my_seek(from,start,MY_SEEK_SET,MYF(0));
 
1987
  lseek(from,start,SEEK_SET);
1989
1988
  while (length > buff_length)
1990
1989
  {
1991
1990
    if (my_read(from,(unsigned char*) buff,buff_length,MYF(MY_NABP)) ||
2125
2124
  sort_info.dupp=0;
2126
2125
  sort_info.buff=0;
2127
2126
  param->read_cache.end_of_file=sort_info.filelength=
2128
 
    my_seek(param->read_cache.file,0L,MY_SEEK_END,MYF(0));
 
2127
    lseek(param->read_cache.file,0L,SEEK_END);
2129
2128
 
2130
2129
  sort_param.wordlist=NULL;
2131
2130
 
2535
2534
  sort_info.dupp=0;
2536
2535
  sort_info.buff=0;
2537
2536
  param->read_cache.end_of_file=sort_info.filelength=
2538
 
    my_seek(param->read_cache.file,0L,MY_SEEK_END,MYF(0));
 
2537
    lseek(param->read_cache.file,0L,SEEK_END);
2539
2538
 
2540
2539
  if (share->data_file_type == DYNAMIC_RECORD)
2541
2540
    rec_length=cmax(share->base.min_pack_length+1,share->base.min_block_length);
3664
3663
{
3665
3664
  if (info->s->options & HA_OPTION_COMPRESS_RECORD)
3666
3665
    return 0;
3667
 
  return my_seek(info->s->kfile, 0L, MY_SEEK_END, MYF(MY_THREADSAFE)) / 10 * 9 >
 
3666
  return (my_off_t)(lseek(info->s->kfile, 0L, SEEK_END) / 10 * 9) >
3668
3667
         (my_off_t) info->s->base.max_key_file_length ||
3669
 
         my_seek(info->dfile, 0L, MY_SEEK_END, MYF(0)) / 10 * 9 >
 
3668
         (my_off_t)(lseek(info->dfile, 0L, SEEK_END) / 10 * 9) >
3670
3669
         (my_off_t) info->s->base.max_data_file_length;
3671
3670
}
3672
3671
 
3761
3760
  if (share.options & HA_OPTION_COMPRESS_RECORD)
3762
3761
    share.base.records=max_records=info.state->records;
3763
3762
  else if (share.base.min_pack_length)
3764
 
    max_records=(ha_rows) (my_seek(info.dfile,0L,MY_SEEK_END,MYF(0)) /
 
3763
    max_records=(ha_rows) (lseek(info.dfile,0L,SEEK_END) /
3765
3764
                           (ulong) share.base.min_pack_length);
3766
3765
  else
3767
3766
    max_records=0;
3769
3768
    (param->testflag & T_UNPACK);
3770
3769
  share.options&= ~HA_OPTION_TEMP_COMPRESS_RECORD;
3771
3770
 
3772
 
  file_length=(uint64_t) my_seek(info.dfile,0L,MY_SEEK_END,MYF(0));
 
3771
  file_length=(uint64_t) lseek(info.dfile,0L,SEEK_END);
3773
3772
  tmp_length= file_length+file_length/10;
3774
3773
  set_if_bigger(file_length,param->max_data_file_length);
3775
3774
  set_if_bigger(file_length,tmp_length);