~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/myisam/mi_cache.cc

Merged build.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
#include <algorithm>
39
39
 
40
40
using namespace std;
41
 
 
42
 
 
43
 
int _mi_read_cache(IO_CACHE *info, unsigned char *buff, my_off_t pos, uint32_t length,
 
41
using namespace drizzled;
 
42
 
 
43
 
 
44
int _mi_read_cache(internal::IO_CACHE *info, unsigned char *buff, internal::my_off_t pos, uint32_t length,
44
45
                   int flag)
45
46
{
46
47
  uint32_t read_length,in_buff_length;
47
 
  my_off_t offset;
 
48
  internal::my_off_t offset;
48
49
  unsigned char *in_buff_pos;
49
50
 
50
51
  if (pos < info->pos_in_file)
51
52
  {
52
53
    read_length=length;
53
 
    if ((my_off_t) read_length > (my_off_t) (info->pos_in_file-pos))
 
54
    if ((internal::my_off_t) read_length > (internal::my_off_t) (info->pos_in_file-pos))
54
55
      read_length=(uint) (info->pos_in_file-pos);
55
56
    info->seek_not_done=1;
56
57
    if (my_pread(info->file,buff,read_length,pos,MYF(MY_NABP)))
61
62
    buff+=read_length;
62
63
  }
63
64
  if (pos >= info->pos_in_file &&
64
 
      (offset= (my_off_t) (pos - info->pos_in_file)) <
65
 
      (my_off_t) (info->read_end - info->request_pos))
 
65
      (offset= (internal::my_off_t) (pos - info->pos_in_file)) <
 
66
      (internal::my_off_t) (info->read_end - info->request_pos))
66
67
  {
67
68
    in_buff_pos=info->request_pos+(uint) offset;
68
69
    in_buff_length= min(length, (uint32_t) (info->read_end-in_buff_pos));