~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_load.cc

  • Committer: Brian Aker
  • Date: 2009-03-07 17:21:24 UTC
  • mfrom: (919.1.3 merge)
  • Revision ID: brian@tangent.org-20090307172124-s1bnv3chifan0v5s
Merge of patches for removal of LOAD DATA "LOCAL"

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
 
48
48
  READ_INFO(File file,uint32_t tot_length, const CHARSET_INFO * const cs,
49
49
            String &field_term,String &line_start,String &line_term,
50
 
            String &enclosed,int escape,bool get_it_from_net, bool is_fifo);
 
50
            String &enclosed,int escape, bool is_fifo);
51
51
  ~READ_INFO();
52
52
  int read_field();
53
53
  int read_fixed_length(void);
101
101
      handle_duplicates - indicates whenever we should emit error or
102
102
                          replace row if we will meet duplicates.
103
103
      ignore -          - indicates whenever we should ignore duplicates
104
 
      read_file_from_client - is this LOAD DATA LOCAL ?
105
104
 
106
105
  RETURN VALUES
107
106
    true - error / false - success
110
109
int mysql_load(Session *session,file_exchange *ex,TableList *table_list,
111
110
                List<Item> &fields_vars, List<Item> &set_fields,
112
111
                List<Item> &set_values,
113
 
                enum enum_duplicates handle_duplicates, bool ignore,
114
 
                bool read_file_from_client)
 
112
                enum enum_duplicates handle_duplicates, bool ignore)
115
113
{
116
114
  char name[FN_REFLEN];
117
115
  File file;
243
241
    return(true);
244
242
  }
245
243
 
246
 
  /* We can't give an error in the middle when using LOCAL files */
247
 
  if (read_file_from_client && handle_duplicates == DUP_ERROR)
248
 
    ignore= 1;
249
 
 
250
 
  if (read_file_from_client)
251
 
  {
252
 
    assert(0);
253
 
    file = -1;
254
 
  }
255
 
  else
256
244
  {
257
245
#ifdef DONT_ALLOW_FULL_LOAD_DATA_PATHS
258
246
    ex->file_name+=dirname_length(ex->file_name);
312
300
  READ_INFO read_info(file,tot_length,
313
301
                      ex->cs ? ex->cs : session->variables.collation_database,
314
302
                      *field_term,*ex->line_start, *ex->line_term, *enclosed,
315
 
                      info.escape_char, read_file_from_client, is_fifo);
 
303
                      info.escape_char, is_fifo);
316
304
  if (read_info.error)
317
305
  {
318
306
    if  (file >= 0)
385
373
  killed_status= (error == 0)? Session::NOT_KILLED : session->killed;
386
374
  if (error)
387
375
  {
388
 
    if (read_file_from_client)
389
 
      while (!read_info.next_line())
390
 
        ;
391
 
 
392
376
    error= -1;                          // Error on read
393
377
    goto err;
394
378
  }
741
725
 
742
726
READ_INFO::READ_INFO(File file_par, uint32_t tot_length, const CHARSET_INFO * const cs,
743
727
                     String &field_term, String &line_start, String &line_term,
744
 
                     String &enclosed_par, int escape, bool get_it_from_net,
745
 
                     bool is_fifo)
 
728
                     String &enclosed_par, int escape, bool is_fifo)
746
729
  :file(file_par),escape_char(escape)
747
730
{
748
731
  read_charset= cs;
786
769
  else
787
770
  {
788
771
    end_of_buff=buffer+buff_length;
789
 
    if (init_io_cache(&cache,(get_it_from_net) ? -1 : file, 0,
790
 
                      (get_it_from_net) ? READ_NET :
 
772
    if (init_io_cache(&cache,(false) ? -1 : file, 0,
 
773
                      (false) ? READ_NET :
791
774
                      (is_fifo ? READ_FIFO : READ_CACHE),0L,1,
792
775
                      MYF(MY_WME)))
793
776
    {
802
785
        manual assignment
803
786
      */
804
787
      need_end_io_cache = 1;
805
 
 
806
 
      if (get_it_from_net)
807
 
        cache.read_function = _my_b_net_read;
808
788
    }
809
789
  }
810
790
}