Commit 8b21d6f7 authored by jcole@tetra.spaceapes.com's avatar jcole@tetra.spaceapes.com
Browse files

Merge jcole@work.mysql.com:/home/bk/mysql

into tetra.spaceapes.com:/usr/home/jcole/bk/mysql
parents c28988e7 eaddff59
Loading
Loading
Loading
Loading
+287 −259
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ extern "C" { // Because of SCO 3.2V4.2
#include <errno.h>
#include <sys/stat.h>
#ifndef __GNU_LIBRARY__
#define __GNU_LIBRARY__				// Skipp warnings in getopt.h
#define __GNU_LIBRARY__				// Skip warnings in getopt.h
#endif
#include <getopt.h>
#ifdef HAVE_SYSENT_H
@@ -2141,59 +2141,68 @@ pthread_handler_decl(handle_flush,arg __attribute__((unused)))
** handle start options
******************************************************************************/

enum options {OPT_ISAM_LOG=256,OPT_SKIP_NEW,OPT_SKIP_GRANT,
	      OPT_SKIP_LOCK,OPT_ENABLE_LOCK,
	      OPT_USE_LOCKING,OPT_SOCKET,OPT_UPDATE_LOG, OPT_BIN_LOG,
	      OPT_SKIP_RESOLVE,OPT_SKIP_NETWORKING, OPT_BIN_LOG_INDEX,
	      OPT_BIND_ADDRESS,OPT_PID_FILE,OPT_SKIP_PRIOR,OPT_BIG_TABLES,
	      OPT_STANDALONE,OPT_ONE_THREAD,OPT_CONSOLE,
	      OPT_LOW_PRIORITY_UPDATES,OPT_SKIP_HOST_CACHE,OPT_LONG_FORMAT,
	      OPT_FLUSH, OPT_SAFE, OPT_BOOTSTRAP, OPT_SKIP_SHOW_DB,
	      OPT_TABLE_TYPE, OPT_INIT_FILE, OPT_DELAY_KEY_WRITE,
	      OPT_SLOW_QUERY_LOG, OPT_SKIP_DELAY_KEY_WRITE,
              OPT_CHARSETS_DIR,
	      OPT_BDB_HOME, OPT_BDB_LOG, OPT_BDB_TMP, OPT_BDB_NOSYNC,
              OPT_BDB_LOCK, OPT_BDB_SKIP, OPT_BDB_RECOVER,
              OPT_MASTER_HOST, OPT_MASTER_USER, OPT_MASTER_PASSWORD,
	      OPT_MASTER_PORT, OPT_MASTER_INFO_FILE, OPT_MASTER_CONNECT_RETRY,
              OPT_SQL_BIN_UPDATE_SAME, OPT_REPLICATE_DO_DB,
	      OPT_REPLICATE_IGNORE_DB, OPT_LOG_SLAVE_UPDATES,
              OPT_BINLOG_DO_DB, OPT_BINLOG_IGNORE_DB, OPT_WANT_CORE};

static struct option long_options[] =
{
enum options {
               OPT_ISAM_LOG=256,         OPT_SKIP_NEW, 
               OPT_SKIP_GRANT,           OPT_SKIP_LOCK, 
               OPT_ENABLE_LOCK,          OPT_USE_LOCKING,
               OPT_SOCKET,               OPT_UPDATE_LOG, 
               OPT_BIN_LOG,              OPT_SKIP_RESOLVE, 
               OPT_SKIP_NETWORKING,      OPT_BIN_LOG_INDEX,
               OPT_BIND_ADDRESS,         OPT_PID_FILE,
               OPT_SKIP_PRIOR,           OPT_BIG_TABLES,    
               OPT_STANDALONE,           OPT_ONE_THREAD,
               OPT_CONSOLE,              OPT_LOW_PRIORITY_UPDATES,
               OPT_SKIP_HOST_CACHE,      OPT_LONG_FORMAT,   
               OPT_FLUSH,                OPT_SAFE, 
               OPT_BOOTSTRAP,            OPT_SKIP_SHOW_DB,
               OPT_TABLE_TYPE,           OPT_INIT_FILE,   
               OPT_DELAY_KEY_WRITE,      OPT_SLOW_QUERY_LOG, 
               OPT_SKIP_DELAY_KEY_WRITE, OPT_CHARSETS_DIR,
               OPT_BDB_HOME,             OPT_BDB_LOG,  
               OPT_BDB_TMP,              OPT_BDB_NOSYNC,
               OPT_BDB_LOCK,             OPT_BDB_SKIP, 
               OPT_BDB_RECOVER,          OPT_MASTER_HOST,  
               OPT_MASTER_USER,          OPT_MASTER_PASSWORD,
               OPT_MASTER_PORT,          OPT_MASTER_INFO_FILE,
               OPT_MASTER_CONNECT_RETRY, OPT_SQL_BIN_UPDATE_SAME,
               OPT_REPLICATE_DO_DB,      OPT_REPLICATE_IGNORE_DB, 
               OPT_LOG_SLAVE_UPDATES,    OPT_BINLOG_DO_DB, 
               OPT_BINLOG_IGNORE_DB,     OPT_WANT_CORE
};

static struct option long_options[] = {
  {"ansi",                  no_argument,       0, 'a'},
  {"basedir",               required_argument, 0, 'b'},
#ifdef HAVE_BERKELEY_DB
  {"bdb-home",		required_argument, 0, OPT_BDB_HOME},
  {"bdb-lock-detect",	required_argument, 0, OPT_BDB_LOCK},
  {"bdb-logdir",	required_argument, 0, OPT_BDB_LOG},
  {"bdb-recover",	no_argument,	   0, OPT_BDB_RECOVER},
  {"bdb-no-sync",       no_argument,	   0, OPT_BDB_NOSYNC},
  {"bdb-tmpdir",	required_argument, 0, OPT_BDB_TMP},
  {"bdb-home",              required_argument, 0, (int) OPT_BDB_HOME},
  {"bdb-lock-detect",       required_argument, 0, (int) OPT_BDB_LOCK},
  {"bdb-logdir",            required_argument, 0, (int) OPT_BDB_LOG},
  {"bdb-recover",           no_argument,       0, (int) OPT_BDB_RECOVER},
  {"bdb-no-sync",           no_argument,       0, (int) OPT_BDB_NOSYNC},
  {"bdb-tmpdir",            required_argument, 0, (int) OPT_BDB_TMP},
#endif
  {"big-tables",            no_argument,       0, (int) OPT_BIG_TABLES},
  {"binlog-do-db", required_argument, 0, OPT_BINLOG_DO_DB},
  {"binlog-ignore-db", required_argument, 0, OPT_BINLOG_IGNORE_DB},
  {"bind-address",	required_argument, 0, OPT_BIND_ADDRESS},
  {"binlog-do-db",          required_argument, 0, (int) OPT_BINLOG_DO_DB},
  {"binlog-ignore-db",      required_argument, 0, (int) OPT_BINLOG_IGNORE_DB},
  {"bind-address",          required_argument, 0, (int) OPT_BIND_ADDRESS},
  {"bootstrap",             no_argument,       0, (int) OPT_BOOTSTRAP},
#ifdef __WIN__
  {"console",		no_argument,	  0,  OPT_CONSOLE},
  {"console",               no_argument,       0, (int) OPT_CONSOLE},
#endif
  {"core-file",		no_argument,	   0, OPT_WANT_CORE},
  {"core-file",             no_argument,       0, (int) OPT_WANT_CORE},
  {"chroot",                required_argument, 0, 'r'},
  {"character-sets-dir",required_argument,0,  OPT_CHARSETS_DIR},
  {"character-sets-dir",    required_argument, 0, (int) OPT_CHARSETS_DIR},
  {"datadir",               required_argument, 0, 'h'},
#ifndef DBUG_OFF
  {"debug",                 optional_argument, 0, '#'},
#endif
  {"default-character-set", required_argument, 0, 'C'},
  {"default-table-type",required_argument,0,OPT_TABLE_TYPE},
  {"default-table-type",    required_argument, 0, (int) OPT_TABLE_TYPE},
  {"delay-key-write-for-all-tables",
                            no_argument,       0, (int) OPT_DELAY_KEY_WRITE},
  {"enable-locking",        no_argument,       0, (int) OPT_ENABLE_LOCK},
  {"exit-info",             optional_argument, 0, 'T'},
  {"flush",		no_argument,	  0,  OPT_FLUSH},
  {"flush",                 no_argument,       0, (int) OPT_FLUSH},
  {"help",                  no_argument,       0, '?'},
  {"init-file",             required_argument, 0, (int) OPT_INIT_FILE},
  {"log",                   optional_argument, 0, 'l'},
@@ -2215,17 +2224,17 @@ static struct option long_options[] =
  {"new",                   no_argument,       0, 'n'},
  {"old-protocol",          no_argument,       0, 'o'},
#ifndef DBUG_OFF
  {"one-thread",	no_argument,	   0, OPT_ONE_THREAD},
  {"one-thread",            no_argument,       0, (int) OPT_ONE_THREAD},
#endif
  {"pid-file",              required_argument, 0, (int) OPT_PID_FILE},
  {"port",                  required_argument, 0, 'P'},
  {"replicate-do-db", required_argument, 0, OPT_REPLICATE_DO_DB},
  {"replicate-ignore-db", required_argument, 0, OPT_REPLICATE_IGNORE_DB},
  {"replicate-do-db",       required_argument, 0, (int) OPT_REPLICATE_DO_DB},
  {"replicate-ignore-db",   required_argument, 0, (int) OPT_REPLICATE_IGNORE_DB},
  {"safe-mode",             no_argument,       0, (int) OPT_SAFE},
  {"socket",                required_argument, 0, (int) OPT_SOCKET},
  {"set-variable",          required_argument, 0, 'O'},
#ifdef HAVE_BERKELEY_DB
  {"skip-bdb",		no_argument,	   0, OPT_BDB_SKIP},
  {"skip-bdb",              no_argument,       0, (int) OPT_BDB_SKIP},
#endif
  {"skip-delay-key-write",  no_argument,       0, (int) OPT_SKIP_DELAY_KEY_WRITE},
  {"skip-grant-tables",     no_argument,       0, (int) OPT_SKIP_GRANT},
@@ -2252,65 +2261,82 @@ static struct option long_options[] =
};

CHANGEABLE_VAR changeable_vars[] = {
  { "back_log", (long*) &back_log,50,1,65535,0,1},
  { "back_log",                (long*) &back_log, 
      50, 1, 65535, 0, 1 },
#ifdef HAVE_BERKELEY_DB
  { "bdb_cache_size",  (long*) &berkeley_cache_size, KEY_CACHE_SIZE,
      20*1024, (long) ~0, 0, IO_SIZE},
  { "bdb_cache_size",          (long*) &berkeley_cache_size, 
      KEY_CACHE_SIZE, 20*1024, (long) ~0, 0, IO_SIZE },
#endif
  { "connect_timeout", (long*) &connect_timeout,CONNECT_TIMEOUT,2,65535,0,1},
  { "connect_timeout",         (long*) &connect_timeout,
      CONNECT_TIMEOUT, 2, 65535, 0, 1 },
  { "delayed_insert_timeout", (long*) &delayed_insert_timeout, 
      DELAYED_WAIT_TIMEOUT, 1, ~0L, 0, 1 },
  { "delayed_insert_limit",    (long*) &delayed_insert_limit, 
      DELAYED_LIMIT, 1, ~0L, 0, 1 },
  { "delayed_queue_size", (long*) &delayed_queue_size,DELAYED_QUEUE_SIZE,1,
    ~0L,0,1},
  { "flush_time", (long*) &flush_time,FLUSH_TIME,0,~0L,0,1},
  { "delayed_queue_size",      (long*) &delayed_queue_size,
      DELAYED_QUEUE_SIZE, 1, ~0L, 0, 1 },
  { "flush_time",              (long*) &flush_time,
      FLUSH_TIME, 0, ~0L, 0, 1 },
  { "interactive_timeout",     (long*) &net_interactive_timeout,
      NET_WAIT_TIMEOUT, 1, 31*24*60*60, 0, 1 },
  { "join_buffer_size", (long*) &join_buff_size,128*1024L,
    IO_SIZE*2+MALLOC_OVERHEAD,~0L,MALLOC_OVERHEAD,IO_SIZE },
  { "key_buffer_size", (long*) &keybuff_size,KEY_CACHE_SIZE,MALLOC_OVERHEAD,
    (long) ~0, MALLOC_OVERHEAD, IO_SIZE },
  { "long_query_time", (long*) &long_query_time,10,1,~0L,0,1},
  { "lower_case_table_names",  (long*) &lower_case_table_names,IF_WIN(1,0),
    0,1,0,1},
  { "max_allowed_packet",(long*) &max_allowed_packet,1024*1024L,80,
      17*1024*1024L, MALLOC_OVERHEAD,1024},
  { "max_connections", (long*) &max_connections,100,1,16384,0,1},
  { "max_connect_errors", (long*) &max_connect_errors,MAX_CONNECT_ERRORS,1,
    ~0L,0,1},
  { "max_delayed_threads", (long*) &max_insert_delayed_threads,20,1,
    16384,0,1},
  { "max_heap_table_size",(long*) &max_heap_table_size,16*1024*1024L,16384,~0L,
    MALLOC_OVERHEAD,1024},
  { "max_join_size",(long*) &max_join_size,~0L,1,~0L,0,1},
  { "max_sort_length",(long*) &max_item_sort_length,1024,4,8192*1024L,0,1},
  { "max_tmp_tables",(long*) &max_tmp_tables,32,1,~0L,0,1},
  { "max_write_lock_count",(long*) &max_write_lock_count,~0L,1,~0L,0,1},
  { "myisam_sort_buffer_size", (long*) &myisam_sort_buffer_size,8192*1024,4,
      ~0L,0,1},
  { "net_buffer_length",(long*) &net_buffer_length,16384,1024,1024*1024L,
    MALLOC_OVERHEAD,1024},
  { "net_retry_count",(long*) &mysqld_net_retry_count,MYSQLD_NET_RETRY_COUNT,
    1,~0L, 0,1},
  { "net_read_timeout",  (long*) &net_read_timeout, NET_READ_TIMEOUT,1,65535,0,1},
  { "net_write_timeout", (long*) &net_write_timeout,NET_WRITE_TIMEOUT,1,65535,0,1},
  { "query_buffer_size", (long*) &query_buff_size,0,MALLOC_OVERHEAD,
    (long) ~0, MALLOC_OVERHEAD, IO_SIZE },
  { "record_buffer", (long*) &my_default_record_cache_size,128*1024L,
    IO_SIZE*2+MALLOC_OVERHEAD,~0L,MALLOC_OVERHEAD,IO_SIZE },
  { "slow_launch_time", (long*) &slow_launch_time, 2L,
    0L,~0L,0,1 },
  { "sort_buffer", (long*) &sortbuff_size,MAX_SORT_MEMORY,
    MIN_SORT_MEMORY+MALLOC_OVERHEAD*2,~0L,MALLOC_OVERHEAD,1 },
  { "table_cache",  (long*) &table_cache_size,64,1,16384,0,1},
  { "thread_concurrency", (long*) &concurrency,DEFAULT_CONCURRENCY,1,512,0,1},
  { "thread_cache_size", (long*) &thread_cache_size, 0,1,16384,0,1},
  { "tmp_table_size",  (long*) &tmp_table_size,1024*1024L,1024,~0L,
    MALLOC_OVERHEAD,1},
  { "thread_stack", (long*) &thread_stack,1024*64,1024*32,~0L,0,1024},
  { "wait_timeout", (long*) &net_wait_timeout,NET_WAIT_TIMEOUT,1,~0L,0,1},
  { NullS,(long*) 0,0,0,0,0,0,} };
  { "join_buffer_size",        (long*) &join_buff_size,
      128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, ~0L, MALLOC_OVERHEAD, IO_SIZE },
  { "key_buffer_size",         (long*) &keybuff_size,
      KEY_CACHE_SIZE, MALLOC_OVERHEAD, (long) ~0, MALLOC_OVERHEAD, IO_SIZE },
  { "long_query_time",         (long*) &long_query_time,
      10, 1, ~0L, 0, 1 },
  { "lower_case_table_names",  (long*) &lower_case_table_names,
      IF_WIN(1,0), 0, 1, 0, 1 },
  { "max_allowed_packet",      (long*) &max_allowed_packet,
      1024*1024L, 80, 17*1024*1024L, MALLOC_OVERHEAD, 1024 },
  { "max_connections",         (long*) &max_connections,
      100, 1, 16384, 0, 1 },
  { "max_connect_errors",      (long*) &max_connect_errors,
      MAX_CONNECT_ERRORS, 1, ~0L, 0, 1 },
  { "max_delayed_threads",     (long*) &max_insert_delayed_threads,
      20, 1, 16384, 0, 1 },
  { "max_heap_table_size",     (long*) &max_heap_table_size,
      16*1024*1024L, 16384, ~0L, MALLOC_OVERHEAD, 1024 },
  { "max_join_size",           (long*) &max_join_size,
      ~0L, 1, ~0L, 0, 1 },
  { "max_sort_length",         (long*) &max_item_sort_length,
      1024, 4, 8192*1024L, 0, 1 },
  { "max_tmp_tables",          (long*) &max_tmp_tables,
      32, 1, ~0L, 0, 1 },
  { "max_write_lock_count",    (long*) &max_write_lock_count,
      ~0L, 1, ~0L, 0, 1 },
  { "myisam_sort_buffer_size", (long*) &myisam_sort_buffer_size,
      8192*1024, 4, ~0L, 0, 1 },
  { "net_buffer_length",       (long*) &net_buffer_length,
      16384, 1024, 1024*1024L, MALLOC_OVERHEAD, 1024 },
  { "net_retry_count",         (long*) &mysqld_net_retry_count,
      MYSQLD_NET_RETRY_COUNT, 1, ~0L, 0, 1 },
  { "net_read_timeout",        (long*) &net_read_timeout, 
      NET_READ_TIMEOUT, 1, 65535, 0, 1 },
  { "net_write_timeout",       (long*) &net_write_timeout,
      NET_WRITE_TIMEOUT, 1, 65535, 0, 1 },
  { "query_buffer_size",       (long*) &query_buff_size,
      0, MALLOC_OVERHEAD, (long) ~0, MALLOC_OVERHEAD, IO_SIZE },
  { "record_buffer",           (long*) &my_default_record_cache_size,
      128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, ~0L, MALLOC_OVERHEAD, IO_SIZE },
  { "slow_launch_time",        (long*) &slow_launch_time, 
      2L, 0L, ~0L, 0, 1 },
  { "sort_buffer",             (long*) &sortbuff_size,
      MAX_SORT_MEMORY, MIN_SORT_MEMORY+MALLOC_OVERHEAD*2, ~0L, MALLOC_OVERHEAD, 1 },
  { "table_cache",             (long*) &table_cache_size,
      64, 1, 16384, 0, 1 },
  { "thread_concurrency",      (long*) &concurrency,
      DEFAULT_CONCURRENCY, 1, 512, 0, 1 },
  { "thread_cache_size",       (long*) &thread_cache_size,
      0, 1, 16384, 0, 1 },
  { "tmp_table_size",          (long*) &tmp_table_size,
      1024*1024L, 1024, ~0L, MALLOC_OVERHEAD, 1 },
  { "thread_stack",            (long*) &thread_stack,
      1024*64, 1024*32, ~0L, 0, 1024 },
  { "wait_timeout",            (long*) &net_wait_timeout,
      NET_WAIT_TIMEOUT, 1, ~0L, 0, 1 },
  { NullS, (long*) 0, 0, 0, 0, 0, 0}
};


struct show_var_st init_vars[]= {
@@ -2369,7 +2395,7 @@ struct show_var_st init_vars[]= {
  {"socket",                   (char*) &mysql_unix_port,              SHOW_CHAR_PTR},
  {"sort_buffer",              (char*) &sortbuff_size,                SHOW_LONG},
  {"table_cache",              (char*) &table_cache_size,             SHOW_LONG},
  {"table_type",  (char*) (&default_table_type_name), SHOW_CHAR_PTR},
  {"table_type",               (char*) &default_table_type_name,      SHOW_CHAR_PTR},
#ifdef HAVE_THR_SETCONCURRENCY
  {"thread_concurrency",       (char*) &concurrency,                  SHOW_LONG},
#endif
@@ -2444,7 +2470,8 @@ static void usage(void)
{
  print_version();
  puts("Copyright (C) 2000 MySQL AB & MySQL Finland AB, by Monty and others");
  puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
  puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,");
  puts("and you are welcome to modify and redistribute it under the GPL license\n");
  puts("Starts the MySQL server\n");

  printf("Usage: %s [OPTIONS]\n", my_progname);
@@ -2489,7 +2516,8 @@ static void usage(void)
  --log-long-format	Log some extra information to update log\n\
  --low-priority-updates INSERT/DELETE/UPDATE has lower priority than selects\n\
  --log-slow-queries=[file]\n\
			Log slow queries to this log file\n\
			Log slow queries to this log file.  Defaults logging\n\
                        to hostname-slow.log\n\
  --pid-file=path	Pid file used by safe_mysqld\n\
  -P, --port=...	Port number to use for connection\n\
  -n, --new		Use very new possible 'unsafe' functions\n\