~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_load.cc

Merge Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
#include <algorithm>
33
33
#include <climits>
34
34
 
35
 
using namespace drizzled;
36
35
using namespace std;
 
36
namespace drizzled
 
37
{
37
38
 
38
39
class READ_INFO {
39
40
  int   cursor;
47
48
  int   *stack,*stack_pos;
48
49
  bool  found_end_of_line,start_of_line,eof;
49
50
  bool  need_end_io_cache;
50
 
  IO_CACHE cache;
 
51
  internal::IO_CACHE cache;
51
52
 
52
53
public:
53
54
  bool error,line_cuted,found_null,enclosed;
72
73
  */
73
74
  void end_io_cache()
74
75
  {
75
 
    ::end_io_cache(&cache);
 
76
    internal::end_io_cache(&cache);
76
77
    need_end_io_cache = 0;
77
78
  }
78
79
 
255
256
#ifdef DONT_ALLOW_FULL_LOAD_DATA_PATHS
256
257
    ex->file_name+=dirname_length(ex->file_name);
257
258
#endif
258
 
    if (!dirname_length(ex->file_name))
 
259
    if (!internal::dirname_length(ex->file_name))
259
260
    {
260
261
      strcpy(name, drizzle_real_data_home);
261
262
      strncat(name, tdb, FN_REFLEN-strlen(drizzle_real_data_home)-1);
262
 
      (void) fn_format(name, ex->file_name, name, "",
 
263
      (void) internal::fn_format(name, ex->file_name, name, "",
263
264
                       MY_RELATIVE_PATH | MY_UNPACK_FILENAME);
264
265
    }
265
266
    else
266
267
    {
267
 
      (void) fn_format(name, ex->file_name, drizzle_real_data_home, "",
 
268
      (void) internal::fn_format(name, ex->file_name, drizzle_real_data_home, "",
268
269
                       MY_RELATIVE_PATH | MY_UNPACK_FILENAME);
269
270
 
270
271
      if (opt_secure_file_priv &&
294
295
      if ((stat_info.st_mode & S_IFIFO) == S_IFIFO)
295
296
        is_fifo = 1;
296
297
    }
297
 
    if ((file=my_open(name,O_RDONLY,MYF(MY_WME))) < 0)
 
298
    if ((file=internal::my_open(name,O_RDONLY,MYF(MY_WME))) < 0)
298
299
    {
299
300
      my_error(ER_CANT_OPEN_FILE, MYF(0), name, errno);
300
301
      return(true);
314
315
  if (read_info.error)
315
316
  {
316
317
    if  (file >= 0)
317
 
      my_close(file,MYF(0));                    // no files in net reading
 
318
      internal::my_close(file,MYF(0));                  // no files in net reading
318
319
    return(true);                               // Can't allocate buffers
319
320
  }
320
321
 
372
373
    table->next_number_field=0;
373
374
  }
374
375
  if (file >= 0)
375
 
    my_close(file,MYF(0));
 
376
    internal::my_close(file,MYF(0));
376
377
  free_blobs(table);                            /* if pack_blob was used */
377
378
  table->copy_blobs=0;
378
379
  session->count_cuted_fields= CHECK_FIELD_IGNORE;
784
785
  {
785
786
    end_of_buff=buffer+buff_length;
786
787
    if (init_io_cache(&cache,(false) ? -1 : cursor, 0,
787
 
                      (false) ? READ_NET :
788
 
                      (is_fifo ? READ_FIFO : READ_CACHE),0L,1,
 
788
                      (false) ? internal::READ_NET :
 
789
                      (is_fifo ? internal::READ_FIFO : internal::READ_CACHE),0L,1,
789
790
                      MYF(MY_WME)))
790
791
    {
791
792
      free((unsigned char*) buffer);
809
810
  if (!error)
810
811
  {
811
812
    if (need_end_io_cache)
812
 
      ::end_io_cache(&cache);
 
813
      internal::end_io_cache(&cache);
813
814
    free(buffer);
814
815
    error=1;
815
816
  }
1141
1142
}
1142
1143
 
1143
1144
 
 
1145
} /* namespace drizzled */