~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzleimport.cc

MergeĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
 
50
50
static bool verbose= false, lock_tables= false, ignore_errors= false,
51
51
            opt_delete= false, opt_replace= false, silent= false,
52
 
            ignore= false, opt_compress= false, opt_low_priority= false,
 
52
            ignore_unique= false, opt_compress= false, opt_low_priority= false,
53
53
            tty_password= false;
54
54
static bool debug_info_flag= false, debug_check_flag= false;
55
55
static uint32_t opt_use_threads= 0, opt_local_file= 0, my_end_arg= 0;
106
106
  {"host", 'h', "Connect to host.", (char**) &current_host,
107
107
   (char**) &current_host, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
108
108
  {"ignore", 'i', "If duplicate unique key was found, keep old row.",
109
 
   (char**) &ignore, (char**) &ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
 
109
   (char**) &ignore_unique, (char**) &ignore_unique, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
110
110
  {"ignore-lines", OPT_IGN_LINES, "Ignore first n lines of data infile.",
111
111
   (char**) &opt_ignore_lines, (char**) &opt_ignore_lines, 0, GET_LL,
112
112
   REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
265
265
    fprintf(stderr, "You can't use ..enclosed.. and ..optionally-enclosed.. at the same time.\n");
266
266
    return(1);
267
267
  }
268
 
  if (opt_replace && ignore)
 
268
  if (opt_replace && ignore_unique)
269
269
  {
270
 
    fprintf(stderr, "You can't use --ignore (-i) and --replace (-r) at the same time.\n");
 
270
    fprintf(stderr, "You can't use --ignore_unique (-i) and --replace (-r) at the same time.\n");
271
271
    return(1);
272
272
  }
273
273
  if (strcmp(default_charset, charset_info->csname) &&
328
328
  end= strchr(sql_statement, '\0');
329
329
  if (opt_replace)
330
330
    end= strcpy(end, " REPLACE")+8;
331
 
  if (ignore)
 
331
  if (ignore_unique)
332
332
    end= strcpy(end, " IGNORE")+7;
333
333
 
334
334
  end+= sprintf(end, " INTO TABLE %s", tablename);