~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/csv/transparent_file.cc

  • Committer: Monty Taylor
  • Date: 2010-02-05 08:11:15 UTC
  • mfrom: (1283 build)
  • mto: (1273.13.43 fix_is)
  • mto: This revision was merged to the branch mainline in revision 1300.
  • Revision ID: mordred@inaugust.com-20100205081115-dr82nvrwv4lvw7sd
Merged trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#include "drizzled/internal/my_sys.h"
20
20
#include "transparent_file.h"
21
21
 
 
22
using namespace drizzled;
 
23
 
22
24
Transparent_file::Transparent_file() : lower_bound(0), buff_size(IO_SIZE)
23
25
{
24
26
  buff= static_cast<unsigned char *>(malloc(buff_size*sizeof(unsigned char)));
36
38
  lower_bound= 0;
37
39
  lseek(filedes, 0, SEEK_SET);
38
40
  if (filedes && buff)
39
 
    upper_bound= my_read(filedes, buff, buff_size, MYF(0));
 
41
    upper_bound= internal::my_read(filedes, buff, buff_size, MYF(0));
40
42
}
41
43
 
42
44
unsigned char *Transparent_file::ptr()
62
64
     No need to seek here, as the file managed by Transparent_file class
63
65
     always points to upper_bound byte
64
66
  */
65
 
  if ((bytes_read= my_read(filedes, buff, buff_size, MYF(0))) == MY_FILE_ERROR)
 
67
  if ((bytes_read= internal::my_read(filedes, buff, buff_size, MYF(0))) == MY_FILE_ERROR)
66
68
    return (off_t) -1;
67
69
 
68
70
  /* end of file */
86
88
 
87
89
  lseek(filedes, offset, SEEK_SET);
88
90
  /* read appropriate portion of the file */
89
 
  if ((bytes_read= my_read(filedes, buff, buff_size,
 
91
  if ((bytes_read= internal::my_read(filedes, buff, buff_size,
90
92
                           MYF(0))) == MY_FILE_ERROR)
91
93
    return 0;
92
94