~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/drizzled.cc

  • Committer: Mats Kindahl
  • Date: 2008-08-07 06:24:22 UTC
  • mfrom: (265 drizzle)
  • mto: (264.1.19 codestyle)
  • mto: This revision was merged to the branch mainline in revision 266.
  • Revision ID: mats@mysql.com-20080807062422-20kyv6ssp4grfm0s
Manual merge of lp:drizzle into ~mkindahl/remove-mem-casts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
16
#include "mysql_priv.h"
17
 
#include <m_ctype.h>
18
 
#include <my_dir.h>
19
17
#include <mysys/my_bit.h>
20
18
#include "slave.h"
21
19
#include "rpl_mi.h"
27
25
#include <mysys/mysys_err.h>
28
26
#include <sys/poll.h>
29
27
#include <netinet/tcp.h>
 
28
#include <drizzled/drizzled_error_messages.h>
30
29
 
31
30
#include <storage/myisam/ha_myisam.h>
32
31
 
39
38
#endif
40
39
 
41
40
#include <mysys/thr_alarm.h>
42
 
#include <errmsg.h>
 
41
#include <libdrizzle/errmsg.h>
 
42
#include <locale.h>
 
43
#include <libdrizzle/gettext.h>
43
44
 
44
45
#define mysqld_charset &my_charset_latin1
45
46
 
95
96
#endif
96
97
 
97
98
#define SIGNAL_FMT "signal %d"
98
 
  
 
99
 
99
100
 
100
101
#if defined(__FreeBSD__) && defined(HAVE_IEEEFP_H)
101
102
#include <ieeefp.h>
200
201
/*
201
202
  Used with --help for detailed option
202
203
*/
203
 
static bool opt_help= 0, opt_verbose= 0;
 
204
static bool opt_help= false;
204
205
 
