317
312
uint64_t slow_launch_time;
318
313
uint64_t slave_open_temp_tables;
319
314
uint64_t open_files_limit;
320
uint64_t max_binlog_size;
321
uint64_t max_relay_log_size;
322
uint64_t slave_net_timeout;
323
uint64_t slave_trans_retries;
324
bool slave_allow_batching;
325
ulong slave_exec_mode_options;
326
const char *slave_exec_mode_str= "STRICT";
327
315
uint64_t thread_pool_size= 0;
328
uint64_t binlog_cache_size= 0;
329
uint64_t max_binlog_cache_size= 0;
330
316
uint32_t refresh_version; /* Increments on each reload */
331
317
uint64_t aborted_threads;
332
318
uint64_t aborted_connects;
333
uint64_t binlog_cache_use= 0;
334
uint64_t binlog_cache_disk_use= 0;
335
319
uint64_t max_connections;
336
320
uint64_t max_connect_errors;
337
321
ulong thread_id=1L;
338
322
pid_t current_pid;
339
323
uint64_t slow_launch_threads= 0;
340
uint64_t sync_binlog_period;
341
324
uint64_t expire_logs_days= 0;
343
326
const double log_10[] = {
1768
1735
{"alter_table", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_ALTER_TABLE]), SHOW_LONG_STATUS},
1769
1736
{"analyze", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_ANALYZE]), SHOW_LONG_STATUS},
1770
1737
{"begin", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_BEGIN]), SHOW_LONG_STATUS},
1771
{"binlog", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_BINLOG_BASE64_EVENT]), SHOW_LONG_STATUS},
1772
1738
{"change_db", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_CHANGE_DB]), SHOW_LONG_STATUS},
1773
{"change_master", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_CHANGE_MASTER]), SHOW_LONG_STATUS},
1774
1739
{"check", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_CHECK]), SHOW_LONG_STATUS},
1775
1740
{"checksum", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_CHECKSUM]), SHOW_LONG_STATUS},
1776
1741
{"commit", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_COMMIT]), SHOW_LONG_STATUS},
1790
1755
{"load", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_LOAD]), SHOW_LONG_STATUS},
1791
1756
{"lock_tables", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_LOCK_TABLES]), SHOW_LONG_STATUS},
1792
1757
{"optimize", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_OPTIMIZE]), SHOW_LONG_STATUS},
1793
{"purge", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_PURGE]), SHOW_LONG_STATUS},
1794
{"purge_before_date", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_PURGE_BEFORE]), SHOW_LONG_STATUS},
1795
1758
{"release_savepoint", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_RELEASE_SAVEPOINT]), SHOW_LONG_STATUS},
1796
1759
{"rename_table", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_RENAME_TABLE]), SHOW_LONG_STATUS},
1797
1760
{"repair", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_REPAIR]), SHOW_LONG_STATUS},
1798
1761
{"replace", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_REPLACE]), SHOW_LONG_STATUS},
1799
1762
{"replace_select", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_REPLACE_SELECT]), SHOW_LONG_STATUS},
1800
{"reset", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_RESET]), SHOW_LONG_STATUS},
1801
1763
{"rollback", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_ROLLBACK]), SHOW_LONG_STATUS},
1802
1764
{"rollback_to_savepoint",(char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_ROLLBACK_TO_SAVEPOINT]), SHOW_LONG_STATUS},
1803
1765
{"savepoint", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SAVEPOINT]), SHOW_LONG_STATUS},
1804
1766
{"select", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SELECT]), SHOW_LONG_STATUS},
1805
1767
{"set_option", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SET_OPTION]), SHOW_LONG_STATUS},
1806
{"show_binlogs", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_BINLOGS]), SHOW_LONG_STATUS},
1807
1768
{"show_create_db", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_CREATE_DB]), SHOW_LONG_STATUS},
1808
1769
{"show_create_table", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_CREATE]), SHOW_LONG_STATUS},
1809
1770
{"show_databases", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_DATABASES]), SHOW_LONG_STATUS},
1811
1772
{"show_errors", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_ERRORS]), SHOW_LONG_STATUS},
1812
1773
{"show_fields", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_FIELDS]), SHOW_LONG_STATUS},
1813
1774
{"show_keys", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_KEYS]), SHOW_LONG_STATUS},
1814
{"show_master_status", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_MASTER_STAT]), SHOW_LONG_STATUS},
1815
1775
{"show_open_tables", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_OPEN_TABLES]), SHOW_LONG_STATUS},
1816
1776
{"show_plugins", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_PLUGINS]), SHOW_LONG_STATUS},
1817
1777
{"show_processlist", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_PROCESSLIST]), SHOW_LONG_STATUS},
1818
{"show_slave_status", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_SLAVE_STAT]), SHOW_LONG_STATUS},
1819
1778
{"show_status", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_STATUS]), SHOW_LONG_STATUS},
1820
1779
{"show_table_status", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_TABLE_STATUS]), SHOW_LONG_STATUS},
1821
1780
{"show_tables", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_TABLES]), SHOW_LONG_STATUS},
1822
1781
{"show_variables", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_VARIABLES]), SHOW_LONG_STATUS},
1823
1782
{"show_warnings", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_WARNS]), SHOW_LONG_STATUS},
1824
{"slave_start", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SLAVE_START]), SHOW_LONG_STATUS},
1825
{"slave_stop", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SLAVE_STOP]), SHOW_LONG_STATUS},
1826
1783
{"truncate", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_TRUNCATE]), SHOW_LONG_STATUS},
1827
1784
{"unlock_tables", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_UNLOCK_TABLES]), SHOW_LONG_STATUS},
1828
1785
{"update", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_UPDATE]), SHOW_LONG_STATUS},
2121
2060
unireg_abort(1);
2124
if (opt_log_slave_updates && replicate_same_server_id)
2126
errmsg_printf(ERRMSG_LVL_ERROR, _("using --replicate-same-server-id in conjunction with "
2127
"--log-slave-updates is impossible, it would lead to "
2128
"infinite loops in this server."));
2134
char buf[FN_REFLEN];
2136
ln= drizzle_bin_log.generate_name(opt_bin_logname, "-bin", 1, buf);
2137
if (!opt_bin_logname && !opt_binlog_index_name)
2140
User didn't give us info to name the binlog index file.
2141
Picking `hostname`-bin.index like did in 4.x, causes replication to
2142
fail if the hostname is changed later. So, we would like to instead
2143
require a name. But as we don't want to break many existing setups, we
2144
only give warning, not error.
2146
errmsg_printf(ERRMSG_LVL_WARN, _("No argument was provided to --log-bin, and "
2147
"--log-bin-index was not used; so replication "
2148
"may break when this Drizzle server acts as a "
2149
"master and has his hostname changed!! Please "
2150
"use '--log-bin=%s' to avoid this problem."), ln);
2154
free(opt_bin_logname);
2155
opt_bin_logname=strdup(buf);
2156
if (opt_bin_logname == NULL)
2158
errmsg_printf(ERRMSG_LVL_ERROR, _("Out of memory in init_server_components."));
2162
if (drizzle_bin_log.open_index_file(opt_binlog_index_name, ln))
2168
2063
/* call ha_init_key_cache() on all key caches to init them */
2169
2064
process_key_caches(&ha_init_key_cache);
2791
2649
{"help", '?', N_("Display this help and exit."),
2792
2650
(char**) &opt_help, (char**) &opt_help, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
2794
{"abort-slave-event-count", OPT_ABORT_SLAVE_EVENT_COUNT,
2795
N_("Option used by mysql-test for debugging and testing of replication."),
2796
(char**) &abort_slave_event_count, (char**) &abort_slave_event_count,
2797
0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
2798
2652
{"auto-increment-increment", OPT_AUTO_INCREMENT,
2799
2653
N_("Auto-increment columns are incremented by this"),
2800
2654
(char**) &global_system_variables.auto_increment_increment,
2814
2668
{"bind-address", OPT_BIND_ADDRESS, N_("IP address to bind to."),
2815
2669
(char**) &my_bind_addr_str, (char**) &my_bind_addr_str, 0, GET_STR,
2816
2670
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
2817
{"binlog-row-event-max-size", OPT_BINLOG_ROWS_EVENT_MAX_SIZE,
2818
N_("The maximum size of a row-based binary log event in bytes. Rows will "
2819
"be grouped into events smaller than this size if possible. "
2820
"The value has to be a multiple of 256."),
2821
(char**) &opt_binlog_rows_event_max_size,
2822
(char**) &opt_binlog_rows_event_max_size, 0,
2823
GET_ULL, REQUIRED_ARG,
2824
/* def_value */ 1024, /* min_value */ 256, /* max_value */ ULONG_MAX,
2825
/* sub_size */ 0, /* block_size */ 256,
2828
2671
{"character-set-filesystem", OPT_CHARACTER_SET_FILESYSTEM,
2829
2672
N_("Set the filesystem character set."),
2830
2673
(char**) &character_set_filesystem_name,
2869
2712
{"delay-key-write", OPT_DELAY_KEY_WRITE,
2870
2713
N_("Type of DELAY_KEY_WRITE."),
2871
2714
0,0,0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
2872
{"disconnect-slave-event-count", OPT_DISCONNECT_SLAVE_EVENT_COUNT,
2873
N_("Option used by mysql-test for debugging and testing of replication."),
2874
(char**) &disconnect_slave_event_count,
2875
(char**) &disconnect_slave_event_count, 0, GET_INT, REQUIRED_ARG, 0, 0, 0,
2877
2715
#ifdef HAVE_STACK_TRACE_ON_SEGV
2878
2716
{"enable-pstack", OPT_DO_PSTACK,
2879
2717
N_("Print a symbolic stack trace on failure."),
2929
2763
N_("Log connections and queries to file."),
2930
2764
(char**) &opt_logname,
2931
2765
(char**) &opt_logname, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
2932
{"log-bin", OPT_BIN_LOG,
2933
N_("Log update queries in binary format. Optional argument is the "
2934
"location for the binary log files.(Strongly "
2935
"recommended to avoid replication problems if server's hostname "
2937
(char**) &opt_bin_logname, (char**) &opt_bin_logname, 0, GET_STR_ALLOC,
2938
OPT_ARG, 0, 0, 0, 0, 0, 0},
2939
{"log-bin-index", OPT_BIN_LOG_INDEX,
2940
N_("File that holds the names for last binary log files."),
2941
(char**) &opt_binlog_index_name, (char**) &opt_binlog_index_name, 0, GET_STR,
2942
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
2943
2766
{"log-isam", OPT_ISAM_LOG,
2944
2767
N_("Log all MyISAM changes to file."),
2945
2768
(char**) &myisam_log_filename, (char**) &myisam_log_filename, 0, GET_STR,
2946
2769
OPT_ARG, 0, 0, 0, 0, 0, 0},
2947
{"log-slave-updates", OPT_LOG_SLAVE_UPDATES,
2948
N_("Tells the slave to log the updates from the slave thread to the binary "
2949
"log. You will need to turn it on if you plan to "
2950
"daisy-chain the slaves."),
2951
(char**) &opt_log_slave_updates, (char**) &opt_log_slave_updates,
2953
NO_ARG, 0, 0, 0, 0, 0, 0},
2954
{"log-tc", OPT_LOG_TC,
2955
N_("Path to transaction coordinator log (used for transactions that affect "
2956
"more than one storage engine, when binary log is disabled)"),
2957
(char**) &opt_tc_log_file, (char**) &opt_tc_log_file, 0, GET_STR,
2958
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
2960
{"log-tc-size", OPT_LOG_TC_SIZE,
2961
N_("Size of transaction coordinator log."),
2962
(char**) &opt_tc_log_size, (char**) &opt_tc_log_size, 0, GET_ULL,
2963
REQUIRED_ARG, TC_LOG_MIN_SIZE, TC_LOG_MIN_SIZE, ULONG_MAX, 0,
2964
TC_LOG_PAGE_SIZE, 0},
2966
2770
{"log-warnings", 'W',
2967
2771
N_("Log some not critical warnings to the log file."),
2968
2772
(char**) &global_system_variables.log_warnings,
2969
2773
(char**) &max_system_variables.log_warnings, 0, GET_ULONG, OPT_ARG, 1, 0, 0,
2971
{"master-info-file", OPT_MASTER_INFO_FILE,
2972
N_("The location and name of the file that remembers the master and "
2973
"where the I/O replication thread is in the master's binlogs."),
2974
(char**) &master_info_file, (char**) &master_info_file, 0, GET_STR,
2975
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
2976
{"master-retry-count", OPT_MASTER_RETRY_COUNT,
2977
N_("The number of tries the slave will make to connect to the master "
2978
"before giving up."),
2979
(char**) &master_retry_count, (char**) &master_retry_count, 0, GET_ULONG,
2980
REQUIRED_ARG, 3600*24, 0, 0, 0, 0, 0},
2981
{"max-binlog-dump-events", OPT_MAX_BINLOG_DUMP_EVENTS,
2982
N_("Option used by mysql-test for debugging and testing of replication."),
2983
(char**) &max_binlog_dump_events, (char**) &max_binlog_dump_events, 0,
2984
GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
2985
2775
{"memlock", OPT_MEMLOCK,
2986
2776
N_("Lock drizzled in memory."),
2987
2777
(char**) &locked_in_memory,
3016
2806
"(Default: no wait)"),
3017
2807
(char**) &drizzled_port_timeout,
3018
2808
(char**) &drizzled_port_timeout, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
3019
{"relay-log", OPT_RELAY_LOG,
3020
N_("The location and name to use for relay logs."),
3021
(char**) &opt_relay_logname, (char**) &opt_relay_logname, 0,
3022
GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
3023
{"relay-log-index", OPT_RELAY_LOG_INDEX,
3024
N_("The location and name to use for the file that keeps a list of the "
3025
"last relay logs."),
3026
(char**) &opt_relaylog_index_name, (char**) &opt_relaylog_index_name, 0,
3027
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
3028
{"relay-log-info-file", OPT_RELAY_LOG_INFO_FILE,
3029
N_("The location and name of the file that remembers where the SQL "
3030
"replication thread is in the relay logs."),
3031
(char**) &relay_log_info_file, (char**) &relay_log_info_file, 0, GET_STR,
3032
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
3033
{"replicate-same-server-id", OPT_REPLICATE_SAME_SERVER_ID,
3034
N_("In replication, if set to 1, do not skip events having our server id. "
3035
"Default value is 0 (to break infinite loops in circular replication). "
3036
"Can't be set to 1 if --log-slave-updates is used."),
3037
(char**) &replicate_same_server_id,
3038
(char**) &replicate_same_server_id,
3039
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
3040
// In replication, we may need to tell the other servers how to connect
3041
{"report-host", OPT_REPORT_HOST,
3042
N_("Hostname or IP of the slave to be reported to to the master during "
3043
"slave registration. Will appear in the output of SHOW SLAVE HOSTS. "
3044
"Leave unset if you do not want the slave to register itself with the "
3045
"master. Note that it is not sufficient for the master to simply read "
3046
"the IP of the slave off the socket once the slave connects. Due to NAT "
3047
"and other routing issues, that IP may not be valid for connecting to "
3048
"the slave from the master or other hosts."),
3049
(char**) &report_host, (char**) &report_host, 0, GET_STR, REQUIRED_ARG, 0, 0,
3051
2809
{"safe-mode", OPT_SAFE,
3052
2810
N_("Skip some optimize stages (for testing)."),
3053
2811
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
3064
2822
{"skip-new", OPT_SKIP_NEW,
3065
2823
N_("Don't use new, possible wrong routines."),
3066
2824
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
3067
{"skip-slave-start", OPT_SKIP_SLAVE_START,
3068
N_("If set, slave is not started automatically."),
3069
(char**) &opt_skip_slave_start,
3070
(char**) &opt_skip_slave_start, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
3071
2825
{"skip-stack-trace", OPT_SKIP_STACK_TRACE,
3072
2826
N_("Don't print a stack trace on failure."),
3073
2827
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
3076
2830
N_("Don't give threads different priorities."),
3077
2831
0, 0, 0, GET_NO_ARG, NO_ARG,
3078
2832
DEFAULT_SKIP_THREAD_PRIORITY, 0, 0, 0, 0, 0},
3079
{"slave-load-tmpdir", OPT_SLAVE_LOAD_TMPDIR,
3080
N_("The location where the slave should put its temporary files when "
3081
"replicating a LOAD DATA INFILE command."),
3082
(char**) &slave_load_tmpdir, (char**) &slave_load_tmpdir, 0, GET_STR_ALLOC,
3083
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
3084
{"slave-skip-errors", OPT_SLAVE_SKIP_ERRORS,
3085
N_("Tells the slave thread to continue replication when a query event "
3086
"returns an error from the provided list."),
3087
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
3088
{"slave-exec-mode", OPT_SLAVE_EXEC_MODE,
3089
N_("Modes for how replication events should be executed. Legal values are "
3090
"STRICT (default) and IDEMPOTENT. In IDEMPOTENT mode, replication will "
3091
"not stop for operations that are idempotent. In STRICT mode, "
3092
"replication will stop on any unexpected difference between the master "
3094
(char**) &slave_exec_mode_str, (char**) &slave_exec_mode_str,
3095
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
3096
{"sql-bin-update-same", OPT_SQL_BIN_UPDATE_SAME,
3098
0, 0, 0, GET_DISABLED, NO_ARG, 0, 0, 0, 0, 0, 0},
3099
2833
{"symbolic-links", 's',
3100
2834
N_("Enable symbolic link support."),
3101
2835
(char**) &my_use_symdir, (char**) &my_use_symdir, 0, GET_BOOL, NO_ARG,
3110
2844
"safe-replicable."),
3111
2845
(char**) &global_system_variables.sysdate_is_now,
3112
2846
0, 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0},
3113
{"tc-heuristic-recover", OPT_TC_HEURISTIC_RECOVER,
3114
N_("Decision to use in heuristic recover process. Possible values are "
3115
"COMMIT or ROLLBACK."),
3116
(char**) &opt_tc_heuristic_recover, (char**) &opt_tc_heuristic_recover,
3117
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
3118
2847
{"temp-pool", OPT_TEMP_POOL,
3119
2848
N_("Using this option will cause most temporary files created to use a "
3120
2849
"small set of names, rather than a unique name for each new file."),
3147
2876
"requests in a very short time."),
3148
2877
(char**) &back_log, (char**) &back_log, 0, GET_UINT,
3149
2878
REQUIRED_ARG, 50, 1, 65535, 0, 1, 0 },
3150
{ "binlog_cache_size", OPT_BINLOG_CACHE_SIZE,
3151
N_("The size of the cache to hold the SQL statements for the binary log "
3152
"during a transaction. If you often use big, multi-statement "
3153
"transactions you can increase this to get more performance."),
3154
(char**) &binlog_cache_size, (char**) &binlog_cache_size, 0, GET_ULL,
3155
REQUIRED_ARG, 32*1024L, IO_SIZE, ULONG_MAX, 0, IO_SIZE, 0},
3156
2879
{ "bulk_insert_buffer_size", OPT_BULK_INSERT_BUFFER_SIZE,
3157
2880
N_("Size of tree cache used in bulk insert optimization. Note that this is "
3158
2881
"a limit per thread!"),
3185
2908
(char**) &global_system_variables.div_precincrement,
3186
2909
(char**) &max_system_variables.div_precincrement, 0, GET_UINT,
3187
2910
REQUIRED_ARG, 4, 0, DECIMAL_MAX_SCALE, 0, 0, 0},
3188
{ "expire_logs_days", OPT_EXPIRE_LOGS_DAYS,
3189
N_("If non-zero, binary logs will be purged after expire_logs_days "
3190
"days; possible purges happen at startup and at binary log rotation."),
3191
(char**) &expire_logs_days,
3192
(char**) &expire_logs_days, 0, GET_ULL,
3193
REQUIRED_ARG, 0, 0, 99, 0, 1, 0},
3194
2911
{ "group_concat_max_len", OPT_GROUP_CONCAT_MAX_LEN,
3195
2912
N_("The maximum length of the result of function group_concat."),
3196
2913
(char**) &global_system_variables.group_concat_max_len,
3248
2965
(char**) &global_system_variables.max_allowed_packet,
3249
2966
(char**) &max_system_variables.max_allowed_packet, 0, GET_ULONG,
3250
2967
REQUIRED_ARG, 1024*1024L, 1024, 1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0},
3251
{"max_binlog_cache_size", OPT_MAX_BINLOG_CACHE_SIZE,
3252
N_("Can be used to restrict the total size used to cache a "
3253
"multi-transaction query."),
3254
(char**) &max_binlog_cache_size, (char**) &max_binlog_cache_size, 0,
3255
GET_ULL, REQUIRED_ARG, ULONG_MAX, IO_SIZE, ULONG_MAX, 0, IO_SIZE, 0},
3256
{"max_binlog_size", OPT_MAX_BINLOG_SIZE,
3257
N_("Binary log will be rotated automatically when the size exceeds this "
3258
"value. Will also apply to relay logs if max_relay_log_size is 0. "
3259
"The minimum value for this variable is 4096."),
3260
(char**) &max_binlog_size, (char**) &max_binlog_size, 0, GET_ULONG,
3261
REQUIRED_ARG, 1024*1024L*1024L, IO_SIZE, 1024*1024L*1024L, 0, IO_SIZE, 0},
3262
2968
{"max_connect_errors", OPT_MAX_CONNECT_ERRORS,
3263
2969
N_("If there is more than this number of interrupted connections from a "
3264
2970
"host this host will be blocked from further connections."),
3293
2999
(char**) &global_system_variables.max_length_for_sort_data,
3294
3000
(char**) &max_system_variables.max_length_for_sort_data, 0, GET_ULL,
3295
3001
REQUIRED_ARG, 1024, 4, 8192*1024L, 0, 1, 0},
3296
{"max_relay_log_size", OPT_MAX_RELAY_LOG_SIZE,
3297
N_("If non-zero: relay log will be rotated automatically when the size "
3298
"exceeds this value; if zero (the default): when the size exceeds "
3299
"max_binlog_size. 0 excepted, the minimum value for this variable "
3301
(char**) &max_relay_log_size, (char**) &max_relay_log_size, 0, GET_ULONG,
3302
REQUIRED_ARG, 0L, 0L, 1024*1024L*1024L, 0, IO_SIZE, 0},
3303
3002
{ "max_seeks_for_key", OPT_MAX_SEEKS_FOR_KEY,
3304
3003
N_("Limit assumed max number of seeks when looking up rows based on a key"),
3305
3004
(char**) &global_system_variables.max_seeks_for_key,
3437
3136
(char**) &max_system_variables.read_rnd_buff_size, 0,
3438
3137
GET_UINT, REQUIRED_ARG, 256*1024L, 64 /*IO_SIZE*2+MALLOC_OVERHEAD*/ ,
3439
3138
UINT32_MAX, MALLOC_OVERHEAD, 1 /* Small lower limit to be able to test MRR */, 0},
3440
{"relay_log_purge", OPT_RELAY_LOG_PURGE,
3441
N_("0 = do not purge relay logs. "
3442
"1 = purge them as soon as they are no more needed."),
3443
(char**) &relay_log_purge,
3444
(char**) &relay_log_purge, 0, GET_BOOL, NO_ARG,
3446
{"relay_log_space_limit", OPT_RELAY_LOG_SPACE_LIMIT,
3447
N_("Maximum space to use for all relay logs."),
3448
(char**) &relay_log_space_limit,
3449
(char**) &relay_log_space_limit, 0, GET_ULL, REQUIRED_ARG, 0L, 0L,
3450
(int64_t) ULONG_MAX, 0, 1, 0},
3451
{"slave_compressed_protocol", OPT_SLAVE_COMPRESSED_PROTOCOL,
3452
N_("Use compression on master/slave protocol."),
3453
(char**) &opt_slave_compressed_protocol,
3454
(char**) &opt_slave_compressed_protocol,
3455
0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0},
3456
{"slave_net_timeout", OPT_SLAVE_NET_TIMEOUT,
3457
N_("Number of seconds to wait for more data from a master/slave connection "
3458
"before aborting the read."),
3459
(char**) &slave_net_timeout, (char**) &slave_net_timeout, 0,
3460
GET_UINT, REQUIRED_ARG, SLAVE_NET_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0},
3461
{"slave_transaction_retries", OPT_SLAVE_TRANS_RETRIES,
3462
N_("Number of times the slave SQL thread will retry a transaction in case "
3463
"it failed with a deadlock or elapsed lock wait timeout, "
3464
"before giving up and stopping."),
3465
(char**) &slave_trans_retries, (char**) &slave_trans_retries, 0,
3466
GET_ULL, REQUIRED_ARG, 10L, 0L, (int64_t) ULONG_MAX, 0, 1, 0},
3467
{"slave-allow-batching", OPT_SLAVE_ALLOW_BATCHING,
3468
N_("Allow slave to batch requests."),
3469
(char**) &slave_allow_batching, (char**) &slave_allow_batching,
3470
0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0},
3471
{"slow_launch_time", OPT_SLOW_LAUNCH_TIME,
3472
N_("If creating the thread takes longer than this value (in seconds), the "
3473
"Slow_launch_threads counter will be incremented."),
3474
(char**) &slow_launch_time, (char**) &slow_launch_time, 0, GET_ULL,
3475
REQUIRED_ARG, 2L, 0L, LONG_TIMEOUT, 0, 1, 0},
3476
3139
{"sort_buffer_size", OPT_SORT_BUFFER,
3477
3140
N_("Each thread that needs to do a sort allocates a buffer of this size."),
3478
3141
(char**) &global_system_variables.sortbuff_size,
3479
3142
(char**) &max_system_variables.sortbuff_size, 0, GET_ULONG, REQUIRED_ARG,
3480
3143
MAX_SORT_MEMORY, MIN_SORT_MEMORY+MALLOC_OVERHEAD*2, SIZE_MAX,
3481
3144
MALLOC_OVERHEAD, 1, 0},
3482
{"sync-binlog", OPT_SYNC_BINLOG,
3483
N_("Synchronously flush binary log to disk after every #th event. "
3484
"Use 0 (default) to disable synchronous flushing."),
3485
(char**) &sync_binlog_period, (char**) &sync_binlog_period, 0, GET_ULL,
3486
REQUIRED_ARG, 0, 0, ULONG_MAX, 0, 1, 0},
3487
3145
{"table_definition_cache", OPT_TABLE_DEF_CACHE,
3488
3146
N_("The number of cached table definitions."),
3489
3147
(char**) &table_def_size, (char**) &table_def_size,
3573
3231
static st_show_var_func_container
3574
3232
show_flushstatustime_cont= { &show_flushstatustime };
3576
static int show_slave_running(Session *session __attribute__((unused)),
3577
SHOW_VAR *var, char *buff)
3579
var->type= SHOW_MY_BOOL;
3580
pthread_mutex_lock(&LOCK_active_mi);
3582
*((bool *)buff)= (bool) (active_mi && active_mi->slave_running &&
3583
active_mi->rli.slave_running);
3584
pthread_mutex_unlock(&LOCK_active_mi);
3588
static st_show_var_func_container
3589
show_slave_running_cont= { &show_slave_running };
3591
static int show_slave_retried_trans(Session *session __attribute__((unused)),
3592
SHOW_VAR *var, char *buff)
3595
TODO: with multimaster, have one such counter per line in
3596
SHOW SLAVE STATUS, and have the sum over all lines here.
3598
pthread_mutex_lock(&LOCK_active_mi);
3601
var->type= SHOW_LONG;
3603
pthread_mutex_lock(&active_mi->rli.data_lock);
3604
*((long *)buff)= (long)active_mi->rli.retried_trans;
3605
pthread_mutex_unlock(&active_mi->rli.data_lock);
3608
var->type= SHOW_UNDEF;
3609
pthread_mutex_unlock(&LOCK_active_mi);
3613
static st_show_var_func_container
3614
show_slave_retried_trans_cont= { &show_slave_retried_trans };
3616
static int show_slave_received_heartbeats(Session *session __attribute__((unused)),
3617
SHOW_VAR *var, char *buff)
3619
pthread_mutex_lock(&LOCK_active_mi);
3622
var->type= SHOW_LONGLONG;
3624
pthread_mutex_lock(&active_mi->rli.data_lock);
3625
*((int64_t *)buff)= active_mi->received_heartbeats;
3626
pthread_mutex_unlock(&active_mi->rli.data_lock);
3629
var->type= SHOW_UNDEF;
3630
pthread_mutex_unlock(&LOCK_active_mi);
3634
static st_show_var_func_container
3635
show_slave_received_heartbeats_cont= { &show_slave_received_heartbeats };
3637
static int show_heartbeat_period(Session *session __attribute__((unused)),
3638
SHOW_VAR *var, char *buff)
3640
pthread_mutex_lock(&LOCK_active_mi);
3643
var->type= SHOW_CHAR;
3645
sprintf(buff, "%.3f",active_mi->heartbeat_period);
3648
var->type= SHOW_UNDEF;
3649
pthread_mutex_unlock(&LOCK_active_mi);
3653
static st_show_var_func_container
3654
show_heartbeat_period_cont= { &show_heartbeat_period};
3656
3234
static int show_open_tables(Session *session __attribute__((unused)),
3657
3235
SHOW_VAR *var, char *buff)
3730
3306
{"Select_range", (char*) offsetof(STATUS_VAR, select_range_count), SHOW_LONG_STATUS},
3731
3307
{"Select_range_check", (char*) offsetof(STATUS_VAR, select_range_check_count), SHOW_LONG_STATUS},
3732
3308
{"Select_scan", (char*) offsetof(STATUS_VAR, select_scan_count), SHOW_LONG_STATUS},
3733
{"Slave_open_temp_tables", (char*) &slave_open_temp_tables, SHOW_LONGLONG},
3734
{"Slave_retried_transactions",(char*) &show_slave_retried_trans_cont, SHOW_FUNC},
3735
{"Slave_heartbeat_period", (char*) &show_heartbeat_period_cont, SHOW_FUNC},
3736
{"Slave_received_heartbeats",(char*) &show_slave_received_heartbeats_cont, SHOW_FUNC},
3737
{"Slave_running", (char*) &show_slave_running_cont, SHOW_FUNC},
3738
3309
{"Slow_launch_threads", (char*) &slow_launch_threads, SHOW_LONGLONG},
3739
3310
{"Slow_queries", (char*) offsetof(STATUS_VAR, long_query_count), SHOW_LONG_STATUS},
3740
3311
{"Sort_merge_passes", (char*) offsetof(STATUS_VAR, filesort_merge_passes), SHOW_LONG_STATUS},
3743
3314
{"Sort_scan", (char*) offsetof(STATUS_VAR, filesort_scan_count), SHOW_LONG_STATUS},
3744
3315
{"Table_locks_immediate", (char*) &locks_immediate, SHOW_INT},
3745
3316
{"Table_locks_waited", (char*) &locks_waited, SHOW_INT},
3747
{"Tc_log_max_pages_used", (char*) &tc_log_max_pages_used, SHOW_LONGLONG},
3748
{"Tc_log_page_size", (char*) &tc_log_page_size, SHOW_LONGLONG},
3749
{"Tc_log_page_waits", (char*) &tc_log_page_waits, SHOW_LONGLONG},
3751
3317
{"Threads_connected", (char*) &connection_count, SHOW_INT},
3752
3318
{"Threads_created", (char*) &thread_created, SHOW_LONG_NOFLUSH},
3753
3319
{"Threads_running", (char*) &thread_running, SHOW_INT},