~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzleimport.c

Merged from codestyle.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
#include "client_priv.h"
30
30
#include "drizzle_version.h"
31
 
#ifdef HAVE_LIBPTHREAD
32
31
#include <my_pthread.h>
33
 
#endif
34
32
 
35
33
 
36
34
/* Global Thread counter */
37
35
uint counter;
38
 
#ifdef HAVE_LIBPTHREAD
39
36
pthread_mutex_t counter_mutex;
40
37
pthread_cond_t count_threshhold;
41
 
#endif
42
38
 
43
39
static void db_error_with_table(MYSQL *mysql, char *table);
44
40
static void db_error(MYSQL *mysql);
61
57
static int64_t opt_ignore_lines= -1;
62
58
static CHARSET_INFO *charset_info= &my_charset_latin1;
63
59
 
64
 
#ifdef HAVE_SMEM
65
 
static char *shared_memory_base_name=0;
66
 
#endif
67
 
 
68
60
static struct my_option my_long_options[] =
69
61
{
70
62
  {"character-sets-dir", OPT_CHARSETS_DIR,
141
133
   0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
142
134
  {"replace", 'r', "If duplicate unique key was found, replace old row.",
143
135
   (char**) &replace, (char**) &replace, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
144
 
#ifdef HAVE_SMEM
145
 
  {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
146
 
   "Base name of shared memory.", (char**) &shared_memory_base_name, (char**) &shared_memory_base_name,
147
 
   0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
148
 
#endif
149
136
  {"silent", 's', "Be more silent.", (char**) &silent, (char**) &silent, 0,
150
137
   GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
151
138
  {"socket", 'S', "Socket file to use for connection.",
387
374
                  (char*) &opt_local_file);
388
375
  if (opt_protocol)
389
376
    mysql_options(mysql,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol);
390
 
#ifdef HAVE_SMEM
391
 
  if (shared_memory_base_name)
392
 
    mysql_options(mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
393
 
#endif
394
377
  if (!(mysql_real_connect(mysql,host,user,passwd,
395
378
                           database,opt_mysql_port,opt_mysql_unix_port,
396
379
                           0)))
498
481
 
499
482
int exitcode= 0;
500
483
 
501
 
#ifdef HAVE_LIBPTHREAD
502
484
static pthread_handler_t worker_thread(void *arg)
503
485
{
504
486
  int error;
538
520
 
539
521
  return 0;
540
522
}
541
 
#endif
542
523
 
543
524
 
544
525
int main(int argc, char **argv)
634
615
    db_disconnect(current_host, mysql);
635
616
  }
636
617
  my_free(opt_password,MYF(MY_ALLOW_ZERO_PTR));
637
 
#ifdef HAVE_SMEM
638
 
  my_free(shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR));
639
 
#endif
640
618
  free_defaults(argv_to_free);
641
619
  my_end(my_end_arg);
642
620
  return(exitcode);