205
206
arg_cmp_func Arg_comparator::comparator_matrix[5][2] =
206
207
{{&Arg_comparator::compare_string,     &Arg_comparator::compare_e_string},
212
213
const char *log_output_names[] = { "NONE", "FILE", NullS};
213
214
static const unsigned int log_output_names_len[]= { 4, 4, 0 };
214
215
TYPELIB log_output_typelib= {array_elements(log_output_names)-1,"",
215
 
                             log_output_names, 
 
216
                             log_output_names,
216
217
                             (unsigned int *) log_output_names_len};
217
218
 
218
219
/* static variables */
232
233
static char *character_set_filesystem_name;
233
234
static char *lc_time_names_name;
234
235
static char *my_bind_addr_str;
235
 
static char *default_collation_name; 
 
236
static char *default_collation_name;
236
237
static char *default_storage_engine_str;
237
238
static char compiled_default_collation_name[]= MYSQL_DEFAULT_COLLATION_NAME;
238
239
static I_List<THD> thread_cache;
243
244
/* Global variables */
244
245
 
245
246
bool opt_bin_log;
246
 
bool opt_log; 
 
247
bool opt_log;
247
248
bool opt_slow_log;
248
249
ulong log_output_options;
249
250
bool opt_log_queries_not_using_indexes= false;
384
385
char mysql_data_home_buff[2], *mysql_data_home=mysql_real_data_home;
385
386
char server_version[SERVER_VERSION_LENGTH];
386
387
char *opt_mysql_tmpdir;
387
 
const char **errmesg;                   /**< Error messages */
388
388
const char *myisam_recover_options_str="OFF";
389
389
const char *myisam_stats_method_str="nulls_unequal";
390
390
 
424
424
MY_LOCALE *my_default_lc_time_names;
425
425
 
426
426
SHOW_COMP_OPTION have_symlink;
427
 
SHOW_COMP_OPTION have_crypt;
428
427
SHOW_COMP_OPTION have_compress;
429
428
 
430
429
/* Thread specific variables */
434
433
pthread_mutex_t LOCK_mysql_create_db, LOCK_open, LOCK_thread_count,
435
434
                LOCK_mapped_file, LOCK_status, LOCK_global_read_lock,
436
435
                LOCK_error_log, LOCK_uuid_generator,
437
 
                LOCK_crypt,
438
436
                LOCK_global_system_variables,
439
437
                LOCK_user_conn, LOCK_slave_list, LOCK_active_mi,
440
438
                LOCK_connection_count;
560
558
  /* Abort listening to new connections */
561
559
  {
562
560
    int x;
563
 
    
 
561
 
564
562
    for (x= 0; x < pollfd_count; x++)
565
563
    {
566
564
      if (fds[x].fd != INVALID_SOCKET)
654
652
#ifdef HAVE_CLOSE_SERVER_SOCK
655
653
  {
656
654
    int x;
657
 
    
 
655
 
658
656
    for (x= 0; x < pollfd_count; x++)
659
657
    {
660
658
      if (fds[x].fd != INVALID_SOCKET)
722
720
    sql_print_information(ER(ER_NORMAL_SHUTDOWN),my_progname);
723
721
  else
724
722
    sql_print_error(ER(ER_GOT_SIGNAL),my_progname,sig); /* purecov: inspected */
725
 
  
 
723
 
726
724
  close_connections();
727
725
  if (sig != MYSQL_KILL_SIGNAL &&
728
726
      sig != 0)
868
866
 
869
867
  (void) my_delete(pidfile_name,MYF(0));        // This may not always exist
870
868
 
871
 
  if (print_message && errmesg && server_start_time)
 
869
  if (print_message && server_start_time)
872
870
    sql_print_information(ER(ER_SHUTDOWN_COMPLETE),my_progname);
873
871
  thread_scheduler.end();
874
872
  finish_client_errs();
875
 
  my_free((uchar*) my_error_unregister(ER_ERROR_FIRST, ER_ERROR_LAST),
876
 
          MYF(MY_WME | MY_FAE | MY_ALLOW_ZERO_PTR));
 
873
  /* Returns NULL on globerrs, we don't want to try to free that */
 
874
  //void *freeme=
 
875
  (void *)my_error_unregister(ER_ERROR_FIRST, ER_ERROR_LAST);
 
876
  // TODO!!!! EPIC FAIL!!!! This sefaults if uncommented.
 
877
/*  if (freeme != NULL)
 
878
    my_free(freeme, MYF(MY_WME | MY_FAE | MY_ALLOW_ZERO_PTR));  */
877
879
  /* Tell main we are ready */
878
880
  logger.cleanup_end();
879
881
  (void) pthread_mutex_lock(&LOCK_thread_count);
918
920
  (void) pthread_mutex_destroy(&LOCK_mapped_file);
919
921
  (void) pthread_mutex_destroy(&LOCK_status);
920
922
  (void) pthread_mutex_destroy(&LOCK_error_log);
921
 
  (void) pthread_mutex_destroy(&LOCK_crypt);
922
923
  (void) pthread_mutex_destroy(&LOCK_user_conn);
923
924
  (void) pthread_mutex_destroy(&LOCK_connection_count);
924
925
  (void) pthread_mutex_destroy(&LOCK_rpl_status);
1439
1440
    fprintf(stderr,"\
1440
1441
Attempting backtrace. You can use the following information to find out\n\
1441
1442
where mysqld died. If you see no messages after this, something went\n\
1442
 
terribly wrong...\n");  
 
1443
terribly wrong...\n");
1443
1444
    print_stacktrace(thd ? (uchar*) thd->thread_stack : (uchar*) 0,
1444
1445
                     my_thread_stack_size);
1445
1446
  }
1493
1494
You should either build a dynamically-linked binary, or force LinuxThreads\n\
1494
1495
to be used with the LD_ASSUME_KERNEL environment variable. Please consult\n\
1495
1496
the documentation for your distribution on how to do that.\n");
1496
 
  
 
1497
 
1497
1498
  if (locked_in_memory)
1498
1499
  {
1499
1500
    fprintf(stderr, "\n\
1804
1805
      this could be improved by having a common stack of handlers.
1805
1806
    */
1806
1807
    if (thd->handle_error(error, str,
1807
 
                          MYSQL_ERROR::WARN_LEVEL_ERROR))
 
1808
                          DRIZZLE_ERROR::WARN_LEVEL_ERROR))
1808
1809
      return;;
1809
1810
 
1810
1811
    thd->is_slave_error=  1; // needed to catch query errors during replication
1833
1834
        inside push_warning.
1834
1835
      */
1835
1836
      thd->no_warnings_for_error= true;
1836
 
      push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, error, str);
 
1837
      push_warning(thd, DRIZZLE_ERROR::WARN_LEVEL_ERROR, error, str);
1837
1838
      thd->no_warnings_for_error= false;
1838
1839
    }
1839
1840
  }
1906
1907
  {"admin_commands",       (char*) offsetof(STATUS_VAR, com_other), SHOW_LONG_STATUS},
1907
1908
  {"assign_to_keycache",   (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_ASSIGN_TO_KEYCACHE]), SHOW_LONG_STATUS},
1908
1909
  {"alter_db",             (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_ALTER_DB]), SHOW_LONG_STATUS},
1909
 
  {"alter_db_upgrade",     (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_ALTER_DB_UPGRADE]), SHOW_LONG_STATUS},
