~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_load.cc

  • Committer: Olaf van der Spek
  • Date: 2011-06-22 20:05:58 UTC
  • mto: This revision was merged to the branch mainline in revision 2347.
  • Revision ID: olafvdspek@gmail.com-20110622200558-oq3jb987di9yj70r
Refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
154
154
  if (escaped->length() > 4 || enclosed->length() > 4)
155
155
  {
156
156
    my_error(ER_WRONG_FIELD_TERMINATORS,MYF(0),enclosed->c_ptr(), enclosed->length());
157
 
    return(true);
 
157
    return true;
158
158
  }
159
159
 
160
160
  if (session->openTablesLock(table_list))
161
 
    return(true);
 
161
    return true;
162
162
 
163
163
  if (setup_tables_and_check_access(session, &session->lex().select_lex.context,
164
164
                                    &session->lex().select_lex.top_join_list,
177
177
  if (unique_table(table_list, table_list->next_global))
178
178
  {
179
179
    my_error(ER_UPDATE_TABLE_USED, MYF(0), table_list->getTableName());
180
 
    return(true);
 
180
    return true;
181
181
  }
182
182
 
183
183
  table= table_list->table;
196
196
    */
197
197
    if (setup_fields(session, 0, set_fields, MARK_COLUMNS_WRITE, 0, 0) ||
198
198
        setup_fields(session, 0, set_values, MARK_COLUMNS_READ, 0, 0))
199
 
      return(true);
 
199
      return true;
200
200
  }
201
201
  else
202
202
  {                                             // Part field list
204
204
    if (setup_fields(session, 0, fields_vars, MARK_COLUMNS_WRITE, 0, 0) ||
205
205
        setup_fields(session, 0, set_fields, MARK_COLUMNS_WRITE, 0, 0) ||
206
206
        check_that_all_fields_are_given_values(session, table, table_list))
207
 
      return(true);
 
207
      return true;
208
208
    /*
209
209
      Check whenever TIMESTAMP field with auto-set feature specified
210
210
      explicitly.
222
222
    }
223
223
    /* Fix the expressions in SET clause */
224
224
    if (setup_fields(session, 0, set_values, MARK_COLUMNS_READ, 0, 0))
225
 
      return(true);
 
225
      return true;
226
226
  }
227
227
 
228
228
  table->mark_columns_needed_for_insert();
254
254
  {
255
255
    my_message(ER_BLOBS_AND_NO_TERMINATED,ER(ER_BLOBS_AND_NO_TERMINATED),
256
256
               MYF(0));
257
 
    return(true);
 
257
    return true;
258
258
  }
259
259
  if (use_vars && !field_term->length() && !enclosed->length())
260
260
  {
261
261
    my_error(ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR, MYF(0));
262
 
    return(true);
 
262
    return true;
263
263
  }
264
264
 
265
265
  fs::path to_file(ex->file_name);
289
289
    {
290
290
      /* Read only allowed from within dir specified by secure_file_priv */
291
291
      my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--secure-file-priv");
292
 
      return(true);
 
292
      return true;
293
293
    }
294
294
  }
295
295
 
297
297
  if (stat(target_path.file_string().c_str(), &stat_info))
298
298
  {
299
299
    my_error(ER_FILE_NOT_FOUND, MYF(0), target_path.file_string().c_str(), errno);
300
 
    return(true);
 
300
    return true;
301
301
  }
302
302
 
303
303
  // if we are not in slave thread, the cursor must be:
307
307
         (stat_info.st_mode & S_IFIFO) == S_IFIFO)))
308
308
  {
309
309
    my_error(ER_TEXTFILE_NOT_READABLE, MYF(0), target_path.file_string().c_str());
310
 
    return(true);
 
310
    return true;
311
311
  }
312
312
  if ((stat_info.st_mode & S_IFIFO) == S_IFIFO)
313
313
    is_fifo = 1;
316
316
  if ((file=internal::my_open(target_path.file_string().c_str(), O_RDONLY,MYF(MY_WME))) < 0)
317
317
  {
318
318
    my_error(ER_CANT_OPEN_FILE, MYF(0), target_path.file_string().c_str(), errno);
319
 
    return(true);
 
319
    return true;
320
320
  }
321
321
  CopyInfo info;
322
322
  memset(&info, 0, sizeof(info));
333
333
  {
334
334
    if  (file >= 0)
335
335
      internal::my_close(file,MYF(0));                  // no files in net reading
336
 
    return(true);                               // Can't allocate buffers
 
336
    return true;                                // Can't allocate buffers
337
337
  }
338
338
 
339
339
  /*