~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/drizzled.cc

  • Committer: Grant Limberg
  • Date: 2008-08-12 21:13:01 UTC
  • mto: (322.1.1 codestyle)
  • mto: This revision was merged to the branch mainline in revision 324.
  • Revision ID: grant@glsoftware.net-20080812211301-ym3wsowelkgp16s2
renamed all instances of MYSQL_ to DRIZZLE_

Show diffs side-by-side

added added

removed removed

Lines of Context:
144
144
 
145
145
} /* cplusplus */
146
146
 
147
 
#define MYSQL_KILL_SIGNAL SIGTERM
 
147
#define DRIZZLE_KILL_SIGNAL SIGTERM
148
148
 
149
149
#include <mysys/my_pthread.h>                   // For thr_setconcurency()
150
150
 
234
234
static char *my_bind_addr_str;
235
235
static char *default_collation_name;
236
236
static char *default_storage_engine_str;
237
 
static char compiled_default_collation_name[]= MYSQL_DEFAULT_COLLATION_NAME;
 
237
static char compiled_default_collation_name[]= DRIZZLE_DEFAULT_COLLATION_NAME;
238
238
static I_List<THD> thread_cache;
239
239
static double long_query_time;
240
240
 
674
674
#endif
675
675
 
676
676
#if defined(HAVE_PTHREAD_KILL)
677
 
  pthread_kill(signal_thread, MYSQL_KILL_SIGNAL);
 
677
  pthread_kill(signal_thread, DRIZZLE_KILL_SIGNAL);
678
678
#elif !defined(SIGNALS_DONT_BREAK_READ)
679
 
  kill(current_pid, MYSQL_KILL_SIGNAL);
 
679
  kill(current_pid, DRIZZLE_KILL_SIGNAL);
680
680
#endif
681
681
  shutdown_in_progress=1;                       // Safety if kill didn't work
682
682
#ifdef SIGNALS_DONT_BREAK_READ
714
714
  abort_loop=1;                                 // This should be set
715
715
  if (sig != 0) // 0 is not a valid signal number
716
716
    my_sigset(sig, SIG_IGN);                    /* purify inspected */
717
 
  if (sig == MYSQL_KILL_SIGNAL || sig == 0)
 
717
  if (sig == DRIZZLE_KILL_SIGNAL || sig == 0)
718
718
    sql_print_information(ER(ER_NORMAL_SHUTDOWN),my_progname);
719
719
  else
720
720
    sql_print_error(ER(ER_GOT_SIGNAL),my_progname,sig); /* purecov: inspected */
721
721
 
722
722
  close_connections();
723
 
  if (sig != MYSQL_KILL_SIGNAL &&
 
723
  if (sig != DRIZZLE_KILL_SIGNAL &&
724
724
      sig != 0)
725
725
    unireg_abort(1);                            /* purecov: inspected */
726
726
  else
902
902
  */
903
903
  for (i= 0 ; i < 100 && signal_thread_in_use; i++)
904
904
  {
905
 
    if (pthread_kill(signal_thread, MYSQL_KILL_SIGNAL) != ESRCH)
 
905
    if (pthread_kill(signal_thread, DRIZZLE_KILL_SIGNAL) != ESRCH)
906
906
      break;
907
907
    my_sleep(100);                              // Give it time to die
908
908
  }
1820
1820
      thd->is_fatal_error= 1;
1821
1821
 
1822
1822
#ifdef BUG_36098_FIXED
1823
 
    mysql_audit_general(thd,MYSQL_AUDIT_GENERAL_ERROR,error,my_time(0),
 
1823
    mysql_audit_general(thd,DRIZZLE_AUDIT_GENERAL_ERROR,error,my_time(0),
1824
1824
                        0,0,str,str ? strlen(str) : 0,
1825
1825
                        thd->query,thd->query_length,
1826
1826
                        thd->variables.character_set_client,
1888
1888
 
1889
1889
 
1890
1890
static const char *load_default_groups[]= {
1891
 
"mysqld","server", MYSQL_BASE_VERSION, 0, 0};
 
1891
"mysqld","server", DRIZZLE_BASE_VERSION, 0, 0};
1892
1892
 
1893
1893
 
1894
1894
/**
2044
2044
  global_system_variables.time_zone= my_tz_SYSTEM;
2045
2045
 
2046
2046
  /*
2047
 
    Init mutexes for the global MYSQL_BIN_LOG objects.
 
2047
    Init mutexes for the global DRIZZLE_BIN_LOG objects.
2048
2048
    As safe_mutex depends on what MY_INIT() does, we can't init the mutexes of
2049
 
    global MYSQL_BIN_LOGs in their constructors, because then they would be
 
2049
    global DRIZZLE_BIN_LOGs in their constructors, because then they would be
2050
2050
    inited before MY_INIT(). So we do it here.
2051
2051
  */
2052
2052
  mysql_bin_log.init_pthread_objects();
2601
2601
  }
2602
2602
#endif
2603
2603
 
2604
 
  if (init_common_variables(MYSQL_CONFIG_NAME,
 
2604
  if (init_common_variables(DRIZZLE_CONFIG_NAME,
2605
2605
                            argc, argv, load_default_groups))
2606
2606
    unireg_abort(1);                            // Will do exit
2607
2607
 
2686
2686
  {
2687
2687
    abort_loop=1;
2688
2688
    select_thread_in_use=0;
2689
 
    (void) pthread_kill(signal_thread, MYSQL_KILL_SIGNAL);
 
2689
    (void) pthread_kill(signal_thread, DRIZZLE_KILL_SIGNAL);
2690
2690
 
2691
2691
    (void) my_delete(pidfile_name,MYF(MY_WME)); // Not needed anymore
2692
2692
 
2706
2706
  }
2707
2707
 
2708
2708
  sql_print_information(ER(ER_STARTUP),my_progname,server_version,
2709
 
                        "", mysqld_port, MYSQL_COMPILATION_COMMENT);
 
2709
                        "", mysqld_port, DRIZZLE_COMPILATION_COMMENT);
2710
2710
 
2711
2711
 
2712
2712
  handle_connections_sockets();
2802
2802
  {
2803
2803
    select_thread_in_use = 0;
2804
2804
    /* The following call will never return */
2805
 
    kill_server((void*) MYSQL_KILL_SIGNAL);
 
2805
    kill_server((void*) DRIZZLE_KILL_SIGNAL);
2806
2806
  }
2807
2807
}
2808
2808
#define MAYBE_BROKEN_SYSCALL kill_broken_server();
4143
4143
    version from the output of 'mysqld --version', so don't change it!
4144
4144
  */
4145
4145
  printf("%s  Ver %s for %s on %s (%s)\n",my_progname,
4146
 
         server_version,SYSTEM_TYPE,MACHINE_TYPE, MYSQL_COMPILATION_COMMENT);
 
4146
         server_version,SYSTEM_TYPE,MACHINE_TYPE, DRIZZLE_COMPILATION_COMMENT);
