~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/drizzled.cc

  • Committer: Monty Taylor
  • Date: 2009-06-30 18:09:07 UTC
  • mto: This revision was merged to the branch mainline in revision 1083.
  • Revision ID: mordred@inaugust.com-20090630180907-r24363hlhgxg4cbw
Whole boat-load of build fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
342
342
 
343
343
uint32_t drizzle_data_home_len;
344
344
char drizzle_data_home_buff[2], *drizzle_data_home=drizzle_real_data_home;
345
 
char server_version[SERVER_VERSION_LENGTH];
346
345
char *drizzle_tmpdir= NULL;
347
346
char *opt_drizzle_tmpdir= NULL;
348
347
const char *myisam_stats_method_str="nulls_unequal";
421
420
static void drizzle_init_variables(void);
422
421
static void get_options(int *argc,char **argv);
423
422
extern "C" bool drizzled_get_one_option(int, const struct my_option *, char *);
424
 
static void set_server_version(void);
425
423
static int init_thread_environment();
426
424
static const char *get_relative_path(const char *path);
427
425
static void fix_paths(void);
1142
1140
 
1143
1141
 
1144
1142
static const char *load_default_groups[]= {
1145
 
DRIZZLE_CONFIG_NAME,"server", DRIZZLE_BASE_VERSION, 0, 0};
 
1143
DRIZZLE_CONFIG_NAME, "server", 0, 0};
1146
1144
 
1147
1145
SHOW_VAR com_status_vars[]= {
1148
1146
  {"admin_commands",       (char*) offsetof(STATUS_VAR, com_other), SHOW_LONG_STATUS},
1259
1257
  defaults_argv=argv;
1260
1258
  defaults_argc=argc;
1261
1259
  get_options(&defaults_argc, defaults_argv);
1262
 
  set_server_version();
1263
1260
 
1264
1261
  current_pid=(ulong) getpid();         /* Save for later ref */
1265
1262
  init_time();                          /* Init time-functions (read zone) */
1557
1554
  thr_kill_signal= SIGINT;
1558
1555
#endif
1559
1556
 
1560
 
#ifdef _CUSTOMSTARTUPCONFIG_
1561
 
  if (_cust_check_startup())
1562
 
  {
1563
 
    / * _cust_check_startup will report startup failure error * /
1564
 
    exit(1);
1565
 
  }
1566
 
#endif
1567
 
 
1568
1557
  if (init_common_variables(DRIZZLE_CONFIG_NAME,
1569
1558
                            argc, argv, load_default_groups))
1570
1559
    unireg_abort(1);                            // Will do exit
1571
1560
 
1572
1561
  init_signals();
1573
1562
 
1574
 
#ifdef TODO_MOVE_OUT_TO_SCHEDULER_API
1575
 
  pthread_attr_setstacksize(&connection_attrib, my_thread_stack_size);
1576
 
 
1577
 
#ifdef HAVE_PTHREAD_ATTR_GETSTACKSIZE
1578
 
  {
1579
 
    /* Retrieve used stack size;  Needed for checking stack overflows */
1580
 
    size_t stack_size= 0;
1581
 
    pthread_attr_getstacksize(&connection_attrib, &stack_size);
1582
 
    /* We must check if stack_size = 0 as Solaris 2.9 can return 0 here */
1583
 
    if (stack_size && stack_size < my_thread_stack_size)
1584
 
    {
1585
 
      if (global_system_variables.log_warnings)
1586
 
      {
1587
 
            errmsg_printf(ERRMSG_LVL_WARN, _("Asked for %"PRIu64" thread stack, "
1588
 
                            "but got %"PRIu64),
1589
 
                          (uint64_t)my_thread_stack_size,
1590
 
                          (uint64_t)stack_size);
1591
 
      }
1592
 
      my_thread_stack_size= stack_size;
1593
 
    }
1594
 
  }
1595
 
#endif
1596
 
#endif
1597
1563
 
1598
1564
  select_thread=pthread_self();
1599
1565
  select_thread_in_use=1;
1600
1566
 
1601
 
  /*
1602
 
    We have enough space for fiddling with the argv, continue
1603
 
  */
1604
1567
  check_data_home(drizzle_real_data_home);
1605
1568
  if (chdir(drizzle_real_data_home) && !opt_help)
1606
1569
    unireg_abort(1);                            /* purecov: inspected */
1652
1615
 
1653
1616
  init_status_vars();
1654
1617
 
1655
 
  errmsg_printf(ERRMSG_LVL_INFO, _(ER(ER_STARTUP)), my_progname, server_version,
 
1618
  errmsg_printf(ERRMSG_LVL_INFO, _(ER(ER_STARTUP)), my_progname, VERSION,
1656
1619
                COMPILATION_COMMENT);
1657
1620
 
1658
1621
 
2368
2331
 
2369
2332
static void print_version(void)
2370
2333
{
2371
 
  set_server_version();
2372
2334
  /*
2373
2335
    Note: the instance manager keys off the string 'Ver' so it can find the
2374
2336
    version from the output of 'drizzled --version', so don't change it!
2375
2337
  */
2376
 
  printf("%s  Ver %s for %s on %s (%s)\n",my_progname,
2377
 
         server_version,SYSTEM_TYPE,MACHINE_TYPE, COMPILATION_COMMENT);
 
2338
  printf("%s  Ver %s for %s-%s on %s (%s)\n",my_progname,
 
2339
         VERSION, HOST_VENDOR, HOST_OS, HOST_CPU, COMPILATION_COMMENT);
2378
2340
}
2379
2341
 
2380
2342
static void usage(void)
2462
2424
  session_startup_options= (OPTION_AUTO_IS_NULL | OPTION_SQL_NOTES);
2463
2425
  refresh_version= 1L;  /* Increments on each reload */
2464
2426
  thread_id= 1;
2465
 
  strcpy(server_version, VERSION);
2466
2427
  myisam_stats_method_str= "nulls_unequal";
2467
2428
  session_list.clear();
2468
2429
  key_caches.empty();
2768
2729
  myisam_max_temp_length= INT32_MAX;
2769
2730
}
2770
2731
 
2771
 
/*
2772
 
  Create version name for running drizzled version
2773
 
  We automaticly add suffixes -debug, -embedded and -log to the version
2774
 
  name to make the version more descriptive.
2775
 
  (DRIZZLE_SERVER_SUFFIX is set by the compilation environment)
2776
 
*/
2777
 
 
2778
 
#ifdef DRIZZLE_SERVER_SUFFIX
2779
 
#define DRIZZLE_SERVER_SUFFIX_STR STRINGIFY_ARG(DRIZZLE_SERVER_SUFFIX)
2780
 
#else
2781
 
#define DRIZZLE_SERVER_SUFFIX_STR ""
2782
 
#endif
2783
 
 
2784
 
static void set_server_version(void)
2785
 
{
2786
 
  char *end= server_version;
2787
 
  end+= sprintf(server_version, "%s%s", VERSION, 
2788
 
                DRIZZLE_SERVER_SUFFIX_STR);
2789
 
}
2790
 
 
2791
2732
 
2792
2733
static const char *get_relative_path(const char *path)
2793
2734
{