~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/drizzled.cc

  • Committer: Stewart Smith
  • Date: 2010-03-15 04:42:26 UTC
  • mto: (1283.38.1)
  • mto: This revision was merged to the branch mainline in revision 1475.
  • Revision ID: stewart@flamingspork.com-20100315044226-q74o953r9h98brm4
basic embedded innodb DATA_DICTIONARY.INNODB_CONFIGURATION test

Show diffs side-by-side

added added

removed removed

Lines of Context:
376
376
extern "C" pthread_handler_t signal_hand(void *arg);
377
377
static void drizzle_init_variables(void);
378
378
static void get_options(int *argc,char **argv);
379
 
int drizzled_get_one_option(int, const struct my_option *, char *);
 
379
bool drizzled_get_one_option(int, const struct my_option *, char *);
380
380
static int init_thread_environment();
381
381
static const char *get_relative_path(const char *path);
382
382
static void fix_paths(string &progname);
528
528
  TableShare::cacheStop();
529
529
  set_var_free();
530
530
  free_charsets();
 
531
  ha_end();
531
532
  plugin::Registry &plugins= plugin::Registry::singleton();
532
533
  plugin_shutdown(plugins);
533
534
  xid_cache_free();
548
549
 
549
550
  if (print_message && server_start_time)
550
551
    errmsg_printf(ERRMSG_LVL_INFO, _(ER(ER_SHUTDOWN_COMPLETE)),internal::my_progname);
 
552
  /* Returns NULL on globerrs, we don't want to try to free that */
 
553
  //void *freeme=
 
554
  (void *)my_error_unregister(ER_ERROR_FIRST, ER_ERROR_LAST);
 
555
  // TODO!!!! EPIC FAIL!!!! This sefaults if uncommented.
 
556
/*  if (freeme != NULL)
 
557
    free(freeme);  */
551
558
  (void) pthread_mutex_lock(&LOCK_thread_count);
552
559
  ready_to_exit=1;
553
560
  /* do the broadcast inside the lock to ensure that my_end() is not called */
963
970
  return 0;
964
971
}
965
972
 
966
 
static st_show_var_func_container show_starttime_cont= { &show_starttime };
967
 
 
968
 
static st_show_var_func_container show_flushstatustime_cont= { &show_flushstatustime };
 
973
static int show_open_tables(drizzle_show_var *var, char *buff)
 
974
{
 
975
  var->type= SHOW_LONG;
 
976
  var->value= buff;
 
977
  *((long *)buff)= (long)cached_open_tables();
 
978
  return 0;
 
979
}
 
980
 
 
981
static int show_table_definitions(drizzle_show_var *var, char *buff)
 
982
{
 
983
  var->type= SHOW_LONG;
 
984
  var->value= buff;
 
985
  *((long *)buff)= (long)cached_table_definitions();
 
986
  return 0;
 
987
}
 
988
 
 
989
static st_show_var_func_container
 
990
show_open_tables_cont= { &show_open_tables };
 
991
static st_show_var_func_container
 
992
show_table_definitions_cont= { &show_table_definitions };
 
993
static st_show_var_func_container
 
994
show_starttime_cont= { &show_starttime };
 
995
static st_show_var_func_container
 
996
show_flushstatustime_cont= { &show_flushstatustime };
969
997
 
970
998
/*
971
999
  Variables shown by SHOW STATUS in alphabetical order
1044
1072
  {"Key_writes",               (char*) offsetof(KEY_CACHE, global_cache_write), SHOW_KEY_CACHE_LONGLONG},
1045
1073
  {"Last_query_cost",          (char*) offsetof(system_status_var, last_query_cost), SHOW_DOUBLE_STATUS},
1046
1074
  {"Max_used_connections",     (char*) &max_used_connections,  SHOW_INT},
 
1075
  {"Open_table_definitions",   (char*) &show_table_definitions_cont, SHOW_FUNC},
 
1076
  {"Open_tables",              (char*) &show_open_tables_cont,       SHOW_FUNC},
 
1077
  {"Opened_tables",            (char*) offsetof(system_status_var, opened_tables), SHOW_LONG_STATUS},
 
1078
  {"Opened_table_definitions", (char*) offsetof(system_status_var, opened_shares), SHOW_LONG_STATUS},
1047
1079
  {"Questions",                (char*) offsetof(system_status_var, questions), SHOW_LONG_STATUS},
1048
1080
  {"Select_full_join",         (char*) offsetof(system_status_var, select_full_join_count), SHOW_LONG_STATUS},
1049
1081
  {"Select_full_range_join",   (char*) offsetof(system_status_var, select_full_range_join_count), SHOW_LONG_STATUS},
1127
1159
  current_pid= getpid();                /* Save for later ref */
1128
1160
  init_time();                          /* Init time-functions (read zone) */
1129
1161
 
 
1162
  if (init_errmessage())        /* Read error messages from file */
 
1163
    return 1;
1130
1164
  if (item_create_init())
1131
1165
    return 1;
1132
1166
  if (set_var_init())
1235
1269
  }
1236
1270
 
1237
1271
  /* Allow storage engine to give real error messages */
1238
 
  ha_init_errors();
 
1272
  if (ha_init_errors())
 
1273
    return(1);
1239
1274
 
1240
1275
  if (plugin_init(plugins, &defaults_argc, defaults_argv,
1241
1276
                  ((opt_help) ? true : false)))
1870
1905
}
1871
1906
 
1872
1907
 
1873
 
int drizzled_get_one_option(int optid, const struct my_option *opt,
 
1908
bool drizzled_get_one_option(int optid, const struct my_option *opt,
1874
1909
                             char *argument)
1875
1910
{
1876
1911
  switch(optid) {
1938
1973
      if (getaddrinfo(argument, NULL, &hints, &res_lst) != 0)
1939
1974
      {
1940
1975
          errmsg_printf(ERRMSG_LVL_ERROR, _("Can't start server: cannot resolve hostname!"));
1941
 
        return EXIT_ARGUMENT_INVALID;
 
1976
        exit(1);
1942
1977
      }
1943
1978
 
1944
1979
      if (res_lst->ai_next)
1945
1980
      {
1946
1981
          errmsg_printf(ERRMSG_LVL_ERROR, _("Can't start server: bind-address refers to "
1947
1982
                          "multiple interfaces!"));
1948
 
        return EXIT_ARGUMENT_INVALID;
 
1983
        exit(1);
1949
1984
      }
1950
1985
      freeaddrinfo(res_lst);
1951
1986
    }