The world's most popular open source database
00001 /* Copyright (C) 2000-2003 MySQL AB 00002 00003 This program is free software; you can redistribute it and/or modify 00004 it under the terms of the GNU General Public License as published by 00005 the Free Software Foundation; either version 2 of the License, or 00006 (at your option) any later version. 00007 00008 This program is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 GNU General Public License for more details. 00012 00013 You should have received a copy of the GNU General Public License 00014 along with this program; if not, write to the Free Software 00015 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ 00016 00017 /* 00018 Handling of MySQL SQL variables 00019 00020 To add a new variable, one has to do the following: 00021 00022 - Use one of the 'sys_var... classes from set_var.h or write a specific 00023 one for the variable type. 00024 - Define it in the 'variable definition list' in this file. 00025 - If the variable is thread specific, add it to 'system_variables' struct. 00026 If not, add it to mysqld.cc and an declaration in 'mysql_priv.h' 00027 - If the variable should be changed from the command line, add a definition 00028 of it in the my_option structure list in mysqld.cc 00029 - Don't forget to initialize new fields in global_system_variables and 00030 max_system_variables! 00031 - If the variable should show up in 'show variables' add it to the 00032 init_vars[] struct in this file 00033 00034 NOTES: 00035 - Be careful with var->save_result: sys_var::check() only updates 00036 ulonglong_value; so other members of the union are garbage then; to use 00037 them you must first assign a value to them (in specific ::check() for 00038 example). 00039 00040 TODO: 00041 - Add full support for the variable character_set (for 4.1) 00042 00043 - When updating myisam_delay_key_write, we should do a 'flush tables' 00044 of all MyISAM tables to ensure that they are reopen with the 00045 new attribute. 00046 */ 00047 00048 #ifdef USE_PRAGMA_IMPLEMENTATION 00049 #pragma implementation // gcc: Class implementation 00050 #endif 00051 00052 #include "mysql_priv.h" 00053 #include <mysql.h> 00054 #include "slave.h" 00055 #include <my_getopt.h> 00056 #include <thr_alarm.h> 00057 #include <myisam.h> 00058 #include <my_dir.h> 00059 00060 #include "event_scheduler.h" 00061 00062 /* WITH_INNOBASE_STORAGE_ENGINE */ 00063 extern uint innobase_flush_log_at_trx_commit; 00064 extern ulong innobase_fast_shutdown; 00065 extern long innobase_mirrored_log_groups, innobase_log_files_in_group; 00066 extern longlong innobase_log_file_size; 00067 extern long innobase_log_buffer_size; 00068 extern longlong innobase_buffer_pool_size; 00069 extern long innobase_additional_mem_pool_size; 00070 extern long innobase_buffer_pool_awe_mem_mb; 00071 extern long innobase_file_io_threads, innobase_lock_wait_timeout; 00072 extern long innobase_force_recovery; 00073 extern long innobase_open_files; 00074 extern char *innobase_data_home_dir, *innobase_data_file_path; 00075 extern char *innobase_log_group_home_dir, *innobase_log_arch_dir; 00076 extern char *innobase_unix_file_flush_method; 00077 /* The following variables have to be my_bool for SHOW VARIABLES to work */ 00078 extern my_bool innobase_log_archive, 00079 innobase_use_doublewrite, 00080 innobase_use_checksums, 00081 innobase_file_per_table, 00082 innobase_locks_unsafe_for_binlog; 00083 00084 extern "C" { 00085 extern ulong srv_max_buf_pool_modified_pct; 00086 extern ulong srv_max_purge_lag; 00087 extern ulong srv_auto_extend_increment; 00088 extern ulong srv_n_spin_wait_rounds; 00089 extern ulong srv_n_free_tickets_to_enter; 00090 extern ulong srv_thread_sleep_delay; 00091 extern ulong srv_thread_concurrency; 00092 extern ulong srv_commit_concurrency; 00093 extern ulong srv_flush_log_at_trx_commit; 00094 } 00095 00096 /* WITH_NDBCLUSTER_STORAGE_ENGINE */ 00097 extern ulong ndb_cache_check_time; 00098 extern ulong ndb_extra_logging; 00099 #ifdef HAVE_NDB_BINLOG 00100 extern ulong ndb_report_thresh_binlog_epoch_slip; 00101 extern ulong ndb_report_thresh_binlog_mem_usage; 00102 #endif 00103 00104 00105 00106 static HASH system_variable_hash; 00107 const char *bool_type_names[]= { "OFF", "ON", NullS }; 00108 TYPELIB bool_typelib= 00109 { 00110 array_elements(bool_type_names)-1, "", bool_type_names, NULL 00111 }; 00112 00113 const char *delay_key_write_type_names[]= { "OFF", "ON", "ALL", NullS }; 00114 TYPELIB delay_key_write_typelib= 00115 { 00116 array_elements(delay_key_write_type_names)-1, "", 00117 delay_key_write_type_names, NULL 00118 }; 00119 00120 static int sys_check_charset(THD *thd, set_var *var); 00121 static bool sys_update_charset(THD *thd, set_var *var); 00122 static void sys_set_default_charset(THD *thd, enum_var_type type); 00123 static int sys_check_ftb_syntax(THD *thd, set_var *var); 00124 static bool sys_update_ftb_syntax(THD *thd, set_var * var); 00125 static void sys_default_ftb_syntax(THD *thd, enum_var_type type); 00126 static bool sys_update_init_connect(THD*, set_var*); 00127 static void sys_default_init_connect(THD*, enum_var_type type); 00128 static bool sys_update_init_slave(THD*, set_var*); 00129 static void sys_default_init_slave(THD*, enum_var_type type); 00130 static bool set_option_bit(THD *thd, set_var *var); 00131 static bool set_option_autocommit(THD *thd, set_var *var); 00132 static int check_log_update(THD *thd, set_var *var); 00133 static bool set_log_update(THD *thd, set_var *var); 00134 static int check_pseudo_thread_id(THD *thd, set_var *var); 00135 void fix_binlog_format_after_update(THD *thd, enum_var_type type); 00136 static void fix_low_priority_updates(THD *thd, enum_var_type type); 00137 static int check_tx_isolation(THD *thd, set_var *var); 00138 static void fix_tx_isolation(THD *thd, enum_var_type type); 00139 static int check_completion_type(THD *thd, set_var *var); 00140 static void fix_completion_type(THD *thd, enum_var_type type); 00141 static void fix_net_read_timeout(THD *thd, enum_var_type type); 00142 static void fix_net_write_timeout(THD *thd, enum_var_type type); 00143 static void fix_net_retry_count(THD *thd, enum_var_type type); 00144 static void fix_max_join_size(THD *thd, enum_var_type type); 00145 static void fix_query_cache_size(THD *thd, enum_var_type type); 00146 static void fix_query_cache_min_res_unit(THD *thd, enum_var_type type); 00147 static void fix_myisam_max_sort_file_size(THD *thd, enum_var_type type); 00148 static void fix_max_binlog_size(THD *thd, enum_var_type type); 00149 static void fix_max_relay_log_size(THD *thd, enum_var_type type); 00150 static void fix_max_connections(THD *thd, enum_var_type type); 00151 static int check_max_delayed_threads(THD *thd, set_var *var); 00152 static void fix_thd_mem_root(THD *thd, enum_var_type type); 00153 static void fix_trans_mem_root(THD *thd, enum_var_type type); 00154 static void fix_server_id(THD *thd, enum_var_type type); 00155 static KEY_CACHE *create_key_cache(const char *name, uint length); 00156 void fix_sql_mode_var(THD *thd, enum_var_type type); 00157 static byte *get_error_count(THD *thd); 00158 static byte *get_warning_count(THD *thd); 00159 static byte *get_prepared_stmt_count(THD *thd); 00160 static byte *get_tmpdir(THD *thd); 00161 static int sys_check_log_path(THD *thd, set_var *var); 00162 static bool sys_update_general_log_path(THD *thd, set_var * var); 00163 static void sys_default_general_log_path(THD *thd, enum_var_type type); 00164 static bool sys_update_slow_log_path(THD *thd, set_var * var); 00165 static void sys_default_slow_log_path(THD *thd, enum_var_type type); 00166 00167 /* 00168 Variable definition list 00169 00170 These are variables that can be set from the command line, in 00171 alphabetic order. 00172 00173 The variables are linked into the list. A variable is added to 00174 it in the constructor (see sys_var class for details). 00175 */ 00176 00177 sys_var *sys_var::first= NULL; 00178 uint sys_var::sys_vars= 0; 00179 00180 sys_var_thd_ulong sys_auto_increment_increment("auto_increment_increment", 00181 &SV::auto_increment_increment); 00182 sys_var_thd_ulong sys_auto_increment_offset("auto_increment_offset", 00183 &SV::auto_increment_offset); 00184 00185 sys_var_bool_ptr sys_automatic_sp_privileges("automatic_sp_privileges", 00186 &sp_automatic_privileges); 00187 00188 sys_var_const_str sys_basedir("basedir", mysql_home); 00189 sys_var_long_ptr sys_binlog_cache_size("binlog_cache_size", 00190 &binlog_cache_size); 00191 sys_var_thd_binlog_format sys_binlog_format("binlog_format", 00192 &SV::binlog_format); 00193 sys_var_thd_ulong sys_bulk_insert_buff_size("bulk_insert_buffer_size", 00194 &SV::bulk_insert_buff_size); 00195 sys_var_character_set_server sys_character_set_server("character_set_server"); 00196 sys_var_const_str sys_charset_system("character_set_system", 00197 (char *)my_charset_utf8_general_ci.name); 00198 sys_var_character_set_database sys_character_set_database("character_set_database"); 00199 sys_var_character_set_client sys_character_set_client("character_set_client"); 00200 sys_var_character_set_connection sys_character_set_connection("character_set_connection"); 00201 sys_var_character_set_results sys_character_set_results("character_set_results"); 00202 sys_var_character_set_filesystem sys_character_set_filesystem("character_set_filesystem"); 00203 sys_var_thd_ulong sys_completion_type("completion_type", 00204 &SV::completion_type, 00205 check_completion_type, 00206 fix_completion_type); 00207 sys_var_collation_connection sys_collation_connection("collation_connection"); 00208 sys_var_collation_database sys_collation_database("collation_database"); 00209 sys_var_collation_server sys_collation_server("collation_server"); 00210 sys_var_long_ptr sys_concurrent_insert("concurrent_insert", 00211 &myisam_concurrent_insert); 00212 sys_var_long_ptr sys_connect_timeout("connect_timeout", 00213 &connect_timeout); 00214 sys_var_const_str sys_datadir("datadir", mysql_real_data_home); 00215 #ifndef DBUG_OFF 00216 sys_var_thd_dbug sys_dbug("debug"); 00217 #endif 00218 sys_var_enum sys_delay_key_write("delay_key_write", 00219 &delay_key_write_options, 00220 &delay_key_write_typelib, 00221 fix_delay_key_write); 00222 sys_var_long_ptr sys_delayed_insert_limit("delayed_insert_limit", 00223 &delayed_insert_limit); 00224 sys_var_long_ptr sys_delayed_insert_timeout("delayed_insert_timeout", 00225 &delayed_insert_timeout); 00226 sys_var_long_ptr sys_delayed_queue_size("delayed_queue_size", 00227 &delayed_queue_size); 00228 00229 sys_var_event_scheduler sys_event_scheduler("event_scheduler"); 00230 sys_var_long_ptr sys_expire_logs_days("expire_logs_days", 00231 &expire_logs_days); 00232 sys_var_bool_ptr sys_flush("flush", &myisam_flush); 00233 sys_var_long_ptr sys_flush_time("flush_time", &flush_time); 00234 sys_var_str sys_ft_boolean_syntax("ft_boolean_syntax", 00235 sys_check_ftb_syntax, 00236 sys_update_ftb_syntax, 00237 sys_default_ftb_syntax, 00238 ft_boolean_syntax); 00239 sys_var_str sys_init_connect("init_connect", 0, 00240 sys_update_init_connect, 00241 sys_default_init_connect,0); 00242 sys_var_str sys_init_slave("init_slave", 0, 00243 sys_update_init_slave, 00244 sys_default_init_slave,0); 00245 sys_var_thd_ulong sys_interactive_timeout("interactive_timeout", 00246 &SV::net_interactive_timeout); 00247 sys_var_thd_ulong sys_join_buffer_size("join_buffer_size", 00248 &SV::join_buff_size); 00249 sys_var_key_buffer_size sys_key_buffer_size("key_buffer_size"); 00250 sys_var_key_cache_long sys_key_cache_block_size("key_cache_block_size", 00251 offsetof(KEY_CACHE, 00252 param_block_size)); 00253 sys_var_key_cache_long sys_key_cache_division_limit("key_cache_division_limit", 00254 offsetof(KEY_CACHE, 00255 param_division_limit)); 00256 sys_var_key_cache_long sys_key_cache_age_threshold("key_cache_age_threshold", 00257 offsetof(KEY_CACHE, 00258 param_age_threshold)); 00259 sys_var_bool_ptr sys_local_infile("local_infile", 00260 &opt_local_infile); 00261 sys_var_trust_routine_creators 00262 sys_trust_routine_creators("log_bin_trust_routine_creators", 00263 &trust_function_creators); 00264 sys_var_bool_ptr 00265 sys_trust_function_creators("log_bin_trust_function_creators", 00266 &trust_function_creators); 00267 sys_var_bool_ptr 00268 sys_log_queries_not_using_indexes("log_queries_not_using_indexes", 00269 &opt_log_queries_not_using_indexes); 00270 sys_var_thd_ulong sys_log_warnings("log_warnings", &SV::log_warnings); 00271 sys_var_thd_ulong sys_long_query_time("long_query_time", 00272 &SV::long_query_time); 00273 sys_var_thd_bool sys_low_priority_updates("low_priority_updates", 00274 &SV::low_priority_updates, 00275 fix_low_priority_updates); 00276 #ifndef TO_BE_DELETED /* Alias for the low_priority_updates */ 00277 sys_var_thd_bool sys_sql_low_priority_updates("sql_low_priority_updates", 00278 &SV::low_priority_updates, 00279 fix_low_priority_updates); 00280 #endif 00281 sys_var_thd_ulong sys_max_allowed_packet("max_allowed_packet", 00282 &SV::max_allowed_packet); 00283 sys_var_long_ptr sys_max_binlog_cache_size("max_binlog_cache_size", 00284 &max_binlog_cache_size); 00285 sys_var_long_ptr sys_max_binlog_size("max_binlog_size", 00286 &max_binlog_size, 00287 fix_max_binlog_size); 00288 sys_var_long_ptr sys_max_connections("max_connections", 00289 &max_connections, 00290 fix_max_connections); 00291 sys_var_long_ptr sys_max_connect_errors("max_connect_errors", 00292 &max_connect_errors); 00293 sys_var_thd_ulong sys_max_insert_delayed_threads("max_insert_delayed_threads", 00294 &SV::max_insert_delayed_threads, 00295 check_max_delayed_threads, 00296 fix_max_connections); 00297 sys_var_thd_ulong sys_max_delayed_threads("max_delayed_threads", 00298 &SV::max_insert_delayed_threads, 00299 check_max_delayed_threads, 00300 fix_max_connections); 00301 sys_var_thd_ulong sys_max_error_count("max_error_count", 00302 &SV::max_error_count); 00303 sys_var_thd_ulong sys_max_heap_table_size("max_heap_table_size", 00304 &SV::max_heap_table_size); 00305 sys_var_thd_ulong sys_pseudo_thread_id("pseudo_thread_id", 00306 &SV::pseudo_thread_id, 00307 check_pseudo_thread_id, 0); 00308 sys_var_thd_ha_rows sys_max_join_size("max_join_size", 00309 &SV::max_join_size, 00310 fix_max_join_size); 00311 sys_var_thd_ulong sys_max_seeks_for_key("max_seeks_for_key", 00312 &SV::max_seeks_for_key); 00313 sys_var_thd_ulong sys_max_length_for_sort_data("max_length_for_sort_data", 00314 &SV::max_length_for_sort_data); 00315 #ifndef TO_BE_DELETED /* Alias for max_join_size */ 00316 sys_var_thd_ha_rows sys_sql_max_join_size("sql_max_join_size", 00317 &SV::max_join_size, 00318 fix_max_join_size); 00319 #endif 00320 static sys_var_long_ptr_global 00321 sys_max_prepared_stmt_count("max_prepared_stmt_count", 00322 &max_prepared_stmt_count, 00323 &LOCK_prepared_stmt_count); 00324 sys_var_long_ptr sys_max_relay_log_size("max_relay_log_size", 00325 &max_relay_log_size, 00326 fix_max_relay_log_size); 00327 sys_var_thd_ulong sys_max_sort_length("max_sort_length", 00328 &SV::max_sort_length); 00329 sys_var_thd_ulong sys_max_sp_recursion_depth("max_sp_recursion_depth", 00330 &SV::max_sp_recursion_depth); 00331 sys_var_max_user_conn sys_max_user_connections("max_user_connections"); 00332 sys_var_thd_ulong sys_max_tmp_tables("max_tmp_tables", 00333 &SV::max_tmp_tables); 00334 sys_var_long_ptr sys_max_write_lock_count("max_write_lock_count", 00335 &max_write_lock_count); 00336 sys_var_thd_ulong sys_multi_range_count("multi_range_count", 00337 &SV::multi_range_count); 00338 sys_var_long_ptr sys_myisam_data_pointer_size("myisam_data_pointer_size", 00339 &myisam_data_pointer_size); 00340 sys_var_thd_ulonglong sys_myisam_max_sort_file_size("myisam_max_sort_file_size", &SV::myisam_max_sort_file_size, fix_myisam_max_sort_file_size, 1); 00341 sys_var_thd_ulong sys_myisam_repair_threads("myisam_repair_threads", &SV::myisam_repair_threads); 00342 sys_var_thd_ulong sys_myisam_sort_buffer_size("myisam_sort_buffer_size", &SV::myisam_sort_buff_size); 00343 sys_var_bool_ptr sys_myisam_use_mmap("myisam_use_mmap", 00344 &opt_myisam_use_mmap); 00345 00346 sys_var_thd_enum sys_myisam_stats_method("myisam_stats_method", 00347 &SV::myisam_stats_method, 00348 &myisam_stats_method_typelib, 00349 NULL); 00350 00351 sys_var_thd_ulong sys_net_buffer_length("net_buffer_length", 00352 &SV::net_buffer_length); 00353 sys_var_thd_ulong sys_net_read_timeout("net_read_timeout", 00354 &SV::net_read_timeout, 00355 0, fix_net_read_timeout); 00356 sys_var_thd_ulong sys_net_write_timeout("net_write_timeout", 00357 &SV::net_write_timeout, 00358 0, fix_net_write_timeout); 00359 sys_var_thd_ulong sys_net_retry_count("net_retry_count", 00360 &SV::net_retry_count, 00361 0, fix_net_retry_count); 00362 sys_var_thd_bool sys_new_mode("new", &SV::new_mode); 00363 sys_var_thd_bool sys_old_alter_table("old_alter_table", 00364 &SV::old_alter_table); 00365 sys_var_thd_bool sys_old_passwords("old_passwords", &SV::old_passwords); 00366 sys_var_thd_ulong sys_optimizer_prune_level("optimizer_prune_level", 00367 &SV::optimizer_prune_level); 00368 sys_var_thd_ulong sys_optimizer_search_depth("optimizer_search_depth", 00369 &SV::optimizer_search_depth); 00370 sys_var_thd_ulong sys_preload_buff_size("preload_buffer_size", 00371 &SV::preload_buff_size); 00372 sys_var_thd_ulong sys_read_buff_size("read_buffer_size", 00373 &SV::read_buff_size); 00374 sys_var_bool_ptr sys_readonly("read_only", &opt_readonly); 00375 sys_var_thd_ulong sys_read_rnd_buff_size("read_rnd_buffer_size", 00376 &SV::read_rnd_buff_size); 00377 sys_var_thd_ulong sys_div_precincrement("div_precision_increment", 00378 &SV::div_precincrement); 00379 #ifdef HAVE_REPLICATION 00380 sys_var_bool_ptr sys_relay_log_purge("relay_log_purge", 00381 &relay_log_purge); 00382 #endif 00383 sys_var_long_ptr sys_rpl_recovery_rank("rpl_recovery_rank", 00384 &rpl_recovery_rank); 00385 sys_var_long_ptr sys_query_cache_size("query_cache_size", 00386 &query_cache_size, 00387 fix_query_cache_size); 00388 00389 sys_var_thd_ulong sys_range_alloc_block_size("range_alloc_block_size", 00390 &SV::range_alloc_block_size); 00391 sys_var_thd_ulong sys_query_alloc_block_size("query_alloc_block_size", 00392 &SV::query_alloc_block_size, 00393 0, fix_thd_mem_root); 00394 sys_var_thd_ulong sys_query_prealloc_size("query_prealloc_size", 00395 &SV::query_prealloc_size, 00396 0, fix_thd_mem_root); 00397 sys_var_readonly sys_tmpdir("tmpdir", OPT_GLOBAL, SHOW_CHAR, get_tmpdir); 00398 sys_var_thd_ulong sys_trans_alloc_block_size("transaction_alloc_block_size", 00399 &SV::trans_alloc_block_size, 00400 0, fix_trans_mem_root); 00401 sys_var_thd_ulong sys_trans_prealloc_size("transaction_prealloc_size", 00402 &SV::trans_prealloc_size, 00403 0, fix_trans_mem_root); 00404 00405 #ifdef HAVE_QUERY_CACHE 00406 sys_var_long_ptr sys_query_cache_limit("query_cache_limit", 00407 &query_cache.query_cache_limit); 00408 sys_var_long_ptr sys_query_cache_min_res_unit("query_cache_min_res_unit", 00409 &query_cache_min_res_unit, 00410 fix_query_cache_min_res_unit); 00411 sys_var_thd_enum sys_query_cache_type("query_cache_type", 00412 &SV::query_cache_type, 00413 &query_cache_type_typelib); 00414 sys_var_thd_bool 00415 sys_query_cache_wlock_invalidate("query_cache_wlock_invalidate", 00416 &SV::query_cache_wlock_invalidate); 00417 #endif /* HAVE_QUERY_CACHE */ 00418 sys_var_bool_ptr sys_secure_auth("secure_auth", &opt_secure_auth); 00419 sys_var_long_ptr sys_server_id("server_id", &server_id, fix_server_id); 00420 sys_var_bool_ptr sys_slave_compressed_protocol("slave_compressed_protocol", 00421 &opt_slave_compressed_protocol); 00422 #ifdef HAVE_REPLICATION 00423 sys_var_long_ptr sys_slave_net_timeout("slave_net_timeout", 00424 &slave_net_timeout); 00425 sys_var_long_ptr sys_slave_trans_retries("slave_transaction_retries", 00426 &slave_trans_retries); 00427 #endif 00428 sys_var_long_ptr sys_slow_launch_time("slow_launch_time", 00429 &slow_launch_time); 00430 sys_var_thd_ulong sys_sort_buffer("sort_buffer_size", 00431 &SV::sortbuff_size); 00432 sys_var_thd_sql_mode sys_sql_mode("sql_mode", 00433 &SV::sql_mode); 00434 #ifdef HAVE_OPENSSL 00435 extern char *opt_ssl_ca, *opt_ssl_capath, *opt_ssl_cert, *opt_ssl_cipher, 00436 *opt_ssl_key; 00437 sys_var_const_str_ptr sys_ssl_ca("ssl_ca", &opt_ssl_ca); 00438 sys_var_const_str_ptr sys_ssl_capath("ssl_capath", &opt_ssl_capath); 00439 sys_var_const_str_ptr sys_ssl_cert("ssl_cert", &opt_ssl_cert); 00440 sys_var_const_str_ptr sys_ssl_cipher("ssl_cipher", &opt_ssl_cipher); 00441 sys_var_const_str_ptr sys_ssl_key("ssl_key", &opt_ssl_key); 00442 #else 00443 sys_var_const_str sys_ssl_ca("ssl_ca", NULL); 00444 sys_var_const_str sys_ssl_capath("ssl_capath", NULL); 00445 sys_var_const_str sys_ssl_cert("ssl_cert", NULL); 00446 sys_var_const_str sys_ssl_cipher("ssl_cipher", NULL); 00447 sys_var_const_str sys_ssl_key("ssl_key", NULL); 00448 #endif 00449 sys_var_thd_enum 00450 sys_updatable_views_with_limit("updatable_views_with_limit", 00451 &SV::updatable_views_with_limit, 00452 &updatable_views_with_limit_typelib); 00453 00454 sys_var_thd_table_type sys_table_type("table_type", 00455 &SV::table_type); 00456 sys_var_thd_storage_engine sys_storage_engine("storage_engine", 00457 &SV::table_type); 00458 #ifdef HAVE_REPLICATION 00459 sys_var_sync_binlog_period sys_sync_binlog_period("sync_binlog", &sync_binlog_period); 00460 #endif 00461 sys_var_bool_ptr sys_sync_frm("sync_frm", &opt_sync_frm); 00462 sys_var_const_str sys_system_time_zone("system_time_zone", 00463 system_time_zone); 00464 sys_var_long_ptr sys_table_def_size("table_definition_cache", 00465 &table_def_size); 00466 sys_var_long_ptr sys_table_cache_size("table_open_cache", 00467 &table_cache_size); 00468 sys_var_long_ptr sys_table_lock_wait_timeout("table_lock_wait_timeout", 00469 &table_lock_wait_timeout); 00470 sys_var_long_ptr sys_thread_cache_size("thread_cache_size", 00471 &thread_cache_size); 00472 sys_var_thd_enum sys_tx_isolation("tx_isolation", 00473 &SV::tx_isolation, 00474 &tx_isolation_typelib, 00475 fix_tx_isolation, 00476 check_tx_isolation); 00477 sys_var_thd_ulong sys_tmp_table_size("tmp_table_size", 00478 &SV::tmp_table_size); 00479 sys_var_bool_ptr sys_timed_mutexes("timed_mutexes", 00480 &timed_mutexes); 00481 sys_var_const_str sys_version("version", server_version); 00482 sys_var_const_str sys_version_comment("version_comment", 00483 MYSQL_COMPILATION_COMMENT); 00484 sys_var_const_str sys_version_compile_machine("version_compile_machine", 00485 MACHINE_TYPE); 00486 sys_var_const_str sys_version_compile_os("version_compile_os", 00487 SYSTEM_TYPE); 00488 sys_var_thd_ulong sys_net_wait_timeout("wait_timeout", 00489 &SV::net_wait_timeout); 00490 #ifdef WITH_INNOBASE_STORAGE_ENGINE 00491 sys_var_long_ptr sys_innodb_fast_shutdown("innodb_fast_shutdown", 00492 &innobase_fast_shutdown); 00493 sys_var_long_ptr sys_innodb_max_dirty_pages_pct("innodb_max_dirty_pages_pct", 00494 &srv_max_buf_pool_modified_pct); 00495 sys_var_long_ptr sys_innodb_max_purge_lag("innodb_max_purge_lag", 00496 &srv_max_purge_lag); 00497 sys_var_thd_bool sys_innodb_table_locks("innodb_table_locks", 00498 &SV::innodb_table_locks); 00499 sys_var_thd_bool sys_innodb_support_xa("innodb_support_xa", 00500 &SV::innodb_support_xa); 00501 sys_var_long_ptr sys_innodb_autoextend_increment("innodb_autoextend_increment", 00502 &srv_auto_extend_increment); 00503 sys_var_long_ptr sys_innodb_sync_spin_loops("innodb_sync_spin_loops", 00504 &srv_n_spin_wait_rounds); 00505 sys_var_long_ptr sys_innodb_concurrency_tickets("innodb_concurrency_tickets", 00506 &srv_n_free_tickets_to_enter); 00507 sys_var_long_ptr sys_innodb_thread_sleep_delay("innodb_thread_sleep_delay", 00508 &srv_thread_sleep_delay); 00509 sys_var_long_ptr sys_innodb_thread_concurrency("innodb_thread_concurrency", 00510 &srv_thread_concurrency); 00511 sys_var_long_ptr sys_innodb_commit_concurrency("innodb_commit_concurrency", 00512 &srv_commit_concurrency); 00513 sys_var_long_ptr sys_innodb_flush_log_at_trx_commit( 00514 "innodb_flush_log_at_trx_commit", 00515 &srv_flush_log_at_trx_commit); 00516 #endif 00517 /* Condition pushdown to storage engine */ 00518 sys_var_thd_bool 00519 sys_engine_condition_pushdown("engine_condition_pushdown", 00520 &SV::engine_condition_pushdown); 00521 00522 /* ndb thread specific variable settings */ 00523 sys_var_thd_ulong 00524 sys_ndb_autoincrement_prefetch_sz("ndb_autoincrement_prefetch_sz", 00525 &SV::ndb_autoincrement_prefetch_sz); 00526 sys_var_thd_bool 00527 sys_ndb_force_send("ndb_force_send", &SV::ndb_force_send); 00528 #ifdef HAVE_NDB_BINLOG 00529 sys_var_long_ptr 00530 sys_ndb_report_thresh_binlog_epoch_slip("ndb_report_thresh_binlog_epoch_slip", 00531 &ndb_report_thresh_binlog_epoch_slip); 00532 sys_var_long_ptr 00533 sys_ndb_report_thresh_binlog_mem_usage("ndb_report_thresh_binlog_mem_usage", 00534 &ndb_report_thresh_binlog_mem_usage); 00535 #endif 00536 sys_var_thd_bool 00537 sys_ndb_use_exact_count("ndb_use_exact_count", &SV::ndb_use_exact_count); 00538 sys_var_thd_bool 00539 sys_ndb_use_transactions("ndb_use_transactions", &SV::ndb_use_transactions); 00540 sys_var_long_ptr 00541 sys_ndb_cache_check_time("ndb_cache_check_time", &ndb_cache_check_time); 00542 sys_var_thd_bool 00543 sys_ndb_index_stat_enable("ndb_index_stat_enable", 00544 &SV::ndb_index_stat_enable); 00545 sys_var_thd_ulong 00546 sys_ndb_index_stat_cache_entries("ndb_index_stat_cache_entries", 00547 &SV::ndb_index_stat_cache_entries); 00548 sys_var_thd_ulong 00549 sys_ndb_index_stat_update_freq("ndb_index_stat_update_freq", 00550 &SV::ndb_index_stat_update_freq); 00551 sys_var_long_ptr 00552 sys_ndb_extra_logging("ndb_extra_logging", &ndb_extra_logging); 00553 sys_var_thd_bool 00554 sys_ndb_use_copying_alter_table("ndb_use_copying_alter_table", &SV::ndb_use_copying_alter_table); 00555 00556 /* Time/date/datetime formats */ 00557 00558 sys_var_thd_date_time_format sys_time_format("time_format", 00559 &SV::time_format, 00560 MYSQL_TIMESTAMP_TIME); 00561 sys_var_thd_date_time_format sys_date_format("date_format", 00562 &SV::date_format, 00563 MYSQL_TIMESTAMP_DATE); 00564 sys_var_thd_date_time_format sys_datetime_format("datetime_format", 00565 &SV::datetime_format, 00566 MYSQL_TIMESTAMP_DATETIME); 00567 00568 /* Variables that are bits in THD */ 00569 00570 sys_var_thd_bit sys_autocommit("autocommit", 0, 00571 set_option_autocommit, 00572 OPTION_NOT_AUTOCOMMIT, 00573 1); 00574 static sys_var_thd_bit sys_big_tables("big_tables", 0, 00575 set_option_bit, 00576 OPTION_BIG_TABLES); 00577 #ifndef TO_BE_DELETED /* Alias for big_tables */ 00578 static sys_var_thd_bit sys_sql_big_tables("sql_big_tables", 0, 00579 set_option_bit, 00580 OPTION_BIG_TABLES); 00581 #endif 00582 static sys_var_thd_bit sys_big_selects("sql_big_selects", 0, 00583 set_option_bit, 00584 OPTION_BIG_SELECTS); 00585 static sys_var_thd_bit sys_log_off("sql_log_off", 00586 check_log_update, 00587 set_option_bit, 00588 OPTION_LOG_OFF); 00589 static sys_var_thd_bit sys_log_update("sql_log_update", 00590 check_log_update, 00591 set_log_update, 00592 OPTION_BIN_LOG); 00593 static sys_var_thd_bit sys_log_binlog("sql_log_bin", 00594 check_log_update, 00595 set_option_bit, 00596 OPTION_BIN_LOG); 00597 static sys_var_thd_bit sys_sql_warnings("sql_warnings", 0, 00598 set_option_bit, 00599 OPTION_WARNINGS); 00600 static sys_var_thd_bit sys_sql_notes("sql_notes", 0, 00601 set_option_bit, 00602 OPTION_SQL_NOTES); 00603 static sys_var_thd_bit sys_auto_is_null("sql_auto_is_null", 0, 00604 set_option_bit, 00605 OPTION_AUTO_IS_NULL); 00606 static sys_var_thd_bit sys_safe_updates("sql_safe_updates", 0, 00607 set_option_bit, 00608 OPTION_SAFE_UPDATES); 00609 static sys_var_thd_bit sys_buffer_results("sql_buffer_result", 0, 00610 set_option_bit, 00611 OPTION_BUFFER_RESULT); 00612 static sys_var_thd_bit sys_quote_show_create("sql_quote_show_create", 0, 00613 set_option_bit, 00614 OPTION_QUOTE_SHOW_CREATE); 00615 static sys_var_thd_bit sys_foreign_key_checks("foreign_key_checks", 0, 00616 set_option_bit, 00617 OPTION_NO_FOREIGN_KEY_CHECKS, 00618 1); 00619 static sys_var_thd_bit sys_unique_checks("unique_checks", 0, 00620 set_option_bit, 00621 OPTION_RELAXED_UNIQUE_CHECKS, 00622 1); 00623 00624 /* Local state variables */ 00625 00626 static sys_var_thd_ha_rows sys_select_limit("sql_select_limit", 00627 &SV::select_limit); 00628 static sys_var_timestamp sys_timestamp("timestamp"); 00629 static sys_var_last_insert_id sys_last_insert_id("last_insert_id"); 00630 static sys_var_last_insert_id sys_identity("identity"); 00631 00632 static

