~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzleimport.cc

  • Committer: Brian Aker
  • Date: 2008-12-06 23:57:32 UTC
  • mfrom: (656.1.10 devel)
  • Revision ID: brian@tangent.org-20081206235732-jx228bczpvmxu8ww
Merge from Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
257
257
 
258
258
  fn_format(tablename, filename, "", "", 1 | 2); /* removes path & ext. */
259
259
  if (!opt_local_file)
260
 
    my_stpcpy(hard_path,filename);
 
260
    strcpy(hard_path,filename);
261
261
  else
262
262
    my_load_path(hard_path, filename, NULL); /* filename includes the path */
263
263
 
291
291
    opt_local_file ? "LOCAL" : "", hard_path);
292
292
  end= strchr(sql_statement, '\0');
293
293
  if (opt_replace)
294
 
    end= my_stpcpy(end, " REPLACE");
 
294
    end= strcpy(end, " REPLACE")+8;
295
295
  if (ignore)
296
 
    end= my_stpcpy(end, " IGNORE");
297
 
  end= my_stpcpy(my_stpcpy(end, " INTO TABLE "), tablename);
 
296
    end= strcpy(end, " IGNORE")+7;
 
297
 
 
298
  end+= sprintf(end, " INTO TABLE %s", tablename);
298
299
 
299
300
  if (fields_terminated || enclosed || opt_enclosed || escaped)
300
 
      end= my_stpcpy(end, " FIELDS");
 
301
      end= strcpy(end, " FIELDS")+7;
301
302
  end= add_load_option(end, fields_terminated, " TERMINATED BY");
302
303
  end= add_load_option(end, enclosed, " ENCLOSED BY");
303
304
  end= add_load_option(end, opt_enclosed,
305
306
  end= add_load_option(end, escaped, " ESCAPED BY");
306
307
  end= add_load_option(end, lines_terminated, " LINES TERMINATED BY");
307
308
  if (opt_ignore_lines >= 0)
308
 
    end= my_stpcpy(int64_t10_to_str(opt_ignore_lines,
309
 
          my_stpcpy(end, " IGNORE "),10), " LINES");
 
309
  {
 
310
    end= strcpy(end, " IGNORE ")+8;
 
311
    end= int64_t2str(opt_ignore_lines, end, 10);
 
312
    end= strcpy(end, " LINES")+6;
 
313
  }
310
314
  if (opt_columns)
311
 
    end= my_stpcpy(my_stpcpy(my_stpcpy(end, " ("), opt_columns), ")");
 
315
  {
 
316
    end= strcpy(end, " (")+2;
 
317
    end= strcpy(end, opt_columns)+strlen(opt_columns);
 
318
    end= strcpy(end, ")")+1;
 
319
  }
312
320
  *end= '\0';
313
321
 
314
322
  if (drizzle_query(drizzle, sql_statement))
467
475
  }
468
476
  /* Add missing backslashes if user has specified odd number of backs.*/
469
477
  if (end_backslashes)
470
 
    *to++= '\\';         
 
478
    *to++= '\\';
471
479
  return to;
472
480
}
473
481