4147
4147
}
4148
4148
 
4149
4149
static void usage(void)
4164
4164
  printf("Usage: %s [OPTIONS]\n", my_progname);
4165
4165
  {
4166
4166
#ifdef FOO
4167
 
  print_defaults(MYSQL_CONFIG_NAME,load_default_groups);
 
4167
  print_defaults(DRIZZLE_CONFIG_NAME,load_default_groups);
4168
4168
  puts("");
4169
4169
  set_ports();
4170
4170
#endif
4257
4257
  what_to_log= ~ (1L << (uint) COM_TIME);
4258
4258
  refresh_version= 1L;  /* Increments on each reload */
4259
4259
  global_query_id= thread_id= 1L;
4260
 
  stpcpy(server_version, MYSQL_SERVER_VERSION);
 
4260
  stpcpy(server_version, DRIZZLE_SERVER_VERSION);
4261
4261
  myisam_recover_options_str= "OFF";
4262
4262
  myisam_stats_method_str= "nulls_unequal";
4263
4263
  threads.empty();
4285
4285
 
4286
4286
  /* Variables in libraries */
4287
4287
  charsets_dir= 0;
4288
 
  default_character_set_name= (char*) MYSQL_DEFAULT_CHARSET_NAME;
 
4288
  default_character_set_name= (char*) DRIZZLE_DEFAULT_CHARSET_NAME;
4289
4289
  default_collation_name= compiled_default_collation_name;
4290
4290
  sys_charset_system.set((char*) system_charset_info->csname);
4291
4291
  character_set_filesystem_name= (char*) "binary";
4321
4321
 
4322
4322
  const char *tmpenv;
4323
4323
  if (!(tmpenv = getenv("MY_BASEDIR_VERSION")))
4324
 
    tmpenv = DEFAULT_MYSQL_HOME;
 
4324
    tmpenv = DEFAULT_DRIZZLE_HOME;
4325
4325
  (void) strmake(mysql_home, tmpenv, sizeof(mysql_home)-1);
4326
4326
}
4327
4327
 
4772
4772
  Create version name for running mysqld version
4773
4773
  We automaticly add suffixes -debug, -embedded and -log to the version
4774
4774
  name to make the version more descriptive.
4775
 
  (MYSQL_SERVER_SUFFIX is set by the compilation environment)
 
4775
  (DRIZZLE_SERVER_SUFFIX is set by the compilation environment)
4776
4776
*/
4777
4777
 
4778
4778
static void set_server_version(void)
4779
4779
{
4780
 
  char *end= strxmov(server_version, MYSQL_SERVER_VERSION,
4781
 
                     MYSQL_SERVER_SUFFIX_STR, NullS);
 
4780
  char *end= strxmov(server_version, DRIZZLE_SERVER_VERSION,
 
4781
                     DRIZZLE_SERVER_SUFFIX_STR, NullS);
4782
4782
  if (opt_log || opt_slow_log || opt_bin_log)
4783
4783
    stpcpy(end, "-log");                        // This may slow down system
4784
4784
}
4787
4787
static char *get_relative_path(const char *path)
4788
4788
{
4789
4789
  if (test_if_hard_path(path) &&
4790
 
      is_prefix(path,DEFAULT_MYSQL_HOME) &&
4791
 
      strcmp(DEFAULT_MYSQL_HOME,FN_ROOTDIR))
 
4790
      is_prefix(path,DEFAULT_DRIZZLE_HOME) &&
 
4791
      strcmp(DEFAULT_DRIZZLE_HOME,FN_ROOTDIR))
4792
4792
  {
4793
 
    path+=(uint) strlen(DEFAULT_MYSQL_HOME);
 
4793
    path+=(uint) strlen(DEFAULT_DRIZZLE_HOME);
4794
4794
    while (*path == FN_LIBCHAR)
4795
4795
      path++;
4796
4796
  }