~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/drizzled.cc

  • Committer: Jay Pipes
  • Date: 2009-02-04 15:44:25 UTC
  • mfrom: (829 drizzle)
  • mto: This revision was merged to the branch mainline in revision 830.
  • Revision ID: jpipes@serialcoder-20090204154425-th8xfk2ujz2y8xwg
Merge with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#include <signal.h>
28
28
 
29
29
#include <mysys/my_bit.h>
30
 
#include <libdrizzle/libdrizzle.h>
 
30
#include <libdrizzleclient/libdrizzle.h>
31
31
#include <mysys/hash.h>
32
32
#include <drizzled/stacktrace.h>
33
33
#include <mysys/mysys_err.h>
69
69
#endif
70
70
 
71
71
#include <mysys/thr_alarm.h>
72
 
#include <libdrizzle/errmsg.h>
 
72
#include <libdrizzleclient/errmsg.h>
73
73
#include <locale.h>
74
74
 
75
75
#define mysqld_charset &my_charset_utf8_general_ci
465
465
 
466
466
/* Function declarations */
467
467
 
468
 
pthread_handler_t signal_hand(void *arg);
 
468
extern "C" pthread_handler_t signal_hand(void *arg);
469
469
static void drizzle_init_variables(void);
470
470
static void get_options(int *argc,char **argv);
471
471
extern "C" bool drizzled_get_one_option(int, const struct my_option *, char *);
474
474
static const char *get_relative_path(const char *path);
475
475
static void fix_paths(void);
476
476
void handle_connections_sockets();
477
 
pthread_handler_t kill_server_thread(void *arg);
478
 
pthread_handler_t handle_slave(void *arg);
 
477
extern "C" pthread_handler_t kill_server_thread(void *arg);
 
478
extern "C" pthread_handler_t handle_slave(void *arg);
479
479
static uint32_t find_bit_type(const char *x, TYPELIB *bit_lib);
480
480
static uint32_t find_bit_type_or_exit(const char *x, TYPELIB *bit_lib,
481
481
                                   const char *option);
488
488
static void wait_for_signal_thread_to_end(void);
489
489
static void create_pid_file();
490
490
static void drizzled_exit(int exit_code) __attribute__((noreturn));
491
 
bool safe_read_error_impl(NET *net);
 
491
extern "C" bool safe_read_error_impl(NET *net);
492
492
 
493
493
/****************************************************************************
494
494
** Code to end drizzled
770
770
  if (cleanup_done++)
771
771
    return; /* purecov: inspected */
772
772
 
773
 
  my_database_names_free();
774
773
  table_cache_free();
775
774
  table_def_free();
776
 
  lex_free();                           /* Free some memory */
777
775
  item_create_cleanup();
778
776
  set_var_free();
779
777
  free_charsets();
1599
1597
      break;                                    /* purecov: tested */
1600
1598
    }
1601
1599
  }
1602
 
  return(0);                                    /* purecov: deadcode */
 
1600
  return 0;
1603
1601
}
1604
1602
 
1605
1603
static void check_data_home(const char *)
1837
1835
 
1838
1836
  /* connections and databases needs lots of files */
1839
1837
  {
1840
 
    uint32_t files, wanted_files, max_open_files;
 
1838
    uint64_t files, wanted_files, max_open_files;
1841
1839
 
1842
1840
    /* MyISAM requires two file handles per table. */
1843
1841
    wanted_files= 10+max_connections+table_cache_size*2;
1889
1887
  unireg_init(); /* Set up extern variabels */
1890
1888
  if (init_errmessage())        /* Read error messages from file */
1891
1889
    return 1;
1892
 
  lex_init();
1893
1890
  if (item_create_init())
1894
1891
    return 1;
1895
1892
  if (set_var_init())
1973
1970
 
1974
1971
  if (use_temp_pool && bitmap_init(&temp_pool,0,1024,1))
1975
1972
    return 1;
1976
 
  if (my_database_names_init())
1977
 
    return 1;
1978
 
 
1979
1973
 
1980
1974
  /* Reset table_alias_charset, now that lower_case_table_names is set. */
1981
1975
  lower_case_table_names= 1; /* This we need to look at */
2637
2631
  {"auto-increment-increment", OPT_AUTO_INCREMENT,
2638
2632
   N_("Auto-increment columns are incremented by this"),
2639
2633
   (char**) &global_system_variables.auto_increment_increment,
2640
 
   (char**) &max_system_variables.auto_increment_increment, 0, GET_UINT,
2641
 
   OPT_ARG, 1, 1, 65535, 0, 1, 0 },
 
2634
   (char**) &max_system_variables.auto_increment_increment, 0, GET_ULL,
 
2635
   OPT_ARG, 1, 1, UINT64_MAX, 0, 1, 0 },
2642
2636
  {"auto-increment-offset", OPT_AUTO_INCREMENT_OFFSET,
2643
2637
   N_("Offset added to Auto-increment columns. Used when "
2644
2638
      "auto-increment-increment != 1"),
2645
2639
   (char**) &global_system_variables.auto_increment_offset,
2646
 
   (char**) &max_system_variables.auto_increment_offset, 0, GET_UINT, OPT_ARG,
2647
 
   1, 1, 65535, 0, 1, 0 },
 
2640
   (char**) &max_system_variables.auto_increment_offset, 0, GET_ULL, OPT_ARG,
 
2641
   1, 1, UINT64_MAX, 0, 1, 0 },
2648
2642
  {"basedir", 'b',
2649
2643
   N_("Path to installation directory. All paths are usually resolved "
2650
2644
      "relative to this."),
3378
3372
  abort_loop= select_thread_in_use= signal_thread_in_use= 0;
3379
3373
  ready_to_exit= shutdown_in_progress= 0;
3380
3374
  aborted_threads= aborted_connects= 0;
3381
 
  max_used_connections= slow_launch_threads = 0;
 
3375
  max_used_connections= 0;
 
3376
  slow_launch_threads= 0;
3382
3377
  drizzled_user= drizzled_chroot= opt_init_file= opt_bin_logname = 0;
3383
3378
  my_bind_addr_str= NULL;
3384
3379
  memset(&global_status_var, 0, sizeof(global_status_var));