1910
1910
  {"alter_table",          (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_ALTER_TABLE]), SHOW_LONG_STATUS},
1911
1911
  {"analyze",              (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_ANALYZE]), SHOW_LONG_STATUS},
1912
1912
  {"begin",                (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_BEGIN]), SHOW_LONG_STATUS},
1988
1988
  server_start_time= flush_status_time= my_time(0);
1989
1989
  rpl_filter= new Rpl_filter;
1990
1990
  binlog_filter= new Rpl_filter;
1991
 
  if (!rpl_filter || !binlog_filter) 
 
1991
  if (!rpl_filter || !binlog_filter)
1992
1992
  {
1993
1993
    sql_perror("Could not allocate replication and binlog filters");
1994
1994
    exit(1);
2165
2165
  global_system_variables.optimizer_use_mrr= 1;
2166
2166
  global_system_variables.optimizer_switch= 0;
2167
2167
 
2168
 
  if (!(character_set_filesystem= 
 
2168
  if (!(character_set_filesystem=
2169
2169
        get_charset_by_csname(character_set_filesystem_name,
2170
2170
                              MY_CS_PRIMARY, MYF(MY_WME))))
2171
2171
    return 1;
2178
2178
    return 1;
2179
2179
  }
2180
2180
  global_system_variables.lc_time_names= my_default_lc_time_names;
2181
 
  
 
2181
 
2182
2182
  sys_init_connect.value_length= 0;
2183
2183
  if ((sys_init_connect.value= opt_init_connect))
2184
2184
    sys_init_connect.value_length= strlen(opt_init_connect);
2235
2235
  (void) pthread_mutex_init(&LOCK_mapped_file,MY_MUTEX_INIT_SLOW);
2236
2236
  (void) pthread_mutex_init(&LOCK_status,MY_MUTEX_INIT_FAST);
2237
2237
  (void) pthread_mutex_init(&LOCK_error_log,MY_MUTEX_INIT_FAST);
2238
 
  (void) pthread_mutex_init(&LOCK_crypt,MY_MUTEX_INIT_FAST);
2239
2238
  (void) pthread_mutex_init(&LOCK_user_conn, MY_MUTEX_INIT_FAST);
2240
2239
  (void) pthread_mutex_init(&LOCK_active_mi, MY_MUTEX_INIT_FAST);
2241
2240
  (void) pthread_mutex_init(&LOCK_global_system_variables, MY_MUTEX_INIT_FAST);
2336
2335
    if (opt_binlog_format_id == BINLOG_FORMAT_UNSPEC)
2337
2336
      global_system_variables.binlog_format= BINLOG_FORMAT_MIXED;
2338
2337
    else
2339
 
    { 
 
2338
    {
2340
2339
      assert(global_system_variables.binlog_format != BINLOG_FORMAT_UNSPEC);
2341
2340
    }
2342
2341
 
2438
2437
    }
2439
2438
  }
2440
2439
 
2441
 
  /* if the errmsg.sys is not loaded, terminate to maintain behaviour */
2442
 
  if (!errmesg[0][0])
2443
 
    unireg_abort(1);
2444
 
 
2445
2440
  /* We have to initialize the storage engines before CSV logging */
2446
2441
  if (ha_init())
2447
2442
  {
2461
2456
                       strlen(default_storage_engine_str) };
2462
2457
    plugin_ref plugin;
2463
2458
    handlerton *hton;
2464
 
    
 
2459
 
2465
2460
    if ((plugin= ha_resolve_by_name(0, &name)))
2466
 
      hton= plugin_data(plugin, handlerton*);
 
2461
    {
 
2462
      hton= plugin_data(plugin,handlerton *);
 
2463
    }
2467
2464
    else
2468
2465
    {
2469
2466
      sql_print_error("Unknown/unsupported table type: %s",
2480
2477
    else
2481
2478
    {
2482
2479
      /*
2483
 
        Need to unlock as global_system_variables.table_plugin 
 
2480
        Need to unlock as global_system_variables.table_plugin
2484
2481
        was acquired during plugin_init()
2485
2482
      */
2486
2483
      plugin_unlock(0, global_system_variables.table_plugin);
2546
2543
 
2547
2544
int main(int argc, char **argv)
2548
2545
{
 
2546
 
 
2547
#if defined(ENABLE_NLS)
 
2548
# if defined(HAVE_LOCALE_H)
 
2549
  setlocale(LC_ALL, "");
 
2550
# endif
 
2551
  bindtextdomain("drizzle", LOCALEDIR);
 
2552
  textdomain("drizzle");
 
2553
#endif
 
2554
 
2549
2555
  MY_INIT(argv[0]);             // init my_sys library & pthreads
2550
2556
  /* nothing should come before this line ^^^ */
2551
2557
 
2677
2683
  handle_connections_sockets();
2678
2684
 
2679
2685
  /* (void) pthread_attr_destroy(&connection_attrib); */
2680
 
  
 
2686
 
2681
2687
 
2682
2688
#ifdef EXTRA_DEBUG2
2683
2689
  sql_print_error("Before Lock_thread_count");
2803
2809
    }
2804
2810
    if (number_of == 0)
2805
2811
      continue;
2806
 
    
 
2812
 
2807
2813
#ifdef FIXME_IF_WE_WERE_KEEPING_THIS
2808
2814
    assert(number_of > 1); /* Not handling this at the moment */
2809
2815
#endif
2848
2854
      size_socket dummyLen;
2849
2855
      struct sockaddr_storage dummy;
2850
2856
      dummyLen = sizeof(dummy);
2851
 
      if (  getsockname(new_sock,(struct sockaddr *)&dummy, 
 
2857
      if (  getsockname(new_sock,(struct sockaddr *)&dummy,
2852
2858
                  (socklen_t *)&dummyLen) < 0  )
2853
2859
      {
2854
2860
        sql_perror("Error on new connection socket");
2898
2904
 
2899
2905
enum options_mysqld
2900
2906
{
2901
 
  OPT_ISAM_LOG=256,            OPT_SKIP_NEW, 
2902
 
  OPT_SKIP_GRANT,              
 
2907
  OPT_ISAM_LOG=256,            OPT_SKIP_NEW,
 
2908
  OPT_SKIP_GRANT,
2903
2909
  OPT_ENABLE_LOCK,             OPT_USE_LOCKING,
2904
2910
  OPT_SOCKET,                  OPT_UPDATE_LOG,
2905
 
  OPT_BIN_LOG,                 
 
2911
  OPT_BIN_LOG,
2906
2912
  OPT_BIN_LOG_INDEX,
2907
2913
  OPT_BIND_ADDRESS,            OPT_PID_FILE,
2908
 
  OPT_SKIP_PRIOR,              OPT_BIG_TABLES,
 
2914
  OPT_SKIP_PRIOR,
2909
2915
  OPT_STANDALONE,
2910
2916
  OPT_CONSOLE,                 OPT_LOW_PRIORITY_UPDATES,
2911
2917
  OPT_SHORT_LOG_FORMAT,
2912
2918
  OPT_FLUSH,                   OPT_SAFE,
2913
 
  OPT_BOOTSTRAP,               OPT_SKIP_SHOW_DB,
2914
2919
  OPT_STORAGE_ENGINE,          OPT_INIT_FILE,
2915
2920
  OPT_DELAY_KEY_WRITE_ALL,     OPT_SLOW_QUERY_LOG,
2916
2921
  OPT_DELAY_KEY_WRITE,         OPT_CHARSETS_DIR,
2920
2925
  OPT_REPLICATE_IGNORE_DB,     OPT_LOG_SLAVE_UPDATES,
2921
2926
  OPT_BINLOG_DO_DB,            OPT_BINLOG_IGNORE_DB,
2922
2927
  OPT_BINLOG_FORMAT,
2923
 
  OPT_BINLOG_ROWS_EVENT_MAX_SIZE, 
 
2928
  OPT_BINLOG_ROWS_EVENT_MAX_SIZE,
2924
2929
  OPT_WANT_CORE,
2925
2930
  OPT_MEMLOCK,                 OPT_MYISAM_RECOVER,
2926
2931
  OPT_REPLICATE_REWRITE_DB,    OPT_SERVER_ID,
2931
2936
  OPT_DISCONNECT_SLAVE_EVENT_COUNT, OPT_TC_HEURISTIC_RECOVER,
2932
2937
  OPT_ABORT_SLAVE_EVENT_COUNT,
2933
2938
  OPT_LOG_BIN_TRUST_FUNCTION_CREATORS,
2934
 
  OPT_ENGINE_CONDITION_PUSHDOWN, 
 
2939
  OPT_ENGINE_CONDITION_PUSHDOWN,
2935
2940
  OPT_TEMP_POOL, OPT_TX_ISOLATION, OPT_COMPLETION_TYPE,
2936
2941
  OPT_SKIP_STACK_TRACE, OPT_SKIP_SYMLINKS,
2937
2942
  OPT_MAX_BINLOG_DUMP_EVENTS, OPT_SPORADIC_BINLOG_DUMP_FAIL,
2956
2961
  OPT_MAX_BINLOG_CACHE_SIZE, OPT_MAX_BINLOG_SIZE,
2957
2962
  OPT_MAX_CONNECTIONS, OPT_MAX_CONNECT_ERRORS,
2958
2963
  OPT_MAX_HEP_TABLE_SIZE,
2959
 
  OPT_MAX_JOIN_SIZE, OPT_MAX_PREPARED_STMT_COUNT,
 
2964
  OPT_MAX_JOIN_SIZE,
2960
2965
  OPT_MAX_RELAY_LOG_SIZE, OPT_MAX_SORT_LENGTH,
2961
2966
  OPT_MAX_SEEKS_FOR_KEY, OPT_MAX_TMP_TABLES, OPT_MAX_USER_CONNECTIONS,
2962
2967
  OPT_MAX_LENGTH_FOR_SORT_DATA,
2970
2975
  OPT_NET_READ_TIMEOUT, OPT_NET_WRITE_TIMEOUT,
2971
2976
  OPT_OPEN_FILES_LIMIT,
2972
2977
  OPT_PRELOAD_BUFFER_SIZE,
2973
 
  OPT_QUERY_CACHE_LIMIT, OPT_QUERY_CACHE_MIN_RES_UNIT, OPT_QUERY_CACHE_SIZE,
2974
 
  OPT_QUERY_CACHE_TYPE, OPT_QUERY_CACHE_WLOCK_INVALIDATE, OPT_RECORD_BUFFER,
 
2978
  OPT_RECORD_BUFFER,
2975
2979
  OPT_RECORD_RND_BUFFER, OPT_DIV_PRECINCREMENT, OPT_RELAY_LOG_SPACE_LIMIT,
2976
2980
  OPT_RELAY_LOG_PURGE,
2977
2981
  OPT_SLAVE_NET_TIMEOUT, OPT_SLAVE_COMPRESSED_PROTOCOL, OPT_SLOW_LAUNCH_TIME,
3039
3043
 
3040
3044
struct my_option my_long_options[] =
3041
3045
{
3042
 
  {"help", '?', "Display this help and exit.", 
 
3046
  {"help", '?', "Display this help and exit.",
3043
3047
   (char**) &opt_help, (char**) &opt_help, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
3044
3048
   0, 0},
3045
3049
  {"abort-slave-event-count", OPT_ABORT_SLAVE_EVENT_COUNT,
3046
3050
   "Option used by mysql-test for debugging and testing of replication.",
3047
3051
   (char**) &abort_slave_event_count,  (char**) &abort_slave_event_count,
3048
3052
   0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
3049
 
  {"ansi", 'a', "Use ANSI SQL syntax instead of MySQL syntax. This mode will also set transaction isolation level 'serializable'.", 0, 0, 0,
3050
 
   GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
3051
3053
  {"auto-increment-increment", OPT_AUTO_INCREMENT,
3052
3054
   "Auto-increment columns are incremented by this",
3053
3055
   (char**) &global_system_variables.auto_increment_increment,
3062
3064
   "Path to installation directory. All paths are usually resolved relative to this.",
3063
3065
   (char**) &mysql_home_ptr, (char**) &mysql_home_ptr, 0, GET_STR, REQUIRED_ARG,
3064
3066
   0, 0, 0, 0, 0, 0},
3065
 
  {"big-tables", OPT_BIG_TABLES,
3066
 
   "Allow big result sets by saving all temporary sets on file (Solves most 'table full' errors).",
3067
 
   0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
3068
3067
  {"bind-address", OPT_BIND_ADDRESS, "IP address to bind to.",
3069
3068
   (char**) &my_bind_addr_str, (char**) &my_bind_addr_str, 0, GET_STR,
3070
3069
   REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
3088
3087
   "The maximum size of a row-based binary log event in bytes. Rows will be "
3089
3088
   "grouped into events smaller than this size if possible. "
3090
3089
   "The value has to be a multiple of 256.",
3091
 
   (char**) &opt_binlog_rows_event_max_size, 
3092
 
   (char**) &opt_binlog_rows_event_max_size, 0, 
3093
 
   GET_ULONG, REQUIRED_ARG, 
3094
 
   /* def_value */ 1024, /* min_value */  256, /* max_value */ ULONG_MAX, 
3095
 
   /* sub_size */     0, /* block_size */ 256, 
 
3090
   (char**) &opt_binlog_rows_event_max_size,
 
3091
   (char**) &opt_binlog_rows_event_max_size, 0,
 
3092
   GET_ULONG, REQUIRED_ARG,
 
3093
   /* def_value */ 1024, /* min_value */  256, /* max_value */ ULONG_MAX,
 
3094
   /* sub_size */     0, /* block_size */ 256,
3096
3095
   /* app_type */ 0
3097
3096
  },
3098
 
#ifndef DISABLE_GRANT_OPTIONS
3099
 
  {"bootstrap", OPT_BOOTSTRAP, "Used by mysql installation scripts.", 0, 0, 0,
3100
 
   GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
3101
 
#endif
3102
3097
  {"character-set-client-handshake", OPT_CHARACTER_SET_CLIENT_HANDSHAKE,
3103
3098
   "Don't ignore client side character set value sent during handshake.",
3104
3099
   (char**) &opt_character_set_client_handshake,
3190
3185
   (char**) &opt_init_slave, (char**) &opt_init_slave, 0, GET_STR_ALLOC,
3191
3186
   REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
3192
3187
  {"language", 'L',
3193
 
   "Client error messages in given language. May be given as a full path.",
 
3188
   "Client error messages in given language. May be given as a full path. (IGNORED)",
3194
3189
   (char**) &language_ptr, (char**) &language_ptr, 0, GET_STR, REQUIRED_ARG,
3195
3190
   0, 0, 0, 0, 0, 0},
3196
3191
  {"lc-time-names", OPT_LC_TIME_NAMES,
3235
3230
   (char**) &myisam_log_filename, (char**) &myisam_log_filename, 0, GET_STR,
3236
3231
   OPT_ARG, 0, 0, 0, 0, 0, 0},
3237
3232
  {"log-long-format", '0',
3238
 
   "Log some extra information to update log. Please note that this option is deprecated; see --log-short-format option.", 
 
3233
   "Log some extra information to update log. Please note that this option is deprecated; see --log-short-format option.",
3239
3234
   0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
3240
3235
#ifdef WITH_CSV_STORAGE_ENGINE
3241
3236
  {"log-output", OPT_LOG_OUTPUT,
3457
3452
   0, 0, 0, 0, 0},
3458
3453
  {"timed_mutexes", OPT_TIMED_MUTEXES,
3459
3454
   "Specify whether to time mutexes (only InnoDB mutexes are currently supported)",
3460
 
   (char**) &timed_mutexes, (char**) &timed_mutexes, 0, GET_BOOL, NO_ARG, 0, 
 
3455
   (char**) &timed_mutexes, (char**) &timed_mutexes, 0, GET_BOOL, NO_ARG, 0,
3461
3456
    0, 0, 0, 0, 0},
3462
3457
  {"tmpdir", 't',
3463
3458
   "Path for temporary files. Several paths may be specified, separated by a "
3473
3468
   IF_PURIFY(0,1), 0, 0, 0, 0, 0},
3474
3469
  {"user", 'u', "Run mysqld daemon as user.", 0, 0, 0, GET_STR, REQUIRED_ARG,
3475
3470
   0, 0, 0, 0, 0, 0},
3476
 
  {"verbose", 'v', "Used with --help option for detailed help",
3477
 
   (char**) &opt_verbose, (char**) &opt_verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
3478
 
   0, 0},
3479
3471
  {"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG,
3480
3472
   NO_ARG, 0, 0, 0, 0, 0, 0},
3481
3473
  {"warnings", 'W', "Deprecated; use --log-warnings instead.",
3501
3493
   0, GET_ULONG, REQUIRED_ARG, CONNECT_TIMEOUT, 2, LONG_TIMEOUT, 0, 1, 0 },
3502
3494
  { "date_format", OPT_DATE_FORMAT,
3503
3495
    "The DATE format (For future).",
3504
 
    (char**) &opt_date_time_formats[MYSQL_TIMESTAMP_DATE],
3505
 
    (char**) &opt_date_time_formats[MYSQL_TIMESTAMP_DATE],
 
3496
    (char**) &opt_date_time_formats[DRIZZLE_TIMESTAMP_DATE],
 
3497
    (char**) &opt_date_time_formats[DRIZZLE_TIMESTAMP_DATE],
3506
3498
    0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
3507
3499
  { "datetime_format", OPT_DATETIME_FORMAT,
3508
3500
    "The DATETIME/TIMESTAMP format (for future).",
3509
 
    (char**) &opt_date_time_formats[MYSQL_TIMESTAMP_DATETIME],
3510
 
    (char**) &opt_date_time_formats[MYSQL_TIMESTAMP_DATETIME],
 
3501
    (char**) &opt_date_time_formats[DRIZZLE_TIMESTAMP_DATETIME],
 
3502
    (char**) &opt_date_time_formats[DRIZZLE_TIMESTAMP_DATETIME],
3511
3503
    0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
3512
3504
  { "default_week_format", OPT_DEFAULT_WEEK_FORMAT,
3513
3505
    "The default week format used by WEEK() functions.",
3557
3549
   "This characterizes the number of hits a hot block has to be untouched until it is considered aged enough to be downgraded to a warm block. This specifies the percentage ratio of that number of hits to the total number of blocks in key cache",
3558
3550
   (char**) &dflt_key_cache_var.param_age_threshold,
3559
3551
   (char**) 0,
3560
 
   0, (GET_ULONG | GET_ASK_ADDR), REQUIRED_ARG, 
 
3552
   0, (GET_ULONG | GET_ASK_ADDR), REQUIRED_ARG,
3561
3553
   300, 100, ULONG_MAX, 0, 100, 0},
3562
3554
  {"key_cache_block_size", OPT_KEY_CACHE_BLOCK_SIZE,
3563
3555
   "The default size of key cache blocks",
3709
3701
   (char**) &global_system_variables.net_write_timeout,
3710
3702
   (char**) &max_system_variables.net_write_timeout, 0, GET_ULONG,
3711
3703
   REQUIRED_ARG, NET_WRITE_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0},
3712
 
  { "old", OPT_OLD_MODE, "Use compatible behavior.", 
 
3704
  { "old", OPT_OLD_MODE, "Use compatible behavior.",
3713
3705
    (char**) &global_system_variables.old_mode,
3714
 
    (char**) &max_system_variables.old_mode, 0, GET_BOOL, NO_ARG, 
 
3706
    (char**) &max_system_variables.old_mode, 0, GET_BOOL, NO_ARG,
3715
3707
    0, 0, 0, 0, 0, 0},
3716
3708
  {"open_files_limit", OPT_OPEN_FILES_LIMIT,
3717
3709
   "If this is not 0, then mysqld will use this value to reserve file descriptors to use with setrlimit(). If this value is 0 then mysqld will reserve max_connections*5 or max_connections + table_cache*2 (whichever is larger) number of files.",
3858
3850
   1024L*128L, ULONG_MAX, 0, 1024, 0},
3859
3851
  { "time_format", OPT_TIME_FORMAT,
3860
3852
    "The TIME format (for future).",
3861
 
    (char**) &opt_date_time_formats[MYSQL_TIMESTAMP_TIME],
3862
 
    (char**) &opt_date_time_formats[MYSQL_TIMESTAMP_TIME],
 
3853
    (char**) &opt_date_time_formats[DRIZZLE_TIMESTAMP_TIME],
 
3854
    (char**) &opt_date_time_formats[DRIZZLE_TIMESTAMP_TIME],
3863
3855
    0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
3864
3856
  {"tmp_table_size", OPT_TMP_TABLE_SIZE,
3865
3857
   "If an internal in-memory temporary table exceeds this size, MySQL will"
4129
4121
Copyright (C) 2000 MySQL AB, by Monty and others\n\
4130
4122
This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n\
4131
4123
and you are welcome to modify and redistribute it under the GPL license\n\n\
4132
 
Starts the MySQL database server\n");
 
4124
Starts the Drizzle database server\n");
4133
4125
 
4134
4126
  printf("Usage: %s [OPTIONS]\n", my_progname);
4135
 
  if (!opt_verbose)
4136
 
    puts("\nFor more help options (several pages), use mysqld --verbose --help");
4137
 
  else
4138
4127
  {
 
4128
#ifdef FOO
4139
4129
  print_defaults(MYSQL_CONFIG_NAME,load_default_groups);
4140
4130
  puts("");
4141
4131
  set_ports();
 
4132
#endif
4142
4133
 
4143
4134
  /* Print out all the options including plugin supplied options */
4144
4135
  my_print_help_inc_plugins(my_long_options, sizeof(my_long_options)/sizeof(my_option));
4145
4136
 
4146
4137
  puts("\n\
4147
 
To see what values a running MySQL server is using, type\n\
4148
 
'mysqladmin variables' instead of 'mysqld --verbose --help'.");
 
4138
To see what values a running DrizzleD server is using, type\n\
 
4139
'drizzleadmin variables' instead of 'drizzled --help'.");
4149
4140
  }
4150
4141
}
4151
4142
 
4198
4189
  binlog_cache_use=  binlog_cache_disk_use= 0;
4199
4190
  max_used_connections= slow_launch_threads = 0;
4200
4191
  mysqld_user= mysqld_chroot= opt_init_file= opt_bin_logname = 0;
4201
 
  errmesg= 0;
4202
4192
  opt_mysql_tmpdir= my_bind_addr_str= NullS;
4203
4193
  memset(&mysql_tmpdir_list, 0, sizeof(mysql_tmpdir_list));
4204
4194
  memset(&global_status_var, 0, sizeof(global_status_var));
4286
4276
#else
4287
4277
  have_symlink=SHOW_OPTION_YES;
4288
4278
#endif
4289
 
#ifdef HAVE_CRYPT
4290
 
  have_crypt=SHOW_OPTION_YES;
4291
 
#else
4292
 
  have_crypt=SHOW_OPTION_NO;
4293
 
#endif
4294
4279
#ifdef HAVE_COMPRESS
4295
4280
  have_compress= SHOW_OPTION_YES;
4296
4281
#else
4363
4348
    test_flags= argument ? (uint) atoi(argument) : 0;
4364
4349
    opt_endinfo=1;
4365
4350
    break;
4366
 
  case (int) OPT_BIG_TABLES:
4367
 
    thd_startup_options|=OPTION_BIG_TABLES;
4368
 
    break;
4369
4351
  case (int) OPT_ISAM_LOG:
4370
4352
    opt_myisam_log=1;
4371
4353
    break;
4492
4474
      break;
4493
4475
    }
4494
4476
#endif
4495
 
  case (int) OPT_SKIP_NEW:
4496
 
    opt_specialflag|= SPECIAL_NO_NEW_FUNC;
4497
 
    delay_key_write_options= (uint) DELAY_KEY_WRITE_NONE;
4498
 
    myisam_concurrent_insert=0;
4499
 
    myisam_recover_options= HA_RECOVER_NONE;
4500
 
    my_use_symdir=0;
4501
 
    ha_open_options&= ~(HA_OPEN_ABORT_IF_CRASHED | HA_OPEN_DELAY_KEY_WRITE);
4502
 
    break;
4503
 
  case (int) OPT_SAFE:
4504
 
    opt_specialflag|= SPECIAL_SAFE_MODE;
4505
 
    delay_key_write_options= (uint) DELAY_KEY_WRITE_NONE;
4506
 
    myisam_recover_options= HA_RECOVER_DEFAULT;
4507
 
    ha_open_options&= ~(HA_OPEN_DELAY_KEY_WRITE);
4508
 
    break;
4509
4477
  case (int) OPT_SKIP_PRIOR:
4510
4478
    opt_specialflag|= SPECIAL_NO_PRIOR;
4511
4479
    break;
4512
 
  case (int) OPT_SKIP_SHOW_DB:
4513
 
    opt_skip_show_db=1;
4514
 
    opt_specialflag|=SPECIAL_SKIP_SHOW_DB;
4515
 
    break;
4516
4480
  case (int) OPT_WANT_CORE:
4517
4481
    test_flags |= TEST_CORE_ON_SIGNAL;
4518
4482
    break;
4524
4488
    break;
4525
4489
  case (int) OPT_BIND_ADDRESS:
4526
4490
    {
4527
 
      struct addrinfo *res_lst, hints;    
 
4491
      struct addrinfo *res_lst, hints;
4528
4492
 
4529
4493
      memset(&hints, 0, sizeof(struct addrinfo));
4530
4494
      hints.ai_socktype= SOCK_STREAM;
4531
4495
      hints.ai_protocol= IPPROTO_TCP;
4532
4496
 
4533
 
      if (getaddrinfo(argument, NULL, &hints, &res_lst) != 0) 
 
4497
      if (getaddrinfo(argument, NULL, &hints, &res_lst) != 0)
4534
4498
      {
4535
4499
        sql_print_error("Can't start server: cannot resolve hostname!");
4536
4500
        exit(1);
4758
4722
  if (opt_short_log_format)
4759
4723
    opt_specialflag|= SPECIAL_SHORT_LOG_FORMAT;
4760
4724
 
4761
 
  if (init_global_datetime_format(MYSQL_TIMESTAMP_DATE,
 
4725
  if (init_global_datetime_format(DRIZZLE_TIMESTAMP_DATE,
4762
4726
                                  &global_system_variables.date_format) ||
4763
 
      init_global_datetime_format(MYSQL_TIMESTAMP_TIME,
 
4727
      init_global_datetime_format(DRIZZLE_TIMESTAMP_TIME,
4764
4728
                                  &global_system_variables.time_format) ||
4765
 
      init_global_datetime_format(MYSQL_TIMESTAMP_DATETIME,
 
4729
      init_global_datetime_format(DRIZZLE_TIMESTAMP_DATETIME,
4766
4730
                                  &global_system_variables.datetime_format))
4767
4731
    exit(1);
4768
4732
 
4892
4856
  ulong res;
4893
4857
 
4894
4858
  const char **ptr;
4895
 
  
 
4859
 
4896
4860
  if ((res= find_bit_type(x, bit_lib)) == ~(ulong) 0)
4897
4861
  {
4898
4862
    ptr= bit_lib->type_names;