summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mysql.com>2009-12-22 10:35:56 +0100
committerSergei Golubchik <serg@mysql.com>2009-12-22 10:35:56 +0100
commit1ad5bb1a69656808312efc40ca12c4897f8ea128 (patch)
treeffef2f9db240392c7f322d05058dfd7ea8c01a9d
parent22c65346986d63c906e1d5a57941cadc367c2a9f (diff)
downloadmariadb-git-1ad5bb1a69656808312efc40ca12c4897f8ea128.tar.gz
WL#4738 streamline/simplify @@variable creation process
Bug#16565 mysqld --help --verbose does not order variablesBug#20413 sql_slave_skip_counter is not shown in show variables Bug#20415 Output of mysqld --help --verbose is incomplete Bug#25430 variable not found in SELECT @@global.ft_max_word_len; Bug#32902 plugin variables don't know their names Bug#34599 MySQLD Option and Variable Reference need to be consistent in formatting! Bug#34829 No default value for variable and setting default does not raise error Bug#34834 ? Is accepted as a valid sql mode Bug#34878 Few variables have default value according to documentation but error occurs Bug#34883 ft_boolean_syntax cant be assigned from user variable to global var. Bug#37187 `INFORMATION_SCHEMA`.`GLOBAL_VARIABLES`: inconsistent status Bug#40988 log_output_basic.test succeeded though syntactically false. Bug#41010 enum-style command-line options are not honoured (maria.maria-recover fails) Bug#42103 Setting key_buffer_size to a negative value may lead to very large allocations Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled Bug#44797 plugins w/o command-line options have no disabling option in --help Bug#46314 string system variables don't support expressions Bug#46470 sys_vars.max_binlog_cache_size_basic_32 is broken Bug#46586 When using the plugin interface the type "set" for options caused a crash. Bug#47212 Crash in DBUG_PRINT in mysqltest.cc when trying to print octal number Bug#48758 mysqltest crashes on sys_vars.collation_server_basic in gcov builds Bug#49417 some complaints about mysqld --help --verbose output Bug#49540 DEFAULT value of binlog_format isn't the default value Bug#49640 ambiguous option '--skip-skip-myisam' (double skip prefix) Bug#49644 init_connect and \0 Bug#49645 init_slave and multi-byte characters Bug#49646 mysql --show-warnings crashes when server dies CMakeLists.txt: Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled client/mysql.cc: don't crash with --show-warnings when mysqld dies config/ac-macros/plugins.m4: Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled include/my_getopt.h: comments include/my_pthread.h: fix double #define mysql-test/mysql-test-run.pl: run sys_vars suite by default properly recognize envirinment variables (e.g. MTR_MAX_SAVE_CORE) set to 0 escape gdb command line arguments mysql-test/suite/sys_vars/r/rpl_init_slave_func.result: init_slave+utf8 bug mysql-test/suite/sys_vars/t/rpl_init_slave_func.test: init_slave+utf8 bug mysys/my_getopt.c: Bug#34599 MySQLD Option and Variable Reference need to be consistent in formatting! Bug#46586 When using the plugin interface the type "set" for options caused a crash. Bug#49640 ambiguous option '--skip-skip-myisam' (double skip prefix) mysys/typelib.c: support for flagset sql/ha_ndbcluster.cc: backport from telco tree sql/item_func.cc: Bug#49644 init_connect and \0 Bug#49645 init_slave and multi-byte characters sql/sql_builtin.cc.in: Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled sql/sql_plugin.cc: Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled Bug#32902 plugin variables don't know their names Bug#44797 plugins w/o command-line options have no disabling option in --help sql/sys_vars.cc: all server variables are defined here storage/myisam/ft_parser.c: remove unnecessary updates of param->quot storage/myisam/ha_myisam.cc: myisam_* variables belong here strings/my_vsnprintf.c: %o and %llx unittest/mysys/my_vsnprintf-t.c: %o and %llx tests vio/viosocket.c: bugfix: fix @@wait_timeout to work with socket timeouts (vs. alarm thread)
-rw-r--r--.bzrignore2
-rwxr-xr-xCMakeLists.txt10
-rw-r--r--Makefile.am4
-rw-r--r--client/mysql.cc4
-rw-r--r--client/mysqltest.cc7
-rw-r--r--config/ac-macros/plugins.m46
-rw-r--r--configure.in6
-rw-r--r--include/config-netware.h2
-rw-r--r--include/config-win.h6
-rw-r--r--include/ft_global.h4
-rw-r--r--include/keycache.h8
-rw-r--r--include/m_string.h12
-rw-r--r--include/my_base.h11
-rw-r--r--include/my_getopt.h51
-rw-r--r--include/my_global.h39
-rw-r--r--include/my_pthread.h3
-rw-r--r--include/my_time.h6
-rw-r--r--include/myisam.h2
-rw-r--r--include/mysql.h.pp4
-rw-r--r--include/mysql/plugin.h1
-rw-r--r--include/mysql/plugin.h.pp1
-rw-r--r--include/mysql/service_my_snprintf.h2
-rw-r--r--include/sslopt-longopts.h6
-rw-r--r--include/typelib.h5
-rw-r--r--libmysqld/CMakeLists.txt3
-rw-r--r--libmysqld/Makefile.am4
-rw-r--r--libmysqld/lib_sql.cc5
-rw-r--r--mysql-test/Makefile.am3
-rw-r--r--mysql-test/collections/mysql-next-mr.push2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_charset.test4
-rw-r--r--mysql-test/include/diff_tables.inc1
-rw-r--r--mysql-test/include/have_thread_concurrency.inc10
-rw-r--r--mysql-test/include/index_merge1.inc2
-rw-r--r--mysql-test/include/mysqld--help.inc39
-rw-r--r--mysql-test/include/query_cache.inc2
-rw-r--r--mysql-test/include/query_cache_sql_prepare.inc10
-rw-r--r--mysql-test/include/show_slave_status2.inc2
-rwxr-xr-xmysql-test/mysql-test-run.pl52
-rw-r--r--mysql-test/r/archive.result2
-rw-r--r--mysql-test/r/bug46080.result2
-rw-r--r--mysql-test/r/cache_innodb.result2
-rw-r--r--mysql-test/r/change_user.result2
-rw-r--r--mysql-test/r/date_formats.result65
-rw-r--r--mysql-test/r/errors.result8
-rw-r--r--mysql-test/r/events_2.result6
-rw-r--r--mysql-test/r/events_bugs.result11
-rw-r--r--mysql-test/r/have_profiling.require2
-rw-r--r--mysql-test/r/index_merge_myisam.result5
-rw-r--r--mysql-test/r/innodb.result4
-rw-r--r--mysql-test/r/innodb_bug42101-nonzero.result4
-rw-r--r--mysql-test/r/innodb_bug42101.result4
-rw-r--r--mysql-test/r/key_cache.result21
-rw-r--r--mysql-test/r/mysqld--help-notwin.result947
-rw-r--r--mysql-test/r/mysqld--help-win.result953
-rw-r--r--mysql-test/r/partition_key_cache.result4
-rw-r--r--mysql-test/r/plugin.result6
-rw-r--r--mysql-test/r/profiling.result2
-rw-r--r--mysql-test/r/query_cache.result12
-rw-r--r--mysql-test/r/query_cache_ps_no_prot.result10
-rw-r--r--mysql-test/r/query_cache_ps_ps_prot.result10
-rw-r--r--mysql-test/r/select_safe.result4
-rw-r--r--mysql-test/r/sp.result9
-rw-r--r--mysql-test/r/subselect.result2
-rw-r--r--mysql-test/r/union.result2
-rw-r--r--mysql-test/r/user_limits.result2
-rw-r--r--mysql-test/r/user_var.result2
-rw-r--r--mysql-test/r/variables.result99
-rw-r--r--mysql-test/suite/binlog/r/binlog_grant.result4
-rw-r--r--mysql-test/suite/binlog/t/binlog_grant.test4
-rw-r--r--mysql-test/suite/innodb/r/innodb-zip.result12
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug47167.result8
-rw-r--r--mysql-test/suite/innodb/r/innodb_file_format.result12
-rw-r--r--mysql-test/suite/innodb/t/innodb-zip.test12
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug47167.test8
-rw-r--r--mysql-test/suite/innodb/t/innodb_file_format.test12
-rw-r--r--mysql-test/suite/ndb/r/ndb_basic.result4
-rw-r--r--mysql-test/suite/ndb/r/ndb_dd_ddl.result1
-rw-r--r--mysql-test/suite/ndb/t/ndb_dd_ddl.test1
-rw-r--r--mysql-test/suite/rpl/r/rpl_charset.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_heartbeat.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_heartbeat_basic.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_idempotency.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_max_relay_size.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_variables_stm.result5
-rw-r--r--mysql-test/suite/rpl/t/rpl_idempotency.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_sp_effects-master.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_sp_effects-slave.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_variables_stm.test5
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_2innodb.result1
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_2myisam.result1
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test1
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test1
-rw-r--r--mysql-test/suite/sys_vars/README3
-rw-r--r--mysql-test/suite/sys_vars/inc/bulk_insert_buffer_size_basic.inc1
-rw-r--r--mysql-test/suite/sys_vars/inc/delayed_insert_limit_basic.inc1
-rw-r--r--mysql-test/suite/sys_vars/inc/delayed_queue_size_basic.inc1
-rw-r--r--mysql-test/suite/sys_vars/inc/join_buffer_size_basic.inc59
-rw-r--r--mysql-test/suite/sys_vars/inc/key_cache_age_threshold_basic.inc7
-rw-r--r--mysql-test/suite/sys_vars/inc/log_warnings_basic.inc9
-rw-r--r--mysql-test/suite/sys_vars/inc/max_connect_errors_basic.inc4
-rw-r--r--mysql-test/suite/sys_vars/inc/max_seeks_for_key_basic.inc9
-rw-r--r--mysql-test/suite/sys_vars/inc/max_tmp_tables_basic.inc8
-rw-r--r--mysql-test/suite/sys_vars/inc/max_write_lock_count_basic.inc4
-rw-r--r--mysql-test/suite/sys_vars/inc/min_examined_row_limit_basic.inc9
-rw-r--r--mysql-test/suite/sys_vars/inc/myisam_max_sort_file_size_basic.inc9
-rw-r--r--mysql-test/suite/sys_vars/inc/myisam_repair_threads_basic.inc9
-rw-r--r--mysql-test/suite/sys_vars/inc/myisam_sort_buffer_size_basic.inc9
-rw-r--r--mysql-test/suite/sys_vars/inc/net_retry_count_basic.inc10
-rw-r--r--mysql-test/suite/sys_vars/inc/query_alloc_block_size_basic.inc17
-rw-r--r--mysql-test/suite/sys_vars/inc/query_cache_limit_basic.inc1
-rw-r--r--mysql-test/suite/sys_vars/inc/query_cache_min_res_unit_basic.inc3
-rw-r--r--mysql-test/suite/sys_vars/inc/query_cache_size_basic.inc4
-rw-r--r--mysql-test/suite/sys_vars/inc/range_alloc_block_size_basic.inc11
-rw-r--r--mysql-test/suite/sys_vars/inc/rpl_recovery_rank_basic.inc4
-rw-r--r--mysql-test/suite/sys_vars/inc/slave_transaction_retries_basic.inc6
-rw-r--r--mysql-test/suite/sys_vars/inc/sort_buffer_size_basic.inc44
-rw-r--r--mysql-test/suite/sys_vars/inc/transaction_alloc_block_size_basic.inc6
-rw-r--r--mysql-test/suite/sys_vars/inc/transaction_prealloc_size_basic.inc4
-rw-r--r--mysql-test/suite/sys_vars/r/all_vars.result12
-rw-r--r--mysql-test/suite/sys_vars/r/auto_increment_increment_basic.result9
-rw-r--r--mysql-test/suite/sys_vars/r/auto_increment_increment_func.result3
-rw-r--r--mysql-test/suite/sys_vars/r/auto_increment_offset_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/auto_increment_offset_func.result6
-rw-r--r--mysql-test/suite/sys_vars/r/autocommit_basic.result (renamed from mysql-test/suite/sys_vars/r/auto_commit_basic.result)17
-rw-r--r--mysql-test/suite/sys_vars/r/autocommit_func.result1
-rw-r--r--mysql-test/suite/sys_vars/r/automatic_sp_privileges_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/back_log_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/big_tables_basic.result11
-rw-r--r--mysql-test/suite/sys_vars/r/binlog_cache_size_basic_32.result6
-rw-r--r--mysql-test/suite/sys_vars/r/binlog_cache_size_basic_64.result8
-rw-r--r--mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_32.result1
-rw-r--r--mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_64.result1
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_client_basic.result10
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_client_func.result13
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_connection_basic.result3
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_database_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_database_func.result3
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_filesystem_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_results_basic.resultbin16478 -> 16478 bytes
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_server_basic.result9
-rw-r--r--mysql-test/suite/sys_vars/r/character_sets_dir_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/collation_database_basic.result5
-rw-r--r--mysql-test/suite/sys_vars/r/collation_database_func.result2
-rw-r--r--mysql-test/suite/sys_vars/r/completion_type_basic.result69
-rw-r--r--mysql-test/suite/sys_vars/r/concurrent_insert_basic.result71
-rw-r--r--mysql-test/suite/sys_vars/r/concurrent_insert_func.result2
-rw-r--r--mysql-test/suite/sys_vars/r/connect_timeout_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/date_format_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/datetime_format_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/debug_basic.result25
-rw-r--r--mysql-test/suite/sys_vars/r/debug_sync_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/default_storage_engine_basic.result117
-rw-r--r--mysql-test/suite/sys_vars/r/default_week_format_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/delay_key_write_basic.result10
-rw-r--r--mysql-test/suite/sys_vars/r/delayed_insert_limit_basic_32.result1
-rw-r--r--mysql-test/suite/sys_vars/r/delayed_insert_limit_basic_64.result1
-rw-r--r--mysql-test/suite/sys_vars/r/delayed_insert_timeout_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/delayed_queue_size_basic_32.result1
-rw-r--r--mysql-test/suite/sys_vars/r/delayed_queue_size_basic_64.result1
-rw-r--r--mysql-test/suite/sys_vars/r/div_precision_increment_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/div_precision_increment_func.result7
-rw-r--r--mysql-test/suite/sys_vars/r/engine_condition_pushdown_basic.result24
-rw-r--r--mysql-test/suite/sys_vars/r/event_scheduler_basic.result5
-rw-r--r--mysql-test/suite/sys_vars/r/expire_logs_days_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/flush_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/flush_time_basic.result41
-rw-r--r--mysql-test/suite/sys_vars/r/foreign_key_checks_basic.result23
-rw-r--r--mysql-test/suite/sys_vars/r/foreign_key_checks_func.result3
-rw-r--r--mysql-test/suite/sys_vars/r/ft_boolean_syntax_basic.result3
-rw-r--r--mysql-test/suite/sys_vars/r/ft_boolean_syntax_func.result7
-rw-r--r--mysql-test/suite/sys_vars/r/ft_max_word_len_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/ft_min_word_len_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/ft_query_expansion_limit_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/ft_stopword_file_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/general_log_file_basic.result7
-rw-r--r--mysql-test/suite/sys_vars/r/general_log_func.result13
-rw-r--r--mysql-test/suite/sys_vars/r/group_concat_max_len_basic.result9
-rw-r--r--mysql-test/suite/sys_vars/r/have_profiling_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/identity_basic.result9
-rw-r--r--mysql-test/suite/sys_vars/r/ignore_builtin_innodb_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/init_connect_basic.resultbin3580 -> 3867 bytes
-rw-r--r--mysql-test/suite/sys_vars/r/init_file_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_autoextend_increment_basic.result20
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_commit_concurrency_basic.result43
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_concurrency_tickets_basic.result (renamed from mysql-test/suite/sys_vars/r/innodb_concurrency_tickets_basic_64.result)14
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_concurrency_tickets_basic_32.result100
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_fast_shutdown_basic.result26
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_flush_log_at_trx_commit_basic.result10
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_basic.result10
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_max_purge_lag_basic.result (renamed from mysql-test/suite/sys_vars/r/innodb_max_purge_lag_basic_64.result)8
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_max_purge_lag_basic_32.result94
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_support_xa_basic.result28
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_sync_spin_loops_basic.result (renamed from mysql-test/suite/sys_vars/r/innodb_sync_spin_loops_basic_64.result)8
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_sync_spin_loops_basic_32.result94
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_table_locks_basic.result24
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_thread_concurrency_basic.result10
-rw-r--r--mysql-test/suite/sys_vars/r/insert_id_basic.result9
-rw-r--r--mysql-test/suite/sys_vars/r/interactive_timeout_basic.result9
-rw-r--r--mysql-test/suite/sys_vars/r/join_buffer_size_basic_32.result115
-rw-r--r--mysql-test/suite/sys_vars/r/join_buffer_size_basic_64.result123
-rw-r--r--mysql-test/suite/sys_vars/r/keep_files_on_create_basic.result11
-rw-r--r--mysql-test/suite/sys_vars/r/key_buffer_size_basic.result (renamed from mysql-test/suite/sys_vars/r/key_buffer_size_basic_32.result)59
-rw-r--r--mysql-test/suite/sys_vars/r/key_buffer_size_basic_64.result100
-rw-r--r--mysql-test/suite/sys_vars/r/key_buffer_size_func.result3
-rw-r--r--mysql-test/suite/sys_vars/r/key_cache_age_threshold_basic_32.result23
-rw-r--r--mysql-test/suite/sys_vars/r/key_cache_age_threshold_basic_64.result25
-rw-r--r--mysql-test/suite/sys_vars/r/key_cache_block_size_basic.result (renamed from mysql-test/suite/sys_vars/r/key_cache_block_size_basic_64.result)19
-rw-r--r--mysql-test/suite/sys_vars/r/key_cache_block_size_basic_32.result142
-rw-r--r--mysql-test/suite/sys_vars/r/key_cache_division_limit_basic.result (renamed from mysql-test/suite/sys_vars/r/key_cache_division_limit_basic_64.result)14
-rw-r--r--mysql-test/suite/sys_vars/r/key_cache_division_limit_basic_32.result139
-rw-r--r--mysql-test/suite/sys_vars/r/large_files_support_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/large_page_size_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/large_pages_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/last_insert_id_basic.result27
-rw-r--r--mysql-test/suite/sys_vars/r/lc_messages_basic.result46
-rw-r--r--mysql-test/suite/sys_vars/r/lc_messages_dir_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/lc_time_names_basic.result22
-rw-r--r--mysql-test/suite/sys_vars/r/locked_in_memory_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/log_basic.result10
-rw-r--r--mysql-test/suite/sys_vars/r/log_bin_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/log_bin_trust_function_creators_basic.result8
-rw-r--r--mysql-test/suite/sys_vars/r/log_bin_trust_routine_creators_basic.result121
-rw-r--r--mysql-test/suite/sys_vars/r/log_error_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/log_output_basic.result34
-rw-r--r--mysql-test/suite/sys_vars/r/log_queries_not_using_indexes_basic.result33
-rw-r--r--mysql-test/suite/sys_vars/r/log_slave_updates_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/log_slow_queries_basic.result112
-rw-r--r--mysql-test/suite/sys_vars/r/log_warnings_basic_32.result9
-rw-r--r--mysql-test/suite/sys_vars/r/log_warnings_basic_64.result9
-rw-r--r--mysql-test/suite/sys_vars/r/long_query_time_basic.result24
-rw-r--r--mysql-test/suite/sys_vars/r/low_priority_updates_basic.result12
-rw-r--r--mysql-test/suite/sys_vars/r/lower_case_file_system_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/lower_case_table_names_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result16
-rw-r--r--mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic.result (renamed from mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_32.result)29
-rw-r--r--mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_64.result141
-rw-r--r--mysql-test/suite/sys_vars/r/max_binlog_size_basic.result13
-rw-r--r--mysql-test/suite/sys_vars/r/max_connect_errors_basic_32.result3
-rw-r--r--mysql-test/suite/sys_vars/r/max_connect_errors_basic_64.result3
-rw-r--r--mysql-test/suite/sys_vars/r/max_connections_basic.result3
-rw-r--r--mysql-test/suite/sys_vars/r/max_delayed_threads_basic.result34
-rw-r--r--mysql-test/suite/sys_vars/r/max_error_count_basic.result10
-rw-r--r--mysql-test/suite/sys_vars/r/max_heap_table_size_basic.result (renamed from mysql-test/suite/sys_vars/r/max_heap_table_size_basic_32.result)43
-rw-r--r--mysql-test/suite/sys_vars/r/max_heap_table_size_basic_64.result196
-rw-r--r--mysql-test/suite/sys_vars/r/max_insert_delayed_threads_basic.result71
-rw-r--r--mysql-test/suite/sys_vars/r/max_join_size_basic.result51
-rw-r--r--mysql-test/suite/sys_vars/r/max_length_for_sort_data_basic.result8
-rw-r--r--mysql-test/suite/sys_vars/r/max_prepared_stmt_count_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result15
-rw-r--r--mysql-test/suite/sys_vars/r/max_seeks_for_key_basic_32.result9
-rw-r--r--mysql-test/suite/sys_vars/r/max_seeks_for_key_basic_64.result9
-rw-r--r--mysql-test/suite/sys_vars/r/max_sort_length_basic.result8
-rw-r--r--mysql-test/suite/sys_vars/r/max_sp_recursion_depth_basic.result8
-rw-r--r--mysql-test/suite/sys_vars/r/max_tmp_tables_basic_32.result8
-rw-r--r--mysql-test/suite/sys_vars/r/max_tmp_tables_basic_64.result8
-rw-r--r--mysql-test/suite/sys_vars/r/max_user_connections_basic.result40
-rw-r--r--mysql-test/suite/sys_vars/r/max_write_lock_count_basic_32.result4
-rw-r--r--mysql-test/suite/sys_vars/r/max_write_lock_count_basic_64.result4
-rw-r--r--mysql-test/suite/sys_vars/r/maximum_basic.result18
-rw-r--r--mysql-test/suite/sys_vars/r/min_examined_row_limit_basic_32.result9
-rw-r--r--mysql-test/suite/sys_vars/r/min_examined_row_limit_basic_64.result9
-rw-r--r--mysql-test/suite/sys_vars/r/myisam_data_pointer_size_basic.result5
-rw-r--r--mysql-test/suite/sys_vars/r/myisam_data_pointer_size_func.result1
-rw-r--r--mysql-test/suite/sys_vars/r/myisam_max_sort_file_size_basic_32.result20
-rw-r--r--mysql-test/suite/sys_vars/r/myisam_max_sort_file_size_basic_64.result20
-rw-r--r--mysql-test/suite/sys_vars/r/myisam_mmap_size_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/myisam_recover_options_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/myisam_repair_threads_basic_32.result8
-rw-r--r--mysql-test/suite/sys_vars/r/myisam_repair_threads_basic_64.result8
-rw-r--r--mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic.result184
-rw-r--r--mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result8
-rw-r--r--mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_64.result8
-rw-r--r--mysql-test/suite/sys_vars/r/myisam_stats_method_basic.result30
-rw-r--r--mysql-test/suite/sys_vars/r/named_pipe_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/net_buffer_length_basic.result16
-rw-r--r--mysql-test/suite/sys_vars/r/net_read_timeout_basic.result9
-rw-r--r--mysql-test/suite/sys_vars/r/net_retry_count_basic_32.result9
-rw-r--r--mysql-test/suite/sys_vars/r/net_retry_count_basic_64.result9
-rw-r--r--mysql-test/suite/sys_vars/r/net_write_timeout_basic.result9
-rw-r--r--mysql-test/suite/sys_vars/r/new_basic.result11
-rw-r--r--mysql-test/suite/sys_vars/r/old_alter_table_basic.result40
-rw-r--r--mysql-test/suite/sys_vars/r/old_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/old_passwords_basic.result11
-rw-r--r--mysql-test/suite/sys_vars/r/open_files_limit_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/optimizer_prune_level_basic.result5
-rw-r--r--mysql-test/suite/sys_vars/r/optimizer_search_depth_basic.result9
-rw-r--r--mysql-test/suite/sys_vars/r/optimizer_switch_basic.result54
-rw-r--r--mysql-test/suite/sys_vars/r/pid_file_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/plugin_dir_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/port_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/preload_buffer_size_basic.result9
-rw-r--r--mysql-test/suite/sys_vars/r/profiling_basic.result40
-rw-r--r--mysql-test/suite/sys_vars/r/profiling_history_size_basic.result50
-rw-r--r--mysql-test/suite/sys_vars/r/protocol_version_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/pseudo_thread_id_basic.result27
-rw-r--r--mysql-test/suite/sys_vars/r/query_alloc_block_size_basic_32.result31
-rw-r--r--mysql-test/suite/sys_vars/r/query_alloc_block_size_basic_64.result37
-rw-r--r--mysql-test/suite/sys_vars/r/query_cache_limit_basic_32.result1
-rw-r--r--mysql-test/suite/sys_vars/r/query_cache_limit_basic_64.result1
-rw-r--r--mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic_32.result3
-rw-r--r--mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic_64.result3
-rw-r--r--mysql-test/suite/sys_vars/r/query_cache_type_basic.result35
-rw-r--r--mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_basic.result24
-rw-r--r--mysql-test/suite/sys_vars/r/query_prealloc_size_basic.result (renamed from mysql-test/suite/sys_vars/r/query_prealloc_size_basic_64.result)12
-rw-r--r--mysql-test/suite/sys_vars/r/query_prealloc_size_basic_32.result166
-rw-r--r--mysql-test/suite/sys_vars/r/rand_seed1_basic.result27
-rw-r--r--mysql-test/suite/sys_vars/r/rand_seed2_basic.result27
-rw-r--r--mysql-test/suite/sys_vars/r/range_alloc_block_size_basic_32.result11
-rw-r--r--mysql-test/suite/sys_vars/r/range_alloc_block_size_basic_64.result21
-rw-r--r--mysql-test/suite/sys_vars/r/read_buffer_size_basic.result86
-rw-r--r--mysql-test/suite/sys_vars/r/read_only_basic.result3
-rw-r--r--mysql-test/suite/sys_vars/r/read_rnd_buffer_size_basic.result117
-rw-r--r--mysql-test/suite/sys_vars/r/relay_log_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/relay_log_index_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/relay_log_info_file_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/relay_log_recovery_basic.result41
-rw-r--r--mysql-test/suite/sys_vars/r/relay_log_space_limit_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/report_host_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/report_password_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/report_port_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/report_user_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/rpl_init_slave_func.result12
-rw-r--r--mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_32.result32
-rw-r--r--mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_64.result35
-rw-r--r--mysql-test/suite/sys_vars/r/secure_file_priv_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/server_id_basic.result (renamed from mysql-test/suite/sys_vars/r/server_id_basic_64.result)5
-rw-r--r--mysql-test/suite/sys_vars/r/server_id_basic_32.result121
-rw-r--r--mysql-test/suite/sys_vars/r/shared_memory_base_name_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/shared_memory_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/skip_external_locking_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/skip_networking_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/skip_show_database_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/slave_allow_batching_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/slave_load_tmpdir_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/slave_net_timeout_basic.result5
-rw-r--r--mysql-test/suite/sys_vars/r/slave_skip_errors_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/slave_transaction_retries_basic_32.result5
-rw-r--r--mysql-test/suite/sys_vars/r/slave_transaction_retries_basic_64.result5
-rw-r--r--mysql-test/suite/sys_vars/r/slow_launch_time_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/slow_query_log_file_basic.result7
-rw-r--r--mysql-test/suite/sys_vars/r/socket_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result98
-rw-r--r--mysql-test/suite/sys_vars/r/sort_buffer_size_basic_64.result98
-rw-r--r--mysql-test/suite/sys_vars/r/sql_auto_is_null_basic.result62
-rw-r--r--mysql-test/suite/sys_vars/r/sql_big_selects_basic.result24
-rw-r--r--mysql-test/suite/sys_vars/r/sql_big_selects_func.result2
-rw-r--r--mysql-test/suite/sys_vars/r/sql_big_tables_basic.result27
-rw-r--r--mysql-test/suite/sys_vars/r/sql_buffer_result_basic.result37
-rw-r--r--mysql-test/suite/sys_vars/r/sql_log_bin_basic.result22
-rw-r--r--mysql-test/suite/sys_vars/r/sql_log_off_basic.result27
-rw-r--r--mysql-test/suite/sys_vars/r/sql_log_off_func.result1
-rw-r--r--mysql-test/suite/sys_vars/r/sql_log_update_basic.result46
-rw-r--r--mysql-test/suite/sys_vars/r/sql_low_priority_updates_basic.result26
-rw-r--r--mysql-test/suite/sys_vars/r/sql_max_join_size_basic.result61
-rw-r--r--mysql-test/suite/sys_vars/r/sql_max_join_size_func.result14
-rw-r--r--mysql-test/suite/sys_vars/r/sql_mode_basic.result76
-rw-r--r--mysql-test/suite/sys_vars/r/sql_mode_func.result4
-rw-r--r--mysql-test/suite/sys_vars/r/sql_notes_basic.result27
-rw-r--r--mysql-test/suite/sys_vars/r/sql_quote_show_create_basic.result27
-rw-r--r--mysql-test/suite/sys_vars/r/sql_safe_updates_basic.result27
-rw-r--r--mysql-test/suite/sys_vars/r/sql_select_limit_basic.result40
-rw-r--r--mysql-test/suite/sys_vars/r/sql_slave_skip_counter_basic.result13
-rw-r--r--mysql-test/suite/sys_vars/r/sql_warnings_basic.result34
-rw-r--r--mysql-test/suite/sys_vars/r/storage_engine_basic.result14
-rw-r--r--mysql-test/suite/sys_vars/r/sync_binlog_basic.result (renamed from mysql-test/suite/sys_vars/r/sync_binlog_basic_32.result)1
-rw-r--r--mysql-test/suite/sys_vars/r/sync_binlog_basic_64.result109
-rw-r--r--mysql-test/suite/sys_vars/r/sync_master_info_basic.result47
-rw-r--r--mysql-test/suite/sys_vars/r/sync_relay_log_basic.result47
-rw-r--r--mysql-test/suite/sys_vars/r/sync_relay_log_info_basic.result47
-rw-r--r--mysql-test/suite/sys_vars/r/table_definition_cache_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/table_lock_wait_timeout_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/table_open_cache_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/thread_cache_size_basic.result47
-rw-r--r--mysql-test/suite/sys_vars/r/thread_concurrency_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/thread_stack_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/time_format_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/timestamp_basic.result (renamed from mysql-test/suite/sys_vars/r/timestamp_basic_32.result)24
-rw-r--r--mysql-test/suite/sys_vars/r/timestamp_basic_64.result68
-rw-r--r--mysql-test/suite/sys_vars/r/tmp_table_size_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_32.result10
-rw-r--r--mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_64.result20
-rw-r--r--mysql-test/suite/sys_vars/r/tx_isolation_basic.result45
-rw-r--r--mysql-test/suite/sys_vars/r/unique_checks_basic.result7
-rw-r--r--mysql-test/suite/sys_vars/r/updatable_views_with_limit_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/wait_timeout_basic.result (renamed from mysql-test/suite/sys_vars/r/wait_timeout_basic_32.result)1
-rw-r--r--mysql-test/suite/sys_vars/r/wait_timeout_basic_64.result129
-rw-r--r--mysql-test/suite/sys_vars/t/all_vars.test35
-rw-r--r--mysql-test/suite/sys_vars/t/auto_increment_increment_basic.test9
-rw-r--r--mysql-test/suite/sys_vars/t/auto_increment_increment_func.test5
-rw-r--r--mysql-test/suite/sys_vars/t/auto_increment_offset_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/auto_increment_offset_func.test7
-rw-r--r--mysql-test/suite/sys_vars/t/autocommit_basic.test (renamed from mysql-test/suite/sys_vars/t/auto_commit_basic.test)11
-rw-r--r--mysql-test/suite/sys_vars/t/autocommit_func-master.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/autocommit_func.test1
-rw-r--r--mysql-test/suite/sys_vars/t/automatic_sp_privileges_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/back_log_basic.test19
-rw-r--r--mysql-test/suite/sys_vars/t/big_tables_basic.test8
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_client_basic.test13
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_client_func.test6
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_connection_basic.test3
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_database_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_database_func.test6
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_filesystem_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_server_basic.test9
-rw-r--r--mysql-test/suite/sys_vars/t/character_sets_dir_basic.test24
-rw-r--r--mysql-test/suite/sys_vars/t/collation_connection_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/collation_database_basic.test5
-rw-r--r--mysql-test/suite/sys_vars/t/collation_database_func.test3
-rw-r--r--mysql-test/suite/sys_vars/t/collation_server_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/completion_type_basic.test31
-rw-r--r--mysql-test/suite/sys_vars/t/completion_type_func.test4
-rw-r--r--mysql-test/suite/sys_vars/t/concurrent_insert_basic.test36
-rw-r--r--mysql-test/suite/sys_vars/t/connect_timeout_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/date_format_basic.test18
-rw-r--r--mysql-test/suite/sys_vars/t/datetime_format_basic.test18
-rw-r--r--mysql-test/suite/sys_vars/t/debug_basic.test22
-rw-r--r--mysql-test/suite/sys_vars/t/debug_sync_basic.test21
-rw-r--r--mysql-test/suite/sys_vars/t/default_storage_engine_basic.test183
-rw-r--r--mysql-test/suite/sys_vars/t/default_week_format_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/delay_key_write_basic.test7
-rw-r--r--mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test18
-rw-r--r--mysql-test/suite/sys_vars/t/delayed_insert_timeout_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/disabled.def17
-rw-r--r--mysql-test/suite/sys_vars/t/div_precision_increment_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/div_precision_increment_func.test5
-rw-r--r--mysql-test/suite/sys_vars/t/engine_condition_pushdown_basic.test14
-rw-r--r--mysql-test/suite/sys_vars/t/event_scheduler_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/expire_logs_days_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/flush_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/flush_time_basic.test50
-rw-r--r--mysql-test/suite/sys_vars/t/foreign_key_checks_basic.test11
-rw-r--r--mysql-test/suite/sys_vars/t/foreign_key_checks_func.test3
-rw-r--r--mysql-test/suite/sys_vars/t/ft_boolean_syntax_basic.test3
-rw-r--r--mysql-test/suite/sys_vars/t/ft_boolean_syntax_func.test8
-rw-r--r--mysql-test/suite/sys_vars/t/ft_max_word_len_basic.test19
-rw-r--r--mysql-test/suite/sys_vars/t/ft_min_word_len_basic.test19
-rw-r--r--mysql-test/suite/sys_vars/t/ft_query_expansion_limit_basic.test19
-rw-r--r--mysql-test/suite/sys_vars/t/ft_stopword_file_basic.test19
-rw-r--r--mysql-test/suite/sys_vars/t/general_log_file_basic.test3
-rw-r--r--mysql-test/suite/sys_vars/t/general_log_func.test17
-rw-r--r--mysql-test/suite/sys_vars/t/group_concat_max_len_basic.test9
-rw-r--r--mysql-test/suite/sys_vars/t/have_profiling_basic.test23
-rw-r--r--mysql-test/suite/sys_vars/t/identity_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/ignore_builtin_innodb_basic.test19
-rw-r--r--mysql-test/suite/sys_vars/t/init_connect_basic.test5
-rw-r--r--mysql-test/suite/sys_vars/t/init_file_basic.test19
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_commit_concurrency_basic.test31
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic.test (renamed from mysql-test/suite/sys_vars/inc/innodb_concurrency_tickets_basic.inc)0
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic_32.test9
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic_64.test9
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic.test (renamed from mysql-test/suite/sys_vars/inc/innodb_max_purge_lag_basic.inc)0
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic_32.test9
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic_64.test9
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_support_xa_basic.test8
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic.test (renamed from mysql-test/suite/sys_vars/inc/innodb_sync_spin_loops_basic.inc)0
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic_32.test9
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic_64.test9
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_table_locks_basic.test6
-rw-r--r--mysql-test/suite/sys_vars/t/insert_id_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/interactive_timeout_basic.test9
-rw-r--r--mysql-test/suite/sys_vars/t/keep_files_on_create_basic.test11
-rw-r--r--mysql-test/suite/sys_vars/t/key_buffer_size_basic.test (renamed from mysql-test/suite/sys_vars/inc/key_buffer_size_basic.inc)55
-rw-r--r--mysql-test/suite/sys_vars/t/key_buffer_size_basic_32.test9
-rw-r--r--mysql-test/suite/sys_vars/t/key_buffer_size_basic_64.test9
-rw-r--r--mysql-test/suite/sys_vars/t/key_buffer_size_func.test5
-rw-r--r--mysql-test/suite/sys_vars/t/key_cache_block_size_basic.test (renamed from mysql-test/suite/sys_vars/inc/key_cache_block_size_basic.inc)7
-rw-r--r--mysql-test/suite/sys_vars/t/key_cache_block_size_basic_32.test9
-rw-r--r--mysql-test/suite/sys_vars/t/key_cache_block_size_basic_64.test9
-rw-r--r--mysql-test/suite/sys_vars/t/key_cache_division_limit_basic.test (renamed from mysql-test/suite/sys_vars/inc/key_cache_division_limit_basic.inc)5
-rw-r--r--mysql-test/suite/sys_vars/t/key_cache_division_limit_basic_32.test9
-rw-r--r--mysql-test/suite/sys_vars/t/key_cache_division_limit_basic_64.test9
-rw-r--r--mysql-test/suite/sys_vars/t/large_files_support_basic.test19
-rw-r--r--mysql-test/suite/sys_vars/t/large_page_size_basic.test23
-rw-r--r--mysql-test/suite/sys_vars/t/large_pages_basic.test19
-rw-r--r--mysql-test/suite/sys_vars/t/last_insert_id_basic.test30
-rw-r--r--mysql-test/suite/sys_vars/t/lc_messages_basic.test35
-rw-r--r--mysql-test/suite/sys_vars/t/lc_messages_dir_basic.test23
-rw-r--r--mysql-test/suite/sys_vars/t/lc_time_names_basic.test36
-rw-r--r--mysql-test/suite/sys_vars/t/locked_in_memory_basic.test20
-rw-r--r--mysql-test/suite/sys_vars/t/log_basic.test8
-rw-r--r--mysql-test/suite/sys_vars/t/log_bin_basic.test19
-rw-r--r--mysql-test/suite/sys_vars/t/log_bin_trust_function_creators_basic.test10
-rw-r--r--mysql-test/suite/sys_vars/t/log_bin_trust_routine_creators_basic.test164
-rw-r--r--mysql-test/suite/sys_vars/t/log_error_basic.test18
-rw-r--r--mysql-test/suite/sys_vars/t/log_output_basic.test29
-rw-r--r--mysql-test/suite/sys_vars/t/log_queries_not_using_indexes_basic.test25
-rw-r--r--mysql-test/suite/sys_vars/t/log_slave_updates_basic.test19
-rw-r--r--mysql-test/suite/sys_vars/t/log_slow_queries_basic.test170
-rw-r--r--mysql-test/suite/sys_vars/t/long_query_time_basic.test11
-rw-r--r--mysql-test/suite/sys_vars/t/low_priority_updates_basic.test12
-rw-r--r--mysql-test/suite/sys_vars/t/lower_case_file_system_basic.test23
-rw-r--r--mysql-test/suite/sys_vars/t/lower_case_table_names_basic.test23
-rw-r--r--mysql-test/suite/sys_vars/t/max_allowed_packet_basic.test12
-rw-r--r--mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic.test (renamed from mysql-test/suite/sys_vars/inc/max_binlog_cache_size_basic.inc)4
-rw-r--r--mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic_32.test9
-rw-r--r--mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic_64.test9
-rw-r--r--mysql-test/suite/sys_vars/t/max_binlog_size_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/max_connections_basic.test5
-rw-r--r--mysql-test/suite/sys_vars/t/max_delayed_threads_basic.test14
-rw-r--r--mysql-test/suite/sys_vars/t/max_error_count_basic.test10
-rw-r--r--mysql-test/suite/sys_vars/t/max_heap_table_size_basic.test (renamed from mysql-test/suite/sys_vars/inc/max_heap_table_size_basic.inc)13
-rw-r--r--mysql-test/suite/sys_vars/t/max_heap_table_size_basic_32.test9
-rw-r--r--mysql-test/suite/sys_vars/t/max_heap_table_size_basic_64.test9
-rw-r--r--mysql-test/suite/sys_vars/t/max_insert_delayed_threads_basic.test81
-rw-r--r--mysql-test/suite/sys_vars/t/max_join_size_basic.test42
-rw-r--r--mysql-test/suite/sys_vars/t/max_length_for_sort_data_basic.test8
-rw-r--r--mysql-test/suite/sys_vars/t/max_prepared_stmt_count_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/max_relay_log_size_basic.test5
-rw-r--r--mysql-test/suite/sys_vars/t/max_sort_length_basic.test8
-rw-r--r--mysql-test/suite/sys_vars/t/max_sp_recursion_depth_basic.test8
-rw-r--r--mysql-test/suite/sys_vars/t/max_user_connections_basic.test15
-rw-r--r--mysql-test/suite/sys_vars/t/maximum_basic-master.opt3
-rw-r--r--mysql-test/suite/sys_vars/t/maximum_basic.test20
-rw-r--r--mysql-test/suite/sys_vars/t/myisam_data_pointer_size_basic.test7
-rw-r--r--mysql-test/suite/sys_vars/t/myisam_data_pointer_size_func.test2
-rw-r--r--mysql-test/suite/sys_vars/t/myisam_mmap_size_basic.test18
-rw-r--r--mysql-test/suite/sys_vars/t/myisam_recover_options_basic.test18
-rw-r--r--mysql-test/suite/sys_vars/t/myisam_stats_method_basic.test24
-rw-r--r--mysql-test/suite/sys_vars/t/named_pipe_basic.test19
-rw-r--r--mysql-test/suite/sys_vars/t/net_buffer_length_basic.test18
-rw-r--r--mysql-test/suite/sys_vars/t/net_read_timeout_basic.test9
-rw-r--r--mysql-test/suite/sys_vars/t/net_write_timeout_basic.test9
-rw-r--r--mysql-test/suite/sys_vars/t/new_basic.test11
-rw-r--r--mysql-test/suite/sys_vars/t/old_alter_table_basic.test33
-rw-r--r--mysql-test/suite/sys_vars/t/old_basic.test19
-rw-r--r--mysql-test/suite/sys_vars/t/old_passwords_basic.test11
-rw-r--r--mysql-test/suite/sys_vars/t/open_files_limit_basic.test24
-rw-r--r--mysql-test/suite/sys_vars/t/optimizer_prune_level_basic.test5
-rw-r--r--mysql-test/suite/sys_vars/t/optimizer_search_depth_basic.test9
-rw-r--r--mysql-test/suite/sys_vars/t/optimizer_switch_basic.test41
-rw-r--r--mysql-test/suite/sys_vars/t/pid_file_basic.test23
-rw-r--r--mysql-test/suite/sys_vars/t/plugin_dir_basic.test29
-rw-r--r--mysql-test/suite/sys_vars/t/port_basic.test23
-rw-r--r--mysql-test/suite/sys_vars/t/preload_buffer_size_basic.test9
-rw-r--r--mysql-test/suite/sys_vars/t/profiling_basic.test35
-rw-r--r--mysql-test/suite/sys_vars/t/profiling_history_size_basic.test43
-rw-r--r--mysql-test/suite/sys_vars/t/protocol_version_basic.test18
-rw-r--r--mysql-test/suite/sys_vars/t/pseudo_thread_id_basic.test32
-rw-r--r--mysql-test/suite/sys_vars/t/query_cache_type_basic.test31
-rw-r--r--mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_basic.test14
-rw-r--r--mysql-test/suite/sys_vars/t/query_prealloc_size_basic.test (renamed from mysql-test/suite/sys_vars/inc/query_prealloc_size_basic.inc)9
-rw-r--r--mysql-test/suite/sys_vars/t/query_prealloc_size_basic_32.test9
-rw-r--r--mysql-test/suite/sys_vars/t/query_prealloc_size_basic_64.test9
-rw-r--r--mysql-test/suite/sys_vars/t/rand_seed1_basic.test30
-rw-r--r--mysql-test/suite/sys_vars/t/rand_seed2_basic.test30
-rw-r--r--mysql-test/suite/sys_vars/t/read_buffer_size_basic.test33
-rw-r--r--mysql-test/suite/sys_vars/t/read_only_basic.test3
-rw-r--r--mysql-test/suite/sys_vars/t/read_rnd_buffer_size_basic.test52
-rw-r--r--mysql-test/suite/sys_vars/t/relay_log_basic.test19
-rw-r--r--mysql-test/suite/sys_vars/t/relay_log_index_basic.test19
-rw-r--r--mysql-test/suite/sys_vars/t/relay_log_info_file_basic.test19
-rw-r--r--mysql-test/suite/sys_vars/t/relay_log_recovery_basic.test39
-rw-r--r--mysql-test/suite/sys_vars/t/relay_log_space_limit_basic.test19
-rw-r--r--mysql-test/suite/sys_vars/t/report_host_basic.test19
-rw-r--r--mysql-test/suite/sys_vars/t/report_password_basic.test19
-rw-r--r--mysql-test/suite/sys_vars/t/report_port_basic.test24
-rw-r--r--mysql-test/suite/sys_vars/t/report_user_basic.test19
-rw-r--r--mysql-test/suite/sys_vars/t/rpl_init_slave_func.test4
-rw-r--r--mysql-test/suite/sys_vars/t/secure_file_priv_basic.test23
-rw-r--r--mysql-test/suite/sys_vars/t/server_id_basic.test (renamed from mysql-test/suite/sys_vars/inc/server_id_basic.inc)7
-rw-r--r--mysql-test/suite/sys_vars/t/server_id_basic_32.test9
-rw-r--r--mysql-test/suite/sys_vars/t/server_id_basic_64.test9
-rw-r--r--mysql-test/suite/sys_vars/t/shared_memory_base_name_basic.test24
-rw-r--r--mysql-test/suite/sys_vars/t/shared_memory_basic.test19
-rw-r--r--mysql-test/suite/sys_vars/t/skip_external_locking_basic.test18
-rw-r--r--mysql-test/suite/sys_vars/t/skip_networking_basic.test18
-rw-r--r--mysql-test/suite/sys_vars/t/skip_show_database_basic.test18
-rw-r--r--mysql-test/suite/sys_vars/t/slave_allow_batching_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/slave_exec_mode_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/slave_load_tmpdir_basic.test24
-rw-r--r--mysql-test/suite/sys_vars/t/slave_net_timeout_basic.test7
-rw-r--r--mysql-test/suite/sys_vars/t/slave_skip_errors_basic.test19
-rw-r--r--mysql-test/suite/sys_vars/t/slow_launch_time_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/slow_query_log_file_basic.test3
-rw-r--r--mysql-test/suite/sys_vars/t/socket_basic.test23
-rw-r--r--mysql-test/suite/sys_vars/t/sql_auto_is_null_basic.test59
-rw-r--r--mysql-test/suite/sys_vars/t/sql_big_selects_basic.test12
-rw-r--r--mysql-test/suite/sys_vars/t/sql_big_tables_basic.test13
-rw-r--r--mysql-test/suite/sys_vars/t/sql_buffer_result_basic.test21
-rw-r--r--mysql-test/suite/sys_vars/t/sql_log_bin_basic.test10
-rw-r--r--mysql-test/suite/sys_vars/t/sql_log_off_basic.test13
-rw-r--r--mysql-test/suite/sys_vars/t/sql_log_update_basic.test35
-rw-r--r--mysql-test/suite/sys_vars/t/sql_low_priority_updates_basic.test18
-rw-r--r--mysql-test/suite/sys_vars/t/sql_max_join_size_basic.test42
-rw-r--r--mysql-test/suite/sys_vars/t/sql_mode_basic.test50
-rw-r--r--mysql-test/suite/sys_vars/t/sql_notes_basic.test13
-rw-r--r--mysql-test/suite/sys_vars/t/sql_quote_show_create_basic.test13
-rw-r--r--mysql-test/suite/sys_vars/t/sql_safe_updates_basic.test13
-rw-r--r--mysql-test/suite/sys_vars/t/sql_select_limit_basic.test33
-rw-r--r--mysql-test/suite/sys_vars/t/sql_slave_skip_counter_basic.test9
-rw-r--r--mysql-test/suite/sys_vars/t/sql_warnings_basic.test20
-rw-r--r--mysql-test/suite/sys_vars/t/storage_engine_basic.test17
-rw-r--r--mysql-test/suite/sys_vars/t/sync_binlog_basic.test (renamed from mysql-test/suite/sys_vars/inc/sync_binlog_basic.inc)1
-rw-r--r--mysql-test/suite/sys_vars/t/sync_binlog_basic_32.test9
-rw-r--r--mysql-test/suite/sys_vars/t/sync_binlog_basic_64.test9
-rw-r--r--mysql-test/suite/sys_vars/t/sync_master_info_basic.test43
-rw-r--r--mysql-test/suite/sys_vars/t/sync_relay_log_basic.test44
-rw-r--r--mysql-test/suite/sys_vars/t/sync_relay_log_info_basic.test44
-rw-r--r--mysql-test/suite/sys_vars/t/table_definition_cache_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/table_lock_wait_timeout_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/table_open_cache_basic.test3
-rw-r--r--mysql-test/suite/sys_vars/t/thread_cache_size_basic.test43
-rw-r--r--mysql-test/suite/sys_vars/t/thread_concurrency_basic.test19
-rw-r--r--mysql-test/suite/sys_vars/t/thread_stack_basic.test23
-rw-r--r--mysql-test/suite/sys_vars/t/time_format_basic.test18
-rw-r--r--mysql-test/suite/sys_vars/t/timestamp_basic.test (renamed from mysql-test/suite/sys_vars/inc/timestamp_basic.inc)16
-rw-r--r--mysql-test/suite/sys_vars/t/timestamp_basic_32.test9
-rw-r--r--mysql-test/suite/sys_vars/t/timestamp_basic_64.test9
-rw-r--r--mysql-test/suite/sys_vars/t/tx_isolation_basic.test43
-rw-r--r--mysql-test/suite/sys_vars/t/unique_checks_basic.test10
-rw-r--r--mysql-test/suite/sys_vars/t/updatable_views_with_limit_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/wait_timeout_basic.test (renamed from mysql-test/suite/sys_vars/inc/wait_timeout_basic.inc)2
-rw-r--r--mysql-test/suite/sys_vars/t/wait_timeout_basic_32.test9
-rw-r--r--mysql-test/suite/sys_vars/t/wait_timeout_basic_64.test9
-rw-r--r--mysql-test/t/archive.test2
-rw-r--r--mysql-test/t/bug46080-master.opt2
-rw-r--r--mysql-test/t/bug46080.test2
-rw-r--r--mysql-test/t/change_user.test2
-rw-r--r--mysql-test/t/date_formats.test139
-rw-r--r--mysql-test/t/ddl_i18n_koi8r.test26
-rw-r--r--mysql-test/t/ddl_i18n_utf8.test26
-rw-r--r--mysql-test/t/errors.test10
-rw-r--r--mysql-test/t/events_2.test9
-rw-r--r--mysql-test/t/events_bugs.test8
-rw-r--r--mysql-test/t/index_merge_myisam.test1
-rw-r--r--mysql-test/t/innodb_bug42101-nonzero.test4
-rw-r--r--mysql-test/t/innodb_bug42101.test4
-rw-r--r--mysql-test/t/key_cache.test10
-rw-r--r--mysql-test/t/mysql-bug45236-master.opt1
-rw-r--r--mysql-test/t/mysql_locale_posix.test16
-rw-r--r--mysql-test/t/mysqld--help-notwin.test8
-rw-r--r--mysql-test/t/mysqld--help-win.test8
-rw-r--r--mysql-test/t/mysqldump.test30
-rw-r--r--mysql-test/t/partition_key_cache.test2
-rw-r--r--mysql-test/t/profiling.test4
-rw-r--r--mysql-test/t/query_cache.test8
-rw-r--r--mysql-test/t/select_safe.test4
-rw-r--r--mysql-test/t/show_check.test2
-rw-r--r--mysql-test/t/sp.test7
-rw-r--r--mysql-test/t/user_limits.test2
-rw-r--r--mysql-test/t/user_var.test2
-rw-r--r--mysql-test/t/variables.test37
-rw-r--r--mysys/my_getopt.c325
-rw-r--r--mysys/safemalloc.c2
-rw-r--r--mysys/typelib.c226
-rw-r--r--sql-common/my_time.c6
-rw-r--r--[-rwxr-xr-x]sql/CMakeLists.txt4
-rw-r--r--sql/Makefile.am8
-rw-r--r--sql/debug_sync.cc84
-rw-r--r--sql/event_scheduler.cc2
-rw-r--r--sql/events.cc159
-rw-r--r--sql/events.h36
-rw-r--r--sql/ha_ndbcluster.cc407
-rw-r--r--sql/ha_ndbcluster.h6
-rw-r--r--sql/ha_ndbcluster_binlog.cc80
-rw-r--r--sql/ha_ndbcluster_binlog.h2
-rw-r--r--sql/ha_partition.cc6
-rw-r--r--sql/handler.cc13
-rw-r--r--sql/handler.h7
-rw-r--r--sql/item.cc2
-rw-r--r--sql/item_cmpfunc.cc2
-rw-r--r--sql/item_func.cc63
-rw-r--r--sql/item_sum.cc6
-rw-r--r--sql/item_timefunc.h2
-rw-r--r--sql/keycaches.cc163
-rw-r--r--sql/keycaches.h41
-rw-r--r--sql/log.cc58
-rw-r--r--sql/log.h21
-rw-r--r--sql/log_event.cc66
-rw-r--r--sql/log_event_old.cc30
-rw-r--r--sql/mysql_priv.h195
-rw-r--r--sql/mysqld.cc2332
-rw-r--r--sql/opt_range.cc16
-rw-r--r--sql/repl_failsafe.cc7
-rw-r--r--sql/repl_failsafe.h4
-rw-r--r--sql/rpl_record.cc1
-rw-r--r--sql/rpl_rli.cc8
-rw-r--r--sql/rpl_rli.h3
-rw-r--r--sql/set_var.cc4231
-rw-r--r--sql/set_var.h1499
-rw-r--r--sql/share/errmsg-utf8.txt8
-rw-r--r--sql/share/errmsg.txt8
-rw-r--r--sql/slave.cc19
-rw-r--r--sql/slave.h1
-rw-r--r--sql/sp_head.cc20
-rw-r--r--sql/sql_acl.cc25
-rw-r--r--sql/sql_acl.h1
-rw-r--r--sql/sql_base.cc22
-rw-r--r--sql/sql_builtin.cc.in12
-rw-r--r--sql/sql_cache.cc23
-rw-r--r--sql/sql_cache.h1
-rw-r--r--sql/sql_class.cc60
-rw-r--r--sql/sql_class.h61
-rw-r--r--sql/sql_connect.cc15
-rw-r--r--sql/sql_cursor.cc2
-rw-r--r--sql/sql_delete.cc4
-rw-r--r--sql/sql_derived.cc4
-rw-r--r--sql/sql_insert.cc6
-rw-r--r--sql/sql_lex.h14
-rw-r--r--sql/sql_parse.cc96
-rw-r--r--sql/sql_partition.cc12
-rw-r--r--sql/sql_plugin.cc649
-rw-r--r--sql/sql_plugin.h7
-rw-r--r--sql/sql_prepare.cc1
-rw-r--r--sql/sql_profile.cc4
-rw-r--r--sql/sql_repl.cc151
-rw-r--r--sql/sql_select.cc48
-rw-r--r--sql/sql_select.h4
-rw-r--r--sql/sql_show.cc26
-rw-r--r--sql/sql_table.cc44
-rw-r--r--sql/sql_test.cc7
-rw-r--r--sql/sql_union.cc8
-rw-r--r--sql/sql_update.cc19
-rw-r--r--sql/sql_view.cc9
-rw-r--r--sql/sql_yacc.yy11
-rw-r--r--sql/strfunc.cc263
-rw-r--r--sql/structs.h2
-rw-r--r--sql/sys_vars.cc2738
-rw-r--r--sql/sys_vars.h1600
-rw-r--r--sql/sys_vars_shared.h81
-rw-r--r--sql/table.cc6
-rw-r--r--sql/tztime.cc4
-rw-r--r--sql/unireg.h4
-rw-r--r--storage/heap/hp_create.c6
-rw-r--r--storage/heap/hp_rkey.c2
-rw-r--r--storage/myisam/ft_parser.c8
-rw-r--r--storage/myisam/ft_static.c18
-rw-r--r--storage/myisam/ha_myisam.cc92
-rw-r--r--storage/myisam/ha_myisam.h5
-rw-r--r--storage/myisam/mi_check.c3
-rw-r--r--storage/myisam/mi_static.c6
-rw-r--r--strings/longlong2str.c10
-rw-r--r--strings/longlong2str_asm.c2
-rw-r--r--strings/my_vsnprintf.c38
-rw-r--r--tests/mysql_client_test.c6
-rw-r--r--unittest/mysys/my_vsnprintf-t.c10
-rw-r--r--vio/viosocket.c21
739 files changed, 16071 insertions, 14727 deletions
diff --git a/.bzrignore b/.bzrignore
index 351417a4353..668a8824576 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -3070,3 +3070,5 @@ libmysqld/rpl_handler.cc
libmysqld/debug_sync.cc
libmysqld/rpl_handler.cc
dbug/tests
+libmysqld/sys_vars.cc
+libmysqld/keycaches.cc
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6e8c7db3c2a..b3efe39a988 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -255,7 +255,11 @@ FOREACH(SUBDIR ${STORAGE_SUBDIRS})
SET(ENGINE_BUILD_TYPE "NONE")
ENDIF(WITH_${ENGINE}_STORAGE_ENGINE AND MYSQL_PLUGIN_STATIC)
IF (ENGINE_BUILD_TYPE STREQUAL "STATIC")
- SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_${ENGINE_LOWER}_plugin")
+ IF(MYSQL_PLUGIN_MANDATORY)
+ SET (mysql_mandatory_plugins "${mysql_mandatory_plugins}builtin_${ENGINE_LOWER}_plugin,")
+ ELSE(MYSQL_PLUGIN_MANDATORY)
+ SET (mysql_optional_plugins "${mysql_optional_plugins}builtin_${ENGINE_LOWER}_plugin,")
+ ENDIF(MYSQL_PLUGIN_MANDATORY)
SET (MYSQLD_STATIC_ENGINE_LIBS ${MYSQLD_STATIC_ENGINE_LIBS} ${ENGINE_LOWER})
SET (STORAGE_ENGINE_DEFS "${STORAGE_ENGINE_DEFS} -DWITH_${ENGINE}_STORAGE_ENGINE")
SET (WITH_${ENGINE}_STORAGE_ENGINE TRUE)
@@ -274,12 +278,12 @@ ENDFOREACH(SUBDIR ${STORAGE_SUBDIRS})
# Special handling for partition(not really pluggable)
IF(NOT WITHOUT_PARTITION_STORAGE_ENGINE)
SET (STORAGE_ENGINE_DEFS "${STORAGE_ENGINE_DEFS} -DWITH_PARTITION_STORAGE_ENGINE")
- SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_partition_plugin")
+ SET (mysql_optional_plugins "${mysql_optional_plugins}builtin_partition_plugin,")
ENDIF(NOT WITHOUT_PARTITION_STORAGE_ENGINE)
ADD_DEFINITIONS(${STORAGE_ENGINE_DEFS})
-# Now write out our mysql_plugin_defs struct
+# Now write out our mysql_mandatory_plugins/mysql_optional_plugins structs
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc.in
${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc @ONLY)
diff --git a/Makefile.am b/Makefile.am
index d98db920701..88322206575 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -204,10 +204,6 @@ test-bt-debug:
@PERL@ ./mysql-test-run.pl --comment=debug --force --timer \
--skip-ndbcluster --skip-rpl --report-features $(EXP)
-test-bt-debug-fast:
-
-test-bt-debug-fast:
-
# Keep these for a while
test-pl: test
test-full-pl: test-full
diff --git a/client/mysql.cc b/client/mysql.cc
index be3c13bf362..726b06b02be 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -100,7 +100,7 @@ extern "C" {
#define vidattr(A) {} // Can't get this to work
#endif
-#ifdef FN_NO_CASE_SENCE
+#ifdef FN_NO_CASE_SENSE
#define cmp_database(cs,A,B) my_strcasecmp((cs), (A), (B))
#else
#define cmp_database(cs,A,B) strcmp((A),(B))
@@ -3652,7 +3652,7 @@ static void print_warnings()
mysql_store_result_for_lazy(&result);
/* Bail out when no warnings */
- if (!(num_rows= mysql_num_rows(result)))
+ if (!result || !(num_rows= mysql_num_rows(result)))
goto end;
cur= mysql_fetch_row(result);
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 79ee7fe9990..43107d838ee 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -2227,7 +2227,7 @@ do_result_format_version(struct st_command *command)
long version;
static DYNAMIC_STRING ds_version;
const struct command_arg result_format_args[] = {
- "version", ARG_STRING, TRUE, &ds_version, "Version to use",
+ {"version", ARG_STRING, TRUE, &ds_version, "Version to use"}
};
DBUG_ENTER("do_result_format_version");
@@ -6154,6 +6154,8 @@ void init_win_path_patterns()
"$MYSQL_TMP_DIR",
"$MYSQLTEST_VARDIR",
"$MASTER_MYSOCK",
+ "$MYSQL_SHAREDIR",
+ "$MYSQL_LIBDIR",
"./test/" };
int num_paths= sizeof(paths)/sizeof(char*);
int i;
@@ -7102,7 +7104,7 @@ int util_query(MYSQL* org_mysql, const char* query){
cur_con->util_mysql= mysql;
}
- return mysql_query(mysql, query);
+ DBUG_RETURN(mysql_query(mysql, query));
}
@@ -7740,6 +7742,7 @@ int main(int argc, char **argv)
cur_file->file_name= my_strdup("<stdin>", MYF(MY_WME));
cur_file->lineno= 1;
}
+ var_set_string("MYSQLTEST_FILE", cur_file->file_name);
init_re();
ps_protocol_enabled= ps_protocol;
sp_protocol_enabled= sp_protocol;
diff --git a/config/ac-macros/plugins.m4 b/config/ac-macros/plugins.m4
index 5d15afeda99..9fcfc031281 100644
--- a/config/ac-macros/plugins.m4
+++ b/config/ac-macros/plugins.m4
@@ -460,7 +460,11 @@ dnl Although this is "pretty", it breaks libmysqld build
])
])
])
- mysql_plugin_defs="$mysql_plugin_defs, [builtin_]$2[_plugin]"
+ m4_ifdef([$9],[
+ mysql_mandatory_plugins="$mysql_mandatory_plugins [builtin_]$2[_plugin],"
+ ],[
+ mysql_optional_plugins="$mysql_optional_plugins [builtin_]$2[_plugin],"
+ ])
[with_plugin_]$2=yes
AC_MSG_RESULT([yes])
m4_ifdef([$11],[
diff --git a/configure.in b/configure.in
index 402280392ba..644463bbfd9 100644
--- a/configure.in
+++ b/configure.in
@@ -2875,7 +2875,7 @@ case $SYSTEM_TYPE in
fi
# if there is no readline, but we want to build with readline, we fail
- if [test "$want_to_use_readline" = "yes"] && [test ! -d "./cmd-line-utils/readline"]
+ if [test "$want_to_use_readline" = "yes"] && [test ! -d "$srcdir/cmd-line-utils/readline"]
then
AC_MSG_ERROR([This commercially licensed MySQL source package can't
be built with libreadline. Please use --with-libedit to use
@@ -3015,8 +3015,8 @@ AC_SUBST(server_scripts)
AC_SUBST(mysql_plugin_dirs)
AC_SUBST(mysql_plugin_libs)
-AC_SUBST(mysql_plugin_defs)
-
+AC_SUBST(mysql_optional_plugins)
+AC_SUBST(mysql_mandatory_plugins)
# Now that sql_client_dirs and sql_server_dirs are stable, determine the union.
# We support client-only builds by "--without-server", but not vice versa,
diff --git a/include/config-netware.h b/include/config-netware.h
index adde3c4fbd2..a4465ea177a 100644
--- a/include/config-netware.h
+++ b/include/config-netware.h
@@ -100,7 +100,7 @@ extern "C" {
#define USE_OLD_FUNCTIONS 1
/* no case sensitivity */
-#define FN_NO_CASE_SENCE 1
+#define FN_NO_CASE_SENSE 1
/* the thread alarm is not used */
#define DONT_USE_THR_ALARM 1
diff --git a/include/config-win.h b/include/config-win.h
index 68248c09bef..f8d51165bc2 100644
--- a/include/config-win.h
+++ b/include/config-win.h
@@ -318,10 +318,8 @@ inline ulonglong double2ulonglong(double d)
#define strcasecmp stricmp
#define strncasecmp strnicmp
-#ifdef NOT_USED
#define HAVE_SNPRINTF /* Gave link error */
-#define _snprintf snprintf
-#endif
+#define snprintf _snprintf
#ifdef _MSC_VER
#define HAVE_LDIV /* The optimizer breaks in zortech for ldiv */
@@ -360,7 +358,7 @@ inline ulonglong double2ulonglong(double d)
#define FN_ROOTDIR "\\"
#define FN_DEVCHAR ':'
#define FN_NETWORK_DRIVES /* Uses \\ to indicate network drives */
-#define FN_NO_CASE_SENCE /* Files are not case-sensitive */
+#define FN_NO_CASE_SENSE /* Files are not case-sensitive */
#define OS_FILE_LIMIT UINT_MAX /* No limit*/
#define DO_NOT_REMOVE_THREAD_WRAPPERS
diff --git a/include/ft_global.h b/include/ft_global.h
index 752371d6bc6..ad56bce678b 100644
--- a/include/ft_global.h
+++ b/include/ft_global.h
@@ -28,6 +28,8 @@ extern "C" {
#define HA_FT_MAXBYTELEN 254
#define HA_FT_MAXCHARLEN (HA_FT_MAXBYTELEN/3)
+#define DEFAULT_FTB_SYNTAX "+ -><()~*:\"\"&|"
+
typedef struct st_ft_info FT_INFO;
struct _ft_vft
{
@@ -51,7 +53,7 @@ extern const char *ft_precompiled_stopwords[];
extern ulong ft_min_word_len;
extern ulong ft_max_word_len;
extern ulong ft_query_expansion_limit;
-extern char ft_boolean_syntax[15];
+extern const char *ft_boolean_syntax;
extern struct st_mysql_ftparser ft_default_parser;
int ft_init_stopwords(void);
diff --git a/include/keycache.h b/include/keycache.h
index 4e715dda88d..cd5c83e144e 100644
--- a/include/keycache.h
+++ b/include/keycache.h
@@ -87,10 +87,10 @@ typedef struct st_key_cache
initializing the key cache.
*/
- ulonglong param_buff_size; /* size the memory allocated for the cache */
- ulong param_block_size; /* size of the blocks in the key cache */
- ulong param_division_limit; /* min. percentage of warm blocks */
- ulong param_age_threshold; /* determines when hot block is downgraded */
+ ulonglong param_buff_size; /* size the memory allocated for the cache */
+ ulonglong param_block_size; /* size of the blocks in the key cache */
+ ulonglong param_division_limit; /* min. percentage of warm blocks */
+ ulonglong param_age_threshold; /* determines when hot block is downgraded */
/* Statistics variables. These are reset in reset_key_cache_counters(). */
ulong global_blocks_changed; /* number of currently dirty blocks */
diff --git a/include/m_string.h b/include/m_string.h
index a6a36f32ca4..f1c42b0cda4 100644
--- a/include/m_string.h
+++ b/include/m_string.h
@@ -215,7 +215,7 @@ extern char *str2int(const char *src,int radix,long lower,long upper,
long *val);
longlong my_strtoll10(const char *nptr, char **endptr, int *error);
#if SIZEOF_LONG == SIZEOF_LONG_LONG
-#define longlong2str(A,B,C) int2str((A),(B),(C),1)
+#define ll2str(A,B,C,D) int2str((A),(B),(C),(D))
#define longlong10_to_str(A,B,C) int10_to_str((A),(B),(C))
#undef strtoll
#define strtoll(A,B,C) strtol((A),(B),(C))
@@ -228,7 +228,7 @@ longlong my_strtoll10(const char *nptr, char **endptr, int *error);
#endif
#else
#ifdef HAVE_LONG_LONG
-extern char *longlong2str(longlong val,char *dst,int radix);
+extern char *ll2str(longlong val,char *dst,int radix, int upcase);
extern char *longlong10_to_str(longlong val,char *dst,int radix);
#if (!defined(HAVE_STRTOULL) || defined(NO_STRTOLL_PROTO))
extern longlong strtoll(const char *str, char **ptr, int base);
@@ -236,6 +236,7 @@ extern ulonglong strtoull(const char *str, char **ptr, int base);
#endif
#endif
#endif
+#define longlong2str(A,B,C) ll2str((A),(B),(C),1)
/* my_vsnprintf.c */
@@ -260,6 +261,13 @@ typedef struct st_mysql_lex_string LEX_STRING;
#define USTRING_WITH_LEN(X) ((uchar*) X), ((size_t) (sizeof(X) - 1))
#define C_STRING_WITH_LEN(X) ((char *) (X)), ((size_t) (sizeof(X) - 1))
+struct st_mysql_const_lex_string
+{
+ const char *str;
+ size_t length;
+};
+typedef struct st_mysql_const_lex_string LEX_CSTRING;
+
/* SPACE_INT is a word that contains only spaces */
#if SIZEOF_INT == 4
#define SPACE_INT 0x20202020
diff --git a/include/my_base.h b/include/my_base.h
index 70bd9b5e073..226a6c44733 100644
--- a/include/my_base.h
+++ b/include/my_base.h
@@ -275,17 +275,6 @@ enum ha_base_keytype {
#define HA_USES_PARSER 16384 /* Fulltext index uses [pre]parser */
#define HA_USES_BLOCK_SIZE ((uint) 32768)
#define HA_SORT_ALLOWS_SAME 512 /* Intern bit when sorting records */
-#if MYSQL_VERSION_ID < 0x50200
-/*
- Key has a part that can have end space. If this is an unique key
- we have to handle it differently from other unique keys as we can find
- many matching rows for one key (because end space are not compared)
-*/
-#define HA_END_SPACE_KEY 0 /* was: 4096 */
-#else
-#error HA_END_SPACE_KEY is obsolete, please remove it
-#endif
-
/* These flags can be added to key-seg-flag */
diff --git a/include/my_getopt.h b/include/my_getopt.h
index 7cbad607aac..32380efe289 100644
--- a/include/my_getopt.h
+++ b/include/my_getopt.h
@@ -32,6 +32,7 @@ C_MODE_START
#define GET_ENUM 12
#define GET_SET 13
#define GET_DOUBLE 14
+#define GET_FLAGSET 15
#define GET_ASK_ADDR 128
#define GET_TYPE_MASK 127
@@ -42,24 +43,40 @@ struct st_typelib;
struct my_option
{
- const char *name; /* Name of the option */
- int id; /* unique id or short option */
- const char *comment; /* option comment, for autom. --help */
- uchar **value; /* The variable value */
- uchar **u_max_value; /* The user def. max variable value */
- struct st_typelib *typelib; /* Pointer to possible values */
- ulong var_type;
- enum get_opt_arg_type arg_type;
- longlong def_value; /* Default value */
- longlong min_value; /* Min allowed value */
- longlong max_value; /* Max allowed value */
- longlong sub_size; /* Subtract this from given value */
- long block_size; /* Value should be a mult. of this */
- void *app_type; /* To be used by an application */
+ const char *name; /**< Name of the option. name=NULL
+ marks the end of the my_option[]
+ array.
+ */
+ int id; /**< For 0<id<255 it's means one
+ character for a short option
+ (like -A), if >255 no short option
+ is created, but a long option still
+ can be identified uniquely in the
+ my_get_one_option() callback.
+ If an opton needs neither special
+ treatment in the my_get_one_option()
+ nor one-letter short equivalent
+ use id=0
+ */
+ const char *comment; /**< option comment, for autom. --help.
+ if it's NULL the option is not
+ visible in --help.
+ */
+ uchar **value; /**< A pointer to the variable value */
+ uchar **u_max_value; /**< The user def. max variable value */
+ struct st_typelib *typelib; /**< Pointer to possible values */
+ ulong var_type; /**< GET_BOOL, GET_ULL, etc */
+ enum get_opt_arg_type arg_type; /**< e.g. REQUIRED_ARG or OPT_ARG */
+ longlong def_value; /**< Default value */
+ longlong min_value; /**< Min allowed value (for numbers) */
+ longlong max_value; /**< Max allowed value (for numbers) */
+ longlong sub_size; /**< Unused */
+ long block_size; /**< Value should be a mult. of this (for numbers) */
+ void *app_type; /**< To be used by an application */
};
-typedef my_bool (* my_get_one_option) (int, const struct my_option *, char * );
-typedef void (* my_error_reporter) (enum loglevel level, const char *format, ... );
+typedef my_bool (*my_get_one_option) (int, const struct my_option *, char * );
+typedef void (*my_error_reporter) (enum loglevel level, const char *format, ... );
extern char *disabled_my_option;
extern my_bool my_getopt_print_errors;
@@ -78,6 +95,8 @@ ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp,
my_bool *fix);
longlong getopt_ll_limit_value(longlong, const struct my_option *,
my_bool *fix);
+double getopt_double_limit_value(double num, const struct my_option *optp,
+ my_bool *fix);
my_bool getopt_compare_strings(const char *s, const char *t, uint length);
C_MODE_END
diff --git a/include/my_global.h b/include/my_global.h
index 255958e08b0..27fac096c19 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -93,11 +93,35 @@
#define HAVE_PSI_INTERFACE
#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */
-/* Make it easier to add conditionl code for windows */
+/* Make it easier to add conditional code in _expressions_ */
#ifdef __WIN__
-#define IF_WIN(A,B) (A)
+#define IF_WIN(A,B) A
#else
-#define IF_WIN(A,B) (B)
+#define IF_WIN(A,B) B
+#endif
+
+#ifdef __NETWARE__
+#define IF_NETWARE(A,B) A
+#else
+#define IF_NETWARE(A,B) B
+#endif
+
+#ifndef DBUG_OFF
+#define IF_DBUG(A,B) A
+#else
+#define IF_DBUG(A,B) B
+#endif
+
+#ifdef HAVE_purify
+#define IF_PURIFY(A,B) A
+#else
+#define IF_PURIFY(A,B) B
+#endif
+
+#ifdef DISABLE_GRANT_OPTIONS
+#define IF_DISABLE_GRANT_OPTIONS(A,B) A
+#else
+#define IF_DISABLE_GRANT_OPTIONS(A,B) B
#endif
#ifndef EMBEDDED_LIBRARY
@@ -249,6 +273,8 @@
#define inline_test_2(X) inline_test_1(X)
#if inline_test_2(inline) != 1
#define HAVE_INLINE
+#else
+#warning No "inline" support in C, all "static inline" functions will be instantiated in every .o file!!!
#endif
#undef inline_test_2
#undef inline_test_1
@@ -489,8 +515,7 @@ C_MODE_END
#define compile_time_assert(X) \
do \
{ \
- char compile_time_assert[(X) ? 1 : -1] \
- __attribute__ ((unused)); \
+ typedef char compile_time_assert[(X) ? 1 : -1]; \
} while(0)
#endif
@@ -787,7 +812,7 @@ typedef SOCKET_SIZE_TYPE size_socket;
#endif
/* #define EXT_IN_LIBNAME */
-/* #define FN_NO_CASE_SENCE */
+/* #define FN_NO_CASE_SENSE */
/* #define FN_UPPER_CASE TRUE */
/*
@@ -810,7 +835,7 @@ typedef SOCKET_SIZE_TYPE size_socket;
/* Typical record cash */
#define RECORD_CACHE_SIZE (uint) (64*1024-MALLOC_OVERHEAD)
/* Typical key cash */
-#define KEY_CACHE_SIZE (uint) (8*1024*1024-MALLOC_OVERHEAD)
+#define KEY_CACHE_SIZE (uint) (8*1024*1024)
/* Default size of a key cache block */
#define KEY_CACHE_BLOCK_SIZE (uint) 1024
diff --git a/include/my_pthread.h b/include/my_pthread.h
index 2558f8d5986..343bff6ba72 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -154,8 +154,7 @@ int pthread_join(pthread_t thread, void **value_ptr);
#define pthread_detach_this_thread()
#define pthread_condattr_init(A)
#define pthread_condattr_destroy(A)
-/* per the platform's documentation */
-#define pthread_yield() Sleep(0)
+#define pthread_yield() SwitchToThread()
#else /* Normal threads */
diff --git a/include/my_time.h b/include/my_time.h
index 58995f1bf62..829cb706bb6 100644
--- a/include/my_time.h
+++ b/include/my_time.h
@@ -74,12 +74,12 @@ typedef long my_time_t;
TIME_MAX_MINUTE * 60L + TIME_MAX_SECOND)
my_bool check_date(const MYSQL_TIME *ltime, my_bool not_zero_date,
- ulong flags, int *was_cut);
+ ulonglong flags, int *was_cut);
enum enum_mysql_timestamp_type
str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time,
- uint flags, int *was_cut);
+ ulonglong flags, int *was_cut);
longlong number_to_datetime(longlong nr, MYSQL_TIME *time_res,
- uint flags, int *was_cut);
+ ulonglong flags, int *was_cut);
ulonglong TIME_to_ulonglong_datetime(const MYSQL_TIME *);
ulonglong TIME_to_ulonglong_date(const MYSQL_TIME *);
ulonglong TIME_to_ulonglong_time(const MYSQL_TIME *);
diff --git a/include/myisam.h b/include/myisam.h
index e6404cb5405..d590a29c1b3 100644
--- a/include/myisam.h
+++ b/include/myisam.h
@@ -251,7 +251,7 @@ typedef struct st_columndef /* column information */
extern char * myisam_log_filename; /* Name of logfile */
extern ulong myisam_block_size;
-extern ulong myisam_concurrent_insert;
+extern uint myisam_concurrent_insert;
extern my_bool myisam_flush,myisam_delay_key_write,myisam_single_user;
extern my_off_t myisam_max_temp_length;
extern ulong myisam_bulk_insert_tree_size, myisam_data_pointer_size;
diff --git a/include/mysql.h.pp b/include/mysql.h.pp
index 0ea1d0974c2..4fef9e9ec0b 100644
--- a/include/mysql.h.pp
+++ b/include/mysql.h.pp
@@ -233,6 +233,10 @@ extern void make_type(char *to,unsigned int nr,TYPELIB *typelib);
extern const char *get_type(TYPELIB *typelib,unsigned int nr);
extern TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from);
extern TYPELIB sql_protocol_typelib;
+my_ulonglong find_set_from_flags(const TYPELIB *lib, uint default_name,
+ my_ulonglong cur_set, my_ulonglong default_set,
+ const char *str, uint length,
+ char **err_pos, uint *err_len);
typedef struct st_mysql_rows {
struct st_mysql_rows *next;
MYSQL_ROW data;
diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h
index f158dc20999..cd5b6f2fe2c 100644
--- a/include/mysql/plugin.h
+++ b/include/mysql/plugin.h
@@ -675,6 +675,7 @@ struct st_mysql_value
const char *(*val_str)(struct st_mysql_value *, char *buffer, int *length);
int (*val_real)(struct st_mysql_value *, double *realbuf);
int (*val_int)(struct st_mysql_value *, long long *intbuf);
+ int (*is_unsigned)(struct st_mysql_value *);
};
diff --git a/include/mysql/plugin.h.pp b/include/mysql/plugin.h.pp
index b7dd7bc0032..709430db3fb 100644
--- a/include/mysql/plugin.h.pp
+++ b/include/mysql/plugin.h.pp
@@ -144,6 +144,7 @@ struct st_mysql_value
const char *(*val_str)(struct st_mysql_value *, char *buffer, int *length);
int (*val_real)(struct st_mysql_value *, double *realbuf);
int (*val_int)(struct st_mysql_value *, long long *intbuf);
+ int (*is_unsigned)(struct st_mysql_value *);
};
int thd_in_lock_tables(const void* thd);
int thd_tablespace_op(const void* thd);
diff --git a/include/mysql/service_my_snprintf.h b/include/mysql/service_my_snprintf.h
index ad344864c34..9e5fe7f9c9f 100644
--- a/include/mysql/service_my_snprintf.h
+++ b/include/mysql/service_my_snprintf.h
@@ -53,7 +53,7 @@
<length modifier> can be 'l', 'll', or 'z'.
Supported formats are 's' (null pointer is accepted, printed as
- "(null)"), 'b' (extension, see below), 'c', 'd', 'u', 'x',
+ "(null)"), 'b' (extension, see below), 'c', 'd', 'u', 'x', 'o',
'X', 'p' (works as 0x%x).
Standard syntax for positional arguments $n is supported.
diff --git a/include/sslopt-longopts.h b/include/sslopt-longopts.h
index eae1424238b..b98e72e298e 100644
--- a/include/sslopt-longopts.h
+++ b/include/sslopt-longopts.h
@@ -19,8 +19,8 @@
#ifdef HAVE_OPENSSL
{"ssl", OPT_SSL_SSL,
- "Enable SSL for connection (automatically enabled with other flags). Disable with --skip-ssl.",
- (uchar **) &opt_use_ssl, (uchar **) &opt_use_ssl, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+ "Enable SSL for connection (automatically enabled with other flags).",
+ (uchar **) &opt_use_ssl, (uchar **) &opt_use_ssl, 0, GET_BOOL, OPT_ARG, 0, 0, 0,
0, 0, 0},
{"ssl-ca", OPT_SSL_CA,
"CA file in PEM format (check OpenSSL docs, implies --ssl).",
@@ -43,7 +43,7 @@
{"ssl-verify-server-cert", OPT_SSL_VERIFY_SERVER_CERT,
"Verify server's \"Common Name\" in its cert against hostname used when connecting. This option is disabled by default.",
(uchar **) &opt_ssl_verify_server_cert, (uchar **) &opt_ssl_verify_server_cert,
- 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
#endif /* HAVE_OPENSSL */
#endif /* SSLOPT_LONGOPTS_INCLUDED */
diff --git a/include/typelib.h b/include/typelib.h
index 46106d1bdab..c6a7f7a42e9 100644
--- a/include/typelib.h
+++ b/include/typelib.h
@@ -36,4 +36,9 @@ extern TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from);
extern TYPELIB sql_protocol_typelib;
+my_ulonglong find_set_from_flags(const TYPELIB *lib, uint default_name,
+ my_ulonglong cur_set, my_ulonglong default_set,
+ const char *str, uint length,
+ char **err_pos, uint *err_len);
+
#endif /* _typelib_h */
diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt
index 65b8e12bc26..2eeb092b759 100644
--- a/libmysqld/CMakeLists.txt
+++ b/libmysqld/CMakeLists.txt
@@ -117,7 +117,8 @@ SET(LIBMYSQLD_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc
../sql/sql_class.cc ../sql/sql_crypt.cc ../sql/sql_cursor.cc
../sql/sql_db.cc ../sql/sql_delete.cc ../sql/sql_derived.cc
../sql/sql_do.cc ../sql/sql_error.cc ../sql/sql_handler.cc
- ../sql/sql_help.cc ../sql/sql_insert.cc ../sql/sql_lex.cc
+ ../sql/sql_help.cc ../sql/sql_insert.cc
+ ../sql/sql_lex.cc ../sql/keycaches.cc
../sql/sql_list.cc ../sql/sql_load.cc ../sql/sql_locale.cc
../sql/sql_binlog.cc ../sql/sql_manager.cc ../sql/sql_map.cc
../sql/sql_parse.cc ../sql/sql_partition.cc ../sql/sql_plugin.cc
diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am
index ec73741eaaf..c3e3086b446 100644
--- a/libmysqld/Makefile.am
+++ b/libmysqld/Makefile.am
@@ -67,7 +67,7 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
sql_lex.cc sql_list.cc sql_manager.cc sql_map.cc \
scheduler.cc sql_connect.cc sql_parse.cc \
sql_prepare.cc sql_derived.cc sql_rename.cc \
- sql_select.cc sql_do.cc sql_show.cc set_var.cc \
+ sql_select.cc sql_do.cc sql_show.cc set_var.cc sys_vars.cc \
sql_string.cc sql_table.cc sql_test.cc sql_udf.cc \
sql_update.cc sql_yacc.cc table.cc thr_malloc.cc time.cc \
unireg.cc uniques.cc sql_union.cc hash_filo.cc \
@@ -79,7 +79,7 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
sql_tablespace.cc \
rpl_injector.cc my_user.c partition_info.cc \
sql_servers.cc event_parse_data.cc sql_signal.cc \
- rpl_handler.cc
+ rpl_handler.cc keycaches.cc
libmysqld_int_a_SOURCES= $(libmysqld_sources)
nodist_libmysqld_int_a_SOURCES= $(libmysqlsources) $(sqlsources)
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index 1d6c3ee18bf..2a425edb379 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -506,6 +506,9 @@ int init_embedded_server(int argc, char **argv, char **groups)
mysql_server_end();
return 1;
}
+
+ mysql_data_home= mysql_real_data_home;
+ mysql_data_home_len= mysql_real_data_home_len;
/* Get default temporary directory */
opt_mysql_tmpdir=getenv("TMPDIR"); /* Use this if possible */
@@ -614,7 +617,7 @@ void *create_embedded_thd(int client_flag)
/* TODO - add init_connect command execution */
if (thd->variables.max_join_size == HA_POS_ERROR)
- thd->options |= OPTION_BIG_SELECTS;
+ thd->variables.option_bits |= OPTION_BIG_SELECTS;
thd->proc_info=0; // Remove 'login'
thd->command=COM_SLEEP;
thd->version=refresh_version;
diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am
index b1d0e85c70e..2686cd36355 100644
--- a/mysql-test/Makefile.am
+++ b/mysql-test/Makefile.am
@@ -99,7 +99,8 @@ TEST_DIRS = t r include std_data std_data/parts collections \
suite/ndb suite/ndb/t suite/ndb/r \
suite/rpl_ndb suite/rpl_ndb/t suite/rpl_ndb/r \
suite/parts suite/parts/t suite/parts/r suite/parts/inc \
- suite/innodb suite/innodb/t suite/innodb/r suite/innodb/include
+ suite/innodb suite/innodb/t suite/innodb/r suite/innodb/include \
+ suite/sys_vars suite/sys_vars/t suite/sys_vars/inc suite/sys_vars/r
# Used by dist-hook and install-data-local to copy all
# test files into either dist or install directory
diff --git a/mysql-test/collections/mysql-next-mr.push b/mysql-test/collections/mysql-next-mr.push
index 97101d5994c..7699e2532c3 100644
--- a/mysql-test/collections/mysql-next-mr.push
+++ b/mysql-test/collections/mysql-next-mr.push
@@ -1,4 +1,4 @@
-perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed --suite=main,binlog,innodb,federated,rpl
+perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed --suite=main,binlog,innodb,federated,rpl,sys_vars
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=ps_row --vardir=var-ps_row --ps-protocol --mysqld=--binlog-format=row --suite=main,binlog,innodb,federated,rpl
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=embedded --vardir=var-emebbed --embedded --suite=main,binlog,innodb,federated,rpl
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=rpl_binlog_row --vardir=var-rpl_binlog_row --mysqld=--binlog-format=row --suite=rpl,binlog
diff --git a/mysql-test/extra/rpl_tests/rpl_charset.test b/mysql-test/extra/rpl_tests/rpl_charset.test
index 8bcb60b0227..d884bd1178c 100644
--- a/mysql-test/extra/rpl_tests/rpl_charset.test
+++ b/mysql-test/extra/rpl_tests/rpl_charset.test
@@ -114,9 +114,7 @@ set @@character_set_server=latin5;
select @@character_set_server;
select @@character_set_server;
-# ONE_SHOT on not charset/collation stuff is not allowed
--- error 1382
-set one_shot max_join_size=10;
+set one_shot max_join_size=1000000;
# Test of wrong character set numbers;
error 1115;
diff --git a/mysql-test/include/diff_tables.inc b/mysql-test/include/diff_tables.inc
index d15dd56b35d..ad42615511a 100644
--- a/mysql-test/include/diff_tables.inc
+++ b/mysql-test/include/diff_tables.inc
@@ -60,6 +60,7 @@ disable_query_log;
--error 0,1
--remove_file $MYSQLTEST_VARDIR/tmp/diff_table_2
+
let $_diff_table=$diff_table_2;
let $_diff_i=2;
while ($_diff_i) {
diff --git a/mysql-test/include/have_thread_concurrency.inc b/mysql-test/include/have_thread_concurrency.inc
new file mode 100644
index 00000000000..730edbf4895
--- /dev/null
+++ b/mysql-test/include/have_thread_concurrency.inc
@@ -0,0 +1,10 @@
+disable_query_log;
+disable_result_log;
+set @have_thread_concurrency=0;
+select @have_thread_concurrency:=1 from information_schema.global_variables where variable_name='thread_concurrency';
+if (`select @have_thread_concurrency = 0`)
+{
+ skip Need @@thread_concurrency;
+}
+enable_result_log;
+enable_query_log;
diff --git a/mysql-test/include/index_merge1.inc b/mysql-test/include/index_merge1.inc
index d137b0957c0..ef116c5addc 100644
--- a/mysql-test/include/index_merge1.inc
+++ b/mysql-test/include/index_merge1.inc
@@ -303,7 +303,7 @@ drop table t4;
create table t4 (a int);
insert into t4 values (1),(4),(3);
set @save_join_buffer_size=@@join_buffer_size;
-set join_buffer_size= 4000;
+set join_buffer_size= 4096;
explain select max(A.key1 + B.key1 + A.key2 + B.key2 + A.key3 + B.key3 + A.key4 + B.key4 + A.key5 + B.key5)
from t0 as A force index(i1,i2), t0 as B force index (i1,i2)
where (A.key1 < 500000 or A.key2 < 3)
diff --git a/mysql-test/include/mysqld--help.inc b/mysql-test/include/mysqld--help.inc
new file mode 100644
index 00000000000..11945e6606a
--- /dev/null
+++ b/mysql-test/include/mysqld--help.inc
@@ -0,0 +1,39 @@
+#
+# mysqld --help
+#
+--source include/not_embedded.inc
+
+#
+# force lower-case-table-names=1 (linux/macosx have different defaults)
+# force symbolic-links=0 (valgrind build has a different default)
+#
+exec $MYSQLD_BOOTSTRAP_CMD --symbolic-links=0 --lower-case-table-names=1 --help --verbose > $MYSQL_TMP_DIR/mysqld--help.txt 2>&1;
+
+perl;
+ @skipvars=qw/basedir character-sets-dir datadir
+ general-log-file language lc-messages-dir
+ log log-slow-queries pid-file plugin-dir slave-load-tmpdir
+ slow-query-log-file tmpdir open-files-limit/;
+ @plugins=qw/innodb ndb ndbcluster safemalloc debug temp-pool
+ thread-concurrency super-large-pages/;
+ $re1=join('|', @skipvars, @plugins);
+ $re2=join('|', @plugins);
+ $skip=0;
+ open(F, '<', "$ENV{MYSQL_TMP_DIR}/mysqld--help.txt") or die;
+ while (<F>) {
+ next if 1../The following groups are read/;
+ next if /^($re1) /;
+ next if /^($re2)-/;
+ $skip=0 if /^ -/;
+ $skip=1 if / --($re2)\b/;
+ # fixes for 32-bit
+ s/\b4294967295\b/18446744073709551615/;
+ s/\b2146435072\b/9223372036853727232/;
+ s/\b196608\b/262144/;
+ next if /use --skip-(use-)?symbolic-links to disable/; # for valgrind, again
+ next if $skip;
+ print;
+ }
+ close F;
+EOF
+
diff --git a/mysql-test/include/query_cache.inc b/mysql-test/include/query_cache.inc
index 7ce97b42158..0cc1ebb21d6 100644
--- a/mysql-test/include/query_cache.inc
+++ b/mysql-test/include/query_cache.inc
@@ -114,7 +114,7 @@ connection default;
# This should be 'YES'.
SHOW VARIABLES LIKE 'have_query_cache';
-SET GLOBAL query_cache_size = 200000;
+SET GLOBAL query_cache_size = 204800;
flush status;
SET @@autocommit=1;
eval SET SESSION STORAGE_ENGINE = $engine_type;
diff --git a/mysql-test/include/query_cache_sql_prepare.inc b/mysql-test/include/query_cache_sql_prepare.inc
index baa041aa058..769cd535f37 100644
--- a/mysql-test/include/query_cache_sql_prepare.inc
+++ b/mysql-test/include/query_cache_sql_prepare.inc
@@ -27,7 +27,7 @@ connect (con1,localhost,root,,test,$MASTER_MYPORT,);
connection default;
set @initial_query_cache_size = @@global.query_cache_size;
-set @@global.query_cache_size=100000;
+set @@global.query_cache_size=102400;
flush status;
--disable_warnings
drop table if exists t1;
@@ -178,7 +178,7 @@ show status like 'Qcache_hits';
# then QC is re-enabled for more EXECUTE.
--echo ---- switch to connection default ----
connection default;
-set global query_cache_size=100000;
+set global query_cache_size=102400;
# Expect to see additional Qcache_hits.
# The fact that the QC was temporary disabled should have no affect
# except that the first execute will not hit results from the
@@ -235,7 +235,7 @@ prepare stmt3 from "select * from t1 where c1=10";
--echo ---- switch to connection default ----
connection default;
# then QC is enabled at EXECUTE
-set global query_cache_size=100000;
+set global query_cache_size=102400;
show status like 'Qcache_hits';
execute stmt1;
show status like 'Qcache_hits';
@@ -260,7 +260,7 @@ connection default;
set global query_cache_size=0;
prepare stmt1 from "select * from t1 where c1=?";
# then QC is enabled at EXECUTE
-set global query_cache_size=100000;
+set global query_cache_size=102400;
show status like 'Qcache_hits';
set @a=1;
execute stmt1 using @a;
@@ -509,7 +509,7 @@ execute stmt;
set @@global.query_cache_size=0;
alter table t1 add column b int;
execute stmt;
-set @@global.query_cache_size=100000;
+set @@global.query_cache_size=102400;
execute stmt;
execute stmt;
--echo #
diff --git a/mysql-test/include/show_slave_status2.inc b/mysql-test/include/show_slave_status2.inc
index 9c4e14c62c2..7e970b31d8e 100644
--- a/mysql-test/include/show_slave_status2.inc
+++ b/mysql-test/include/show_slave_status2.inc
@@ -3,6 +3,6 @@
# masked out log positions
---replace_result $MASTER_MYPORT MASTER_PORT
+--replace_result $MASTER_MYPORT MASTER_PORT $DEFAULT_MASTER_PORT 3306
--replace_column 1 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
query_vertical SHOW SLAVE STATUS;
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 03c0acfd2d0..27f4891c39e 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -68,8 +68,8 @@ use My::File::Path; # Patched version of File::Path
use File::Basename;
use File::Copy;
use File::Find;
-use File::Temp qw /tempdir/;
-use File::Spec::Functions qw / splitdir /;
+use File::Temp qw/tempdir/;
+use File::Spec::Functions qw/splitdir/;
use My::Platform;
use My::SafeProcess;
use My::ConfigFactory;
@@ -118,6 +118,8 @@ END {
}
}
+sub env_or_val($$) { defined $ENV{$_[0]} ? $ENV{$_[0]} : $_[1] }
+
my $path_config_file; # The generated config file, var/my.cnf
# Visual Studio produces executables in different sub-directories based on the
@@ -126,7 +128,7 @@ my $path_config_file; # The generated config file, var/my.cnf
# executables will be used by the test suite.
our $opt_vs_config = $ENV{'MTR_VS_CONFIG'};
-my $DEFAULT_SUITES= "main,binlog,federated,rpl,rpl_ndb,ndb,innodb";
+my $DEFAULT_SUITES= "main,sys_vars,binlog,federated,rpl,rpl_ndb,ndb,innodb";
my $opt_suites;
our $opt_verbose= 0; # Verbose output, enable with --verbose
@@ -213,7 +215,7 @@ my $start_only;
my $opt_wait_all;
my $opt_repeat= 1;
my $opt_retry= 3;
-my $opt_retry_failure= 2;
+my $opt_retry_failure= env_or_val(MTR_RETRY_FAILURE => 2);
my $opt_strace_client;
@@ -242,9 +244,9 @@ our %mysqld_variables;
my $source_dist= 0;
-my $opt_max_save_core= $ENV{MTR_MAX_SAVE_CORE} || 5;
-my $opt_max_save_datadir= $ENV{MTR_MAX_SAVE_DATADIR} || 20;
-my $opt_max_test_fail= $ENV{MTR_MAX_TEST_FAIL} || 10;
+my $opt_max_save_core= env_or_val(MTR_MAX_SAVE_CORE => 5);
+my $opt_max_save_datadir= env_or_val(MTR_MAX_SAVE_DATADIR => 20);
+my $opt_max_test_fail= env_or_val(MTR_MAX_TEST_FAIL => 10);
my $opt_parallel= $ENV{MTR_PARALLEL} || 1;
@@ -783,11 +785,12 @@ sub set_vardir {
sub command_line_setup {
my $opt_comment;
my $opt_usage;
+ my $opt_list_options;
# Read the command line options
# Note: Keep list, and the order, in sync with usage at end of this file
Getopt::Long::Configure("pass_through");
- GetOptions(
+ my %options=(
# Control what engine/variation to run
'embedded-server' => \$opt_embedded_server,
'ps-protocol' => \$opt_ps_protocol,
@@ -905,9 +908,13 @@ sub command_line_setup {
'timediff' => \&report_option,
'help|h' => \$opt_usage,
- ) or usage("Can't read options");
+ 'list-options' => \$opt_list_options,
+ );
+
+ GetOptions(%options) or usage("Can't read options");
usage("") if $opt_usage;
+ list_options(\%options) if $opt_list_options;
# --------------------------------------------------------------------------
# Setup verbosity
@@ -1925,7 +1932,6 @@ sub environment_setup {
split(':', $ENV{'LIBPATH'}) : ());
mtr_debug("LIBPATH: $ENV{'LIBPATH'}");
- $ENV{'CHARSETSDIR'}= $path_charsetsdir;
$ENV{'UMASK'}= "0660"; # The octal *string*
$ENV{'UMASK_DIR'}= "0770"; # The octal *string*
@@ -1943,9 +1949,11 @@ sub environment_setup {
$ENV{'LC_COLLATE'}= "C";
$ENV{'USE_RUNNING_SERVER'}= using_extern();
$ENV{'MYSQL_TEST_DIR'}= $glob_mysql_test_dir;
- $ENV{'DEFAULT_MASTER_PORT'}= $mysqld_variables{'master-port'} || 3306;
+ $ENV{'DEFAULT_MASTER_PORT'}= $mysqld_variables{'port'};
$ENV{'MYSQL_TMP_DIR'}= $opt_tmpdir;
$ENV{'MYSQLTEST_VARDIR'}= $opt_vardir;
+ $ENV{'MYSQL_LIBDIR'}= "$basedir/lib";
+ $ENV{'MYSQL_SHAREDIR'}= $path_language;
# ----------------------------------------------------
# Setup env for NDB
@@ -3784,7 +3792,7 @@ sub start_check_warnings ($$) {
mtr_add_arg($args, "--defaults-file=%s", $path_config_file);
mtr_add_arg($args, "--defaults-group-suffix=%s", $mysqld->after('mysqld'));
- mtr_add_arg($args, "--skip-safemalloc");
+ mtr_add_arg($args, "--loose-skip-safemalloc");
mtr_add_arg($args, "--test-file=%s", "include/check-warnings.test");
mtr_add_arg($args, "--verbose");
@@ -4208,7 +4216,7 @@ sub mysqld_arguments ($$$) {
if ( $opt_valgrind_mysqld )
{
- mtr_add_arg($args, "--skip-safemalloc");
+ mtr_add_arg($args, "--loose-skip-safemalloc");
if ( $mysql_version_id < 50100 )
{
@@ -4993,7 +5001,7 @@ sub gdb_arguments {
my $type= shift;
# Write $args to gdb init file
- my $str= join(" ", @$$args);
+ my $str= join " ", map { s/"/\\"/g; "\"$_\""; } @$$args;
my $gdb_init_file= "$opt_vardir/tmp/gdbinit.$type";
# Remove the old gdbinit file
@@ -5057,7 +5065,7 @@ sub ddd_arguments {
my $type= shift;
# Write $args to ddd init file
- my $str= join(" ", @$$args);
+ my $str= join " ", map { s/"/\\"/g; "\"$_\""; } @$$args;
my $gdb_init_file= "$opt_vardir/tmp/gdbinit.$type";
# Remove the old gdbinit file
@@ -5122,8 +5130,8 @@ sub debugger_arguments {
# vc[express] /debugexe exe arg1 .. argn
# Add /debugexe and name of the exe before args
- unshift(@$$args, "/debugexe");
unshift(@$$args, "$$exe");
+ unshift(@$$args, "/debugexe");
# Set exe to debuggername
$$exe= $debugger;
@@ -5392,3 +5400,15 @@ HERE
}
+sub list_options ($) {
+ my $hash= shift;
+
+ for (keys %$hash) {
+ s/([:=].*|[+!])$//;
+ s/\|/\n--/g;
+ print "--$_\n" unless /list-options/;
+ }
+
+ exit(1);
+}
+
diff --git a/mysql-test/r/archive.result b/mysql-test/r/archive.result
index 08618f81808..b3a634b07e2 100644
--- a/mysql-test/r/archive.result
+++ b/mysql-test/r/archive.result
@@ -12707,7 +12707,7 @@ DATA_LENGTH AVG_ROW_LENGTH
8700 4350
DROP TABLE t1;
SET @save_join_buffer_size= @@join_buffer_size;
-SET @@join_buffer_size= 8228;
+SET @@join_buffer_size= 8192;
CREATE TABLE t1(a CHAR(255)) ENGINE=archive;
INSERT INTO t1 VALUES('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),
('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),
diff --git a/mysql-test/r/bug46080.result b/mysql-test/r/bug46080.result
index 2173768cdad..f1abcde7766 100644
--- a/mysql-test/r/bug46080.result
+++ b/mysql-test/r/bug46080.result
@@ -8,6 +8,8 @@ CREATE TABLE t1(a CHAR(255));
INSERT INTO t1 VALUES ('a');
SET @@SESSION.sort_buffer_size=5*16*1000000;
SET @@SESSION.max_heap_table_size=5*1000000;
+Warnings:
+Warning 1292 Truncated incorrect max_heap_table_size value: '5000000'
# Must not crash.
SELECT GROUP_CONCAT(a ORDER BY a) FROM t1 GROUP BY a;
DROP TABLE t1;
diff --git a/mysql-test/r/cache_innodb.result b/mysql-test/r/cache_innodb.result
index b59298727c5..600ed84c3c9 100644
--- a/mysql-test/r/cache_innodb.result
+++ b/mysql-test/r/cache_innodb.result
@@ -134,7 +134,7 @@ connection default
SHOW VARIABLES LIKE 'have_query_cache';
Variable_name Value
have_query_cache YES
-SET GLOBAL query_cache_size = 200000;
+SET GLOBAL query_cache_size = 204800;
flush status;
SET @@autocommit=1;
SET SESSION STORAGE_ENGINE = InnoDB;
diff --git a/mysql-test/r/change_user.result b/mysql-test/r/change_user.result
index f8d5d900a80..1ed7fcbb8fa 100644
--- a/mysql-test/r/change_user.result
+++ b/mysql-test/r/change_user.result
@@ -18,7 +18,7 @@ change_user
SELECT @@session.sql_big_selects;
@@session.sql_big_selects
0
-SET @@global.max_join_size = -1;
+SET @@global.max_join_size = 18446744073709551615;
SET @@session.max_join_size = default;
change_user
SELECT @@session.sql_big_selects;
diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result
index b0b8316fe33..432b9b14a85 100644
--- a/mysql-test/r/date_formats.result
+++ b/mysql-test/r/date_formats.result
@@ -15,71 +15,6 @@ variable_name variable_value
DATETIME_FORMAT %Y-%m-%d %H:%i:%s
DATE_FORMAT %d.%m.%Y
TIME_FORMAT %H.%i.%s
-SET time_format='%H%i%s';
-SET time_format='%H:%i:%s.%f';
-SET time_format='%h-%i-%s.%f%p';
-SET time_format='%h:%i:%s.%f %p';
-SET time_format='%h:%i:%s%p';
-SET date_format='%Y%m%d';
-SET date_format='%Y.%m.%d';
-SET date_format='%d.%m.%Y';
-SET date_format='%m-%d-%Y';
-set datetime_format= '%Y%m%d%H%i%s';
-set datetime_format= '%Y-%m-%d %H:%i:%s';
-set datetime_format= '%m-%d-%y %H:%i:%s.%f';
-set datetime_format= '%d-%m-%Y %h:%i:%s%p';
-set datetime_format= '%H:%i:%s %Y-%m-%d';
-set datetime_format= '%H:%i:%s.%f %m-%d-%Y';
-set datetime_format= '%h:%i:%s %p %Y-%m-%d';
-set datetime_format= '%h:%i:%s.%f %p %Y-%m-%d';
-SELECT variable_name, variable_value
-FROM information_schema.session_variables
-WHERE variable_name IN ('date_format', 'datetime_format', 'time_format')
-ORDER BY variable_name;
-variable_name variable_value
-DATETIME_FORMAT %h:%i:%s.%f %p %Y-%m-%d
-DATE_FORMAT %m-%d-%Y
-TIME_FORMAT %h:%i:%s%p
-SET time_format='%h:%i:%s';
-ERROR 42000: Variable 'time_format' can't be set to the value of '%h:%i:%s'
-SET time_format='%H %i:%s';
-ERROR 42000: Variable 'time_format' can't be set to the value of '%H %i:%s'
-SET time_format='%H::%i:%s';
-ERROR 42000: Variable 'time_format' can't be set to the value of '%H::%i:%s'
-SET time_format='%H:%i:%s%f';
-ERROR 42000: Variable 'time_format' can't be set to the value of '%H:%i:%s%f'
-SET time_format='%H:%i.%f:%s';
-ERROR 42000: Variable 'time_format' can't be set to the value of '%H:%i.%f:%s'
-SET time_format='%H:%i:%s%p';
-ERROR 42000: Variable 'time_format' can't be set to the value of '%H:%i:%s%p'
-SET time_format='%h:%i:%s.%f %p %Y-%m-%d';
-ERROR 42000: Variable 'time_format' can't be set to the value of '%h:%i:%s.%f %p %Y-%m-%d'
-SET time_format='%H%i%s.%f';
-ERROR 42000: Variable 'time_format' can't be set to the value of '%H%i%s.%f'
-SET time_format='%H:%i-%s.%f';
-ERROR 42000: Variable 'time_format' can't be set to the value of '%H:%i-%s.%f'
-SET date_format='%d.%m.%d';
-ERROR 42000: Variable 'date_format' can't be set to the value of '%d.%m.%d'
-SET datetime_format='%h.%m.%y %d.%i.%s';
-ERROR 42000: Variable 'datetime_format' can't be set to the value of '%h.%m.%y %d.%i.%s'
-set datetime_format= '%H:%i:%s.%f %p %Y-%m-%d';
-ERROR 42000: Variable 'datetime_format' can't be set to the value of '%H:%i:%s.%f %p %Y-%m-%d'
-set GLOBAL datetime_format= '%H:%i:%s %Y-%m-%d';
-SET SESSION datetime_format=default;
-select @@global.datetime_format, @@session.datetime_format;
-@@global.datetime_format @@session.datetime_format
-%H:%i:%s %Y-%m-%d %H:%i:%s %Y-%m-%d
-SET GLOBAL datetime_format=default;
-SET SESSION datetime_format=default;
-select @@global.datetime_format, @@session.datetime_format;
-@@global.datetime_format @@session.datetime_format
-%Y-%m-%d %H:%i:%s %Y-%m-%d %H:%i:%s
-SET GLOBAL date_format=default;
-SET GLOBAL time_format=default;
-SET GLOBAL datetime_format=default;
-SET time_format=default;
-SET date_format=default;
-SET datetime_format=default;
select str_to_date(concat('15-01-2001',' 2:59:58.999'),
concat('%d-%m-%Y',' ','%H:%i:%s.%f'));
str_to_date(concat('15-01-2001',' 2:59:58.999'),
diff --git a/mysql-test/r/errors.result b/mysql-test/r/errors.result
index b5863b94026..79474b960f5 100644
--- a/mysql-test/r/errors.result
+++ b/mysql-test/r/errors.result
@@ -109,10 +109,10 @@ SET sql_quote_show_create= _utf8 x'5452C39C45';
ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TRÜE'
SET sql_quote_show_create=_latin1 x'5452DC45';
ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TRÜE'
-SET sql_quote_show_create='TR.E';
-ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TR.E'
-SET sql_quote_show_create=TR.E;
-ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'E'
+SET sql_quote_show_create='TRÜE';
+ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TRÜE'
+SET sql_quote_show_create=TRÜE;
+ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TRÜE'
SET NAMES binary;
SET sql_quote_show_create= _binary x'5452C39C45';
ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TR\xC3\x9CE'
diff --git a/mysql-test/r/events_2.result b/mysql-test/r/events_2.result
index 44eaa668b04..530d8559f11 100644
--- a/mysql-test/r/events_2.result
+++ b/mysql-test/r/events_2.result
@@ -13,12 +13,6 @@ ERROR HY000: Incorrect AT value: 'definitely not a datetime'
set names utf8;
create event задачка on schedule every 123 minute starts now() ends now() + interval 1 month do select 1;
drop event задачка;
-set event_scheduler=off;
-ERROR HY000: Variable 'event_scheduler' is a GLOBAL variable and should be set with SET GLOBAL
-set global event_scheduler=3;
-ERROR 42000: Variable 'event_scheduler' can't be set to the value of '3'
-set global event_scheduler=disabled;
-ERROR 42000: Variable 'event_scheduler' can't be set to the value of 'disabled'
"DISABLE the scheduler. Testing that it does not work when the variable is 0"
set global event_scheduler=off;
select definer, name, db from mysql.event;
diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result
index efe6df41ac6..a5003c936e8 100644
--- a/mysql-test/r/events_bugs.result
+++ b/mysql-test/r/events_bugs.result
@@ -725,16 +725,15 @@ DROP USER mysqltest_u1@localhost;
drop procedure if exists p;
set @old_mode= @@sql_mode;
-set @@sql_mode= pow(2,32)-1;
+set @@sql_mode= cast(pow(2,32)-1 as unsigned integer);
create event e1 on schedule every 1 day do select 1;
-select @@sql_mode;
-@@sql_mode
-REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,?,ONLY_FULL_GROUP_BY,NO_UNSIGNED_SUBTRACTION,NO_DIR_IN_CREATE,POSTGRESQL,ORACLE,MSSQL,DB2,MAXDB,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,MYSQL323,MYSQL40,ANSI,NO_AUTO_VALUE_ON_ZERO,NO_BACKSLASH_ESCAPES,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ALLOW_INVALID_DATES,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,HIGH_NOT_PRECEDENCE,NO_ENGINE_SUBSTITUTION,PAD_CHAR_TO_FULL_LENGTH
+select @@sql_mode into @full_mode;
set @@sql_mode= @old_mode;
-select replace(@full_mode, '?', 'NOT_USED') into @full_mode;
+select replace(@full_mode, ',,,', ',NOT_USED,') into @full_mode;
select replace(@full_mode, 'ALLOW_INVALID_DATES', 'INVALID_DATES') into @full_mode;
-select name from mysql.event where name = 'p' and sql_mode = @full_mode;
+select name from mysql.event where name = 'e1' and sql_mode = @full_mode;
name
+e1
drop event e1;
SET @old_server_id = @@GLOBAL.server_id;
SET GLOBAL server_id = (1 << 32) - 1;
diff --git a/mysql-test/r/have_profiling.require b/mysql-test/r/have_profiling.require
index 453ee5bb084..54caeba1dae 100644
--- a/mysql-test/r/have_profiling.require
+++ b/mysql-test/r/have_profiling.require
@@ -1,2 +1,2 @@
Variable_name Value
-have_profiling YES
+have_profiling YES
diff --git a/mysql-test/r/index_merge_myisam.result b/mysql-test/r/index_merge_myisam.result
index c639b20de91..922f7241102 100644
--- a/mysql-test/r/index_merge_myisam.result
+++ b/mysql-test/r/index_merge_myisam.result
@@ -341,9 +341,7 @@ drop table t4;
create table t4 (a int);
insert into t4 values (1),(4),(3);
set @save_join_buffer_size=@@join_buffer_size;
-set join_buffer_size= 4000;
-Warnings:
-Warning 1292 Truncated incorrect join_buffer_size value: '4000'
+set join_buffer_size= 4096;
explain select max(A.key1 + B.key1 + A.key2 + B.key2 + A.key3 + B.key3 + A.key4 + B.key4 + A.key5 + B.key5)
from t0 as A force index(i1,i2), t0 as B force index (i1,i2)
where (A.key1 < 500000 or A.key2 < 3)
@@ -1435,7 +1433,6 @@ select @@optimizer_switch;
@@optimizer_switch
index_merge=on,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on
set optimizer_switch=4;
-ERROR 42000: Variable 'optimizer_switch' can't be set to the value of '4'
set optimizer_switch=NULL;
ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'NULL'
set optimizer_switch='default,index_merge';
diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result
index 7208c529e89..6cee55482e3 100644
--- a/mysql-test/r/innodb.result
+++ b/mysql-test/r/innodb.result
@@ -1788,7 +1788,7 @@ Variable_name Value
innodb_thread_concurrency 0
set global innodb_thread_concurrency=1001;
Warnings:
-Warning 1292 Truncated incorrect thread_concurrency value: '1001'
+Warning 1292 Truncated incorrect innodb_thread_concurrency value: '1001'
show variables like "innodb_thread_concurrency";
Variable_name Value
innodb_thread_concurrency 1000
@@ -1809,7 +1809,7 @@ Variable_name Value
innodb_concurrency_tickets 1000
set global innodb_concurrency_tickets=0;
Warnings:
-Warning 1292 Truncated incorrect concurrency_tickets value: '0'
+Warning 1292 Truncated incorrect innodb_concurrency_tickets value: '0'
show variables like "innodb_concurrency_tickets";
Variable_name Value
innodb_concurrency_tickets 1
diff --git a/mysql-test/r/innodb_bug42101-nonzero.result b/mysql-test/r/innodb_bug42101-nonzero.result
index 277dfffdd35..f43cb9da239 100644
--- a/mysql-test/r/innodb_bug42101-nonzero.result
+++ b/mysql-test/r/innodb_bug42101-nonzero.result
@@ -1,5 +1,5 @@
set global innodb_commit_concurrency=0;
-ERROR HY000: Incorrect arguments to SET
+ERROR 42000: Variable 'innodb_commit_concurrency' can't be set to the value of '0'
select @@innodb_commit_concurrency;
@@innodb_commit_concurrency
1
@@ -16,7 +16,7 @@ select @@innodb_commit_concurrency;
@@innodb_commit_concurrency
1
set global innodb_commit_concurrency=0;
-ERROR HY000: Incorrect arguments to SET
+ERROR 42000: Variable 'innodb_commit_concurrency' can't be set to the value of '0'
select @@innodb_commit_concurrency;
@@innodb_commit_concurrency
1
diff --git a/mysql-test/r/innodb_bug42101.result b/mysql-test/r/innodb_bug42101.result
index 805097ffe9d..4e3367d5a54 100644
--- a/mysql-test/r/innodb_bug42101.result
+++ b/mysql-test/r/innodb_bug42101.result
@@ -3,12 +3,12 @@ select @@innodb_commit_concurrency;
@@innodb_commit_concurrency
0
set global innodb_commit_concurrency=1;
-ERROR HY000: Incorrect arguments to SET
+ERROR 42000: Variable 'innodb_commit_concurrency' can't be set to the value of '1'
select @@innodb_commit_concurrency;
@@innodb_commit_concurrency
0
set global innodb_commit_concurrency=42;
-ERROR HY000: Incorrect arguments to SET
+ERROR 42000: Variable 'innodb_commit_concurrency' can't be set to the value of '42'
select @@innodb_commit_concurrency;
@@innodb_commit_concurrency
0
diff --git a/mysql-test/r/key_cache.result b/mysql-test/r/key_cache.result
index 08d8059f61b..844109dba1f 100644
--- a/mysql-test/r/key_cache.result
+++ b/mysql-test/r/key_cache.result
@@ -274,8 +274,26 @@ Key_blocks_used 4
show status like 'key_blocks_unused';
Variable_name Value
Key_blocks_unused KEY_BLOCKS_UNUSED
+create table t1 (a int primary key);
+cache index t1 in keycache2;
+Table Op Msg_type Msg_text
+test.t1 assign_to_keycache status OK
+insert t1 values (1),(2),(3),(4),(5),(6),(7),(8);
set global keycache2.key_buffer_size=0;
+select * from t1;
+a
+1
+2
+3
+4
+5
+6
+7
+8
+drop table t1;
set global keycache3.key_buffer_size=100;
+Warnings:
+Warning 1292 Truncated incorrect key_buffer_size value: '100'
set global keycache3.key_buffer_size=0;
create table t1 (mytext text, FULLTEXT (mytext));
insert t1 values ('aaabbb');
@@ -334,8 +352,7 @@ test.t1 check status OK
DROP TABLE t1,t2;
set global key_cache_block_size= @my_key_cache_block_size;
set @@global.key_buffer_size=0;
-Warnings:
-Warning 1438 Cannot drop default keycache
+ERROR HY000: Cannot drop default keycache
select @@global.key_buffer_size;
@@global.key_buffer_size
2097152
diff --git a/mysql-test/r/mysqld--help-notwin.result b/mysql-test/r/mysqld--help-notwin.result
new file mode 100644
index 00000000000..623b4a119e4
--- /dev/null
+++ b/mysql-test/r/mysqld--help-notwin.result
@@ -0,0 +1,947 @@
+The following options may be given as the first argument:
+--print-defaults Print the program argument list and exit
+--no-defaults Don't read default options from any options file
+--defaults-file=# Only read default options from the given file #
+--defaults-extra-file=# Read this file after the global files are read
+
+ --abort-slave-event-count=#
+ Option used by mysql-test for debugging and testing of
+ replication.
+ --allow-suspicious-udfs
+ Allows use of UDFs consisting of only one symbol xxx()
+ without corresponding xxx_init() or xxx_deinit(). That
+ also means that one can load any function from any
+ library, for example exit() from libc.so
+ -a, --ansi Use ANSI SQL syntax instead of MySQL syntax. This mode
+ will also set transaction isolation level 'serializable'.
+ --archive[=name] Enable or disable ARCHIVE plugin. Possible values are ON,
+ OFF, FORCE (don't start if the plugin fails to load).
+ --auto-increment-increment[=#]
+ Auto-increment columns are incremented by this
+ --auto-increment-offset[=#]
+ Offset added to Auto-increment columns. Used when
+ auto-increment-increment != 1
+ --automatic-sp-privileges
+ Creating and dropping stored procedures alters ACLs
+ (Defaults to on; use --skip-automatic-sp-privileges to disable.)
+ --back-log=# The number of outstanding connection requests MySQL can
+ have. This comes into play when the main MySQL thread
+ gets very many connection requests in a very short time
+ -b, --basedir=name Path to installation directory. All paths are usually
+ resolved relative to this
+ --big-tables Allow big result sets by saving all temporary sets on
+ file (Solves most 'table full' errors)
+ --bind-address=name IP address to bind to.
+ --binlog-cache-size=#
+ The size of the cache to hold the SQL statements for the
+ binary log during a transaction. If you often use big,
+ multi-statement transactions you can increase this to get
+ more performance
+ --binlog-do-db=name Tells the master it should log updates for the specified
+ database, and exclude all others not explicitly
+ mentioned.
+ --binlog-format=name
+ What form of binary logging the master will use: either
+ ROW for row-based binary logging, STATEMENT for
+ statement-based binary logging, or MIXED. MIXED is
+ statement-based binary logging except for those
+ statements where only row-based is correct: those which
+ involve user-defined functions (i.e. UDFs) or the UUID()
+ function; for those, row-based binary logging is
+ automatically used. If NDBCLUSTER is enabled and
+ binlog-format is MIXED, the format switches to row-based
+ and back implicitly per each query accessing an
+ NDBCLUSTER table
+ --binlog-ignore-db=name
+ Tells the master that updates to the given database
+ should not be logged tothe binary log.
+ --binlog-row-event-max-size=#
+ The maximum size of a row-based binary log event in
+ bytes. Rows will be grouped into events smaller than this
+ size if possible. The value has to be a multiple of 256.
+ --blackhole[=name] Enable or disable BLACKHOLE plugin. Possible values are
+ ON, OFF, FORCE (don't start if the plugin fails to load).
+ --bootstrap Used by mysql installation scripts.
+ --bulk-insert-buffer-size=#
+ Size of tree cache used in bulk insert optimisation. Note
+ that this is a limit per thread!
+ --character-set-client-handshake
+ Don't ignore client side character set value sent during
+ handshake.
+ (Defaults to on; use --skip-character-set-client-handshake to disable.)
+ --character-set-filesystem=name
+ Set the filesystem character set.
+ -C, --character-set-server=name
+ Set the default character set.
+ --character-sets-dir=name
+ Directory where character sets are
+ -r, --chroot=name Chroot mysqld daemon during startup.
+ --collation-server=name
+ Set the default collation.
+ --completion-type=name
+ The transaction completion type, one of NO_CHAIN, CHAIN,
+ RELEASE
+ --concurrent-insert[=name]
+ Use concurrent insert with MyISAM. Possible values are
+ NEVER, AUTO, ALWAYS
+ --connect-timeout=# The number of seconds the mysqld server is waiting for a
+ connect packet before responding with 'Bad handshake'
+ --console Write error output on screen; Don't remove the console
+ window on windows.
+ --core-file Write core on errors.
+ -h, --datadir=name Path to the database root directory
+ --date-format=name The DATE format (ignored)
+ --datetime-format=name
+ The DATETIME format (ignored)
+ -C, --default-character-set=name
+ Set the default character set (deprecated option, use
+ --character-set-server instead).
+ --default-collation=name
+ Set the default collation (deprecated option, use
+ --collation-server instead).
+ --default-storage-engine=name
+ The default storage engine for new tables
+ --default-time-zone=name
+ Set the default time zone.
+ --default-week-format=#
+ The default week format used by WEEK() functions
+ --delay-key-write[=name]
+ Type of DELAY_KEY_WRITE
+ --delay-key-write-for-all-tables
+ Don't flush key buffers between writes for any MyISAM
+ table (Deprecated option, use --delay-key-write=all
+ instead).
+ --delayed-insert-limit=#
+ After inserting delayed_insert_limit rows, the INSERT
+ DELAYED handler will check if there are any SELECT
+ statements pending. If so, it allows these to execute
+ before continuing
+ --delayed-insert-timeout=#
+ How long a INSERT DELAYED thread should wait for INSERT
+ statements before terminating
+ --delayed-queue-size=#
+ What size queue (in rows) should be allocated for
+ handling INSERT DELAYED. If the queue becomes full, any
+ client that does INSERT DELAYED will wait until there is
+ room in the queue again
+ --des-key-file=name Load keys for des_encrypt() and des_encrypt from given
+ file.
+ --disconnect-slave-event-count=#
+ Option used by mysql-test for debugging and testing of
+ replication.
+ --div-precision-increment=#
+ Precision of the result of '/' operator will be increased
+ on that value
+ --enable-locking Deprecated option, use --external-locking instead.
+ --engine-condition-pushdown
+ Push supported query conditions to the storage engine
+ (Defaults to on; use --skip-engine-condition-pushdown to disable.)
+ --event-scheduler[=name]
+ Enable the event scheduler. Possible values are ON, OFF,
+ and DISABLED (keep the event scheduler completely
+ deactivated, it cannot be activated run-time)
+ -T, --exit-info[=#] Used for debugging; Use at your own risk!
+ --expire-logs-days=#
+ If non-zero, binary logs will be purged after
+ expire_logs_days days; possible purges happen at startup
+ and at binary log rotation
+ --external-locking Use system (external) locking (disabled by default).
+ With this option enabled you can run myisamchk to test
+ (not repair) tables while the MySQL server is running.
+ Disable with --skip-external-locking.
+ --federated[=name] Enable or disable FEDERATED plugin. Possible values are
+ ON, OFF, FORCE (don't start if the plugin fails to load).
+ --flush Flush MyISAM tables to disk between SQL commands
+ --flush-time=# A dedicated thread is created to flush all tables at the
+ given interval
+ --ft-boolean-syntax=name
+ List of operators for MATCH ... AGAINST ( ... IN BOOLEAN
+ MODE)
+ --ft-max-word-len=# The maximum length of the word to be included in a
+ FULLTEXT index. Note: FULLTEXT indexes must be rebuilt
+ after changing this variable
+ --ft-min-word-len=# The minimum length of the word to be included in a
+ FULLTEXT index. Note: FULLTEXT indexes must be rebuilt
+ after changing this variable
+ --ft-query-expansion-limit=#
+ Number of best matches to use for query expansion
+ --ft-stopword-file=name
+ Use stopwords from this file instead of built-in list
+ --gdb Set up signals usable for debugging
+ --general-log Log connections and queries to a table or log file.
+ Defaults logging to a file hostname.log or a table
+ mysql.general_logif --log-output=TABLE is used
+ --general-log-file=name
+ Log connections and queries to given file
+ --group-concat-max-len=#
+ The maximum length of the result of function
+ GROUP_CONCAT()
+ -?, --help Display this help and exit.
+ --ignore-builtin-innodb
+ Disable initialization of builtin InnoDB plugin
+ --init-connect=name Command(s) that are executed for each new connection
+ --init-file=name Read SQL commands from this file at startup
+ --init-rpl-role=name
+ Set the replication role.
+ --init-slave=name Command(s) that are executed by a slave server each time
+ the SQL thread starts
+ --interactive-timeout=#
+ The number of seconds the server waits for activity on an
+ interactive connection before closing it
+ --join-buffer-size=#
+ The size of the buffer that is used for full joins
+ --keep-files-on-create
+ Don't overwrite stale .MYD and .MYI even if no directory
+ is specified
+ --key-buffer-size=# The size of the buffer used for index blocks for MyISAM
+ tables. Increase this to get better index handling (for
+ all reads and multiple writes) to as much as you can
+ afford
+ --key-cache-age-threshold=#
+ 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
+ --key-cache-block-size=#
+ The default size of key cache blocks
+ --key-cache-division-limit=#
+ The minimum percentage of warm blocks in key cache
+ -L, --language=name Client error messages in given language. May be given as
+ a full path. Deprecated. Use --lc-messages-dir instead.
+ --large-pages Enable support for large pages
+ --lc-messages=name Set the language used for the error messages.
+ -L, --lc-messages-dir=name
+ Directory where error messages are
+ --lc-time-names=name
+ Set the language used for the month names and the days of
+ the week.
+ --local-infile Enable LOAD DATA LOCAL INFILE
+ (Defaults to on; use --skip-local-infile to disable.)
+ -l, --log[=name] Log connections and queries to file (deprecated option,
+ use --general-log/--general-log-file instead).
+ --log-bin[=name] Log update queries in binary format. Optional (but
+ strongly recommended to avoid replication problems if
+ server's hostname changes) argument should be the chosen
+ location for the binary log files.
+ --log-bin-index=name
+ File that holds the names for last binary log files.
+ --log-bin-trust-function-creators
+ If set to FALSE (the default), then when --log-bin is
+ used, creation of a stored function (or trigger) is
+ allowed only to users having the SUPER privilege and only
+ if this stored function (trigger) may not break binary
+ logging. Note that if ALL connections to this server
+ ALWAYS use row-based binary logging, the security issues
+ do not exist and the binary logging cannot break, so you
+ can safely set this to TRUE
+ --log-error[=name] Error log file
+ --log-isam[=name] Log all MyISAM changes to file.
+ -0, --log-long-format
+ Log some extra information to update log. Please note
+ that this option is deprecated; see --log-short-format
+ option.
+ --log-output=name Syntax: log-output=value[,value...], where "value" could
+ be TABLE, FILE or NONE
+ --log-queries-not-using-indexes
+ Log queries that are executed without benefit of any
+ index to the slow log if it is open
+ --log-short-format Don't log extra information to update and slow-query
+ logs.
+ --log-slave-updates Tells the slave to log the updates from the slave thread
+ to the binary log. You will need to turn it on if you
+ plan to daisy-chain the slaves
+ --log-slow-admin-statements
+ Log slow OPTIMIZE, ANALYZE, ALTER and other
+ administrative statements to the slow log if it is open.
+ --log-slow-queries[=name]
+ Log slow queries to a table or log file. Defaults logging
+ to table mysql.slow_log or hostname-slow.log if
+ --log-output=file is used. Must be enabled to activate
+ other slow log options. Deprecated option, use
+ --slow-query-log/--slow-query-log-file instead.
+ --log-slow-slave-statements
+ Log slow statements executed by slave thread to the slow
+ log if it is open.
+ --log-tc=name Path to transaction coordinator log (used for
+ transactions that affect more than one storage engine,
+ when binary log is disabled)
+ --log-tc-size=# Size of transaction coordinator log.
+ --log-update[=name] The update log is deprecated since version 5.0, is
+ replaced by the binary log and this option justs turns on
+ --log-bin instead.
+ -W, --log-warnings[=#]
+ Log some not critical warnings to the log file
+ --long-query-time=# Log all queries that have taken more than long_query_time
+ seconds to execute to file. The argument will be treated
+ as a decimal value with microsecond precision
+ --low-priority-updates
+ INSERT/DELETE/UPDATE has lower priority than selects
+ --lower-case-table-names[=#]
+ If set to 1 table names are stored in lowercase on disk
+ and table names will be case-insensitive. Should be set
+ to 2 if you are using a case insensitive file system
+ --master-info-file=name
+ The location and name of the file that remembers the
+ master and where the I/O replication thread is in the
+ master's binlogs.
+ --master-retry-count=#
+ The number of tries the slave will make to connect to the
+ master before giving up.
+ --max-allowed-packet=#
+ Max packet length to send to or receive from the server
+ --max-binlog-cache-size=#
+ Can be used to restrict the total size used to cache a
+ multi-transaction query
+ --max-binlog-dump-events=#
+ Option used by mysql-test for debugging and testing of
+ replication.
+ --max-binlog-size=# Binary log will be rotated automatically when the size
+ exceeds this value. Will also apply to relay logs if
+ max_relay_log_size is 0
+ --max-connect-errors=#
+ If there is more than this number of interrupted
+ connections from a host this host will be blocked from
+ further connections
+ --max-connections=# The number of simultaneous clients allowed
+ --max-delayed-threads=#
+ Don't start more than this number of threads to handle
+ INSERT DELAYED statements. If set to zero INSERT DELAYED
+ will be not used
+ --max-error-count=# Max number of errors/warnings to store for a statement
+ --max-heap-table-size=#
+ Don't allow creation of heap tables bigger than this
+ --max-join-size=# Joins that are probably going to read more than
+ max_join_size records return an error
+ --max-length-for-sort-data=#
+ Max number of bytes in sorted records
+ --max-prepared-stmt-count=#
+ Maximum number of prepared statements in the server
+ --max-relay-log-size=#
+ If non-zero: relay log will be rotated automatically when
+ the size exceeds this value; if zero: when the size
+ exceeds max_binlog_size
+ --max-seeks-for-key=#
+ Limit assumed max number of seeks when looking up rows
+ based on a key
+ --max-sort-length=# The number of bytes to use when sorting BLOB or TEXT
+ values (only the first max_sort_length bytes of each
+ value are used; the rest are ignored)
+ --max-sp-recursion-depth[=#]
+ Maximum stored procedure recursion depth
+ --max-tmp-tables=# Maximum number of temporary tables a client can keep open
+ at a time
+ --max-user-connections=#
+ The maximum number of active connections for a single
+ user (0 = no limit)
+ --max-write-lock-count=#
+ After this many write locks, allow some read locks to run
+ in between
+ --memlock Lock mysqld in memory.
+ --min-examined-row-limit=#
+ Don't write queries to slow log that examine fewer rows
+ than that
+ --multi-range-count=#
+ Number of key ranges to request at once
+ --myisam-block-size=#
+ Block size to be used for MyISAM index pages
+ --myisam-data-pointer-size=#
+ Default pointer size to be used for MyISAM tables
+ --myisam-max-sort-file-size=#
+ Don't use the fast sort index method to created index if
+ the temporary file would get bigger than this
+ --myisam-mmap-size=#
+ Restricts the total memory used for memory mapping of
+ MySQL tables
+ --myisam-recover-options[=name]
+ Syntax: myisam-recover-options[=option[,option...]],
+ where option can be DEFAULT, BACKUP, FORCE, QUICK, or OFF
+ --myisam-repair-threads=#
+ If larger than 1, when repairing a MyISAM table all
+ indexes will be created in parallel, with one thread per
+ index. The value of 1 disables parallel repair
+ --myisam-sort-buffer-size=#
+ The buffer that is allocated when sorting the index when
+ doing a REPAIR or when creating indexes with CREATE INDEX
+ or ALTER TABLE
+ --myisam-stats-method=name
+ Specifies how MyISAM index statistics collection code
+ should treat NULLs. Possible values of name are
+ NULLS_UNEQUAL (default behavior for 4.1 and later),
+ NULLS_EQUAL (emulate 4.0 behavior), and NULLS_IGNORED
+ --myisam-use-mmap Use memory mapping for reading and writing MyISAM tables
+ --net-buffer-length=#
+ Buffer length for TCP/IP and socket communication
+ --net-read-timeout=#
+ Number of seconds to wait for more data from a connection
+ before aborting the read
+ --net-retry-count=# If a read on a communication port is interrupted, retry
+ this many times before giving up
+ --net-write-timeout=#
+ Number of seconds to wait for a block to be written to a
+ connection before aborting the write
+ -n, --new Use very new possible "unsafe" functions
+ --old Use compatible behavior
+ --old-alter-table Use old, non-optimized alter table
+ --old-passwords Use old password encryption method (needed for 4.0 and
+ older clients)
+ --old-style-user-limits
+ Enable old-style user limits (before 5.0.3 user resources
+ were counted per each user+host vs. per account)
+ --one-thread (deprecated): Only use one thread (for debugging under
+ Linux). Use thread-handling=no-threads instead
+ --open-files-limit=#
+ 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 file descriptors
+ --optimizer-prune-level=#
+ Controls the heuristic(s) applied during query
+ optimization to prune less-promising partial plans from
+ the optimizer search space. Meaning: 0 - do not apply any
+ heuristic, thus perform exhaustive search; 1 - prune
+ plans based on number of retrieved rows
+ --optimizer-search-depth=#
+ Maximum depth of search performed by the query optimizer.
+ Values larger than the number of relations in a query
+ result in better query plans, but take longer to compile
+ a query. Values smaller than the number of tables in a
+ relation result in faster optimization, but may produce
+ very bad query plans. If set to 0, the system will
+ automatically pick a reasonable value; if set to 63, the
+ optimizer will switch to the original find_best
+ search(used for testing/comparison)
+ --optimizer-switch=name
+ optimizer_switch=option=val[,option=val...], where option
+ is one of {index_merge, index_merge_union,
+ index_merge_sort_union, index_merge_intersection} and val
+ is one of {on, off, default}
+ --partition[=name] Enable or disable partition plugin. Possible values are
+ ON, OFF, FORCE (don't start if the plugin fails to load).
+ --pid-file=name Pid file used by safe_mysqld
+ --plugin-dir=name Directory for plugins
+ --plugin-load=name Optional semicolon-separated list of plugins to load,
+ where each plugin is identified as name=library, where
+ name is the plugin name and library is the plugin library
+ in plugin_dir.
+ -P, --port=# Port number to use for connection or 0 to default to,
+ my.cnf, $MYSQL_TCP_PORT, /etc/services, built-in default
+ (3306), whatever comes first
+ --port-open-timeout=#
+ Maximum time in seconds to wait for the port to become
+ free. (Default: no wait)
+ --preload-buffer-size=#
+ The size of the buffer that is allocated when preloading
+ indexes
+ --profiling-history-size=#
+ Limit of query profiling memory
+ --query-alloc-block-size=#
+ Allocation block size for query parsing and execution
+ --query-cache-limit=#
+ Don't cache results that are bigger than this
+ --query-cache-min-res-unit=#
+ The minimum size for blocks allocated by the query cache
+ --query-cache-size=#
+ The memory allocated to store results from old queries
+ --query-cache-type=name
+ OFF = Don't cache or retrieve results. ON = Cache all
+ results except SELECT SQL_NO_CACHE ... queries. DEMAND =
+ Cache only SELECT SQL_CACHE ... queries
+ --query-cache-wlock-invalidate
+ Invalidate queries in query cache on LOCK for write
+ --query-prealloc-size=#
+ Persistent buffer for query parsing and execution
+ --range-alloc-block-size=#
+ Allocation block size for storing ranges during
+ optimization
+ --read-buffer-size=#
+ Each thread that does a sequential scan allocates a
+ buffer of this size for each table it scans. If you do
+ many sequential scans, you may want to increase this
+ value
+ --read-only Make all non-temporary tables read-only, with the
+ exception for replication (slave) threads and users with
+ the SUPER privilege
+ --read-rnd-buffer-size=#
+ When reading rows in sorted order after a sort, the rows
+ are read through this buffer to avoid a disk seeks. If
+ not set, then it's set to the value of record_buffer
+ --record-buffer=# Deprecated; use --read-buffer-size instead.
+ --relay-log=name The location and name to use for relay logs
+ --relay-log-index=name
+ The location and name to use for the file that keeps a
+ list of the last relay logs
+ --relay-log-info-file=name
+ The location and name of the file that remembers where
+ the SQL replication thread is in the relay logs
+ --relay-log-purge if disabled - do not purge relay logs. if enabled - purge
+ them as soon as they are no more needed
+ (Defaults to on; use --skip-relay-log-purge to disable.)
+ --relay-log-recovery
+ Enables automatic relay log recovery right after the
+ database startup, which means that the IO Thread starts
+ re-fetching from the master right after the last
+ transaction processed
+ --relay-log-space-limit=#
+ Maximum space to use for all relay logs
+ --replicate-do-db=name
+ Tells the slave thread to restrict replication to the
+ specified database. To specify more than one database,
+ use the directive multiple times, once for each database.
+ Note that this will only work if you do not use
+ cross-database queries such as UPDATE some_db.some_table
+ SET foo='bar' while having selected a different or no
+ database. If you need cross database updates to work,
+ make sure you have 3.23.28 or later, and use
+ replicate-wild-do-table=db_name.%.
+ --replicate-do-table=name
+ Tells the slave thread to restrict replication to the
+ specified table. To specify more than one table, use the
+ directive multiple times, once for each table. This will
+ work for cross-database updates, in contrast to
+ replicate-do-db.
+ --replicate-ignore-db=name
+ Tells the slave thread to not replicate to the specified
+ database. To specify more than one database to ignore,
+ use the directive multiple times, once for each database.
+ This option will not work if you use cross database
+ updates. If you need cross database updates to work, make
+ sure you have 3.23.28 or later, and use
+ replicate-wild-ignore-table=db_name.%.
+ --replicate-ignore-table=name
+ Tells the slave thread to not replicate to the specified
+ table. To specify more than one table to ignore, use the
+ directive multiple times, once for each table. This will
+ work for cross-datbase updates, in contrast to
+ replicate-ignore-db.
+ --replicate-rewrite-db=name
+ Updates to a database with a different name than the
+ original. Example:
+ replicate-rewrite-db=master_db_name->slave_db_name.
+ --replicate-same-server-id
+ In replication, if set to 1, do not skip events having
+ our server id. Default value is 0 (to break infinite
+ loops in circular replication). Can't be set to 1 if
+ --log-slave-updates is used.
+ --replicate-wild-do-table=name
+ Tells the slave thread to restrict replication to the
+ tables that match the specified wildcard pattern. To
+ specify more than one table, use the directive multiple
+ times, once for each table. This will work for
+ cross-database updates. Example:
+ replicate-wild-do-table=foo%.bar% will replicate only
+ updates to tables in all databases that start with foo
+ and whose table names start with bar.
+ --replicate-wild-ignore-table=name
+ Tells the slave thread to not replicate to the tables
+ that match the given wildcard pattern. To specify more
+ than one table to ignore, use the directive multiple
+ times, once for each table. This will work for
+ cross-database updates. Example:
+ replicate-wild-ignore-table=foo%.bar% will not do updates
+ to tables in databases that start with foo and whose
+ table names start with bar.
+ --report-host=name Hostname or IP of the slave to be reported to the master
+ during slave registration. Will appear in the output of
+ SHOW SLAVE HOSTS. Leave unset if you do not want the
+ slave to register itself with the master. Note that it is
+ not sufficient for the master to simply read the IP of
+ the slave off the socket once the slave connects. Due to
+ NAT and other routing issues, that IP may not be valid
+ for connecting to the slave from the master or other
+ hosts
+ --report-password=name
+ The account password of the slave to be reported to the
+ master during slave registration
+ --report-port=# Port for connecting to slave reported to the master
+ during slave registration. Set it only if the slave is
+ listening on a non-default port or if you have a special
+ tunnel from the master or other clients to the slave. If
+ not sure, leave this option unset
+ --report-user=name The account user name of the slave to be reported to the
+ master during slave registration
+ --rpl-recovery-rank=#
+ Unused, will be removed
+ --safe-mode Skip some optimize stages (for testing).
+ --safe-show-database
+ Deprecated option; use GRANT SHOW DATABASES instead...
+ --safe-user-create Don't allow new user creation by the user who has no
+ write privileges to the mysql.user table.
+ --secure-auth Disallow authentication for accounts that have old
+ (pre-4.1) passwords
+ --secure-file-priv=name
+ Limit LOAD DATA, SELECT ... OUTFILE, and LOAD_FILE() to
+ files within specified directory
+ --server-id=# Uniquely identifies the server instance in the community
+ of replication partners
+ -O, --set-variable=name
+ Change the value of a variable. Please note that this
+ option is deprecated;you can set variables directly with
+ --variable-name=value.
+ --show-slave-auth-info
+ Show user and password in SHOW SLAVE HOSTS on this master
+ --skip-grant-tables Start without grant tables. This gives all users FULL
+ ACCESS to all tables!
+ --skip-host-cache Don't cache host names.
+ --skip-locking Deprecated option, use --skip-external-locking instead.
+ --skip-name-resolve Don't resolve hostnames. All hostnames are IP's or
+ 'localhost'.
+ --skip-networking Don't allow connection with TCP/IP
+ --skip-new Don't use new, possible wrong routines.
+ --skip-show-database
+ Don't allow 'SHOW DATABASE' commands
+ --skip-slave-start If set, slave is not autostarted.
+ --skip-stack-trace Don't print a stack trace on failure.
+ --skip-symlink Don't allow symlinking of tables. Deprecated option. Use
+ --skip-symbolic-links instead.
+ --skip-thread-priority
+ Don't give threads different priorities. This option is
+ deprecated because it has no effect; the implied behavior
+ is already the default.
+ --slave-compressed-protocol
+ Use compression on master/slave protocol
+ --slave-exec-mode=name
+ Modes for how replication events should be executed.
+ Legal values are STRICT (default) and IDEMPOTENT. In
+ IDEMPOTENT mode, replication will not stop for operations
+ that are idempotent. In STRICT mode, replication will
+ stop on any unexpected difference between the master and
+ the slave
+ --slave-load-tmpdir=name
+ The location where the slave should put its temporary
+ files when replicating a LOAD DATA INFILE command
+ --slave-net-timeout=#
+ Number of seconds to wait for more data from a
+ master/slave connection before aborting the read
+ --slave-skip-errors=name
+ Tells the slave thread to continue replication when a
+ query event returns an error from the provided list
+ --slave-transaction-retries=#
+ Number of times the slave SQL thread will retry a
+ transaction in case it failed with a deadlock or elapsed
+ lock wait timeout, before giving up and stopping
+ --slow-launch-time=#
+ If creating the thread takes longer than this value (in
+ seconds), the Slow_launch_threads counter will be
+ incremented
+ --slow-query-log Log slow queries to a table or log file. Defaults logging
+ to a file hostname-slow.log or a table mysql.slow_log if
+ --log-output=TABLE is used. Must be enabled to activate
+ other slow log options
+ --slow-query-log-file=name
+ Log slow queries to given log file. Defaults logging to
+ hostname-slow.log. Must be enabled to activate other slow
+ log options
+ --socket=name Socket file to use for connection
+ --sort-buffer-size=#
+ Each thread that needs to do a sort allocates a buffer of
+ this size
+ --sporadic-binlog-dump-fail
+ Option used by mysql-test for debugging and testing of
+ replication.
+ --sql-bin-update-same
+ The update log is deprecated since version 5.0, is
+ replaced by the binary log and this option does nothing
+ anymore.
+ --sql-mode=name Syntax: sql-mode=mode[,mode[,mode...]]. See the manual
+ for the complete list of valid sql modes
+ --ssl Enable SSL for connection (automatically enabled with
+ other flags).
+ --ssl-ca=name CA file in PEM format (check OpenSSL docs, implies --ssl)
+ --ssl-capath=name CA directory (check OpenSSL docs, implies --ssl)
+ --ssl-cert=name X509 cert in PEM format (implies --ssl)
+ --ssl-cipher=name SSL cipher to use (implies --ssl)
+ --ssl-key=name X509 key in PEM format (implies --ssl)
+ -s, --symbolic-links
+ Enable symbolic link support.
+ --sync-binlog=# Synchronously flush binary log to disk after every #th
+ event. Use 0 (default) to disable synchronous flushing
+ --sync-frm Sync .frm files to disk on creation
+ (Defaults to on; use --skip-sync-frm to disable.)
+ --sync-master-info=#
+ Synchronously flush master info to disk after every #th
+ event. Use 0 (default) to disable synchronous flushing
+ --sync-relay-log=# Synchronously flush relay log to disk after every #th
+ event. Use 0 (default) to disable synchronous flushing
+ --sync-relay-log-info=#
+ Synchronously flush relay log info to disk after every
+ #th transaction. Use 0 (default) to disable synchronous
+ flushing
+ --sysdate-is-now Non-default option to alias SYSDATE() to NOW() to make it
+ safe-replicable. Since 5.0, SYSDATE() returns a `dynamic'
+ value different for different invocations, even within
+ the same statement.
+ --table-cache=# Deprecated; use --table-open-cache instead.
+ --table-definition-cache=#
+ The number of cached table definitions
+ --table-lock-wait-timeout=#
+ Timeout in seconds to wait for a table level lock before
+ returning an error. Used only if the connection has
+ active cursors
+ --table-open-cache=#
+ The number of cached open tables
+ --tc-heuristic-recover=name
+ Decision to use in heuristic recover process. Possible
+ values are COMMIT or ROLLBACK.
+ --thread-cache-size=#
+ How many threads we should keep in a cache for reuse
+ --thread-handling=name
+ Define threads usage for handling queries, one of
+ one-thread-per-connection, no-threads
+ --thread-stack=# The stack size for each thread
+ --time-format=name The TIME format (ignored)
+ --timed-mutexes Specify whether to time mutexes (only InnoDB mutexes are
+ currently supported)
+ --tmp-table-size=# If an internal in-memory temporary table exceeds this
+ size, MySQL will automatically convert it to an on-disk
+ MyISAM table
+ -t, --tmpdir=name Path for temporary files. Several paths may be specified,
+ separated by a colon (:), in this case they are used in a
+ round-robin fashion
+ --transaction-alloc-block-size=#
+ Allocation block size for transactions to be stored in
+ binary log
+ --transaction-isolation=name
+ Default transaction isolation level.
+ --transaction-prealloc-size=#
+ Persistent buffer for transactions to be stored in binary
+ log
+ --updatable-views-with-limit=name
+ YES = Don't issue an error message (warning only) if a
+ VIEW without presence of a key of the underlying table is
+ used in queries with a LIMIT clause for updating. NO =
+ Prohibit update of a VIEW, which does not contain a key
+ of the underlying table and the query uses a LIMIT clause
+ (usually get from GUI tools)
+ -s, --use-symbolic-links
+ Enable symbolic link support. Deprecated option; use
+ --symbolic-links instead.
+ -u, --user=name Run mysqld daemon as user.
+ -v, --verbose Used with --help option for detailed help
+ -V, --version Output version information and exit.
+ --wait-timeout=# The number of seconds the server waits for activity on a
+ connection before closing it
+ -W, --warnings[=#] Deprecated; use --log-warnings instead.
+
+Variables (--variable-name=value)
+and boolean options {FALSE|TRUE} Value (after reading options)
+----------------------------------- --------------------------------------
+abort-slave-event-count 0
+allow-suspicious-udfs FALSE
+archive ON
+auto-increment-increment 1
+auto-increment-offset 1
+automatic-sp-privileges TRUE
+back-log 50
+big-tables FALSE
+bind-address (No default value)
+binlog-cache-size 32768
+binlog-format STATEMENT
+binlog-row-event-max-size 1024
+blackhole ON
+bulk-insert-buffer-size 8388608
+character-set-client-handshake TRUE
+character-set-filesystem binary
+character-set-server latin1
+chroot (No default value)
+collation-server latin1_swedish_ci
+completion-type NO_CHAIN
+concurrent-insert AUTO
+connect-timeout 10
+console FALSE
+date-format %Y-%m-%d
+datetime-format %Y-%m-%d %H:%i:%s
+default-character-set latin1
+default-collation latin1_swedish_ci
+default-storage-engine MyISAM
+default-time-zone (No default value)
+default-week-format 0
+delay-key-write ON
+delayed-insert-limit 100
+delayed-insert-timeout 300
+delayed-queue-size 1000
+des-key-file (No default value)
+disconnect-slave-event-count 0
+div-precision-increment 4
+enable-locking FALSE
+engine-condition-pushdown TRUE
+event-scheduler OFF
+expire-logs-days 0
+external-locking FALSE
+federated ON
+flush FALSE
+flush-time 0
+ft-boolean-syntax + -><()~*:""&|
+ft-max-word-len 84
+ft-min-word-len 4
+ft-query-expansion-limit 20
+ft-stopword-file (No default value)
+gdb FALSE
+general-log FALSE
+group-concat-max-len 1024
+help TRUE
+ignore-builtin-innodb FALSE
+init-connect
+init-file (No default value)
+init-rpl-role MASTER
+init-slave
+interactive-timeout 28800
+join-buffer-size 131072
+keep-files-on-create FALSE
+key-buffer-size 8388608
+key-cache-age-threshold 300
+key-cache-block-size 1024
+key-cache-division-limit 100
+large-pages FALSE
+lc-messages en_US
+lc-time-names en_US
+local-infile TRUE
+log-bin (No default value)
+log-bin-index (No default value)
+log-bin-trust-function-creators FALSE
+log-error
+log-isam myisam.log
+log-output FILE
+log-queries-not-using-indexes FALSE
+log-short-format FALSE
+log-slave-updates FALSE
+log-slow-admin-statements FALSE
+log-slow-slave-statements FALSE
+log-tc tc.log
+log-tc-size 24576
+log-update (No default value)
+log-warnings 1
+long-query-time 10
+low-priority-updates FALSE
+lower-case-table-names 1
+master-info-file master.info
+master-retry-count 86400
+max-allowed-packet 1048576
+max-binlog-cache-size 18446744073709547520
+max-binlog-dump-events 0
+max-binlog-size 1073741824
+max-connect-errors 10
+max-connections 151
+max-delayed-threads 20
+max-error-count 64
+max-heap-table-size 16777216
+max-join-size 18446744073709551615
+max-length-for-sort-data 1024
+max-prepared-stmt-count 16382
+max-relay-log-size 0
+max-seeks-for-key 18446744073709551615
+max-sort-length 1024
+max-sp-recursion-depth 0
+max-tmp-tables 32
+max-user-connections 0
+max-write-lock-count 18446744073709551615
+memlock FALSE
+min-examined-row-limit 0
+multi-range-count 256
+myisam-block-size 1024
+myisam-data-pointer-size 6
+myisam-max-sort-file-size 9223372036853727232
+myisam-mmap-size 18446744073709551615
+myisam-recover-options OFF
+myisam-repair-threads 1
+myisam-sort-buffer-size 8388608
+myisam-stats-method nulls_unequal
+myisam-use-mmap FALSE
+net-buffer-length 16384
+net-read-timeout 30
+net-retry-count 10
+net-write-timeout 60
+new FALSE
+old FALSE
+old-alter-table FALSE
+old-passwords FALSE
+old-style-user-limits FALSE
+optimizer-prune-level 1
+optimizer-search-depth 62
+optimizer-switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
+partition ON
+plugin-load (No default value)
+port 3306
+port-open-timeout 0
+preload-buffer-size 32768
+profiling-history-size 15
+query-alloc-block-size 8192
+query-cache-limit 1048576
+query-cache-min-res-unit 4096
+query-cache-size 0
+query-cache-type ON
+query-cache-wlock-invalidate FALSE
+query-prealloc-size 8192
+range-alloc-block-size 4096
+read-buffer-size 131072
+read-only FALSE
+read-rnd-buffer-size 262144
+record-buffer 131072
+relay-log (No default value)
+relay-log-index (No default value)
+relay-log-info-file relay-log.info
+relay-log-purge TRUE
+relay-log-recovery FALSE
+relay-log-space-limit 0
+replicate-same-server-id FALSE
+report-host (No default value)
+report-password (No default value)
+report-port 3306
+report-user (No default value)
+rpl-recovery-rank 0
+safe-user-create FALSE
+secure-auth FALSE
+secure-file-priv (No default value)
+server-id 0
+show-slave-auth-info FALSE
+skip-grant-tables TRUE
+skip-networking FALSE
+skip-show-database FALSE
+skip-slave-start FALSE
+slave-compressed-protocol FALSE
+slave-exec-mode STRICT
+slave-net-timeout 3600
+slave-skip-errors (No default value)
+slave-transaction-retries 10
+slow-launch-time 2
+slow-query-log FALSE
+socket /tmp/mysql.sock
+sort-buffer-size 2097152
+sporadic-binlog-dump-fail FALSE
+sql-mode
+ssl FALSE
+ssl-ca (No default value)
+ssl-capath (No default value)
+ssl-cert (No default value)
+ssl-cipher (No default value)
+ssl-key (No default value)
+symbolic-links FALSE
+sync-binlog 0
+sync-frm TRUE
+sync-master-info 0
+sync-relay-log 0
+sync-relay-log-info 0
+sysdate-is-now FALSE
+table-cache 400
+table-definition-cache 400
+table-lock-wait-timeout 50
+table-open-cache 400
+tc-heuristic-recover COMMIT
+thread-cache-size 0
+thread-handling one-thread-per-connection
+thread-stack 262144
+time-format %H:%i:%s
+timed-mutexes FALSE
+tmp-table-size 16777216
+transaction-alloc-block-size 8192
+transaction-isolation REPEATABLE-READ
+transaction-prealloc-size 4096
+updatable-views-with-limit YES
+use-symbolic-links FALSE
+verbose TRUE
+wait-timeout 28800
+warnings 1
+
+To see what values a running MySQL server is using, type
+'mysqladmin variables' instead of 'mysqld --verbose --help'.
diff --git a/mysql-test/r/mysqld--help-win.result b/mysql-test/r/mysqld--help-win.result
new file mode 100644
index 00000000000..ec621d72bef
--- /dev/null
+++ b/mysql-test/r/mysqld--help-win.result
@@ -0,0 +1,953 @@
+The following options may be given as the first argument:
+--print-defaults Print the program argument list and exit
+--no-defaults Don't read default options from any options file
+--defaults-file=# Only read default options from the given file #
+--defaults-extra-file=# Read this file after the global files are read
+
+ --abort-slave-event-count=#
+ Option used by mysql-test for debugging and testing of
+ replication.
+ --allow-suspicious-udfs
+ Allows use of UDFs consisting of only one symbol xxx()
+ without corresponding xxx_init() or xxx_deinit(). That
+ also means that one can load any function from any
+ library, for example exit() from libc.so
+ -a, --ansi Use ANSI SQL syntax instead of MySQL syntax. This mode
+ will also set transaction isolation level 'serializable'.
+ --archive[=name] Enable or disable ARCHIVE plugin. Possible values are ON,
+ OFF, FORCE (don't start if the plugin fails to load).
+ --auto-increment-increment[=#]
+ Auto-increment columns are incremented by this
+ --auto-increment-offset[=#]
+ Offset added to Auto-increment columns. Used when
+ auto-increment-increment != 1
+ --automatic-sp-privileges
+ Creating and dropping stored procedures alters ACLs
+ (Defaults to on; use --skip-automatic-sp-privileges to disable.)
+ --back-log=# The number of outstanding connection requests MySQL can
+ have. This comes into play when the main MySQL thread
+ gets very many connection requests in a very short time
+ -b, --basedir=name Path to installation directory. All paths are usually
+ resolved relative to this
+ --big-tables Allow big result sets by saving all temporary sets on
+ file (Solves most 'table full' errors)
+ --bind-address=name IP address to bind to.
+ --binlog-cache-size=#
+ The size of the cache to hold the SQL statements for the
+ binary log during a transaction. If you often use big,
+ multi-statement transactions you can increase this to get
+ more performance
+ --binlog-do-db=name Tells the master it should log updates for the specified
+ database, and exclude all others not explicitly
+ mentioned.
+ --binlog-format=name
+ What form of binary logging the master will use: either
+ ROW for row-based binary logging, STATEMENT for
+ statement-based binary logging, or MIXED. MIXED is
+ statement-based binary logging except for those
+ statements where only row-based is correct: those which
+ involve user-defined functions (i.e. UDFs) or the UUID()
+ function; for those, row-based binary logging is
+ automatically used. If NDBCLUSTER is enabled and
+ binlog-format is MIXED, the format switches to row-based
+ and back implicitly per each query accessing an
+ NDBCLUSTER table
+ --binlog-ignore-db=name
+ Tells the master that updates to the given database
+ should not be logged tothe binary log.
+ --binlog-row-event-max-size=#
+ The maximum size of a row-based binary log event in
+ bytes. Rows will be grouped into events smaller than this
+ size if possible. The value has to be a multiple of 256.
+ --blackhole[=name] Enable or disable BLACKHOLE plugin. Possible values are
+ ON, OFF, FORCE (don't start if the plugin fails to load).
+ --bootstrap Used by mysql installation scripts.
+ --bulk-insert-buffer-size=#
+ Size of tree cache used in bulk insert optimisation. Note
+ that this is a limit per thread!
+ --character-set-client-handshake
+ Don't ignore client side character set value sent during
+ handshake.
+ (Defaults to on; use --skip-character-set-client-handshake to disable.)
+ --character-set-filesystem=name
+ Set the filesystem character set.
+ -C, --character-set-server=name
+ Set the default character set.
+ --character-sets-dir=name
+ Directory where character sets are
+ -r, --chroot=name Chroot mysqld daemon during startup.
+ --collation-server=name
+ Set the default collation.
+ --completion-type=name
+ The transaction completion type, one of NO_CHAIN, CHAIN,
+ RELEASE
+ --concurrent-insert[=name]
+ Use concurrent insert with MyISAM. Possible values are
+ NEVER, AUTO, ALWAYS
+ --connect-timeout=# The number of seconds the mysqld server is waiting for a
+ connect packet before responding with 'Bad handshake'
+ --console Write error output on screen; Don't remove the console
+ window on windows.
+ --core-file Write core on errors.
+ -h, --datadir=name Path to the database root directory
+ --date-format=name The DATE format (ignored)
+ --datetime-format=name
+ The DATETIME format (ignored)
+ -C, --default-character-set=name
+ Set the default character set (deprecated option, use
+ --character-set-server instead).
+ --default-collation=name
+ Set the default collation (deprecated option, use
+ --collation-server instead).
+ --default-storage-engine=name
+ The default storage engine for new tables
+ --default-time-zone=name
+ Set the default time zone.
+ --default-week-format=#
+ The default week format used by WEEK() functions
+ --delay-key-write[=name]
+ Type of DELAY_KEY_WRITE
+ --delay-key-write-for-all-tables
+ Don't flush key buffers between writes for any MyISAM
+ table (Deprecated option, use --delay-key-write=all
+ instead).
+ --delayed-insert-limit=#
+ After inserting delayed_insert_limit rows, the INSERT
+ DELAYED handler will check if there are any SELECT
+ statements pending. If so, it allows these to execute
+ before continuing
+ --delayed-insert-timeout=#
+ How long a INSERT DELAYED thread should wait for INSERT
+ statements before terminating
+ --delayed-queue-size=#
+ What size queue (in rows) should be allocated for
+ handling INSERT DELAYED. If the queue becomes full, any
+ client that does INSERT DELAYED will wait until there is
+ room in the queue again
+ --des-key-file=name Load keys for des_encrypt() and des_encrypt from given
+ file.
+ --disconnect-slave-event-count=#
+ Option used by mysql-test for debugging and testing of
+ replication.
+ --div-precision-increment=#
+ Precision of the result of '/' operator will be increased
+ on that value
+ --enable-locking Deprecated option, use --external-locking instead.
+ --engine-condition-pushdown
+ Push supported query conditions to the storage engine
+ (Defaults to on; use --skip-engine-condition-pushdown to disable.)
+ --event-scheduler[=name]
+ Enable the event scheduler. Possible values are ON, OFF,
+ and DISABLED (keep the event scheduler completely
+ deactivated, it cannot be activated run-time)
+ -T, --exit-info[=#] Used for debugging; Use at your own risk!
+ --expire-logs-days=#
+ If non-zero, binary logs will be purged after
+ expire_logs_days days; possible purges happen at startup
+ and at binary log rotation
+ --external-locking Use system (external) locking (disabled by default).
+ With this option enabled you can run myisamchk to test
+ (not repair) tables while the MySQL server is running.
+ Disable with --skip-external-locking.
+ --federated[=name] Enable or disable FEDERATED plugin. Possible values are
+ ON, OFF, FORCE (don't start if the plugin fails to load).
+ --flush Flush MyISAM tables to disk between SQL commands
+ --flush-time=# A dedicated thread is created to flush all tables at the
+ given interval
+ --ft-boolean-syntax=name
+ List of operators for MATCH ... AGAINST ( ... IN BOOLEAN
+ MODE)
+ --ft-max-word-len=# The maximum length of the word to be included in a
+ FULLTEXT index. Note: FULLTEXT indexes must be rebuilt
+ after changing this variable
+ --ft-min-word-len=# The minimum length of the word to be included in a
+ FULLTEXT index. Note: FULLTEXT indexes must be rebuilt
+ after changing this variable
+ --ft-query-expansion-limit=#
+ Number of best matches to use for query expansion
+ --ft-stopword-file=name
+ Use stopwords from this file instead of built-in list
+ --gdb Set up signals usable for debugging
+ --general-log Log connections and queries to a table or log file.
+ Defaults logging to a file hostname.log or a table
+ mysql.general_logif --log-output=TABLE is used
+ --general-log-file=name
+ Log connections and queries to given file
+ --group-concat-max-len=#
+ The maximum length of the result of function
+ GROUP_CONCAT()
+ -?, --help Display this help and exit.
+ --ignore-builtin-innodb
+ Disable initialization of builtin InnoDB plugin
+ --init-connect=name Command(s) that are executed for each new connection
+ --init-file=name Read SQL commands from this file at startup
+ --init-rpl-role=name
+ Set the replication role.
+ --init-slave=name Command(s) that are executed by a slave server each time
+ the SQL thread starts
+ --interactive-timeout=#
+ The number of seconds the server waits for activity on an
+ interactive connection before closing it
+ --join-buffer-size=#
+ The size of the buffer that is used for full joins
+ --keep-files-on-create
+ Don't overwrite stale .MYD and .MYI even if no directory
+ is specified
+ --key-buffer-size=# The size of the buffer used for index blocks for MyISAM
+ tables. Increase this to get better index handling (for
+ all reads and multiple writes) to as much as you can
+ afford
+ --key-cache-age-threshold=#
+ 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
+ --key-cache-block-size=#
+ The default size of key cache blocks
+ --key-cache-division-limit=#
+ The minimum percentage of warm blocks in key cache
+ -L, --language=name Client error messages in given language. May be given as
+ a full path. Deprecated. Use --lc-messages-dir instead.
+ --lc-messages=name Set the language used for the error messages.
+ -L, --lc-messages-dir=name
+ Directory where error messages are
+ --lc-time-names=name
+ Set the language used for the month names and the days of
+ the week.
+ --local-infile Enable LOAD DATA LOCAL INFILE
+ (Defaults to on; use --skip-local-infile to disable.)
+ -l, --log[=name] Log connections and queries to file (deprecated option,
+ use --general-log/--general-log-file instead).
+ --log-bin[=name] Log update queries in binary format. Optional (but
+ strongly recommended to avoid replication problems if
+ server's hostname changes) argument should be the chosen
+ location for the binary log files.
+ --log-bin-index=name
+ File that holds the names for last binary log files.
+ --log-bin-trust-function-creators
+ If set to FALSE (the default), then when --log-bin is
+ used, creation of a stored function (or trigger) is
+ allowed only to users having the SUPER privilege and only
+ if this stored function (trigger) may not break binary
+ logging. Note that if ALL connections to this server
+ ALWAYS use row-based binary logging, the security issues
+ do not exist and the binary logging cannot break, so you
+ can safely set this to TRUE
+ --log-error[=name] Error log file
+ --log-isam[=name] Log all MyISAM changes to file.
+ -0, --log-long-format
+ Log some extra information to update log. Please note
+ that this option is deprecated; see --log-short-format
+ option.
+ --log-output=name Syntax: log-output=value[,value...], where "value" could
+ be TABLE, FILE or NONE
+ --log-queries-not-using-indexes
+ Log queries that are executed without benefit of any
+ index to the slow log if it is open
+ --log-short-format Don't log extra information to update and slow-query
+ logs.
+ --log-slave-updates Tells the slave to log the updates from the slave thread
+ to the binary log. You will need to turn it on if you
+ plan to daisy-chain the slaves
+ --log-slow-admin-statements
+ Log slow OPTIMIZE, ANALYZE, ALTER and other
+ administrative statements to the slow log if it is open.
+ --log-slow-queries[=name]
+ Log slow queries to a table or log file. Defaults logging
+ to table mysql.slow_log or hostname-slow.log if
+ --log-output=file is used. Must be enabled to activate
+ other slow log options. Deprecated option, use
+ --slow-query-log/--slow-query-log-file instead.
+ --log-slow-slave-statements
+ Log slow statements executed by slave thread to the slow
+ log if it is open.
+ --log-tc=name Path to transaction coordinator log (used for
+ transactions that affect more than one storage engine,
+ when binary log is disabled)
+ --log-tc-size=# Size of transaction coordinator log.
+ --log-update[=name] The update log is deprecated since version 5.0, is
+ replaced by the binary log and this option justs turns on
+ --log-bin instead.
+ -W, --log-warnings[=#]
+ Log some not critical warnings to the log file
+ --long-query-time=# Log all queries that have taken more than long_query_time
+ seconds to execute to file. The argument will be treated
+ as a decimal value with microsecond precision
+ --low-priority-updates
+ INSERT/DELETE/UPDATE has lower priority than selects
+ --lower-case-table-names[=#]
+ If set to 1 table names are stored in lowercase on disk
+ and table names will be case-insensitive. Should be set
+ to 2 if you are using a case insensitive file system
+ --master-info-file=name
+ The location and name of the file that remembers the
+ master and where the I/O replication thread is in the
+ master's binlogs.
+ --master-retry-count=#
+ The number of tries the slave will make to connect to the
+ master before giving up.
+ --max-allowed-packet=#
+ Max packet length to send to or receive from the server
+ --max-binlog-cache-size=#
+ Can be used to restrict the total size used to cache a
+ multi-transaction query
+ --max-binlog-dump-events=#
+ Option used by mysql-test for debugging and testing of
+ replication.
+ --max-binlog-size=# Binary log will be rotated automatically when the size
+ exceeds this value. Will also apply to relay logs if
+ max_relay_log_size is 0
+ --max-connect-errors=#
+ If there is more than this number of interrupted
+ connections from a host this host will be blocked from
+ further connections
+ --max-connections=# The number of simultaneous clients allowed
+ --max-delayed-threads=#
+ Don't start more than this number of threads to handle
+ INSERT DELAYED statements. If set to zero INSERT DELAYED
+ will be not used
+ --max-error-count=# Max number of errors/warnings to store for a statement
+ --max-heap-table-size=#
+ Don't allow creation of heap tables bigger than this
+ --max-join-size=# Joins that are probably going to read more than
+ max_join_size records return an error
+ --max-length-for-sort-data=#
+ Max number of bytes in sorted records
+ --max-prepared-stmt-count=#
+ Maximum number of prepared statements in the server
+ --max-relay-log-size=#
+ If non-zero: relay log will be rotated automatically when
+ the size exceeds this value; if zero: when the size
+ exceeds max_binlog_size
+ --max-seeks-for-key=#
+ Limit assumed max number of seeks when looking up rows
+ based on a key
+ --max-sort-length=# The number of bytes to use when sorting BLOB or TEXT
+ values (only the first max_sort_length bytes of each
+ value are used; the rest are ignored)
+ --max-sp-recursion-depth[=#]
+ Maximum stored procedure recursion depth
+ --max-tmp-tables=# Maximum number of temporary tables a client can keep open
+ at a time
+ --max-user-connections=#
+ The maximum number of active connections for a single
+ user (0 = no limit)
+ --max-write-lock-count=#
+ After this many write locks, allow some read locks to run
+ in between
+ --memlock Lock mysqld in memory.
+ --min-examined-row-limit=#
+ Don't write queries to slow log that examine fewer rows
+ than that
+ --multi-range-count=#
+ Number of key ranges to request at once
+ --myisam-block-size=#
+ Block size to be used for MyISAM index pages
+ --myisam-data-pointer-size=#
+ Default pointer size to be used for MyISAM tables
+ --myisam-max-sort-file-size=#
+ Don't use the fast sort index method to created index if
+ the temporary file would get bigger than this
+ --myisam-mmap-size=#
+ Restricts the total memory used for memory mapping of
+ MySQL tables
+ --myisam-recover-options[=name]
+ Syntax: myisam-recover-options[=option[,option...]],
+ where option can be DEFAULT, BACKUP, FORCE, QUICK, or OFF
+ --myisam-repair-threads=#
+ If larger than 1, when repairing a MyISAM table all
+ indexes will be created in parallel, with one thread per
+ index. The value of 1 disables parallel repair
+ --myisam-sort-buffer-size=#
+ The buffer that is allocated when sorting the index when
+ doing a REPAIR or when creating indexes with CREATE INDEX
+ or ALTER TABLE
+ --myisam-stats-method=name
+ Specifies how MyISAM index statistics collection code
+ should treat NULLs. Possible values of name are
+ NULLS_UNEQUAL (default behavior for 4.1 and later),
+ NULLS_EQUAL (emulate 4.0 behavior), and NULLS_IGNORED
+ --myisam-use-mmap Use memory mapping for reading and writing MyISAM tables
+ --named-pipe Enable the named pipe (NT)
+ --net-buffer-length=#
+ Buffer length for TCP/IP and socket communication
+ --net-read-timeout=#
+ Number of seconds to wait for more data from a connection
+ before aborting the read
+ --net-retry-count=# If a read on a communication port is interrupted, retry
+ this many times before giving up
+ --net-write-timeout=#
+ Number of seconds to wait for a block to be written to a
+ connection before aborting the write
+ -n, --new Use very new possible "unsafe" functions
+ --old Use compatible behavior
+ --old-alter-table Use old, non-optimized alter table
+ --old-passwords Use old password encryption method (needed for 4.0 and
+ older clients)
+ --old-style-user-limits
+ Enable old-style user limits (before 5.0.3 user resources
+ were counted per each user+host vs. per account)
+ --one-thread (deprecated): Only use one thread (for debugging under
+ Linux). Use thread-handling=no-threads instead
+ --open-files-limit=#
+ 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 file descriptors
+ --optimizer-prune-level=#
+ Controls the heuristic(s) applied during query
+ optimization to prune less-promising partial plans from
+ the optimizer search space. Meaning: 0 - do not apply any
+ heuristic, thus perform exhaustive search; 1 - prune
+ plans based on number of retrieved rows
+ --optimizer-search-depth=#
+ Maximum depth of search performed by the query optimizer.
+ Values larger than the number of relations in a query
+ result in better query plans, but take longer to compile
+ a query. Values smaller than the number of tables in a
+ relation result in faster optimization, but may produce
+ very bad query plans. If set to 0, the system will
+ automatically pick a reasonable value; if set to 63, the
+ optimizer will switch to the original find_best
+ search(used for testing/comparison)
+ --optimizer-switch=name
+ optimizer_switch=option=val[,option=val...], where option
+ is one of {index_merge, index_merge_union,
+ index_merge_sort_union, index_merge_intersection} and val
+ is one of {on, off, default}
+ --partition[=name] Enable or disable partition plugin. Possible values are
+ ON, OFF, FORCE (don't start if the plugin fails to load).
+ --pid-file=name Pid file used by safe_mysqld
+ --plugin-dir=name Directory for plugins
+ --plugin-load=name Optional semicolon-separated list of plugins to load,
+ where each plugin is identified as name=library, where
+ name is the plugin name and library is the plugin library
+ in plugin_dir.
+ -P, --port=# Port number to use for connection or 0 to default to,
+ my.cnf, $MYSQL_TCP_PORT, /etc/services, built-in default
+ (3306), whatever comes first
+ --port-open-timeout=#
+ Maximum time in seconds to wait for the port to become
+ free. (Default: no wait)
+ --preload-buffer-size=#
+ The size of the buffer that is allocated when preloading
+ indexes
+ --profiling-history-size=#
+ Limit of query profiling memory
+ --query-alloc-block-size=#
+ Allocation block size for query parsing and execution
+ --query-cache-limit=#
+ Don't cache results that are bigger than this
+ --query-cache-min-res-unit=#
+ The minimum size for blocks allocated by the query cache
+ --query-cache-size=#
+ The memory allocated to store results from old queries
+ --query-cache-type=name
+ OFF = Don't cache or retrieve results. ON = Cache all
+ results except SELECT SQL_NO_CACHE ... queries. DEMAND =
+ Cache only SELECT SQL_CACHE ... queries
+ --query-cache-wlock-invalidate
+ Invalidate queries in query cache on LOCK for write
+ --query-prealloc-size=#
+ Persistent buffer for query parsing and execution
+ --range-alloc-block-size=#
+ Allocation block size for storing ranges during
+ optimization
+ --read-buffer-size=#
+ Each thread that does a sequential scan allocates a
+ buffer of this size for each table it scans. If you do
+ many sequential scans, you may want to increase this
+ value
+ --read-only Make all non-temporary tables read-only, with the
+ exception for replication (slave) threads and users with
+ the SUPER privilege
+ --read-rnd-buffer-size=#
+ When reading rows in sorted order after a sort, the rows
+ are read through this buffer to avoid a disk seeks. If
+ not set, then it's set to the value of record_buffer
+ --record-buffer=# Deprecated; use --read-buffer-size instead.
+ --relay-log=name The location and name to use for relay logs
+ --relay-log-index=name
+ The location and name to use for the file that keeps a
+ list of the last relay logs
+ --relay-log-info-file=name
+ The location and name of the file that remembers where
+ the SQL replication thread is in the relay logs
+ --relay-log-purge if disabled - do not purge relay logs. if enabled - purge
+ them as soon as they are no more needed
+ (Defaults to on; use --skip-relay-log-purge to disable.)
+ --relay-log-recovery
+ Enables automatic relay log recovery right after the
+ database startup, which means that the IO Thread starts
+ re-fetching from the master right after the last
+ transaction processed
+ --relay-log-space-limit=#
+ Maximum space to use for all relay logs
+ --replicate-do-db=name
+ Tells the slave thread to restrict replication to the
+ specified database. To specify more than one database,
+ use the directive multiple times, once for each database.
+ Note that this will only work if you do not use
+ cross-database queries such as UPDATE some_db.some_table
+ SET foo='bar' while having selected a different or no
+ database. If you need cross database updates to work,
+ make sure you have 3.23.28 or later, and use
+ replicate-wild-do-table=db_name.%.
+ --replicate-do-table=name
+ Tells the slave thread to restrict replication to the
+ specified table. To specify more than one table, use the
+ directive multiple times, once for each table. This will
+ work for cross-database updates, in contrast to
+ replicate-do-db.
+ --replicate-ignore-db=name
+ Tells the slave thread to not replicate to the specified
+ database. To specify more than one database to ignore,
+ use the directive multiple times, once for each database.
+ This option will not work if you use cross database
+ updates. If you need cross database updates to work, make
+ sure you have 3.23.28 or later, and use
+ replicate-wild-ignore-table=db_name.%.
+ --replicate-ignore-table=name
+ Tells the slave thread to not replicate to the specified
+ table. To specify more than one table to ignore, use the
+ directive multiple times, once for each table. This will
+ work for cross-datbase updates, in contrast to
+ replicate-ignore-db.
+ --replicate-rewrite-db=name
+ Updates to a database with a different name than the
+ original. Example:
+ replicate-rewrite-db=master_db_name->slave_db_name.
+ --replicate-same-server-id
+ In replication, if set to 1, do not skip events having
+ our server id. Default value is 0 (to break infinite
+ loops in circular replication). Can't be set to 1 if
+ --log-slave-updates is used.
+ --replicate-wild-do-table=name
+ Tells the slave thread to restrict replication to the
+ tables that match the specified wildcard pattern. To
+ specify more than one table, use the directive multiple
+ times, once for each table. This will work for
+ cross-database updates. Example:
+ replicate-wild-do-table=foo%.bar% will replicate only
+ updates to tables in all databases that start with foo
+ and whose table names start with bar.
+ --replicate-wild-ignore-table=name
+ Tells the slave thread to not replicate to the tables
+ that match the given wildcard pattern. To specify more
+ than one table to ignore, use the directive multiple
+ times, once for each table. This will work for
+ cross-database updates. Example:
+ replicate-wild-ignore-table=foo%.bar% will not do updates
+ to tables in databases that start with foo and whose
+ table names start with bar.
+ --report-host=name Hostname or IP of the slave to be reported to the master
+ during slave registration. Will appear in the output of
+ SHOW SLAVE HOSTS. Leave unset if you do not want the
+ slave to register itself with the master. Note that it is
+ not sufficient for the master to simply read the IP of
+ the slave off the socket once the slave connects. Due to
+ NAT and other routing issues, that IP may not be valid
+ for connecting to the slave from the master or other
+ hosts
+ --report-password=name
+ The account password of the slave to be reported to the
+ master during slave registration
+ --report-port=# Port for connecting to slave reported to the master
+ during slave registration. Set it only if the slave is
+ listening on a non-default port or if you have a special
+ tunnel from the master or other clients to the slave. If
+ not sure, leave this option unset
+ --report-user=name The account user name of the slave to be reported to the
+ master during slave registration
+ --rpl-recovery-rank=#
+ Unused, will be removed
+ --safe-mode Skip some optimize stages (for testing).
+ --safe-show-database
+ Deprecated option; use GRANT SHOW DATABASES instead...
+ --safe-user-create Don't allow new user creation by the user who has no
+ write privileges to the mysql.user table.
+ --secure-auth Disallow authentication for accounts that have old
+ (pre-4.1) passwords
+ --secure-file-priv=name
+ Limit LOAD DATA, SELECT ... OUTFILE, and LOAD_FILE() to
+ files within specified directory
+ --server-id=# Uniquely identifies the server instance in the community
+ of replication partners
+ -O, --set-variable=name
+ Change the value of a variable. Please note that this
+ option is deprecated;you can set variables directly with
+ --variable-name=value.
+ --shared-memory Enable the shared memory
+ --shared-memory-base-name=name
+ Base name of shared memory
+ --show-slave-auth-info
+ Show user and password in SHOW SLAVE HOSTS on this master
+ --skip-grant-tables Start without grant tables. This gives all users FULL
+ ACCESS to all tables!
+ --skip-host-cache Don't cache host names.
+ --skip-locking Deprecated option, use --skip-external-locking instead.
+ --skip-name-resolve Don't resolve hostnames. All hostnames are IP's or
+ 'localhost'.
+ --skip-networking Don't allow connection with TCP/IP
+ --skip-new Don't use new, possible wrong routines.
+ --skip-show-database
+ Don't allow 'SHOW DATABASE' commands
+ --skip-slave-start If set, slave is not autostarted.
+ --skip-stack-trace Don't print a stack trace on failure.
+ --skip-symlink Don't allow symlinking of tables. Deprecated option. Use
+ --skip-symbolic-links instead.
+ --skip-thread-priority
+ Don't give threads different priorities. This option is
+ deprecated because it has no effect; the implied behavior
+ is already the default.
+ --slave-compressed-protocol
+ Use compression on master/slave protocol
+ --slave-exec-mode=name
+ Modes for how replication events should be executed.
+ Legal values are STRICT (default) and IDEMPOTENT. In
+ IDEMPOTENT mode, replication will not stop for operations
+ that are idempotent. In STRICT mode, replication will
+ stop on any unexpected difference between the master and
+ the slave
+ --slave-load-tmpdir=name
+ The location where the slave should put its temporary
+ files when replicating a LOAD DATA INFILE command
+ --slave-net-timeout=#
+ Number of seconds to wait for more data from a
+ master/slave connection before aborting the read
+ --slave-skip-errors=name
+ Tells the slave thread to continue replication when a
+ query event returns an error from the provided list
+ --slave-transaction-retries=#
+ Number of times the slave SQL thread will retry a
+ transaction in case it failed with a deadlock or elapsed
+ lock wait timeout, before giving up and stopping
+ --slow-launch-time=#
+ If creating the thread takes longer than this value (in
+ seconds), the Slow_launch_threads counter will be
+ incremented
+ --slow-query-log Log slow queries to a table or log file. Defaults logging
+ to a file hostname-slow.log or a table mysql.slow_log if
+ --log-output=TABLE is used. Must be enabled to activate
+ other slow log options
+ --slow-query-log-file=name
+ Log slow queries to given log file. Defaults logging to
+ hostname-slow.log. Must be enabled to activate other slow
+ log options
+ --socket=name Socket file to use for connection
+ --sort-buffer-size=#
+ Each thread that needs to do a sort allocates a buffer of
+ this size
+ --sporadic-binlog-dump-fail
+ Option used by mysql-test for debugging and testing of
+ replication.
+ --sql-bin-update-same
+ The update log is deprecated since version 5.0, is
+ replaced by the binary log and this option does nothing
+ anymore.
+ --sql-mode=name Syntax: sql-mode=mode[,mode[,mode...]]. See the manual
+ for the complete list of valid sql modes
+ --ssl Enable SSL for connection (automatically enabled with
+ other flags).
+ --ssl-ca=name CA file in PEM format (check OpenSSL docs, implies --ssl)
+ --ssl-capath=name CA directory (check OpenSSL docs, implies --ssl)
+ --ssl-cert=name X509 cert in PEM format (implies --ssl)
+ --ssl-cipher=name SSL cipher to use (implies --ssl)
+ --ssl-key=name X509 key in PEM format (implies --ssl)
+ --standalone Dummy option to start as a standalone program (NT).
+ -s, --symbolic-links
+ Enable symbolic link support.
+ --sync-binlog=# Synchronously flush binary log to disk after every #th
+ event. Use 0 (default) to disable synchronous flushing
+ --sync-frm Sync .frm files to disk on creation
+ (Defaults to on; use --skip-sync-frm to disable.)
+ --sync-master-info=#
+ Synchronously flush master info to disk after every #th
+ event. Use 0 (default) to disable synchronous flushing
+ --sync-relay-log=# Synchronously flush relay log to disk after every #th
+ event. Use 0 (default) to disable synchronous flushing
+ --sync-relay-log-info=#
+ Synchronously flush relay log info to disk after every
+ #th transaction. Use 0 (default) to disable synchronous
+ flushing
+ --sysdate-is-now Non-default option to alias SYSDATE() to NOW() to make it
+ safe-replicable. Since 5.0, SYSDATE() returns a `dynamic'
+ value different for different invocations, even within
+ the same statement.
+ --table-cache=# Deprecated; use --table-open-cache instead.
+ --table-definition-cache=#
+ The number of cached table definitions
+ --table-lock-wait-timeout=#
+ Timeout in seconds to wait for a table level lock before
+ returning an error. Used only if the connection has
+ active cursors
+ --table-open-cache=#
+ The number of cached open tables
+ --tc-heuristic-recover=name
+ Decision to use in heuristic recover process. Possible
+ values are COMMIT or ROLLBACK.
+ --thread-cache-size=#
+ How many threads we should keep in a cache for reuse
+ --thread-handling=name
+ Define threads usage for handling queries, one of
+ one-thread-per-connection, no-threads
+ --thread-stack=# The stack size for each thread
+ --time-format=name The TIME format (ignored)
+ --timed-mutexes Specify whether to time mutexes (only InnoDB mutexes are
+ currently supported)
+ --tmp-table-size=# If an internal in-memory temporary table exceeds this
+ size, MySQL will automatically convert it to an on-disk
+ MyISAM table
+ -t, --tmpdir=name Path for temporary files. Several paths may be specified,
+ separated by a semicolon (;), in this case they are used
+ in a round-robin fashion
+ --transaction-alloc-block-size=#
+ Allocation block size for transactions to be stored in
+ binary log
+ --transaction-isolation=name
+ Default transaction isolation level.
+ --transaction-prealloc-size=#
+ Persistent buffer for transactions to be stored in binary
+ log
+ --updatable-views-with-limit=name
+ YES = Don't issue an error message (warning only) if a
+ VIEW without presence of a key of the underlying table is
+ used in queries with a LIMIT clause for updating. NO =
+ Prohibit update of a VIEW, which does not contain a key
+ of the underlying table and the query uses a LIMIT clause
+ (usually get from GUI tools)
+ -s, --use-symbolic-links
+ Enable symbolic link support. Deprecated option; use
+ --symbolic-links instead.
+ -u, --user=name Run mysqld daemon as user.
+ -v, --verbose Used with --help option for detailed help
+ -V, --version Output version information and exit.
+ --wait-timeout=# The number of seconds the server waits for activity on a
+ connection before closing it
+ -W, --warnings[=#] Deprecated; use --log-warnings instead.
+
+Variables (--variable-name=value)
+and boolean options {FALSE|TRUE} Value (after reading options)
+--------------------------------- ----------------------------------------
+abort-slave-event-count 0
+allow-suspicious-udfs FALSE
+archive ON
+auto-increment-increment 1
+auto-increment-offset 1
+automatic-sp-privileges TRUE
+back-log 50
+big-tables FALSE
+bind-address (No default value)
+binlog-cache-size 32768
+binlog-format STATEMENT
+binlog-row-event-max-size 1024
+blackhole ON
+bulk-insert-buffer-size 8388608
+character-set-client-handshake TRUE
+character-set-filesystem binary
+character-set-server latin1
+chroot (No default value)
+collation-server latin1_swedish_ci
+completion-type NO_CHAIN
+concurrent-insert AUTO
+connect-timeout 10
+console FALSE
+date-format %Y-%m-%d
+datetime-format %Y-%m-%d %H:%i:%s
+default-character-set latin1
+default-collation latin1_swedish_ci
+default-storage-engine MyISAM
+default-time-zone (No default value)
+default-week-format 0
+delay-key-write ON
+delayed-insert-limit 100
+delayed-insert-timeout 300
+delayed-queue-size 1000
+des-key-file (No default value)
+disconnect-slave-event-count 0
+div-precision-increment 4
+enable-locking FALSE
+engine-condition-pushdown TRUE
+event-scheduler OFF
+expire-logs-days 0
+external-locking FALSE
+federated ON
+flush FALSE
+flush-time 1800
+ft-boolean-syntax + -><()~*:""&|
+ft-max-word-len 84
+ft-min-word-len 4
+ft-query-expansion-limit 20
+ft-stopword-file (No default value)
+gdb FALSE
+general-log FALSE
+group-concat-max-len 1024
+help TRUE
+ignore-builtin-innodb FALSE
+init-connect
+init-file (No default value)
+init-rpl-role MASTER
+init-slave
+interactive-timeout 28800
+join-buffer-size 131072
+keep-files-on-create FALSE
+key-buffer-size 8388608
+key-cache-age-threshold 300
+key-cache-block-size 1024
+key-cache-division-limit 100
+lc-messages en_US
+lc-time-names en_US
+local-infile TRUE
+log-bin (No default value)
+log-bin-index (No default value)
+log-bin-trust-function-creators FALSE
+log-error
+log-isam myisam.log
+log-output FILE
+log-queries-not-using-indexes FALSE
+log-short-format FALSE
+log-slave-updates FALSE
+log-slow-admin-statements FALSE
+log-slow-slave-statements FALSE
+log-tc tc.log
+log-tc-size 24576
+log-update (No default value)
+log-warnings 1
+long-query-time 10
+low-priority-updates FALSE
+lower-case-table-names 1
+master-info-file master.info
+master-retry-count 86400
+max-allowed-packet 1048576
+max-binlog-cache-size 18446744073709547520
+max-binlog-dump-events 0
+max-binlog-size 1073741824
+max-connect-errors 10
+max-connections 151
+max-delayed-threads 20
+max-error-count 64
+max-heap-table-size 16777216
+max-join-size 18446744073709551615
+max-length-for-sort-data 1024
+max-prepared-stmt-count 16382
+max-relay-log-size 0
+max-seeks-for-key 18446744073709551615
+max-sort-length 1024
+max-sp-recursion-depth 0
+max-tmp-tables 32
+max-user-connections 0
+max-write-lock-count 18446744073709551615
+memlock FALSE
+min-examined-row-limit 0
+multi-range-count 256
+myisam-block-size 1024
+myisam-data-pointer-size 6
+myisam-max-sort-file-size 9223372036853727232
+myisam-mmap-size 18446744073709551615
+myisam-recover-options OFF
+myisam-repair-threads 1
+myisam-sort-buffer-size 8388608
+myisam-stats-method nulls_unequal
+myisam-use-mmap FALSE
+named-pipe FALSE
+net-buffer-length 16384
+net-read-timeout 30
+net-retry-count 10
+net-write-timeout 60
+new FALSE
+old FALSE
+old-alter-table FALSE
+old-passwords FALSE
+old-style-user-limits FALSE
+optimizer-prune-level 1
+optimizer-search-depth 62
+optimizer-switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
+partition ON
+plugin-load (No default value)
+port 3306
+port-open-timeout 0
+preload-buffer-size 32768
+profiling-history-size 15
+query-alloc-block-size 8192
+query-cache-limit 1048576
+query-cache-min-res-unit 4096
+query-cache-size 0
+query-cache-type ON
+query-cache-wlock-invalidate FALSE
+query-prealloc-size 8192
+range-alloc-block-size 4096
+read-buffer-size 131072
+read-only FALSE
+read-rnd-buffer-size 262144
+record-buffer 131072
+relay-log (No default value)
+relay-log-index (No default value)
+relay-log-info-file relay-log.info
+relay-log-purge TRUE
+relay-log-recovery FALSE
+relay-log-space-limit 0
+replicate-same-server-id FALSE
+report-host (No default value)
+report-password (No default value)
+report-port 3306
+report-user (No default value)
+rpl-recovery-rank 0
+safe-user-create FALSE
+secure-auth FALSE
+secure-file-priv (No default value)
+server-id 0
+shared-memory FALSE
+shared-memory-base-name MYSQL
+show-slave-auth-info FALSE
+skip-grant-tables TRUE
+skip-networking FALSE
+skip-show-database FALSE
+skip-slave-start FALSE
+slave-compressed-protocol FALSE
+slave-exec-mode STRICT
+slave-net-timeout 3600
+slave-skip-errors (No default value)
+slave-transaction-retries 10
+slow-launch-time 2
+slow-query-log FALSE
+socket MySQL
+sort-buffer-size 2097152
+sporadic-binlog-dump-fail FALSE
+sql-mode
+ssl FALSE
+ssl-ca (No default value)
+ssl-capath (No default value)
+ssl-cert (No default value)
+ssl-cipher (No default value)
+ssl-key (No default value)
+symbolic-links FALSE
+sync-binlog 0
+sync-frm TRUE
+sync-master-info 0
+sync-relay-log 0
+sync-relay-log-info 0
+sysdate-is-now FALSE
+table-cache 400
+table-definition-cache 400
+table-lock-wait-timeout 50
+table-open-cache 400
+tc-heuristic-recover COMMIT
+thread-cache-size 0
+thread-handling one-thread-per-connection
+thread-stack 262144
+time-format %H:%i:%s
+timed-mutexes FALSE
+tmp-table-size 16777216
+transaction-alloc-block-size 8192
+transaction-isolation REPEATABLE-READ
+transaction-prealloc-size 4096
+updatable-views-with-limit YES
+use-symbolic-links FALSE
+verbose TRUE
+wait-timeout 28800
+warnings 1
+
+To see what values a running MySQL server is using, type
+'mysqladmin variables' instead of 'mysqld --verbose --help'.
diff --git a/mysql-test/r/partition_key_cache.result b/mysql-test/r/partition_key_cache.result
index 7fbab34fa41..c5241c6ea90 100644
--- a/mysql-test/r/partition_key_cache.result
+++ b/mysql-test/r/partition_key_cache.result
@@ -5,9 +5,7 @@ SELECT @org_key_cache_buffer_size:= @@global.default.key_buffer_size;
@org_key_cache_buffer_size:= @@global.default.key_buffer_size
1048576
# Minimize default key cache (almost disabled).
-SET @@global.default.key_buffer_size = 1;
-Warnings:
-Warning 1292 Truncated incorrect key_buffer_size value: '1'
+SET @@global.default.key_buffer_size = 4096;
CREATE TABLE t1 (
a INT,
b INT,
diff --git a/mysql-test/r/plugin.result b/mysql-test/r/plugin.result
index 85fbd1353cc..9cae2b487b2 100644
--- a/mysql-test/r/plugin.result
+++ b/mysql-test/r/plugin.result
@@ -34,7 +34,7 @@ INSTALL PLUGIN example SONAME 'ha_example.so';
SET GLOBAL example_enum_var= e1;
SET GLOBAL example_enum_var= e2;
SET GLOBAL example_enum_var= impossible;
-ERROR 42000: Variable 'enum_var' can't be set to the value of 'impossible'
+ERROR 42000: Variable 'example_enum_var' can't be set to the value of 'impossible'
UNINSTALL PLUGIN example;
INSTALL PLUGIN example SONAME 'ha_example.so';
select @@session.sql_mode into @old_sql_mode;
@@ -45,7 +45,7 @@ select @@global.example_ulong_var;
500
set global example_ulong_var=1111;
Warnings:
-Warning 1292 Truncated incorrect ulong_var value: '1111'
+Warning 1292 Truncated incorrect example_ulong_var value: '1111'
select @@global.example_ulong_var;
@@global.example_ulong_var
1000
@@ -55,7 +55,7 @@ select @@global.example_ulong_var;
@@global.example_ulong_var
500
set global example_ulong_var=1111;
-ERROR 42000: Variable 'ulong_var' can't be set to the value of '1111'
+ERROR 42000: Variable 'example_ulong_var' can't be set to the value of '1111'
select @@global.example_ulong_var;
@@global.example_ulong_var
500
diff --git a/mysql-test/r/profiling.result b/mysql-test/r/profiling.result
index f20c459d7dc..6292cd085e4 100644
--- a/mysql-test/r/profiling.result
+++ b/mysql-test/r/profiling.result
@@ -9,8 +9,6 @@ profiling_history_size 15
select @@profiling;
@@profiling
0
-set global profiling = ON;
-ERROR HY000: Variable 'profiling' is a SESSION variable and can't be used with SET GLOBAL
set @start_value= @@global.profiling_history_size;
set global profiling_history_size=100;
show global variables like 'profil%';
diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result
index 9cde630e4ed..eab0c51f974 100644
--- a/mysql-test/r/query_cache.result
+++ b/mysql-test/r/query_cache.result
@@ -508,6 +508,8 @@ AAA
drop table t1;
create table t1 (a int);
set GLOBAL query_cache_size=1000;
+Warnings:
+Warning 1292 Truncated incorrect query_cache_size value: '1000'
show global variables like "query_cache_size";
Variable_name Value
query_cache_size 0
@@ -1342,9 +1344,9 @@ set global query_cache_size=0;
create table t1 (a int);
insert into t1 values (1),(2),(3);
set GLOBAL query_cache_type=1;
-set GLOBAL query_cache_limit=10000;
+set GLOBAL query_cache_limit=10240;
set GLOBAL query_cache_min_res_unit=0;
-set GLOBAL query_cache_size= 100000;
+set GLOBAL query_cache_size= 102400;
reset query cache;
set LOCAL default_week_format = 0;
select week('2007-01-04');
@@ -1434,7 +1436,7 @@ set GLOBAL query_cache_type=default;
set GLOBAL query_cache_limit=default;
set GLOBAL query_cache_min_res_unit=default;
set GLOBAL query_cache_size= default;
-set GLOBAL query_cache_size=1000000;
+set GLOBAL query_cache_size=1024000;
create table t1 (a char);
insert into t1 values ('c');
a
@@ -1562,7 +1564,7 @@ SET GLOBAL query_cache_size= default;
#
# Bug#25132 disabled query cache: Qcache_free_blocks = 1
#
-set global query_cache_size=100000;
+set global query_cache_size=102400;
set global query_cache_size=0;
set global query_cache_type=0;
show status like 'Qcache_free_blocks';
@@ -1581,7 +1583,7 @@ CREATE TABLE t1 (c1 INT NOT NULL) ENGINE=MyISAM;
INSERT INTO t1 (c1) VALUES (1), (2);
SHOW GLOBAL VARIABLES LIKE 'concurrent_insert';
Variable_name Value
-concurrent_insert 0
+concurrent_insert NEVER
SHOW STATUS LIKE 'Qcache_hits';
Variable_name Value
Qcache_hits 0
diff --git a/mysql-test/r/query_cache_ps_no_prot.result b/mysql-test/r/query_cache_ps_no_prot.result
index f686e876a60..02e660450d1 100644
--- a/mysql-test/r/query_cache_ps_no_prot.result
+++ b/mysql-test/r/query_cache_ps_no_prot.result
@@ -1,7 +1,7 @@
---- establish connection con1 (root) ----
---- switch to connection default ----
set @initial_query_cache_size = @@global.query_cache_size;
-set @@global.query_cache_size=100000;
+set @@global.query_cache_size=102400;
flush status;
drop table if exists t1;
create table t1(c1 int);
@@ -211,7 +211,7 @@ show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 16
---- switch to connection default ----
-set global query_cache_size=100000;
+set global query_cache_size=102400;
execute stmt1;
c1
10
@@ -297,7 +297,7 @@ prepare stmt1 from "select * from t1 where c1=10";
---- switch to connection con1 ----
prepare stmt3 from "select * from t1 where c1=10";
---- switch to connection default ----
-set global query_cache_size=100000;
+set global query_cache_size=102400;
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 21
@@ -344,7 +344,7 @@ Qcache_hits 21
---- switch to connection default ----
set global query_cache_size=0;
prepare stmt1 from "select * from t1 where c1=?";
-set global query_cache_size=100000;
+set global query_cache_size=102400;
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 21
@@ -548,7 +548,7 @@ alter table t1 add column b int;
execute stmt;
a
Pack my box with five dozen liquor jugs.
-set @@global.query_cache_size=100000;
+set @@global.query_cache_size=102400;
execute stmt;
a
Pack my box with five dozen liquor jugs.
diff --git a/mysql-test/r/query_cache_ps_ps_prot.result b/mysql-test/r/query_cache_ps_ps_prot.result
index e594161f2e9..2115ecc62ff 100644
--- a/mysql-test/r/query_cache_ps_ps_prot.result
+++ b/mysql-test/r/query_cache_ps_ps_prot.result
@@ -1,7 +1,7 @@
---- establish connection con1 (root) ----
---- switch to connection default ----
set @initial_query_cache_size = @@global.query_cache_size;
-set @@global.query_cache_size=100000;
+set @@global.query_cache_size=102400;
flush status;
drop table if exists t1;
create table t1(c1 int);
@@ -211,7 +211,7 @@ show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 14
---- switch to connection default ----
-set global query_cache_size=100000;
+set global query_cache_size=102400;
execute stmt1;
c1
10
@@ -297,7 +297,7 @@ prepare stmt1 from "select * from t1 where c1=10";
---- switch to connection con1 ----
prepare stmt3 from "select * from t1 where c1=10";
---- switch to connection default ----
-set global query_cache_size=100000;
+set global query_cache_size=102400;
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 19
@@ -344,7 +344,7 @@ Qcache_hits 19
---- switch to connection default ----
set global query_cache_size=0;
prepare stmt1 from "select * from t1 where c1=?";
-set global query_cache_size=100000;
+set global query_cache_size=102400;
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 19
@@ -548,7 +548,7 @@ alter table t1 add column b int;
execute stmt;
a
Pack my box with five dozen liquor jugs.
-set @@global.query_cache_size=100000;
+set @@global.query_cache_size=102400;
execute stmt;
a
Pack my box with five dozen liquor jugs.
diff --git a/mysql-test/r/select_safe.result b/mysql-test/r/select_safe.result
index feac9efcb13..5e5ef55477c 100644
--- a/mysql-test/r/select_safe.result
+++ b/mysql-test/r/select_safe.result
@@ -1,5 +1,5 @@
drop table if exists t1;
-SET SQL_SAFE_UPDATES=1,SQL_SELECT_LIMIT=4, SQL_MAX_JOIN_SIZE=9;
+SET SQL_SAFE_UPDATES=1,SQL_SELECT_LIMIT=4, MAX_JOIN_SIZE=9;
create table t1 (a int auto_increment primary key, b char(20));
insert into t1 values(1,"test");
SELECT SQL_BUFFER_RESULT * from t1;
@@ -90,4 +90,4 @@ set local max_join_size=1;
select * from (select 1 union select 2 union select 3) x;
ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
drop table t1;
-SET SQL_SAFE_UPDATES=0,SQL_SELECT_LIMIT=DEFAULT, SQL_MAX_JOIN_SIZE=DEFAULT;
+SET SQL_SAFE_UPDATES=0,SQL_SELECT_LIMIT=DEFAULT, MAX_JOIN_SIZE=DEFAULT;
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index ac118d0bab2..7ef69df56bd 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -3030,7 +3030,7 @@ set @x = @x + 1;
return @x;
end|
set @qcs1 = @@query_cache_size|
-set global query_cache_size = 100000|
+set global query_cache_size = 102400|
set @x = 1|
insert into t1 values ("qc", 42)|
select bug9902() from t1|
@@ -6903,15 +6903,12 @@ DROP FUNCTION f1;
drop procedure if exists p;
set @old_mode= @@sql_mode;
-set @@sql_mode= pow(2,32)-1;
+set @@sql_mode= cast(pow(2,32)-1 as unsigned integer);
select @@sql_mode into @full_mode;
create procedure p() begin end;
call p();
-select @@sql_mode;
-@@sql_mode
-REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,?,ONLY_FULL_GROUP_BY,NO_UNSIGNED_SUBTRACTION,NO_DIR_IN_CREATE,POSTGRESQL,ORACLE,MSSQL,DB2,MAXDB,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,MYSQL323,MYSQL40,ANSI,NO_AUTO_VALUE_ON_ZERO,NO_BACKSLASH_ESCAPES,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ALLOW_INVALID_DATES,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,HIGH_NOT_PRECEDENCE,NO_ENGINE_SUBSTITUTION,PAD_CHAR_TO_FULL_LENGTH
set @@sql_mode= @old_mode;
-select replace(@full_mode, '?', 'NOT_USED') into @full_mode;
+select replace(@full_mode, ',,,', ',NOT_USED,') into @full_mode;
select replace(@full_mode, 'ALLOW_INVALID_DATES', 'INVALID_DATES') into @full_mode;
select name from mysql.proc where name = 'p' and sql_mode = @full_mode;
name
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index ccea954c214..615ba21c811 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -3669,8 +3669,6 @@ CREATE TABLE t1 (a int, b int auto_increment, PRIMARY KEY (b));
CREATE TABLE t2 (x int auto_increment, y int, z int,
PRIMARY KEY (x), FOREIGN KEY (y) REFERENCES t1 (b));
SET SESSION sort_buffer_size = 32 * 1024;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '32768'
SELECT SQL_NO_CACHE COUNT(*)
FROM (SELECT a, b, (SELECT x FROM t2 WHERE y=b ORDER BY z DESC LIMIT 1) c
FROM t1) t;
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result
index 3b6541ce56a..4f492d05558 100644
--- a/mysql-test/r/union.result
+++ b/mysql-test/r/union.result
@@ -1305,6 +1305,8 @@ SELECT @tmp_max:= @@global.max_allowed_packet;
@tmp_max:= @@global.max_allowed_packet
1048576
SET @@global.max_allowed_packet=25000000;
+Warnings:
+Warning 1292 Truncated incorrect max_allowed_packet value: '25000000'
CREATE TABLE t1 (a mediumtext);
CREATE TABLE t2 (b varchar(20));
INSERT INTO t1 VALUES ('a');
diff --git a/mysql-test/r/user_limits.result b/mysql-test/r/user_limits.result
index a94eb4616d1..80ec5517b16 100644
--- a/mysql-test/r/user_limits.result
+++ b/mysql-test/r/user_limits.result
@@ -70,7 +70,7 @@ select @@session.max_user_connections, @@global.max_user_connections;
@@session.max_user_connections @@global.max_user_connections
0 0
set session max_user_connections= 2;
-ERROR HY000: Variable 'max_user_connections' is a GLOBAL variable and should be set with SET GLOBAL
+ERROR HY000: SESSION variable 'max_user_connections' is read-only. Use SET GLOBAL to assign the value
set global max_user_connections= 2;
select @@session.max_user_connections, @@global.max_user_connections;
@@session.max_user_connections @@global.max_user_connections
diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result
index 28da1dae931..fe3dd4171ce 100644
--- a/mysql-test/r/user_var.result
+++ b/mysql-test/r/user_var.result
@@ -192,8 +192,6 @@ coercibility(@v1) coercibility(@v2) coercibility(@v3) coercibility(@v4)
2 2 2 2
set session @honk=99;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@honk=99' at line 1
-set one_shot @honk=99;
-ERROR HY000: The 'SET ONE_SHOT' syntax is reserved for purposes internal to the MySQL server
select @@local.max_allowed_packet;
@@local.max_allowed_packet
#
diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result
index f98872d93b3..e99f4e3deb9 100644
--- a/mysql-test/r/variables.result
+++ b/mysql-test/r/variables.result
@@ -24,7 +24,7 @@ set @my_query_cache_type =@@global.query_cache_type;
set @my_rpl_recovery_rank =@@global.rpl_recovery_rank;
set @my_server_id =@@global.server_id;
set @my_slow_launch_time =@@global.slow_launch_time;
-set @my_storage_engine =@@global.storage_engine;
+set @my_storage_engine =@@global.default_storage_engine;
set @my_thread_cache_size =@@global.thread_cache_size;
set @my_max_allowed_packet =@@global.max_allowed_packet;
set @my_join_buffer_size =@@global.join_buffer_size;
@@ -165,28 +165,28 @@ set big_tables=OFF, big_tables=ON, big_tables=0, big_tables=1, big_tables="OFF",
set global concurrent_insert=2;
show variables like 'concurrent_insert';
Variable_name Value
-concurrent_insert 2
+concurrent_insert ALWAYS
select * from information_schema.session_variables where variable_name like 'concurrent_insert';
VARIABLE_NAME VARIABLE_VALUE
-CONCURRENT_INSERT 2
+CONCURRENT_INSERT ALWAYS
set global concurrent_insert=1;
show variables like 'concurrent_insert';
Variable_name Value
-concurrent_insert 1
+concurrent_insert AUTO
select * from information_schema.session_variables where variable_name like 'concurrent_insert';
VARIABLE_NAME VARIABLE_VALUE
-CONCURRENT_INSERT 1
+CONCURRENT_INSERT AUTO
set global concurrent_insert=0;
show variables like 'concurrent_insert';
Variable_name Value
-concurrent_insert 0
+concurrent_insert NEVER
select * from information_schema.session_variables where variable_name like 'concurrent_insert';
VARIABLE_NAME VARIABLE_VALUE
-CONCURRENT_INSERT 0
+CONCURRENT_INSERT NEVER
set global concurrent_insert=DEFAULT;
select @@concurrent_insert;
@@concurrent_insert
-1
+AUTO
set global timed_mutexes=ON;
show variables like 'timed_mutexes';
Variable_name Value
@@ -201,21 +201,23 @@ timed_mutexes OFF
select * from information_schema.session_variables where variable_name like 'timed_mutexes';
VARIABLE_NAME VARIABLE_VALUE
TIMED_MUTEXES OFF
-set storage_engine=MYISAM, storage_engine="HEAP", global storage_engine="MERGE";
-show local variables like 'storage_engine';
+set default_storage_engine=MYISAM, default_storage_engine="HEAP", global default_storage_engine="MERGE";
+show local variables like 'default_storage_engine';
Variable_name Value
-storage_engine MEMORY
-select * from information_schema.session_variables where variable_name like 'storage_engine';
+default_storage_engine MEMORY
+select * from information_schema.session_variables where variable_name like 'default_storage_engine';
VARIABLE_NAME VARIABLE_VALUE
-STORAGE_ENGINE MEMORY
-show global variables like 'storage_engine';
+DEFAULT_STORAGE_ENGINE MEMORY
+show global variables like 'default_storage_engine';
Variable_name Value
-storage_engine MRG_MYISAM
-select * from information_schema.global_variables where variable_name like 'storage_engine';
+default_storage_engine MRG_MYISAM
+select * from information_schema.global_variables where variable_name like 'default_storage_engine';
VARIABLE_NAME VARIABLE_VALUE
-STORAGE_ENGINE MRG_MYISAM
-set GLOBAL query_cache_size=100000;
+DEFAULT_STORAGE_ENGINE MRG_MYISAM
+set GLOBAL query_cache_size=102400;
set GLOBAL myisam_max_sort_file_size=2000000;
+Warnings:
+Warning 1292 Truncated incorrect myisam_max_sort_file_size value: '2000000'
show global variables like 'myisam_max_sort_file_size';
Variable_name Value
myisam_max_sort_file_size 1048576
@@ -256,6 +258,8 @@ NET_READ_TIMEOUT 30
NET_RETRY_COUNT 10
NET_WRITE_TIMEOUT 60
set global net_buffer_length=8000, global net_read_timeout=900, net_write_timeout=1000;
+Warnings:
+Warning 1292 Truncated incorrect net_buffer_length value: '8000'
show global variables like 'net_%';
Variable_name Value
net_buffer_length 7168
@@ -359,13 +363,20 @@ TRANSACTION_PREALLOC_SIZE 19456
==+ Manipulate variable values +==
Testing values that are not 1024 multiples
set @@range_alloc_block_size=1024*16+1023;
+Warnings:
+Warning 1292 Truncated incorrect range_alloc_block_size value: '17407'
set @@query_alloc_block_size=1024*17+2;
+Warnings:
+Warning 1292 Truncated incorrect query_alloc_block_size value: '17410'
set @@query_prealloc_size=1024*18-1023;
+Warnings:
+Warning 1292 Truncated incorrect query_prealloc_size value: '17409'
set @@transaction_alloc_block_size=1024*20-1;
+Warnings:
+Warning 1292 Truncated incorrect transaction_alloc_block_size value: '20479'
set @@transaction_prealloc_size=1024*21-1;
-select @@query_alloc_block_size;
-@@query_alloc_block_size
-17408
+Warnings:
+Warning 1292 Truncated incorrect transaction_prealloc_size value: '21503'
==+ Check manipulated values ==+
SHOW VARIABLES WHERE variable_name IN ('range_alloc_block_size',
'query_alloc_block_size', 'query_prealloc_size',
@@ -415,17 +426,15 @@ set unknown_variable=1;
ERROR HY000: Unknown system variable 'unknown_variable'
set max_join_size="hello";
ERROR 42000: Incorrect argument type to variable 'max_join_size'
-set storage_engine=UNKNOWN_TABLE_TYPE;
+set default_storage_engine=UNKNOWN_TABLE_TYPE;
ERROR 42000: Unknown table engine 'UNKNOWN_TABLE_TYPE'
-set storage_engine=MERGE, big_tables=2;
+set default_storage_engine=MERGE, big_tables=2;
ERROR 42000: Variable 'big_tables' can't be set to the value of '2'
-show local variables like 'storage_engine';
+show local variables like 'default_storage_engine';
Variable_name Value
-storage_engine MEMORY
+default_storage_engine MEMORY
set SESSION query_cache_size=10000;
ERROR HY000: Variable 'query_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
-set GLOBAL storage_engine=DEFAULT;
-ERROR 42000: Variable 'storage_engine' doesn't have a default value
set character_set_client=UNKNOWN_CHARACTER_SET;
ERROR 42000: Unknown character set: 'UNKNOWN_CHARACTER_SET'
set collation_connection=UNKNOWN_COLLATION;
@@ -434,18 +443,12 @@ set character_set_client=NULL;
ERROR 42000: Variable 'character_set_client' can't be set to the value of 'NULL'
set collation_connection=NULL;
ERROR 42000: Variable 'collation_connection' can't be set to the value of 'NULL'
-set global autocommit=1;
-ERROR HY000: Variable 'autocommit' is a SESSION variable and can't be used with SET GLOBAL
select @@global.timestamp;
ERROR HY000: Variable 'timestamp' is a SESSION variable
set @@version='';
ERROR HY000: Variable 'version' is a read only variable
set @@concurrent_insert=1;
ERROR HY000: Variable 'concurrent_insert' is a GLOBAL variable and should be set with SET GLOBAL
-set @@global.sql_auto_is_null=1;
-ERROR HY000: Variable 'sql_auto_is_null' is a SESSION variable and can't be used with SET GLOBAL
-select @@global.sql_auto_is_null;
-ERROR HY000: Variable 'sql_auto_is_null' is a SESSION variable
set myisam_max_sort_file_size=100;
ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL
set @@SQL_WARNINGS=NULL;
@@ -530,14 +533,16 @@ set net_read_timeout=100;
set net_write_timeout=100;
set global query_cache_limit=100;
set global query_cache_size=100;
+Warnings:
+Warning 1292 Truncated incorrect query_cache_size value: '100'
set global query_cache_type=demand;
set read_buffer_size=100;
Warnings:
Warning 1292 Truncated incorrect read_buffer_size value: '100'
set read_rnd_buffer_size=100;
-Warnings:
-Warning 1292 Truncated incorrect read_rnd_buffer_size value: '100'
set global rpl_recovery_rank=100;
+Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
set global server_id=100;
set global slow_launch_time=100;
set sort_buffer_size=100;
@@ -568,17 +573,13 @@ set sql_log_update=1;
Warnings:
Note 1315 The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored
set sql_low_priority_updates=1;
-set sql_max_join_size=200;
-select @@sql_max_join_size,@@max_join_size;
-@@sql_max_join_size @@max_join_size
-200 200
set sql_quote_show_create=1;
set sql_safe_updates=1;
set sql_select_limit=1;
set sql_select_limit=default;
set sql_warnings=1;
set global table_open_cache=100;
-set storage_engine=myisam;
+set default_storage_engine=myisam;
set global thread_cache_size=100;
set timestamp=1, timestamp=default;
set tmp_table_size=100;
@@ -615,6 +616,8 @@ create table t2 (a int not null auto_increment, primary key(a));
insert into t1 values(null),(null),(null);
insert into t2 values(null),(null),(null);
set global key_buffer_size=100000;
+Warnings:
+Warning 1292 Truncated incorrect key_buffer_size value: '100000'
select @@key_buffer_size;
@@key_buffer_size
98304
@@ -658,11 +661,11 @@ MYISAM_MAX_SORT_FILE_SIZE MAX_FILE_SIZE
set global myisam_max_sort_file_size=default;
select @@global.max_user_connections,@@local.max_join_size;
@@global.max_user_connections @@local.max_join_size
-100 200
+100 100
set @svc=@@global.max_user_connections, @svj=@@local.max_join_size;
select @@global.max_user_connections,@@local.max_join_size;
@@global.max_user_connections @@local.max_join_size
-100 200
+100 100
set @@global.max_user_connections=111,@@local.max_join_size=222;
select @@global.max_user_connections,@@local.max_join_size;
@@global.max_user_connections @@local.max_join_size
@@ -674,7 +677,7 @@ select @@global.max_user_connections,@@local.max_join_size;
set @@global.max_user_connections=@svc, @@local.max_join_size=@svj;
select @@global.max_user_connections,@@local.max_join_size;
@@global.max_user_connections @@local.max_join_size
-100 200
+100 100
set @a=1, @b=2;
set @a=@b, @b=@a;
select @a, @b;
@@ -1055,9 +1058,11 @@ set global net_read_timeout =@my_net_read_timeout;
set global query_cache_limit =@my_query_cache_limit;
set global query_cache_type =@my_query_cache_type;
set global rpl_recovery_rank =@my_rpl_recovery_rank;
+Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
set global server_id =@my_server_id;
set global slow_launch_time =@my_slow_launch_time;
-set global storage_engine =@my_storage_engine;
+set global default_storage_engine =@my_storage_engine;
set global thread_cache_size =@my_thread_cache_size;
set global max_allowed_packet =@my_max_allowed_packet;
set global join_buffer_size =@my_join_buffer_size;
@@ -1440,10 +1445,10 @@ Warning 1292 Truncated incorrect auto_increment_offset value: '-1'
SET GLOBAL auto_increment_offset=0;
Warnings:
Warning 1292 Truncated incorrect auto_increment_offset value: '0'
-select @@storage_engine;
+select @@default_storage_engine;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @@storage_engine 253 6 6 Y 0 31 8
-@@storage_engine
+def @@default_storage_engine 253 6 6 Y 0 31 8
+@@default_storage_engine
MyISAM
SET @old_server_id = @@GLOBAL.server_id;
SET GLOBAL server_id = (1 << 32) - 1;
diff --git a/mysql-test/suite/binlog/r/binlog_grant.result b/mysql-test/suite/binlog/r/binlog_grant.result
index 548013fcbf2..1c0e73f8842 100644
--- a/mysql-test/suite/binlog/r/binlog_grant.result
+++ b/mysql-test/suite/binlog/r/binlog_grant.result
@@ -6,12 +6,8 @@ Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
**** Variable SQL_LOG_BIN ****
[root]
-set global sql_log_bin = 1;
-ERROR HY000: Variable 'sql_log_bin' is a SESSION variable and can't be used with SET GLOBAL
set session sql_log_bin = 1;
[plain]
-set global sql_log_bin = 1;
-ERROR HY000: Variable 'sql_log_bin' is a SESSION variable and can't be used with SET GLOBAL
set session sql_log_bin = 1;
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
**** Variable BINLOG_FORMAT ****
diff --git a/mysql-test/suite/binlog/t/binlog_grant.test b/mysql-test/suite/binlog/t/binlog_grant.test
index d36dcce4cc3..9d9c6031b5a 100644
--- a/mysql-test/suite/binlog/t/binlog_grant.test
+++ b/mysql-test/suite/binlog/t/binlog_grant.test
@@ -22,14 +22,10 @@ connect (root,localhost,root,,test);
connection root;
--echo [root]
---error ER_LOCAL_VARIABLE
-set global sql_log_bin = 1;
set session sql_log_bin = 1;
connection plain;
--echo [plain]
---error ER_LOCAL_VARIABLE
-set global sql_log_bin = 1;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
set session sql_log_bin = 1;
diff --git a/mysql-test/suite/innodb/r/innodb-zip.result b/mysql-test/suite/innodb/r/innodb-zip.result
index 21396d81ba8..bcd3849238f 100644
--- a/mysql-test/suite/innodb/r/innodb-zip.result
+++ b/mysql-test/suite/innodb/r/innodb-zip.result
@@ -173,19 +173,19 @@ select @@innodb_file_format;
@@innodb_file_format
Barracuda
set global innodb_file_format=`2`;
-ERROR HY000: Incorrect arguments to SET
+ERROR 42000: Variable 'innodb_file_format' can't be set to the value of '2'
set global innodb_file_format=`-1`;
-ERROR HY000: Incorrect arguments to SET
+ERROR 42000: Variable 'innodb_file_format' can't be set to the value of '-1'
set global innodb_file_format=`Antelope`;
set global innodb_file_format=`Barracuda`;
set global innodb_file_format=`Cheetah`;
-ERROR HY000: Incorrect arguments to SET
+ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'Cheetah'
set global innodb_file_format=`abc`;
-ERROR HY000: Incorrect arguments to SET
+ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'abc'
set global innodb_file_format=`1a`;
-ERROR HY000: Incorrect arguments to SET
+ERROR 42000: Variable 'innodb_file_format' can't be set to the value of '1a'
set global innodb_file_format=``;
-ERROR HY000: Incorrect arguments to SET
+ERROR 42000: Variable 'innodb_file_format' can't be set to the value of ''
set global innodb_file_per_table = on;
set global innodb_file_format = `1`;
set innodb_strict_mode = off;
diff --git a/mysql-test/suite/innodb/r/innodb_bug47167.result b/mysql-test/suite/innodb/r/innodb_bug47167.result
index cbec363d78f..cf8cb0c0d7b 100644
--- a/mysql-test/suite/innodb/r/innodb_bug47167.result
+++ b/mysql-test/suite/innodb/r/innodb_bug47167.result
@@ -15,10 +15,10 @@ select @@innodb_file_format_check;
@@innodb_file_format_check
Antelope
set global innodb_file_format_check = cheetah;
-ERROR HY000: Incorrect arguments to SET
+ERROR 42000: Variable 'innodb_file_format_check' can't be set to the value of 'cheetah'
set global innodb_file_format_check = Bear;
-ERROR HY000: Incorrect arguments to SET
+ERROR 42000: Variable 'innodb_file_format_check' can't be set to the value of 'Bear'
set global innodb_file_format_check = on;
-ERROR HY000: Incorrect arguments to SET
+ERROR 42000: Variable 'innodb_file_format_check' can't be set to the value of 'ON'
set global innodb_file_format_check = off;
-ERROR HY000: Incorrect arguments to SET
+ERROR 42000: Variable 'innodb_file_format_check' can't be set to the value of 'off'
diff --git a/mysql-test/suite/innodb/r/innodb_file_format.result b/mysql-test/suite/innodb/r/innodb_file_format.result
index 36f176c616a..107025e4e52 100644
--- a/mysql-test/suite/innodb/r/innodb_file_format.result
+++ b/mysql-test/suite/innodb/r/innodb_file_format.result
@@ -8,7 +8,7 @@ Antelope
set global innodb_file_format=antelope;
set global innodb_file_format=barracuda;
set global innodb_file_format=cheetah;
-ERROR HY000: Incorrect arguments to SET
+ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'cheetah'
select @@innodb_file_format;
@@innodb_file_format
Barracuda
@@ -17,16 +17,16 @@ select @@innodb_file_format;
@@innodb_file_format
Antelope
set global innodb_file_format=on;
-ERROR HY000: Incorrect arguments to SET
+ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'ON'
set global innodb_file_format=off;
-ERROR HY000: Incorrect arguments to SET
+ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'off'
select @@innodb_file_format;
@@innodb_file_format
Antelope
set global innodb_file_format_check=antelope;
set global innodb_file_format_check=barracuda;
set global innodb_file_format_check=cheetah;
-ERROR HY000: Incorrect arguments to SET
+ERROR 42000: Variable 'innodb_file_format_check' can't be set to the value of 'cheetah'
select @@innodb_file_format_check;
@@innodb_file_format_check
Barracuda
@@ -35,9 +35,9 @@ select @@innodb_file_format_check;
@@innodb_file_format_check
Barracuda
set global innodb_file_format=on;
-ERROR HY000: Incorrect arguments to SET
+ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'ON'
set global innodb_file_format=off;
-ERROR HY000: Incorrect arguments to SET
+ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'off'
select @@innodb_file_format_check;
@@innodb_file_format_check
Barracuda
diff --git a/mysql-test/suite/innodb/t/innodb-zip.test b/mysql-test/suite/innodb/t/innodb-zip.test
index fdb9b89e37a..eb517563416 100644
--- a/mysql-test/suite/innodb/t/innodb-zip.test
+++ b/mysql-test/suite/innodb/t/innodb-zip.test
@@ -142,19 +142,19 @@ set global innodb_file_format=`0`;
select @@innodb_file_format;
set global innodb_file_format=`1`;
select @@innodb_file_format;
--- error ER_WRONG_ARGUMENTS
+-- error ER_WRONG_VALUE_FOR_VAR
set global innodb_file_format=`2`;
--- error ER_WRONG_ARGUMENTS
+-- error ER_WRONG_VALUE_FOR_VAR
set global innodb_file_format=`-1`;
set global innodb_file_format=`Antelope`;
set global innodb_file_format=`Barracuda`;
--- error ER_WRONG_ARGUMENTS
+-- error ER_WRONG_VALUE_FOR_VAR
set global innodb_file_format=`Cheetah`;
--- error ER_WRONG_ARGUMENTS
+-- error ER_WRONG_VALUE_FOR_VAR
set global innodb_file_format=`abc`;
--- error ER_WRONG_ARGUMENTS
+-- error ER_WRONG_VALUE_FOR_VAR
set global innodb_file_format=`1a`;
--- error ER_WRONG_ARGUMENTS
+-- error ER_WRONG_VALUE_FOR_VAR
set global innodb_file_format=``;
#test strict mode.
diff --git a/mysql-test/suite/innodb/t/innodb_bug47167.test b/mysql-test/suite/innodb/t/innodb_bug47167.test
index 88e927c01bd..9b8bff0292f 100644
--- a/mysql-test/suite/innodb/t/innodb_bug47167.test
+++ b/mysql-test/suite/innodb/t/innodb_bug47167.test
@@ -31,15 +31,15 @@ select @@innodb_file_format_check;
# Following are negative tests, all should fail.
--disable_warnings
---error ER_WRONG_ARGUMENTS
+--error ER_WRONG_VALUE_FOR_VAR
set global innodb_file_format_check = cheetah;
---error ER_WRONG_ARGUMENTS
+--error ER_WRONG_VALUE_FOR_VAR
set global innodb_file_format_check = Bear;
---error ER_WRONG_ARGUMENTS
+--error ER_WRONG_VALUE_FOR_VAR
set global innodb_file_format_check = on;
---error ER_WRONG_ARGUMENTS
+--error ER_WRONG_VALUE_FOR_VAR
set global innodb_file_format_check = off;
--enable_warnings
diff --git a/mysql-test/suite/innodb/t/innodb_file_format.test b/mysql-test/suite/innodb/t/innodb_file_format.test
index 3bd1dd2fa6f..4e11da5f123 100644
--- a/mysql-test/suite/innodb/t/innodb_file_format.test
+++ b/mysql-test/suite/innodb/t/innodb_file_format.test
@@ -9,26 +9,26 @@ select @@innodb_file_format;
select @@innodb_file_format_check;
set global innodb_file_format=antelope;
set global innodb_file_format=barracuda;
---error ER_WRONG_ARGUMENTS
+--error ER_WRONG_VALUE_FOR_VAR
set global innodb_file_format=cheetah;
select @@innodb_file_format;
set global innodb_file_format=default;
select @@innodb_file_format;
---error ER_WRONG_ARGUMENTS
+--error ER_WRONG_VALUE_FOR_VAR
set global innodb_file_format=on;
---error ER_WRONG_ARGUMENTS
+--error ER_WRONG_VALUE_FOR_VAR
set global innodb_file_format=off;
select @@innodb_file_format;
set global innodb_file_format_check=antelope;
set global innodb_file_format_check=barracuda;
---error ER_WRONG_ARGUMENTS
+--error ER_WRONG_VALUE_FOR_VAR
set global innodb_file_format_check=cheetah;
select @@innodb_file_format_check;
set global innodb_file_format_check=default;
select @@innodb_file_format_check;
---error ER_WRONG_ARGUMENTS
+--error ER_WRONG_VALUE_FOR_VAR
set global innodb_file_format=on;
---error ER_WRONG_ARGUMENTS
+--error ER_WRONG_VALUE_FOR_VAR
set global innodb_file_format=off;
select @@innodb_file_format_check;
diff --git a/mysql-test/suite/ndb/r/ndb_basic.result b/mysql-test/suite/ndb/r/ndb_basic.result
index 9f4f8c0755c..cbc320908ac 100644
--- a/mysql-test/suite/ndb/r/ndb_basic.result
+++ b/mysql-test/suite/ndb/r/ndb_basic.result
@@ -18,11 +18,15 @@ Variable_name Value
ndb_autoincrement_prefetch_sz #
ndb_cache_check_time #
ndb_connectstring #
+ndb_distribution #
ndb_extra_logging #
ndb_force_send #
ndb_index_stat_cache_entries #
ndb_index_stat_enable #
ndb_index_stat_update_freq #
+ndb_mgmd_host #
+ndb_nodeid #
+ndb_optimized_node_selection #
ndb_report_thresh_binlog_epoch_slip #
ndb_report_thresh_binlog_mem_usage #
ndb_use_copying_alter_table #
diff --git a/mysql-test/suite/ndb/r/ndb_dd_ddl.result b/mysql-test/suite/ndb/r/ndb_dd_ddl.result
index 9714a89c2ab..35516efb48c 100644
--- a/mysql-test/suite/ndb/r/ndb_dd_ddl.result
+++ b/mysql-test/suite/ndb/r/ndb_dd_ddl.result
@@ -308,6 +308,7 @@ ENGINE = NDB;
DROP USER mysqltest_u1@localhost;
DROP USER mysqltest_u2@localhost;
+DROP DATABASE mysqltest2;
# -----------------------------------------------------------------
# End 6.0 test
diff --git a/mysql-test/suite/ndb/t/ndb_dd_ddl.test b/mysql-test/suite/ndb/t/ndb_dd_ddl.test
index e8db0730687..ca39be87c94 100644
--- a/mysql-test/suite/ndb/t/ndb_dd_ddl.test
+++ b/mysql-test/suite/ndb/t/ndb_dd_ddl.test
@@ -462,6 +462,7 @@ ENGINE = NDB;
DROP USER mysqltest_u1@localhost;
DROP USER mysqltest_u2@localhost;
+DROP DATABASE mysqltest2;
--echo
--echo # -----------------------------------------------------------------
diff --git a/mysql-test/suite/rpl/r/rpl_charset.result b/mysql-test/suite/rpl/r/rpl_charset.result
index ae5cf3b0fd1..a4841b0baf3 100644
--- a/mysql-test/suite/rpl/r/rpl_charset.result
+++ b/mysql-test/suite/rpl/r/rpl_charset.result
@@ -116,8 +116,7 @@ latin5
select @@character_set_server;
@@character_set_server
latin5
-set one_shot max_join_size=10;
-ERROR HY000: The 'SET ONE_SHOT' syntax is reserved for purposes internal to the MySQL server
+set one_shot max_join_size=1000000;
set character_set_client=9999999;
ERROR 42000: Unknown character set: '9999999'
set collation_server=9999998;
diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat.result b/mysql-test/suite/rpl/r/rpl_heartbeat.result
index 92ba8549ee4..44b3964f632 100644
--- a/mysql-test/suite/rpl/r/rpl_heartbeat.result
+++ b/mysql-test/suite/rpl/r/rpl_heartbeat.result
@@ -42,7 +42,7 @@ Variable_name Slave_heartbeat_period
Value 4.000
set @@global.slave_net_timeout= 3 /* must be a warning */;
Warnings:
-Warning 1624 The currect value for master_heartbeat_period exceeds the new value of `slave_net_timeout' sec. A sensible value for the period should be less than the timeout.
+Warning 1624 The current value for master_heartbeat_period exceeds the new value of `slave_net_timeout' sec. A sensible value for the period should be less than the timeout.
reset slave;
drop table if exists t1;
set @@global.slave_net_timeout= 10;
diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result
index d229e1260dd..5a47d1da596 100644
--- a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result
+++ b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result
@@ -38,7 +38,7 @@ RESET SLAVE;
*** Warning if updated slave_net_timeout < slave_heartbeat_timeout ***
SET @@global.slave_net_timeout=FLOOR(SLAVE_HEARTBEAT_TIMEOUT)-1;
Warnings:
-Warning 1624 The currect value for master_heartbeat_period exceeds the new value of `slave_net_timeout' sec. A sensible value for the period should be less than the timeout.
+Warning 1624 The current value for master_heartbeat_period exceeds the new value of `slave_net_timeout' sec. A sensible value for the period should be less than the timeout.
SET @@global.slave_net_timeout=@restore_slave_net_timeout;
RESET SLAVE;
diff --git a/mysql-test/suite/rpl/r/rpl_idempotency.result b/mysql-test/suite/rpl/r/rpl_idempotency.result
index bfdcbc6fa23..6a20480fb5a 100644
--- a/mysql-test/suite/rpl/r/rpl_idempotency.result
+++ b/mysql-test/suite/rpl/r/rpl_idempotency.result
@@ -113,7 +113,7 @@ a b
set global slave_exec_mode='IDEMPOTENT';
set global slave_exec_mode='STRICT';
set global slave_exec_mode='IDEMPOTENT,STRICT';
-ERROR HY000: Ambiguous slave modes combination.
+ERROR 42000: Variable 'slave_exec_mode' can't be set to the value of 'IDEMPOTENT,STRICT'
select @@global.slave_exec_mode /* must be STRICT */;
@@global.slave_exec_mode
STRICT
diff --git a/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result b/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result
index c2554218f73..a21bec6ae55 100644
--- a/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result
+++ b/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result
@@ -17,6 +17,8 @@ reset slave;
set @my_max_binlog_size= @@global.max_binlog_size;
set global max_binlog_size=8192;
set global max_relay_log_size=8192-1;
+Warnings:
+Warning 1292 Truncated incorrect max_relay_log_size value: '8191'
select @@global.max_relay_log_size;
@@global.max_relay_log_size
4096
diff --git a/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result b/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result
index c2554218f73..a21bec6ae55 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result
@@ -17,6 +17,8 @@ reset slave;
set @my_max_binlog_size= @@global.max_binlog_size;
set global max_binlog_size=8192;
set global max_relay_log_size=8192-1;
+Warnings:
+Warning 1292 Truncated incorrect max_relay_log_size value: '8191'
select @@global.max_relay_log_size;
@@global.max_relay_log_size
4096
diff --git a/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result b/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result
index 7447d12f9b2..37781aeac0c 100644
--- a/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result
+++ b/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result
@@ -23,7 +23,7 @@ binlog_format ROW
set global binlog_format=DEFAULT;
show global variables like "binlog_format%";
Variable_name Value
-binlog_format MIXED
+binlog_format STATEMENT
set global binlog_format=MIXED;
show global variables like "binlog_format%";
Variable_name Value
diff --git a/mysql-test/suite/rpl/r/rpl_variables_stm.result b/mysql-test/suite/rpl/r/rpl_variables_stm.result
index 51484187215..7a1bcc4f44f 100644
--- a/mysql-test/suite/rpl/r/rpl_variables_stm.result
+++ b/mysql-test/suite/rpl/r/rpl_variables_stm.result
@@ -6,7 +6,6 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
==== Initialization ====
[on master]
-SET @m_pseudo_thread_id= @@global.pseudo_thread_id;
SET @m_auto_increment_increment= @@global.auto_increment_increment;
SET @m_auto_increment_offset= @@global.auto_increment_offset;
SET @m_character_set_client= @@global.character_set_client;
@@ -16,7 +15,6 @@ SET @m_time_zone= @@global.time_zone;
SET @m_lc_time_names= @@global.lc_time_names;
SET @m_collation_database= @@global.collation_database;
[on slave]
-SET @s_pseudo_thread_id= @@global.pseudo_thread_id;
SET @s_auto_increment_increment= @@global.auto_increment_increment;
SET @s_auto_increment_offset= @@global.auto_increment_offset;
SET @s_character_set_client= @@global.character_set_client;
@@ -25,7 +23,6 @@ SET @s_collation_server= @@global.collation_server;
SET @s_time_zone= @@global.time_zone;
SET @s_lc_time_names= @@global.lc_time_names;
SET @s_collation_database= @@global.collation_database;
-SET @@global.pseudo_thread_id= 4711;
SET @@global.auto_increment_increment=19;
SET @@global.auto_increment_offset=4;
SET @@global.character_set_client='latin2';
@@ -505,7 +502,6 @@ DROP PROCEDURE proc;
DROP FUNCTION func;
DROP TRIGGER trig;
DROP TABLE tstmt, tproc, tfunc, ttrig, tprep, trigger_table;
-SET @@global.pseudo_thread_id= @m_pseudo_thread_id;
SET @@global.auto_increment_increment= @m_auto_increment_increment;
SET @@global.auto_increment_offset= @m_auto_increment_offset;
SET @@global.character_set_client= @m_character_set_client;
@@ -515,7 +511,6 @@ SET @@global.time_zone= @m_time_zone;
SET @@global.lc_time_names= @m_lc_time_names;
SET @@global.collation_database= @m_collation_database;
[on slave]
-SET @@global.pseudo_thread_id= @s_pseudo_thread_id;
SET @@global.auto_increment_increment= @s_auto_increment_increment;
SET @@global.auto_increment_offset= @s_auto_increment_offset;
SET @@global.character_set_client= @s_character_set_client;
diff --git a/mysql-test/suite/rpl/t/rpl_idempotency.test b/mysql-test/suite/rpl/t/rpl_idempotency.test
index c96b88a1b1a..b1abe916806 100644
--- a/mysql-test/suite/rpl/t/rpl_idempotency.test
+++ b/mysql-test/suite/rpl/t/rpl_idempotency.test
@@ -165,7 +165,7 @@ set global slave_exec_mode='IDEMPOTENT';
set global slave_exec_mode='STRICT';
# checking mutual exclusion for the options
---error ER_SLAVE_AMBIGOUS_EXEC_MODE
+--error ER_WRONG_VALUE_FOR_VAR
set global slave_exec_mode='IDEMPOTENT,STRICT';
select @@global.slave_exec_mode /* must be STRICT */;
diff --git a/mysql-test/suite/rpl/t/rpl_sp_effects-master.opt b/mysql-test/suite/rpl/t/rpl_sp_effects-master.opt
index 61dd7a6ad0e..27fad1403d2 100644
--- a/mysql-test/suite/rpl/t/rpl_sp_effects-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_sp_effects-master.opt
@@ -1 +1 @@
---log_bin_trust_routine_creators=1
+--log_bin_trust_function_creators=1
diff --git a/mysql-test/suite/rpl/t/rpl_sp_effects-slave.opt b/mysql-test/suite/rpl/t/rpl_sp_effects-slave.opt
index 61dd7a6ad0e..27fad1403d2 100644
--- a/mysql-test/suite/rpl/t/rpl_sp_effects-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_sp_effects-slave.opt
@@ -1 +1 @@
---log_bin_trust_routine_creators=1
+--log_bin_trust_function_creators=1
diff --git a/mysql-test/suite/rpl/t/rpl_variables_stm.test b/mysql-test/suite/rpl/t/rpl_variables_stm.test
index 67f2e50e041..c05bc42b1c2 100644
--- a/mysql-test/suite/rpl/t/rpl_variables_stm.test
+++ b/mysql-test/suite/rpl/t/rpl_variables_stm.test
@@ -63,7 +63,6 @@ source include/have_binlog_format_mixed_or_statement.inc;
--echo [on master]
connection master;
-SET @m_pseudo_thread_id= @@global.pseudo_thread_id;
SET @m_auto_increment_increment= @@global.auto_increment_increment;
SET @m_auto_increment_offset= @@global.auto_increment_offset;
SET @m_character_set_client= @@global.character_set_client;
@@ -75,7 +74,6 @@ SET @m_collation_database= @@global.collation_database;
--echo [on slave]
connection slave;
-SET @s_pseudo_thread_id= @@global.pseudo_thread_id;
SET @s_auto_increment_increment= @@global.auto_increment_increment;
SET @s_auto_increment_offset= @@global.auto_increment_offset;
SET @s_character_set_client= @@global.character_set_client;
@@ -85,7 +83,6 @@ SET @s_time_zone= @@global.time_zone;
SET @s_lc_time_names= @@global.lc_time_names;
SET @s_collation_database= @@global.collation_database;
-SET @@global.pseudo_thread_id= 4711;
SET @@global.auto_increment_increment=19;
SET @@global.auto_increment_offset=4;
SET @@global.character_set_client='latin2';
@@ -612,7 +609,6 @@ DROP FUNCTION func;
DROP TRIGGER trig;
DROP TABLE tstmt, tproc, tfunc, ttrig, tprep, trigger_table;
-SET @@global.pseudo_thread_id= @m_pseudo_thread_id;
SET @@global.auto_increment_increment= @m_auto_increment_increment;
SET @@global.auto_increment_offset= @m_auto_increment_offset;
SET @@global.character_set_client= @m_character_set_client;
@@ -624,7 +620,6 @@ SET @@global.collation_database= @m_collation_database;
--echo [on slave]
connection slave;
-SET @@global.pseudo_thread_id= @s_pseudo_thread_id;
SET @@global.auto_increment_increment= @s_auto_increment_increment;
SET @@global.auto_increment_offset= @s_auto_increment_offset;
SET @@global.character_set_client= @s_character_set_client;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_2innodb.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2innodb.result
index 9857f621bbe..b4e6c7c77b5 100644
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_2innodb.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2innodb.result
@@ -924,4 +924,5 @@ DELETE FROM t1;
--- End test 5 key partition testing ---
--- Do Cleanup ---
DROP TABLE IF EXISTS t1;
+set @@global.slave_exec_mode= DEFAULT;
drop table mysql.ndb_apply_status;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_2myisam.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2myisam.result
index 44ee9d01709..935a7d61dfa 100644
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_2myisam.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2myisam.result
@@ -924,4 +924,5 @@ DELETE FROM t1;
--- End test 5 key partition testing ---
--- Do Cleanup ---
DROP TABLE IF EXISTS t1;
+set @@global.slave_exec_mode= DEFAULT;
drop table mysql.ndb_apply_status;
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test
index 3b075808481..21265f730d3 100644
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test
@@ -31,5 +31,6 @@ CREATE TABLE mysql.ndb_apply_status
--source extra/rpl_tests/rpl_ndb_2multi_eng.test
+set @@global.slave_exec_mode= DEFAULT;
--connection slave
drop table mysql.ndb_apply_status;
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test
index 560efec255b..785222f85e4 100644
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test
@@ -30,5 +30,6 @@ CREATE TABLE mysql.ndb_apply_status
--source extra/rpl_tests/rpl_ndb_2multi_eng.test
+set @@global.slave_exec_mode= DEFAULT;
--connection slave
drop table mysql.ndb_apply_status;
diff --git a/mysql-test/suite/sys_vars/README b/mysql-test/suite/sys_vars/README
deleted file mode 100644
index a84f00f1f62..00000000000
--- a/mysql-test/suite/sys_vars/README
+++ /dev/null
@@ -1,3 +0,0 @@
-Some of these tests allocate more than 4GB RAM.
-So, assure that the machine on which the suite will be executed has more than 4GB RAM.
-
diff --git a/mysql-test/suite/sys_vars/inc/bulk_insert_buffer_size_basic.inc b/mysql-test/suite/sys_vars/inc/bulk_insert_buffer_size_basic.inc
index 56ffbace173..a9580028c7e 100644
--- a/mysql-test/suite/sys_vars/inc/bulk_insert_buffer_size_basic.inc
+++ b/mysql-test/suite/sys_vars/inc/bulk_insert_buffer_size_basic.inc
@@ -115,7 +115,6 @@ SET @@session.bulk_insert_buffer_size = 42949672950;
SELECT @@session.bulk_insert_buffer_size;
SET @@session.bulk_insert_buffer_size = -2;
SELECT @@session.bulk_insert_buffer_size;
-echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.bulk_insert_buffer_size = test;
diff --git a/mysql-test/suite/sys_vars/inc/delayed_insert_limit_basic.inc b/mysql-test/suite/sys_vars/inc/delayed_insert_limit_basic.inc
index ab158bc593e..0c9a7d1ddb8 100644
--- a/mysql-test/suite/sys_vars/inc/delayed_insert_limit_basic.inc
+++ b/mysql-test/suite/sys_vars/inc/delayed_insert_limit_basic.inc
@@ -79,7 +79,6 @@ SET @@global.delayed_insert_limit = -1024;
SELECT @@global.delayed_insert_limit;
SET @@global.delayed_insert_limit = 42949672950;
SELECT @@global.delayed_insert_limit;
-echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.delayed_insert_limit = 429496729.5;
diff --git a/mysql-test/suite/sys_vars/inc/delayed_queue_size_basic.inc b/mysql-test/suite/sys_vars/inc/delayed_queue_size_basic.inc
index 2d16f75d4e1..e8b5ab31224 100644
--- a/mysql-test/suite/sys_vars/inc/delayed_queue_size_basic.inc
+++ b/mysql-test/suite/sys_vars/inc/delayed_queue_size_basic.inc
@@ -77,7 +77,6 @@ SET @@global.delayed_queue_size = -1024;
SELECT @@global.delayed_queue_size;
SET @@global.delayed_queue_size = 42949672950;
SELECT @@global.delayed_queue_size;
-echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.delayed_queue_size = 429496729.5;
diff --git a/mysql-test/suite/sys_vars/inc/join_buffer_size_basic.inc b/mysql-test/suite/sys_vars/inc/join_buffer_size_basic.inc
index 880dac4cac4..618b70f3ac3 100644
--- a/mysql-test/suite/sys_vars/inc/join_buffer_size_basic.inc
+++ b/mysql-test/suite/sys_vars/inc/join_buffer_size_basic.inc
@@ -45,40 +45,24 @@ SELECT @start_session_value;
# Display the DEFAULT value of join_buffer_size #
################################################################
-SET @@global.join_buffer_size = 8200;
SET @@global.join_buffer_size = DEFAULT;
SELECT @@global.join_buffer_size;
-SET @@session.join_buffer_size = 8200;
SET @@session.join_buffer_size = DEFAULT;
SELECT @@session.join_buffer_size;
---echo '#--------------------FN_DYNVARS_053_02-------------------------#'
-###################################################################
-# Check the DEFAULT value of join_buffer_size #
-###################################################################
-
-SET @@global.join_buffer_size = DEFAULT;
-SELECT @@global.join_buffer_size = 131072;
-
-SET @@session.join_buffer_size = DEFAULT;
-SELECT @@session.join_buffer_size = 131072;
-
-
--echo '#--------------------FN_DYNVARS_053_03-------------------------#'
##########################################################################
# Change the value of join_buffer_size to a valid value for GLOBAL Scope #
##########################################################################
SET @@global.join_buffer_size = 8200;
-SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
+SELECT @@global.join_buffer_size;
SET @@global.join_buffer_size = 65536;
SELECT @@global.join_buffer_size;
SET @@global.join_buffer_size = 4294967295;
SELECT @@global.join_buffer_size;
-echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
--echo '#--------------------FN_DYNVARS_053_04-------------------------#'
###########################################################################
@@ -86,13 +70,11 @@ echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable
###########################################################################
SET @@session.join_buffer_size = 8200;
-SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
+SELECT @@session.join_buffer_size;
SET @@session.join_buffer_size = 65536;
SELECT @@session.join_buffer_size;
SET @@session.join_buffer_size = 4294967295;
SELECT @@session.join_buffer_size;
-echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
--echo '#------------------FN_DYNVARS_053_05-----------------------#'
############################################################
@@ -100,40 +82,38 @@ echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable
############################################################
SET @@global.join_buffer_size = 0;
-SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
+SELECT @@global.join_buffer_size;
SET @@global.join_buffer_size = -1024;
-SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
-SET @@global.join_buffer_size = 8199;
-SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
+SELECT @@global.join_buffer_size;
+SET @@global.join_buffer_size = 127;
+SELECT @@global.join_buffer_size;
SET @@global.join_buffer_size = 42949672951;
SELECT @@global.join_buffer_size;
---Error ER_PARSE_ERROR
-SET @@global.join_buffer_size = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.join_buffer_size = 65530.34;
SELECT @@global.join_buffer_size;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.join_buffer_size = test;
SELECT @@global.join_buffer_size;
SET @@session.join_buffer_size = 0;
-SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
-SET @@session.join_buffer_size = -2;
-SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
-SET @@session.join_buffer_size = 8199;
-SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
+SELECT @@session.join_buffer_size;
+SET @@session.join_buffer_size = -1024;
+SELECT @@session.join_buffer_size;
+SET @@session.join_buffer_size = 127;
+SELECT @@session.join_buffer_size;
SET @@session.join_buffer_size = 42949672951;
SELECT @@session.join_buffer_size;
---Error ER_PARSE_ERROR
-SET @@session.join_buffer_size = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.join_buffer_size = 65530.34;
SELECT @@session.join_buffer_size;
-echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.join_buffer_size = test;
SELECT @@session.join_buffer_size;
-
--echo '#------------------FN_DYNVARS_053_06-----------------------#'
####################################################################
# Check if the value in GLOBAL Table matches value in variable #
@@ -160,11 +140,7 @@ WHERE VARIABLE_NAME='join_buffer_size';
####################################################################
SET @@global.join_buffer_size = TRUE;
-SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
SET @@global.join_buffer_size = FALSE;
-SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
---echo 'Bug: Errors are not coming on assigning TRUE/FALSE to variable';
-
--echo '#---------------------FN_DYNVARS_001_09----------------------#'
#################################################################################
@@ -174,7 +150,6 @@ SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
SET @@global.join_buffer_size = 10;
SELECT @@join_buffer_size = @@global.join_buffer_size;
-
--echo '#---------------------FN_DYNVARS_001_10----------------------#'
########################################################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
@@ -184,14 +159,13 @@ SET @@join_buffer_size = 100;
SELECT @@join_buffer_size = @@local.join_buffer_size;
SELECT @@local.join_buffer_size = @@session.join_buffer_size;
-
--echo '#---------------------FN_DYNVARS_001_11----------------------#'
##############################################################################
# Check if join_buffer_size can be accessed with and without @@ sign #
##############################################################################
SET join_buffer_size = 1;
-SELECT @@join_buffer_size=8200 OR @@join_buffer_size= 8228;
+SELECT @@join_buffer_size;
--Error ER_UNKNOWN_TABLE
SELECT local.join_buffer_size;
--Error ER_UNKNOWN_TABLE
@@ -199,7 +173,6 @@ SELECT session.join_buffer_size;
--Error ER_BAD_FIELD_ERROR
SELECT join_buffer_size = @@session.join_buffer_size;
-
####################################
# Restore initial value #
####################################
diff --git a/mysql-test/suite/sys_vars/inc/key_cache_age_threshold_basic.inc b/mysql-test/suite/sys_vars/inc/key_cache_age_threshold_basic.inc
index 7841ad2cedc..e0970016577 100644
--- a/mysql-test/suite/sys_vars/inc/key_cache_age_threshold_basic.inc
+++ b/mysql-test/suite/sys_vars/inc/key_cache_age_threshold_basic.inc
@@ -43,10 +43,7 @@ SELECT @start_value;
# Display the DEFAULT value of key_cache_age_threshold #
################################################################################
-SET @@global.key_cache_age_threshold = 99;
---Error ER_NO_DEFAULT
SET @@global.key_cache_age_threshold = DEFAULT;
---echo 'Bug# 34878: This variable has default value according to documentation';
SELECT @@global.key_cache_age_threshold;
@@ -72,8 +69,6 @@ SET @@global.key_cache_age_threshold = 1800;
SELECT @@global.key_cache_age_threshold;
SET @@global.key_cache_age_threshold = 65535;
SELECT @@global.key_cache_age_threshold;
---echo 'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming';
-
--echo '#--------------------FN_DYNVARS_056_04-------------------------#'
###########################################################################
@@ -92,8 +87,6 @@ SELECT @@global.key_cache_age_threshold;
SET @@global.key_cache_age_threshold = 99;
SELECT @@global.key_cache_age_threshold;
-echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.key_cache_age_threshold = ON;
SELECT @@global.key_cache_age_threshold;
diff --git a/mysql-test/suite/sys_vars/inc/log_warnings_basic.inc b/mysql-test/suite/sys_vars/inc/log_warnings_basic.inc
index cd7e1023649..54b4fc4c937 100644
--- a/mysql-test/suite/sys_vars/inc/log_warnings_basic.inc
+++ b/mysql-test/suite/sys_vars/inc/log_warnings_basic.inc
@@ -109,8 +109,8 @@ SET @@global.log_warnings = 100000000000;
SELECT @@global.log_warnings;
SET @@global.log_warnings = -1024;
SELECT @@global.log_warnings;
---Error ER_PARSE_ERROR
-SET @@global.log_warnings = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.log_warnings = 65530.34;
SELECT @@global.log_warnings;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.log_warnings = test;
@@ -120,9 +120,8 @@ SET @@session.log_warnings = 100000000000;
SELECT @@session.log_warnings;
SET @@session.log_warnings = -2;
SELECT @@session.log_warnings;
---Error ER_PARSE_ERROR
-SET @@session.log_warnings = 65530.34.;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.log_warnings = 65530.34;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.log_warnings = test;
diff --git a/mysql-test/suite/sys_vars/inc/max_connect_errors_basic.inc b/mysql-test/suite/sys_vars/inc/max_connect_errors_basic.inc
index 530022652a1..ffad23f6ba7 100644
--- a/mysql-test/suite/sys_vars/inc/max_connect_errors_basic.inc
+++ b/mysql-test/suite/sys_vars/inc/max_connect_errors_basic.inc
@@ -46,7 +46,6 @@ SELECT @start_value;
SET @@global.max_connect_errors = 5000;
SET @@global.max_connect_errors = DEFAULT;
SELECT @@global.max_connect_errors;
---echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
--echo '#---------------------FN_DYNVARS_073_02-------------------------#'
###############################################
@@ -71,7 +70,6 @@ SET @@global.max_connect_errors = 1;
SELECT @@global.max_connect_errors;
SET @@global.max_connect_errors = 2;
SELECT @@global.max_connect_errors;
---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
--echo '#--------------------FN_DYNVARS_073_04-------------------------#'
@@ -93,8 +91,6 @@ SELECT @@global.max_connect_errors;
SET @@global.max_connect_errors = 4294967296;
SELECT @@global.max_connect_errors;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.max_connect_errors = ON;
SELECT @@global.max_connect_errors;
diff --git a/mysql-test/suite/sys_vars/inc/max_seeks_for_key_basic.inc b/mysql-test/suite/sys_vars/inc/max_seeks_for_key_basic.inc
index 23c3c5b2a95..08aff37054d 100644
--- a/mysql-test/suite/sys_vars/inc/max_seeks_for_key_basic.inc
+++ b/mysql-test/suite/sys_vars/inc/max_seeks_for_key_basic.inc
@@ -110,8 +110,8 @@ SET @@global.max_seeks_for_key = -1024;
SELECT @@global.max_seeks_for_key;
SET @@global.max_seeks_for_key = 4294967296;
SELECT @@global.max_seeks_for_key;
---Error ER_PARSE_ERROR
-SET @@global.max_seeks_for_key = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.max_seeks_for_key = 65530.34;
SELECT @@global.max_seeks_for_key;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.max_seeks_for_key = test;
@@ -121,11 +121,10 @@ SET @@session.max_seeks_for_key = 0;
SELECT @@session.max_seeks_for_key;
SET @@session.max_seeks_for_key = -2;
SELECT @@session.max_seeks_for_key;
---Error ER_PARSE_ERROR
-SET @@session.max_seeks_for_key = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.max_seeks_for_key = 65530.34;
SET @@session.max_seeks_for_key = 4294967296;
SELECT @@session.max_seeks_for_key;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.max_seeks_for_key = test;
diff --git a/mysql-test/suite/sys_vars/inc/max_tmp_tables_basic.inc b/mysql-test/suite/sys_vars/inc/max_tmp_tables_basic.inc
index e24d97f47dd..236c59837d8 100644
--- a/mysql-test/suite/sys_vars/inc/max_tmp_tables_basic.inc
+++ b/mysql-test/suite/sys_vars/inc/max_tmp_tables_basic.inc
@@ -121,8 +121,8 @@ SET @@global.max_tmp_tables = -1;
SELECT @@global.max_tmp_tables;
SET @@global.max_tmp_tables = 429496729500;
SELECT @@global.max_tmp_tables;
---Error ER_PARSE_ERROR
-SET @@global.max_tmp_tables = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.max_tmp_tables = 65530.34;
SELECT @@global.max_tmp_tables;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.max_tmp_tables = test;
@@ -136,8 +136,8 @@ SET @@session.max_tmp_tables = 429496729500;
SELECT @@session.max_tmp_tables;
SET @@session.max_tmp_tables = -001;
SELECT @@session.max_tmp_tables;
---Error ER_PARSE_ERROR
-SET @@session.max_tmp_tables = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.max_tmp_tables = 65530.34;
SET @@session.max_tmp_tables = 10737418241;
SELECT @@session.max_tmp_tables;
--Error ER_WRONG_TYPE_FOR_VAR
diff --git a/mysql-test/suite/sys_vars/inc/max_write_lock_count_basic.inc b/mysql-test/suite/sys_vars/inc/max_write_lock_count_basic.inc
index 80d5b7cc747..4e92a3057b0 100644
--- a/mysql-test/suite/sys_vars/inc/max_write_lock_count_basic.inc
+++ b/mysql-test/suite/sys_vars/inc/max_write_lock_count_basic.inc
@@ -88,8 +88,8 @@ SET @@global.max_write_lock_count = -1;
SELECT @@global.max_write_lock_count;
SET @@global.max_write_lock_count = 429496729500;
SELECT @@global.max_write_lock_count;
---Error ER_PARSE_ERROR
-SET @@global.max_write_lock_count = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.max_write_lock_count = 65530.34;
SELECT @@global.max_write_lock_count;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.max_write_lock_count = test;
diff --git a/mysql-test/suite/sys_vars/inc/min_examined_row_limit_basic.inc b/mysql-test/suite/sys_vars/inc/min_examined_row_limit_basic.inc
index c032d4a9d6d..cd80d1d0998 100644
--- a/mysql-test/suite/sys_vars/inc/min_examined_row_limit_basic.inc
+++ b/mysql-test/suite/sys_vars/inc/min_examined_row_limit_basic.inc
@@ -116,8 +116,8 @@ SET @@global.min_examined_row_limit = -1024;
SELECT @@global.min_examined_row_limit;
SET @@global.min_examined_row_limit = 429496729500;
SELECT @@global.min_examined_row_limit;
---Error ER_PARSE_ERROR
-SET @@global.min_examined_row_limit = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.min_examined_row_limit = 65530.34;
SELECT @@global.min_examined_row_limit;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.min_examined_row_limit = test;
@@ -127,11 +127,10 @@ SET @@session.min_examined_row_limit = 4294967296;
SELECT @@session.min_examined_row_limit;
SET @@session.min_examined_row_limit = -1;
SELECT @@session.min_examined_row_limit;
---Error ER_PARSE_ERROR
-SET @@session.min_examined_row_limit = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.min_examined_row_limit = 65530.34;
SET @@session.min_examined_row_limit = 4294967295021;
SELECT @@session.min_examined_row_limit;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.min_examined_row_limit = test;
diff --git a/mysql-test/suite/sys_vars/inc/myisam_max_sort_file_size_basic.inc b/mysql-test/suite/sys_vars/inc/myisam_max_sort_file_size_basic.inc
index 23f0607b439..9a975b977eb 100644
--- a/mysql-test/suite/sys_vars/inc/myisam_max_sort_file_size_basic.inc
+++ b/mysql-test/suite/sys_vars/inc/myisam_max_sort_file_size_basic.inc
@@ -47,8 +47,6 @@ SET @@global.myisam_max_sort_file_size = 500000;
SET @@global.myisam_max_sort_file_size = DEFAULT;
SELECT @@global.myisam_max_sort_file_size;
---echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
-
--echo '#--------------------FN_DYNVARS_094_02-------------------------#'
###################################################################
# Check the DEFAULT value of myisam_max_sort_file_size #
@@ -102,8 +100,8 @@ SET @@global.myisam_max_sort_file_size = -2147483648;
SELECT @@global.myisam_max_sort_file_size;
SET @@global.myisam_max_sort_file_size = -2147483649;
SELECT @@global.myisam_max_sort_file_size;
---Error ER_PARSE_ERROR
-SET @@global.myisam_max_sort_file_size = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.myisam_max_sort_file_size = 65530.34;
SELECT @@global.myisam_max_sort_file_size;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.myisam_max_sort_file_size = 2147483649.56;
@@ -111,9 +109,6 @@ SELECT @@global.myisam_max_sort_file_size;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.myisam_max_sort_file_size = 1G;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
-
--echo '#------------------FN_DYNVARS_094_06-----------------------#'
####################################################################
# Check if the value in GLOBAL Table matches value in variable #
diff --git a/mysql-test/suite/sys_vars/inc/myisam_repair_threads_basic.inc b/mysql-test/suite/sys_vars/inc/myisam_repair_threads_basic.inc
index 8485e79ff03..e3aca46536d 100644
--- a/mysql-test/suite/sys_vars/inc/myisam_repair_threads_basic.inc
+++ b/mysql-test/suite/sys_vars/inc/myisam_repair_threads_basic.inc
@@ -114,8 +114,8 @@ SET @@global.myisam_repair_threads = 429496729533;
SELECT @@global.myisam_repair_threads ;
---Error ER_PARSE_ERROR
-SET @@global.myisam_repair_threads = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.myisam_repair_threads = 65530.34;
SELECT @@global.myisam_repair_threads ;
--Error ER_WRONG_TYPE_FOR_VAR
@@ -141,9 +141,8 @@ SELECT @@session.myisam_repair_threads ;
SET @@session.myisam_repair_threads = -2;
SELECT @@session.myisam_repair_threads ;
---Error ER_PARSE_ERROR
-
-SET @@session.myisam_repair_threads = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.myisam_repair_threads = 65530.34;
SELECT @@session.myisam_repair_threads ;
diff --git a/mysql-test/suite/sys_vars/inc/myisam_sort_buffer_size_basic.inc b/mysql-test/suite/sys_vars/inc/myisam_sort_buffer_size_basic.inc
index 8e36d8a2c70..c92c2f85adb 100644
--- a/mysql-test/suite/sys_vars/inc/myisam_sort_buffer_size_basic.inc
+++ b/mysql-test/suite/sys_vars/inc/myisam_sort_buffer_size_basic.inc
@@ -113,8 +113,8 @@ SET @@global.myisam_sort_buffer_size = 429496729533;
SELECT @@global.myisam_sort_buffer_size ;
---Error ER_PARSE_ERROR
-SET @@global.myisam_sort_buffer_size = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.myisam_sort_buffer_size = 65530.34;
SELECT @@global.myisam_sort_buffer_size ;
--Error ER_WRONG_TYPE_FOR_VAR
@@ -140,9 +140,8 @@ SELECT @@session.myisam_sort_buffer_size ;
SET @@session.myisam_sort_buffer_size = -2;
SELECT @@session.myisam_sort_buffer_size ;
---Error ER_PARSE_ERROR
-
-SET @@session.myisam_sort_buffer_size = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.myisam_sort_buffer_size = 65530.34;
SELECT @@session.myisam_sort_buffer_size ;
diff --git a/mysql-test/suite/sys_vars/inc/net_retry_count_basic.inc b/mysql-test/suite/sys_vars/inc/net_retry_count_basic.inc
index 537d8eea6c6..46b8d0350fe 100644
--- a/mysql-test/suite/sys_vars/inc/net_retry_count_basic.inc
+++ b/mysql-test/suite/sys_vars/inc/net_retry_count_basic.inc
@@ -111,8 +111,8 @@ SET @@global.net_retry_count = 4294967296;
SELECT @@global.net_retry_count;
SET @@global.net_retry_count = 429496729500;
SELECT @@global.net_retry_count;
---Error ER_PARSE_ERROR
-SET @@global.net_retry_count = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.net_retry_count = 65530.34;
SELECT @@global.net_retry_count;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.net_retry_count = test;
@@ -122,15 +122,13 @@ SET @@session.net_retry_count = 0;
SELECT @@session.net_retry_count;
SET @@session.net_retry_count = -2;
SELECT @@session.net_retry_count;
---Error ER_PARSE_ERROR
-SET @@session.net_retry_count = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.net_retry_count = 65530.34;
SET @@session.net_retry_count = 6555015425;
SELECT @@session.net_retry_count;
SET @@session.net_retry_count = 4294967296;
SELECT @@session.net_retry_count;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.net_retry_count = test;
SELECT @@session.net_retry_count;
diff --git a/mysql-test/suite/sys_vars/inc/query_alloc_block_size_basic.inc b/mysql-test/suite/sys_vars/inc/query_alloc_block_size_basic.inc
index 208fe6b3da4..35d80f36f6d 100644
--- a/mysql-test/suite/sys_vars/inc/query_alloc_block_size_basic.inc
+++ b/mysql-test/suite/sys_vars/inc/query_alloc_block_size_basic.inc
@@ -82,9 +82,6 @@ SELECT @@global.query_alloc_block_size;
SET @@global.query_alloc_block_size = 65536;
SELECT @@global.query_alloc_block_size;
---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-
-
--echo '#--------------------FN_DYNVARS_130_04-------------------------#'
#################################################################################
# Change the value of query_alloc_block_size to a valid value for SESSION Scope #
@@ -114,8 +111,8 @@ SET @@global.query_alloc_block_size = 1023;
SELECT @@global.query_alloc_block_size;
SET @@global.query_alloc_block_size = 4294967296;
SELECT @@global.query_alloc_block_size;
---Error ER_PARSE_ERROR
-SET @@global.query_alloc_block_size = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.query_alloc_block_size = 65530.34;
SELECT @@global.query_alloc_block_size;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.query_alloc_block_size = test;
@@ -125,13 +122,12 @@ SET @@session.query_alloc_block_size = 64;
SELECT @@session.query_alloc_block_size;
SET @@session.query_alloc_block_size = -2;
SELECT @@session.query_alloc_block_size;
---Error ER_PARSE_ERROR
-SET @@session.query_alloc_block_size = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.query_alloc_block_size = 65530.34;
SET @@session.query_alloc_block_size = 1023;
SELECT @@session.query_alloc_block_size;
-SET @@session.query_alloc_block_size = 4294967296;
-SELECT @@session.query_alloc_block_size;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+#SET @@session.query_alloc_block_size = 4294967296;
+#SELECT @@session.query_alloc_block_size;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.query_alloc_block_size = test;
@@ -144,7 +140,6 @@ SELECT @@session.query_alloc_block_size;
#SET @@global.query_alloc_block_size = 1;
#SET @@session.query_alloc_block_size = 12;
---echo 'Bug# 34877: OutOFMemeory errors are coming if we dont assign these values to variable before comparision statement';
SET @@global.query_alloc_block_size = 1;
SET @@session.query_alloc_block_size = 12;
diff --git a/mysql-test/suite/sys_vars/inc/query_cache_limit_basic.inc b/mysql-test/suite/sys_vars/inc/query_cache_limit_basic.inc
index 2eb4a597eef..c94ba3a52dd 100644
--- a/mysql-test/suite/sys_vars/inc/query_cache_limit_basic.inc
+++ b/mysql-test/suite/sys_vars/inc/query_cache_limit_basic.inc
@@ -91,7 +91,6 @@ SET @@global.query_cache_limit = -1024;
SELECT @@global.query_cache_limit;
SET @@global.query_cache_limit = 42949672950;
SELECT @@global.query_cache_limit;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.query_cache_limit = ON;
diff --git a/mysql-test/suite/sys_vars/inc/query_cache_min_res_unit_basic.inc b/mysql-test/suite/sys_vars/inc/query_cache_min_res_unit_basic.inc
index 1b65e035b18..9276a987dfb 100644
--- a/mysql-test/suite/sys_vars/inc/query_cache_min_res_unit_basic.inc
+++ b/mysql-test/suite/sys_vars/inc/query_cache_min_res_unit_basic.inc
@@ -70,12 +70,10 @@ SET @@global.query_cache_min_res_unit = 0;
SELECT @@global.query_cache_min_res_unit;
SET @@global.query_cache_min_res_unit = 1;
SELECT @@global.query_cache_min_res_unit;
---echo 'Bug#34842: FN_DYNVARS_132_03 - Minimum value according to documentation is 0, and here it is 512';
SET @@global.query_cache_min_res_unit = 512;
SELECT @@global.query_cache_min_res_unit;
SET @@global.query_cache_min_res_unit = 513;
SELECT @@global.query_cache_min_res_unit;
---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
SET @@global.query_cache_min_res_unit = 1048576;
SELECT @@global.query_cache_min_res_unit;
SET @@global.query_cache_min_res_unit = 1048575;
@@ -100,7 +98,6 @@ SET @@global.query_cache_min_res_unit = -1024;
SELECT @@global.query_cache_min_res_unit;
SET @@global.query_cache_min_res_unit = 42949672950;
SELECT @@global.query_cache_min_res_unit;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.query_cache_min_res_unit = ON;
diff --git a/mysql-test/suite/sys_vars/inc/query_cache_size_basic.inc b/mysql-test/suite/sys_vars/inc/query_cache_size_basic.inc
index 1f8c63c55bb..83edefaaf25 100644
--- a/mysql-test/suite/sys_vars/inc/query_cache_size_basic.inc
+++ b/mysql-test/suite/sys_vars/inc/query_cache_size_basic.inc
@@ -68,8 +68,6 @@ SET @@global.query_cache_size = 512;
SELECT @@global.query_cache_size;
SET @@global.query_cache_size = 1024;
SELECT @@global.query_cache_size;
---echo : 'Bug#34880: Warnings are coming on assinging valid values to variable
---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
SET @@global.query_cache_size = 1048576;
SELECT @@global.query_cache_size;
SET @@global.query_cache_size = 1048575;
@@ -93,8 +91,6 @@ SET @@global.query_cache_size = -1024;
SELECT @@global.query_cache_size;
SET @@global.query_cache_size = 42949672950;
SELECT @@global.query_cache_size;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.query_cache_size = ON;
SELECT @@global.query_cache_size;
diff --git a/mysql-test/suite/sys_vars/inc/range_alloc_block_size_basic.inc b/mysql-test/suite/sys_vars/inc/range_alloc_block_size_basic.inc
index 37692cc8c35..cfa74665dd9 100644
--- a/mysql-test/suite/sys_vars/inc/range_alloc_block_size_basic.inc
+++ b/mysql-test/suite/sys_vars/inc/range_alloc_block_size_basic.inc
@@ -73,12 +73,10 @@ SELECT @@session.range_alloc_block_size = 2048;
SET @@global.range_alloc_block_size = 2048;
SELECT @@global.range_alloc_block_size;
---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
SET @@global.range_alloc_block_size = 4294967295;
SELECT @@global.range_alloc_block_size;
SET @@global.range_alloc_block_size = 4294967294;
SELECT @@global.range_alloc_block_size;
---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
--echo '#--------------------FN_DYNVARS_137_04-------------------------#'
@@ -105,8 +103,8 @@ SET @@global.range_alloc_block_size = -1024;
SELECT @@global.range_alloc_block_size;
SET @@global.range_alloc_block_size = 42949672951;
SELECT @@global.range_alloc_block_size;
---Error ER_PARSE_ERROR
-SET @@global.range_alloc_block_size = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.range_alloc_block_size = 65530.34;
SELECT @@global.range_alloc_block_size;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.range_alloc_block_size = test;
@@ -116,11 +114,10 @@ SET @@session.range_alloc_block_size = 0;
SELECT @@session.range_alloc_block_size;
SET @@session.range_alloc_block_size = -2;
SELECT @@session.range_alloc_block_size;
---Error ER_PARSE_ERROR
-SET @@session.range_alloc_block_size = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.range_alloc_block_size = 65530.34;
SET @@session.range_alloc_block_size = 4294967296;
SELECT @@session.range_alloc_block_size;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.range_alloc_block_size = test;
diff --git a/mysql-test/suite/sys_vars/inc/rpl_recovery_rank_basic.inc b/mysql-test/suite/sys_vars/inc/rpl_recovery_rank_basic.inc
index f9ae3968b31..b185eeb21a7 100644
--- a/mysql-test/suite/sys_vars/inc/rpl_recovery_rank_basic.inc
+++ b/mysql-test/suite/sys_vars/inc/rpl_recovery_rank_basic.inc
@@ -93,8 +93,8 @@ SET @@global.rpl_recovery_rank = -2147483648;
SELECT @@global.rpl_recovery_rank;
SET @@global.rpl_recovery_rank = -2147483649;
SELECT @@global.rpl_recovery_rank;
---Error ER_PARSE_ERROR
-SET @@global.rpl_recovery_rank = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.rpl_recovery_rank = 65530.34;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.rpl_recovery_rank = 2147483649.56;
--Error ER_WRONG_TYPE_FOR_VAR
diff --git a/mysql-test/suite/sys_vars/inc/slave_transaction_retries_basic.inc b/mysql-test/suite/sys_vars/inc/slave_transaction_retries_basic.inc
index 28ba8791b0a..17146f07bc0 100644
--- a/mysql-test/suite/sys_vars/inc/slave_transaction_retries_basic.inc
+++ b/mysql-test/suite/sys_vars/inc/slave_transaction_retries_basic.inc
@@ -105,10 +105,8 @@ SELECT @@global.slave_transaction_retries;
SET @@global.slave_transaction_retries = 2147483649*2147483649;
SELECT @@global.slave_transaction_retries;
---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-
---Error ER_PARSE_ERROR
-SET @@global.slave_transaction_retries = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.slave_transaction_retries = 65530.34;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.slave_transaction_retries = '100';
--Error ER_WRONG_TYPE_FOR_VAR
diff --git a/mysql-test/suite/sys_vars/inc/sort_buffer_size_basic.inc b/mysql-test/suite/sys_vars/inc/sort_buffer_size_basic.inc
index 19d8b442c2c..a88ad65a076 100644
--- a/mysql-test/suite/sys_vars/inc/sort_buffer_size_basic.inc
+++ b/mysql-test/suite/sys_vars/inc/sort_buffer_size_basic.inc
@@ -40,12 +40,6 @@
# Save initial value #
#############################################################
-# due to differences when running on Windows (Bug#36695)
---source include/not_windows.inc
-
-let $kbrange32 = BETWEEN 32776 AND 32999;
-let $mbrange2 = BETWEEN 2097116 AND 2100000;
-
--disable_warnings
SET @start_global_value = @@global.sort_buffer_size;
@@ -59,12 +53,12 @@ SET @start_session_value = @@session.sort_buffer_size;
SET @@global.sort_buffer_size = 1000;
SET @@global.sort_buffer_size = DEFAULT;
eval
-SELECT @@global.sort_buffer_size $mbrange2;
+SELECT @@global.sort_buffer_size;
SET @@session.sort_buffer_size = 2000;
SET @@session.sort_buffer_size = DEFAULT;
eval
-SELECT @@session.sort_buffer_size $mbrange2;
+SELECT @@session.sort_buffer_size;
--echo '#--------------------FN_DYNVARS_151_02-------------------------#'
@@ -74,11 +68,11 @@ SELECT @@session.sort_buffer_size $mbrange2;
SET @@global.sort_buffer_size = DEFAULT;
eval
-SELECT @@global.sort_buffer_size $mbrange2;
+SELECT @@global.sort_buffer_size;
SET @@session.sort_buffer_size = DEFAULT;
eval
-SELECT @@session.sort_buffer_size $mbrange2;
+SELECT @@session.sort_buffer_size;
--echo '#--------------------FN_DYNVARS_151_03-------------------------#'
@@ -88,10 +82,10 @@ SELECT @@session.sort_buffer_size $mbrange2;
SET @@global.sort_buffer_size = 32776;
eval
-SELECT @@global.sort_buffer_size $kbrange32;
+SELECT @@global.sort_buffer_size;
SET @@global.sort_buffer_size = 32777;
eval
-SELECT @@global.sort_buffer_size $kbrange32;
+SELECT @@global.sort_buffer_size;
SET @@global.sort_buffer_size = 4294967295;
SELECT @@global.sort_buffer_size;
SET @@global.sort_buffer_size = 4294967294;
@@ -104,10 +98,10 @@ SELECT @@global.sort_buffer_size;
SET @@session.sort_buffer_size = 32776;
eval
-SELECT @@session.sort_buffer_size $kbrange32;
+SELECT @@session.sort_buffer_size;
SET @@session.sort_buffer_size = 32777;
eval
-SELECT @@session.sort_buffer_size $kbrange32;
+SELECT @@session.sort_buffer_size;
SET @@session.sort_buffer_size = 4294967295;
SELECT @@session.sort_buffer_size;
SET @@session.sort_buffer_size = 4294967294;
@@ -121,14 +115,14 @@ SELECT @@session.sort_buffer_size;
SET @@global.sort_buffer_size = 32775;
eval
-SELECT @@global.sort_buffer_size $kbrange32;
+SELECT @@global.sort_buffer_size;
SET @@global.sort_buffer_size = -1024;
eval
-SELECT @@global.sort_buffer_size $kbrange32;
+SELECT @@global.sort_buffer_size;
SET @@global.sort_buffer_size = 4294967296;
SELECT @@global.sort_buffer_size;
---Error ER_PARSE_ERROR
-SET @@global.sort_buffer_size = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.sort_buffer_size = 65530.34;
SELECT @@global.sort_buffer_size;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.sort_buffer_size = test;
@@ -136,12 +130,12 @@ SELECT @@global.sort_buffer_size;
SET @@session.sort_buffer_size = 32775;
eval
-SELECT @@session.sort_buffer_size $kbrange32;
+SELECT @@session.sort_buffer_size;
SET @@session.sort_buffer_size = -2;
eval
-SELECT @@session.sort_buffer_size $kbrange32;
---Error ER_PARSE_ERROR
-SET @@session.sort_buffer_size = 65530.34.;
+SELECT @@session.sort_buffer_size;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.sort_buffer_size = 65530.34;
SET @@session.sort_buffer_size = 4294967296;
SELECT @@session.sort_buffer_size;
@@ -173,10 +167,10 @@ INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
SET @@global.sort_buffer_size = TRUE;
eval
-SELECT @@global.sort_buffer_size $kbrange32;
+SELECT @@global.sort_buffer_size;
SET @@global.sort_buffer_size = FALSE;
eval
-SELECT @@global.sort_buffer_size $kbrange32;
+SELECT @@global.sort_buffer_size;
--echo '#---------------------FN_DYNVARS_151_09----------------------#'
####################################################################################
@@ -203,7 +197,7 @@ SELECT @@local.sort_buffer_size = @@session.sort_buffer_size;
SET sort_buffer_size = 9100;
eval
-SELECT @@sort_buffer_size $kbrange32;
+SELECT @@sort_buffer_size;
--Error ER_UNKNOWN_TABLE
SELECT local.sort_buffer_size;
--Error ER_UNKNOWN_TABLE
diff --git a/mysql-test/suite/sys_vars/inc/transaction_alloc_block_size_basic.inc b/mysql-test/suite/sys_vars/inc/transaction_alloc_block_size_basic.inc
index c14383b86c6..4a69bbcdb01 100644
--- a/mysql-test/suite/sys_vars/inc/transaction_alloc_block_size_basic.inc
+++ b/mysql-test/suite/sys_vars/inc/transaction_alloc_block_size_basic.inc
@@ -82,7 +82,6 @@ SELECT @@global.transaction_alloc_block_size;
SET @@global.transaction_alloc_block_size = 4294967295;
SELECT @@global.transaction_alloc_block_size;
---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
--echo '#--------------------FN_DYNVARS_005_04-------------------------#'
###################################################################
@@ -97,7 +96,6 @@ SELECT @@session.transaction_alloc_block_size;
SET @@session.transaction_alloc_block_size = 65535;
SELECT @@session.transaction_alloc_block_size;
---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
--echo '#------------------FN_DYNVARS_005_05-----------------------#'
@@ -115,8 +113,6 @@ SELECT @@global.transaction_alloc_block_size;
SET @@global.transaction_alloc_block_size = 123456789201;
SELECT @@global.transaction_alloc_block_size;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
-- Error ER_WRONG_TYPE_FOR_VAR
SET @@global.transaction_alloc_block_size = ON;
@@ -143,8 +139,6 @@ SELECT @@global.transaction_alloc_block_size;
SET @@session.transaction_alloc_block_size = 12345678901;
SELECT @@session.transaction_alloc_block_size;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
-- Error ER_WRONG_TYPE_FOR_VAR
SET @@session.transaction_alloc_block_size = ON;
diff --git a/mysql-test/suite/sys_vars/inc/transaction_prealloc_size_basic.inc b/mysql-test/suite/sys_vars/inc/transaction_prealloc_size_basic.inc
index 1ca302a19e0..56c93163621 100644
--- a/mysql-test/suite/sys_vars/inc/transaction_prealloc_size_basic.inc
+++ b/mysql-test/suite/sys_vars/inc/transaction_prealloc_size_basic.inc
@@ -39,8 +39,6 @@ SELECT @start_global_value;
SET @start_session_value = @@session.transaction_prealloc_size;
SELECT @start_session_value;
---echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
-
--echo '#--------------------FN_DYNVARS_005_01-------------------------#'
########################################################################
# Display the DEFAULT value of transaction_prealloc_size #
@@ -106,8 +104,6 @@ SELECT @@global.transaction_prealloc_size;
SET @@global.transaction_prealloc_size = -1024;
SELECT @@global.transaction_prealloc_size;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
-- Error ER_WRONG_TYPE_FOR_VAR
SET @@global.transaction_prealloc_size = ON;
diff --git a/mysql-test/suite/sys_vars/r/all_vars.result b/mysql-test/suite/sys_vars/r/all_vars.result
new file mode 100644
index 00000000000..abd1f5d2bd6
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/all_vars.result
@@ -0,0 +1,12 @@
+create table t1 (test_name text);
+load data infile "MYSQLTEST_VARDIR/tmp/sys_vars.all_vars.txt" into table t1;
+select variable_name as `There should be *no* variables listed below:`
+ from information_schema.global_variables
+left join t1 on variable_name=test_name where
+test_name is null
+union
+select variable_name from information_schema.session_variables
+left join t1 on variable_name=test_name where
+test_name is null;
+There should be *no* variables listed below:
+drop table t1;
diff --git a/mysql-test/suite/sys_vars/r/auto_increment_increment_basic.result b/mysql-test/suite/sys_vars/r/auto_increment_increment_basic.result
index 3cfdc54457b..3e66041856f 100644
--- a/mysql-test/suite/sys_vars/r/auto_increment_increment_basic.result
+++ b/mysql-test/suite/sys_vars/r/auto_increment_increment_basic.result
@@ -71,8 +71,8 @@ Warning 1292 Truncated incorrect auto_increment_increment value: '65536'
SELECT @@global.auto_increment_increment;
@@global.auto_increment_increment
65535
-SET @@global.auto_increment_increment = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.auto_increment_increment = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'auto_increment_increment'
SELECT @@global.auto_increment_increment;
@@global.auto_increment_increment
65535
@@ -93,15 +93,14 @@ Warning 1292 Truncated incorrect auto_increment_increment value: '-2'
SELECT @@session.auto_increment_increment;
@@session.auto_increment_increment
1
-SET @@session.auto_increment_increment = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.auto_increment_increment = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'auto_increment_increment'
SET @@session.auto_increment_increment = 65550;
Warnings:
Warning 1292 Truncated incorrect auto_increment_increment value: '65550'
SELECT @@session.auto_increment_increment;
@@session.auto_increment_increment
65535
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@session.auto_increment_increment = test;
ERROR 42000: Incorrect argument type to variable 'auto_increment_increment'
SELECT @@session.auto_increment_increment;
diff --git a/mysql-test/suite/sys_vars/r/auto_increment_increment_func.result b/mysql-test/suite/sys_vars/r/auto_increment_increment_func.result
index eeaa3949886..df3ca1ab093 100644
--- a/mysql-test/suite/sys_vars/r/auto_increment_increment_func.result
+++ b/mysql-test/suite/sys_vars/r/auto_increment_increment_func.result
@@ -95,8 +95,6 @@ id name
113 Record_8
115 Record_9
116 Record_10
-'Bug#35362: Here Record_10 id should be 120 instead of 115 because we'
-'have set the value of variable to 5'
SET @@session.auto_increment_increment = 1;
SELECT @@auto_increment_increment;
@@auto_increment_increment
@@ -189,7 +187,6 @@ id name
127 Record_16
128 Record_17
129 Record_18
-'Bug#35364: Variable is incrementing some random values on assigning -ve value'
## Disconnecting test_con2 ##
## Dropping table t1 ##
DROP table if exists t1;
diff --git a/mysql-test/suite/sys_vars/r/auto_increment_offset_basic.result b/mysql-test/suite/sys_vars/r/auto_increment_offset_basic.result
index 7752851cb4c..cc7b6b693c0 100644
--- a/mysql-test/suite/sys_vars/r/auto_increment_offset_basic.result
+++ b/mysql-test/suite/sys_vars/r/auto_increment_offset_basic.result
@@ -104,7 +104,6 @@ Warning 1292 Truncated incorrect auto_increment_offset value: '65550'
SELECT @@session.auto_increment_offset;
@@session.auto_increment_offset
65535
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
SET @@session.auto_increment_offset = ON;
ERROR 42000: Incorrect argument type to variable 'auto_increment_offset'
SELECT @@session.auto_increment_offset;
diff --git a/mysql-test/suite/sys_vars/r/auto_increment_offset_func.result b/mysql-test/suite/sys_vars/r/auto_increment_offset_func.result
index e166cb149f6..d2b5b828c04 100644
--- a/mysql-test/suite/sys_vars/r/auto_increment_offset_func.result
+++ b/mysql-test/suite/sys_vars/r/auto_increment_offset_func.result
@@ -84,8 +84,6 @@ id name
## Setting value of variable less than last insert id ##
SET @@session.auto_increment_offset = 5;
INSERT into t1(name) values('Record_9');
-'Bug#35367: Random value of id is increasing on assigning value to';
-'variable that is less than current offset';
INSERT into t1(name) values('Record_10');
INSERT into t1(name) values('Record_11');
INSERT into t1(name) values('Record_12');
@@ -125,8 +123,6 @@ id name
125 Record_12
134 Record_13
140 Record_14
-'Bug#35369: Some invalid value of id is increasing on assigning value to';
-'variable that is greater than auto_increment_increment';
'#--------------------FN_DYNVARS_002_06-------------------------#'
## Changing datatype of column id with primary key to SmallInt ##
ALTER table t1 modify id SMALLINT NOT NULL auto_increment;
@@ -206,8 +202,6 @@ id name
180 Record_18
181 Record_17
191 Record_18
-'Bug#35370: Some invalid value of id is increasing on assigning negative';
-' value in variable';
## Assigning value that is out of range of variable ##
SET @@auto_increment_offset = 65536;
Warnings:
diff --git a/mysql-test/suite/sys_vars/r/auto_commit_basic.result b/mysql-test/suite/sys_vars/r/autocommit_basic.result
index 96cfd3e7ee6..68531f8b5a6 100644
--- a/mysql-test/suite/sys_vars/r/auto_commit_basic.result
+++ b/mysql-test/suite/sys_vars/r/autocommit_basic.result
@@ -1,4 +1,4 @@
-SET @start_value = @@autocommit;
+SET @start_value = @@global.autocommit;
SELECT @start_value;
@start_value
1
@@ -7,8 +7,7 @@ SET @@autocommit = 0;
SET @@autocommit = DEFAULT;
SELECT @@autocommit;
@@autocommit
-0
-'Bug: variable DEFAULT value not working and is not throwing error'
+1
'#---------------------FN_DYNVARS_003_02-------------------------#'
SET @@autocommit = @start_value;
SELECT @@autocommit = 1;
@@ -50,16 +49,16 @@ SET @@autocommit = '';
ERROR 42000: Variable 'autocommit' can't be set to the value of ''
'#-------------------FN_DYNVARS_003_05----------------------------#'
SET @@global.autocommit = 0;
-ERROR HY000: Variable 'autocommit' is a SESSION variable and can't be used with SET GLOBAL
SELECT @@global.autocommit;
-ERROR HY000: Variable 'autocommit' is a SESSION variable
+@@global.autocommit
+0
+SET @@global.autocommit = 1;
'#----------------------FN_DYNVARS_003_06------------------------#'
SELECT IF(@@session.autocommit, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='autocommit';
IF(@@session.autocommit, "ON", "OFF") = VARIABLE_VALUE
1
-Bug # 34839: Values in variable and information_schema do not match for autocommit
'#----------------------FN_DYNVARS_003_07------------------------#'
SET @@autocommit = 1;
SELECT IF(@@autocommit, "ON", "OFF") = VARIABLE_VALUE
@@ -111,7 +110,7 @@ SELECT session.autocommit;
ERROR 42S02: Unknown table 'session' in field list
SELECT autocommit = @@session.autocommit;
ERROR 42S22: Unknown column 'autocommit' in 'field list'
-SET @@autocommit = @start_value;
-SELECT @@autocommit;
-@@autocommit
+SET @@global.autocommit = @start_value;
+SELECT @@global.autocommit;
+@@global.autocommit
1
diff --git a/mysql-test/suite/sys_vars/r/autocommit_func.result b/mysql-test/suite/sys_vars/r/autocommit_func.result
index 47c2c921022..8fe7c0bc90e 100644
--- a/mysql-test/suite/sys_vars/r/autocommit_func.result
+++ b/mysql-test/suite/sys_vars/r/autocommit_func.result
@@ -89,7 +89,6 @@ id name
1 Record_1
2 Record_2
3 Record_3
-'Bug#35373: Records donot get committed in transaction on switching connections'
INSERT into t1(name) values('Record_6');
SELECT * from t1;
id name
diff --git a/mysql-test/suite/sys_vars/r/automatic_sp_privileges_basic.result b/mysql-test/suite/sys_vars/r/automatic_sp_privileges_basic.result
index 26e33a384b9..e0a939758d5 100644
--- a/mysql-test/suite/sys_vars/r/automatic_sp_privileges_basic.result
+++ b/mysql-test/suite/sys_vars/r/automatic_sp_privileges_basic.result
@@ -58,7 +58,6 @@ FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='automatic_sp_privileges';
IF(@@global.automatic_sp_privileges, "ON", "OFF") = VARIABLE_VALUE
1
-'Bug# 34839: Values in variable and information_schema donot match'
'#---------------------FN_DYNVARS_004_07----------------------#'
SET @@global.automatic_sp_privileges = OFF;
SELECT @@global.automatic_sp_privileges;
diff --git a/mysql-test/suite/sys_vars/r/back_log_basic.result b/mysql-test/suite/sys_vars/r/back_log_basic.result
new file mode 100644
index 00000000000..5cfb0da65d6
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/back_log_basic.result
@@ -0,0 +1,21 @@
+select @@global.back_log;
+@@global.back_log
+50
+select @@session.back_log;
+ERROR HY000: Variable 'back_log' is a GLOBAL variable
+show global variables like 'back_log';
+Variable_name Value
+back_log 50
+show session variables like 'back_log';
+Variable_name Value
+back_log 50
+select * from information_schema.global_variables where variable_name='back_log';
+VARIABLE_NAME VARIABLE_VALUE
+BACK_LOG 50
+select * from information_schema.session_variables where variable_name='back_log';
+VARIABLE_NAME VARIABLE_VALUE
+BACK_LOG 50
+set global back_log=1;
+ERROR HY000: Variable 'back_log' is a read only variable
+set session back_log=1;
+ERROR HY000: Variable 'back_log' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/big_tables_basic.result b/mysql-test/suite/sys_vars/r/big_tables_basic.result
index e88caae47cf..fac9be20d8d 100644
--- a/mysql-test/suite/sys_vars/r/big_tables_basic.result
+++ b/mysql-test/suite/sys_vars/r/big_tables_basic.result
@@ -7,8 +7,7 @@ SET @@big_tables = 1;
SET @@big_tables = DEFAULT;
SELECT @@big_tables;
@@big_tables
-1
-'Bug# 34829: No default value for variable and setting default does not raise error';
+0
'#--------------------FN_DYNVARS_005_02------------------------#'
SET @@big_tables = 0;
SELECT @@big_tables;
@@ -44,17 +43,17 @@ ERROR 42000: Variable 'big_tables' can't be set to the value of ' '
SET @@big_tables = '';
ERROR 42000: Variable 'big_tables' can't be set to the value of ''
'#-------------------FN_DYNVARS_005_04----------------------------#'
-SET @@global.big_tables = 0;
-ERROR HY000: Variable 'big_tables' is a SESSION variable and can't be used with SET GLOBAL
+SET @@global.big_tables = 1-@@global.big_tables;
SELECT @@global.big_tables;
-ERROR HY000: Variable 'big_tables' is a SESSION variable
+@@global.big_tables
+1
+SET @@global.big_tables = 1-@@global.big_tables;
'#----------------------FN_DYNVARS_005_05------------------------#'
SELECT IF(@@big_tables, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='big_tables';
IF(@@big_tables, "ON", "OFF") = VARIABLE_VALUE
1
-Bug # 34839: Values in variable and information_schema do not match for autocommit
'#---------------------FN_DYNVARS_005_06----------------------#'
SET @@big_tables = OFF;
SELECT @@big_tables;
diff --git a/mysql-test/suite/sys_vars/r/binlog_cache_size_basic_32.result b/mysql-test/suite/sys_vars/r/binlog_cache_size_basic_32.result
index 2f439c8f834..d378765d96f 100644
--- a/mysql-test/suite/sys_vars/r/binlog_cache_size_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/binlog_cache_size_basic_32.result
@@ -21,14 +21,20 @@ SELECT @@global.binlog_cache_size;
@@global.binlog_cache_size
4096
SET @@global.binlog_cache_size = 4294967295;
+Warnings:
+Warning 1292 Truncated incorrect binlog_cache_size value: '4294967295'
SELECT @@global.binlog_cache_size;
@@global.binlog_cache_size
4294963200
SET @@global.binlog_cache_size = 10000;
+Warnings:
+Warning 1292 Truncated incorrect binlog_cache_size value: '10000'
SELECT @@global.binlog_cache_size;
@@global.binlog_cache_size
8192
SET @@global.binlog_cache_size = 21221204;
+Warnings:
+Warning 1292 Truncated incorrect binlog_cache_size value: '21221204'
SELECT @@global.binlog_cache_size;
@@global.binlog_cache_size
21217280
diff --git a/mysql-test/suite/sys_vars/r/binlog_cache_size_basic_64.result b/mysql-test/suite/sys_vars/r/binlog_cache_size_basic_64.result
index 3858df0f4d6..95693c6a1ba 100644
--- a/mysql-test/suite/sys_vars/r/binlog_cache_size_basic_64.result
+++ b/mysql-test/suite/sys_vars/r/binlog_cache_size_basic_64.result
@@ -21,14 +21,20 @@ SELECT @@global.binlog_cache_size;
@@global.binlog_cache_size
4096
SET @@global.binlog_cache_size = 4294967295;
+Warnings:
+Warning 1292 Truncated incorrect binlog_cache_size value: '4294967295'
SELECT @@global.binlog_cache_size;
@@global.binlog_cache_size
4294963200
SET @@global.binlog_cache_size = 10000;
+Warnings:
+Warning 1292 Truncated incorrect binlog_cache_size value: '10000'
SELECT @@global.binlog_cache_size;
@@global.binlog_cache_size
8192
SET @@global.binlog_cache_size = 21221204;
+Warnings:
+Warning 1292 Truncated incorrect binlog_cache_size value: '21221204'
SELECT @@global.binlog_cache_size;
@@global.binlog_cache_size
21217280
@@ -49,6 +55,8 @@ SELECT @@global.binlog_cache_size;
@@global.binlog_cache_size
4096
SET @@global.binlog_cache_size = 42949672950;
+Warnings:
+Warning 1292 Truncated incorrect binlog_cache_size value: '42949672950'
SELECT @@global.binlog_cache_size;
@@global.binlog_cache_size
42949668864
diff --git a/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_32.result b/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_32.result
index 3e071f76f98..497fe531fec 100644
--- a/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_32.result
@@ -91,7 +91,6 @@ Warning 1292 Truncated incorrect bulk_insert_buffer_size value: '-2'
SELECT @@session.bulk_insert_buffer_size;
@@session.bulk_insert_buffer_size
0
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
SET @@session.bulk_insert_buffer_size = test;
ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size'
SET @@session.bulk_insert_buffer_size = 429496.10;
diff --git a/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_64.result b/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_64.result
index 320290fbca1..e687a86c68d 100644
--- a/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_64.result
+++ b/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_64.result
@@ -87,7 +87,6 @@ Warning 1292 Truncated incorrect bulk_insert_buffer_size value: '-2'
SELECT @@session.bulk_insert_buffer_size;
@@session.bulk_insert_buffer_size
0
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
SET @@session.bulk_insert_buffer_size = test;
ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size'
SET @@session.bulk_insert_buffer_size = 429496.10;
diff --git a/mysql-test/suite/sys_vars/r/character_set_client_basic.result b/mysql-test/suite/sys_vars/r/character_set_client_basic.result
index c946d5109a8..78993015a24 100644
--- a/mysql-test/suite/sys_vars/r/character_set_client_basic.result
+++ b/mysql-test/suite/sys_vars/r/character_set_client_basic.result
@@ -162,11 +162,8 @@ SET @@character_set_client = utf8;
SELECT @@character_set_client;
@@character_set_client
utf8
-'Bug: Assignment of ucs2 to session character-set does not raise error';
-'but selecting variable after setting it does.';
-'Even catching this does not allow any further character-set to be set.';
-'Offending querry seems to be:';
-'SET @@character_set_client = ucs2;'
+SET @@character_set_client = ucs2;
+ERROR 42000: Variable 'character_set_client' can't be set to the value of 'ucs2'
SET @@character_set_client = cp866;
SELECT @@character_set_client;
@@character_set_client
@@ -426,9 +423,6 @@ SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS);
SELECT @total_charset;
@total_charset
36
-'Bug # 34843: character sets are mapped in such a way that 100 and following';
-'numbers gives error, and before 100 the 36 mapped wraps arround';
-'several times.';
'#--------------------FN_DYNVARS_010_10-------------------------#'
SET @@character_set_client = abc;
ERROR 42000: Unknown character set: 'abc'
diff --git a/mysql-test/suite/sys_vars/r/character_set_client_func.result b/mysql-test/suite/sys_vars/r/character_set_client_func.result
index 087db21639b..82c1548d438 100644
--- a/mysql-test/suite/sys_vars/r/character_set_client_func.result
+++ b/mysql-test/suite/sys_vars/r/character_set_client_func.result
@@ -10,7 +10,6 @@ utf8
SELECT @@session.character_set_client;
@@session.character_set_client
latin1
-'Bug# 35372: session character_set_client is not effected by global character_set_client'
'#--------------------FN_DYNVARS_010_02-------------------------#'
'connection default'
SHOW VARIABLES like 'character_set_client';
@@ -22,16 +21,16 @@ CREATE TABLE t1(a CHAR(3) character set utf8);
'For latin1 characterset';
SET @@session.character_set_client = latin1;
INSERT INTO t1 values('è');
-SELECT a,CHAR_LENGTH(a) FROM t1;
-a CHAR_LENGTH(a)
-è 2
+SELECT hex(a),CHAR_LENGTH(a) FROM t1;
+hex(a) CHAR_LENGTH(a)
+03C3A8 2
DELETE FROM t1;
'For utf8 characterset';
SET @@session.character_set_client = utf8;
INSERT INTO t1 values('è');
-SELECT a,CHAR_LENGTH(a) FROM t1;
-a CHAR_LENGTH(a)
- 1
+SELECT hex(a),CHAR_LENGTH(a) FROM t1;
+hex(a) CHAR_LENGTH(a)
+03 1
DELETE FROM t1;
DROP TABLE IF EXISTS t1;
SET @@global.character_set_client = @global_character_set_client;
diff --git a/mysql-test/suite/sys_vars/r/character_set_connection_basic.result b/mysql-test/suite/sys_vars/r/character_set_connection_basic.result
index 18697a20fb9..dd1052d27ef 100644
--- a/mysql-test/suite/sys_vars/r/character_set_connection_basic.result
+++ b/mysql-test/suite/sys_vars/r/character_set_connection_basic.result
@@ -425,9 +425,6 @@ SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS);
SELECT @total_charset;
@total_charset
36
-'Bug # 34843: character sets are mapped in such a way that 100 and following ';
-'numbers gives error, and before 100 the 36 mapped wraps arround';
-'several times.';
'#--------------------FN_DYNVARS_011_10-------------------------#'
SET @@character_set_connection = abc;
ERROR 42000: Unknown character set: 'abc'
diff --git a/mysql-test/suite/sys_vars/r/character_set_database_basic.result b/mysql-test/suite/sys_vars/r/character_set_database_basic.result
index 4380fea4c81..9aa449816f5 100644
--- a/mysql-test/suite/sys_vars/r/character_set_database_basic.result
+++ b/mysql-test/suite/sys_vars/r/character_set_database_basic.result
@@ -425,8 +425,6 @@ SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS);
SELECT @total_charset;
@total_charset
36
-'Bug # 34843: character sets are mapped in such a way that 100 and following';
-'numbers gives error, and before 100 the 36 mapped wraps arround several times.';
'#--------------------FN_DYNVARS_012_10-------------------------#'
SET @@character_set_database = "grek";
ERROR 42000: Unknown character set: 'grek'
diff --git a/mysql-test/suite/sys_vars/r/character_set_database_func.result b/mysql-test/suite/sys_vars/r/character_set_database_func.result
index 746824c58ff..3cadadd0f3f 100644
--- a/mysql-test/suite/sys_vars/r/character_set_database_func.result
+++ b/mysql-test/suite/sys_vars/r/character_set_database_func.result
@@ -12,7 +12,6 @@ utf8
SELECT @@session.character_set_database;
@@session.character_set_database
latin1
-'Bug#35356: session character_set_database differ from global character_set_database'
'#--------------------FN_DYNVARS_008_02-------------------------#'
'connection default'
DROP TABLE IF EXISTS t1;
@@ -39,7 +38,6 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=utf8
DROP TABLE t1;
DROP DATABASE db1;
-'Bug#35357: character_set_database does not effects CREATE DATABASE without characater set'
'--ascii character set specified--'
CREATE DATABASE db1 CHARACTER SET ascii;
USE db1;
@@ -72,7 +70,6 @@ SELECT count(*) FROM t1 WHERE CHAR_LENGTH(a)>1;
count(*)
1
DROP TABLE IF EXISTS t1;
-'Bug#27208: If no current database, character_set_database !=character_set_server'
SET GLOBAL character_set_server=latin5;
CREATE DATABASE csdb CHARACTER SET = utf8;
USE csdb;
diff --git a/mysql-test/suite/sys_vars/r/character_set_filesystem_basic.result b/mysql-test/suite/sys_vars/r/character_set_filesystem_basic.result
index 11f85528593..e33df353c74 100644
--- a/mysql-test/suite/sys_vars/r/character_set_filesystem_basic.result
+++ b/mysql-test/suite/sys_vars/r/character_set_filesystem_basic.result
@@ -403,8 +403,6 @@ SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS);
SELECT @total_charset;
@total_charset
36
-'Bug # 34843: character sets are mapped in such a way that 100 and following '
-'numbers give error, and before 100 the 36 mapped wraps arround several times.'
'#--------------------FN_DYNVARS_008_10-------------------------#'
SET @@character_set_filesystem = abc;
ERROR 42000: Unknown character set: 'abc'
diff --git a/mysql-test/suite/sys_vars/r/character_set_results_basic.result b/mysql-test/suite/sys_vars/r/character_set_results_basic.result
index 71c01a3dc0d..0b59f60cd45 100644
--- a/mysql-test/suite/sys_vars/r/character_set_results_basic.result
+++ b/mysql-test/suite/sys_vars/r/character_set_results_basic.result
Binary files differ
diff --git a/mysql-test/suite/sys_vars/r/character_set_server_basic.result b/mysql-test/suite/sys_vars/r/character_set_server_basic.result
index 83545128a76..966489c6cbb 100644
--- a/mysql-test/suite/sys_vars/r/character_set_server_basic.result
+++ b/mysql-test/suite/sys_vars/r/character_set_server_basic.result
@@ -29,6 +29,8 @@ ERROR 42S22: Unknown column 'session' in 'field list'
SET global character_set_server=utf8;
SELECT global character_set_server;
ERROR 42S22: Unknown column 'global' in 'field list'
+SET @@character_set_server = null;
+ERROR 42000: Variable 'character_set_server' can't be set to the value of 'NULL'
'#--------------------FN_DYNVARS_009_02-------------------------#'
SET @@character_set_server = latin5;
SET @@character_set_server = DEFAULT;
@@ -417,13 +419,6 @@ SELECT @@global.character_set_server;
cp1250
SET @@global.character_set_server = 100;
ERROR 42000: Unknown character set: '100'
-SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS);
-SELECT @total_charset;
-@total_charset
-36
-'Bug # 34843: character sets are mapped in such a way that 100 and following ';
-'numbers gives error, and before 100 the 36 mapped wraps arround ';
-'several times.';
'#--------------------FN_DYNVARS_009_10-------------------------#'
SET @@character_set_server = abc;
ERROR 42000: Unknown character set: 'abc'
diff --git a/mysql-test/suite/sys_vars/r/character_sets_dir_basic.result b/mysql-test/suite/sys_vars/r/character_sets_dir_basic.result
new file mode 100644
index 00000000000..0ee774c1e9d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/character_sets_dir_basic.result
@@ -0,0 +1,21 @@
+select @@global.character_sets_dir;
+@@global.character_sets_dir
+MYSQL_SHAREDIR/charsets/
+select @@session.character_sets_dir;
+ERROR HY000: Variable 'character_sets_dir' is a GLOBAL variable
+show global variables like 'character_sets_dir';
+Variable_name Value
+character_sets_dir MYSQL_SHAREDIR/charsets/
+show session variables like 'character_sets_dir';
+Variable_name Value
+character_sets_dir MYSQL_SHAREDIR/charsets/
+select * from information_schema.global_variables where variable_name='character_sets_dir';
+VARIABLE_NAME VARIABLE_VALUE
+CHARACTER_SETS_DIR MYSQL_SHAREDIR/charsets/
+select * from information_schema.session_variables where variable_name='character_sets_dir';
+VARIABLE_NAME VARIABLE_VALUE
+CHARACTER_SETS_DIR MYSQL_SHAREDIR/charsets/
+set global character_sets_dir="foo";
+ERROR HY000: Variable 'character_sets_dir' is a read only variable
+set session character_sets_dir="foo";
+ERROR HY000: Variable 'character_sets_dir' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/collation_database_basic.result b/mysql-test/suite/sys_vars/r/collation_database_basic.result
index d4375b7c8e4..50787b4bc7d 100644
--- a/mysql-test/suite/sys_vars/r/collation_database_basic.result
+++ b/mysql-test/suite/sys_vars/r/collation_database_basic.result
@@ -32,9 +32,12 @@ ERROR 42S22: Unknown column 'global' in 'field list'
'#--------------------FN_DYNVARS_016_02-------------------------#'
SET @@collation_database = latin1_bin;
SET @@collation_database = DEFAULT;
+SELECT DEFAULT_COLLATION_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME=DATABASE();
+DEFAULT_COLLATION_NAME
+latin1_swedish_ci
SELECT @@collation_database AS DEFAULT_VALUE;
DEFAULT_VALUE
-utf8_unicode_ci
+latin1_swedish_ci
SET @@global.collation_database = latin1_bin;
SET @@global.collation_database = DEFAULT;
SELECT @@global.collation_database;
diff --git a/mysql-test/suite/sys_vars/r/collation_database_func.result b/mysql-test/suite/sys_vars/r/collation_database_func.result
index dae8677eecf..38b1c7e22ba 100644
--- a/mysql-test/suite/sys_vars/r/collation_database_func.result
+++ b/mysql-test/suite/sys_vars/r/collation_database_func.result
@@ -11,7 +11,6 @@ latin1_danish_ci
SELECT @@session.collation_database;
@@session.collation_database
latin1_swedish_ci
-'Bug#35378: New session collation_database is not change by global collation_database'
'#--------------------FN_DYNVARS_011_02-------------------------#'
'connection default'
DROP TABLE IF EXISTS t1,t2;
@@ -31,7 +30,6 @@ USE db1;
SHOW CREATE DATABASE db1;
Database Create Database
db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_roman_ci */
-'Bug#35380: collation_database does not effects CREATE DATABASE without characater set'
CREATE TABLE t1(a CHAR(20));
SHOW CREATE TABLE t1;
Table Create Table
diff --git a/mysql-test/suite/sys_vars/r/completion_type_basic.result b/mysql-test/suite/sys_vars/r/completion_type_basic.result
index 93bfe581182..c0f307cf238 100644
--- a/mysql-test/suite/sys_vars/r/completion_type_basic.result
+++ b/mysql-test/suite/sys_vars/r/completion_type_basic.result
@@ -1,58 +1,74 @@
SET @start_global_value = @@global.completion_type;
SELECT @start_global_value;
@start_global_value
-0
+NO_CHAIN
SET @start_session_value = @@session.completion_type;
SELECT @start_session_value;
@start_session_value
-0
+NO_CHAIN
'#--------------------FN_DYNVARS_017_01-------------------------#'
SET @@global.completion_type = 2;
SET @@global.completion_type = DEFAULT;
SELECT @@global.completion_type;
@@global.completion_type
-0
+NO_CHAIN
SET @@session.completion_type = 1;
SET @@session.completion_type = DEFAULT;
SELECT @@session.completion_type;
@@session.completion_type
-0
-'#--------------------FN_DYNVARS_017_02-------------------------#'
-SET @@global.completion_type = @start_global_value;
-SELECT @@global.completion_type = 0;
-@@global.completion_type = 0
-1
-SET @@session.completion_type = @start_session_value;
-SELECT @@session.completion_type = 0;
-@@session.completion_type = 0
-1
+NO_CHAIN
'#--------------------FN_DYNVARS_017_03-------------------------#'
SET @@global.completion_type = 0;
SELECT @@global.completion_type;
@@global.completion_type
-0
+NO_CHAIN
SET @@global.completion_type = 1;
SELECT @@global.completion_type;
@@global.completion_type
-1
+CHAIN
SET @@global.completion_type = 2;
SELECT @@global.completion_type;
@@global.completion_type
-2
+RELEASE
+SET @@global.completion_type = NO_CHAIN;
+SELECT @@global.completion_type;
+@@global.completion_type
+NO_CHAIN
+SET @@global.completion_type = CHAIN;
+SELECT @@global.completion_type;
+@@global.completion_type
+CHAIN
+SET @@global.completion_type = 'RELEASE';
+SELECT @@global.completion_type;
+@@global.completion_type
+RELEASE
'#--------------------FN_DYNVARS_017_04-------------------------#'
SET @@session.completion_type = 0;
SELECT @@session.completion_type;
@@session.completion_type
-0
+NO_CHAIN
SET @@session.completion_type = 1;
SELECT @@session.completion_type;
@@session.completion_type
-1
+CHAIN
SET @@session.completion_type = 2;
SELECT @@session.completion_type;
@@session.completion_type
-2
+RELEASE
+SET @@session.completion_type = 'NO_CHAIN';
+SELECT @@session.completion_type;
+@@session.completion_type
+NO_CHAIN
+SET @@session.completion_type = 'CHAIN';
+SELECT @@session.completion_type;
+@@session.completion_type
+CHAIN
+SET @@session.completion_type = 'RELEASE';
+SELECT @@session.completion_type;
+@@session.completion_type
+RELEASE
'#------------------FN_DYNVARS_017_05-----------------------#'
+set sql_mode=TRADITIONAL;
SET @@global.completion_type = 10;
ERROR 42000: Variable 'completion_type' can't be set to the value of '10'
SET @@global.completion_type = -1024;
@@ -60,7 +76,7 @@ ERROR 42000: Variable 'completion_type' can't be set to the value of '-1024'
SET @@global.completion_type = 2.4;
ERROR 42000: Incorrect argument type to variable 'completion_type'
SET @@global.completion_type = OFF;
-ERROR 42000: Incorrect argument type to variable 'completion_type'
+ERROR 42000: Variable 'completion_type' can't be set to the value of 'OFF'
SET @@session.completion_type = 10;
ERROR 42000: Variable 'completion_type' can't be set to the value of '10'
SET @@session.completion_type = -2;
@@ -68,7 +84,7 @@ ERROR 42000: Variable 'completion_type' can't be set to the value of '-2'
SET @@session.completion_type = 1.2;
ERROR 42000: Incorrect argument type to variable 'completion_type'
SET @@session.completion_type = ON;
-ERROR 42000: Incorrect argument type to variable 'completion_type'
+ERROR 42000: Variable 'completion_type' can't be set to the value of 'ON'
'#------------------FN_DYNVARS_017_06-----------------------#'
SELECT @@global.completion_type = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@@ -84,11 +100,11 @@ WHERE VARIABLE_NAME='completion_type';
SET @@global.completion_type = TRUE;
SELECT @@global.completion_type;
@@global.completion_type
-1
+CHAIN
SET @@global.completion_type = FALSE;
SELECT @@global.completion_type;
@@global.completion_type
-0
+NO_CHAIN
'#---------------------FN_DYNVARS_001_08----------------------#'
SET @@completion_type = 1;
SELECT @@completion_type = @@local.completion_type;
@@ -101,7 +117,7 @@ SELECT @@local.completion_type = @@session.completion_type;
SET completion_type = 1;
SELECT @@completion_type;
@@completion_type
-1
+CHAIN
SET local.completion_type = 1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'completion_type = 1' at line 1
SELECT local.completion_type;
@@ -115,8 +131,9 @@ ERROR 42S22: Unknown column 'completion_type' in 'field list'
SET @@global.completion_type = @start_global_value;
SELECT @@global.completion_type;
@@global.completion_type
-0
+NO_CHAIN
SET @@session.completion_type = @start_session_value;
SELECT @@session.completion_type;
@@session.completion_type
-0
+NO_CHAIN
+set sql_mode='';
diff --git a/mysql-test/suite/sys_vars/r/concurrent_insert_basic.result b/mysql-test/suite/sys_vars/r/concurrent_insert_basic.result
index 1ea9c37c2a1..996a5e93717 100644
--- a/mysql-test/suite/sys_vars/r/concurrent_insert_basic.result
+++ b/mysql-test/suite/sys_vars/r/concurrent_insert_basic.result
@@ -1,65 +1,70 @@
SET @start_value = @@global.concurrent_insert;
SELECT @start_value;
@start_value
-1
+AUTO
'#--------------------FN_DYNVARS_018_01------------------------#'
SET @@global.concurrent_insert = 0;
SET @@global.concurrent_insert = DEFAULT;
SELECT @@global.concurrent_insert;
@@global.concurrent_insert
-1
+AUTO
'#---------------------FN_DYNVARS_018_02-------------------------#'
SET @@global.concurrent_insert = DEFAULT;
SELECT @@global.concurrent_insert = 1;
@@global.concurrent_insert = 1
-1
+0
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'AUTO'
'#--------------------FN_DYNVARS_018_03------------------------#'
SET @@global.concurrent_insert = 0;
SELECT @@global.concurrent_insert;
@@global.concurrent_insert
-0
+NEVER
SET @@global.concurrent_insert = 1;
SELECT @@global.concurrent_insert;
@@global.concurrent_insert
-1
+AUTO
SET @@global.concurrent_insert = 2;
SELECT @@global.concurrent_insert;
@@global.concurrent_insert
-2
+ALWAYS
+SET @@global.concurrent_insert = NEVER;
+SELECT @@global.concurrent_insert;
+@@global.concurrent_insert
+NEVER
+SET @@global.concurrent_insert = AUTO;
+SELECT @@global.concurrent_insert;
+@@global.concurrent_insert
+AUTO
+SET @@global.concurrent_insert = ALWAYS;
+SELECT @@global.concurrent_insert;
+@@global.concurrent_insert
+ALWAYS
'#--------------------FN_DYNVARS_018_04-------------------------#'
SET @@global.concurrent_insert = -1;
-Warnings:
-Warning 1292 Truncated incorrect concurrent_insert value: '-1'
-Select @@global.concurrent_insert;
-@@global.concurrent_insert
-0
+ERROR 42000: Variable 'concurrent_insert' can't be set to the value of '-1'
SET @@global.concurrent_insert = 100;
-Warnings:
-Warning 1292 Truncated incorrect concurrent_insert value: '100'
-Select @@global.concurrent_insert;
-@@global.concurrent_insert
-2
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
+ERROR 42000: Variable 'concurrent_insert' can't be set to the value of '100'
SET @@global.concurrent_insert = TRUEF;
-ERROR 42000: Incorrect argument type to variable 'concurrent_insert'
+ERROR 42000: Variable 'concurrent_insert' can't be set to the value of 'TRUEF'
SET @@global.concurrent_insert = TRUE_F;
-ERROR 42000: Incorrect argument type to variable 'concurrent_insert'
+ERROR 42000: Variable 'concurrent_insert' can't be set to the value of 'TRUE_F'
SET @@global.concurrent_insert = FALSE0;
-ERROR 42000: Incorrect argument type to variable 'concurrent_insert'
+ERROR 42000: Variable 'concurrent_insert' can't be set to the value of 'FALSE0'
SET @@global.concurrent_insert = OON;
-ERROR 42000: Incorrect argument type to variable 'concurrent_insert'
+ERROR 42000: Variable 'concurrent_insert' can't be set to the value of 'OON'
SET @@global.concurrent_insert = ONN;
-ERROR 42000: Incorrect argument type to variable 'concurrent_insert'
+ERROR 42000: Variable 'concurrent_insert' can't be set to the value of 'ONN'
SET @@global.concurrent_insert = OOFF;
-ERROR 42000: Incorrect argument type to variable 'concurrent_insert'
+ERROR 42000: Variable 'concurrent_insert' can't be set to the value of 'OOFF'
SET @@global.concurrent_insert = 0FF;
-ERROR 42000: Incorrect argument type to variable 'concurrent_insert'
+ERROR 42000: Variable 'concurrent_insert' can't be set to the value of '0FF'
SET @@global.concurrent_insert = ' ';
-ERROR 42000: Incorrect argument type to variable 'concurrent_insert'
+ERROR 42000: Variable 'concurrent_insert' can't be set to the value of ' '
SET @@global.concurrent_insert = " ";
-ERROR 42000: Incorrect argument type to variable 'concurrent_insert'
+ERROR 42000: Variable 'concurrent_insert' can't be set to the value of ' '
SET @@global.concurrent_insert = '';
-ERROR 42000: Incorrect argument type to variable 'concurrent_insert'
+ERROR 42000: Variable 'concurrent_insert' can't be set to the value of ''
'#-------------------FN_DYNVARS_018_05----------------------------#'
SET @@session.concurrent_insert = 1;
ERROR HY000: Variable 'concurrent_insert' is a GLOBAL variable and should be set with SET GLOBAL
@@ -73,18 +78,18 @@ WHERE VARIABLE_NAME='concurrent_insert';
1
'#---------------------FN_DYNVARS_018_07----------------------#'
SET @@global.concurrent_insert = OFF;
-ERROR 42000: Incorrect argument type to variable 'concurrent_insert'
+ERROR 42000: Variable 'concurrent_insert' can't be set to the value of 'OFF'
SET @@global.concurrent_insert = ON;
-ERROR 42000: Incorrect argument type to variable 'concurrent_insert'
+ERROR 42000: Variable 'concurrent_insert' can't be set to the value of 'ON'
'#---------------------FN_DYNVARS_018_08----------------------#'
SET @@global.concurrent_insert = TRUE;
SELECT @@global.concurrent_insert;
@@global.concurrent_insert
-1
+AUTO
SET @@global.concurrent_insert = FALSE;
SELECT @@global.concurrent_insert;
@@global.concurrent_insert
-0
+NEVER
'#---------------------FN_DYNVARS_018_09----------------------#'
SET @@global.concurrent_insert = 1;
SELECT @@concurrent_insert = @@global.concurrent_insert;
@@ -95,7 +100,7 @@ SET concurrent_insert = 1;
ERROR HY000: Variable 'concurrent_insert' is a GLOBAL variable and should be set with SET GLOBAL
SELECT @@concurrent_insert;
@@concurrent_insert
-1
+AUTO
SET global.concurrent_insert = 1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'concurrent_insert = 1' at line 1
SELECT global.concurrent_insert;
@@ -105,4 +110,4 @@ ERROR 42S22: Unknown column 'concurrent_insert' in 'field list'
SET @@global.concurrent_insert = @start_value;
SELECT @@global.concurrent_insert;
@@global.concurrent_insert
-1
+AUTO
diff --git a/mysql-test/suite/sys_vars/r/concurrent_insert_func.result b/mysql-test/suite/sys_vars/r/concurrent_insert_func.result
index 774775a8287..de4ddbb5a04 100644
--- a/mysql-test/suite/sys_vars/r/concurrent_insert_func.result
+++ b/mysql-test/suite/sys_vars/r/concurrent_insert_func.result
@@ -82,7 +82,7 @@ Record_6
Record_5
SELECT @@concurrent_insert;
@@concurrent_insert
-2
+ALWAYS
connection default;
## Unlocking table ##
UNLOCK TABLES;
diff --git a/mysql-test/suite/sys_vars/r/connect_timeout_basic.result b/mysql-test/suite/sys_vars/r/connect_timeout_basic.result
index cc84405cf86..7947332a68c 100644
--- a/mysql-test/suite/sys_vars/r/connect_timeout_basic.result
+++ b/mysql-test/suite/sys_vars/r/connect_timeout_basic.result
@@ -45,7 +45,6 @@ Warning 1292 Truncated incorrect connect_timeout value: '42949672950'
SELECT @@global.connect_timeout;
@@global.connect_timeout
31536000
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
SET @@global.connect_timeout = 21221204.10;
ERROR 42000: Incorrect argument type to variable 'connect_timeout'
SET @@global.connect_timeout = ON;
diff --git a/mysql-test/suite/sys_vars/r/date_format_basic.result b/mysql-test/suite/sys_vars/r/date_format_basic.result
new file mode 100644
index 00000000000..a92d275dbba
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/date_format_basic.result
@@ -0,0 +1,21 @@
+select @@global.date_format;
+@@global.date_format
+%Y-%m-%d
+select @@session.date_format;
+ERROR HY000: Variable 'date_format' is a GLOBAL variable
+show global variables like 'date_format';
+Variable_name Value
+date_format %Y-%m-%d
+show session variables like 'date_format';
+Variable_name Value
+date_format %Y-%m-%d
+select * from information_schema.global_variables where variable_name='date_format';
+VARIABLE_NAME VARIABLE_VALUE
+DATE_FORMAT %Y-%m-%d
+select * from information_schema.session_variables where variable_name='date_format';
+VARIABLE_NAME VARIABLE_VALUE
+DATE_FORMAT %Y-%m-%d
+set global date_format="foo";
+ERROR HY000: Variable 'date_format' is a read only variable
+set session date_format="foo";
+ERROR HY000: Variable 'date_format' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/datetime_format_basic.result b/mysql-test/suite/sys_vars/r/datetime_format_basic.result
new file mode 100644
index 00000000000..ac80ee37590
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/datetime_format_basic.result
@@ -0,0 +1,21 @@
+select @@global.datetime_format;
+@@global.datetime_format
+%Y-%m-%d %H:%i:%s
+select @@session.datetime_format;
+ERROR HY000: Variable 'datetime_format' is a GLOBAL variable
+show global variables like 'datetime_format';
+Variable_name Value
+datetime_format %Y-%m-%d %H:%i:%s
+show session variables like 'datetime_format';
+Variable_name Value
+datetime_format %Y-%m-%d %H:%i:%s
+select * from information_schema.global_variables where variable_name='datetime_format';
+VARIABLE_NAME VARIABLE_VALUE
+DATETIME_FORMAT %Y-%m-%d %H:%i:%s
+select * from information_schema.session_variables where variable_name='datetime_format';
+VARIABLE_NAME VARIABLE_VALUE
+DATETIME_FORMAT %Y-%m-%d %H:%i:%s
+set global datetime_format="foo";
+ERROR HY000: Variable 'datetime_format' is a read only variable
+set session datetime_format="foo";
+ERROR HY000: Variable 'datetime_format' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/debug_basic.result b/mysql-test/suite/sys_vars/r/debug_basic.result
new file mode 100644
index 00000000000..5a77446d036
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/debug_basic.result
@@ -0,0 +1,25 @@
+set session debug="L";
+select @@global.debug="1";
+@@global.debug="1"
+0
+select @@session.debug;
+@@session.debug
+L
+show global variables like 'debug';
+Variable_name Value
+debug #
+show session variables like 'debug';
+Variable_name Value
+debug L
+select * from information_schema.global_variables where variable_name="debug";
+VARIABLE_NAME VARIABLE_VALUE
+DEBUG #
+select * from information_schema.session_variables where variable_name="debug";
+VARIABLE_NAME VARIABLE_VALUE
+DEBUG L
+set @@global.debug=1;
+ERROR 42000: Incorrect argument type to variable 'debug'
+set @@global.debug=1.1;
+ERROR 42000: Incorrect argument type to variable 'debug'
+set @@global.debug=1e1;
+ERROR 42000: Incorrect argument type to variable 'debug'
diff --git a/mysql-test/suite/sys_vars/r/debug_sync_basic.result b/mysql-test/suite/sys_vars/r/debug_sync_basic.result
new file mode 100644
index 00000000000..6ebb46dd662
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/debug_sync_basic.result
@@ -0,0 +1,21 @@
+select @@global.debug_sync;
+ERROR HY000: Variable 'debug_sync' is a SESSION variable
+select @@session.debug_sync;
+@@session.debug_sync
+ON - current signal: ''
+show global variables like "debug_sync";
+Variable_name Value
+show session variables like "debug_sync";
+Variable_name Value
+debug_sync ON - current signal: ''
+select * from information_schema.global_variables where variable_name="debug_sync";
+VARIABLE_NAME VARIABLE_VALUE
+select * from information_schema.session_variables where variable_name="debug_sync";
+VARIABLE_NAME VARIABLE_VALUE
+DEBUG_SYNC ON - current signal: ''
+set @@session.debug_sync=1;
+ERROR 42000: Incorrect argument type to variable 'debug_sync'
+set @@session.debug_sync=1.1;
+ERROR 42000: Incorrect argument type to variable 'debug_sync'
+set @@session.debug_sync=1e1;
+ERROR 42000: Incorrect argument type to variable 'debug_sync'
diff --git a/mysql-test/suite/sys_vars/r/default_storage_engine_basic.result b/mysql-test/suite/sys_vars/r/default_storage_engine_basic.result
new file mode 100644
index 00000000000..2bbb6fe6012
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/default_storage_engine_basic.result
@@ -0,0 +1,117 @@
+SET @start_global_value = @@global.default_storage_engine;
+SELECT @start_global_value;
+@start_global_value
+MyISAM
+SET @start_session_value = @@session.default_storage_engine;
+SELECT @start_session_value;
+@start_session_value
+MyISAM
+'#--------------------FN_DYNVARS_005_01-------------------------#'
+SET @@global.default_storage_engine = INNODB;
+SET @@global.default_storage_engine = DEFAULT;
+SELECT @@global.default_storage_engine;
+@@global.default_storage_engine
+MyISAM
+SET @@session.default_storage_engine = INNODB;
+SET @@session.default_storage_engine = DEFAULT;
+SELECT @@session.default_storage_engine;
+@@session.default_storage_engine
+MyISAM
+'#--------------------FN_DYNVARS_005_02-------------------------#'
+SET @@global.default_storage_engine = MYISAM;
+SELECT @@global.default_storage_engine;
+@@global.default_storage_engine
+MyISAM
+SET @@global.default_storage_engine = MERGE;
+SELECT @@global.default_storage_engine;
+@@global.default_storage_engine
+MRG_MYISAM
+SET @@global.default_storage_engine = MEMORY;
+SELECT @@global.default_storage_engine;
+@@global.default_storage_engine
+MEMORY
+SET @@global.default_storage_engine = INNODB;
+SELECT @@global.default_storage_engine;
+@@global.default_storage_engine
+InnoDB
+'#--------------------FN_DYNVARS_005_03-------------------------#'
+SET @@session.default_storage_engine = MYISAM;
+SELECT @@session.default_storage_engine;
+@@session.default_storage_engine
+MyISAM
+SET @@session.default_storage_engine = MERGE;
+SELECT @@session.default_storage_engine;
+@@session.default_storage_engine
+MRG_MYISAM
+SET @@session.default_storage_engine = MEMORY;
+SELECT @@session.default_storage_engine;
+@@session.default_storage_engine
+MEMORY
+SET @@session.default_storage_engine = INNODB;
+SELECT @@session.default_storage_engine;
+@@session.default_storage_engine
+InnoDB
+'#------------------FN_DYNVARS_005_04-----------------------#'
+SET @@global.default_storage_engine = 8199;
+ERROR 42000: Incorrect argument type to variable 'default_storage_engine'
+SET @@global.default_storage_engine = NULL;
+ERROR 42000: Variable 'default_storage_engine' can't be set to the value of 'NULL'
+SET @@global.default_storage_engine = -1024;
+ERROR 42000: Incorrect argument type to variable 'default_storage_engine'
+SET @@global.default_storage_engine = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'default_storage_engine'
+SET @@global.default_storage_engine = FILE;
+ERROR 42000: Unknown table engine 'FILE'
+SET @@session.default_storage_engine = 8199;
+ERROR 42000: Incorrect argument type to variable 'default_storage_engine'
+SET @@session.default_storage_engine = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'default_storage_engine'
+SET @@session.default_storage_engine = RECORD;
+ERROR 42000: Unknown table engine 'RECORD'
+'#------------------FN_DYNVARS_005_05-----------------------#'
+SELECT @@global.default_storage_engine =
+VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='default_storage_engine';
+@@global.default_storage_engine =
+VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_005_06-----------------------#'
+SELECT @@session.default_storage_engine =
+VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='default_storage_engine';
+@@session.default_storage_engine =
+VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_005_07-----------------------#'
+SET @@global.default_storage_engine = TRUE;
+ERROR 42000: Incorrect argument type to variable 'default_storage_engine'
+SET @@global.default_storage_engine = FALSE;
+ERROR 42000: Incorrect argument type to variable 'default_storage_engine'
+'#---------------------FN_DYNVARS_001_8----------------------#'
+SET @@default_storage_engine = MYISAM;
+SELECT @@default_storage_engine = @@local.default_storage_engine;
+@@default_storage_engine = @@local.default_storage_engine
+1
+SELECT @@local.default_storage_engine = @@session.default_storage_engine;
+@@local.default_storage_engine = @@session.default_storage_engine
+1
+'#---------------------FN_DYNVARS_001_9----------------------#'
+SET default_storage_engine = MEMORY;
+SELECT @@default_storage_engine;
+@@default_storage_engine
+MEMORY
+SELECT local.default_storage_engine;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.default_storage_engine;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT default_storage_engine = @@session.default_storage_engine;
+ERROR 42S22: Unknown column 'default_storage_engine' in 'field list'
+SET @@default_storage_engine = @start_global_value;
+SET @@global.default_storage_engine = @start_global_value;
+SELECT @@global.default_storage_engine;
+@@global.default_storage_engine
+MyISAM
+SET @@session.default_storage_engine = @start_session_value;
+SELECT @@session.default_storage_engine;
+@@session.default_storage_engine
+MyISAM
diff --git a/mysql-test/suite/sys_vars/r/default_week_format_basic.result b/mysql-test/suite/sys_vars/r/default_week_format_basic.result
index aa5e0b264d3..8e3bc407ba3 100644
--- a/mysql-test/suite/sys_vars/r/default_week_format_basic.result
+++ b/mysql-test/suite/sys_vars/r/default_week_format_basic.result
@@ -113,7 +113,6 @@ Warning 1292 Truncated incorrect default_week_format value: '65550'
SELECT @@session.default_week_format;
@@session.default_week_format
7
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
'#------------------FN_DYNVARS_022_06-----------------------#'
SELECT @@global.default_week_format = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
diff --git a/mysql-test/suite/sys_vars/r/delay_key_write_basic.result b/mysql-test/suite/sys_vars/r/delay_key_write_basic.result
index 100c62ac47e..2258d7af078 100644
--- a/mysql-test/suite/sys_vars/r/delay_key_write_basic.result
+++ b/mysql-test/suite/sys_vars/r/delay_key_write_basic.result
@@ -5,12 +5,9 @@ ON
'#--------------------FN_DYNVARS_023_01------------------------#'
SET @@global.delay_key_write = OFF;
SET @@global.delay_key_write = DEFAULT;
-ERROR 42000: Variable 'delay_key_write' doesn't have a default value
-'Bug # 34878: Documentation specifies a DEFAULT value of ON for variable but';
-'its not supported';
SELECT @@global.delay_key_write;
@@global.delay_key_write
-OFF
+ON
'#---------------------FN_DYNVARS_023_02-------------------------#'
SET @@global.delay_key_write = NULL;
ERROR 42000: Variable 'delay_key_write' can't be set to the value of 'NULL'
@@ -41,10 +38,7 @@ ERROR 42000: Variable 'delay_key_write' can't be set to the value of 'FALSE0'
SET @@global.delay_key_write = ONN;
ERROR 42000: Variable 'delay_key_write' can't be set to the value of 'ONN'
SET @@global.delay_key_write = OF;
-SELECT @@global.delay_key_write;
-@@global.delay_key_write
-OFF
-'Bug# 34828: Variable is incorrectly accepting OF as a value'
+ERROR 42000: Variable 'delay_key_write' can't be set to the value of 'OF'
SET @@global.delay_key_write = ' ';
ERROR 42000: Variable 'delay_key_write' can't be set to the value of ' '
SET @@global.delay_key_write = "";
diff --git a/mysql-test/suite/sys_vars/r/delayed_insert_limit_basic_32.result b/mysql-test/suite/sys_vars/r/delayed_insert_limit_basic_32.result
index f55c966dc38..3da10bc8416 100644
--- a/mysql-test/suite/sys_vars/r/delayed_insert_limit_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/delayed_insert_limit_basic_32.result
@@ -45,7 +45,6 @@ Warning 1292 Truncated incorrect delayed_insert_limit value: '42949672950'
SELECT @@global.delayed_insert_limit;
@@global.delayed_insert_limit
4294967295
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
SET @@global.delayed_insert_limit = 429496729.5;
ERROR 42000: Incorrect argument type to variable 'delayed_insert_limit'
SELECT @@global.delayed_insert_limit;
diff --git a/mysql-test/suite/sys_vars/r/delayed_insert_limit_basic_64.result b/mysql-test/suite/sys_vars/r/delayed_insert_limit_basic_64.result
index 1f7d0a52e72..af73196d14f 100644
--- a/mysql-test/suite/sys_vars/r/delayed_insert_limit_basic_64.result
+++ b/mysql-test/suite/sys_vars/r/delayed_insert_limit_basic_64.result
@@ -43,7 +43,6 @@ SET @@global.delayed_insert_limit = 42949672950;
SELECT @@global.delayed_insert_limit;
@@global.delayed_insert_limit
42949672950
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
SET @@global.delayed_insert_limit = 429496729.5;
ERROR 42000: Incorrect argument type to variable 'delayed_insert_limit'
SELECT @@global.delayed_insert_limit;
diff --git a/mysql-test/suite/sys_vars/r/delayed_insert_timeout_basic.result b/mysql-test/suite/sys_vars/r/delayed_insert_timeout_basic.result
index e8eab4da3cc..ceb89ad6698 100644
--- a/mysql-test/suite/sys_vars/r/delayed_insert_timeout_basic.result
+++ b/mysql-test/suite/sys_vars/r/delayed_insert_timeout_basic.result
@@ -45,7 +45,6 @@ Warning 1292 Truncated incorrect delayed_insert_timeout value: '42949672950'
SELECT @@global.delayed_insert_timeout;
@@global.delayed_insert_timeout
31536000
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
SET @@global.delayed_insert_timeout = 429496729.5;
ERROR 42000: Incorrect argument type to variable 'delayed_insert_timeout'
SELECT @@global.delayed_insert_timeout;
diff --git a/mysql-test/suite/sys_vars/r/delayed_queue_size_basic_32.result b/mysql-test/suite/sys_vars/r/delayed_queue_size_basic_32.result
index 3b356c6d866..f4448b08b1f 100644
--- a/mysql-test/suite/sys_vars/r/delayed_queue_size_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/delayed_queue_size_basic_32.result
@@ -45,7 +45,6 @@ Warning 1292 Truncated incorrect delayed_queue_size value: '42949672950'
SELECT @@global.delayed_queue_size;
@@global.delayed_queue_size
4294967295
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
SET @@global.delayed_queue_size = 429496729.5;
ERROR 42000: Incorrect argument type to variable 'delayed_queue_size'
SELECT @@global.delayed_queue_size;
diff --git a/mysql-test/suite/sys_vars/r/delayed_queue_size_basic_64.result b/mysql-test/suite/sys_vars/r/delayed_queue_size_basic_64.result
index ed866b7e0b4..8b1936e68c5 100644
--- a/mysql-test/suite/sys_vars/r/delayed_queue_size_basic_64.result
+++ b/mysql-test/suite/sys_vars/r/delayed_queue_size_basic_64.result
@@ -43,7 +43,6 @@ SET @@global.delayed_queue_size = 42949672950;
SELECT @@global.delayed_queue_size;
@@global.delayed_queue_size
42949672950
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
SET @@global.delayed_queue_size = 429496729.5;
ERROR 42000: Incorrect argument type to variable 'delayed_queue_size'
SELECT @@global.delayed_queue_size;
diff --git a/mysql-test/suite/sys_vars/r/div_precision_increment_basic.result b/mysql-test/suite/sys_vars/r/div_precision_increment_basic.result
index f78855fcaae..982cca47f5f 100644
--- a/mysql-test/suite/sys_vars/r/div_precision_increment_basic.result
+++ b/mysql-test/suite/sys_vars/r/div_precision_increment_basic.result
@@ -113,7 +113,6 @@ Warning 1292 Truncated incorrect div_precision_increment value: '65550'
SELECT @@session.div_precision_increment;
@@session.div_precision_increment
30
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
SET @@global.div_precision_increment = 65530.30;
ERROR 42000: Incorrect argument type to variable 'div_precision_increment'
SELECT @@global.div_precision_increment;
diff --git a/mysql-test/suite/sys_vars/r/div_precision_increment_func.result b/mysql-test/suite/sys_vars/r/div_precision_increment_func.result
index eb1fc7ae3a7..ee8b7c5691d 100644
--- a/mysql-test/suite/sys_vars/r/div_precision_increment_func.result
+++ b/mysql-test/suite/sys_vars/r/div_precision_increment_func.result
@@ -5,7 +5,7 @@ CREATE TABLE t1
id INT NOT NULL auto_increment,
PRIMARY KEY (id),
name VARCHAR(30),
-salary LONG
+salary INT
);
'#--------------------FN_DYNVARS_027_01-------------------------#'
## Setting initial session value of variable to 3 ##
@@ -18,8 +18,7 @@ SELECT name, salary, ((salary * 2.5)/1000) AS INCOME from t1;
name salary INCOME
Record_1 100011 250.0275
Record_2 501 1.2525
-Record_3 210 0.525
-'Bug#35374: div_precision is not working with table column'
+Record_3 210 0.5250
## Verifying variable's behavior with direct division ##
SELECT 1/7;
1/7
@@ -32,7 +31,7 @@ CREATE TABLE t1
id INT NOT NULL auto_increment,
PRIMARY KEY (id),
name VARCHAR(30),
-salary LONG,
+salary INT,
income_tax FLOAT
);
## Creating new connection test_con1 ##
diff --git a/mysql-test/suite/sys_vars/r/engine_condition_pushdown_basic.result b/mysql-test/suite/sys_vars/r/engine_condition_pushdown_basic.result
index 93e3cd56c77..6a8052490c4 100644
--- a/mysql-test/suite/sys_vars/r/engine_condition_pushdown_basic.result
+++ b/mysql-test/suite/sys_vars/r/engine_condition_pushdown_basic.result
@@ -57,22 +57,19 @@ SELECT @@global.engine_condition_pushdown;
SET @@session.engine_condition_pushdown = -1;
ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of '-1'
SET @@session.engine_condition_pushdown = 1.6;
-ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of '2'
+ERROR 42000: Incorrect argument type to variable 'engine_condition_pushdown'
SET @@session.engine_condition_pushdown = "T";
ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of 'T'
SET @@session.engine_condition_pushdown = "Y";
ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of 'Y'
SET @@session.engine_condition_pushdown = TRÜE;
-ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of 'TRÃœE'
+ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of 'TRÜE'
SET @@session.engine_condition_pushdown = ÕN;
-ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of 'ÕN'
+ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of 'ÕN'
SET @@session.engine_condition_pushdown = OF;
-SELECT @@session.engine_condition_pushdown;
-@@session.engine_condition_pushdown
-0
-'Bug# 34828: OF is taken as OFF and a value of 0 is set.'
+ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of 'OF'
SET @@session.engine_condition_pushdown = ÓFF;
-ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of 'ÓFF'
+ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of 'ÓFF'
SET @@global.engine_condition_pushdown = -1;
ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of '-1'
SET @@global.engine_condition_pushdown = 2;
@@ -82,16 +79,13 @@ ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of '
SET @@global.engine_condition_pushdown = "Y";
ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of 'Y'
SET @@global.engine_condition_pushdown = TRÜE;
-ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of 'TRÃœE'
+ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of 'TRÜE'
SET @@global.engine_condition_pushdown = ÕN;
-ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of 'ÕN'
+ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of 'ÕN'
SET @@global.engine_condition_pushdown = OF;
-SELECT @@global.engine_condition_pushdown;
-@@global.engine_condition_pushdown
-0
-'Bug# 34828: OF is taken as OFF and a value of 0 is set.'
+ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of 'OF'
SET @@global.engine_condition_pushdown = ÓFF;
-ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of 'ÓFF'
+ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of 'ÓFF'
'#-------------------FN_DYNVARS_028_05----------------------------#'
SET @@global.engine_condition_pushdown = 0;
SET @@session.engine_condition_pushdown = 1;
diff --git a/mysql-test/suite/sys_vars/r/event_scheduler_basic.result b/mysql-test/suite/sys_vars/r/event_scheduler_basic.result
index 8042187d39d..835321530eb 100644
--- a/mysql-test/suite/sys_vars/r/event_scheduler_basic.result
+++ b/mysql-test/suite/sys_vars/r/event_scheduler_basic.result
@@ -4,8 +4,9 @@ SELECT @start_value;
OFF
'#---------------------FN_DYNVARS_004_01-------------------------#'
SET @@global.event_scheduler = DEFAULT;
-ERROR 42000: Variable 'event_scheduler' doesn't have a default value
-'Bug# 34878: According to documentation the default value of variable is OFF';
+SELECT @@global.event_scheduler;
+@@global.event_scheduler
+OFF
'#--------------------FN_DYNVARS_004_02------------------------#'
SET @@global.event_scheduler = ON;
SELECT @@global.event_scheduler;
diff --git a/mysql-test/suite/sys_vars/r/expire_logs_days_basic.result b/mysql-test/suite/sys_vars/r/expire_logs_days_basic.result
index 1abab8e68b0..59b2662d1ea 100644
--- a/mysql-test/suite/sys_vars/r/expire_logs_days_basic.result
+++ b/mysql-test/suite/sys_vars/r/expire_logs_days_basic.result
@@ -66,7 +66,6 @@ Warning 1292 Truncated incorrect expire_logs_days value: '42949672950'
SELECT @@global.expire_logs_days;
@@global.expire_logs_days
99
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
SET @@global.expire_logs_days = ON;
ERROR 42000: Incorrect argument type to variable 'expire_logs_days'
SELECT @@global.expire_logs_days;
diff --git a/mysql-test/suite/sys_vars/r/flush_basic.result b/mysql-test/suite/sys_vars/r/flush_basic.result
index e0584d46351..9a080ee0313 100644
--- a/mysql-test/suite/sys_vars/r/flush_basic.result
+++ b/mysql-test/suite/sys_vars/r/flush_basic.result
@@ -5,11 +5,9 @@ SELECT @start_value;
'#--------------------FN_DYNVARS_030_01------------------------#'
SET @@global.flush = ON;
SET @@global.flush = DEFAULT;
-ERROR 42000: Variable 'flush' doesn't have a default value
-'Bug# 34878: FN_DYNVARS_002_01 - Default value is off according to Documentation of MySQL';
SELECT @@global.flush;
@@global.flush
-1
+0
'#---------------------FN_DYNVARS_030_02-------------------------#'
SET @@global.flush = @start_value;
SELECT @@global.flush;
diff --git a/mysql-test/suite/sys_vars/r/flush_time_basic.result b/mysql-test/suite/sys_vars/r/flush_time_basic.result
new file mode 100644
index 00000000000..8dac3bbdb1e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/flush_time_basic.result
@@ -0,0 +1,41 @@
+SET @start_global_value = @@global.flush_time;
+select @@global.flush_time;
+@@global.flush_time
+0
+select @@session.flush_time;
+ERROR HY000: Variable 'flush_time' is a GLOBAL variable
+show global variables like 'flush_time';
+Variable_name Value
+flush_time 0
+show session variables like 'flush_time';
+Variable_name Value
+flush_time 0
+select * from information_schema.global_variables where variable_name='flush_time';
+VARIABLE_NAME VARIABLE_VALUE
+FLUSH_TIME 0
+select * from information_schema.session_variables where variable_name='flush_time';
+VARIABLE_NAME VARIABLE_VALUE
+FLUSH_TIME 0
+set global flush_time=1;
+select @@global.flush_time;
+@@global.flush_time
+1
+set session flush_time=1;
+ERROR HY000: Variable 'flush_time' is a GLOBAL variable and should be set with SET GLOBAL
+set global flush_time=1.1;
+ERROR 42000: Incorrect argument type to variable 'flush_time'
+set global flush_time=1e1;
+ERROR 42000: Incorrect argument type to variable 'flush_time'
+set global flush_time="foo";
+ERROR 42000: Incorrect argument type to variable 'flush_time'
+set global flush_time=0;
+select @@global.flush_time;
+@@global.flush_time
+0
+set global flush_time=cast(-1 as unsigned int);
+Warnings:
+Warning 1292 Truncated incorrect flush_time value: '18446744073709551615'
+select @@global.flush_time;
+@@global.flush_time
+31536000
+SET @@global.flush_time = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/foreign_key_checks_basic.result b/mysql-test/suite/sys_vars/r/foreign_key_checks_basic.result
index 8540467b9b2..834d693edb8 100644
--- a/mysql-test/suite/sys_vars/r/foreign_key_checks_basic.result
+++ b/mysql-test/suite/sys_vars/r/foreign_key_checks_basic.result
@@ -7,8 +7,7 @@ SET @@session.foreign_key_checks = 1;
SET @@session.foreign_key_checks = DEFAULT;
SELECT @@session.foreign_key_checks;
@@session.foreign_key_checks
-1
-'Bug# 34878: No DEFAULT value for variable. Also setting DEFAULT does not give error'
+0
'#---------------------FN_DYNVARS_032_02-------------------------#'
SET foreign_key_checks = 1;
SELECT @@foreign_key_checks;
@@ -41,25 +40,23 @@ ERROR 42000: Variable 'foreign_key_checks' can't be set to the value of 'T'
SET @@session.foreign_key_checks = "Y";
ERROR 42000: Variable 'foreign_key_checks' can't be set to the value of 'Y'
SET @@session.foreign_key_checks = TRÜE;
-ERROR 42000: Variable 'foreign_key_checks' can't be set to the value of 'TRÃœE'
+ERROR 42000: Variable 'foreign_key_checks' can't be set to the value of 'TRÜE'
SET @@session.foreign_key_checks = ÕN;
-ERROR 42000: Variable 'foreign_key_checks' can't be set to the value of 'ÕN'
+ERROR 42000: Variable 'foreign_key_checks' can't be set to the value of 'ÕN'
SET @@session.foreign_key_checks = OF;
-SELECT @@session.foreign_key_checks;
-@@session.foreign_key_checks
-0
-'Bug# 34828: OF is taken as OFF and a value of 0 is set.'
+ERROR 42000: Variable 'foreign_key_checks' can't be set to the value of 'OF'
SET @@session.foreign_key_checks = ÓFF;
-ERROR 42000: Variable 'foreign_key_checks' can't be set to the value of 'ÓFF'
+ERROR 42000: Variable 'foreign_key_checks' can't be set to the value of 'ÓFF'
SET @@session.foreign_key_checks = '¹';
ERROR 42000: Variable 'foreign_key_checks' can't be set to the value of '¹'
SET @@session.foreign_key_checks = NO;
ERROR 42000: Variable 'foreign_key_checks' can't be set to the value of 'NO'
'#-------------------FN_DYNVARS_032_05----------------------------#'
SET @@global.foreign_key_checks = 0;
-ERROR HY000: Variable 'foreign_key_checks' is a SESSION variable and can't be used with SET GLOBAL
SELECT @@global.foreign_key_checks;
-ERROR HY000: Variable 'foreign_key_checks' is a SESSION variable
+@@global.foreign_key_checks
+0
+SET @@global.foreign_key_checks = 1;
'#----------------------FN_DYNVARS_032_06------------------------#'
SELECT count(VARIABLE_VALUE) FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='foreign_key_checks';
count(VARIABLE_VALUE)
@@ -72,12 +69,12 @@ IF(@@session.foreign_key_checks, "ON", "OFF") = VARIABLE_VALUE
1
SELECT @@session.foreign_key_checks;
@@session.foreign_key_checks
-0
+1
SELECT VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='foreign_key_checks';
VARIABLE_VALUE
-OFF
+ON
'#---------------------FN_DYNVARS_032_08-------------------------#'
SET @@session.foreign_key_checks = OFF;
SELECT @@session.foreign_key_checks;
diff --git a/mysql-test/suite/sys_vars/r/foreign_key_checks_func.result b/mysql-test/suite/sys_vars/r/foreign_key_checks_func.result
index c2898293f83..9b1736541c1 100644
--- a/mysql-test/suite/sys_vars/r/foreign_key_checks_func.result
+++ b/mysql-test/suite/sys_vars/r/foreign_key_checks_func.result
@@ -36,9 +36,6 @@ INSERT INTO t2 values (20,4);
'try enabling foreign_key_checks again';
SET @@session.foreign_key_checks = 1;
UPDATE t2 SET b=4 where a=20;
-'Bug#35358: Updating an incorrect foreign key(inserted by disabling '
-'foreign_key_checks)to the same value does not raise error after '
-'enabling foreign_key_checks'
'Check when foreign_key_checks is enabled and FK constraint is re-created'
SET @@session.foreign_key_checks = 0;
TRUNCATE t2;
diff --git a/mysql-test/suite/sys_vars/r/ft_boolean_syntax_basic.result b/mysql-test/suite/sys_vars/r/ft_boolean_syntax_basic.result
index 94a052172bb..d889eb7bba7 100644
--- a/mysql-test/suite/sys_vars/r/ft_boolean_syntax_basic.result
+++ b/mysql-test/suite/sys_vars/r/ft_boolean_syntax_basic.result
@@ -93,9 +93,6 @@ SELECT @global_start_value;
@global_start_value
+ -><()~*:""&|
SET @@global.ft_boolean_syntax = @global_start_value;
-ERROR 42000: Variable 'ft_boolean_syntax' can't be set to the value of ''
-'Bug# 34883: ft_boolean_syntax cant be assigned values from session temporary';
-'variables';
SET @@global.ft_boolean_syntax = DEFAULT;
SELECT @@global.ft_boolean_syntax;
@@global.ft_boolean_syntax
diff --git a/mysql-test/suite/sys_vars/r/ft_boolean_syntax_func.result b/mysql-test/suite/sys_vars/r/ft_boolean_syntax_func.result
index 0096c553155..0e7d9e26325 100644
--- a/mysql-test/suite/sys_vars/r/ft_boolean_syntax_func.result
+++ b/mysql-test/suite/sys_vars/r/ft_boolean_syntax_func.result
@@ -76,14 +76,14 @@ AGAINST ('"faster than"' IN BOOLEAN MODE);
id title body
6 100 Tips for Myisam 1. Myisam is faster than innodb 2. Tricks and Tips for Myisam...
SELECT * FROM articles WHERE MATCH (title,body)
-AGAINST ('+run ~line' IN BOOLEAN MODE);
+AGAINST ('+tutorial ~line' IN BOOLEAN MODE);
id title body
-'Bug#35359: ~ is not working correctly. Its behaving like -'
+1 MySQL Tutorial DBMS stands for DataBase ...
+4 Optimizing MySQL In this tutorial we will show .... Run command line ...
SELECT * FROM articles WHERE MATCH (title,body)
AGAINST ('10*' IN BOOLEAN MODE);
id title body
5 1001 MySQL Tricks 1. Never run mysqld as root. 2. ...
-'Bug#35360: * is not working correctly. Not all rows are returned'
SELECT id,title,body, (MATCH (title,body)
AGAINST ('+MySQL +(>show <dbms)' IN BOOLEAN MODE)) AS relevance
FROM articles WHERE MATCH (title,body)
@@ -103,6 +103,5 @@ id title body
5 1001 MySQL Tricks 1. Never run mysqld as root. 2. ...
8 MySQL Security When configured properly, MySQL ...
9 Database Security Configuring MySQL for ...
-'Bug#35361: Different syntax does not produce result as default operators'
SET @@global.ft_boolean_syntax=DEFAULT;
DROP TABLE articles;
diff --git a/mysql-test/suite/sys_vars/r/ft_max_word_len_basic.result b/mysql-test/suite/sys_vars/r/ft_max_word_len_basic.result
new file mode 100644
index 00000000000..d35669aba44
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/ft_max_word_len_basic.result
@@ -0,0 +1,21 @@
+select @@global.ft_max_word_len;
+@@global.ft_max_word_len
+84
+select @@session.ft_max_word_len;
+ERROR HY000: Variable 'ft_max_word_len' is a GLOBAL variable
+show global variables like 'ft_max_word_len';
+Variable_name Value
+ft_max_word_len 84
+show session variables like 'ft_max_word_len';
+Variable_name Value
+ft_max_word_len 84
+select * from information_schema.global_variables where variable_name='ft_max_word_len';
+VARIABLE_NAME VARIABLE_VALUE
+FT_MAX_WORD_LEN 84
+select * from information_schema.session_variables where variable_name='ft_max_word_len';
+VARIABLE_NAME VARIABLE_VALUE
+FT_MAX_WORD_LEN 84
+set global ft_max_word_len=1;
+ERROR HY000: Variable 'ft_max_word_len' is a read only variable
+set session ft_max_word_len=1;
+ERROR HY000: Variable 'ft_max_word_len' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/ft_min_word_len_basic.result b/mysql-test/suite/sys_vars/r/ft_min_word_len_basic.result
new file mode 100644
index 00000000000..008955eaf01
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/ft_min_word_len_basic.result
@@ -0,0 +1,21 @@
+select @@global.ft_min_word_len;
+@@global.ft_min_word_len
+4
+select @@session.ft_min_word_len;
+ERROR HY000: Variable 'ft_min_word_len' is a GLOBAL variable
+show global variables like 'ft_min_word_len';
+Variable_name Value
+ft_min_word_len 4
+show session variables like 'ft_min_word_len';
+Variable_name Value
+ft_min_word_len 4
+select * from information_schema.global_variables where variable_name='ft_min_word_len';
+VARIABLE_NAME VARIABLE_VALUE
+FT_MIN_WORD_LEN 4
+select * from information_schema.session_variables where variable_name='ft_min_word_len';
+VARIABLE_NAME VARIABLE_VALUE
+FT_MIN_WORD_LEN 4
+set global ft_min_word_len=1;
+ERROR HY000: Variable 'ft_min_word_len' is a read only variable
+set session ft_min_word_len=1;
+ERROR HY000: Variable 'ft_min_word_len' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/ft_query_expansion_limit_basic.result b/mysql-test/suite/sys_vars/r/ft_query_expansion_limit_basic.result
new file mode 100644
index 00000000000..e4577fb5368
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/ft_query_expansion_limit_basic.result
@@ -0,0 +1,21 @@
+select @@global.ft_query_expansion_limit;
+@@global.ft_query_expansion_limit
+20
+select @@session.ft_query_expansion_limit;
+ERROR HY000: Variable 'ft_query_expansion_limit' is a GLOBAL variable
+show global variables like 'ft_query_expansion_limit';
+Variable_name Value
+ft_query_expansion_limit 20
+show session variables like 'ft_query_expansion_limit';
+Variable_name Value
+ft_query_expansion_limit 20
+select * from information_schema.global_variables where variable_name='ft_query_expansion_limit';
+VARIABLE_NAME VARIABLE_VALUE
+FT_QUERY_EXPANSION_LIMIT 20
+select * from information_schema.session_variables where variable_name='ft_query_expansion_limit';
+VARIABLE_NAME VARIABLE_VALUE
+FT_QUERY_EXPANSION_LIMIT 20
+set global ft_query_expansion_limit=1;
+ERROR HY000: Variable 'ft_query_expansion_limit' is a read only variable
+set session ft_query_expansion_limit=1;
+ERROR HY000: Variable 'ft_query_expansion_limit' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/ft_stopword_file_basic.result b/mysql-test/suite/sys_vars/r/ft_stopword_file_basic.result
new file mode 100644
index 00000000000..89792eaa03a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/ft_stopword_file_basic.result
@@ -0,0 +1,21 @@
+select @@global.ft_stopword_file;
+@@global.ft_stopword_file
+(built-in)
+select @@session.ft_stopword_file;
+ERROR HY000: Variable 'ft_stopword_file' is a GLOBAL variable
+show global variables like 'ft_stopword_file';
+Variable_name Value
+ft_stopword_file (built-in)
+show session variables like 'ft_stopword_file';
+Variable_name Value
+ft_stopword_file (built-in)
+select * from information_schema.global_variables where variable_name='ft_stopword_file';
+VARIABLE_NAME VARIABLE_VALUE
+FT_STOPWORD_FILE (built-in)
+select * from information_schema.session_variables where variable_name='ft_stopword_file';
+VARIABLE_NAME VARIABLE_VALUE
+FT_STOPWORD_FILE (built-in)
+set global ft_stopword_file=1;
+ERROR HY000: Variable 'ft_stopword_file' is a read only variable
+set session ft_stopword_file=1;
+ERROR HY000: Variable 'ft_stopword_file' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/general_log_file_basic.result b/mysql-test/suite/sys_vars/r/general_log_file_basic.result
index 48a8d90b55e..611e0f80d86 100644
--- a/mysql-test/suite/sys_vars/r/general_log_file_basic.result
+++ b/mysql-test/suite/sys_vars/r/general_log_file_basic.result
@@ -4,9 +4,10 @@ SELECT @start_value;
test.log
'#---------------------FN_DYNVARS_004_01-------------------------#'
SET @@global.general_log_file = DEFAULT;
-SELECT RIGHT(@@global.general_log_file,10) AS log_file;
-log_file
-mysqld.log
+SET @a=concat(left(@@hostname, instr(concat(@@hostname, '.'), '.')-1), '.log');
+SELECT RIGHT(@@global.general_log_file, length(@a)) = @a;
+RIGHT(@@global.general_log_file, length(@a)) = @a
+1
'#--------------------FN_DYNVARS_004_02------------------------#'
SET @@global.general_log_file = mytest.log;
SET @@global.general_log_file = 12;
diff --git a/mysql-test/suite/sys_vars/r/general_log_func.result b/mysql-test/suite/sys_vars/r/general_log_func.result
index 39ba90265d5..5a5b4bdc5ec 100644
--- a/mysql-test/suite/sys_vars/r/general_log_func.result
+++ b/mysql-test/suite/sys_vars/r/general_log_func.result
@@ -12,6 +12,10 @@ SET @@global.general_log = OFF;
SELECT @@general_log;
@@general_log
0
+flush logs;
+SET @@global.general_log = ON;
+flush logs;
+SET @@global.general_log = OFF;
## Inserting some Records & Verifying output in log ##
INSERT into t1(name) values('Record_1');
INSERT into t1(name) values('Record_2');
@@ -25,12 +29,11 @@ SELECT @@general_log;
## Inserting some Records & Verifying output in log ##
INSERT into t1(name) values('Record_3');
INSERT into t1(name) values('Record_4');
-## There should be a difference ##
-SET @@global.max_allowed_packet= 1024*1024*1024;
+## old log is a proper prefix of the new log ##
SET @orig_file= load_file('MYSQLD_LOGFILE.orig');
SET @copy_file= load_file('MYSQLD_LOGFILE.copy');
-SELECT STRCMP(@orig_file, @copy_file);
-STRCMP(@orig_file, @copy_file)
-1
+SELECT @orig_file > @copy_file, left(@orig_file, length(@copy_file)) = @copy_file;
+@orig_file > @copy_file left(@orig_file, length(@copy_file)) = @copy_file
+1 1
## Dropping tables ##
DROP TABLE t1;
diff --git a/mysql-test/suite/sys_vars/r/group_concat_max_len_basic.result b/mysql-test/suite/sys_vars/r/group_concat_max_len_basic.result
index 4821ca91308..48126d33ee8 100644
--- a/mysql-test/suite/sys_vars/r/group_concat_max_len_basic.result
+++ b/mysql-test/suite/sys_vars/r/group_concat_max_len_basic.result
@@ -73,8 +73,8 @@ SET @@global.group_concat_max_len = 65536;
SELECT @@global.group_concat_max_len;
@@global.group_concat_max_len
65536
-SET @@global.group_concat_max_len = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.group_concat_max_len = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'group_concat_max_len'
SELECT @@global.group_concat_max_len;
@@global.group_concat_max_len
65536
@@ -95,13 +95,12 @@ Warning 1292 Truncated incorrect group_concat_max_len value: '-2'
SELECT @@session.group_concat_max_len;
@@session.group_concat_max_len
4
-SET @@session.group_concat_max_len = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.group_concat_max_len = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'group_concat_max_len'
SET @@session.group_concat_max_len = 65550;
SELECT @@session.group_concat_max_len;
@@session.group_concat_max_len
65550
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
SET @@session.group_concat_max_len = test;
ERROR 42000: Incorrect argument type to variable 'group_concat_max_len'
SELECT @@session.group_concat_max_len;
diff --git a/mysql-test/suite/sys_vars/r/have_profiling_basic.result b/mysql-test/suite/sys_vars/r/have_profiling_basic.result
new file mode 100644
index 00000000000..72923134e83
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/have_profiling_basic.result
@@ -0,0 +1,21 @@
+select @@global.have_profiling="1";
+@@global.have_profiling="1"
+0
+select @@session.have_profiling;
+ERROR HY000: Variable 'have_profiling' is a GLOBAL variable
+show global variables like 'have_profiling';
+Variable_name Value
+have_profiling #
+show session variables like 'have_profiling';
+Variable_name Value
+have_profiling #
+select * from information_schema.global_variables where variable_name='have_profiling';
+VARIABLE_NAME VARIABLE_VALUE
+HAVE_PROFILING #
+select * from information_schema.session_variables where variable_name='have_profiling';
+VARIABLE_NAME VARIABLE_VALUE
+HAVE_PROFILING #
+set global have_profiling=1;
+ERROR HY000: Variable 'have_profiling' is a read only variable
+set session have_profiling=1;
+ERROR HY000: Variable 'have_profiling' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/identity_basic.result b/mysql-test/suite/sys_vars/r/identity_basic.result
index 60f3edcc030..063decf2eb1 100644
--- a/mysql-test/suite/sys_vars/r/identity_basic.result
+++ b/mysql-test/suite/sys_vars/r/identity_basic.result
@@ -32,9 +32,11 @@ SELECT @@session.identity;
65535
'#--------------------FN_DYNVARS_035_04-------------------------#'
SET @@session.identity = -1;
+Warnings:
+Warning 1292 Truncated incorrect identity value: '-1'
SELECT @@session.identity;
@@session.identity
--1
+0
SET @@session.identity = 100000000000;
SELECT @@session.identity;
@@session.identity
@@ -45,14 +47,15 @@ SELECT @@session.identity;
@@session.identity
100000000000
SET @@session.identity = -1024;
+Warnings:
+Warning 1292 Truncated incorrect identity value: '-1024'
SELECT @@session.identity;
@@session.identity
--1024
+0
SET @@session.identity = 42949672950;
SELECT @@session.identity;
@@session.identity
42949672950
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
SET @@session.identity = ON;
ERROR 42000: Incorrect argument type to variable 'identity'
SELECT @@session.identity;
diff --git a/mysql-test/suite/sys_vars/r/ignore_builtin_innodb_basic.result b/mysql-test/suite/sys_vars/r/ignore_builtin_innodb_basic.result
new file mode 100644
index 00000000000..85084c13115
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/ignore_builtin_innodb_basic.result
@@ -0,0 +1,21 @@
+select @@global.ignore_builtin_innodb;
+@@global.ignore_builtin_innodb
+0
+select @@session.ignore_builtin_innodb;
+ERROR HY000: Variable 'ignore_builtin_innodb' is a GLOBAL variable
+show global variables like 'ignore_builtin_innodb';
+Variable_name Value
+ignore_builtin_innodb OFF
+show session variables like 'ignore_builtin_innodb';
+Variable_name Value
+ignore_builtin_innodb OFF
+select * from information_schema.global_variables where variable_name='ignore_builtin_innodb';
+VARIABLE_NAME VARIABLE_VALUE
+IGNORE_BUILTIN_INNODB OFF
+select * from information_schema.session_variables where variable_name='ignore_builtin_innodb';
+VARIABLE_NAME VARIABLE_VALUE
+IGNORE_BUILTIN_INNODB OFF
+set global ignore_builtin_innodb=1;
+ERROR HY000: Variable 'ignore_builtin_innodb' is a read only variable
+set session ignore_builtin_innodb=1;
+ERROR HY000: Variable 'ignore_builtin_innodb' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/init_connect_basic.result b/mysql-test/suite/sys_vars/r/init_connect_basic.result
index 58f7a9d2ccd..333a230a4a1 100644
--- a/mysql-test/suite/sys_vars/r/init_connect_basic.result
+++ b/mysql-test/suite/sys_vars/r/init_connect_basic.result
Binary files differ
diff --git a/mysql-test/suite/sys_vars/r/init_file_basic.result b/mysql-test/suite/sys_vars/r/init_file_basic.result
new file mode 100644
index 00000000000..1e13b53d913
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/init_file_basic.result
@@ -0,0 +1,21 @@
+select @@global.init_file;
+@@global.init_file
+NULL
+select @@session.init_file;
+ERROR HY000: Variable 'init_file' is a GLOBAL variable
+show global variables like 'init_file';
+Variable_name Value
+init_file
+show session variables like 'init_file';
+Variable_name Value
+init_file
+select * from information_schema.global_variables where variable_name='init_file';
+VARIABLE_NAME VARIABLE_VALUE
+INIT_FILE
+select * from information_schema.session_variables where variable_name='init_file';
+VARIABLE_NAME VARIABLE_VALUE
+INIT_FILE
+set global init_file=1;
+ERROR HY000: Variable 'init_file' is a read only variable
+set session init_file=1;
+ERROR HY000: Variable 'init_file' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/innodb_autoextend_increment_basic.result b/mysql-test/suite/sys_vars/r/innodb_autoextend_increment_basic.result
index ea87526c42a..1f458a8e1fd 100644
--- a/mysql-test/suite/sys_vars/r/innodb_autoextend_increment_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_autoextend_increment_basic.result
@@ -2,22 +2,22 @@ SET @global_start_value = @@global.innodb_autoextend_increment ;
'#--------------------FN_DYNVARS_046_01------------------------#'
SET @@global.innodb_autoextend_increment = 0;
Warnings:
-Warning 1292 Truncated incorrect autoextend_increment value: '0'
+Warning 1292 Truncated incorrect innodb_autoextend_increment value: '0'
SET @@global.innodb_autoextend_increment = DEFAULT;
SELECT @@global.innodb_autoextend_increment ;
@@global.innodb_autoextend_increment
-64
+8
'#---------------------FN_DYNVARS_046_02-------------------------#'
SET innodb_autoextend_increment = 1;
ERROR HY000: Variable 'innodb_autoextend_increment' is a GLOBAL variable and should be set with SET GLOBAL
SELECT @@innodb_autoextend_increment ;
@@innodb_autoextend_increment
-64
+8
SELECT local.innodb_autoextend_increment ;
ERROR 42S02: Unknown table 'local' in field list
SET global innodb_autoextend_increment = 0;
Warnings:
-Warning 1292 Truncated incorrect autoextend_increment value: '0'
+Warning 1292 Truncated incorrect innodb_autoextend_increment value: '0'
SELECT @@global.innodb_autoextend_increment ;
@@global.innodb_autoextend_increment
1
@@ -33,23 +33,23 @@ SELECT @@global.innodb_autoextend_increment ;
'#--------------------FN_DYNVARS_046_04-------------------------#'
SET @@global.innodb_autoextend_increment = -1;
Warnings:
-Warning 1292 Truncated incorrect autoextend_increment value: '18446744073709551615'
+Warning 1292 Truncated incorrect innodb_autoextend_increment value: '-1'
SELECT @@global.innodb_autoextend_increment;
@@global.innodb_autoextend_increment
-1000
+1
SET @@global.innodb_autoextend_increment = "T";
ERROR 42000: Incorrect argument type to variable 'innodb_autoextend_increment'
SELECT @@global.innodb_autoextend_increment;
@@global.innodb_autoextend_increment
-1000
+1
SET @@global.innodb_autoextend_increment = "Y";
ERROR 42000: Incorrect argument type to variable 'innodb_autoextend_increment'
SELECT @@global.innodb_autoextend_increment;
@@global.innodb_autoextend_increment
-1000
+1
SET @@global.innodb_autoextend_increment = 1001;
Warnings:
-Warning 1292 Truncated incorrect autoextend_increment value: '1001'
+Warning 1292 Truncated incorrect innodb_autoextend_increment value: '1001'
SELECT @@global.innodb_autoextend_increment;
@@global.innodb_autoextend_increment
1000
@@ -85,7 +85,7 @@ SELECT @@global.innodb_autoextend_increment ;
1
SET @@global.innodb_autoextend_increment = FALSE;
Warnings:
-Warning 1292 Truncated incorrect autoextend_increment value: '0'
+Warning 1292 Truncated incorrect innodb_autoextend_increment value: '0'
SELECT @@global.innodb_autoextend_increment ;
@@global.innodb_autoextend_increment
1
diff --git a/mysql-test/suite/sys_vars/r/innodb_commit_concurrency_basic.result b/mysql-test/suite/sys_vars/r/innodb_commit_concurrency_basic.result
index 301016d4362..85a4b008ff0 100644
--- a/mysql-test/suite/sys_vars/r/innodb_commit_concurrency_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_commit_concurrency_basic.result
@@ -25,37 +25,17 @@ SET @@global.innodb_commit_concurrency = 0;
SELECT @@global.innodb_commit_concurrency;
@@global.innodb_commit_concurrency
0
-SET @@global.innodb_commit_concurrency = 1;
-SELECT @@global.innodb_commit_concurrency;
-@@global.innodb_commit_concurrency
-1
-SET @@global.innodb_commit_concurrency = 1000;
-SELECT @@global.innodb_commit_concurrency;
-@@global.innodb_commit_concurrency
-1000
'#--------------------FN_DYNVARS_046_04-------------------------#'
+SET @@global.innodb_commit_concurrency = 1;
+ERROR 42000: Variable 'innodb_commit_concurrency' can't be set to the value of '1'
SET @@global.innodb_commit_concurrency = -1;
-Warnings:
-Warning 1292 Truncated incorrect commit_concurrency value: '18446744073709551615'
-SELECT @@global.innodb_commit_concurrency;
-@@global.innodb_commit_concurrency
-1000
+ERROR 42000: Variable 'innodb_commit_concurrency' can't be set to the value of '-1'
SET @@global.innodb_commit_concurrency = "T";
ERROR 42000: Incorrect argument type to variable 'innodb_commit_concurrency'
-SELECT @@global.innodb_commit_concurrency;
-@@global.innodb_commit_concurrency
-1000
SET @@global.innodb_commit_concurrency = "Y";
ERROR 42000: Incorrect argument type to variable 'innodb_commit_concurrency'
-SELECT @@global.innodb_commit_concurrency;
-@@global.innodb_commit_concurrency
-1000
SET @@global.innodb_commit_concurrency = 1001;
-Warnings:
-Warning 1292 Truncated incorrect commit_concurrency value: '1001'
-SELECT @@global.innodb_commit_concurrency;
-@@global.innodb_commit_concurrency
-1000
+ERROR 42000: Variable 'innodb_commit_concurrency' can't be set to the value of '1001'
'#----------------------FN_DYNVARS_046_05------------------------#'
SELECT @@global.innodb_commit_concurrency =
VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@@ -65,30 +45,21 @@ VARIABLE_VALUE
1
SELECT @@global.innodb_commit_concurrency;
@@global.innodb_commit_concurrency
-1000
+0
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_commit_concurrency';
VARIABLE_VALUE
-1000
+0
'#---------------------FN_DYNVARS_046_06-------------------------#'
SET @@global.innodb_commit_concurrency = OFF;
ERROR 42000: Incorrect argument type to variable 'innodb_commit_concurrency'
SELECT @@global.innodb_commit_concurrency;
@@global.innodb_commit_concurrency
-1000
+0
SET @@global.innodb_commit_concurrency = ON;
ERROR 42000: Incorrect argument type to variable 'innodb_commit_concurrency'
SELECT @@global.innodb_commit_concurrency;
@@global.innodb_commit_concurrency
-1000
-'#---------------------FN_DYNVARS_046_07----------------------#'
-SET @@global.innodb_commit_concurrency = TRUE;
-SELECT @@global.innodb_commit_concurrency;
-@@global.innodb_commit_concurrency
-1
-SET @@global.innodb_commit_concurrency = FALSE;
-SELECT @@global.innodb_commit_concurrency;
-@@global.innodb_commit_concurrency
0
SET @@global.innodb_commit_concurrency = @global_start_value;
SELECT @@global.innodb_commit_concurrency;
diff --git a/mysql-test/suite/sys_vars/r/innodb_concurrency_tickets_basic_64.result b/mysql-test/suite/sys_vars/r/innodb_concurrency_tickets_basic.result
index 40d307d8733..cd27de0cb0b 100644
--- a/mysql-test/suite/sys_vars/r/innodb_concurrency_tickets_basic_64.result
+++ b/mysql-test/suite/sys_vars/r/innodb_concurrency_tickets_basic.result
@@ -5,7 +5,7 @@ SELECT @global_start_value;
'#--------------------FN_DYNVARS_046_01------------------------#'
SET @@global.innodb_concurrency_tickets = 0;
Warnings:
-Warning 1292 Truncated incorrect concurrency_tickets value: '0'
+Warning 1292 Truncated incorrect innodb_concurrency_tickets value: '0'
SET @@global.innodb_concurrency_tickets = DEFAULT;
SELECT @@global.innodb_concurrency_tickets;
@@global.innodb_concurrency_tickets
@@ -20,7 +20,7 @@ SELECT local.innodb_concurrency_tickets;
ERROR 42S02: Unknown table 'local' in field list
SET global innodb_concurrency_tickets = 0;
Warnings:
-Warning 1292 Truncated incorrect concurrency_tickets value: '0'
+Warning 1292 Truncated incorrect innodb_concurrency_tickets value: '0'
SELECT @@global.innodb_concurrency_tickets;
@@global.innodb_concurrency_tickets
1
@@ -39,19 +39,21 @@ SELECT @@global.innodb_concurrency_tickets;
4294967295
'#--------------------FN_DYNVARS_046_04-------------------------#'
SET @@global.innodb_concurrency_tickets = -1;
+Warnings:
+Warning 1292 Truncated incorrect innodb_concurrency_tickets value: '-1'
SELECT @@global.innodb_concurrency_tickets;
@@global.innodb_concurrency_tickets
-18446744073709551615
+1
SET @@global.innodb_concurrency_tickets = "T";
ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets'
SELECT @@global.innodb_concurrency_tickets;
@@global.innodb_concurrency_tickets
-18446744073709551615
+1
SET @@global.innodb_concurrency_tickets = "Y";
ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets'
SELECT @@global.innodb_concurrency_tickets;
@@global.innodb_concurrency_tickets
-18446744073709551615
+1
SET @@global.innodb_concurrency_tickets = 1001;
SELECT @@global.innodb_concurrency_tickets;
@@global.innodb_concurrency_tickets
@@ -88,7 +90,7 @@ SELECT @@global.innodb_concurrency_tickets;
1
SET @@global.innodb_concurrency_tickets = FALSE;
Warnings:
-Warning 1292 Truncated incorrect concurrency_tickets value: '0'
+Warning 1292 Truncated incorrect innodb_concurrency_tickets value: '0'
SELECT @@global.innodb_concurrency_tickets;
@@global.innodb_concurrency_tickets
1
diff --git a/mysql-test/suite/sys_vars/r/innodb_concurrency_tickets_basic_32.result b/mysql-test/suite/sys_vars/r/innodb_concurrency_tickets_basic_32.result
deleted file mode 100644
index 1d1317d0d5e..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_concurrency_tickets_basic_32.result
+++ /dev/null
@@ -1,100 +0,0 @@
-SET @global_start_value = @@global.innodb_concurrency_tickets;
-SELECT @global_start_value;
-@global_start_value
-500
-'#--------------------FN_DYNVARS_046_01------------------------#'
-SET @@global.innodb_concurrency_tickets = 0;
-Warnings:
-Warning 1292 Truncated incorrect concurrency_tickets value: '0'
-SET @@global.innodb_concurrency_tickets = DEFAULT;
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-500
-'#---------------------FN_DYNVARS_046_02-------------------------#'
-SET innodb_concurrency_tickets = 1;
-ERROR HY000: Variable 'innodb_concurrency_tickets' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@innodb_concurrency_tickets;
-@@innodb_concurrency_tickets
-500
-SELECT local.innodb_concurrency_tickets;
-ERROR 42S02: Unknown table 'local' in field list
-SET global innodb_concurrency_tickets = 0;
-Warnings:
-Warning 1292 Truncated incorrect concurrency_tickets value: '0'
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-1
-'#--------------------FN_DYNVARS_046_03------------------------#'
-SET @@global.innodb_concurrency_tickets = 1;
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-1
-SET @@global.innodb_concurrency_tickets = 1000;
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-1000
-SET @@global.innodb_concurrency_tickets = 4294967295;
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-4294967295
-'#--------------------FN_DYNVARS_046_04-------------------------#'
-SET @@global.innodb_concurrency_tickets = -1;
-Warnings:
-Warning 1292 Truncated incorrect concurrency_tickets value: '18446744073709551615'
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-4294967295
-SET @@global.innodb_concurrency_tickets = "T";
-ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets'
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-4294967295
-SET @@global.innodb_concurrency_tickets = "Y";
-ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets'
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-4294967295
-SET @@global.innodb_concurrency_tickets = 1001;
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-1001
-'#----------------------FN_DYNVARS_046_05------------------------#'
-SELECT @@global.innodb_concurrency_tickets =
-VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_concurrency_tickets';
-@@global.innodb_concurrency_tickets =
-VARIABLE_VALUE
-1
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-1001
-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_concurrency_tickets';
-VARIABLE_VALUE
-1001
-'#---------------------FN_DYNVARS_046_06-------------------------#'
-SET @@global.innodb_concurrency_tickets = OFF;
-ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets'
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-1001
-SET @@global.innodb_concurrency_tickets = ON;
-ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets'
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-1001
-'#---------------------FN_DYNVARS_046_07----------------------#'
-SET @@global.innodb_concurrency_tickets = TRUE;
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-1
-SET @@global.innodb_concurrency_tickets = FALSE;
-Warnings:
-Warning 1292 Truncated incorrect concurrency_tickets value: '0'
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-1
-SET @@global.innodb_concurrency_tickets = @global_start_value;
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-500
diff --git a/mysql-test/suite/sys_vars/r/innodb_fast_shutdown_basic.result b/mysql-test/suite/sys_vars/r/innodb_fast_shutdown_basic.result
index 4b923f4bdd2..fe09a652700 100644
--- a/mysql-test/suite/sys_vars/r/innodb_fast_shutdown_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_fast_shutdown_basic.result
@@ -36,55 +36,55 @@ SELECT @@global.innodb_fast_shutdown;
'#--------------------FN_DYNVARS_042_04-------------------------#'
SET @@global.innodb_fast_shutdown = -1;
Warnings:
-Warning 1292 Truncated incorrect fast_shutdown value: '18446744073709551615'
+Warning 1292 Truncated incorrect innodb_fast_shutdown value: '-1'
SELECT @@global.innodb_fast_shutdown;
@@global.innodb_fast_shutdown
-2
+0
SET @@global.innodb_fast_shutdown = TRU;
ERROR 42000: Incorrect argument type to variable 'innodb_fast_shutdown'
SELECT @@global.innodb_fast_shutdown;
@@global.innodb_fast_shutdown
-2
+0
SET @@global.innodb_fast_shutdown = TRUE_F;
ERROR 42000: Incorrect argument type to variable 'innodb_fast_shutdown'
SELECT @@global.innodb_fast_shutdown;
@@global.innodb_fast_shutdown
-2
+0
SET @@global.innodb_fast_shutdown = FALS;
ERROR 42000: Incorrect argument type to variable 'innodb_fast_shutdown'
SELECT @@global.innodb_fast_shutdown;
@@global.innodb_fast_shutdown
-2
+0
SET @@global.innodb_fast_shutdown = OON;
ERROR 42000: Incorrect argument type to variable 'innodb_fast_shutdown'
SELECT @@global.innodb_fast_shutdown;
@@global.innodb_fast_shutdown
-2
+0
SET @@global.innodb_fast_shutdown = ONN;
ERROR 42000: Incorrect argument type to variable 'innodb_fast_shutdown'
SELECT @@global.innodb_fast_shutdown;
@@global.innodb_fast_shutdown
-2
+0
SET @@global.innodb_fast_shutdown = OOFF;
ERROR 42000: Incorrect argument type to variable 'innodb_fast_shutdown'
SELECT @@global.innodb_fast_shutdown;
@@global.innodb_fast_shutdown
-2
+0
SET @@global.innodb_fast_shutdown = 0FF;
ERROR 42000: Incorrect argument type to variable 'innodb_fast_shutdown'
SELECT @@global.innodb_fast_shutdown;
@@global.innodb_fast_shutdown
-2
+0
SET @@global.innodb_fast_shutdown = '1';
ERROR 42000: Incorrect argument type to variable 'innodb_fast_shutdown'
SELECT @@global.innodb_fast_shutdown;
@@global.innodb_fast_shutdown
-2
+0
SET @@global.innodb_fast_shutdown = "0";
ERROR 42000: Incorrect argument type to variable 'innodb_fast_shutdown'
SELECT @@global.innodb_fast_shutdown;
@@global.innodb_fast_shutdown
-2
+0
'#-------------------FN_DYNVARS_042_05----------------------------#'
SET @@session.innodb_fast_shutdown = 0;
ERROR HY000: Variable 'innodb_fast_shutdown' is a GLOBAL variable and should be set with SET GLOBAL
@@ -110,12 +110,12 @@ SET @@global.innodb_fast_shutdown = OFF;
ERROR 42000: Incorrect argument type to variable 'innodb_fast_shutdown'
SELECT @@global.innodb_fast_shutdown;
@@global.innodb_fast_shutdown
-2
+0
SET @@global.innodb_fast_shutdown = ON;
ERROR 42000: Incorrect argument type to variable 'innodb_fast_shutdown'
SELECT @@global.innodb_fast_shutdown;
@@global.innodb_fast_shutdown
-2
+0
'#---------------------FN_DYNVARS_042_09----------------------#'
SET @@global.innodb_fast_shutdown = TRUE;
SELECT @@global.innodb_fast_shutdown;
diff --git a/mysql-test/suite/sys_vars/r/innodb_flush_log_at_trx_commit_basic.result b/mysql-test/suite/sys_vars/r/innodb_flush_log_at_trx_commit_basic.result
index da9f5ad3994..eabafb26ccb 100644
--- a/mysql-test/suite/sys_vars/r/innodb_flush_log_at_trx_commit_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_flush_log_at_trx_commit_basic.result
@@ -36,23 +36,23 @@ SELECT @@global.innodb_flush_log_at_trx_commit;
'#--------------------FN_DYNVARS_046_04-------------------------#'
SET @@global.innodb_flush_log_at_trx_commit = -1;
Warnings:
-Warning 1292 Truncated incorrect flush_log_at_trx_commit value: '18446744073709551615'
+Warning 1292 Truncated incorrect innodb_flush_log_at_trx_commit value: '-1'
SELECT @@global.innodb_flush_log_at_trx_commit;
@@global.innodb_flush_log_at_trx_commit
-2
+0
SET @@global.innodb_flush_log_at_trx_commit = "T";
ERROR 42000: Incorrect argument type to variable 'innodb_flush_log_at_trx_commit'
SELECT @@global.innodb_flush_log_at_trx_commit;
@@global.innodb_flush_log_at_trx_commit
-2
+0
SET @@global.innodb_flush_log_at_trx_commit = "Y";
ERROR 42000: Incorrect argument type to variable 'innodb_flush_log_at_trx_commit'
SELECT @@global.innodb_flush_log_at_trx_commit;
@@global.innodb_flush_log_at_trx_commit
-2
+0
SET @@global.innodb_flush_log_at_trx_commit = 1001;
Warnings:
-Warning 1292 Truncated incorrect flush_log_at_trx_commit value: '1001'
+Warning 1292 Truncated incorrect innodb_flush_log_at_trx_commit value: '1001'
SELECT @@global.innodb_flush_log_at_trx_commit;
@@global.innodb_flush_log_at_trx_commit
2
diff --git a/mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_basic.result b/mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_basic.result
index 8e48957258f..eff72613102 100644
--- a/mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_basic.result
@@ -36,23 +36,23 @@ SELECT @@global.innodb_max_dirty_pages_pct;
'#--------------------FN_DYNVARS_046_04-------------------------#'
SET @@global.innodb_max_dirty_pages_pct = -1;
Warnings:
-Warning 1292 Truncated incorrect max_dirty_pages_pct value: '18446744073709551615'
+Warning 1292 Truncated incorrect innodb_max_dirty_pages_pct value: '-1'
SELECT @@global.innodb_max_dirty_pages_pct;
@@global.innodb_max_dirty_pages_pct
-99
+0
SET @@global.innodb_max_dirty_pages_pct = "T";
ERROR 42000: Incorrect argument type to variable 'innodb_max_dirty_pages_pct'
SELECT @@global.innodb_max_dirty_pages_pct;
@@global.innodb_max_dirty_pages_pct
-99
+0
SET @@global.innodb_max_dirty_pages_pct = "Y";
ERROR 42000: Incorrect argument type to variable 'innodb_max_dirty_pages_pct'
SELECT @@global.innodb_max_dirty_pages_pct;
@@global.innodb_max_dirty_pages_pct
-99
+0
SET @@global.innodb_max_dirty_pages_pct = 1001;
Warnings:
-Warning 1292 Truncated incorrect max_dirty_pages_pct value: '1001'
+Warning 1292 Truncated incorrect innodb_max_dirty_pages_pct value: '1001'
SELECT @@global.innodb_max_dirty_pages_pct;
@@global.innodb_max_dirty_pages_pct
99
diff --git a/mysql-test/suite/sys_vars/r/innodb_max_purge_lag_basic_64.result b/mysql-test/suite/sys_vars/r/innodb_max_purge_lag_basic.result
index a6b669dde83..a01d2f2dd0c 100644
--- a/mysql-test/suite/sys_vars/r/innodb_max_purge_lag_basic_64.result
+++ b/mysql-test/suite/sys_vars/r/innodb_max_purge_lag_basic.result
@@ -35,19 +35,21 @@ SELECT @@global.innodb_max_purge_lag;
4294967295
'#--------------------FN_DYNVARS_046_04-------------------------#'
SET @@global.innodb_max_purge_lag = -1;
+Warnings:
+Warning 1292 Truncated incorrect innodb_max_purge_lag value: '-1'
SELECT @@global.innodb_max_purge_lag;
@@global.innodb_max_purge_lag
-18446744073709551615
+0
SET @@global.innodb_max_purge_lag = "T";
ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag'
SELECT @@global.innodb_max_purge_lag;
@@global.innodb_max_purge_lag
-18446744073709551615
+0
SET @@global.innodb_max_purge_lag = "Y";
ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag'
SELECT @@global.innodb_max_purge_lag;
@@global.innodb_max_purge_lag
-18446744073709551615
+0
SET @@global.innodb_max_purge_lag = 1001;
SELECT @@global.innodb_max_purge_lag;
@@global.innodb_max_purge_lag
diff --git a/mysql-test/suite/sys_vars/r/innodb_max_purge_lag_basic_32.result b/mysql-test/suite/sys_vars/r/innodb_max_purge_lag_basic_32.result
deleted file mode 100644
index ed960f12ff1..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_max_purge_lag_basic_32.result
+++ /dev/null
@@ -1,94 +0,0 @@
-SET @global_start_value = @@global.innodb_max_purge_lag;
-SELECT @global_start_value;
-@global_start_value
-0
-'#--------------------FN_DYNVARS_046_01------------------------#'
-SET @@global.innodb_max_purge_lag = 0;
-SET @@global.innodb_max_purge_lag = DEFAULT;
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-0
-'#---------------------FN_DYNVARS_046_02-------------------------#'
-SET innodb_max_purge_lag = 1;
-ERROR HY000: Variable 'innodb_max_purge_lag' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@innodb_max_purge_lag;
-@@innodb_max_purge_lag
-0
-SELECT local.innodb_max_purge_lag;
-ERROR 42S02: Unknown table 'local' in field list
-SET global innodb_max_purge_lag = 0;
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-0
-'#--------------------FN_DYNVARS_046_03------------------------#'
-SET @@global.innodb_max_purge_lag = 0;
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-0
-SET @@global.innodb_max_purge_lag = 1;
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-1
-SET @@global.innodb_max_purge_lag = 4294967295;
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-4294967295
-'#--------------------FN_DYNVARS_046_04-------------------------#'
-SET @@global.innodb_max_purge_lag = -1;
-Warnings:
-Warning 1292 Truncated incorrect max_purge_lag value: '18446744073709551615'
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-4294967295
-SET @@global.innodb_max_purge_lag = "T";
-ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag'
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-4294967295
-SET @@global.innodb_max_purge_lag = "Y";
-ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag'
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-4294967295
-SET @@global.innodb_max_purge_lag = 1001;
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-1001
-'#----------------------FN_DYNVARS_046_05------------------------#'
-SELECT @@global.innodb_max_purge_lag =
-VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_max_purge_lag';
-@@global.innodb_max_purge_lag =
-VARIABLE_VALUE
-1
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-1001
-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_max_purge_lag';
-VARIABLE_VALUE
-1001
-'#---------------------FN_DYNVARS_046_06-------------------------#'
-SET @@global.innodb_max_purge_lag = OFF;
-ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag'
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-1001
-SET @@global.innodb_max_purge_lag = ON;
-ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag'
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-1001
-'#---------------------FN_DYNVARS_046_07----------------------#'
-SET @@global.innodb_max_purge_lag = TRUE;
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-1
-SET @@global.innodb_max_purge_lag = FALSE;
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-0
-SET @@global.innodb_max_purge_lag = @global_start_value;
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-0
diff --git a/mysql-test/suite/sys_vars/r/innodb_support_xa_basic.result b/mysql-test/suite/sys_vars/r/innodb_support_xa_basic.result
index 96a48d7789f..537fd3e5db1 100644
--- a/mysql-test/suite/sys_vars/r/innodb_support_xa_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_support_xa_basic.result
@@ -55,45 +55,43 @@ SELECT @@global.innodb_support_xa;
1
'#--------------------FN_DYNVARS_046_04-------------------------#'
SET @@session.innodb_support_xa = -0.6;
-ERROR 42000: Variable 'support_xa' can't be set to the value of '-0.6'
+ERROR 42000: Incorrect argument type to variable 'innodb_support_xa'
SET @@session.innodb_support_xa = 1.6;
-ERROR 42000: Variable 'support_xa' can't be set to the value of '1.6'
+ERROR 42000: Incorrect argument type to variable 'innodb_support_xa'
SET @@session.innodb_support_xa = "T";
-ERROR 42000: Variable 'support_xa' can't be set to the value of 'T'
+ERROR 42000: Variable 'innodb_support_xa' can't be set to the value of 'T'
SET @@session.innodb_support_xa = "Y";
-ERROR 42000: Variable 'support_xa' can't be set to the value of 'Y'
+ERROR 42000: Variable 'innodb_support_xa' can't be set to the value of 'Y'
SET @@session.innodb_support_xa = TRÜE;
-ERROR 42000: Variable 'support_xa' can't be set to the value of 'TRÃœE'
+ERROR 42000: Variable 'innodb_support_xa' can't be set to the value of 'TRÜE'
SET @@session.innodb_support_xa = ÕN;
-ERROR 42000: Variable 'support_xa' can't be set to the value of 'ÕN'
+ERROR 42000: Variable 'innodb_support_xa' can't be set to the value of 'ÕN'
SET @@session.innodb_support_xa = OF;
SELECT @@session.innodb_support_xa;
@@session.innodb_support_xa
0
-'Bug# 34828: OF is taken as OFF and a value of 0 is set.'
SET @@session.innodb_support_xa = ÓFF;
-ERROR 42000: Variable 'support_xa' can't be set to the value of 'ÓFF'
+ERROR 42000: Variable 'innodb_support_xa' can't be set to the value of 'ÓFF'
SET @@global.innodb_support_xa = -1;
SELECT @@global.innodb_support_xa;
@@global.innodb_support_xa
1
SET @@global.innodb_support_xa = 2;
-ERROR 42000: Variable 'support_xa' can't be set to the value of '2'
+ERROR 42000: Variable 'innodb_support_xa' can't be set to the value of '2'
SET @@global.innodb_support_xa = "T";
-ERROR 42000: Variable 'support_xa' can't be set to the value of 'T'
+ERROR 42000: Variable 'innodb_support_xa' can't be set to the value of 'T'
SET @@global.innodb_support_xa = "Y";
-ERROR 42000: Variable 'support_xa' can't be set to the value of 'Y'
+ERROR 42000: Variable 'innodb_support_xa' can't be set to the value of 'Y'
SET @@global.innodb_support_xa = TRÜE;
-ERROR 42000: Variable 'support_xa' can't be set to the value of 'TRÃœE'
+ERROR 42000: Variable 'innodb_support_xa' can't be set to the value of 'TRÜE'
SET @@global.innodb_support_xa = ÕN;
-ERROR 42000: Variable 'support_xa' can't be set to the value of 'ÕN'
+ERROR 42000: Variable 'innodb_support_xa' can't be set to the value of 'ÕN'
SET @@global.innodb_support_xa = OF;
SELECT @@global.innodb_support_xa;
@@global.innodb_support_xa
0
-'Bug# 34828 : OF is taken as OFF and a value of 0 is set.'
SET @@global.innodb_support_xa = ÓFF;
-ERROR 42000: Variable 'support_xa' can't be set to the value of 'ÓFF'
+ERROR 42000: Variable 'innodb_support_xa' can't be set to the value of 'ÓFF'
'#-------------------FN_DYNVARS_046_05----------------------------#'
SET @@global.innodb_support_xa = 0;
SET @@session.innodb_support_xa = 1;
diff --git a/mysql-test/suite/sys_vars/r/innodb_sync_spin_loops_basic_64.result b/mysql-test/suite/sys_vars/r/innodb_sync_spin_loops_basic.result
index d40e529485b..ba45d4f2ed0 100644
--- a/mysql-test/suite/sys_vars/r/innodb_sync_spin_loops_basic_64.result
+++ b/mysql-test/suite/sys_vars/r/innodb_sync_spin_loops_basic.result
@@ -35,19 +35,21 @@ SELECT @@global.innodb_sync_spin_loops;
1000
'#--------------------FN_DYNVARS_046_04-------------------------#'
SET @@global.innodb_sync_spin_loops = -1;
+Warnings:
+Warning 1292 Truncated incorrect innodb_sync_spin_loops value: '-1'
SELECT @@global.innodb_sync_spin_loops;
@@global.innodb_sync_spin_loops
-18446744073709551615
+0
SET @@global.innodb_sync_spin_loops = "T";
ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops'
SELECT @@global.innodb_sync_spin_loops;
@@global.innodb_sync_spin_loops
-18446744073709551615
+0
SET @@global.innodb_sync_spin_loops = "Y";
ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops'
SELECT @@global.innodb_sync_spin_loops;
@@global.innodb_sync_spin_loops
-18446744073709551615
+0
SET @@global.innodb_sync_spin_loops = 1001;
SELECT @@global.innodb_sync_spin_loops;
@@global.innodb_sync_spin_loops
diff --git a/mysql-test/suite/sys_vars/r/innodb_sync_spin_loops_basic_32.result b/mysql-test/suite/sys_vars/r/innodb_sync_spin_loops_basic_32.result
deleted file mode 100644
index bde6040aa24..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_sync_spin_loops_basic_32.result
+++ /dev/null
@@ -1,94 +0,0 @@
-SET @global_start_value = @@global.innodb_sync_spin_loops;
-SELECT @global_start_value;
-@global_start_value
-30
-'#--------------------FN_DYNVARS_046_01------------------------#'
-SET @@global.innodb_sync_spin_loops = 0;
-SET @@global.innodb_sync_spin_loops = DEFAULT;
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-30
-'#---------------------FN_DYNVARS_046_02-------------------------#'
-SET innodb_sync_spin_loops = 1;
-ERROR HY000: Variable 'innodb_sync_spin_loops' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@innodb_sync_spin_loops;
-@@innodb_sync_spin_loops
-30
-SELECT local.innodb_sync_spin_loops;
-ERROR 42S02: Unknown table 'local' in field list
-SET global innodb_sync_spin_loops = 0;
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-0
-'#--------------------FN_DYNVARS_046_03------------------------#'
-SET @@global.innodb_sync_spin_loops = 0;
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-0
-SET @@global.innodb_sync_spin_loops = 1;
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-1
-SET @@global.innodb_sync_spin_loops = 1000;
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-1000
-'#--------------------FN_DYNVARS_046_04-------------------------#'
-SET @@global.innodb_sync_spin_loops = -1;
-Warnings:
-Warning 1292 Truncated incorrect sync_spin_loops value: '18446744073709551615'
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-4294967295
-SET @@global.innodb_sync_spin_loops = "T";
-ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops'
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-4294967295
-SET @@global.innodb_sync_spin_loops = "Y";
-ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops'
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-4294967295
-SET @@global.innodb_sync_spin_loops = 1001;
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-1001
-'#----------------------FN_DYNVARS_046_05------------------------#'
-SELECT @@global.innodb_sync_spin_loops =
-VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_sync_spin_loops';
-@@global.innodb_sync_spin_loops =
-VARIABLE_VALUE
-1
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-1001
-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_sync_spin_loops';
-VARIABLE_VALUE
-1001
-'#---------------------FN_DYNVARS_046_06-------------------------#'
-SET @@global.innodb_sync_spin_loops = OFF;
-ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops'
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-1001
-SET @@global.innodb_sync_spin_loops = ON;
-ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops'
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-1001
-'#---------------------FN_DYNVARS_046_07----------------------#'
-SET @@global.innodb_sync_spin_loops = TRUE;
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-1
-SET @@global.innodb_sync_spin_loops = FALSE;
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-0
-SET @@global.innodb_sync_spin_loops = @global_start_value;
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-30
diff --git a/mysql-test/suite/sys_vars/r/innodb_table_locks_basic.result b/mysql-test/suite/sys_vars/r/innodb_table_locks_basic.result
index f2424a3ea27..e77424df871 100644
--- a/mysql-test/suite/sys_vars/r/innodb_table_locks_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_table_locks_basic.result
@@ -56,38 +56,36 @@ SELECT @@global.innodb_table_locks;
'#--------------------FN_DYNVARS_046_04-------------------------#'
SET @@session.innodb_table_locks = -6;
SET @@session.innodb_table_locks = 1.6;
-ERROR 42000: Variable 'table_locks' can't be set to the value of '1.6'
+ERROR 42000: Incorrect argument type to variable 'innodb_table_locks'
SET @@session.innodb_table_locks = "T";
-ERROR 42000: Variable 'table_locks' can't be set to the value of 'T'
+ERROR 42000: Variable 'innodb_table_locks' can't be set to the value of 'T'
SET @@session.innodb_table_locks = "Y";
-ERROR 42000: Variable 'table_locks' can't be set to the value of 'Y'
+ERROR 42000: Variable 'innodb_table_locks' can't be set to the value of 'Y'
SET @@session.innodb_table_locks = TRÜE;
-ERROR 42000: Variable 'table_locks' can't be set to the value of 'TRÃœE'
+ERROR 42000: Variable 'innodb_table_locks' can't be set to the value of 'TRÜE'
SET @@session.innodb_table_locks = ÕN;
-ERROR 42000: Variable 'table_locks' can't be set to the value of 'ÕN'
+ERROR 42000: Variable 'innodb_table_locks' can't be set to the value of 'ÕN'
SET @@session.innodb_table_locks = OF;
SELECT @@session.innodb_table_locks;
@@session.innodb_table_locks
0
-'Bug# 34828: OF is taken as OFF and a value of 0 is set.'
SET @@session.innodb_table_locks = ÓFF;
-ERROR 42000: Variable 'table_locks' can't be set to the value of 'ÓFF'
+ERROR 42000: Variable 'innodb_table_locks' can't be set to the value of 'ÓFF'
SET @@global.innodb_table_locks = -1;
SET @@global.innodb_table_locks = 2;
-ERROR 42000: Variable 'table_locks' can't be set to the value of '2'
+ERROR 42000: Variable 'innodb_table_locks' can't be set to the value of '2'
SET @@global.innodb_table_locks = "T";
-ERROR 42000: Variable 'table_locks' can't be set to the value of 'T'
+ERROR 42000: Variable 'innodb_table_locks' can't be set to the value of 'T'
SET @@global.innodb_table_locks = "Y";
-ERROR 42000: Variable 'table_locks' can't be set to the value of 'Y'
+ERROR 42000: Variable 'innodb_table_locks' can't be set to the value of 'Y'
SET @@global.innodb_table_locks = TRÜE;
-ERROR 42000: Variable 'table_locks' can't be set to the value of 'TRÃœE'
+ERROR 42000: Variable 'innodb_table_locks' can't be set to the value of 'TRÜE'
SET @@global.innodb_table_locks = QN;
-ERROR 42000: Variable 'table_locks' can't be set to the value of 'QN'
+ERROR 42000: Variable 'innodb_table_locks' can't be set to the value of 'QN'
SET @@global.innodb_table_locks = OF;
SELECT @@global.innodb_table_locks;
@@global.innodb_table_locks
0
-'Bug# 34828: OF is taken as OFF and a value of 0 is set.'
'#-------------------FN_DYNVARS_046_05----------------------------#'
SET @@global.innodb_table_locks = 0;
SET @@session.innodb_table_locks = 1;
diff --git a/mysql-test/suite/sys_vars/r/innodb_thread_concurrency_basic.result b/mysql-test/suite/sys_vars/r/innodb_thread_concurrency_basic.result
index b27bbce5b3c..c7af96bb22a 100644
--- a/mysql-test/suite/sys_vars/r/innodb_thread_concurrency_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_thread_concurrency_basic.result
@@ -36,23 +36,23 @@ SELECT @@global.innodb_thread_concurrency;
'#--------------------FN_DYNVARS_046_04-------------------------#'
SET @@global.innodb_thread_concurrency = -1;
Warnings:
-Warning 1292 Truncated incorrect thread_concurrency value: '18446744073709551615'
+Warning 1292 Truncated incorrect innodb_thread_concurrency value: '-1'
SELECT @@global.innodb_thread_concurrency;
@@global.innodb_thread_concurrency
-1000
+0
SET @@global.innodb_thread_concurrency = "T";
ERROR 42000: Incorrect argument type to variable 'innodb_thread_concurrency'
SELECT @@global.innodb_thread_concurrency;
@@global.innodb_thread_concurrency
-1000
+0
SET @@global.innodb_thread_concurrency = "Y";
ERROR 42000: Incorrect argument type to variable 'innodb_thread_concurrency'
SELECT @@global.innodb_thread_concurrency;
@@global.innodb_thread_concurrency
-1000
+0
SET @@global.innodb_thread_concurrency = 1001;
Warnings:
-Warning 1292 Truncated incorrect thread_concurrency value: '1001'
+Warning 1292 Truncated incorrect innodb_thread_concurrency value: '1001'
SELECT @@global.innodb_thread_concurrency;
@@global.innodb_thread_concurrency
1000
diff --git a/mysql-test/suite/sys_vars/r/insert_id_basic.result b/mysql-test/suite/sys_vars/r/insert_id_basic.result
index 47dd759ff44..191bdcc96df 100644
--- a/mysql-test/suite/sys_vars/r/insert_id_basic.result
+++ b/mysql-test/suite/sys_vars/r/insert_id_basic.result
@@ -32,9 +32,11 @@ SELECT @@session.insert_id;
65535
'#--------------------FN_DYNVARS_051_04-------------------------#'
SET @@session.insert_id = -1;
+Warnings:
+Warning 1292 Truncated incorrect insert_id value: '-1'
SELECT @@session.insert_id;
@@session.insert_id
--1
+0
SET @@session.insert_id = 100000000000;
SELECT @@session.insert_id;
@@session.insert_id
@@ -45,14 +47,15 @@ SELECT @@session.insert_id;
@@session.insert_id
100000000000
SET @@session.insert_id = -1024;
+Warnings:
+Warning 1292 Truncated incorrect insert_id value: '-1024'
SELECT @@session.insert_id;
@@session.insert_id
--1024
+0
SET @@session.insert_id = 42949672950;
SELECT @@session.insert_id;
@@session.insert_id
42949672950
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
SET @@session.insert_id = ON;
ERROR 42000: Incorrect argument type to variable 'insert_id'
SELECT @@session.insert_id;
diff --git a/mysql-test/suite/sys_vars/r/interactive_timeout_basic.result b/mysql-test/suite/sys_vars/r/interactive_timeout_basic.result
index 519fef8a6e5..79e90fc24fa 100644
--- a/mysql-test/suite/sys_vars/r/interactive_timeout_basic.result
+++ b/mysql-test/suite/sys_vars/r/interactive_timeout_basic.result
@@ -71,8 +71,8 @@ Warning 1292 Truncated incorrect interactive_timeout value: '1000000000'
SELECT @@global.interactive_timeout;
@@global.interactive_timeout
31536000
-SET @@global.interactive_timeout = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.interactive_timeout = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'interactive_timeout'
SELECT @@global.interactive_timeout;
@@global.interactive_timeout
31536000
@@ -93,15 +93,14 @@ Warning 1292 Truncated incorrect interactive_timeout value: '-2'
SELECT @@session.interactive_timeout;
@@session.interactive_timeout
1
-SET @@session.interactive_timeout = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.interactive_timeout = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'interactive_timeout'
SET @@session.interactive_timeout = 100000000;
Warnings:
Warning 1292 Truncated incorrect interactive_timeout value: '100000000'
SELECT @@session.interactive_timeout;
@@session.interactive_timeout
31536000
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
SET @@session.interactive_timeout = test;
ERROR 42000: Incorrect argument type to variable 'interactive_timeout'
SELECT @@session.interactive_timeout;
diff --git a/mysql-test/suite/sys_vars/r/join_buffer_size_basic_32.result b/mysql-test/suite/sys_vars/r/join_buffer_size_basic_32.result
index 2318c6d7055..af3dd553862 100644
--- a/mysql-test/suite/sys_vars/r/join_buffer_size_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/join_buffer_size_basic_32.result
@@ -7,36 +7,21 @@ SELECT @start_session_value;
@start_session_value
131072
'#--------------------FN_DYNVARS_053_01-------------------------#'
-SET @@global.join_buffer_size = 8200;
-Warnings:
-Warning 1292 Truncated incorrect join_buffer_size value: '8200'
SET @@global.join_buffer_size = DEFAULT;
SELECT @@global.join_buffer_size;
@@global.join_buffer_size
131072
-SET @@session.join_buffer_size = 8200;
-Warnings:
-Warning 1292 Truncated incorrect join_buffer_size value: '8200'
SET @@session.join_buffer_size = DEFAULT;
SELECT @@session.join_buffer_size;
@@session.join_buffer_size
131072
-'#--------------------FN_DYNVARS_053_02-------------------------#'
-SET @@global.join_buffer_size = DEFAULT;
-SELECT @@global.join_buffer_size = 131072;
-@@global.join_buffer_size = 131072
-1
-SET @@session.join_buffer_size = DEFAULT;
-SELECT @@session.join_buffer_size = 131072;
-@@session.join_buffer_size = 131072
-1
'#--------------------FN_DYNVARS_053_03-------------------------#'
SET @@global.join_buffer_size = 8200;
Warnings:
Warning 1292 Truncated incorrect join_buffer_size value: '8200'
-SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
-@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
-1
+SELECT @@global.join_buffer_size;
+@@global.join_buffer_size
+8192
SET @@global.join_buffer_size = 65536;
SELECT @@global.join_buffer_size;
@@global.join_buffer_size
@@ -46,15 +31,14 @@ Warnings:
Warning 1292 Truncated incorrect join_buffer_size value: '4294967295'
SELECT @@global.join_buffer_size;
@@global.join_buffer_size
-4294963200
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
+4294967168
'#--------------------FN_DYNVARS_053_04-------------------------#'
SET @@session.join_buffer_size = 8200;
Warnings:
Warning 1292 Truncated incorrect join_buffer_size value: '8200'
-SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
-@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228
-1
+SELECT @@session.join_buffer_size;
+@@session.join_buffer_size
+8192
SET @@session.join_buffer_size = 65536;
SELECT @@session.join_buffer_size;
@@session.join_buffer_size
@@ -64,78 +48,76 @@ Warnings:
Warning 1292 Truncated incorrect join_buffer_size value: '4294967295'
SELECT @@session.join_buffer_size;
@@session.join_buffer_size
-4294963200
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
+4294967168
'#------------------FN_DYNVARS_053_05-----------------------#'
SET @@global.join_buffer_size = 0;
Warnings:
Warning 1292 Truncated incorrect join_buffer_size value: '0'
-SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
-@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
-1
+SELECT @@global.join_buffer_size;
+@@global.join_buffer_size
+128
SET @@global.join_buffer_size = -1024;
Warnings:
Warning 1292 Truncated incorrect join_buffer_size value: '-1024'
-SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
-@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
-1
-SET @@global.join_buffer_size = 8199;
+SELECT @@global.join_buffer_size;
+@@global.join_buffer_size
+128
+SET @@global.join_buffer_size = 127;
Warnings:
-Warning 1292 Truncated incorrect join_buffer_size value: '8199'
-SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
-@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
-1
+Warning 1292 Truncated incorrect join_buffer_size value: '127'
+SELECT @@global.join_buffer_size;
+@@global.join_buffer_size
+128
SET @@global.join_buffer_size = 42949672951;
Warnings:
Warning 1292 Truncated incorrect join_buffer_size value: '42949672951'
SELECT @@global.join_buffer_size;
@@global.join_buffer_size
-4294963200
-SET @@global.join_buffer_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+4294967168
+SET @@global.join_buffer_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'join_buffer_size'
SELECT @@global.join_buffer_size;
@@global.join_buffer_size
-4294963200
+4294967168
SET @@global.join_buffer_size = test;
ERROR 42000: Incorrect argument type to variable 'join_buffer_size'
SELECT @@global.join_buffer_size;
@@global.join_buffer_size
-4294963200
+4294967168
SET @@session.join_buffer_size = 0;
Warnings:
Warning 1292 Truncated incorrect join_buffer_size value: '0'
-SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
-@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228
-1
-SET @@session.join_buffer_size = -2;
+SELECT @@session.join_buffer_size;
+@@session.join_buffer_size
+128
+SET @@session.join_buffer_size = -1024;
Warnings:
-Warning 1292 Truncated incorrect join_buffer_size value: '-2'
-SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
-@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228
-1
-SET @@session.join_buffer_size = 8199;
+Warning 1292 Truncated incorrect join_buffer_size value: '-1024'
+SELECT @@session.join_buffer_size;
+@@session.join_buffer_size
+128
+SET @@session.join_buffer_size = 127;
Warnings:
-Warning 1292 Truncated incorrect join_buffer_size value: '8199'
-SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
-@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228
-1
+Warning 1292 Truncated incorrect join_buffer_size value: '127'
+SELECT @@session.join_buffer_size;
+@@session.join_buffer_size
+128
SET @@session.join_buffer_size = 42949672951;
Warnings:
Warning 1292 Truncated incorrect join_buffer_size value: '42949672951'
SELECT @@session.join_buffer_size;
@@session.join_buffer_size
-4294963200
-SET @@session.join_buffer_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+4294967168
+SET @@session.join_buffer_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'join_buffer_size'
SELECT @@session.join_buffer_size;
@@session.join_buffer_size
-4294963200
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
+4294967168
SET @@session.join_buffer_size = test;
ERROR 42000: Incorrect argument type to variable 'join_buffer_size'
SELECT @@session.join_buffer_size;
@@session.join_buffer_size
-4294963200
+4294967168
'#------------------FN_DYNVARS_053_06-----------------------#'
SELECT @@global.join_buffer_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@@ -152,16 +134,9 @@ WHERE VARIABLE_NAME='join_buffer_size';
SET @@global.join_buffer_size = TRUE;
Warnings:
Warning 1292 Truncated incorrect join_buffer_size value: '1'
-SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
-@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
-1
SET @@global.join_buffer_size = FALSE;
Warnings:
Warning 1292 Truncated incorrect join_buffer_size value: '0'
-SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
-@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
-1
-'Bug: Errors are not coming on assigning TRUE/FALSE to variable';
'#---------------------FN_DYNVARS_001_09----------------------#'
SET @@global.join_buffer_size = 10;
Warnings:
@@ -183,9 +158,9 @@ SELECT @@local.join_buffer_size = @@session.join_buffer_size;
SET join_buffer_size = 1;
Warnings:
Warning 1292 Truncated incorrect join_buffer_size value: '1'
-SELECT @@join_buffer_size=8200 OR @@join_buffer_size= 8228;
-@@join_buffer_size=8200 OR @@join_buffer_size= 8228
-1
+SELECT @@join_buffer_size;
+@@join_buffer_size
+128
SELECT local.join_buffer_size;
ERROR 42S02: Unknown table 'local' in field list
SELECT session.join_buffer_size;
diff --git a/mysql-test/suite/sys_vars/r/join_buffer_size_basic_64.result b/mysql-test/suite/sys_vars/r/join_buffer_size_basic_64.result
index 4811d4732df..fda265910f9 100644
--- a/mysql-test/suite/sys_vars/r/join_buffer_size_basic_64.result
+++ b/mysql-test/suite/sys_vars/r/join_buffer_size_basic_64.result
@@ -7,127 +7,117 @@ SELECT @start_session_value;
@start_session_value
131072
'#--------------------FN_DYNVARS_053_01-------------------------#'
-SET @@global.join_buffer_size = 8200;
-Warnings:
-Warning 1292 Truncated incorrect join_buffer_size value: '8200'
SET @@global.join_buffer_size = DEFAULT;
SELECT @@global.join_buffer_size;
@@global.join_buffer_size
131072
-SET @@session.join_buffer_size = 8200;
-Warnings:
-Warning 1292 Truncated incorrect join_buffer_size value: '8200'
SET @@session.join_buffer_size = DEFAULT;
SELECT @@session.join_buffer_size;
@@session.join_buffer_size
131072
-'#--------------------FN_DYNVARS_053_02-------------------------#'
-SET @@global.join_buffer_size = DEFAULT;
-SELECT @@global.join_buffer_size = 131072;
-@@global.join_buffer_size = 131072
-1
-SET @@session.join_buffer_size = DEFAULT;
-SELECT @@session.join_buffer_size = 131072;
-@@session.join_buffer_size = 131072
-1
'#--------------------FN_DYNVARS_053_03-------------------------#'
SET @@global.join_buffer_size = 8200;
Warnings:
Warning 1292 Truncated incorrect join_buffer_size value: '8200'
-SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
-@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
-1
+SELECT @@global.join_buffer_size;
+@@global.join_buffer_size
+8192
SET @@global.join_buffer_size = 65536;
SELECT @@global.join_buffer_size;
@@global.join_buffer_size
65536
SET @@global.join_buffer_size = 4294967295;
+Warnings:
+Warning 1292 Truncated incorrect join_buffer_size value: '4294967295'
SELECT @@global.join_buffer_size;
@@global.join_buffer_size
-4294963200
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
+4294967168
'#--------------------FN_DYNVARS_053_04-------------------------#'
SET @@session.join_buffer_size = 8200;
Warnings:
Warning 1292 Truncated incorrect join_buffer_size value: '8200'
-SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
-@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228
-1
+SELECT @@session.join_buffer_size;
+@@session.join_buffer_size
+8192
SET @@session.join_buffer_size = 65536;
SELECT @@session.join_buffer_size;
@@session.join_buffer_size
65536
SET @@session.join_buffer_size = 4294967295;
+Warnings:
+Warning 1292 Truncated incorrect join_buffer_size value: '4294967295'
SELECT @@session.join_buffer_size;
@@session.join_buffer_size
-4294963200
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
+4294967168
'#------------------FN_DYNVARS_053_05-----------------------#'
SET @@global.join_buffer_size = 0;
Warnings:
Warning 1292 Truncated incorrect join_buffer_size value: '0'
-SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
-@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
-1
+SELECT @@global.join_buffer_size;
+@@global.join_buffer_size
+128
SET @@global.join_buffer_size = -1024;
Warnings:
Warning 1292 Truncated incorrect join_buffer_size value: '-1024'
-SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
-@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
-1
-SET @@global.join_buffer_size = 8199;
+SELECT @@global.join_buffer_size;
+@@global.join_buffer_size
+128
+SET @@global.join_buffer_size = 127;
Warnings:
-Warning 1292 Truncated incorrect join_buffer_size value: '8199'
-SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
-@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
-1
+Warning 1292 Truncated incorrect join_buffer_size value: '127'
+SELECT @@global.join_buffer_size;
+@@global.join_buffer_size
+128
SET @@global.join_buffer_size = 42949672951;
+Warnings:
+Warning 1292 Truncated incorrect join_buffer_size value: '42949672951'
SELECT @@global.join_buffer_size;
@@global.join_buffer_size
-42949668864
-SET @@global.join_buffer_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+42949672832
+SET @@global.join_buffer_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'join_buffer_size'
SELECT @@global.join_buffer_size;
@@global.join_buffer_size
-42949668864
+42949672832
SET @@global.join_buffer_size = test;
ERROR 42000: Incorrect argument type to variable 'join_buffer_size'
SELECT @@global.join_buffer_size;
@@global.join_buffer_size
-42949668864
+42949672832
SET @@session.join_buffer_size = 0;
Warnings:
Warning 1292 Truncated incorrect join_buffer_size value: '0'
-SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
-@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228
-1
-SET @@session.join_buffer_size = -2;
+SELECT @@session.join_buffer_size;
+@@session.join_buffer_size
+128
+SET @@session.join_buffer_size = -1024;
Warnings:
-Warning 1292 Truncated incorrect join_buffer_size value: '-2'
-SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
-@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228
-1
-SET @@session.join_buffer_size = 8199;
+Warning 1292 Truncated incorrect join_buffer_size value: '-1024'
+SELECT @@session.join_buffer_size;
+@@session.join_buffer_size
+128
+SET @@session.join_buffer_size = 127;
Warnings:
-Warning 1292 Truncated incorrect join_buffer_size value: '8199'
-SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
-@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228
-1
+Warning 1292 Truncated incorrect join_buffer_size value: '127'
+SELECT @@session.join_buffer_size;
+@@session.join_buffer_size
+128
SET @@session.join_buffer_size = 42949672951;
+Warnings:
+Warning 1292 Truncated incorrect join_buffer_size value: '42949672951'
SELECT @@session.join_buffer_size;
@@session.join_buffer_size
-42949668864
-SET @@session.join_buffer_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+42949672832
+SET @@session.join_buffer_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'join_buffer_size'
SELECT @@session.join_buffer_size;
@@session.join_buffer_size
-42949668864
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
+42949672832
SET @@session.join_buffer_size = test;
ERROR 42000: Incorrect argument type to variable 'join_buffer_size'
SELECT @@session.join_buffer_size;
@@session.join_buffer_size
-42949668864
+42949672832
'#------------------FN_DYNVARS_053_06-----------------------#'
SELECT @@global.join_buffer_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@@ -144,16 +134,9 @@ WHERE VARIABLE_NAME='join_buffer_size';
SET @@global.join_buffer_size = TRUE;
Warnings:
Warning 1292 Truncated incorrect join_buffer_size value: '1'
-SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
-@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
-1
SET @@global.join_buffer_size = FALSE;
Warnings:
Warning 1292 Truncated incorrect join_buffer_size value: '0'
-SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
-@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
-1
-'Bug: Errors are not coming on assigning TRUE/FALSE to variable';
'#---------------------FN_DYNVARS_001_09----------------------#'
SET @@global.join_buffer_size = 10;
Warnings:
@@ -175,9 +158,9 @@ SELECT @@local.join_buffer_size = @@session.join_buffer_size;
SET join_buffer_size = 1;
Warnings:
Warning 1292 Truncated incorrect join_buffer_size value: '1'
-SELECT @@join_buffer_size=8200 OR @@join_buffer_size= 8228;
-@@join_buffer_size=8200 OR @@join_buffer_size= 8228
-1
+SELECT @@join_buffer_size;
+@@join_buffer_size
+128
SELECT local.join_buffer_size;
ERROR 42S02: Unknown table 'local' in field list
SELECT session.join_buffer_size;
diff --git a/mysql-test/suite/sys_vars/r/keep_files_on_create_basic.result b/mysql-test/suite/sys_vars/r/keep_files_on_create_basic.result
index 696ac5cc279..b7deea88a9c 100644
--- a/mysql-test/suite/sys_vars/r/keep_files_on_create_basic.result
+++ b/mysql-test/suite/sys_vars/r/keep_files_on_create_basic.result
@@ -94,7 +94,7 @@ ERROR 42000: Variable 'keep_files_on_create' can't be set to the value of '-1024
SET @@global.keep_files_on_create = 65536;
ERROR 42000: Variable 'keep_files_on_create' can't be set to the value of '65536'
SET @@global.keep_files_on_create = 65530.34;
-ERROR 42000: Variable 'keep_files_on_create' can't be set to the value of '65530'
+ERROR 42000: Incorrect argument type to variable 'keep_files_on_create'
SET @@global.keep_files_on_create = test;
ERROR 42000: Variable 'keep_files_on_create' can't be set to the value of 'test'
SET @@session.keep_files_on_create = ONN;
@@ -102,16 +102,13 @@ ERROR 42000: Variable 'keep_files_on_create' can't be set to the value of 'ONN'
SET @@session.keep_files_on_create = ONF;
ERROR 42000: Variable 'keep_files_on_create' can't be set to the value of 'ONF'
SET @@session.keep_files_on_create = OF;
-SELECT @@session.keep_files_on_create;
-@@session.keep_files_on_create
-0
-'Bug# 34828: FN_DYNVARS_054_05 - OF is also working as OFF and no error is coming';
+ERROR 42000: Variable 'keep_files_on_create' can't be set to the value of 'OF'
SET @@session.keep_files_on_create = 'OFN';
ERROR 42000: Variable 'keep_files_on_create' can't be set to the value of 'OFN'
SET @@session.keep_files_on_create = -2;
ERROR 42000: Variable 'keep_files_on_create' can't be set to the value of '-2'
-SET @@session.keep_files_on_create = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.keep_files_on_create = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'keep_files_on_create'
SET @@session.keep_files_on_create = 65550;
ERROR 42000: Variable 'keep_files_on_create' can't be set to the value of '65550'
SET @@session.keep_files_on_create = test;
diff --git a/mysql-test/suite/sys_vars/r/key_buffer_size_basic_32.result b/mysql-test/suite/sys_vars/r/key_buffer_size_basic.result
index eea782701bb..4612b5c7324 100644
--- a/mysql-test/suite/sys_vars/r/key_buffer_size_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/key_buffer_size_basic.result
@@ -1,57 +1,44 @@
SET @start_value = @@global.key_buffer_size;
'#--------------------FN_DYNVARS_055_01------------------------#'
-SET @@global.key_buffer_size = 99;
SET @@global.key_buffer_size = DEFAULT;
-ERROR 42000: Variable 'key_buffer_size' doesn't have a default value
-SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
-@@global.key_buffer_size BETWEEN 8 AND 36
-1
+SELECT @@global.key_buffer_size;
+@@global.key_buffer_size
+8388608
'#---------------------FN_DYNVARS_055_02-------------------------#'
SET @@global.key_buffer_size = @start_value;
SELECT @@global.key_buffer_size = @start_value;
@@global.key_buffer_size = @start_value
1
'#--------------------FN_DYNVARS_055_03------------------------#'
-SET @@global.key_buffer_size = 8 ;
-SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
-@@global.key_buffer_size BETWEEN 8 AND 36
-1
-SET @@global.key_buffer_size = 1800;
-SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
-@@global.key_buffer_size BETWEEN 8 AND 36
-1
SET @@global.key_buffer_size = 65535;
+Warnings:
+Warning 1292 Truncated incorrect key_buffer_size value: '65535'
SELECT @@global.key_buffer_size;
@@global.key_buffer_size
61440
'#--------------------FN_DYNVARS_055_04-------------------------#'
+SET @@global.key_buffer_size = -1;
+ERROR HY000: Cannot drop default keycache
+SET @@global.key_buffer_size = 4;
+ERROR HY000: Cannot drop default keycache
SET @@global.key_buffer_size = 10000.01;
ERROR 42000: Incorrect argument type to variable 'key_buffer_size'
SELECT @@global.key_buffer_size;
@@global.key_buffer_size
61440
-SET @@global.key_buffer_size = 4;
-Warnings:
-Warning 1292 Truncated incorrect key_buffer_size value: '4'
-SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
-@@global.key_buffer_size BETWEEN 8 AND 36
-1
SET @@global.key_buffer_size = ON;
ERROR 42000: Incorrect argument type to variable 'key_buffer_size'
-SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
-@@global.key_buffer_size BETWEEN 8 AND 36
-1
+SELECT @@global.key_buffer_size;
+@@global.key_buffer_size
+61440
SET @@global.key_buffer_size = 'test';
ERROR 42000: Incorrect argument type to variable 'key_buffer_size'
-SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
-@@global.key_buffer_size BETWEEN 8 AND 36
-1
+SELECT @@global.key_buffer_size;
+@@global.key_buffer_size
+61440
'#-------------------FN_DYNVARS_055_05----------------------------#'
SET @@session.key_buffer_size = 0;
ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
-@@global.key_buffer_size BETWEEN 8 AND 36
-1
'#----------------------FN_DYNVARS_055_06------------------------#'
SELECT @@global.key_buffer_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@@ -65,28 +52,16 @@ WHERE VARIABLE_NAME='key_buffer_size';
1
'#---------------------FN_DYNVARS_055_07----------------------#'
SET @@global.key_buffer_size = TRUE;
-Warnings:
-Warning 1292 Truncated incorrect key_buffer_size value: '1'
-SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
-@@global.key_buffer_size BETWEEN 8 AND 36
-1
+ERROR HY000: Cannot drop default keycache
SET @@global.key_buffer_size = FALSE;
-Warnings:
-Warning 1438 Cannot drop default keycache
-SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
-@@global.key_buffer_size BETWEEN 8 AND 36
-1
+ERROR HY000: Cannot drop default keycache
'#---------------------FN_DYNVARS_055_08----------------------#'
-SET @@global.key_buffer_size = 8 ;
SELECT @@key_buffer_size = @@global.key_buffer_size;
@@key_buffer_size = @@global.key_buffer_size
1
'#---------------------FN_DYNVARS_055_09----------------------#'
SET key_buffer_size = 8 ;
ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
-@@global.key_buffer_size BETWEEN 8 AND 36
-1
SET local.key_buffer_size = 10;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size = 10' at line 1
SELECT local.key_buffer_size;
diff --git a/mysql-test/suite/sys_vars/r/key_buffer_size_basic_64.result b/mysql-test/suite/sys_vars/r/key_buffer_size_basic_64.result
deleted file mode 100644
index eea782701bb..00000000000
--- a/mysql-test/suite/sys_vars/r/key_buffer_size_basic_64.result
+++ /dev/null
@@ -1,100 +0,0 @@
-SET @start_value = @@global.key_buffer_size;
-'#--------------------FN_DYNVARS_055_01------------------------#'
-SET @@global.key_buffer_size = 99;
-SET @@global.key_buffer_size = DEFAULT;
-ERROR 42000: Variable 'key_buffer_size' doesn't have a default value
-SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
-@@global.key_buffer_size BETWEEN 8 AND 36
-1
-'#---------------------FN_DYNVARS_055_02-------------------------#'
-SET @@global.key_buffer_size = @start_value;
-SELECT @@global.key_buffer_size = @start_value;
-@@global.key_buffer_size = @start_value
-1
-'#--------------------FN_DYNVARS_055_03------------------------#'
-SET @@global.key_buffer_size = 8 ;
-SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
-@@global.key_buffer_size BETWEEN 8 AND 36
-1
-SET @@global.key_buffer_size = 1800;
-SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
-@@global.key_buffer_size BETWEEN 8 AND 36
-1
-SET @@global.key_buffer_size = 65535;
-SELECT @@global.key_buffer_size;
-@@global.key_buffer_size
-61440
-'#--------------------FN_DYNVARS_055_04-------------------------#'
-SET @@global.key_buffer_size = 10000.01;
-ERROR 42000: Incorrect argument type to variable 'key_buffer_size'
-SELECT @@global.key_buffer_size;
-@@global.key_buffer_size
-61440
-SET @@global.key_buffer_size = 4;
-Warnings:
-Warning 1292 Truncated incorrect key_buffer_size value: '4'
-SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
-@@global.key_buffer_size BETWEEN 8 AND 36
-1
-SET @@global.key_buffer_size = ON;
-ERROR 42000: Incorrect argument type to variable 'key_buffer_size'
-SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
-@@global.key_buffer_size BETWEEN 8 AND 36
-1
-SET @@global.key_buffer_size = 'test';
-ERROR 42000: Incorrect argument type to variable 'key_buffer_size'
-SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
-@@global.key_buffer_size BETWEEN 8 AND 36
-1
-'#-------------------FN_DYNVARS_055_05----------------------------#'
-SET @@session.key_buffer_size = 0;
-ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
-@@global.key_buffer_size BETWEEN 8 AND 36
-1
-'#----------------------FN_DYNVARS_055_06------------------------#'
-SELECT @@global.key_buffer_size = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='key_buffer_size';
-@@global.key_buffer_size = VARIABLE_VALUE
-1
-SELECT @@key_buffer_size = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='key_buffer_size';
-@@key_buffer_size = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_055_07----------------------#'
-SET @@global.key_buffer_size = TRUE;
-Warnings:
-Warning 1292 Truncated incorrect key_buffer_size value: '1'
-SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
-@@global.key_buffer_size BETWEEN 8 AND 36
-1
-SET @@global.key_buffer_size = FALSE;
-Warnings:
-Warning 1438 Cannot drop default keycache
-SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
-@@global.key_buffer_size BETWEEN 8 AND 36
-1
-'#---------------------FN_DYNVARS_055_08----------------------#'
-SET @@global.key_buffer_size = 8 ;
-SELECT @@key_buffer_size = @@global.key_buffer_size;
-@@key_buffer_size = @@global.key_buffer_size
-1
-'#---------------------FN_DYNVARS_055_09----------------------#'
-SET key_buffer_size = 8 ;
-ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@global.key_buffer_size BETWEEN 8 AND 36;
-@@global.key_buffer_size BETWEEN 8 AND 36
-1
-SET local.key_buffer_size = 10;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size = 10' at line 1
-SELECT local.key_buffer_size;
-ERROR 42S02: Unknown table 'local' in field list
-SET global.key_buffer_size = 10;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size = 10' at line 1
-SELECT global.key_buffer_size;
-ERROR 42S02: Unknown table 'global' in field list
-SELECT key_buffer_size = @@session.key_buffer_size;
-ERROR 42S22: Unknown column 'key_buffer_size' in 'field list'
-SET @@global.key_buffer_size = @start_value;
diff --git a/mysql-test/suite/sys_vars/r/key_buffer_size_func.result b/mysql-test/suite/sys_vars/r/key_buffer_size_func.result
index d5b79c260a0..a10be0ab832 100644
--- a/mysql-test/suite/sys_vars/r/key_buffer_size_func.result
+++ b/mysql-test/suite/sys_vars/r/key_buffer_size_func.result
@@ -38,7 +38,6 @@ Key_reads 0
show status like 'Key_reads';
Variable_name Value
Key_reads 0
-SET @@global.key_buffer_size = 36;
## Connecting with connection test_con1 ##
## Inserting some rows in table ##
INSERT INTO t1(rollno, name) VALUES(5, 'Record_11');
@@ -54,7 +53,7 @@ INSERT INTO t1(rollno, name) VALUES(8, 'Record_20');
## Key_reads must be zero (no disk access) ##
show status like 'Key_reads';
Variable_name Value
-Key_reads 10
+Key_reads 0
## Dropping table ##
DROP TABLE IF EXISTS t1;
## Disconnecting both the connections ##
diff --git a/mysql-test/suite/sys_vars/r/key_cache_age_threshold_basic_32.result b/mysql-test/suite/sys_vars/r/key_cache_age_threshold_basic_32.result
index c79e7beb198..9df9f56bd1f 100644
--- a/mysql-test/suite/sys_vars/r/key_cache_age_threshold_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/key_cache_age_threshold_basic_32.result
@@ -3,15 +3,10 @@ SELECT @start_value;
@start_value
300
'#--------------------FN_DYNVARS_056_01------------------------#'
-SET @@global.key_cache_age_threshold = 99;
-Warnings:
-Warning 1292 Truncated incorrect key_cache_age_threshold value: '99'
SET @@global.key_cache_age_threshold = DEFAULT;
-ERROR 42000: Variable 'key_cache_age_threshold' doesn't have a default value
-'Bug# 34878: This variable has default value according to documentation';
SELECT @@global.key_cache_age_threshold;
@@global.key_cache_age_threshold
-100
+300
'#---------------------FN_DYNVARS_056_02-------------------------#'
SET @@global.key_cache_age_threshold = @start_value;
SELECT @@global.key_cache_age_threshold = 300;
@@ -23,6 +18,8 @@ SELECT @@global.key_cache_age_threshold;
@@global.key_cache_age_threshold
100
SET @@global.key_cache_age_threshold = 4294967295;
+Warnings:
+Warning 1292 Truncated incorrect key_cache_age_threshold value: '4294967295'
SELECT @@global.key_cache_age_threshold;
@@global.key_cache_age_threshold
4294967200
@@ -31,17 +28,18 @@ SELECT @@global.key_cache_age_threshold;
@@global.key_cache_age_threshold
1800
SET @@global.key_cache_age_threshold = 65535;
+Warnings:
+Warning 1292 Truncated incorrect key_cache_age_threshold value: '65535'
SELECT @@global.key_cache_age_threshold;
@@global.key_cache_age_threshold
65500
-'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming';
'#--------------------FN_DYNVARS_056_04-------------------------#'
SET @@global.key_cache_age_threshold = -1;
Warnings:
-Warning 1292 Truncated incorrect key_cache_age_threshold value: '18446744073709551615'
+Warning 1292 Truncated incorrect key_cache_age_threshold value: '-1'
SELECT @@global.key_cache_age_threshold;
@@global.key_cache_age_threshold
-4294967200
+100
SET @@global.key_cache_age_threshold = 42949672951;
Warnings:
Warning 1292 Truncated incorrect key_cache_age_threshold value: '42949672951'
@@ -55,17 +53,16 @@ SELECT @@global.key_cache_age_threshold;
4294967200
SET @@global.key_cache_age_threshold = -1024;
Warnings:
-Warning 1292 Truncated incorrect key_cache_age_threshold value: '18446744073709550592'
+Warning 1292 Truncated incorrect key_cache_age_threshold value: '-1024'
SELECT @@global.key_cache_age_threshold;
@@global.key_cache_age_threshold
-4294967200
+100
SET @@global.key_cache_age_threshold = 99;
Warnings:
Warning 1292 Truncated incorrect key_cache_age_threshold value: '99'
SELECT @@global.key_cache_age_threshold;
@@global.key_cache_age_threshold
100
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
SET @@global.key_cache_age_threshold = ON;
ERROR 42000: Incorrect argument type to variable 'key_cache_age_threshold'
SELECT @@global.key_cache_age_threshold;
@@ -107,6 +104,8 @@ SELECT @@global.key_cache_age_threshold;
100
'#---------------------FN_DYNVARS_056_08----------------------#'
SET @@global.key_cache_age_threshold = 101;
+Warnings:
+Warning 1292 Truncated incorrect key_cache_age_threshold value: '101'
SELECT @@key_cache_age_threshold = @@global.key_cache_age_threshold;
@@key_cache_age_threshold = @@global.key_cache_age_threshold
1
diff --git a/mysql-test/suite/sys_vars/r/key_cache_age_threshold_basic_64.result b/mysql-test/suite/sys_vars/r/key_cache_age_threshold_basic_64.result
index 5e05dd7bacf..5e0222e8968 100644
--- a/mysql-test/suite/sys_vars/r/key_cache_age_threshold_basic_64.result
+++ b/mysql-test/suite/sys_vars/r/key_cache_age_threshold_basic_64.result
@@ -3,15 +3,10 @@ SELECT @start_value;
@start_value
300
'#--------------------FN_DYNVARS_056_01------------------------#'
-SET @@global.key_cache_age_threshold = 99;
-Warnings:
-Warning 1292 Truncated incorrect key_cache_age_threshold value: '99'
SET @@global.key_cache_age_threshold = DEFAULT;
-ERROR 42000: Variable 'key_cache_age_threshold' doesn't have a default value
-'Bug# 34878: This variable has default value according to documentation';
SELECT @@global.key_cache_age_threshold;
@@global.key_cache_age_threshold
-100
+300
'#---------------------FN_DYNVARS_056_02-------------------------#'
SET @@global.key_cache_age_threshold = @start_value;
SELECT @@global.key_cache_age_threshold = 300;
@@ -23,6 +18,8 @@ SELECT @@global.key_cache_age_threshold;
@@global.key_cache_age_threshold
100
SET @@global.key_cache_age_threshold = 4294967295;
+Warnings:
+Warning 1292 Truncated incorrect key_cache_age_threshold value: '4294967295'
SELECT @@global.key_cache_age_threshold;
@@global.key_cache_age_threshold
4294967200
@@ -31,16 +28,21 @@ SELECT @@global.key_cache_age_threshold;
@@global.key_cache_age_threshold
1800
SET @@global.key_cache_age_threshold = 65535;
+Warnings:
+Warning 1292 Truncated incorrect key_cache_age_threshold value: '65535'
SELECT @@global.key_cache_age_threshold;
@@global.key_cache_age_threshold
65500
-'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming';
'#--------------------FN_DYNVARS_056_04-------------------------#'
SET @@global.key_cache_age_threshold = -1;
+Warnings:
+Warning 1292 Truncated incorrect key_cache_age_threshold value: '-1'
SELECT @@global.key_cache_age_threshold;
@@global.key_cache_age_threshold
-18446744073709551600
+100
SET @@global.key_cache_age_threshold = 42949672951;
+Warnings:
+Warning 1292 Truncated incorrect key_cache_age_threshold value: '42949672951'
SELECT @@global.key_cache_age_threshold;
@@global.key_cache_age_threshold
42949672900
@@ -50,16 +52,17 @@ SELECT @@global.key_cache_age_threshold;
@@global.key_cache_age_threshold
42949672900
SET @@global.key_cache_age_threshold = -1024;
+Warnings:
+Warning 1292 Truncated incorrect key_cache_age_threshold value: '-1024'
SELECT @@global.key_cache_age_threshold;
@@global.key_cache_age_threshold
-18446744073709550500
+100
SET @@global.key_cache_age_threshold = 99;
Warnings:
Warning 1292 Truncated incorrect key_cache_age_threshold value: '99'
SELECT @@global.key_cache_age_threshold;
@@global.key_cache_age_threshold
100
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
SET @@global.key_cache_age_threshold = ON;
ERROR 42000: Incorrect argument type to variable 'key_cache_age_threshold'
SELECT @@global.key_cache_age_threshold;
@@ -101,6 +104,8 @@ SELECT @@global.key_cache_age_threshold;
100
'#---------------------FN_DYNVARS_056_08----------------------#'
SET @@global.key_cache_age_threshold = 101;
+Warnings:
+Warning 1292 Truncated incorrect key_cache_age_threshold value: '101'
SELECT @@key_cache_age_threshold = @@global.key_cache_age_threshold;
@@key_cache_age_threshold = @@global.key_cache_age_threshold
1
diff --git a/mysql-test/suite/sys_vars/r/key_cache_block_size_basic_64.result b/mysql-test/suite/sys_vars/r/key_cache_block_size_basic.result
index 46ce1f26b29..00ba39558af 100644
--- a/mysql-test/suite/sys_vars/r/key_cache_block_size_basic_64.result
+++ b/mysql-test/suite/sys_vars/r/key_cache_block_size_basic.result
@@ -3,13 +3,10 @@ SELECT @start_value;
@start_value
1024
'#--------------------FN_DYNVARS_057_01------------------------#'
-SET @@global.key_cache_block_size = 600;
SET @@global.key_cache_block_size = DEFAULT;
-ERROR 42000: Variable 'key_cache_block_size' doesn't have a default value
-'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming';
SELECT @@global.key_cache_block_size;
@@global.key_cache_block_size
-512
+1024
'#---------------------FN_DYNVARS_057_02-------------------------#'
SET @@global.key_cache_block_size = @start_value;
SELECT @@global.key_cache_block_size = 1024;
@@ -25,21 +22,24 @@ SELECT @@global.key_cache_block_size;
@@global.key_cache_block_size
16384
SET @@global.key_cache_block_size = 1800;
+Warnings:
+Warning 1292 Truncated incorrect key_cache_block_size value: '1800'
SELECT @@global.key_cache_block_size;
@@global.key_cache_block_size
1536
SET @@global.key_cache_block_size = 16383;
+Warnings:
+Warning 1292 Truncated incorrect key_cache_block_size value: '16383'
SELECT @@global.key_cache_block_size;
@@global.key_cache_block_size
15872
-'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming';
'#--------------------FN_DYNVARS_057_04-------------------------#'
SET @@global.key_cache_block_size = -1;
Warnings:
-Warning 1292 Truncated incorrect key_cache_block_size value: '18446744073709551615'
+Warning 1292 Truncated incorrect key_cache_block_size value: '-1'
SELECT @@global.key_cache_block_size;
@@global.key_cache_block_size
-16384
+512
SET @@global.key_cache_block_size = 42949672951;
Warnings:
Warning 1292 Truncated incorrect key_cache_block_size value: '42949672951'
@@ -53,10 +53,10 @@ SELECT @@global.key_cache_block_size;
16384
SET @@global.key_cache_block_size = -1024;
Warnings:
-Warning 1292 Truncated incorrect key_cache_block_size value: '18446744073709550592'
+Warning 1292 Truncated incorrect key_cache_block_size value: '-1024'
SELECT @@global.key_cache_block_size;
@@global.key_cache_block_size
-16384
+512
SET @@global.key_cache_block_size = 256;
Warnings:
Warning 1292 Truncated incorrect key_cache_block_size value: '256'
@@ -75,7 +75,6 @@ Warning 1292 Truncated incorrect key_cache_block_size value: '16385'
SELECT @@global.key_cache_block_size;
@@global.key_cache_block_size
16384
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
SET @@global.key_cache_block_size = ON;
ERROR 42000: Incorrect argument type to variable 'key_cache_block_size'
SELECT @@global.key_cache_block_size;
diff --git a/mysql-test/suite/sys_vars/r/key_cache_block_size_basic_32.result b/mysql-test/suite/sys_vars/r/key_cache_block_size_basic_32.result
deleted file mode 100644
index 46ce1f26b29..00000000000
--- a/mysql-test/suite/sys_vars/r/key_cache_block_size_basic_32.result
+++ /dev/null
@@ -1,142 +0,0 @@
-SET @start_value = @@global.key_cache_block_size;
-SELECT @start_value;
-@start_value
-1024
-'#--------------------FN_DYNVARS_057_01------------------------#'
-SET @@global.key_cache_block_size = 600;
-SET @@global.key_cache_block_size = DEFAULT;
-ERROR 42000: Variable 'key_cache_block_size' doesn't have a default value
-'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming';
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-512
-'#---------------------FN_DYNVARS_057_02-------------------------#'
-SET @@global.key_cache_block_size = @start_value;
-SELECT @@global.key_cache_block_size = 1024;
-@@global.key_cache_block_size = 1024
-1
-'#--------------------FN_DYNVARS_057_03------------------------#'
-SET @@global.key_cache_block_size = 1024;
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-1024
-SET @@global.key_cache_block_size = 16384;
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-16384
-SET @@global.key_cache_block_size = 1800;
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-1536
-SET @@global.key_cache_block_size = 16383;
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-15872
-'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming';
-'#--------------------FN_DYNVARS_057_04-------------------------#'
-SET @@global.key_cache_block_size = -1;
-Warnings:
-Warning 1292 Truncated incorrect key_cache_block_size value: '18446744073709551615'
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-16384
-SET @@global.key_cache_block_size = 42949672951;
-Warnings:
-Warning 1292 Truncated incorrect key_cache_block_size value: '42949672951'
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-16384
-SET @@global.key_cache_block_size = 10000.01;
-ERROR 42000: Incorrect argument type to variable 'key_cache_block_size'
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-16384
-SET @@global.key_cache_block_size = -1024;
-Warnings:
-Warning 1292 Truncated incorrect key_cache_block_size value: '18446744073709550592'
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-16384
-SET @@global.key_cache_block_size = 256;
-Warnings:
-Warning 1292 Truncated incorrect key_cache_block_size value: '256'
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-512
-SET @@global.key_cache_block_size = 511;
-Warnings:
-Warning 1292 Truncated incorrect key_cache_block_size value: '511'
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-512
-SET @@global.key_cache_block_size = 16385;
-Warnings:
-Warning 1292 Truncated incorrect key_cache_block_size value: '16385'
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-16384
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
-SET @@global.key_cache_block_size = ON;
-ERROR 42000: Incorrect argument type to variable 'key_cache_block_size'
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-16384
-SET @@global.key_cache_block_size = 'test';
-ERROR 42000: Incorrect argument type to variable 'key_cache_block_size'
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-16384
-'#-------------------FN_DYNVARS_057_05----------------------------#'
-SET @@session.key_cache_block_size = 0;
-ERROR HY000: Variable 'key_cache_block_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@session.key_cache_block_size;
-ERROR HY000: Variable 'key_cache_block_size' is a GLOBAL variable
-'#----------------------FN_DYNVARS_057_06------------------------#'
-SELECT @@global.key_cache_block_size = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='key_cache_block_size';
-@@global.key_cache_block_size = VARIABLE_VALUE
-1
-SELECT @@key_cache_block_size = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='key_cache_block_size';
-@@key_cache_block_size = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_057_07----------------------#'
-SET @@global.key_cache_block_size = TRUE;
-Warnings:
-Warning 1292 Truncated incorrect key_cache_block_size value: '1'
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-512
-SET @@global.key_cache_block_size = FALSE;
-Warnings:
-Warning 1292 Truncated incorrect key_cache_block_size value: '0'
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-512
-'#---------------------FN_DYNVARS_057_08----------------------#'
-SET @@global.key_cache_block_size = 1024;
-SELECT @@key_cache_block_size = @@global.key_cache_block_size;
-@@key_cache_block_size = @@global.key_cache_block_size
-1
-'#---------------------FN_DYNVARS_057_09----------------------#'
-SET key_cache_block_size = 8000;
-ERROR HY000: Variable 'key_cache_block_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@key_cache_block_size;
-@@key_cache_block_size
-1024
-SET local.key_cache_block_size = 10;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_block_size = 10' at line 1
-SELECT local.key_cache_block_size;
-ERROR 42S02: Unknown table 'local' in field list
-SET global.key_cache_block_size = 10;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_block_size = 10' at line 1
-SELECT global.key_cache_block_size;
-ERROR 42S02: Unknown table 'global' in field list
-SELECT key_cache_block_size = @@session.key_cache_block_size;
-ERROR 42S22: Unknown column 'key_cache_block_size' in 'field list'
-SET @@global.key_cache_block_size = @start_value;
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-1024
diff --git a/mysql-test/suite/sys_vars/r/key_cache_division_limit_basic_64.result b/mysql-test/suite/sys_vars/r/key_cache_division_limit_basic.result
index cd0cdcbca05..641779ac819 100644
--- a/mysql-test/suite/sys_vars/r/key_cache_division_limit_basic_64.result
+++ b/mysql-test/suite/sys_vars/r/key_cache_division_limit_basic.result
@@ -3,13 +3,10 @@ SELECT @start_value;
@start_value
100
'#--------------------FN_DYNVARS_058_01------------------------#'
-SET @@global.key_cache_division_limit = 50;
SET @@global.key_cache_division_limit = DEFAULT;
-ERROR 42000: Variable 'key_cache_division_limit' doesn't have a default value
-'Bug# 34878: This variable has default value according to documentation';
SELECT @@global.key_cache_division_limit;
@@global.key_cache_division_limit
-50
+100
'#---------------------FN_DYNVARS_058_02-------------------------#'
SET @@global.key_cache_division_limit = @start_value;
SELECT @@global.key_cache_division_limit = 100;
@@ -35,10 +32,10 @@ SELECT @@global.key_cache_division_limit;
'#--------------------FN_DYNVARS_058_04-------------------------#'
SET @@global.key_cache_division_limit = -1;
Warnings:
-Warning 1292 Truncated incorrect key_cache_division_limit value: '18446744073709551615'
+Warning 1292 Truncated incorrect key_cache_division_limit value: '-1'
SELECT @@global.key_cache_division_limit;
@@global.key_cache_division_limit
-100
+1
SET @@global.key_cache_division_limit = 101;
Warnings:
Warning 1292 Truncated incorrect key_cache_division_limit value: '101'
@@ -52,10 +49,10 @@ SELECT @@global.key_cache_division_limit;
100
SET @@global.key_cache_division_limit = -1024;
Warnings:
-Warning 1292 Truncated incorrect key_cache_division_limit value: '18446744073709550592'
+Warning 1292 Truncated incorrect key_cache_division_limit value: '-1024'
SELECT @@global.key_cache_division_limit;
@@global.key_cache_division_limit
-100
+1
SET @@global.key_cache_division_limit = 0;
Warnings:
Warning 1292 Truncated incorrect key_cache_division_limit value: '0'
@@ -74,7 +71,6 @@ Warning 1292 Truncated incorrect key_cache_division_limit value: '65535'
SELECT @@global.key_cache_division_limit;
@@global.key_cache_division_limit
100
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
SET @@global.key_cache_division_limit = ON;
ERROR 42000: Incorrect argument type to variable 'key_cache_division_limit'
SELECT @@global.key_cache_division_limit;
diff --git a/mysql-test/suite/sys_vars/r/key_cache_division_limit_basic_32.result b/mysql-test/suite/sys_vars/r/key_cache_division_limit_basic_32.result
deleted file mode 100644
index cd0cdcbca05..00000000000
--- a/mysql-test/suite/sys_vars/r/key_cache_division_limit_basic_32.result
+++ /dev/null
@@ -1,139 +0,0 @@
-SET @start_value = @@global.key_cache_division_limit;
-SELECT @start_value;
-@start_value
-100
-'#--------------------FN_DYNVARS_058_01------------------------#'
-SET @@global.key_cache_division_limit = 50;
-SET @@global.key_cache_division_limit = DEFAULT;
-ERROR 42000: Variable 'key_cache_division_limit' doesn't have a default value
-'Bug# 34878: This variable has default value according to documentation';
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-50
-'#---------------------FN_DYNVARS_058_02-------------------------#'
-SET @@global.key_cache_division_limit = @start_value;
-SELECT @@global.key_cache_division_limit = 100;
-@@global.key_cache_division_limit = 100
-1
-'#--------------------FN_DYNVARS_058_03------------------------#'
-SET @@global.key_cache_division_limit = 1;
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-1
-SET @@global.key_cache_division_limit = 50;
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-50
-SET @@global.key_cache_division_limit = 99;
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-99
-SET @@global.key_cache_division_limit = 2;
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-2
-'#--------------------FN_DYNVARS_058_04-------------------------#'
-SET @@global.key_cache_division_limit = -1;
-Warnings:
-Warning 1292 Truncated incorrect key_cache_division_limit value: '18446744073709551615'
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-100
-SET @@global.key_cache_division_limit = 101;
-Warnings:
-Warning 1292 Truncated incorrect key_cache_division_limit value: '101'
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-100
-SET @@global.key_cache_division_limit = 10000.01;
-ERROR 42000: Incorrect argument type to variable 'key_cache_division_limit'
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-100
-SET @@global.key_cache_division_limit = -1024;
-Warnings:
-Warning 1292 Truncated incorrect key_cache_division_limit value: '18446744073709550592'
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-100
-SET @@global.key_cache_division_limit = 0;
-Warnings:
-Warning 1292 Truncated incorrect key_cache_division_limit value: '0'
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-1
-SET @@global.key_cache_division_limit = 200;
-Warnings:
-Warning 1292 Truncated incorrect key_cache_division_limit value: '200'
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-100
-SET @@global.key_cache_division_limit = 65535;
-Warnings:
-Warning 1292 Truncated incorrect key_cache_division_limit value: '65535'
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-100
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
-SET @@global.key_cache_division_limit = ON;
-ERROR 42000: Incorrect argument type to variable 'key_cache_division_limit'
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-100
-SET @@global.key_cache_division_limit = 'test';
-ERROR 42000: Incorrect argument type to variable 'key_cache_division_limit'
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-100
-'#-------------------FN_DYNVARS_058_05----------------------------#'
-SET @@session.key_cache_division_limit = 0;
-ERROR HY000: Variable 'key_cache_division_limit' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@session.key_cache_division_limit;
-ERROR HY000: Variable 'key_cache_division_limit' is a GLOBAL variable
-'#----------------------FN_DYNVARS_058_06------------------------#'
-SELECT @@global.key_cache_division_limit = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='key_cache_division_limit';
-@@global.key_cache_division_limit = VARIABLE_VALUE
-1
-SELECT @@key_cache_division_limit = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='key_cache_division_limit';
-@@key_cache_division_limit = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_058_07----------------------#'
-SET @@global.key_cache_division_limit = TRUE;
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-1
-SET @@global.key_cache_division_limit = FALSE;
-Warnings:
-Warning 1292 Truncated incorrect key_cache_division_limit value: '0'
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-1
-'#---------------------FN_DYNVARS_058_08----------------------#'
-SET @@global.key_cache_division_limit = 90;
-SELECT @@key_cache_division_limit = @@global.key_cache_division_limit;
-@@key_cache_division_limit = @@global.key_cache_division_limit
-1
-'#---------------------FN_DYNVARS_058_09----------------------#'
-SET key_cache_division_limit = 80;
-ERROR HY000: Variable 'key_cache_division_limit' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@key_cache_division_limit;
-@@key_cache_division_limit
-90
-SET local.key_cache_division_limit = 10;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_division_limit = 10' at line 1
-SELECT local.key_cache_division_limit;
-ERROR 42S02: Unknown table 'local' in field list
-SET global.key_cache_division_limit = 10;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_division_limit = 10' at line 1
-SELECT global.key_cache_division_limit;
-ERROR 42S02: Unknown table 'global' in field list
-SELECT key_cache_division_limit = @@session.key_cache_division_limit;
-ERROR 42S22: Unknown column 'key_cache_division_limit' in 'field list'
-SET @@global.key_cache_division_limit = @start_value;
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-100
diff --git a/mysql-test/suite/sys_vars/r/large_files_support_basic.result b/mysql-test/suite/sys_vars/r/large_files_support_basic.result
new file mode 100644
index 00000000000..a33e3894ddc
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/large_files_support_basic.result
@@ -0,0 +1,21 @@
+select @@global.large_files_support;
+@@global.large_files_support
+0
+select @@session.large_files_support;
+ERROR HY000: Variable 'large_files_support' is a GLOBAL variable
+show global variables like 'large_files_support';
+Variable_name Value
+large_files_support OFF
+show session variables like 'large_files_support';
+Variable_name Value
+large_files_support OFF
+select * from information_schema.global_variables where variable_name='large_files_support';
+VARIABLE_NAME VARIABLE_VALUE
+LARGE_FILES_SUPPORT OFF
+select * from information_schema.session_variables where variable_name='large_files_support';
+VARIABLE_NAME VARIABLE_VALUE
+LARGE_FILES_SUPPORT OFF
+set global large_files_support=1;
+ERROR HY000: Variable 'large_files_support' is a read only variable
+set session large_files_support=1;
+ERROR HY000: Variable 'large_files_support' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/large_page_size_basic.result b/mysql-test/suite/sys_vars/r/large_page_size_basic.result
new file mode 100644
index 00000000000..ac6b6acf6a0
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/large_page_size_basic.result
@@ -0,0 +1,21 @@
+select @@global.large_page_size = 1;
+@@global.large_page_size = 1
+0
+select @@session.large_page_size;
+ERROR HY000: Variable 'large_page_size' is a GLOBAL variable
+show global variables like 'large_page_size';
+Variable_name Value
+large_page_size #
+show session variables like 'large_page_size';
+Variable_name Value
+large_page_size #
+select * from information_schema.global_variables where variable_name='large_page_size';
+VARIABLE_NAME VARIABLE_VALUE
+LARGE_PAGE_SIZE #
+select * from information_schema.session_variables where variable_name='large_page_size';
+VARIABLE_NAME VARIABLE_VALUE
+LARGE_PAGE_SIZE #
+set global large_page_size=1;
+ERROR HY000: Variable 'large_page_size' is a read only variable
+set session large_page_size=1;
+ERROR HY000: Variable 'large_page_size' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/large_pages_basic.result b/mysql-test/suite/sys_vars/r/large_pages_basic.result
new file mode 100644
index 00000000000..257828a210b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/large_pages_basic.result
@@ -0,0 +1,21 @@
+select @@global.large_pages;
+@@global.large_pages
+0
+select @@session.large_pages;
+ERROR HY000: Variable 'large_pages' is a GLOBAL variable
+show global variables like 'large_pages';
+Variable_name Value
+large_pages OFF
+show session variables like 'large_pages';
+Variable_name Value
+large_pages OFF
+select * from information_schema.global_variables where variable_name='large_pages';
+VARIABLE_NAME VARIABLE_VALUE
+LARGE_PAGES OFF
+select * from information_schema.session_variables where variable_name='large_pages';
+VARIABLE_NAME VARIABLE_VALUE
+LARGE_PAGES OFF
+set global large_pages=1;
+ERROR HY000: Variable 'large_pages' is a read only variable
+set session large_pages=1;
+ERROR HY000: Variable 'large_pages' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/last_insert_id_basic.result b/mysql-test/suite/sys_vars/r/last_insert_id_basic.result
new file mode 100644
index 00000000000..c29a313b9e7
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/last_insert_id_basic.result
@@ -0,0 +1,27 @@
+select @@global.last_insert_id;
+ERROR HY000: Variable 'last_insert_id' is a SESSION variable
+select @@session.last_insert_id;
+@@session.last_insert_id
+0
+show global variables like 'last_insert_id';
+Variable_name Value
+show session variables like 'last_insert_id';
+Variable_name Value
+last_insert_id 0
+select * from information_schema.global_variables where variable_name='last_insert_id';
+VARIABLE_NAME VARIABLE_VALUE
+select * from information_schema.session_variables where variable_name='last_insert_id';
+VARIABLE_NAME VARIABLE_VALUE
+LAST_INSERT_ID 0
+set session last_insert_id=1;
+select @@session.last_insert_id;
+@@session.last_insert_id
+1
+set global last_insert_id=1;
+ERROR HY000: Variable 'last_insert_id' is a SESSION variable and can't be used with SET GLOBAL
+set session last_insert_id=1.1;
+ERROR 42000: Incorrect argument type to variable 'last_insert_id'
+set session last_insert_id=1e1;
+ERROR 42000: Incorrect argument type to variable 'last_insert_id'
+set session last_insert_id="foo";
+ERROR 42000: Incorrect argument type to variable 'last_insert_id'
diff --git a/mysql-test/suite/sys_vars/r/lc_messages_basic.result b/mysql-test/suite/sys_vars/r/lc_messages_basic.result
new file mode 100644
index 00000000000..e765dd53516
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/lc_messages_basic.result
@@ -0,0 +1,46 @@
+SET @start_global_value = @@global.lc_messages;
+SELECT @start_global_value;
+@start_global_value
+en_US
+select @@global.lc_messages;
+@@global.lc_messages
+en_US
+select @@session.lc_messages;
+@@session.lc_messages
+en_US
+show global variables like 'lc_messages';
+Variable_name Value
+lc_messages en_US
+show session variables like 'lc_messages';
+Variable_name Value
+lc_messages en_US
+select * from information_schema.global_variables where variable_name='lc_messages';
+VARIABLE_NAME VARIABLE_VALUE
+LC_MESSAGES en_US
+select * from information_schema.session_variables where variable_name='lc_messages';
+VARIABLE_NAME VARIABLE_VALUE
+LC_MESSAGES en_US
+set global lc_messages=1;
+select @@global.lc_messages;
+@@global.lc_messages
+en_GB
+set session lc_messages=2;
+select @@session.lc_messages;
+@@session.lc_messages
+ja_JP
+set global lc_messages="en_US";
+select @@global.lc_messages;
+@@global.lc_messages
+en_US
+set session lc_messages="en_GB";
+select @@session.lc_messages;
+@@session.lc_messages
+en_GB
+set global lc_messages=1.1;
+ERROR 42000: Incorrect argument type to variable 'lc_messages'
+set global lc_messages=1e1;
+ERROR 42000: Incorrect argument type to variable 'lc_messages'
+SET @@global.lc_messages = @start_global_value;
+SELECT @@global.lc_messages;
+@@global.lc_messages
+en_US
diff --git a/mysql-test/suite/sys_vars/r/lc_messages_dir_basic.result b/mysql-test/suite/sys_vars/r/lc_messages_dir_basic.result
new file mode 100644
index 00000000000..c197d94d4fc
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/lc_messages_dir_basic.result
@@ -0,0 +1,21 @@
+select @@global.lc_messages_dir;
+@@global.lc_messages_dir
+MYSQL_SHAREDIR/
+select @@session.lc_messages_dir;
+ERROR HY000: Variable 'lc_messages_dir' is a GLOBAL variable
+show global variables like 'lc_messages_dir';
+Variable_name Value
+lc_messages_dir MYSQL_SHAREDIR/
+show session variables like 'lc_messages_dir';
+Variable_name Value
+lc_messages_dir MYSQL_SHAREDIR/
+select * from information_schema.global_variables where variable_name='lc_messages_dir';
+VARIABLE_NAME VARIABLE_VALUE
+LC_MESSAGES_DIR MYSQL_SHAREDIR/
+select * from information_schema.session_variables where variable_name='lc_messages_dir';
+VARIABLE_NAME VARIABLE_VALUE
+LC_MESSAGES_DIR MYSQL_SHAREDIR/
+set global lc_messages_dir=1;
+ERROR HY000: Variable 'lc_messages_dir' is a read only variable
+set session lc_messages_dir=1;
+ERROR HY000: Variable 'lc_messages_dir' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/lc_time_names_basic.result b/mysql-test/suite/sys_vars/r/lc_time_names_basic.result
index 36f3c45f0da..39e93a6f76c 100644
--- a/mysql-test/suite/sys_vars/r/lc_time_names_basic.result
+++ b/mysql-test/suite/sys_vars/r/lc_time_names_basic.result
@@ -459,13 +459,19 @@ SELECT @@session.lc_time_names;
@@session.lc_time_names
sq_AL
SET @@session.lc_time_names=sr_YU;
+Warnings:
+Warning 1287 'sr_YU' is deprecated; use 'sr_RS' instead
SELECT @@session.lc_time_names;
@@session.lc_time_names
-sr_YU
+sr_RS
SET @@session.lc_time_names=sv_FI;
SELECT @@session.lc_time_names;
@@session.lc_time_names
sv_FI
+SET @@session.lc_time_names=sr_RS;
+SELECT @@session.lc_time_names;
+@@session.lc_time_names
+sr_RS
SET @@session.lc_time_names=sv_SE;
SELECT @@session.lc_time_names;
@@session.lc_time_names
@@ -900,13 +906,19 @@ SELECT @@global.lc_time_names;
@@global.lc_time_names
sq_AL
SET @@global.lc_time_names=sr_YU;
+Warnings:
+Warning 1287 'sr_YU' is deprecated; use 'sr_RS' instead
SELECT @@global.lc_time_names;
@@global.lc_time_names
-sr_YU
+sr_RS
SET @@global.lc_time_names=sv_FI;
SELECT @@global.lc_time_names;
@@global.lc_time_names
sv_FI
+SET @@global.lc_time_names=sr_RS;
+SELECT @@global.lc_time_names;
+@@global.lc_time_names
+sr_RS
SET @@global.lc_time_names=sv_SE;
SELECT @@global.lc_time_names;
@@global.lc_time_names
@@ -1006,7 +1018,11 @@ SELECT @@lc_time_names;
@@lc_time_names
zh_HK
SET @@lc_time_names = 109;
-ERROR HY000: Unknown locale: '109'
+SELECT @@lc_time_names;
+@@lc_time_names
+el_GR
+SET @@lc_time_names = 110;
+ERROR HY000: Unknown locale: '110'
'#--------------------FN_DYNVARS_060_10-------------------------#'
SET @@lc_time_names = en_EN;
ERROR HY000: Unknown locale: 'en_EN'
diff --git a/mysql-test/suite/sys_vars/r/locked_in_memory_basic.result b/mysql-test/suite/sys_vars/r/locked_in_memory_basic.result
new file mode 100644
index 00000000000..38253790693
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/locked_in_memory_basic.result
@@ -0,0 +1,21 @@
+select @@global.locked_in_memory;
+@@global.locked_in_memory
+0
+select @@session.locked_in_memory;
+ERROR HY000: Variable 'locked_in_memory' is a GLOBAL variable
+show global variables like 'locked_in_memory';
+Variable_name Value
+locked_in_memory OFF
+show session variables like 'locked_in_memory';
+Variable_name Value
+locked_in_memory OFF
+select * from information_schema.global_variables where variable_name='locked_in_memory';
+VARIABLE_NAME VARIABLE_VALUE
+LOCKED_IN_MEMORY OFF
+select * from information_schema.session_variables where variable_name='locked_in_memory';
+VARIABLE_NAME VARIABLE_VALUE
+LOCKED_IN_MEMORY OFF
+set global locked_in_memory=1;
+ERROR HY000: Variable 'locked_in_memory' is a read only variable
+set session locked_in_memory=1;
+ERROR HY000: Variable 'locked_in_memory' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/log_basic.result b/mysql-test/suite/sys_vars/r/log_basic.result
index 18a12b72437..5574d49514d 100644
--- a/mysql-test/suite/sys_vars/r/log_basic.result
+++ b/mysql-test/suite/sys_vars/r/log_basic.result
@@ -6,10 +6,12 @@ INIT_VALUE
SELECT @@log AS INIT_VALUE;
INIT_VALUE
1
-SET @@global.general_log = ON;
-SET global general_log = 0;
-'Bug# 34832: log is a system but it is not accessible using SET @@global.log;'
-'SET GLOBAL log; and SELECT @@global.log. SHOW VARIABLES shows the value of log.'
+SET @@global.log = ON;
+Warnings:
+Warning 1287 The syntax '@@log' is deprecated and will be removed in MySQL 7.0. Please use '@@general_log' instead
+SET global log = 0;
+Warnings:
+Warning 1287 The syntax '@@log' is deprecated and will be removed in MySQL 7.0. Please use '@@general_log' instead
'#--------------------FN_DYNVARS_062_02-------------------------#'
SELECT VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
diff --git a/mysql-test/suite/sys_vars/r/log_bin_basic.result b/mysql-test/suite/sys_vars/r/log_bin_basic.result
new file mode 100644
index 00000000000..e14888300b3
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/log_bin_basic.result
@@ -0,0 +1,21 @@
+select @@global.log_bin;
+@@global.log_bin
+0
+select @@session.log_bin;
+ERROR HY000: Variable 'log_bin' is a GLOBAL variable
+show global variables like 'log_bin';
+Variable_name Value
+log_bin OFF
+show session variables like 'log_bin';
+Variable_name Value
+log_bin OFF
+select * from information_schema.global_variables where variable_name='log_bin';
+VARIABLE_NAME VARIABLE_VALUE
+LOG_BIN OFF
+select * from information_schema.session_variables where variable_name='log_bin';
+VARIABLE_NAME VARIABLE_VALUE
+LOG_BIN OFF
+set global log_bin=1;
+ERROR HY000: Variable 'log_bin' is a read only variable
+set session log_bin=1;
+ERROR HY000: Variable 'log_bin' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/log_bin_trust_function_creators_basic.result b/mysql-test/suite/sys_vars/r/log_bin_trust_function_creators_basic.result
index 72daac1edc1..7ed1b689f5a 100644
--- a/mysql-test/suite/sys_vars/r/log_bin_trust_function_creators_basic.result
+++ b/mysql-test/suite/sys_vars/r/log_bin_trust_function_creators_basic.result
@@ -2,10 +2,6 @@ SET @start_global_value = @@global.log_bin_trust_function_creators;
SELECT @start_global_value;
@start_global_value
1
-'Bug# 34876: TRUE value is coming as Default'
-SET @start_session_value = @@session.log_bin_trust_function_creators;
-ERROR HY000: Variable 'log_bin_trust_function_creators' is a GLOBAL variable
-'Bug# 34881: According to documentation the scope of this variable is GLOBAL as well as SESSION too';
'#--------------------FN_DYNVARS_063_01-------------------------#'
SET @@global.log_bin_trust_function_creators = TRUE;
SET @@global.log_bin_trust_function_creators = DEFAULT;
@@ -55,7 +51,7 @@ ERROR 42000: Variable 'log_bin_trust_function_creators' can't be set to the valu
SET @@global.log_bin_trust_function_creators = "OFFF";
ERROR 42000: Variable 'log_bin_trust_function_creators' can't be set to the value of 'OFFF'
SET @@global.log_bin_trust_function_creators = OF;
-'Bug# 34828: OF is also working as OFF and no error is coming';
+ERROR 42000: Variable 'log_bin_trust_function_creators' can't be set to the value of 'OF'
SET @@global.log_bin_trust_function_creators = TTRUE;
ERROR 42000: Variable 'log_bin_trust_function_creators' can't be set to the value of 'TTRUE'
SET @@global.log_bin_trust_function_creators = FELSE;
@@ -65,7 +61,7 @@ ERROR 42000: Variable 'log_bin_trust_function_creators' can't be set to the valu
SET @@global.log_bin_trust_function_creators = 65536;
ERROR 42000: Variable 'log_bin_trust_function_creators' can't be set to the value of '65536'
SET @@global.log_bin_trust_function_creators = 65530.34;
-ERROR 42000: Variable 'log_bin_trust_function_creators' can't be set to the value of '65530'
+ERROR 42000: Incorrect argument type to variable 'log_bin_trust_function_creators'
SET @@global.log_bin_trust_function_creators = test;
ERROR 42000: Variable 'log_bin_trust_function_creators' can't be set to the value of 'test'
'#------------------FN_DYNVARS_063_06-----------------------#'
diff --git a/mysql-test/suite/sys_vars/r/log_bin_trust_routine_creators_basic.result b/mysql-test/suite/sys_vars/r/log_bin_trust_routine_creators_basic.result
deleted file mode 100644
index 66e253645b1..00000000000
--- a/mysql-test/suite/sys_vars/r/log_bin_trust_routine_creators_basic.result
+++ /dev/null
@@ -1,121 +0,0 @@
-SET @start_global_value = @@global.log_bin_trust_routine_creators;
-SELECT @start_global_value;
-@start_global_value
-1
-'#--------------------FN_DYNVARS_064_01-------------------------#'
-SET @@global.log_bin_trust_routine_creators = TRUE;
-Warnings:
-Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead
-SET @@global.log_bin_trust_routine_creators = DEFAULT;
-Warnings:
-Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead
-SELECT @@global.log_bin_trust_routine_creators;
-@@global.log_bin_trust_routine_creators
-0
-'#--------------------FN_DYNVARS_064_02-------------------------#'
-SET @@global.log_bin_trust_routine_creators = DEFAULT;
-Warnings:
-Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead
-SELECT @@global.log_bin_trust_routine_creators = 'FALSE';
-@@global.log_bin_trust_routine_creators = 'FALSE'
-1
-Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: 'FALSE'
-'#--------------------FN_DYNVARS_064_03-------------------------#'
-SET @@global.log_bin_trust_routine_creators = ON;
-Warnings:
-Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead
-SELECT @@global.log_bin_trust_routine_creators;
-@@global.log_bin_trust_routine_creators
-1
-SET @@global.log_bin_trust_routine_creators = OFF;
-Warnings:
-Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead
-SELECT @@global.log_bin_trust_routine_creators;
-@@global.log_bin_trust_routine_creators
-0
-SET @@global.log_bin_trust_routine_creators = 0;
-Warnings:
-Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead
-SELECT @@global.log_bin_trust_routine_creators;
-@@global.log_bin_trust_routine_creators
-0
-SET @@global.log_bin_trust_routine_creators = 1;
-Warnings:
-Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead
-SELECT @@global.log_bin_trust_routine_creators;
-@@global.log_bin_trust_routine_creators
-1
-SET @@global.log_bin_trust_routine_creators = TRUE;
-Warnings:
-Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead
-SELECT @@global.log_bin_trust_routine_creators;
-@@global.log_bin_trust_routine_creators
-1
-SET @@global.log_bin_trust_routine_creators = FALSE;
-Warnings:
-Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead
-SELECT @@global.log_bin_trust_routine_creators;
-@@global.log_bin_trust_routine_creators
-0
-'#-------------------FN_DYNVARS_064_04----------------------------#'
-SET @@session.log_bin_trust_routine_creators = 0;
-ERROR HY000: Variable 'log_bin_trust_routine_creators' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@session.log_bin_trust_routine_creators;
-ERROR HY000: Variable 'log_bin_trust_routine_creators' is a GLOBAL variable
-'#------------------FN_DYNVARS_064_05-----------------------#'
-SET @@global.log_bin_trust_routine_creators = 'ONN';
-ERROR 42000: Variable 'log_bin_trust_routine_creators' can't be set to the value of 'ONN'
-SET @@global.log_bin_trust_routine_creators = "OFFF";
-ERROR 42000: Variable 'log_bin_trust_routine_creators' can't be set to the value of 'OFFF'
-SET @@global.log_bin_trust_routine_creators = OF;
-Warnings:
-Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead
-SELECT @@global.log_bin_trust_routine_creators;
-@@global.log_bin_trust_routine_creators
-0
-'Bug# 34828: OF is also working as OFF and no error is coming';
-SET @@global.log_bin_trust_routine_creators = TTRUE;
-ERROR 42000: Variable 'log_bin_trust_routine_creators' can't be set to the value of 'TTRUE'
-SET @@global.log_bin_trust_routine_creators = FELSE;
-ERROR 42000: Variable 'log_bin_trust_routine_creators' can't be set to the value of 'FELSE'
-SET @@global.log_bin_trust_routine_creators = -1024;
-ERROR 42000: Variable 'log_bin_trust_routine_creators' can't be set to the value of '-1024'
-SET @@global.log_bin_trust_routine_creators = 65536;
-ERROR 42000: Variable 'log_bin_trust_routine_creators' can't be set to the value of '65536'
-SET @@global.log_bin_trust_routine_creators = 65530.34;
-ERROR 42000: Variable 'log_bin_trust_routine_creators' can't be set to the value of '65530'
-SET @@global.log_bin_trust_routine_creators = test;
-ERROR 42000: Variable 'log_bin_trust_routine_creators' can't be set to the value of 'test'
-'#------------------FN_DYNVARS_064_06-----------------------#'
-SELECT @@global.log_bin_trust_routine_creators = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='log_bin_trust_routine_creators';
-@@global.log_bin_trust_routine_creators = VARIABLE_VALUE
-1
-SELECT @@session.log_bin_trust_routine_creators = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='log_bin_trust_routine_creators';
-ERROR HY000: Variable 'log_bin_trust_routine_creators' is a GLOBAL variable
-'#---------------------FN_DYNVARS_064_07----------------------#'
-SET @@global.log_bin_trust_routine_creators = TRUE;
-Warnings:
-Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead
-SELECT @@log_bin_trust_routine_creators = @@global.log_bin_trust_routine_creators;
-@@log_bin_trust_routine_creators = @@global.log_bin_trust_routine_creators
-1
-'#---------------------FN_DYNVARS_064_08----------------------#'
-SET @@global.log_bin_trust_routine_creators = TRUE;
-Warnings:
-Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead
-SELECT @@log_bin_trust_routine_creators;
-@@log_bin_trust_routine_creators
-1
-SELECT local.log_bin_trust_routine_creators;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.log_bin_trust_routine_creators;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT log_bin_trust_routine_creators = @@session.log_bin_trust_routine_creators;
-ERROR 42S22: Unknown column 'log_bin_trust_routine_creators' in 'field list'
-SET @@global.log_bin_trust_routine_creators = @start_global_value;
-Warnings:
-Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead
-SELECT @@global.log_bin_trust_routine_creators;
-@@global.log_bin_trust_routine_creators
-1
diff --git a/mysql-test/suite/sys_vars/r/log_error_basic.result b/mysql-test/suite/sys_vars/r/log_error_basic.result
new file mode 100644
index 00000000000..c18d43762bf
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/log_error_basic.result
@@ -0,0 +1,21 @@
+select @@global.log_error;
+@@global.log_error
+
+select @@session.log_error;
+ERROR HY000: Variable 'log_error' is a GLOBAL variable
+show global variables like 'log_error';
+Variable_name Value
+log_error
+show session variables like 'log_error';
+Variable_name Value
+log_error
+select * from information_schema.global_variables where variable_name='log_error';
+VARIABLE_NAME VARIABLE_VALUE
+LOG_ERROR
+select * from information_schema.session_variables where variable_name='log_error';
+VARIABLE_NAME VARIABLE_VALUE
+LOG_ERROR
+set global log_error=1;
+ERROR HY000: Variable 'log_error' is a read only variable
+set session log_error=1;
+ERROR HY000: Variable 'log_error' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/log_output_basic.result b/mysql-test/suite/sys_vars/r/log_output_basic.result
index 481d5862074..ab9e5837e63 100644
--- a/mysql-test/suite/sys_vars/r/log_output_basic.result
+++ b/mysql-test/suite/sys_vars/r/log_output_basic.result
@@ -1,26 +1,18 @@
SET @start_value = @@global.log_output;
SELECT @start_value;
@start_value
-FILE,TABLE
+FILE
'#--------------------FN_DYNVARS_065_01------------------------#'
SET @@global.log_output = FILE;
SET @@global.log_output = DEFAULT;
SELECT @@global.log_output;
@@global.log_output
FILE
-'Bug# 34876: Documentation specifies a DEFAULT value of TABLE whereas';
-'DEFAULT value is FILE. Also note that initial value is different';
-'from DEFAULT';
'#---------------------FN_DYNVARS_065_02-------------------------#'
SET @@global.log_output = NULL;
ERROR 42000: Variable 'log_output' can't be set to the value of 'NULL'
SET @@global.log_output = "";
ERROR 42000: Variable 'log_output' can't be set to the value of ''
-SELECT @@global.log_output;
-@@global.log_output
-FILE
-'Bug# 34838: Empty value is allowed where as it is not specified in';
-'documentation';
'#--------------------FN_DYNVARS_065_03------------------------#'
SET @@global.log_output = 'TABLE';
SELECT @@global.log_output;
@@ -66,10 +58,6 @@ SET @@global.log_output = ',TABLE';
SELECT @@global.log_output;
@@global.log_output
TABLE
-SET @@global.log_output = ',';
-SELECT @@global.log_output;
-@@global.log_output
-
SET @@global.log_output = 'TABLE,,FILE,,,';
SELECT @@global.log_output;
@@global.log_output
@@ -89,22 +77,6 @@ SET @@global.log_output = 'TABLE, FILE';
ERROR 42000: Variable 'log_output' can't be set to the value of ' FILE'
SET @@global.log_output = ' TABLE,FILE';
ERROR 42000: Variable 'log_output' can't be set to the value of ' TABLE'
-SET @@global.log_output = ', ';
-SELECT @@global.log_output;
-@@global.log_output
-
-SET @@global.log_output = ' ';
-SELECT @@global.log_output;
-@@global.log_output
-
-SET @@global.log_output = ' ';
-SELECT @@global.log_output;
-@@global.log_output
-
-'Bug: The behavior of space in value is not consistent.';
-'Some times it is trimmed and some times not.';
-'The space before and after value is not accepted where as space';
-'between comma is accepted.';
'#-------------------FN_DYNVARS_065_05----------------------------#'
SET @@log_output = 0;
ERROR HY000: Variable 'log_output' is a GLOBAL variable and should be set with SET GLOBAL
@@ -121,7 +93,7 @@ SET @@global.log_output = 0;
ERROR 42000: Variable 'log_output' can't be set to the value of '0'
SELECT @@global.log_output;
@@global.log_output
-
+FILE,TABLE
SET @@global.log_output = 1;
SELECT @@global.log_output;
@@global.log_output
@@ -172,4 +144,4 @@ TABLE
SET @@global.log_output = @start_value;
SELECT @@global.log_output;
@@global.log_output
-FILE,TABLE
+FILE
diff --git a/mysql-test/suite/sys_vars/r/log_queries_not_using_indexes_basic.result b/mysql-test/suite/sys_vars/r/log_queries_not_using_indexes_basic.result
index 7c69655f109..f577122bacf 100644
--- a/mysql-test/suite/sys_vars/r/log_queries_not_using_indexes_basic.result
+++ b/mysql-test/suite/sys_vars/r/log_queries_not_using_indexes_basic.result
@@ -41,37 +41,11 @@ SELECT @@global.log_queries_not_using_indexes;
@@global.log_queries_not_using_indexes
0
SET GLOBAL log_queries_not_using_indexes= 0.00;
-SELECT @@global.log_queries_not_using_indexes;
-@@global.log_queries_not_using_indexes
-0
-SET GLOBAL log_queries_not_using_indexes= -0.0;
-SELECT @@global.log_queries_not_using_indexes;
-@@global.log_queries_not_using_indexes
-0
-SET GLOBAL log_queries_not_using_indexes= 001.00;
-SELECT @@global.log_queries_not_using_indexes;
-@@global.log_queries_not_using_indexes
-1
-SET GLOBAL log_queries_not_using_indexes= +1.0;
-SELECT @@global.log_queries_not_using_indexes;
-@@global.log_queries_not_using_indexes
-1
+ERROR 42000: Incorrect argument type to variable 'log_queries_not_using_indexes'
SET GLOBAL log_queries_not_using_indexes= +0;
SELECT @@global.log_queries_not_using_indexes;
@@global.log_queries_not_using_indexes
0
-SET GLOBAL log_queries_not_using_indexes= +0.000000;
-SELECT @@global.log_queries_not_using_indexes;
-@@global.log_queries_not_using_indexes
-0
-SET GLOBAL log_queries_not_using_indexes= 0000.00000;
-SELECT @@global.log_queries_not_using_indexes;
-@@global.log_queries_not_using_indexes
-0
-SET GLOBAL log_queries_not_using_indexes= .0;
-SELECT @@global.log_queries_not_using_indexes;
-@@global.log_queries_not_using_indexes
-0
SET @@global.log_queries_not_using_indexes= 'DEFAULT';
ERROR 42000: Variable 'log_queries_not_using_indexes' can't be set to the value of 'DEFAULT'
SET @@global.log_queries_not_using_indexes= 'true';
@@ -80,8 +54,6 @@ SET @@global.log_queries_not_using_indexes= BLABLA;
ERROR 42000: Variable 'log_queries_not_using_indexes' can't be set to the value of 'BLABLA'
SET @@global.log_queries_not_using_indexes= 25;
ERROR 42000: Variable 'log_queries_not_using_indexes' can't be set to the value of '25'
-SET @@global.log_queries_not_using_indexes= 12.34;
-ERROR 42000: Variable 'log_queries_not_using_indexes' can't be set to the value of '12'
SET GLOBAL log_queries_not_using_indexes= -1;
ERROR 42000: Variable 'log_queries_not_using_indexes' can't be set to the value of '-1'
SET @badvar= 'true';
@@ -102,6 +74,3 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
SET @@SESSION log_queries_not_using_indexes= TRUE;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'log_queries_not_using_indexes= TRUE' at line 1
SET @@global.log_queries_not_using_indexes= @start_value;
-SELECT IF(@@GLOBAL.log_queries_not_using_indexes, "ON", "OFF") = VARIABLE_VALUE
-IF(@@GLOBAL.log_queries_not_using_indexes, "ON", "OFF") = VARIABLE_VALUE
-1
diff --git a/mysql-test/suite/sys_vars/r/log_slave_updates_basic.result b/mysql-test/suite/sys_vars/r/log_slave_updates_basic.result
new file mode 100644
index 00000000000..85ee30ca999
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/log_slave_updates_basic.result
@@ -0,0 +1,21 @@
+select @@global.log_slave_updates;
+@@global.log_slave_updates
+0
+select @@session.log_slave_updates;
+ERROR HY000: Variable 'log_slave_updates' is a GLOBAL variable
+show global variables like 'log_slave_updates';
+Variable_name Value
+log_slave_updates OFF
+show session variables like 'log_slave_updates';
+Variable_name Value
+log_slave_updates OFF
+select * from information_schema.global_variables where variable_name='log_slave_updates';
+VARIABLE_NAME VARIABLE_VALUE
+LOG_SLAVE_UPDATES OFF
+select * from information_schema.session_variables where variable_name='log_slave_updates';
+VARIABLE_NAME VARIABLE_VALUE
+LOG_SLAVE_UPDATES OFF
+set global log_slave_updates=1;
+ERROR HY000: Variable 'log_slave_updates' is a read only variable
+set session log_slave_updates=1;
+ERROR HY000: Variable 'log_slave_updates' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/log_slow_queries_basic.result b/mysql-test/suite/sys_vars/r/log_slow_queries_basic.result
new file mode 100644
index 00000000000..ca530ebb41a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/log_slow_queries_basic.result
@@ -0,0 +1,112 @@
+SET @start_value = @@global.log_slow_queries;
+SELECT @start_value;
+@start_value
+1
+'#---------------------FN_DYNVARS_004_01-------------------------#'
+SET @@global.log_slow_queries = DEFAULT;
+Warnings:
+Warning 1287 The syntax '@@log_slow_queries' is deprecated and will be removed in MySQL 7.0. Please use '@@slow_query_log' instead
+SELECT @@global.log_slow_queries = 0;
+@@global.log_slow_queries = 0
+1
+'#--------------------FN_DYNVARS_004_02------------------------#'
+SET @@global.log_slow_queries = ON;
+Warnings:
+Warning 1287 The syntax '@@log_slow_queries' is deprecated and will be removed in MySQL 7.0. Please use '@@slow_query_log' instead
+SELECT @@global.log_slow_queries;
+@@global.log_slow_queries
+1
+SET @@global.log_slow_queries = OFF;
+Warnings:
+Warning 1287 The syntax '@@log_slow_queries' is deprecated and will be removed in MySQL 7.0. Please use '@@slow_query_log' instead
+SELECT @@global.log_slow_queries;
+@@global.log_slow_queries
+0
+'#--------------------FN_DYNVARS_004_03-------------------------#'
+SET @@global.log_slow_queries = 2;
+ERROR 42000: Variable 'log_slow_queries' can't be set to the value of '2'
+SET @@global.log_slow_queries = -1;
+ERROR 42000: Variable 'log_slow_queries' can't be set to the value of '-1'
+SET @@global.log_slow_queries = TRUEF;
+ERROR 42000: Variable 'log_slow_queries' can't be set to the value of 'TRUEF'
+SET @@global.log_slow_queries = TRUE_F;
+ERROR 42000: Variable 'log_slow_queries' can't be set to the value of 'TRUE_F'
+SET @@global.log_slow_queries = FALSE0;
+ERROR 42000: Variable 'log_slow_queries' can't be set to the value of 'FALSE0'
+SET @@global.log_slow_queries = OON;
+ERROR 42000: Variable 'log_slow_queries' can't be set to the value of 'OON'
+SET @@global.log_slow_queries = ONN;
+ERROR 42000: Variable 'log_slow_queries' can't be set to the value of 'ONN'
+SET @@global.log_slow_queries = OOFF;
+ERROR 42000: Variable 'log_slow_queries' can't be set to the value of 'OOFF'
+SET @@global.log_slow_queries = 0FF;
+ERROR 42000: Variable 'log_slow_queries' can't be set to the value of '0FF'
+SET @@global.log_slow_queries = ' ';
+ERROR 42000: Variable 'log_slow_queries' can't be set to the value of ' '
+SET @@global.log_slow_queries = " ";
+ERROR 42000: Variable 'log_slow_queries' can't be set to the value of ' '
+SET @@global.log_slow_queries = '';
+ERROR 42000: Variable 'log_slow_queries' can't be set to the value of ''
+'#-------------------FN_DYNVARS_004_04----------------------------#'
+SET @@session.log_slow_queries = OFF;
+ERROR HY000: Variable 'log_slow_queries' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@session.log_slow_queries;
+ERROR HY000: Variable 'log_slow_queries' is a GLOBAL variable
+'#----------------------FN_DYNVARS_004_05------------------------#'
+SELECT IF(@@global.log_slow_queries, "ON", "OFF") = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='log_slow_queries';
+IF(@@global.log_slow_queries, "ON", "OFF") = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_004_06----------------------#'
+SET @@global.log_slow_queries = 0;
+Warnings:
+Warning 1287 The syntax '@@log_slow_queries' is deprecated and will be removed in MySQL 7.0. Please use '@@slow_query_log' instead
+SELECT @@global.log_slow_queries;
+@@global.log_slow_queries
+0
+SET @@global.log_slow_queries = 1;
+Warnings:
+Warning 1287 The syntax '@@log_slow_queries' is deprecated and will be removed in MySQL 7.0. Please use '@@slow_query_log' instead
+SELECT @@global.log_slow_queries;
+@@global.log_slow_queries
+1
+'#---------------------FN_DYNVARS_004_07----------------------#'
+SET @@global.log_slow_queries = TRUE;
+Warnings:
+Warning 1287 The syntax '@@log_slow_queries' is deprecated and will be removed in MySQL 7.0. Please use '@@slow_query_log' instead
+SELECT @@global.log_slow_queries;
+@@global.log_slow_queries
+1
+SET @@global.log_slow_queries = FALSE;
+Warnings:
+Warning 1287 The syntax '@@log_slow_queries' is deprecated and will be removed in MySQL 7.0. Please use '@@slow_query_log' instead
+SELECT @@global.log_slow_queries;
+@@global.log_slow_queries
+0
+'#---------------------FN_DYNVARS_004_08----------------------#'
+SET @@global.log_slow_queries = ON;
+Warnings:
+Warning 1287 The syntax '@@log_slow_queries' is deprecated and will be removed in MySQL 7.0. Please use '@@slow_query_log' instead
+SELECT @@log_slow_queries = @@global.log_slow_queries;
+@@log_slow_queries = @@global.log_slow_queries
+1
+'#---------------------FN_DYNVARS_004_09----------------------#'
+SET log_slow_queries = ON;
+ERROR HY000: Variable 'log_slow_queries' is a GLOBAL variable and should be set with SET GLOBAL
+SET local.log_slow_queries = OFF;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'log_slow_queries = OFF' at line 1
+SELECT local.log_slow_queries;
+ERROR 42S02: Unknown table 'local' in field list
+SET global.log_slow_queries = ON;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'log_slow_queries = ON' at line 1
+SELECT global.log_slow_queries;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT log_slow_queries = @@session.log_slow_queries;
+ERROR 42S22: Unknown column 'log_slow_queries' in 'field list'
+SET @@global.log_slow_queries = @start_value;
+Warnings:
+Warning 1287 The syntax '@@log_slow_queries' is deprecated and will be removed in MySQL 7.0. Please use '@@slow_query_log' instead
+SELECT @@global.log_slow_queries;
+@@global.log_slow_queries
+1
diff --git a/mysql-test/suite/sys_vars/r/log_warnings_basic_32.result b/mysql-test/suite/sys_vars/r/log_warnings_basic_32.result
index 92b0f4e5e91..fee7f8966ca 100644
--- a/mysql-test/suite/sys_vars/r/log_warnings_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/log_warnings_basic_32.result
@@ -81,8 +81,8 @@ Warning 1292 Truncated incorrect log_warnings value: '-1024'
SELECT @@global.log_warnings;
@@global.log_warnings
0
-SET @@global.log_warnings = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.log_warnings = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'log_warnings'
SELECT @@global.log_warnings;
@@global.log_warnings
0
@@ -103,9 +103,8 @@ Warning 1292 Truncated incorrect log_warnings value: '-2'
SELECT @@session.log_warnings;
@@session.log_warnings
0
-SET @@session.log_warnings = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@session.log_warnings = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'log_warnings'
SET @@session.log_warnings = test;
ERROR 42000: Incorrect argument type to variable 'log_warnings'
SELECT @@session.log_warnings;
diff --git a/mysql-test/suite/sys_vars/r/log_warnings_basic_64.result b/mysql-test/suite/sys_vars/r/log_warnings_basic_64.result
index 6a94881dad0..838fdff269b 100644
--- a/mysql-test/suite/sys_vars/r/log_warnings_basic_64.result
+++ b/mysql-test/suite/sys_vars/r/log_warnings_basic_64.result
@@ -79,8 +79,8 @@ Warning 1292 Truncated incorrect log_warnings value: '-1024'
SELECT @@global.log_warnings;
@@global.log_warnings
0
-SET @@global.log_warnings = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.log_warnings = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'log_warnings'
SELECT @@global.log_warnings;
@@global.log_warnings
0
@@ -99,9 +99,8 @@ Warning 1292 Truncated incorrect log_warnings value: '-2'
SELECT @@session.log_warnings;
@@session.log_warnings
0
-SET @@session.log_warnings = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@session.log_warnings = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'log_warnings'
SET @@session.log_warnings = test;
ERROR 42000: Incorrect argument type to variable 'log_warnings'
SELECT @@session.log_warnings;
diff --git a/mysql-test/suite/sys_vars/r/long_query_time_basic.result b/mysql-test/suite/sys_vars/r/long_query_time_basic.result
index b44500dc1e2..9dfa621ae6f 100644
--- a/mysql-test/suite/sys_vars/r/long_query_time_basic.result
+++ b/mysql-test/suite/sys_vars/r/long_query_time_basic.result
@@ -70,39 +70,47 @@ SELECT @@session.long_query_time;
65550.000000
'#------------------FN_DYNVARS_068_05-----------------------#'
SET @@global.long_query_time = 100000000000;
+Warnings:
+Warning 1292 Truncated incorrect long_query_time value: '1e+11'
SELECT @@global.long_query_time;
@@global.long_query_time
31536000.000000
SET @@global.long_query_time = -1;
+Warnings:
+Warning 1292 Truncated incorrect long_query_time value: '-1'
SELECT @@global.long_query_time;
@@global.long_query_time
0.000000
-SET @@global.long_query_time = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.long_query_time = 65530.34;
SELECT @@global.long_query_time;
@@global.long_query_time
-0.000000
+65530.340000
SET @@global.long_query_time = test;
ERROR 42000: Incorrect argument type to variable 'long_query_time'
SELECT @@global.long_query_time;
@@global.long_query_time
-0.000000
+65530.340000
SET @@session.long_query_time = 100000000000;
+Warnings:
+Warning 1292 Truncated incorrect long_query_time value: '1e+11'
SELECT @@session.long_query_time;
@@session.long_query_time
31536000.000000
SET @@session.long_query_time = -2;
+Warnings:
+Warning 1292 Truncated incorrect long_query_time value: '-2'
SELECT @@session.long_query_time;
@@session.long_query_time
0.000000
-SET @@session.long_query_time = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@session.long_query_time = 65530.34;
+SELECT @@session.long_query_time;
+@@session.long_query_time
+65530.340000
SET @@session.long_query_time = test;
ERROR 42000: Incorrect argument type to variable 'long_query_time'
SELECT @@session.long_query_time;
@@session.long_query_time
-0.000000
+65530.340000
'#------------------FN_DYNVARS_068_06-----------------------#'
SELECT @@global.long_query_time = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
diff --git a/mysql-test/suite/sys_vars/r/low_priority_updates_basic.result b/mysql-test/suite/sys_vars/r/low_priority_updates_basic.result
index d41e4cfc56f..633dc274dec 100644
--- a/mysql-test/suite/sys_vars/r/low_priority_updates_basic.result
+++ b/mysql-test/suite/sys_vars/r/low_priority_updates_basic.result
@@ -94,7 +94,7 @@ ERROR 42000: Variable 'low_priority_updates' can't be set to the value of '-1024
SET @@global.low_priority_updates = 65536;
ERROR 42000: Variable 'low_priority_updates' can't be set to the value of '65536'
SET @@global.low_priority_updates = 65530.34;
-ERROR 42000: Variable 'low_priority_updates' can't be set to the value of '65530'
+ERROR 42000: Incorrect argument type to variable 'low_priority_updates'
SET @@global.low_priority_updates = test;
ERROR 42000: Variable 'low_priority_updates' can't be set to the value of 'test'
SET @@session.low_priority_updates = ONN;
@@ -102,19 +102,15 @@ ERROR 42000: Variable 'low_priority_updates' can't be set to the value of 'ONN'
SET @@session.low_priority_updates = ONF;
ERROR 42000: Variable 'low_priority_updates' can't be set to the value of 'ONF'
SET @@session.low_priority_updates = OF;
-SELECT @@session.low_priority_updates;
-@@session.low_priority_updates
-0
-'Bug# 34828: OF is also working as OFF and no error is coming';
+ERROR 42000: Variable 'low_priority_updates' can't be set to the value of 'OF'
SET @@session.low_priority_updates = 'OFN';
ERROR 42000: Variable 'low_priority_updates' can't be set to the value of 'OFN'
SET @@session.low_priority_updates = -2;
ERROR 42000: Variable 'low_priority_updates' can't be set to the value of '-2'
-SET @@session.low_priority_updates = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.low_priority_updates = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'low_priority_updates'
SET @@session.low_priority_updates = 65550;
ERROR 42000: Variable 'low_priority_updates' can't be set to the value of '65550'
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@session.low_priority_updates = test;
ERROR 42000: Variable 'low_priority_updates' can't be set to the value of 'test'
'#------------------FN_DYNVARS_069_06-----------------------#'
diff --git a/mysql-test/suite/sys_vars/r/lower_case_file_system_basic.result b/mysql-test/suite/sys_vars/r/lower_case_file_system_basic.result
new file mode 100644
index 00000000000..0488ed30dc0
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/lower_case_file_system_basic.result
@@ -0,0 +1,21 @@
+select @@global.lower_case_file_system=2;
+@@global.lower_case_file_system=2
+0
+select @@session.lower_case_file_system;
+ERROR HY000: Variable 'lower_case_file_system' is a GLOBAL variable
+show global variables like 'lower_case_file_system';
+Variable_name Value
+lower_case_file_system #
+show session variables like 'lower_case_file_system';
+Variable_name Value
+lower_case_file_system #
+select * from information_schema.global_variables where variable_name='lower_case_file_system';
+VARIABLE_NAME VARIABLE_VALUE
+LOWER_CASE_FILE_SYSTEM #
+select * from information_schema.session_variables where variable_name='lower_case_file_system';
+VARIABLE_NAME VARIABLE_VALUE
+LOWER_CASE_FILE_SYSTEM #
+set global lower_case_file_system=1;
+ERROR HY000: Variable 'lower_case_file_system' is a read only variable
+set session lower_case_file_system=1;
+ERROR HY000: Variable 'lower_case_file_system' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/lower_case_table_names_basic.result b/mysql-test/suite/sys_vars/r/lower_case_table_names_basic.result
new file mode 100644
index 00000000000..d7dc6d69e30
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/lower_case_table_names_basic.result
@@ -0,0 +1,21 @@
+select @@global.lower_case_table_names=20;
+@@global.lower_case_table_names=20
+0
+select @@session.lower_case_table_names;
+ERROR HY000: Variable 'lower_case_table_names' is a GLOBAL variable
+show global variables like 'lower_case_table_names';
+Variable_name Value
+lower_case_table_names #
+show session variables like 'lower_case_table_names';
+Variable_name Value
+lower_case_table_names #
+select * from information_schema.global_variables where variable_name='lower_case_table_names';
+VARIABLE_NAME VARIABLE_VALUE
+LOWER_CASE_TABLE_NAMES #
+select * from information_schema.session_variables where variable_name='lower_case_table_names';
+VARIABLE_NAME VARIABLE_VALUE
+LOWER_CASE_TABLE_NAMES #
+set global lower_case_table_names=1;
+ERROR HY000: Variable 'lower_case_table_names' is a read only variable
+set session lower_case_table_names=1;
+ERROR HY000: Variable 'lower_case_table_names' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result b/mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result
index ca5b87f19cb..32048a7cfb0 100644
--- a/mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result
@@ -14,7 +14,7 @@ SELECT @@global.max_allowed_packet;
SET @@session.max_allowed_packet = 20000;
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SET @@session.max_allowed_packet = DEFAULT;
-ERROR 42000: Variable 'max_allowed_packet' doesn't have a default value
+ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
1048576
@@ -29,15 +29,18 @@ SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
1024
SET @@global.max_allowed_packet = 1025;
+Warnings:
+Warning 1292 Truncated incorrect max_allowed_packet value: '1025'
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
1024
-: 'Bug# 34841: "Invalid values are coming in variable on assigning valid value';
SET @@global.max_allowed_packet = 1073741824;
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
1073741824
SET @@global.max_allowed_packet = 1073741823;
+Warnings:
+Warning 1292 Truncated incorrect max_allowed_packet value: '1073741823'
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
1073740800
@@ -92,8 +95,8 @@ Warning 1292 Truncated incorrect max_allowed_packet value: '10737418241'
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
1073741824
-SET @@global.max_allowed_packet = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.max_allowed_packet = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'max_allowed_packet'
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
1073741824
@@ -117,14 +120,13 @@ ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
1048576
-SET @@session.max_allowed_packet = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.max_allowed_packet = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'max_allowed_packet'
SET @@session.max_allowed_packet = 10737418241;
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
1048576
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@session.max_allowed_packet = test;
ERROR 42000: Incorrect argument type to variable 'max_allowed_packet'
SELECT @@session.max_allowed_packet;
diff --git a/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_32.result b/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic.result
index 1b3b65010b2..d760474affd 100644
--- a/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic.result
@@ -1,41 +1,49 @@
SET @start_value = @@global.max_binlog_cache_size;
SELECT @start_value;
@start_value
-4294963200
+18446744073709547520
'#--------------------FN_DYNVARS_072_01------------------------#'
SET @@global.max_binlog_cache_size = 5000;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_cache_size value: '5000'
SET @@global.max_binlog_cache_size = DEFAULT;
SELECT @@global.max_binlog_cache_size;
@@global.max_binlog_cache_size
-4294963200
+18446744073709547520
'#---------------------FN_DYNVARS_072_02-------------------------#'
SET @@global.max_binlog_cache_size = @start_value;
SELECT @@global.max_binlog_cache_size = 4294967295;
@@global.max_binlog_cache_size = 4294967295
0
-'Bug# 34876: Incorrect Default Value is assigned to variable';
'#--------------------FN_DYNVARS_072_03------------------------#'
SET @@global.max_binlog_cache_size = 4096;
SELECT @@global.max_binlog_cache_size;
@@global.max_binlog_cache_size
4096
SET @@global.max_binlog_cache_size = 4294967295;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_cache_size value: '4294967295'
SELECT @@global.max_binlog_cache_size;
@@global.max_binlog_cache_size
4294963200
SET @@global.max_binlog_cache_size = 4294967294;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_cache_size value: '4294967294'
SELECT @@global.max_binlog_cache_size;
@@global.max_binlog_cache_size
4294963200
SET @@global.max_binlog_cache_size = 4097;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_cache_size value: '4097'
SELECT @@global.max_binlog_cache_size;
@@global.max_binlog_cache_size
4096
SET @@global.max_binlog_cache_size = 65535;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_cache_size value: '65535'
SELECT @@global.max_binlog_cache_size;
@@global.max_binlog_cache_size
61440
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
'#--------------------FN_DYNVARS_072_04-------------------------#'
SET @@global.max_binlog_cache_size = -1;
Warnings:
@@ -48,12 +56,12 @@ Warnings:
Warning 1292 Truncated incorrect max_binlog_cache_size value: '100000000000'
SELECT @@global.max_binlog_cache_size;
@@global.max_binlog_cache_size
-4294963200
+99999997952
SET @@global.max_binlog_cache_size = 10000.01;
ERROR 42000: Incorrect argument type to variable 'max_binlog_cache_size'
SELECT @@global.max_binlog_cache_size;
@@global.max_binlog_cache_size
-4294963200
+99999997952
SET @@global.max_binlog_cache_size = -1024;
Warnings:
Warning 1292 Truncated incorrect max_binlog_cache_size value: '-1024'
@@ -67,18 +75,15 @@ SELECT @@global.max_binlog_cache_size;
@@global.max_binlog_cache_size
4096
SET @@global.max_binlog_cache_size = 4294967296;
-Warnings:
-Warning 1292 Truncated incorrect max_binlog_cache_size value: '4294967296'
SELECT @@global.max_binlog_cache_size;
@@global.max_binlog_cache_size
-4294963200
+4294967296
SET @@global.max_binlog_cache_size = 4095;
Warnings:
Warning 1292 Truncated incorrect max_binlog_cache_size value: '4095'
SELECT @@global.max_binlog_cache_size;
@@global.max_binlog_cache_size
4096
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@global.max_binlog_cache_size = ON;
ERROR 42000: Incorrect argument type to variable 'max_binlog_cache_size'
SELECT @@global.max_binlog_cache_size;
@@ -120,6 +125,8 @@ SELECT @@global.max_binlog_cache_size;
4096
'#---------------------FN_DYNVARS_072_08----------------------#'
SET @@global.max_binlog_cache_size = 5000;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_cache_size value: '5000'
SELECT @@max_binlog_cache_size = @@global.max_binlog_cache_size;
@@max_binlog_cache_size = @@global.max_binlog_cache_size
1
@@ -142,4 +149,4 @@ ERROR 42S22: Unknown column 'max_binlog_cache_size' in 'field list'
SET @@global.max_binlog_cache_size = @start_value;
SELECT @@global.max_binlog_cache_size;
@@global.max_binlog_cache_size
-4294963200
+18446744073709547520
diff --git a/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_64.result b/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_64.result
deleted file mode 100644
index 10a42f6ab0e..00000000000
--- a/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_64.result
+++ /dev/null
@@ -1,141 +0,0 @@
-SET @start_value = @@global.max_binlog_cache_size;
-SELECT @start_value;
-@start_value
-18446744073709547520
-'#--------------------FN_DYNVARS_072_01------------------------#'
-SET @@global.max_binlog_cache_size = 5000;
-SET @@global.max_binlog_cache_size = DEFAULT;
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-18446744073709547520
-'#---------------------FN_DYNVARS_072_02-------------------------#'
-SET @@global.max_binlog_cache_size = @start_value;
-SELECT @@global.max_binlog_cache_size = 4294967295;
-@@global.max_binlog_cache_size = 4294967295
-0
-'Bug# 34876: Incorrect Default Value is assigned to variable';
-'#--------------------FN_DYNVARS_072_03------------------------#'
-SET @@global.max_binlog_cache_size = 4096;
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4096
-SET @@global.max_binlog_cache_size = 4294967295;
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4294963200
-SET @@global.max_binlog_cache_size = 4294967294;
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4294963200
-SET @@global.max_binlog_cache_size = 4097;
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4096
-SET @@global.max_binlog_cache_size = 65535;
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-61440
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-'#--------------------FN_DYNVARS_072_04-------------------------#'
-SET @@global.max_binlog_cache_size = -1;
-Warnings:
-Warning 1292 Truncated incorrect max_binlog_cache_size value: '-1'
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4096
-SET @@global.max_binlog_cache_size = 100000000000;
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-99999997952
-SET @@global.max_binlog_cache_size = 10000.01;
-ERROR 42000: Incorrect argument type to variable 'max_binlog_cache_size'
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-99999997952
-SET @@global.max_binlog_cache_size = -1024;
-Warnings:
-Warning 1292 Truncated incorrect max_binlog_cache_size value: '-1024'
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4096
-SET @@global.max_binlog_cache_size = 1024;
-Warnings:
-Warning 1292 Truncated incorrect max_binlog_cache_size value: '1024'
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4096
-SET @@global.max_binlog_cache_size = 4294967296;
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4294967296
-SET @@global.max_binlog_cache_size = 4095;
-Warnings:
-Warning 1292 Truncated incorrect max_binlog_cache_size value: '4095'
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4096
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@global.max_binlog_cache_size = ON;
-ERROR 42000: Incorrect argument type to variable 'max_binlog_cache_size'
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4096
-SET @@global.max_binlog_cache_size = 'test';
-ERROR 42000: Incorrect argument type to variable 'max_binlog_cache_size'
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4096
-'#-------------------FN_DYNVARS_072_05----------------------------#'
-SET @@session.max_binlog_cache_size = 4096;
-ERROR HY000: Variable 'max_binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@session.max_binlog_cache_size;
-ERROR HY000: Variable 'max_binlog_cache_size' is a GLOBAL variable
-'#----------------------FN_DYNVARS_072_06------------------------#'
-SELECT @@global.max_binlog_cache_size = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='max_binlog_cache_size';
-@@global.max_binlog_cache_size = VARIABLE_VALUE
-1
-SELECT @@max_binlog_cache_size = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='max_binlog_cache_size';
-@@max_binlog_cache_size = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_072_07----------------------#'
-SET @@global.max_binlog_cache_size = TRUE;
-Warnings:
-Warning 1292 Truncated incorrect max_binlog_cache_size value: '1'
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4096
-SET @@global.max_binlog_cache_size = FALSE;
-Warnings:
-Warning 1292 Truncated incorrect max_binlog_cache_size value: '0'
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4096
-'#---------------------FN_DYNVARS_072_08----------------------#'
-SET @@global.max_binlog_cache_size = 5000;
-SELECT @@max_binlog_cache_size = @@global.max_binlog_cache_size;
-@@max_binlog_cache_size = @@global.max_binlog_cache_size
-1
-'#---------------------FN_DYNVARS_072_09----------------------#'
-SET max_binlog_cache_size = 6000;
-ERROR HY000: Variable 'max_binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@max_binlog_cache_size;
-@@max_binlog_cache_size
-4096
-SET local.max_binlog_cache_size = 7000;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_binlog_cache_size = 7000' at line 1
-SELECT local.max_binlog_cache_size;
-ERROR 42S02: Unknown table 'local' in field list
-SET global.max_binlog_cache_size = 8000;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_binlog_cache_size = 8000' at line 1
-SELECT global.max_binlog_cache_size;
-ERROR 42S02: Unknown table 'global' in field list
-SELECT max_binlog_cache_size = @@session.max_binlog_cache_size;
-ERROR 42S22: Unknown column 'max_binlog_cache_size' in 'field list'
-SET @@global.max_binlog_cache_size = @start_value;
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-18446744073709547520
diff --git a/mysql-test/suite/sys_vars/r/max_binlog_size_basic.result b/mysql-test/suite/sys_vars/r/max_binlog_size_basic.result
index 658289628b0..33f5495a011 100644
--- a/mysql-test/suite/sys_vars/r/max_binlog_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_binlog_size_basic.result
@@ -4,11 +4,12 @@ SELECT @start_value;
1073741824
'#--------------------FN_DYNVARS_072_01------------------------#'
SET @@global.max_binlog_size = 5000;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_size value: '5000'
SET @@global.max_binlog_size = DEFAULT;
SELECT @@global.max_binlog_size;
@@global.max_binlog_size
1073741824
-'Bug# 34878: This variable has invalid default value as compared to documentation';
'#---------------------FN_DYNVARS_072_02-------------------------#'
SET @@global.max_binlog_size = @start_value;
SELECT @@global.max_binlog_size = 1073741824;
@@ -24,18 +25,23 @@ SELECT @@global.max_binlog_size;
@@global.max_binlog_size
1073741824
SET @@global.max_binlog_size = 1073741823;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_size value: '1073741823'
SELECT @@global.max_binlog_size;
@@global.max_binlog_size
1073737728
SET @@global.max_binlog_size = 4097;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_size value: '4097'
SELECT @@global.max_binlog_size;
@@global.max_binlog_size
4096
SET @@global.max_binlog_size = 65535;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_size value: '65535'
SELECT @@global.max_binlog_size;
@@global.max_binlog_size
61440
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
'#--------------------FN_DYNVARS_072_04-------------------------#'
SET @@global.max_binlog_size = -1;
Warnings:
@@ -78,7 +84,6 @@ Warning 1292 Truncated incorrect max_binlog_size value: '4095'
SELECT @@global.max_binlog_size;
@@global.max_binlog_size
4096
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@global.max_binlog_size = ON;
ERROR 42000: Incorrect argument type to variable 'max_binlog_size'
SELECT @@global.max_binlog_size;
@@ -120,6 +125,8 @@ SELECT @@global.max_binlog_size;
4096
'#---------------------FN_DYNVARS_072_08----------------------#'
SET @@global.max_binlog_size = 5000;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_size value: '5000'
SELECT @@max_binlog_size = @@global.max_binlog_size;
@@max_binlog_size = @@global.max_binlog_size
1
diff --git a/mysql-test/suite/sys_vars/r/max_connect_errors_basic_32.result b/mysql-test/suite/sys_vars/r/max_connect_errors_basic_32.result
index 42e64f1b418..19f6f12a50b 100644
--- a/mysql-test/suite/sys_vars/r/max_connect_errors_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/max_connect_errors_basic_32.result
@@ -8,7 +8,6 @@ SET @@global.max_connect_errors = DEFAULT;
SELECT @@global.max_connect_errors;
@@global.max_connect_errors
10
-'Bug# 34876: This variable has invalid default value as compared to documentation';
'#---------------------FN_DYNVARS_073_02-------------------------#'
SET @@global.max_connect_errors = @start_value;
SELECT @@global.max_connect_errors = 10;
@@ -35,7 +34,6 @@ SET @@global.max_connect_errors = 2;
SELECT @@global.max_connect_errors;
@@global.max_connect_errors
2
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
'#--------------------FN_DYNVARS_073_04-------------------------#'
SET @@global.max_connect_errors = -1;
Warnings:
@@ -72,7 +70,6 @@ Warning 1292 Truncated incorrect max_connect_errors value: '4294967296'
SELECT @@global.max_connect_errors;
@@global.max_connect_errors
4294967295
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@global.max_connect_errors = ON;
ERROR 42000: Incorrect argument type to variable 'max_connect_errors'
SELECT @@global.max_connect_errors;
diff --git a/mysql-test/suite/sys_vars/r/max_connect_errors_basic_64.result b/mysql-test/suite/sys_vars/r/max_connect_errors_basic_64.result
index 762cfd14a3a..bbc117b65b6 100644
--- a/mysql-test/suite/sys_vars/r/max_connect_errors_basic_64.result
+++ b/mysql-test/suite/sys_vars/r/max_connect_errors_basic_64.result
@@ -8,7 +8,6 @@ SET @@global.max_connect_errors = DEFAULT;
SELECT @@global.max_connect_errors;
@@global.max_connect_errors
10
-'Bug# 34876: This variable has invalid default value as compared to documentation';
'#---------------------FN_DYNVARS_073_02-------------------------#'
SET @@global.max_connect_errors = @start_value;
SELECT @@global.max_connect_errors = 10;
@@ -35,7 +34,6 @@ SET @@global.max_connect_errors = 2;
SELECT @@global.max_connect_errors;
@@global.max_connect_errors
2
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
'#--------------------FN_DYNVARS_073_04-------------------------#'
SET @@global.max_connect_errors = -1;
Warnings:
@@ -68,7 +66,6 @@ SET @@global.max_connect_errors = 4294967296;
SELECT @@global.max_connect_errors;
@@global.max_connect_errors
4294967296
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@global.max_connect_errors = ON;
ERROR 42000: Incorrect argument type to variable 'max_connect_errors'
SELECT @@global.max_connect_errors;
diff --git a/mysql-test/suite/sys_vars/r/max_connections_basic.result b/mysql-test/suite/sys_vars/r/max_connections_basic.result
index d917cd97b25..eac35f3bf2b 100644
--- a/mysql-test/suite/sys_vars/r/max_connections_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_connections_basic.result
@@ -8,7 +8,6 @@ SET @@global.max_connections = DEFAULT;
SELECT @@global.max_connections;
@@global.max_connections
151
-'Bug# 34876: This variable has invalid default value as compared to documentation';
'#---------------------FN_DYNVARS_074_02-------------------------#'
SET @@global.max_connections = @start_value;
SELECT @@global.max_connections = 151;
@@ -35,7 +34,6 @@ SET @@global.max_connections = 2;
SELECT @@global.max_connections;
@@global.max_connections
2
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
'#--------------------FN_DYNVARS_074_04-------------------------#'
SET @@global.max_connections = -1;
Warnings:
@@ -72,7 +70,6 @@ Warning 1292 Truncated incorrect max_connections value: '100001'
SELECT @@global.max_connections;
@@global.max_connections
100000
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@global.max_connections = ON;
ERROR 42000: Incorrect argument type to variable 'max_connections'
SELECT @@global.max_connections;
diff --git a/mysql-test/suite/sys_vars/r/max_delayed_threads_basic.result b/mysql-test/suite/sys_vars/r/max_delayed_threads_basic.result
index 946c24e3082..a78ac90107f 100644
--- a/mysql-test/suite/sys_vars/r/max_delayed_threads_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_delayed_threads_basic.result
@@ -14,7 +14,6 @@ SELECT @@global.max_delayed_threads;
20
SET @@session.max_delayed_threads = 1000;
ERROR 42000: Variable 'max_delayed_threads' can't be set to the value of '1000'
-'Bug# 34882: Valid values are not allowed to assign in this variable';
SET @@session.max_delayed_threads = DEFAULT;
SELECT @@session.max_delayed_threads;
@@session.max_delayed_threads
@@ -37,7 +36,6 @@ SET @@global.max_delayed_threads = 1025;
SELECT @@global.max_delayed_threads;
@@global.max_delayed_threads
1025
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
SET @@global.max_delayed_threads = 0;
SELECT @@global.max_delayed_threads;
@@global.max_delayed_threads
@@ -93,8 +91,8 @@ Warning 1292 Truncated incorrect max_delayed_threads value: '16385'
SELECT @@global.max_delayed_threads;
@@global.max_delayed_threads
16384
-SET @@global.max_delayed_threads = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.max_delayed_threads = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'max_delayed_threads'
SELECT @@global.max_delayed_threads;
@@global.max_delayed_threads
16384
@@ -104,32 +102,36 @@ SELECT @@global.max_delayed_threads;
@@global.max_delayed_threads
16384
SET @@session.max_delayed_threads = 16385;
-ERROR 42000: Variable 'max_delayed_threads' can't be set to the value of '16385'
+Warnings:
+Warning 1292 Truncated incorrect max_delayed_threads value: '16385'
SELECT @@session.max_delayed_threads;
@@session.max_delayed_threads
-16383
+16384
SET @@session.max_delayed_threads = -1;
-ERROR 42000: Variable 'max_delayed_threads' can't be set to the value of '-1'
+Warnings:
+Warning 1292 Truncated incorrect max_delayed_threads value: '-1'
SELECT @@session.max_delayed_threads;
@@session.max_delayed_threads
-16383
+0
SET @@session.max_delayed_threads = -2;
-ERROR 42000: Variable 'max_delayed_threads' can't be set to the value of '-2'
+Warnings:
+Warning 1292 Truncated incorrect max_delayed_threads value: '-2'
SELECT @@session.max_delayed_threads;
@@session.max_delayed_threads
-16383
-SET @@session.max_delayed_threads = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+0
+SET @@session.max_delayed_threads = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'max_delayed_threads'
SET @@session.max_delayed_threads = 10737418241;
-ERROR 42000: Variable 'max_delayed_threads' can't be set to the value of '10737418241'
+Warnings:
+Warning 1292 Truncated incorrect max_delayed_threads value: '10737418241'
SELECT @@session.max_delayed_threads;
@@session.max_delayed_threads
-16383
+16384
SET @@session.max_delayed_threads = test;
ERROR 42000: Incorrect argument type to variable 'max_delayed_threads'
SELECT @@session.max_delayed_threads;
@@session.max_delayed_threads
-16383
+16384
'#------------------FN_DYNVARS_075_06-----------------------#'
SELECT @@global.max_delayed_threads = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@@ -170,7 +172,7 @@ SET max_delayed_threads = 1024;
ERROR 42000: Variable 'max_delayed_threads' can't be set to the value of '1024'
SELECT @@max_delayed_threads;
@@max_delayed_threads
-16383
+16384
SELECT local.max_delayed_threads;
ERROR 42S02: Unknown table 'local' in field list
SELECT session.max_delayed_threads;
diff --git a/mysql-test/suite/sys_vars/r/max_error_count_basic.result b/mysql-test/suite/sys_vars/r/max_error_count_basic.result
index 7be8e0f37a3..980789b09be 100644
--- a/mysql-test/suite/sys_vars/r/max_error_count_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_error_count_basic.result
@@ -35,7 +35,6 @@ SET @@global.max_error_count = 0;
SELECT @@global.max_error_count;
@@global.max_error_count
0
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
SET @@global.max_error_count = 65535;
SELECT @@global.max_error_count;
@@global.max_error_count
@@ -86,8 +85,8 @@ Warning 1292 Truncated incorrect max_error_count value: '10737418241'
SELECT @@global.max_error_count;
@@global.max_error_count
65535
-SET @@global.max_error_count = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.max_error_count = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'max_error_count'
SELECT @@global.max_error_count;
@@global.max_error_count
65535
@@ -113,14 +112,13 @@ Warning 1292 Truncated incorrect max_error_count value: '-2'
SELECT @@session.max_error_count;
@@session.max_error_count
0
-SET @@session.max_error_count = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.max_error_count = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'max_error_count'
SET @@session.max_error_count = 10737418241;
Warnings:
SELECT @@session.max_error_count;
@@session.max_error_count
65535
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@session.max_error_count = test;
ERROR 42000: Incorrect argument type to variable 'max_error_count'
SELECT @@session.max_error_count;
diff --git a/mysql-test/suite/sys_vars/r/max_heap_table_size_basic_32.result b/mysql-test/suite/sys_vars/r/max_heap_table_size_basic.result
index deedb9ae43c..2c6d86d49f3 100644
--- a/mysql-test/suite/sys_vars/r/max_heap_table_size_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/max_heap_table_size_basic.result
@@ -8,11 +8,15 @@ SELECT @start_session_value;
1048576
'#--------------------FN_DYNVARS_077_01-------------------------#'
SET @@global.max_heap_table_size = 1677721610;
+Warnings:
+Warning 1292 Truncated incorrect max_heap_table_size value: '1677721610'
SET @@global.max_heap_table_size = DEFAULT;
SELECT @@global.max_heap_table_size;
@@global.max_heap_table_size
16777216
SET @@session.max_heap_table_size = 1677721610;
+Warnings:
+Warning 1292 Truncated incorrect max_heap_table_size value: '1677721610'
SET @@session.max_heap_table_size = DEFAULT;
SELECT @@session.max_heap_table_size;
@@session.max_heap_table_size
@@ -32,10 +36,14 @@ SELECT @@global.max_heap_table_size;
@@global.max_heap_table_size
16384
SET @@global.max_heap_table_size = 16385;
+Warnings:
+Warning 1292 Truncated incorrect max_heap_table_size value: '16385'
SELECT @@global.max_heap_table_size;
@@global.max_heap_table_size
16384
SET @@global.max_heap_table_size = 65535;
+Warnings:
+Warning 1292 Truncated incorrect max_heap_table_size value: '65535'
SELECT @@global.max_heap_table_size;
@@global.max_heap_table_size
64512
@@ -51,17 +59,20 @@ Warning 1292 Truncated incorrect max_heap_table_size value: '4294967295'
SELECT @@global.max_heap_table_size;
@@global.max_heap_table_size
4294966272
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
'#--------------------FN_DYNVARS_077_04-------------------------#'
SET @@session.max_heap_table_size = 16384;
SELECT @@session.max_heap_table_size;
@@session.max_heap_table_size
16384
SET @@session.max_heap_table_size = 16385;
+Warnings:
+Warning 1292 Truncated incorrect max_heap_table_size value: '16385'
SELECT @@session.max_heap_table_size;
@@session.max_heap_table_size
16384
SET @@session.max_heap_table_size = 65535;
+Warnings:
+Warning 1292 Truncated incorrect max_heap_table_size value: '65535'
SELECT @@session.max_heap_table_size;
@@session.max_heap_table_size
64512
@@ -77,7 +88,6 @@ Warning 1292 Truncated incorrect max_heap_table_size value: '4294967295'
SELECT @@session.max_heap_table_size;
@@session.max_heap_table_size
4294966272
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
'#------------------FN_DYNVARS_077_05-----------------------#'
SET @@global.max_heap_table_size = -1;
Warnings:
@@ -104,21 +114,19 @@ SELECT @@global.max_heap_table_size;
@@global.max_heap_table_size
16384
SET @@global.max_heap_table_size = 4294967296;
-Warnings:
-Warning 1292 Truncated incorrect max_heap_table_size value: '4294967296'
SELECT @@global.max_heap_table_size;
@@global.max_heap_table_size
-4294966272
-SET @@global.max_heap_table_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+4294967296
+SET @@global.max_heap_table_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'max_heap_table_size'
SELECT @@global.max_heap_table_size;
@@global.max_heap_table_size
-4294966272
+4294967296
SET @@global.max_heap_table_size = test;
ERROR 42000: Incorrect argument type to variable 'max_heap_table_size'
SELECT @@global.max_heap_table_size;
@@global.max_heap_table_size
-4294966272
+4294967296
SET @@session.max_heap_table_size = -1;
Warnings:
Warning 1292 Truncated incorrect max_heap_table_size value: '-1'
@@ -132,25 +140,22 @@ SELECT @@session.max_heap_table_size;
@@session.max_heap_table_size
16384
SET @@session.max_heap_table_size = 4294967296;
-Warnings:
-Warning 1292 Truncated incorrect max_heap_table_size value: '4294967296'
SELECT @@session.max_heap_table_size;
@@session.max_heap_table_size
-4294966272
-SET @@session.max_heap_table_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+4294967296
+SET @@session.max_heap_table_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'max_heap_table_size'
SET @@session.max_heap_table_size = 10737418241;
Warnings:
Warning 1292 Truncated incorrect max_heap_table_size value: '10737418241'
SELECT @@session.max_heap_table_size;
@@session.max_heap_table_size
-4294966272
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+10737418240
SET @@session.max_heap_table_size = test;
ERROR 42000: Incorrect argument type to variable 'max_heap_table_size'
SELECT @@session.max_heap_table_size;
@@session.max_heap_table_size
-4294966272
+10737418240
'#------------------FN_DYNVARS_077_06-----------------------#'
SELECT @@global.max_heap_table_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@@ -178,6 +183,8 @@ SELECT @@global.max_heap_table_size;
16384
'#---------------------FN_DYNVARS_077_09----------------------#'
SET @@global.max_heap_table_size = 163845;
+Warnings:
+Warning 1292 Truncated incorrect max_heap_table_size value: '163845'
SELECT @@max_heap_table_size = @@global.max_heap_table_size;
@@max_heap_table_size = @@global.max_heap_table_size
0
@@ -191,6 +198,8 @@ SELECT @@local.max_heap_table_size = @@session.max_heap_table_size;
1
'#---------------------FN_DYNVARS_077_11----------------------#'
SET max_heap_table_size = 316777216;
+Warnings:
+Warning 1292 Truncated incorrect max_heap_table_size value: '316777216'
SELECT @@max_heap_table_size;
@@max_heap_table_size
316776448
diff --git a/mysql-test/suite/sys_vars/r/max_heap_table_size_basic_64.result b/mysql-test/suite/sys_vars/r/max_heap_table_size_basic_64.result
deleted file mode 100644
index 6642b6024b5..00000000000
--- a/mysql-test/suite/sys_vars/r/max_heap_table_size_basic_64.result
+++ /dev/null
@@ -1,196 +0,0 @@
-SET @start_global_value = @@global.max_heap_table_size;
-SELECT @start_global_value;
-@start_global_value
-1048576
-SET @start_session_value = @@session.max_heap_table_size;
-SELECT @start_session_value;
-@start_session_value
-1048576
-'#--------------------FN_DYNVARS_077_01-------------------------#'
-SET @@global.max_heap_table_size = 1677721610;
-SET @@global.max_heap_table_size = DEFAULT;
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-16777216
-SET @@session.max_heap_table_size = 1677721610;
-SET @@session.max_heap_table_size = DEFAULT;
-SELECT @@session.max_heap_table_size;
-@@session.max_heap_table_size
-16777216
-'#--------------------FN_DYNVARS_077_02-------------------------#'
-SET @@global.max_heap_table_size = DEFAULT;
-SELECT @@global.max_heap_table_size = 16777216;
-@@global.max_heap_table_size = 16777216
-1
-SET @@session.max_heap_table_size = DEFAULT;
-SELECT @@session.max_heap_table_size = 16777216;
-@@session.max_heap_table_size = 16777216
-1
-'#--------------------FN_DYNVARS_077_03-------------------------#'
-SET @@global.max_heap_table_size = 16384;
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-16384
-SET @@global.max_heap_table_size = 16385;
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-16384
-SET @@global.max_heap_table_size = 65535;
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-64512
-SET @@global.max_heap_table_size = 4294967294;
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-4294966272
-SET @@global.max_heap_table_size = 4294967295;
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-4294966272
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-'#--------------------FN_DYNVARS_077_04-------------------------#'
-SET @@session.max_heap_table_size = 16384;
-SELECT @@session.max_heap_table_size;
-@@session.max_heap_table_size
-16384
-SET @@session.max_heap_table_size = 16385;
-SELECT @@session.max_heap_table_size;
-@@session.max_heap_table_size
-16384
-SET @@session.max_heap_table_size = 65535;
-SELECT @@session.max_heap_table_size;
-@@session.max_heap_table_size
-64512
-SET @@session.max_heap_table_size = 4294967294;
-SELECT @@session.max_heap_table_size;
-@@session.max_heap_table_size
-4294966272
-SET @@session.max_heap_table_size = 4294967295;
-SELECT @@session.max_heap_table_size;
-@@session.max_heap_table_size
-4294966272
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-'#------------------FN_DYNVARS_077_05-----------------------#'
-SET @@global.max_heap_table_size = -1;
-Warnings:
-Warning 1292 Truncated incorrect max_heap_table_size value: '-1'
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-16384
-SET @@global.max_heap_table_size = -1024;
-Warnings:
-Warning 1292 Truncated incorrect max_heap_table_size value: '-1024'
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-16384
-SET @@global.max_heap_table_size = 1024;
-Warnings:
-Warning 1292 Truncated incorrect max_heap_table_size value: '1024'
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-16384
-SET @@global.max_heap_table_size = 16383;
-Warnings:
-Warning 1292 Truncated incorrect max_heap_table_size value: '16383'
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-16384
-SET @@global.max_heap_table_size = 4294967296;
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-4294967296
-SET @@global.max_heap_table_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-4294967296
-SET @@global.max_heap_table_size = test;
-ERROR 42000: Incorrect argument type to variable 'max_heap_table_size'
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-4294967296
-SET @@session.max_heap_table_size = -1;
-Warnings:
-Warning 1292 Truncated incorrect max_heap_table_size value: '-1'
-SELECT @@session.max_heap_table_size;
-@@session.max_heap_table_size
-16384
-SET @@session.max_heap_table_size = 16383;
-Warnings:
-Warning 1292 Truncated incorrect max_heap_table_size value: '16383'
-SELECT @@session.max_heap_table_size;
-@@session.max_heap_table_size
-16384
-SET @@session.max_heap_table_size = 4294967296;
-SELECT @@session.max_heap_table_size;
-@@session.max_heap_table_size
-4294967296
-SET @@session.max_heap_table_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SET @@session.max_heap_table_size = 10737418241;
-SELECT @@session.max_heap_table_size;
-@@session.max_heap_table_size
-10737418240
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@session.max_heap_table_size = test;
-ERROR 42000: Incorrect argument type to variable 'max_heap_table_size'
-SELECT @@session.max_heap_table_size;
-@@session.max_heap_table_size
-10737418240
-'#------------------FN_DYNVARS_077_06-----------------------#'
-SELECT @@global.max_heap_table_size = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='max_heap_table_size';
-@@global.max_heap_table_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_077_07-----------------------#'
-SELECT @@session.max_heap_table_size = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='max_heap_table_size';
-@@session.max_heap_table_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_077_08-----------------------#'
-SET @@global.max_heap_table_size = TRUE;
-Warnings:
-Warning 1292 Truncated incorrect max_heap_table_size value: '1'
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-16384
-SET @@global.max_heap_table_size = FALSE;
-Warnings:
-Warning 1292 Truncated incorrect max_heap_table_size value: '0'
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-16384
-'#---------------------FN_DYNVARS_077_09----------------------#'
-SET @@global.max_heap_table_size = 163845;
-SELECT @@max_heap_table_size = @@global.max_heap_table_size;
-@@max_heap_table_size = @@global.max_heap_table_size
-0
-'#---------------------FN_DYNVARS_077_10----------------------#'
-SET @@max_heap_table_size = 16777216;
-SELECT @@max_heap_table_size = @@local.max_heap_table_size;
-@@max_heap_table_size = @@local.max_heap_table_size
-1
-SELECT @@local.max_heap_table_size = @@session.max_heap_table_size;
-@@local.max_heap_table_size = @@session.max_heap_table_size
-1
-'#---------------------FN_DYNVARS_077_11----------------------#'
-SET max_heap_table_size = 316777216;
-SELECT @@max_heap_table_size;
-@@max_heap_table_size
-316776448
-SELECT local.max_heap_table_size;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.max_heap_table_size;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT max_heap_table_size = @@session.max_heap_table_size;
-ERROR 42S22: Unknown column 'max_heap_table_size' in 'field list'
-SET @@global.max_heap_table_size = @start_global_value;
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-1048576
-SET @@session.max_heap_table_size = @start_session_value;
-SELECT @@session.max_heap_table_size;
-@@session.max_heap_table_size
-1048576
diff --git a/mysql-test/suite/sys_vars/r/max_insert_delayed_threads_basic.result b/mysql-test/suite/sys_vars/r/max_insert_delayed_threads_basic.result
index 2f2f7f0c0fc..aa79a5a7b9d 100644
--- a/mysql-test/suite/sys_vars/r/max_insert_delayed_threads_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_insert_delayed_threads_basic.result
@@ -6,30 +6,28 @@ SET @start_session_value = @@session.max_insert_delayed_threads;
SELECT @start_session_value;
@start_session_value
20
-'#--------------------FN_DYNVARS_078_01-------------------------#'
+'#--------------------FN_DYNVARS_075_01-------------------------#'
SET @@global.max_insert_delayed_threads = 1000;
SET @@global.max_insert_delayed_threads = DEFAULT;
-ERROR 42000: Variable 'max_insert_delayed_threads' doesn't have a default value
SELECT @@global.max_insert_delayed_threads;
@@global.max_insert_delayed_threads
-1000
+20
SET @@session.max_insert_delayed_threads = 1000;
+ERROR 42000: Variable 'max_insert_delayed_threads' can't be set to the value of '1000'
SET @@session.max_insert_delayed_threads = DEFAULT;
SELECT @@session.max_insert_delayed_threads;
@@session.max_insert_delayed_threads
-1000
-'#--------------------FN_DYNVARS_078_02-------------------------#'
+20
+'#--------------------FN_DYNVARS_075_02-------------------------#'
SET @@global.max_insert_delayed_threads = DEFAULT;
-ERROR 42000: Variable 'max_insert_delayed_threads' doesn't have a default value
SELECT @@global.max_insert_delayed_threads = 20;
@@global.max_insert_delayed_threads = 20
-0
+1
SET @@session.max_insert_delayed_threads = DEFAULT;
SELECT @@session.max_insert_delayed_threads = 20;
@@session.max_insert_delayed_threads = 20
-0
-'Bug# 34876: This variable has invalid default value as compared to documentation';
-'#--------------------FN_DYNVARS_078_03-------------------------#'
+1
+'#--------------------FN_DYNVARS_075_03-------------------------#'
SET @@global.max_insert_delayed_threads = 1;
SELECT @@global.max_insert_delayed_threads;
@@global.max_insert_delayed_threads
@@ -38,7 +36,6 @@ SET @@global.max_insert_delayed_threads = 1025;
SELECT @@global.max_insert_delayed_threads;
@@global.max_insert_delayed_threads
1025
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
SET @@global.max_insert_delayed_threads = 0;
SELECT @@global.max_insert_delayed_threads;
@@global.max_insert_delayed_threads
@@ -51,17 +48,17 @@ SET @@global.max_insert_delayed_threads = 16383;
SELECT @@global.max_insert_delayed_threads;
@@global.max_insert_delayed_threads
16383
-'#--------------------FN_DYNVARS_078_04-------------------------#'
+'#--------------------FN_DYNVARS_075_04-------------------------#'
SET @@session.max_insert_delayed_threads = 1;
ERROR 42000: Variable 'max_insert_delayed_threads' can't be set to the value of '1'
SELECT @@session.max_insert_delayed_threads;
@@session.max_insert_delayed_threads
-1000
+20
SET @@session.max_insert_delayed_threads = 1025;
ERROR 42000: Variable 'max_insert_delayed_threads' can't be set to the value of '1025'
SELECT @@session.max_insert_delayed_threads;
@@session.max_insert_delayed_threads
-1000
+20
SET @@session.max_insert_delayed_threads = 0;
SELECT @@session.max_insert_delayed_threads;
@@session.max_insert_delayed_threads
@@ -75,7 +72,7 @@ SET @@session.max_insert_delayed_threads = 16383;
SELECT @@session.max_insert_delayed_threads;
@@session.max_insert_delayed_threads
16383
-'#------------------FN_DYNVARS_078_05-----------------------#'
+'#------------------FN_DYNVARS_075_05-----------------------#'
SET @@global.max_insert_delayed_threads = -1024;
Warnings:
Warning 1292 Truncated incorrect max_insert_delayed_threads value: '-1024'
@@ -94,8 +91,8 @@ Warning 1292 Truncated incorrect max_insert_delayed_threads value: '16385'
SELECT @@global.max_insert_delayed_threads;
@@global.max_insert_delayed_threads
16384
-SET @@global.max_insert_delayed_threads = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.max_insert_delayed_threads = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'max_insert_delayed_threads'
SELECT @@global.max_insert_delayed_threads;
@@global.max_insert_delayed_threads
16384
@@ -105,45 +102,49 @@ SELECT @@global.max_insert_delayed_threads;
@@global.max_insert_delayed_threads
16384
SET @@session.max_insert_delayed_threads = 16385;
-ERROR 42000: Variable 'max_insert_delayed_threads' can't be set to the value of '16385'
+Warnings:
+Warning 1292 Truncated incorrect max_insert_delayed_threads value: '16385'
SELECT @@session.max_insert_delayed_threads;
@@session.max_insert_delayed_threads
-16383
+16384
SET @@session.max_insert_delayed_threads = -1;
-ERROR 42000: Variable 'max_insert_delayed_threads' can't be set to the value of '-1'
+Warnings:
+Warning 1292 Truncated incorrect max_insert_delayed_threads value: '-1'
SELECT @@session.max_insert_delayed_threads;
@@session.max_insert_delayed_threads
-16383
+0
SET @@session.max_insert_delayed_threads = -2;
-ERROR 42000: Variable 'max_insert_delayed_threads' can't be set to the value of '-2'
+Warnings:
+Warning 1292 Truncated incorrect max_insert_delayed_threads value: '-2'
SELECT @@session.max_insert_delayed_threads;
@@session.max_insert_delayed_threads
-16383
-SET @@session.max_insert_delayed_threads = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+0
+SET @@session.max_insert_delayed_threads = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'max_insert_delayed_threads'
SET @@session.max_insert_delayed_threads = 10737418241;
-ERROR 42000: Variable 'max_insert_delayed_threads' can't be set to the value of '10737418241'
+Warnings:
+Warning 1292 Truncated incorrect max_insert_delayed_threads value: '10737418241'
SELECT @@session.max_insert_delayed_threads;
@@session.max_insert_delayed_threads
-16383
+16384
SET @@session.max_insert_delayed_threads = test;
ERROR 42000: Incorrect argument type to variable 'max_insert_delayed_threads'
SELECT @@session.max_insert_delayed_threads;
@@session.max_insert_delayed_threads
-16383
-'#------------------FN_DYNVARS_078_06-----------------------#'
+16384
+'#------------------FN_DYNVARS_075_06-----------------------#'
SELECT @@global.max_insert_delayed_threads = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='max_insert_delayed_threads';
@@global.max_insert_delayed_threads = VARIABLE_VALUE
1
-'#------------------FN_DYNVARS_078_07-----------------------#'
+'#------------------FN_DYNVARS_075_07-----------------------#'
SELECT @@session.max_insert_delayed_threads = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='max_insert_delayed_threads';
@@session.max_insert_delayed_threads = VARIABLE_VALUE
1
-'#------------------FN_DYNVARS_078_08-----------------------#'
+'#------------------FN_DYNVARS_075_08-----------------------#'
SET @@global.max_insert_delayed_threads = TRUE;
SELECT @@global.max_insert_delayed_threads;
@@global.max_insert_delayed_threads
@@ -152,12 +153,12 @@ SET @@global.max_insert_delayed_threads = FALSE;
SELECT @@global.max_insert_delayed_threads;
@@global.max_insert_delayed_threads
0
-'#---------------------FN_DYNVARS_078_09----------------------#'
+'#---------------------FN_DYNVARS_001_09----------------------#'
SET @@global.max_insert_delayed_threads = 2048;
SELECT @@max_insert_delayed_threads = @@global.max_insert_delayed_threads;
@@max_insert_delayed_threads = @@global.max_insert_delayed_threads
0
-'#---------------------FN_DYNVARS_078_10----------------------#'
+'#---------------------FN_DYNVARS_001_10----------------------#'
SET @@max_insert_delayed_threads = 100000;
ERROR 42000: Variable 'max_insert_delayed_threads' can't be set to the value of '100000'
SELECT @@max_insert_delayed_threads = @@local.max_insert_delayed_threads;
@@ -166,12 +167,12 @@ SELECT @@max_insert_delayed_threads = @@local.max_insert_delayed_threads;
SELECT @@local.max_insert_delayed_threads = @@session.max_insert_delayed_threads;
@@local.max_insert_delayed_threads = @@session.max_insert_delayed_threads
1
-'#---------------------FN_DYNVARS_078_11----------------------#'
+'#---------------------FN_DYNVARS_001_11----------------------#'
SET max_insert_delayed_threads = 1024;
ERROR 42000: Variable 'max_insert_delayed_threads' can't be set to the value of '1024'
SELECT @@max_insert_delayed_threads;
@@max_insert_delayed_threads
-16383
+16384
SELECT local.max_insert_delayed_threads;
ERROR 42S02: Unknown table 'local' in field list
SELECT session.max_insert_delayed_threads;
diff --git a/mysql-test/suite/sys_vars/r/max_join_size_basic.result b/mysql-test/suite/sys_vars/r/max_join_size_basic.result
new file mode 100644
index 00000000000..5cebefe9ea3
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/max_join_size_basic.result
@@ -0,0 +1,51 @@
+SET @start_global_value = @@global.max_join_size;
+SELECT @start_global_value;
+@start_global_value
+18446744073709551615
+select @@global.max_join_size;
+@@global.max_join_size
+18446744073709551615
+select @@session.max_join_size;
+@@session.max_join_size
+18446744073709551615
+show global variables like 'max_join_size';
+Variable_name Value
+max_join_size 18446744073709551615
+show session variables like 'max_join_size';
+Variable_name Value
+max_join_size 18446744073709551615
+select * from information_schema.global_variables where variable_name='max_join_size';
+VARIABLE_NAME VARIABLE_VALUE
+MAX_JOIN_SIZE 18446744073709551615
+select * from information_schema.session_variables where variable_name='max_join_size';
+VARIABLE_NAME VARIABLE_VALUE
+MAX_JOIN_SIZE 18446744073709551615
+set global max_join_size=10;
+select @@global.max_join_size;
+@@global.max_join_size
+10
+set session max_join_size=20;
+select @@session.max_join_size;
+@@session.max_join_size
+20
+set global max_join_size=1.1;
+ERROR 42000: Incorrect argument type to variable 'max_join_size'
+set global max_join_size=1e1;
+ERROR 42000: Incorrect argument type to variable 'max_join_size'
+set global max_join_size="foo";
+ERROR 42000: Incorrect argument type to variable 'max_join_size'
+select @@sql_big_selects;
+@@sql_big_selects
+0
+set max_join_size=cast(-1 as unsigned int);
+select @@sql_big_selects;
+@@sql_big_selects
+1
+set max_join_size=100;
+select @@sql_big_selects;
+@@sql_big_selects
+0
+SET @@global.max_join_size = @start_global_value;
+SELECT @@global.max_join_size;
+@@global.max_join_size
+18446744073709551615
diff --git a/mysql-test/suite/sys_vars/r/max_length_for_sort_data_basic.result b/mysql-test/suite/sys_vars/r/max_length_for_sort_data_basic.result
index 8936946c774..21d6f66f0bc 100644
--- a/mysql-test/suite/sys_vars/r/max_length_for_sort_data_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_length_for_sort_data_basic.result
@@ -93,8 +93,8 @@ Warning 1292 Truncated incorrect max_length_for_sort_data value: '0'
SELECT @@global.max_length_for_sort_data;
@@global.max_length_for_sort_data
4
-SET @@global.max_length_for_sort_data = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.max_length_for_sort_data = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'max_length_for_sort_data'
SELECT @@global.max_length_for_sort_data;
@@global.max_length_for_sort_data
4
@@ -127,8 +127,8 @@ Warning 1292 Truncated incorrect max_length_for_sort_data value: '0'
SELECT @@session.max_length_for_sort_data;
@@session.max_length_for_sort_data
4
-SET @@session.max_length_for_sort_data = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.max_length_for_sort_data = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'max_length_for_sort_data'
SET @@session.max_length_for_sort_data = 10737418241;
Warnings:
Warning 1292 Truncated incorrect max_length_for_sort_data value: '10737418241'
diff --git a/mysql-test/suite/sys_vars/r/max_prepared_stmt_count_basic.result b/mysql-test/suite/sys_vars/r/max_prepared_stmt_count_basic.result
index 9c28c287980..adfb9be367b 100644
--- a/mysql-test/suite/sys_vars/r/max_prepared_stmt_count_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_prepared_stmt_count_basic.result
@@ -70,7 +70,6 @@ Warning 1292 Truncated incorrect max_prepared_stmt_count value: '104857612'
SELECT @@global.max_prepared_stmt_count;
@@global.max_prepared_stmt_count
1048576
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@global.max_prepared_stmt_count = ON;
ERROR 42000: Incorrect argument type to variable 'max_prepared_stmt_count'
SELECT @@global.max_prepared_stmt_count;
diff --git a/mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result b/mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result
index 168459cf7b6..73d957accc1 100644
--- a/mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result
@@ -4,6 +4,8 @@ SELECT @start_value;
0
'#--------------------FN_DYNVARS_082_01------------------------#'
SET @@global.max_relay_log_size = 5000;
+Warnings:
+Warning 1292 Truncated incorrect max_relay_log_size value: '5000'
SET @@global.max_relay_log_size = DEFAULT;
SELECT @@global.max_relay_log_size;
@@global.max_relay_log_size
@@ -13,13 +15,14 @@ SET @@global.max_relay_log_size = @start_value;
SELECT @@global.max_relay_log_size = 1024;
@@global.max_relay_log_size = 1024
0
-'Bug# 34876: This variable has invalid default value as compared to documentation';
'#--------------------FN_DYNVARS_082_03------------------------#'
SET @@global.max_relay_log_size = 0;
SELECT @@global.max_relay_log_size;
@@global.max_relay_log_size
0
SET @@global.max_relay_log_size = 1;
+Warnings:
+Warning 1292 Truncated incorrect max_relay_log_size value: '1'
SELECT @@global.max_relay_log_size;
@@global.max_relay_log_size
0
@@ -28,14 +31,17 @@ SELECT @@global.max_relay_log_size;
@@global.max_relay_log_size
1073741824
SET @@global.max_relay_log_size = 1073741823;
+Warnings:
+Warning 1292 Truncated incorrect max_relay_log_size value: '1073741823'
SELECT @@global.max_relay_log_size;
@@global.max_relay_log_size
1073737728
SET @@global.max_relay_log_size = 65535;
+Warnings:
+Warning 1292 Truncated incorrect max_relay_log_size value: '65535'
SELECT @@global.max_relay_log_size;
@@global.max_relay_log_size
61440
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
'#--------------------FN_DYNVARS_082_04-------------------------#'
SET @@global.max_relay_log_size = -1;
Warnings:
@@ -72,7 +78,6 @@ Warning 1292 Truncated incorrect max_relay_log_size value: '10737418241'
SELECT @@global.max_relay_log_size;
@@global.max_relay_log_size
1073741824
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@global.max_relay_log_size = ON;
ERROR 42000: Incorrect argument type to variable 'max_relay_log_size'
SELECT @@global.max_relay_log_size;
@@ -101,6 +106,8 @@ WHERE VARIABLE_NAME='max_relay_log_size';
1
'#---------------------FN_DYNVARS_082_07----------------------#'
SET @@global.max_relay_log_size = TRUE;
+Warnings:
+Warning 1292 Truncated incorrect max_relay_log_size value: '1'
SELECT @@global.max_relay_log_size;
@@global.max_relay_log_size
0
@@ -110,6 +117,8 @@ SELECT @@global.max_relay_log_size;
0
'#---------------------FN_DYNVARS_082_08----------------------#'
SET @@global.max_relay_log_size = 5000;
+Warnings:
+Warning 1292 Truncated incorrect max_relay_log_size value: '5000'
SELECT @@max_relay_log_size = @@global.max_relay_log_size;
@@max_relay_log_size = @@global.max_relay_log_size
1
diff --git a/mysql-test/suite/sys_vars/r/max_seeks_for_key_basic_32.result b/mysql-test/suite/sys_vars/r/max_seeks_for_key_basic_32.result
index 9a58ad44cff..2973e7e1efd 100644
--- a/mysql-test/suite/sys_vars/r/max_seeks_for_key_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/max_seeks_for_key_basic_32.result
@@ -87,8 +87,8 @@ Warning 1292 Truncated incorrect max_seeks_for_key value: '4294967296'
SELECT @@global.max_seeks_for_key;
@@global.max_seeks_for_key
4294967295
-SET @@global.max_seeks_for_key = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.max_seeks_for_key = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'max_seeks_for_key'
SELECT @@global.max_seeks_for_key;
@@global.max_seeks_for_key
4294967295
@@ -109,15 +109,14 @@ Warning 1292 Truncated incorrect max_seeks_for_key value: '-2'
SELECT @@session.max_seeks_for_key;
@@session.max_seeks_for_key
1
-SET @@session.max_seeks_for_key = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.max_seeks_for_key = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'max_seeks_for_key'
SET @@session.max_seeks_for_key = 4294967296;
Warnings:
Warning 1292 Truncated incorrect max_seeks_for_key value: '4294967296'
SELECT @@session.max_seeks_for_key;
@@session.max_seeks_for_key
4294967295
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@session.max_seeks_for_key = test;
ERROR 42000: Incorrect argument type to variable 'max_seeks_for_key'
SELECT @@session.max_seeks_for_key;
diff --git a/mysql-test/suite/sys_vars/r/max_seeks_for_key_basic_64.result b/mysql-test/suite/sys_vars/r/max_seeks_for_key_basic_64.result
index 5b1e076c188..ef48f229abc 100644
--- a/mysql-test/suite/sys_vars/r/max_seeks_for_key_basic_64.result
+++ b/mysql-test/suite/sys_vars/r/max_seeks_for_key_basic_64.result
@@ -85,8 +85,8 @@ SET @@global.max_seeks_for_key = 4294967296;
SELECT @@global.max_seeks_for_key;
@@global.max_seeks_for_key
4294967296
-SET @@global.max_seeks_for_key = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.max_seeks_for_key = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'max_seeks_for_key'
SELECT @@global.max_seeks_for_key;
@@global.max_seeks_for_key
4294967296
@@ -107,13 +107,12 @@ Warning 1292 Truncated incorrect max_seeks_for_key value: '-2'
SELECT @@session.max_seeks_for_key;
@@session.max_seeks_for_key
1
-SET @@session.max_seeks_for_key = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.max_seeks_for_key = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'max_seeks_for_key'
SET @@session.max_seeks_for_key = 4294967296;
SELECT @@session.max_seeks_for_key;
@@session.max_seeks_for_key
4294967296
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@session.max_seeks_for_key = test;
ERROR 42000: Incorrect argument type to variable 'max_seeks_for_key'
SELECT @@session.max_seeks_for_key;
diff --git a/mysql-test/suite/sys_vars/r/max_sort_length_basic.result b/mysql-test/suite/sys_vars/r/max_sort_length_basic.result
index f0a9ca83376..a8876b2c81e 100644
--- a/mysql-test/suite/sys_vars/r/max_sort_length_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_sort_length_basic.result
@@ -93,8 +93,8 @@ Warning 1292 Truncated incorrect max_sort_length value: '0'
SELECT @@global.max_sort_length;
@@global.max_sort_length
4
-SET @@global.max_sort_length = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.max_sort_length = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'max_sort_length'
SELECT @@global.max_sort_length;
@@global.max_sort_length
4
@@ -127,8 +127,8 @@ Warning 1292 Truncated incorrect max_sort_length value: '0'
SELECT @@session.max_sort_length;
@@session.max_sort_length
4
-SET @@session.max_sort_length = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.max_sort_length = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'max_sort_length'
SET @@session.max_sort_length = 10737418241;
Warnings:
Warning 1292 Truncated incorrect max_sort_length value: '10737418241'
diff --git a/mysql-test/suite/sys_vars/r/max_sp_recursion_depth_basic.result b/mysql-test/suite/sys_vars/r/max_sp_recursion_depth_basic.result
index e5f267253f4..b3d4917fd75 100644
--- a/mysql-test/suite/sys_vars/r/max_sp_recursion_depth_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_sp_recursion_depth_basic.result
@@ -97,8 +97,8 @@ Warning 1292 Truncated incorrect max_sp_recursion_depth value: '3000'
SELECT @@global.max_sp_recursion_depth;
@@global.max_sp_recursion_depth
255
-SET @@global.max_sp_recursion_depth = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.max_sp_recursion_depth = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'max_sp_recursion_depth'
SELECT @@global.max_sp_recursion_depth;
@@global.max_sp_recursion_depth
255
@@ -131,8 +131,8 @@ Warning 1292 Truncated incorrect max_sp_recursion_depth value: '-1'
SELECT @@session.max_sp_recursion_depth;
@@session.max_sp_recursion_depth
0
-SET @@session.max_sp_recursion_depth = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.max_sp_recursion_depth = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'max_sp_recursion_depth'
SET @@session.max_sp_recursion_depth = 10737418241;
Warnings:
Warning 1292 Truncated incorrect max_sp_recursion_depth value: '10737418241'
diff --git a/mysql-test/suite/sys_vars/r/max_tmp_tables_basic_32.result b/mysql-test/suite/sys_vars/r/max_tmp_tables_basic_32.result
index 1346d24ca47..5daf78fcae1 100644
--- a/mysql-test/suite/sys_vars/r/max_tmp_tables_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/max_tmp_tables_basic_32.result
@@ -93,8 +93,8 @@ Warning 1292 Truncated incorrect max_tmp_tables value: '429496729500'
SELECT @@global.max_tmp_tables;
@@global.max_tmp_tables
4294967295
-SET @@global.max_tmp_tables = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.max_tmp_tables = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'max_tmp_tables'
SELECT @@global.max_tmp_tables;
@@global.max_tmp_tables
4294967295
@@ -127,8 +127,8 @@ Warning 1292 Truncated incorrect max_tmp_tables value: '-1'
SELECT @@session.max_tmp_tables;
@@session.max_tmp_tables
1
-SET @@session.max_tmp_tables = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.max_tmp_tables = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'max_tmp_tables'
SET @@session.max_tmp_tables = 10737418241;
Warnings:
Warning 1292 Truncated incorrect max_tmp_tables value: '10737418241'
diff --git a/mysql-test/suite/sys_vars/r/max_tmp_tables_basic_64.result b/mysql-test/suite/sys_vars/r/max_tmp_tables_basic_64.result
index 808e99b739d..32953d24b2b 100644
--- a/mysql-test/suite/sys_vars/r/max_tmp_tables_basic_64.result
+++ b/mysql-test/suite/sys_vars/r/max_tmp_tables_basic_64.result
@@ -89,8 +89,8 @@ SET @@global.max_tmp_tables = 429496729500;
SELECT @@global.max_tmp_tables;
@@global.max_tmp_tables
429496729500
-SET @@global.max_tmp_tables = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.max_tmp_tables = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'max_tmp_tables'
SELECT @@global.max_tmp_tables;
@@global.max_tmp_tables
429496729500
@@ -119,8 +119,8 @@ Warning 1292 Truncated incorrect max_tmp_tables value: '-1'
SELECT @@session.max_tmp_tables;
@@session.max_tmp_tables
1
-SET @@session.max_tmp_tables = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.max_tmp_tables = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'max_tmp_tables'
SET @@session.max_tmp_tables = 10737418241;
SELECT @@session.max_tmp_tables;
@@session.max_tmp_tables
diff --git a/mysql-test/suite/sys_vars/r/max_user_connections_basic.result b/mysql-test/suite/sys_vars/r/max_user_connections_basic.result
index 3250b2f03ea..cc43b631085 100644
--- a/mysql-test/suite/sys_vars/r/max_user_connections_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_user_connections_basic.result
@@ -13,23 +13,17 @@ SELECT @@global.max_user_connections;
@@global.max_user_connections
0
SET @@session.max_user_connections = 1000;
-ERROR HY000: Variable 'max_user_connections' is a GLOBAL variable and should be set with SET GLOBAL
-SET @@session.max_user_connections = DEFAULT;
-ERROR 42000: Variable 'max_user_connections' doesn't have a default value
-SELECT @@session.max_user_connections;
-@@session.max_user_connections
-0
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+ERROR HY000: SESSION variable 'max_user_connections' is read-only. Use SET GLOBAL to assign the value
'#--------------------FN_DYNVARS_087_02-------------------------#'
SET @@global.max_user_connections = DEFAULT;
SELECT @@global.max_user_connections = 0;
@@global.max_user_connections = 0
1
SET @@session.max_user_connections = DEFAULT;
-ERROR 42000: Variable 'max_user_connections' doesn't have a default value
-SELECT @@session.max_user_connections = 0;
-@@session.max_user_connections = 0
-1
+ERROR HY000: SESSION variable 'max_user_connections' is read-only. Use SET GLOBAL to assign the value
+SELECT @@session.max_user_connections;
+@@session.max_user_connections
+0
'#--------------------FN_DYNVARS_087_03-------------------------#'
SET @@global.max_user_connections = 1;
SELECT @@global.max_user_connections;
@@ -53,31 +47,39 @@ SELECT @@global.max_user_connections;
4294967294
'#------------------FN_DYNVARS_087_05-----------------------#'
SET @@global.max_user_connections = -1024;
+Warnings:
+Warning 1292 Truncated incorrect max_user_connections value: '-1024'
SELECT @@global.max_user_connections;
@@global.max_user_connections
-4294966272
+0
SET @@global.max_user_connections = 4294967296;
+Warnings:
+Warning 1292 Truncated incorrect max_user_connections value: '4294967296'
SELECT @@global.max_user_connections;
@@global.max_user_connections
-0
+4294967295
SET @@global.max_user_connections = -1;
+Warnings:
+Warning 1292 Truncated incorrect max_user_connections value: '-1'
SELECT @@global.max_user_connections;
@@global.max_user_connections
-4294967295
+0
SET @@global.max_user_connections = 429496729500;
+Warnings:
+Warning 1292 Truncated incorrect max_user_connections value: '429496729500'
SELECT @@global.max_user_connections;
@@global.max_user_connections
-4294967196
-SET @@global.max_user_connections = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+4294967295
+SET @@global.max_user_connections = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'max_user_connections'
SELECT @@global.max_user_connections;
@@global.max_user_connections
-4294967196
+4294967295
SET @@global.max_user_connections = test;
ERROR 42000: Incorrect argument type to variable 'max_user_connections'
SELECT @@global.max_user_connections;
@@global.max_user_connections
-4294967196
+4294967295
'#------------------FN_DYNVARS_087_06-----------------------#'
SELECT @@global.max_user_connections = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
diff --git a/mysql-test/suite/sys_vars/r/max_write_lock_count_basic_32.result b/mysql-test/suite/sys_vars/r/max_write_lock_count_basic_32.result
index 24af37260b7..59d92d5cfe8 100644
--- a/mysql-test/suite/sys_vars/r/max_write_lock_count_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/max_write_lock_count_basic_32.result
@@ -59,8 +59,8 @@ Warning 1292 Truncated incorrect max_write_lock_count value: '429496729500'
SELECT @@global.max_write_lock_count;
@@global.max_write_lock_count
4294967295
-SET @@global.max_write_lock_count = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.max_write_lock_count = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'max_write_lock_count'
SELECT @@global.max_write_lock_count;
@@global.max_write_lock_count
4294967295
diff --git a/mysql-test/suite/sys_vars/r/max_write_lock_count_basic_64.result b/mysql-test/suite/sys_vars/r/max_write_lock_count_basic_64.result
index 934777e38d3..af675e40e19 100644
--- a/mysql-test/suite/sys_vars/r/max_write_lock_count_basic_64.result
+++ b/mysql-test/suite/sys_vars/r/max_write_lock_count_basic_64.result
@@ -55,8 +55,8 @@ SET @@global.max_write_lock_count = 429496729500;
SELECT @@global.max_write_lock_count;
@@global.max_write_lock_count
429496729500
-SET @@global.max_write_lock_count = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.max_write_lock_count = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'max_write_lock_count'
SELECT @@global.max_write_lock_count;
@@global.max_write_lock_count
429496729500
diff --git a/mysql-test/suite/sys_vars/r/maximum_basic.result b/mysql-test/suite/sys_vars/r/maximum_basic.result
new file mode 100644
index 00000000000..20b6bbc962e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/maximum_basic.result
@@ -0,0 +1,18 @@
+SET @@session.auto_increment_increment=40960;
+Warnings:
+Warning 1292 Truncated incorrect auto_increment_increment value: '40960'
+SELECT @@session.auto_increment_increment;
+@@session.auto_increment_increment
+8192
+SET @@session.tmp_table_size=40960;
+Warnings:
+Warning 1292 Truncated incorrect tmp_table_size value: '40960'
+SELECT @@session.tmp_table_size;
+@@session.tmp_table_size
+8192
+SET @@session.max_join_size=40960;
+Warnings:
+Warning 1292 Truncated incorrect max_join_size value: '40960'
+SELECT @@session.max_join_size;
+@@session.max_join_size
+8192
diff --git a/mysql-test/suite/sys_vars/r/min_examined_row_limit_basic_32.result b/mysql-test/suite/sys_vars/r/min_examined_row_limit_basic_32.result
index c40640ffa3a..b4b1b9ae402 100644
--- a/mysql-test/suite/sys_vars/r/min_examined_row_limit_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/min_examined_row_limit_basic_32.result
@@ -93,8 +93,8 @@ Warning 1292 Truncated incorrect min_examined_row_limit value: '429496729500'
SELECT @@global.min_examined_row_limit;
@@global.min_examined_row_limit
4294967295
-SET @@global.min_examined_row_limit = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.min_examined_row_limit = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'min_examined_row_limit'
SELECT @@global.min_examined_row_limit;
@@global.min_examined_row_limit
4294967295
@@ -115,15 +115,14 @@ Warning 1292 Truncated incorrect min_examined_row_limit value: '-1'
SELECT @@session.min_examined_row_limit;
@@session.min_examined_row_limit
0
-SET @@session.min_examined_row_limit = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.min_examined_row_limit = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'min_examined_row_limit'
SET @@session.min_examined_row_limit = 4294967295021;
Warnings:
Warning 1292 Truncated incorrect min_examined_row_limit value: '4294967295021'
SELECT @@session.min_examined_row_limit;
@@session.min_examined_row_limit
4294967295
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@session.min_examined_row_limit = test;
ERROR 42000: Incorrect argument type to variable 'min_examined_row_limit'
SELECT @@session.min_examined_row_limit;
diff --git a/mysql-test/suite/sys_vars/r/min_examined_row_limit_basic_64.result b/mysql-test/suite/sys_vars/r/min_examined_row_limit_basic_64.result
index 5cf77ed6dc8..30ccfce0175 100644
--- a/mysql-test/suite/sys_vars/r/min_examined_row_limit_basic_64.result
+++ b/mysql-test/suite/sys_vars/r/min_examined_row_limit_basic_64.result
@@ -91,8 +91,8 @@ SET @@global.min_examined_row_limit = 429496729500;
SELECT @@global.min_examined_row_limit;
@@global.min_examined_row_limit
429496729500
-SET @@global.min_examined_row_limit = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.min_examined_row_limit = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'min_examined_row_limit'
SELECT @@global.min_examined_row_limit;
@@global.min_examined_row_limit
429496729500
@@ -111,13 +111,12 @@ Warning 1292 Truncated incorrect min_examined_row_limit value: '-1'
SELECT @@session.min_examined_row_limit;
@@session.min_examined_row_limit
0
-SET @@session.min_examined_row_limit = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.min_examined_row_limit = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'min_examined_row_limit'
SET @@session.min_examined_row_limit = 4294967295021;
SELECT @@session.min_examined_row_limit;
@@session.min_examined_row_limit
4294967295021
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@session.min_examined_row_limit = test;
ERROR 42000: Incorrect argument type to variable 'min_examined_row_limit'
SELECT @@session.min_examined_row_limit;
diff --git a/mysql-test/suite/sys_vars/r/myisam_data_pointer_size_basic.result b/mysql-test/suite/sys_vars/r/myisam_data_pointer_size_basic.result
index 86f7788fcdf..be5731c83bd 100644
--- a/mysql-test/suite/sys_vars/r/myisam_data_pointer_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/myisam_data_pointer_size_basic.result
@@ -70,8 +70,8 @@ Warning 1292 Truncated incorrect myisam_data_pointer_size value: '4294967296'
SELECT @@global.myisam_data_pointer_size;
@@global.myisam_data_pointer_size
7
-SET @@global.myisam_data_pointer_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.myisam_data_pointer_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'myisam_data_pointer_size'
SELECT @@global.myisam_data_pointer_size;
@@global.myisam_data_pointer_size
7
@@ -80,7 +80,6 @@ ERROR 42000: Incorrect argument type to variable 'myisam_data_pointer_size'
SELECT @@global.myisam_data_pointer_size;
@@global.myisam_data_pointer_size
7
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
'#------------------FN_DYNVARS_093_06-----------------------#'
SET @@global.myisam_data_pointer_size = 3;
SELECT @@global.myisam_data_pointer_size = VARIABLE_VALUE
diff --git a/mysql-test/suite/sys_vars/r/myisam_data_pointer_size_func.result b/mysql-test/suite/sys_vars/r/myisam_data_pointer_size_func.result
index 82d9a7dad66..58bb0d0b52b 100644
--- a/mysql-test/suite/sys_vars/r/myisam_data_pointer_size_func.result
+++ b/mysql-test/suite/sys_vars/r/myisam_data_pointer_size_func.result
@@ -1,3 +1,4 @@
+call mtr.add_suppression("The table 't1' is full");
'#--------------------FN_DYNVARS_093_01-------------------------#'
SET @start_value= @@global.myisam_data_pointer_size;
SET @@global.myisam_data_pointer_size = 2;
diff --git a/mysql-test/suite/sys_vars/r/myisam_max_sort_file_size_basic_32.result b/mysql-test/suite/sys_vars/r/myisam_max_sort_file_size_basic_32.result
index b2a8603de92..ab4f136db6f 100644
--- a/mysql-test/suite/sys_vars/r/myisam_max_sort_file_size_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/myisam_max_sort_file_size_basic_32.result
@@ -4,11 +4,12 @@ SELECT @start_global_value;
2146435072
'#--------------------FN_DYNVARS_094_01-------------------------#'
SET @@global.myisam_max_sort_file_size = 500000;
+Warnings:
+Warning 1292 Truncated incorrect myisam_max_sort_file_size value: '500000'
SET @@global.myisam_max_sort_file_size = DEFAULT;
SELECT @@global.myisam_max_sort_file_size;
@@global.myisam_max_sort_file_size
2146435072
-'Bug# 34876: This variable has invalid default value as compared to documentation';
'#--------------------FN_DYNVARS_094_02-------------------------#'
SET @@global.myisam_max_sort_file_size = DEFAULT;
SELECT @@global.myisam_max_sort_file_size = 2147483648;
@@ -20,10 +21,14 @@ SELECT @@global.myisam_max_sort_file_size;
@@global.myisam_max_sort_file_size
0
SET @@global.myisam_max_sort_file_size = 1024;
+Warnings:
+Warning 1292 Truncated incorrect myisam_max_sort_file_size value: '1024'
SELECT @@global.myisam_max_sort_file_size;
@@global.myisam_max_sort_file_size
0
SET @@global.myisam_max_sort_file_size = 123456789;
+Warnings:
+Warning 1292 Truncated incorrect myisam_max_sort_file_size value: '123456789'
SELECT @@global.myisam_max_sort_file_size;
@@global.myisam_max_sort_file_size
122683392
@@ -65,8 +70,8 @@ Warning 1292 Truncated incorrect myisam_max_sort_file_size value: '-2147483649'
SELECT @@global.myisam_max_sort_file_size;
@@global.myisam_max_sort_file_size
0
-SET @@global.myisam_max_sort_file_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.myisam_max_sort_file_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'myisam_max_sort_file_size'
SELECT @@global.myisam_max_sort_file_size;
@@global.myisam_max_sort_file_size
0
@@ -77,9 +82,10 @@ SELECT @@global.myisam_max_sort_file_size;
0
SET @@global.myisam_max_sort_file_size = 1G;
ERROR 42000: Incorrect argument type to variable 'myisam_max_sort_file_size'
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
'#------------------FN_DYNVARS_094_06-----------------------#'
SET @@global.myisam_max_sort_file_size = 3000;
+Warnings:
+Warning 1292 Truncated incorrect myisam_max_sort_file_size value: '3000'
SELECT @@global.myisam_max_sort_file_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='myisam_max_sort_file_size';
@@ -93,6 +99,8 @@ count(VARIABLE_VALUE)
1
'#------------------FN_DYNVARS_094_08-----------------------#'
SET @@global.myisam_max_sort_file_size = TRUE;
+Warnings:
+Warning 1292 Truncated incorrect myisam_max_sort_file_size value: '1'
SELECT @@global.myisam_max_sort_file_size;
@@global.myisam_max_sort_file_size
0
@@ -102,6 +110,8 @@ SELECT @@global.myisam_max_sort_file_size;
0
'#---------------------FN_DYNVARS_001_09----------------------#'
SET @@global.myisam_max_sort_file_size = 512;
+Warnings:
+Warning 1292 Truncated incorrect myisam_max_sort_file_size value: '512'
SELECT @@myisam_max_sort_file_size = @@global.myisam_max_sort_file_size;
@@myisam_max_sort_file_size = @@global.myisam_max_sort_file_size
1
@@ -114,6 +124,8 @@ SELECT @@myisam_max_sort_file_size;
@@myisam_max_sort_file_size
0
SET global myisam_max_sort_file_size = 64;
+Warnings:
+Warning 1292 Truncated incorrect myisam_max_sort_file_size value: '64'
SET @@global.myisam_max_sort_file_size = @start_global_value;
SELECT @@global.myisam_max_sort_file_size;
@@global.myisam_max_sort_file_size
diff --git a/mysql-test/suite/sys_vars/r/myisam_max_sort_file_size_basic_64.result b/mysql-test/suite/sys_vars/r/myisam_max_sort_file_size_basic_64.result
index df2a49e4dd5..0cef4de3630 100644
--- a/mysql-test/suite/sys_vars/r/myisam_max_sort_file_size_basic_64.result
+++ b/mysql-test/suite/sys_vars/r/myisam_max_sort_file_size_basic_64.result
@@ -4,11 +4,12 @@ SELECT @start_global_value;
9223372036853727232
'#--------------------FN_DYNVARS_094_01-------------------------#'
SET @@global.myisam_max_sort_file_size = 500000;
+Warnings:
+Warning 1292 Truncated incorrect myisam_max_sort_file_size value: '500000'
SET @@global.myisam_max_sort_file_size = DEFAULT;
SELECT @@global.myisam_max_sort_file_size;
@@global.myisam_max_sort_file_size
9223372036853727232
-'Bug# 34876: This variable has invalid default value as compared to documentation';
'#--------------------FN_DYNVARS_094_02-------------------------#'
SET @@global.myisam_max_sort_file_size = DEFAULT;
SELECT @@global.myisam_max_sort_file_size = 2147483648;
@@ -20,10 +21,14 @@ SELECT @@global.myisam_max_sort_file_size;
@@global.myisam_max_sort_file_size
0
SET @@global.myisam_max_sort_file_size = 1024;
+Warnings:
+Warning 1292 Truncated incorrect myisam_max_sort_file_size value: '1024'
SELECT @@global.myisam_max_sort_file_size;
@@global.myisam_max_sort_file_size
0
SET @@global.myisam_max_sort_file_size = 123456789;
+Warnings:
+Warning 1292 Truncated incorrect myisam_max_sort_file_size value: '123456789'
SELECT @@global.myisam_max_sort_file_size;
@@global.myisam_max_sort_file_size
122683392
@@ -65,8 +70,8 @@ Warning 1292 Truncated incorrect myisam_max_sort_file_size value: '-2147483649'
SELECT @@global.myisam_max_sort_file_size;
@@global.myisam_max_sort_file_size
0
-SET @@global.myisam_max_sort_file_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.myisam_max_sort_file_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'myisam_max_sort_file_size'
SELECT @@global.myisam_max_sort_file_size;
@@global.myisam_max_sort_file_size
0
@@ -77,9 +82,10 @@ SELECT @@global.myisam_max_sort_file_size;
0
SET @@global.myisam_max_sort_file_size = 1G;
ERROR 42000: Incorrect argument type to variable 'myisam_max_sort_file_size'
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
'#------------------FN_DYNVARS_094_06-----------------------#'
SET @@global.myisam_max_sort_file_size = 3000;
+Warnings:
+Warning 1292 Truncated incorrect myisam_max_sort_file_size value: '3000'
SELECT @@global.myisam_max_sort_file_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='myisam_max_sort_file_size';
@@ -93,6 +99,8 @@ count(VARIABLE_VALUE)
1
'#------------------FN_DYNVARS_094_08-----------------------#'
SET @@global.myisam_max_sort_file_size = TRUE;
+Warnings:
+Warning 1292 Truncated incorrect myisam_max_sort_file_size value: '1'
SELECT @@global.myisam_max_sort_file_size;
@@global.myisam_max_sort_file_size
0
@@ -102,6 +110,8 @@ SELECT @@global.myisam_max_sort_file_size;
0
'#---------------------FN_DYNVARS_001_09----------------------#'
SET @@global.myisam_max_sort_file_size = 512;
+Warnings:
+Warning 1292 Truncated incorrect myisam_max_sort_file_size value: '512'
SELECT @@myisam_max_sort_file_size = @@global.myisam_max_sort_file_size;
@@myisam_max_sort_file_size = @@global.myisam_max_sort_file_size
1
@@ -114,6 +124,8 @@ SELECT @@myisam_max_sort_file_size;
@@myisam_max_sort_file_size
0
SET global myisam_max_sort_file_size = 64;
+Warnings:
+Warning 1292 Truncated incorrect myisam_max_sort_file_size value: '64'
SET @@global.myisam_max_sort_file_size = @start_global_value;
SELECT @@global.myisam_max_sort_file_size;
@@global.myisam_max_sort_file_size
diff --git a/mysql-test/suite/sys_vars/r/myisam_mmap_size_basic.result b/mysql-test/suite/sys_vars/r/myisam_mmap_size_basic.result
new file mode 100644
index 00000000000..8919c090e96
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/myisam_mmap_size_basic.result
@@ -0,0 +1,21 @@
+select @@global.myisam_mmap_size;
+@@global.myisam_mmap_size
+18446744073709551615
+select @@session.myisam_mmap_size;
+ERROR HY000: Variable 'myisam_mmap_size' is a GLOBAL variable
+show global variables like 'myisam_mmap_size';
+Variable_name Value
+myisam_mmap_size 18446744073709551615
+show session variables like 'myisam_mmap_size';
+Variable_name Value
+myisam_mmap_size 18446744073709551615
+select * from information_schema.global_variables where variable_name='myisam_mmap_size';
+VARIABLE_NAME VARIABLE_VALUE
+MYISAM_MMAP_SIZE 18446744073709551615
+select * from information_schema.session_variables where variable_name='myisam_mmap_size';
+VARIABLE_NAME VARIABLE_VALUE
+MYISAM_MMAP_SIZE 18446744073709551615
+set global myisam_mmap_size=1;
+ERROR HY000: Variable 'myisam_mmap_size' is a read only variable
+set session myisam_mmap_size=1;
+ERROR HY000: Variable 'myisam_mmap_size' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/myisam_recover_options_basic.result b/mysql-test/suite/sys_vars/r/myisam_recover_options_basic.result
new file mode 100644
index 00000000000..22384d3c6ef
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/myisam_recover_options_basic.result
@@ -0,0 +1,21 @@
+select @@global.myisam_recover_options;
+@@global.myisam_recover_options
+OFF
+select @@session.myisam_recover_options;
+ERROR HY000: Variable 'myisam_recover_options' is a GLOBAL variable
+show global variables like 'myisam_recover_options';
+Variable_name Value
+myisam_recover_options OFF
+show session variables like 'myisam_recover_options';
+Variable_name Value
+myisam_recover_options OFF
+select * from information_schema.global_variables where variable_name='myisam_recover_options';
+VARIABLE_NAME VARIABLE_VALUE
+MYISAM_RECOVER_OPTIONS OFF
+select * from information_schema.session_variables where variable_name='myisam_recover_options';
+VARIABLE_NAME VARIABLE_VALUE
+MYISAM_RECOVER_OPTIONS OFF
+set global myisam_recover_options=1;
+ERROR HY000: Variable 'myisam_recover_options' is a read only variable
+set session myisam_recover_options=1;
+ERROR HY000: Variable 'myisam_recover_options' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/myisam_repair_threads_basic_32.result b/mysql-test/suite/sys_vars/r/myisam_repair_threads_basic_32.result
index 64321814746..491f25a3d07 100644
--- a/mysql-test/suite/sys_vars/r/myisam_repair_threads_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/myisam_repair_threads_basic_32.result
@@ -71,8 +71,8 @@ Warning 1292 Truncated incorrect myisam_repair_threads value: '429496729533'
SELECT @@global.myisam_repair_threads ;
@@global.myisam_repair_threads
4294967295
-SET @@global.myisam_repair_threads = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.myisam_repair_threads = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads'
SELECT @@global.myisam_repair_threads ;
@@global.myisam_repair_threads
4294967295
@@ -108,8 +108,8 @@ Warning 1292 Truncated incorrect myisam_repair_threads value: '-2'
SELECT @@session.myisam_repair_threads ;
@@session.myisam_repair_threads
1
-SET @@session.myisam_repair_threads = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.myisam_repair_threads = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads'
SELECT @@session.myisam_repair_threads ;
@@session.myisam_repair_threads
1
diff --git a/mysql-test/suite/sys_vars/r/myisam_repair_threads_basic_64.result b/mysql-test/suite/sys_vars/r/myisam_repair_threads_basic_64.result
index 0a317d28b11..50589c4041c 100644
--- a/mysql-test/suite/sys_vars/r/myisam_repair_threads_basic_64.result
+++ b/mysql-test/suite/sys_vars/r/myisam_repair_threads_basic_64.result
@@ -69,8 +69,8 @@ SET @@global.myisam_repair_threads = 429496729533;
SELECT @@global.myisam_repair_threads ;
@@global.myisam_repair_threads
429496729533
-SET @@global.myisam_repair_threads = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.myisam_repair_threads = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads'
SELECT @@global.myisam_repair_threads ;
@@global.myisam_repair_threads
429496729533
@@ -106,8 +106,8 @@ Warning 1292 Truncated incorrect myisam_repair_threads value: '-2'
SELECT @@session.myisam_repair_threads ;
@@session.myisam_repair_threads
1
-SET @@session.myisam_repair_threads = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.myisam_repair_threads = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads'
SELECT @@session.myisam_repair_threads ;
@@session.myisam_repair_threads
1
diff --git a/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic.result b/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic.result
deleted file mode 100644
index 74d2fb3ec86..00000000000
--- a/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic.result
+++ /dev/null
@@ -1,184 +0,0 @@
-SET @start_global_value = @@global.myisam_sort_buffer_size ;
-SELECT @start_global_value;
-@start_global_value
-8388608
-SET @start_session_value = @@session.myisam_sort_buffer_size ;
-SELECT @start_session_value;
-@start_session_value
-8388608
-'#--------------------FN_DYNVARS_005_01-------------------------#'
-SET @@global.myisam_sort_buffer_size = 100;
-SET @@global.myisam_sort_buffer_size = DEFAULT;
-SELECT @@global.myisam_sort_buffer_size ;
-@@global.myisam_sort_buffer_size
-8388608
-SET @@session.myisam_sort_buffer_size = 200;
-SET @@session.myisam_sort_buffer_size = DEFAULT;
-SELECT @@session.myisam_sort_buffer_size ;
-@@session.myisam_sort_buffer_size
-8388608
-'#--------------------FN_DYNVARS_005_02-------------------------#'
-SET @@global.myisam_sort_buffer_size = DEFAULT;
-SELECT @@global.myisam_sort_buffer_size = 8388608;
-@@global.myisam_sort_buffer_size = 8388608
-1
-SET @@session.myisam_sort_buffer_size = DEFAULT;
-SELECT @@session.myisam_sort_buffer_size = 8388608;
-@@session.myisam_sort_buffer_size = 8388608
-1
-'#--------------------FN_DYNVARS_005_03-------------------------#'
-SET @@global.myisam_sort_buffer_size = 4;
-SELECT @@global.myisam_sort_buffer_size ;
-@@global.myisam_sort_buffer_size
-4
-SET @@global.myisam_sort_buffer_size = 4294967295;
-SELECT @@global.myisam_sort_buffer_size ;
-@@global.myisam_sort_buffer_size
-4294967295
-SET @@global.myisam_sort_buffer_size = 655354;
-SELECT @@global.myisam_sort_buffer_size ;
-@@global.myisam_sort_buffer_size
-655354
-'#--------------------FN_DYNVARS_005_04-------------------------#'
-SET @@session.myisam_sort_buffer_size = 4;
-SELECT @@session.myisam_sort_buffer_size ;
-@@session.myisam_sort_buffer_size
-4
-SET @@session.myisam_sort_buffer_size = 4294967295;
-SELECT @@session.myisam_sort_buffer_size ;
-@@session.myisam_sort_buffer_size
-4294967295
-SET @@session.myisam_sort_buffer_size = 655345;
-SELECT @@session.myisam_sort_buffer_size ;
-@@session.myisam_sort_buffer_size
-655345
-'#------------------FN_DYNVARS_005_05-----------------------#'
-SET @@global.myisam_sort_buffer_size = 0;
-Warnings:
-Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0'
-SELECT @@global.myisam_sort_buffer_size ;
-@@global.myisam_sort_buffer_size
-4
-SET @@global.myisam_sort_buffer_size = -1024;
-Warnings:
-Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0'
-SELECT @@global.myisam_sort_buffer_size ;
-@@global.myisam_sort_buffer_size
-4
-SET @@global.myisam_sort_buffer_size = 429496729533;
-Warnings:
-Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '429496729533'
-SELECT @@global.myisam_sort_buffer_size ;
-@@global.myisam_sort_buffer_size
-4294967295
-SET @@global.myisam_sort_buffer_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@global.myisam_sort_buffer_size ;
-@@global.myisam_sort_buffer_size
-4294967295
-SET @@global.myisam_sort_buffer_size = test;
-ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size'
-SELECT @@global.myisam_sort_buffer_size ;
-@@global.myisam_sort_buffer_size
-4294967295
-SET @@global.myisam_sort_buffer_size = "test";
-ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size'
-SELECT @@global.myisam_sort_buffer_size ;
-@@global.myisam_sort_buffer_size
-4294967295
-SET @@global.myisam_sort_buffer_size = 'test';
-ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size'
-SELECT @@global.myisam_sort_buffer_size ;
-@@global.myisam_sort_buffer_size
-4294967295
-SET @@global.myisam_sort_buffer_size = ON;
-ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size'
-SELECT @@global.myisam_sort_buffer_size ;
-@@global.myisam_sort_buffer_size
-4294967295
-SET @@session.myisam_sort_buffer_size = 0;
-Warnings:
-Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0'
-SELECT @@session.myisam_sort_buffer_size ;
-@@session.myisam_sort_buffer_size
-4
-SET @@session.myisam_sort_buffer_size = -2;
-Warnings:
-Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0'
-SELECT @@session.myisam_sort_buffer_size ;
-@@session.myisam_sort_buffer_size
-4
-SET @@session.myisam_sort_buffer_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@session.myisam_sort_buffer_size ;
-@@session.myisam_sort_buffer_size
-4
-SET @@session.myisam_sort_buffer_size = test;
-ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size'
-SELECT @@session.myisam_sort_buffer_size ;
-@@session.myisam_sort_buffer_size
-4
-SET @@session.myisam_sort_buffer_size = "test";
-ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size'
-SELECT @@session.myisam_sort_buffer_size ;
-@@session.myisam_sort_buffer_size
-4
-'#------------------FN_DYNVARS_005_06-----------------------#'
-SELECT @@global.myisam_sort_buffer_size = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='myisam_sort_buffer_size ';
-@@global.myisam_sort_buffer_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_005_07-----------------------#'
-SELECT @@session.myisam_sort_buffer_size = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='myisam_sort_buffer_size ';
-@@session.myisam_sort_buffer_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_005_08-----------------------#'
-SET @@global.myisam_sort_buffer_size = TRUE;
-Warnings:
-Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '1'
-SELECT @@global.myisam_sort_buffer_size ;
-@@global.myisam_sort_buffer_size
-4
-SET @@global.myisam_sort_buffer_size = FALSE;
-Warnings:
-Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0'
-SELECT @@global.myisam_sort_buffer_size ;
-@@global.myisam_sort_buffer_size
-4
-'#---------------------FN_DYNVARS_001_09----------------------#'
-SET @@global.myisam_sort_buffer_size = 10;
-SELECT @@myisam_sort_buffer_size = @@global.myisam_sort_buffer_size ;
-@@myisam_sort_buffer_size = @@global.myisam_sort_buffer_size
-0
-'#---------------------FN_DYNVARS_001_10----------------------#'
-SET @@myisam_sort_buffer_size = 100;
-SELECT @@myisam_sort_buffer_size = @@local.myisam_sort_buffer_size ;
-@@myisam_sort_buffer_size = @@local.myisam_sort_buffer_size
-1
-SELECT @@local.myisam_sort_buffer_size = @@session.myisam_sort_buffer_size ;
-@@local.myisam_sort_buffer_size = @@session.myisam_sort_buffer_size
-1
-'#---------------------FN_DYNVARS_001_11----------------------#'
-SET myisam_sort_buffer_size = 1;
-Warnings:
-Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '1'
-SELECT @@myisam_sort_buffer_size ;
-@@myisam_sort_buffer_size
-4
-SELECT local.myisam_sort_buffer_size ;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.myisam_sort_buffer_size ;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT myisam_sort_buffer_size = @@session.myisam_sort_buffer_size ;
-ERROR 42S22: Unknown column 'myisam_sort_buffer_size' in 'field list'
-SET @@global.myisam_sort_buffer_size = @start_global_value;
-SELECT @@global.myisam_sort_buffer_size ;
-@@global.myisam_sort_buffer_size
-8388608
-SET @@session.myisam_sort_buffer_size = @start_session_value;
-SELECT @@session.myisam_sort_buffer_size ;
-@@session.myisam_sort_buffer_size
-8388608
diff --git a/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result b/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result
index 2657d599df7..5cb52734d21 100644
--- a/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result
@@ -71,8 +71,8 @@ Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '429496729533'
SELECT @@global.myisam_sort_buffer_size ;
@@global.myisam_sort_buffer_size
4294967295
-SET @@global.myisam_sort_buffer_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.myisam_sort_buffer_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size'
SELECT @@global.myisam_sort_buffer_size ;
@@global.myisam_sort_buffer_size
4294967295
@@ -108,8 +108,8 @@ Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '-2'
SELECT @@session.myisam_sort_buffer_size ;
@@session.myisam_sort_buffer_size
4
-SET @@session.myisam_sort_buffer_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.myisam_sort_buffer_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size'
SELECT @@session.myisam_sort_buffer_size ;
@@session.myisam_sort_buffer_size
4
diff --git a/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_64.result b/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_64.result
index be9e415d830..2069b32fdcd 100644
--- a/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_64.result
+++ b/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_64.result
@@ -69,8 +69,8 @@ SET @@global.myisam_sort_buffer_size = 429496729533;
SELECT @@global.myisam_sort_buffer_size ;
@@global.myisam_sort_buffer_size
429496729533
-SET @@global.myisam_sort_buffer_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.myisam_sort_buffer_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size'
SELECT @@global.myisam_sort_buffer_size ;
@@global.myisam_sort_buffer_size
429496729533
@@ -106,8 +106,8 @@ Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '-2'
SELECT @@session.myisam_sort_buffer_size ;
@@session.myisam_sort_buffer_size
4
-SET @@session.myisam_sort_buffer_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.myisam_sort_buffer_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size'
SELECT @@session.myisam_sort_buffer_size ;
@@session.myisam_sort_buffer_size
4
diff --git a/mysql-test/suite/sys_vars/r/myisam_stats_method_basic.result b/mysql-test/suite/sys_vars/r/myisam_stats_method_basic.result
index 3272ef6e538..f5f1c2d59cf 100644
--- a/mysql-test/suite/sys_vars/r/myisam_stats_method_basic.result
+++ b/mysql-test/suite/sys_vars/r/myisam_stats_method_basic.result
@@ -91,35 +91,7 @@ SELECT @@global.myisam_stats_method;
@@global.myisam_stats_method
nulls_ignored
SET @@global.myisam_stats_method = 0.4;
-SELECT @@global.myisam_stats_method;
-@@global.myisam_stats_method
-nulls_unequal
-SET @@global.myisam_stats_method = 1.0;
-SELECT @@global.myisam_stats_method;
-@@global.myisam_stats_method
-nulls_equal
-SET @@global.myisam_stats_method = 1.1;
-SELECT @@global.myisam_stats_method;
-@@global.myisam_stats_method
-nulls_equal
-SET @@global.myisam_stats_method = 1.5;
-SELECT @@global.myisam_stats_method;
-@@global.myisam_stats_method
-nulls_ignored
-SET @@global.myisam_stats_method = 2.49;
-SELECT @@global.myisam_stats_method;
-@@global.myisam_stats_method
-nulls_ignored
-SET @@session.myisam_stats_method = 0.5;
-SELECT @@session.myisam_stats_method;
-@@session.myisam_stats_method
-nulls_equal
-SET @@session.myisam_stats_method = 1.6;
-SELECT @@session.myisam_stats_method;
-@@session.myisam_stats_method
-nulls_ignored
-'Bug# 34877: Decimal values can be used within the range [0.0-2.5). Values';
-'are rounded to 0,1,2 as evident from outcome.';
+ERROR 42000: Incorrect argument type to variable 'myisam_stats_method'
SET @@global.myisam_stats_method = 3;
ERROR 42000: Variable 'myisam_stats_method' can't be set to the value of '3'
'#---------------------FN_DYNVARS_097_08----------------------#'
diff --git a/mysql-test/suite/sys_vars/r/named_pipe_basic.result b/mysql-test/suite/sys_vars/r/named_pipe_basic.result
new file mode 100644
index 00000000000..472a4f4d0f6
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/named_pipe_basic.result
@@ -0,0 +1,21 @@
+select @@global.named_pipe;
+@@global.named_pipe
+0
+select @@session.named_pipe;
+ERROR HY000: Variable 'named_pipe' is a GLOBAL variable
+show global variables like 'named_pipe';
+Variable_name Value
+named_pipe OFF
+show session variables like 'named_pipe';
+Variable_name Value
+named_pipe OFF
+select * from information_schema.global_variables where variable_name='named_pipe';
+VARIABLE_NAME VARIABLE_VALUE
+NAMED_PIPE OFF
+select * from information_schema.session_variables where variable_name='named_pipe';
+VARIABLE_NAME VARIABLE_VALUE
+NAMED_PIPE OFF
+set global named_pipe=1;
+ERROR HY000: Variable 'named_pipe' is a read only variable
+set session named_pipe=1;
+ERROR HY000: Variable 'named_pipe' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/net_buffer_length_basic.result b/mysql-test/suite/sys_vars/r/net_buffer_length_basic.result
index 07f933b5a4b..178ada08d65 100644
--- a/mysql-test/suite/sys_vars/r/net_buffer_length_basic.result
+++ b/mysql-test/suite/sys_vars/r/net_buffer_length_basic.result
@@ -2,6 +2,8 @@ SET @start_global_value = @@global.net_buffer_length;
SET @@global.net_buffer_length = DEFAULT;
'#--------------------FN_DYNVARS_109_01-------------------------#'
SET @@global.net_buffer_length = 10000;
+Warnings:
+Warning 1292 Truncated incorrect net_buffer_length value: '10000'
SET @@global.net_buffer_length = DEFAULT;
SELECT @@global.net_buffer_length;
@@global.net_buffer_length
@@ -9,7 +11,7 @@ SELECT @@global.net_buffer_length;
SET @@session.net_buffer_length = 20000;
ERROR HY000: SESSION variable 'net_buffer_length' is read-only. Use SET GLOBAL to assign the value
SET @@session.net_buffer_length = DEFAULT;
-ERROR 42000: Variable 'net_buffer_length' doesn't have a default value
+ERROR HY000: SESSION variable 'net_buffer_length' is read-only. Use SET GLOBAL to assign the value
SELECT @@session.net_buffer_length;
@@session.net_buffer_length
16384
@@ -24,6 +26,8 @@ SELECT @@global.net_buffer_length;
@@global.net_buffer_length
1024
SET @@global.net_buffer_length = 1025;
+Warnings:
+Warning 1292 Truncated incorrect net_buffer_length value: '1025'
SELECT @@global.net_buffer_length;
@@global.net_buffer_length
1024
@@ -32,14 +36,17 @@ SELECT @@global.net_buffer_length;
@@global.net_buffer_length
1048576
SET @@global.net_buffer_length = 1048575;
+Warnings:
+Warning 1292 Truncated incorrect net_buffer_length value: '1048575'
SELECT @@global.net_buffer_length;
@@global.net_buffer_length
1047552
SET @@global.net_buffer_length = 65535;
+Warnings:
+Warning 1292 Truncated incorrect net_buffer_length value: '65535'
SELECT @@global.net_buffer_length;
@@global.net_buffer_length
64512
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
'#--------------------FN_DYNVARS_109_04-------------------------#'
'#------------------FN_DYNVARS_109_05-----------------------#'
SET @@global.net_buffer_length = 0;
@@ -72,8 +79,8 @@ Warning 1292 Truncated incorrect net_buffer_length value: '104857633'
SELECT @@global.net_buffer_length;
@@global.net_buffer_length
1048576
-SET @@global.net_buffer_length = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.net_buffer_length = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'net_buffer_length'
SELECT @@global.net_buffer_length;
@@global.net_buffer_length
1048576
@@ -82,7 +89,6 @@ ERROR 42000: Incorrect argument type to variable 'net_buffer_length'
SELECT @@global.net_buffer_length;
@@global.net_buffer_length
1048576
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@session.net_buffer_length = test;
ERROR 42000: Incorrect argument type to variable 'net_buffer_length'
SELECT @@session.net_buffer_length;
diff --git a/mysql-test/suite/sys_vars/r/net_read_timeout_basic.result b/mysql-test/suite/sys_vars/r/net_read_timeout_basic.result
index aeee25c6526..7d2826ffed1 100644
--- a/mysql-test/suite/sys_vars/r/net_read_timeout_basic.result
+++ b/mysql-test/suite/sys_vars/r/net_read_timeout_basic.result
@@ -71,8 +71,8 @@ Warning 1292 Truncated incorrect net_read_timeout value: '655360354'
SELECT @@global.net_read_timeout;
@@global.net_read_timeout
31536000
-SET @@global.net_read_timeout = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.net_read_timeout = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'net_read_timeout'
SELECT @@global.net_read_timeout;
@@global.net_read_timeout
31536000
@@ -93,15 +93,14 @@ Warning 1292 Truncated incorrect net_read_timeout value: '-2'
SELECT @@session.net_read_timeout;
@@session.net_read_timeout
1
-SET @@session.net_read_timeout = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.net_read_timeout = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'net_read_timeout'
SET @@session.net_read_timeout = 6555015425;
Warnings:
Warning 1292 Truncated incorrect net_read_timeout value: '6555015425'
SELECT @@session.net_read_timeout;
@@session.net_read_timeout
31536000
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@session.net_read_timeout = test;
ERROR 42000: Incorrect argument type to variable 'net_read_timeout'
SELECT @@session.net_read_timeout;
diff --git a/mysql-test/suite/sys_vars/r/net_retry_count_basic_32.result b/mysql-test/suite/sys_vars/r/net_retry_count_basic_32.result
index 7a8b99ac55c..46eb9d5e1c0 100644
--- a/mysql-test/suite/sys_vars/r/net_retry_count_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/net_retry_count_basic_32.result
@@ -93,8 +93,8 @@ Warning 1292 Truncated incorrect net_retry_count value: '429496729500'
SELECT @@global.net_retry_count;
@@global.net_retry_count
4294967295
-SET @@global.net_retry_count = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.net_retry_count = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'net_retry_count'
SELECT @@global.net_retry_count;
@@global.net_retry_count
4294967295
@@ -115,8 +115,8 @@ Warning 1292 Truncated incorrect net_retry_count value: '-2'
SELECT @@session.net_retry_count;
@@session.net_retry_count
1
-SET @@session.net_retry_count = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.net_retry_count = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'net_retry_count'
SET @@session.net_retry_count = 6555015425;
Warnings:
Warning 1292 Truncated incorrect net_retry_count value: '6555015425'
@@ -129,7 +129,6 @@ Warning 1292 Truncated incorrect net_retry_count value: '4294967296'
SELECT @@session.net_retry_count;
@@session.net_retry_count
4294967295
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@session.net_retry_count = test;
ERROR 42000: Incorrect argument type to variable 'net_retry_count'
SELECT @@session.net_retry_count;
diff --git a/mysql-test/suite/sys_vars/r/net_retry_count_basic_64.result b/mysql-test/suite/sys_vars/r/net_retry_count_basic_64.result
index 67dae3d1291..28f0ca5be0f 100644
--- a/mysql-test/suite/sys_vars/r/net_retry_count_basic_64.result
+++ b/mysql-test/suite/sys_vars/r/net_retry_count_basic_64.result
@@ -89,8 +89,8 @@ SET @@global.net_retry_count = 429496729500;
SELECT @@global.net_retry_count;
@@global.net_retry_count
429496729500
-SET @@global.net_retry_count = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.net_retry_count = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'net_retry_count'
SELECT @@global.net_retry_count;
@@global.net_retry_count
429496729500
@@ -111,8 +111,8 @@ Warning 1292 Truncated incorrect net_retry_count value: '-2'
SELECT @@session.net_retry_count;
@@session.net_retry_count
1
-SET @@session.net_retry_count = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.net_retry_count = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'net_retry_count'
SET @@session.net_retry_count = 6555015425;
SELECT @@session.net_retry_count;
@@session.net_retry_count
@@ -121,7 +121,6 @@ SET @@session.net_retry_count = 4294967296;
SELECT @@session.net_retry_count;
@@session.net_retry_count
4294967296
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@session.net_retry_count = test;
ERROR 42000: Incorrect argument type to variable 'net_retry_count'
SELECT @@session.net_retry_count;
diff --git a/mysql-test/suite/sys_vars/r/net_write_timeout_basic.result b/mysql-test/suite/sys_vars/r/net_write_timeout_basic.result
index 8857b8c0e37..28ffad86ffc 100644
--- a/mysql-test/suite/sys_vars/r/net_write_timeout_basic.result
+++ b/mysql-test/suite/sys_vars/r/net_write_timeout_basic.result
@@ -71,8 +71,8 @@ Warning 1292 Truncated incorrect net_write_timeout value: '655360354'
SELECT @@global.net_write_timeout;
@@global.net_write_timeout
31536000
-SET @@global.net_write_timeout = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.net_write_timeout = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'net_write_timeout'
SELECT @@global.net_write_timeout;
@@global.net_write_timeout
31536000
@@ -93,15 +93,14 @@ Warning 1292 Truncated incorrect net_write_timeout value: '-2'
SELECT @@session.net_write_timeout;
@@session.net_write_timeout
1
-SET @@session.net_write_timeout = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.net_write_timeout = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'net_write_timeout'
SET @@session.net_write_timeout = 6555015425;
Warnings:
Warning 1292 Truncated incorrect net_write_timeout value: '6555015425'
SELECT @@session.net_write_timeout;
@@session.net_write_timeout
31536000
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@session.net_write_timeout = test;
ERROR 42000: Incorrect argument type to variable 'net_write_timeout'
SELECT @@session.net_write_timeout;
diff --git a/mysql-test/suite/sys_vars/r/new_basic.result b/mysql-test/suite/sys_vars/r/new_basic.result
index 5854649e6b1..c1f11e20cca 100644
--- a/mysql-test/suite/sys_vars/r/new_basic.result
+++ b/mysql-test/suite/sys_vars/r/new_basic.result
@@ -94,7 +94,7 @@ ERROR 42000: Variable 'new' can't be set to the value of '-1024'
SET @@global.new = 65536;
ERROR 42000: Variable 'new' can't be set to the value of '65536'
SET @@global.new = 65530.34;
-ERROR 42000: Variable 'new' can't be set to the value of '65530'
+ERROR 42000: Incorrect argument type to variable 'new'
SET @@global.new = test;
ERROR 42000: Variable 'new' can't be set to the value of 'test'
SET @@session.new = ONN;
@@ -102,16 +102,13 @@ ERROR 42000: Variable 'new' can't be set to the value of 'ONN'
SET @@session.new = ONF;
ERROR 42000: Variable 'new' can't be set to the value of 'ONF'
SET @@session.new = OF;
-SELECT @@session.new;
-@@session.new
-0
-'Bug# 34828: FN_DYNVARS_113_05 - OF is also working as OFF and no error is coming';
+ERROR 42000: Variable 'new' can't be set to the value of 'OF'
SET @@session.new = 'OFN';
ERROR 42000: Variable 'new' can't be set to the value of 'OFN'
SET @@session.new = -2;
ERROR 42000: Variable 'new' can't be set to the value of '-2'
-SET @@session.new = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.new = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'new'
SET @@session.new = 65550;
ERROR 42000: Variable 'new' can't be set to the value of '65550'
SET @@session.new = test;
diff --git a/mysql-test/suite/sys_vars/r/old_alter_table_basic.result b/mysql-test/suite/sys_vars/r/old_alter_table_basic.result
new file mode 100644
index 00000000000..0619235b8e0
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/old_alter_table_basic.result
@@ -0,0 +1,40 @@
+SET @start_global_value = @@global.old_alter_table;
+SELECT @start_global_value;
+@start_global_value
+0
+select @@global.old_alter_table;
+@@global.old_alter_table
+0
+select @@session.old_alter_table;
+@@session.old_alter_table
+0
+show global variables like 'old_alter_table';
+Variable_name Value
+old_alter_table OFF
+show session variables like 'old_alter_table';
+Variable_name Value
+old_alter_table OFF
+select * from information_schema.global_variables where variable_name='old_alter_table';
+VARIABLE_NAME VARIABLE_VALUE
+OLD_ALTER_TABLE OFF
+select * from information_schema.session_variables where variable_name='old_alter_table';
+VARIABLE_NAME VARIABLE_VALUE
+OLD_ALTER_TABLE OFF
+set global old_alter_table=1;
+select @@global.old_alter_table;
+@@global.old_alter_table
+1
+set session old_alter_table=ON;
+select @@session.old_alter_table;
+@@session.old_alter_table
+1
+set global old_alter_table=1.1;
+ERROR 42000: Incorrect argument type to variable 'old_alter_table'
+set global old_alter_table=1e1;
+ERROR 42000: Incorrect argument type to variable 'old_alter_table'
+set global old_alter_table="foo";
+ERROR 42000: Variable 'old_alter_table' can't be set to the value of 'foo'
+SET @@global.old_alter_table = @start_global_value;
+SELECT @@global.old_alter_table;
+@@global.old_alter_table
+0
diff --git a/mysql-test/suite/sys_vars/r/old_basic.result b/mysql-test/suite/sys_vars/r/old_basic.result
new file mode 100644
index 00000000000..03bf61257c1
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/old_basic.result
@@ -0,0 +1,21 @@
+select @@global.old;
+@@global.old
+0
+select @@session.old;
+ERROR HY000: Variable 'old' is a GLOBAL variable
+show global variables like 'old';
+Variable_name Value
+old OFF
+show session variables like 'old';
+Variable_name Value
+old OFF
+select * from information_schema.global_variables where variable_name='old';
+VARIABLE_NAME VARIABLE_VALUE
+OLD OFF
+select * from information_schema.session_variables where variable_name='old';
+VARIABLE_NAME VARIABLE_VALUE
+OLD OFF
+set global old=1;
+ERROR HY000: Variable 'old' is a read only variable
+set session old=1;
+ERROR HY000: Variable 'old' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/old_passwords_basic.result b/mysql-test/suite/sys_vars/r/old_passwords_basic.result
index f8600167801..26d0e79071b 100644
--- a/mysql-test/suite/sys_vars/r/old_passwords_basic.result
+++ b/mysql-test/suite/sys_vars/r/old_passwords_basic.result
@@ -90,7 +90,7 @@ ERROR 42000: Variable 'old_passwords' can't be set to the value of '-1024'
SET @@global.old_passwords = 65536;
ERROR 42000: Variable 'old_passwords' can't be set to the value of '65536'
SET @@global.old_passwords = 65530.34;
-ERROR 42000: Variable 'old_passwords' can't be set to the value of '65530'
+ERROR 42000: Incorrect argument type to variable 'old_passwords'
SET @@global.old_passwords = test;
ERROR 42000: Variable 'old_passwords' can't be set to the value of 'test'
SET @@session.old_passwords = ONN;
@@ -98,16 +98,13 @@ ERROR 42000: Variable 'old_passwords' can't be set to the value of 'ONN'
SET @@session.old_passwords = ONF;
ERROR 42000: Variable 'old_passwords' can't be set to the value of 'ONF'
SET @@session.old_passwords = OF;
-SELECT @@session.old_passwords;
-@@session.old_passwords
-0
-'Bug# 34828: OF is also working as OFF and no error is coming';
+ERROR 42000: Variable 'old_passwords' can't be set to the value of 'OF'
SET @@session.old_passwords = 'OFN';
ERROR 42000: Variable 'old_passwords' can't be set to the value of 'OFN'
SET @@session.old_passwords = -2;
ERROR 42000: Variable 'old_passwords' can't be set to the value of '-2'
-SET @@session.old_passwords = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.old_passwords = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'old_passwords'
SET @@session.old_passwords = 65550;
ERROR 42000: Variable 'old_passwords' can't be set to the value of '65550'
SET @@session.old_passwords = test;
diff --git a/mysql-test/suite/sys_vars/r/open_files_limit_basic.result b/mysql-test/suite/sys_vars/r/open_files_limit_basic.result
new file mode 100644
index 00000000000..b136fdf2e20
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/open_files_limit_basic.result
@@ -0,0 +1,21 @@
+select @@global.open_files_limit;
+@@global.open_files_limit
+1024
+select @@session.open_files_limit;
+ERROR HY000: Variable 'open_files_limit' is a GLOBAL variable
+show global variables like 'open_files_limit';
+Variable_name Value
+open_files_limit 1024
+show session variables like 'open_files_limit';
+Variable_name Value
+open_files_limit 1024
+select * from information_schema.global_variables where variable_name='open_files_limit';
+VARIABLE_NAME VARIABLE_VALUE
+OPEN_FILES_LIMIT 1024
+select * from information_schema.session_variables where variable_name='open_files_limit';
+VARIABLE_NAME VARIABLE_VALUE
+OPEN_FILES_LIMIT 1024
+set global open_files_limit=1;
+ERROR HY000: Variable 'open_files_limit' is a read only variable
+set session open_files_limit=1;
+ERROR HY000: Variable 'open_files_limit' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/optimizer_prune_level_basic.result b/mysql-test/suite/sys_vars/r/optimizer_prune_level_basic.result
index c126569ebcd..99843f0b93f 100644
--- a/mysql-test/suite/sys_vars/r/optimizer_prune_level_basic.result
+++ b/mysql-test/suite/sys_vars/r/optimizer_prune_level_basic.result
@@ -114,15 +114,14 @@ Warning 1292 Truncated incorrect optimizer_prune_level value: '-2'
SELECT @@session.optimizer_prune_level;
@@session.optimizer_prune_level
0
-SET @@session.optimizer_prune_level = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.optimizer_prune_level = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'optimizer_prune_level'
SET @@session.optimizer_prune_level = 65550;
Warnings:
Warning 1292 Truncated incorrect optimizer_prune_level value: '65550'
SELECT @@session.optimizer_prune_level;
@@session.optimizer_prune_level
1
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@session.optimizer_prune_level = test;
ERROR 42000: Incorrect argument type to variable 'optimizer_prune_level'
'#------------------FN_DYNVARS_115_06-----------------------#'
diff --git a/mysql-test/suite/sys_vars/r/optimizer_search_depth_basic.result b/mysql-test/suite/sys_vars/r/optimizer_search_depth_basic.result
index 9c49ae7e73f..4d94fb02be7 100644
--- a/mysql-test/suite/sys_vars/r/optimizer_search_depth_basic.result
+++ b/mysql-test/suite/sys_vars/r/optimizer_search_depth_basic.result
@@ -83,8 +83,8 @@ Warning 1292 Truncated incorrect optimizer_search_depth value: '65536'
SELECT @@global.optimizer_search_depth;
@@global.optimizer_search_depth
63
-SET @@global.optimizer_search_depth = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.optimizer_search_depth = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'optimizer_search_depth'
SELECT @@global.optimizer_search_depth;
@@global.optimizer_search_depth
63
@@ -105,15 +105,14 @@ Warning 1292 Truncated incorrect optimizer_search_depth value: '-2'
SELECT @@session.optimizer_search_depth;
@@session.optimizer_search_depth
0
-SET @@session.optimizer_search_depth = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.optimizer_search_depth = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'optimizer_search_depth'
SET @@session.optimizer_search_depth = 65550;
Warnings:
Warning 1292 Truncated incorrect optimizer_search_depth value: '65550'
SELECT @@session.optimizer_search_depth;
@@session.optimizer_search_depth
63
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@session.optimizer_search_depth = test;
ERROR 42000: Incorrect argument type to variable 'optimizer_search_depth'
SELECT @@session.optimizer_search_depth;
diff --git a/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result b/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result
new file mode 100644
index 00000000000..d1e03f769c8
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result
@@ -0,0 +1,54 @@
+SET @start_global_value = @@global.optimizer_switch;
+SELECT @start_global_value;
+@start_global_value
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
+select @@global.optimizer_switch;
+@@global.optimizer_switch
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
+select @@session.optimizer_switch;
+@@session.optimizer_switch
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
+show global variables like 'optimizer_switch';
+Variable_name Value
+optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
+show session variables like 'optimizer_switch';
+Variable_name Value
+optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
+select * from information_schema.global_variables where variable_name='optimizer_switch';
+VARIABLE_NAME VARIABLE_VALUE
+OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
+select * from information_schema.session_variables where variable_name='optimizer_switch';
+VARIABLE_NAME VARIABLE_VALUE
+OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
+set global optimizer_switch=10;
+select @@global.optimizer_switch;
+@@global.optimizer_switch
+index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on
+set session optimizer_switch=5;
+select @@session.optimizer_switch;
+@@session.optimizer_switch
+index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off
+set global optimizer_switch="index_merge_sort_union=on";
+select @@global.optimizer_switch;
+@@global.optimizer_switch
+index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
+set session optimizer_switch="index_merge=off";
+select @@session.optimizer_switch;
+@@session.optimizer_switch
+index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off
+set session optimizer_switch="default";
+select @@session.optimizer_switch;
+@@session.optimizer_switch
+index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
+set global optimizer_switch=1.1;
+ERROR 42000: Incorrect argument type to variable 'optimizer_switch'
+set global optimizer_switch=1e1;
+ERROR 42000: Incorrect argument type to variable 'optimizer_switch'
+set session optimizer_switch="index_merge";
+ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'index_merge'
+set session optimizer_switch="foobar";
+ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'foobar'
+SET @@global.optimizer_switch = @start_global_value;
+SELECT @@global.optimizer_switch;
+@@global.optimizer_switch
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
diff --git a/mysql-test/suite/sys_vars/r/pid_file_basic.result b/mysql-test/suite/sys_vars/r/pid_file_basic.result
new file mode 100644
index 00000000000..dc3b6ca97c5
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/pid_file_basic.result
@@ -0,0 +1,21 @@
+select @@global.pid_file;
+@@global.pid_file
+MYSQLTEST_VARDIR/run/mysqld.1.pid
+select @@session.pid_file;
+ERROR HY000: Variable 'pid_file' is a GLOBAL variable
+show global variables like 'pid_file';
+Variable_name Value
+pid_file MYSQLTEST_VARDIR/run/mysqld.1.pid
+show session variables like 'pid_file';
+Variable_name Value
+pid_file MYSQLTEST_VARDIR/run/mysqld.1.pid
+select * from information_schema.global_variables where variable_name='pid_file';
+VARIABLE_NAME VARIABLE_VALUE
+PID_FILE MYSQLTEST_VARDIR/run/mysqld.1.pid
+select * from information_schema.session_variables where variable_name='pid_file';
+VARIABLE_NAME VARIABLE_VALUE
+PID_FILE MYSQLTEST_VARDIR/run/mysqld.1.pid
+set global pid_file=1;
+ERROR HY000: Variable 'pid_file' is a read only variable
+set session pid_file=1;
+ERROR HY000: Variable 'pid_file' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/plugin_dir_basic.result b/mysql-test/suite/sys_vars/r/plugin_dir_basic.result
new file mode 100644
index 00000000000..f81cae24dda
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/plugin_dir_basic.result
@@ -0,0 +1,21 @@
+select @@global.plugin_dir;
+@@global.plugin_dir
+MYSQL_LIBDIR/plugin
+select @@session.plugin_dir;
+ERROR HY000: Variable 'plugin_dir' is a GLOBAL variable
+show global variables like 'plugin_dir';
+Variable_name Value
+plugin_dir MYSQL_LIBDIR/plugin
+show session variables like 'plugin_dir';
+Variable_name Value
+plugin_dir MYSQL_LIBDIR/plugin
+select * from information_schema.global_variables where variable_name='plugin_dir';
+VARIABLE_NAME VARIABLE_VALUE
+PLUGIN_DIR MYSQL_LIBDIR/plugin
+select * from information_schema.session_variables where variable_name='plugin_dir';
+VARIABLE_NAME VARIABLE_VALUE
+PLUGIN_DIR MYSQL_LIBDIR/plugin
+set global plugin_dir=1;
+ERROR HY000: Variable 'plugin_dir' is a read only variable
+set session plugin_dir=1;
+ERROR HY000: Variable 'plugin_dir' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/port_basic.result b/mysql-test/suite/sys_vars/r/port_basic.result
new file mode 100644
index 00000000000..cca50395927
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/port_basic.result
@@ -0,0 +1,21 @@
+select @@global.port;
+@@global.port
+MASTER_MYPORT
+select @@session.port;
+ERROR HY000: Variable 'port' is a GLOBAL variable
+show global variables like 'port';
+Variable_name Value
+port MASTER_MYPORT
+show session variables like 'port';
+Variable_name Value
+port MASTER_MYPORT
+select * from information_schema.global_variables where variable_name='port';
+VARIABLE_NAME VARIABLE_VALUE
+PORT MASTER_MYPORT
+select * from information_schema.session_variables where variable_name='port';
+VARIABLE_NAME VARIABLE_VALUE
+PORT MASTER_MYPORT
+set global port=1;
+ERROR HY000: Variable 'port' is a read only variable
+set session port=1;
+ERROR HY000: Variable 'port' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/preload_buffer_size_basic.result b/mysql-test/suite/sys_vars/r/preload_buffer_size_basic.result
index fd8bdd222d2..fef19db95c5 100644
--- a/mysql-test/suite/sys_vars/r/preload_buffer_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/preload_buffer_size_basic.result
@@ -93,8 +93,8 @@ Warning 1292 Truncated incorrect preload_buffer_size value: '1073741825'
SELECT @@global.preload_buffer_size;
@@global.preload_buffer_size
1073741824
-SET @@global.preload_buffer_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.preload_buffer_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'preload_buffer_size'
SELECT @@global.preload_buffer_size;
@@global.preload_buffer_size
1073741824
@@ -115,8 +115,8 @@ Warning 1292 Truncated incorrect preload_buffer_size value: '-2'
SELECT @@session.preload_buffer_size;
@@session.preload_buffer_size
1024
-SET @@session.preload_buffer_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.preload_buffer_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'preload_buffer_size'
SET @@session.preload_buffer_size = 1023;
Warnings:
Warning 1292 Truncated incorrect preload_buffer_size value: '1023'
@@ -129,7 +129,6 @@ Warning 1292 Truncated incorrect preload_buffer_size value: '1073741825'
SELECT @@session.preload_buffer_size;
@@session.preload_buffer_size
1073741824
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@session.preload_buffer_size = test;
ERROR 42000: Incorrect argument type to variable 'preload_buffer_size'
SELECT @@session.preload_buffer_size;
diff --git a/mysql-test/suite/sys_vars/r/profiling_basic.result b/mysql-test/suite/sys_vars/r/profiling_basic.result
new file mode 100644
index 00000000000..26704b6b725
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/profiling_basic.result
@@ -0,0 +1,40 @@
+SET @start_global_value = @@global.profiling;
+SELECT @start_global_value;
+@start_global_value
+0
+select @@global.profiling;
+@@global.profiling
+0
+select @@session.profiling;
+@@session.profiling
+0
+show global variables like 'profiling';
+Variable_name Value
+profiling OFF
+show session variables like 'profiling';
+Variable_name Value
+profiling OFF
+select * from information_schema.global_variables where variable_name='profiling';
+VARIABLE_NAME VARIABLE_VALUE
+PROFILING OFF
+select * from information_schema.session_variables where variable_name='profiling';
+VARIABLE_NAME VARIABLE_VALUE
+PROFILING OFF
+set global profiling=1;
+select @@global.profiling;
+@@global.profiling
+1
+set session profiling=ON;
+select @@session.profiling;
+@@session.profiling
+1
+set global profiling=1.1;
+ERROR 42000: Incorrect argument type to variable 'profiling'
+set global profiling=1e1;
+ERROR 42000: Incorrect argument type to variable 'profiling'
+set global profiling="foo";
+ERROR 42000: Variable 'profiling' can't be set to the value of 'foo'
+SET @@global.profiling = @start_global_value;
+SELECT @@global.profiling;
+@@global.profiling
+0
diff --git a/mysql-test/suite/sys_vars/r/profiling_history_size_basic.result b/mysql-test/suite/sys_vars/r/profiling_history_size_basic.result
new file mode 100644
index 00000000000..be92d075326
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/profiling_history_size_basic.result
@@ -0,0 +1,50 @@
+SET @start_global_value = @@global.profiling_history_size;
+SELECT @start_global_value;
+@start_global_value
+15
+select @@global.profiling_history_size;
+@@global.profiling_history_size
+15
+select @@session.profiling_history_size;
+@@session.profiling_history_size
+15
+show global variables like 'profiling_history_size';
+Variable_name Value
+profiling_history_size 15
+show session variables like 'profiling_history_size';
+Variable_name Value
+profiling_history_size 15
+select * from information_schema.global_variables where variable_name='profiling_history_size';
+VARIABLE_NAME VARIABLE_VALUE
+PROFILING_HISTORY_SIZE 15
+select * from information_schema.session_variables where variable_name='profiling_history_size';
+VARIABLE_NAME VARIABLE_VALUE
+PROFILING_HISTORY_SIZE 15
+set global profiling_history_size=10;
+select @@global.profiling_history_size;
+@@global.profiling_history_size
+10
+set session profiling_history_size=20;
+select @@session.profiling_history_size;
+@@session.profiling_history_size
+20
+set global profiling_history_size=1.1;
+ERROR 42000: Incorrect argument type to variable 'profiling_history_size'
+set global profiling_history_size=1e1;
+ERROR 42000: Incorrect argument type to variable 'profiling_history_size'
+set global profiling_history_size="foo";
+ERROR 42000: Incorrect argument type to variable 'profiling_history_size'
+set session profiling_history_size=0;
+select @@profiling_history_size;
+@@profiling_history_size
+0
+set session profiling_history_size=101;
+Warnings:
+Warning 1292 Truncated incorrect profiling_history_size value: '101'
+select @@profiling_history_size;
+@@profiling_history_size
+100
+SET @@global.profiling_history_size = @start_global_value;
+SELECT @@global.profiling_history_size;
+@@global.profiling_history_size
+15
diff --git a/mysql-test/suite/sys_vars/r/protocol_version_basic.result b/mysql-test/suite/sys_vars/r/protocol_version_basic.result
new file mode 100644
index 00000000000..d00d8615762
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/protocol_version_basic.result
@@ -0,0 +1,21 @@
+select @@global.protocol_version;
+@@global.protocol_version
+10
+select @@session.protocol_version;
+ERROR HY000: Variable 'protocol_version' is a GLOBAL variable
+show global variables like 'protocol_version';
+Variable_name Value
+protocol_version 10
+show session variables like 'protocol_version';
+Variable_name Value
+protocol_version 10
+select * from information_schema.global_variables where variable_name='protocol_version';
+VARIABLE_NAME VARIABLE_VALUE
+PROTOCOL_VERSION 10
+select * from information_schema.session_variables where variable_name='protocol_version';
+VARIABLE_NAME VARIABLE_VALUE
+PROTOCOL_VERSION 10
+set global protocol_version=1;
+ERROR HY000: Variable 'protocol_version' is a read only variable
+set session protocol_version=1;
+ERROR HY000: Variable 'protocol_version' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/pseudo_thread_id_basic.result b/mysql-test/suite/sys_vars/r/pseudo_thread_id_basic.result
new file mode 100644
index 00000000000..e6619e206f1
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/pseudo_thread_id_basic.result
@@ -0,0 +1,27 @@
+select @@global.pseudo_thread_id;
+ERROR HY000: Variable 'pseudo_thread_id' is a SESSION variable
+select @@session.pseudo_thread_id=0;
+@@session.pseudo_thread_id=0
+0
+show global variables like 'pseudo_thread_id';
+Variable_name Value
+show session variables like 'pseudo_thread_id';
+Variable_name Value
+pseudo_thread_id #
+select * from information_schema.global_variables where variable_name='pseudo_thread_id';
+VARIABLE_NAME VARIABLE_VALUE
+select * from information_schema.session_variables where variable_name='pseudo_thread_id';
+VARIABLE_NAME VARIABLE_VALUE
+PSEUDO_THREAD_ID #
+set session pseudo_thread_id=1;
+select @@session.pseudo_thread_id;
+@@session.pseudo_thread_id
+1
+set global pseudo_thread_id=1;
+ERROR HY000: Variable 'pseudo_thread_id' is a SESSION variable and can't be used with SET GLOBAL
+set session pseudo_thread_id=1.1;
+ERROR 42000: Incorrect argument type to variable 'pseudo_thread_id'
+set session pseudo_thread_id=1e1;
+ERROR 42000: Incorrect argument type to variable 'pseudo_thread_id'
+set session pseudo_thread_id="foo";
+ERROR 42000: Incorrect argument type to variable 'pseudo_thread_id'
diff --git a/mysql-test/suite/sys_vars/r/query_alloc_block_size_basic_32.result b/mysql-test/suite/sys_vars/r/query_alloc_block_size_basic_32.result
index 2ea0831a36d..6189a55e86e 100644
--- a/mysql-test/suite/sys_vars/r/query_alloc_block_size_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/query_alloc_block_size_basic_32.result
@@ -8,11 +8,15 @@ SELECT @start_session_value;
8192
'#--------------------FN_DYNVARS_130_01-------------------------#'
SET @@global.query_alloc_block_size = 10000;
+Warnings:
+Warning 1292 Truncated incorrect query_alloc_block_size value: '10000'
SET @@global.query_alloc_block_size = DEFAULT;
SELECT @@global.query_alloc_block_size;
@@global.query_alloc_block_size
8192
SET @@session.query_alloc_block_size = 20000;
+Warnings:
+Warning 1292 Truncated incorrect query_alloc_block_size value: '20000'
SET @@session.query_alloc_block_size = DEFAULT;
SELECT @@session.query_alloc_block_size;
@@session.query_alloc_block_size
@@ -32,6 +36,8 @@ SELECT @@global.query_alloc_block_size;
@@global.query_alloc_block_size
1024
SET @@global.query_alloc_block_size = 1025;
+Warnings:
+Warning 1292 Truncated incorrect query_alloc_block_size value: '1025'
SELECT @@global.query_alloc_block_size;
@@global.query_alloc_block_size
1024
@@ -51,13 +57,14 @@ SET @@global.query_alloc_block_size = 65536;
SELECT @@global.query_alloc_block_size;
@@global.query_alloc_block_size
65536
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
'#--------------------FN_DYNVARS_130_04-------------------------#'
SET @@session.query_alloc_block_size = 1024;
SELECT @@session.query_alloc_block_size;
@@session.query_alloc_block_size
1024
SET @@session.query_alloc_block_size = 1025;
+Warnings:
+Warning 1292 Truncated incorrect query_alloc_block_size value: '1025'
SELECT @@session.query_alloc_block_size;
@@session.query_alloc_block_size
1024
@@ -74,6 +81,8 @@ SELECT @@session.query_alloc_block_size;
@@session.query_alloc_block_size
4294966272
SET @@session.query_alloc_block_size = 655536;
+Warnings:
+Warning 1292 Truncated incorrect query_alloc_block_size value: '655536'
SELECT @@session.query_alloc_block_size;
@@session.query_alloc_block_size
655360
@@ -102,8 +111,8 @@ Warning 1292 Truncated incorrect query_alloc_block_size value: '4294967296'
SELECT @@global.query_alloc_block_size;
@@global.query_alloc_block_size
4294966272
-SET @@global.query_alloc_block_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.query_alloc_block_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'query_alloc_block_size'
SELECT @@global.query_alloc_block_size;
@@global.query_alloc_block_size
4294966272
@@ -124,28 +133,20 @@ Warning 1292 Truncated incorrect query_alloc_block_size value: '-2'
SELECT @@session.query_alloc_block_size;
@@session.query_alloc_block_size
1024
-SET @@session.query_alloc_block_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.query_alloc_block_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'query_alloc_block_size'
SET @@session.query_alloc_block_size = 1023;
Warnings:
Warning 1292 Truncated incorrect query_alloc_block_size value: '1023'
SELECT @@session.query_alloc_block_size;
@@session.query_alloc_block_size
1024
-SET @@session.query_alloc_block_size = 4294967296;
-Warnings:
-Warning 1292 Truncated incorrect query_alloc_block_size value: '4294967296'
-SELECT @@session.query_alloc_block_size;
-@@session.query_alloc_block_size
-4294966272
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@session.query_alloc_block_size = test;
ERROR 42000: Incorrect argument type to variable 'query_alloc_block_size'
SELECT @@session.query_alloc_block_size;
@@session.query_alloc_block_size
-4294966272
+1024
'#------------------FN_DYNVARS_130_06-----------------------#'
-'Bug# 34877: OutOFMemeory errors are coming if we dont assign these values to variable before comparision statement';
SET @@global.query_alloc_block_size = 1;
Warnings:
Warning 1292 Truncated incorrect query_alloc_block_size value: '1'
@@ -184,6 +185,8 @@ SELECT @@query_alloc_block_size = @@global.query_alloc_block_size;
0
'#---------------------FN_DYNVARS_130_10----------------------#'
SET @@query_alloc_block_size = 5000;
+Warnings:
+Warning 1292 Truncated incorrect query_alloc_block_size value: '5000'
SELECT @@query_alloc_block_size = @@local.query_alloc_block_size;
@@query_alloc_block_size = @@local.query_alloc_block_size
1
diff --git a/mysql-test/suite/sys_vars/r/query_alloc_block_size_basic_64.result b/mysql-test/suite/sys_vars/r/query_alloc_block_size_basic_64.result
index 7c573bdb7cb..c77af13ecc9 100644
--- a/mysql-test/suite/sys_vars/r/query_alloc_block_size_basic_64.result
+++ b/mysql-test/suite/sys_vars/r/query_alloc_block_size_basic_64.result
@@ -8,11 +8,15 @@ SELECT @start_session_value;
8192
'#--------------------FN_DYNVARS_130_01-------------------------#'
SET @@global.query_alloc_block_size = 10000;
+Warnings:
+Warning 1292 Truncated incorrect query_alloc_block_size value: '10000'
SET @@global.query_alloc_block_size = DEFAULT;
SELECT @@global.query_alloc_block_size;
@@global.query_alloc_block_size
8192
SET @@session.query_alloc_block_size = 20000;
+Warnings:
+Warning 1292 Truncated incorrect query_alloc_block_size value: '20000'
SET @@session.query_alloc_block_size = DEFAULT;
SELECT @@session.query_alloc_block_size;
@@session.query_alloc_block_size
@@ -32,14 +36,20 @@ SELECT @@global.query_alloc_block_size;
@@global.query_alloc_block_size
1024
SET @@global.query_alloc_block_size = 1025;
+Warnings:
+Warning 1292 Truncated incorrect query_alloc_block_size value: '1025'
SELECT @@global.query_alloc_block_size;
@@global.query_alloc_block_size
1024
SET @@global.query_alloc_block_size = 4294967295;
+Warnings:
+Warning 1292 Truncated incorrect query_alloc_block_size value: '4294967295'
SELECT @@global.query_alloc_block_size;
@@global.query_alloc_block_size
4294966272
SET @@global.query_alloc_block_size = 4294967294;
+Warnings:
+Warning 1292 Truncated incorrect query_alloc_block_size value: '4294967294'
SELECT @@global.query_alloc_block_size;
@@global.query_alloc_block_size
4294966272
@@ -47,25 +57,32 @@ SET @@global.query_alloc_block_size = 65536;
SELECT @@global.query_alloc_block_size;
@@global.query_alloc_block_size
65536
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
'#--------------------FN_DYNVARS_130_04-------------------------#'
SET @@session.query_alloc_block_size = 1024;
SELECT @@session.query_alloc_block_size;
@@session.query_alloc_block_size
1024
SET @@session.query_alloc_block_size = 1025;
+Warnings:
+Warning 1292 Truncated incorrect query_alloc_block_size value: '1025'
SELECT @@session.query_alloc_block_size;
@@session.query_alloc_block_size
1024
SET @@session.query_alloc_block_size = 4294967295;
+Warnings:
+Warning 1292 Truncated incorrect query_alloc_block_size value: '4294967295'
SELECT @@session.query_alloc_block_size;
@@session.query_alloc_block_size
4294966272
SET @@session.query_alloc_block_size = 4294967294;
+Warnings:
+Warning 1292 Truncated incorrect query_alloc_block_size value: '4294967294'
SELECT @@session.query_alloc_block_size;
@@session.query_alloc_block_size
4294966272
SET @@session.query_alloc_block_size = 655536;
+Warnings:
+Warning 1292 Truncated incorrect query_alloc_block_size value: '655536'
SELECT @@session.query_alloc_block_size;
@@session.query_alloc_block_size
655360
@@ -92,8 +109,8 @@ SET @@global.query_alloc_block_size = 4294967296;
SELECT @@global.query_alloc_block_size;
@@global.query_alloc_block_size
4294967296
-SET @@global.query_alloc_block_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.query_alloc_block_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'query_alloc_block_size'
SELECT @@global.query_alloc_block_size;
@@global.query_alloc_block_size
4294967296
@@ -114,26 +131,20 @@ Warning 1292 Truncated incorrect query_alloc_block_size value: '-2'
SELECT @@session.query_alloc_block_size;
@@session.query_alloc_block_size
1024
-SET @@session.query_alloc_block_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.query_alloc_block_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'query_alloc_block_size'
SET @@session.query_alloc_block_size = 1023;
Warnings:
Warning 1292 Truncated incorrect query_alloc_block_size value: '1023'
SELECT @@session.query_alloc_block_size;
@@session.query_alloc_block_size
1024
-SET @@session.query_alloc_block_size = 4294967296;
-SELECT @@session.query_alloc_block_size;
-@@session.query_alloc_block_size
-4294967296
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@session.query_alloc_block_size = test;
ERROR 42000: Incorrect argument type to variable 'query_alloc_block_size'
SELECT @@session.query_alloc_block_size;
@@session.query_alloc_block_size
-4294967296
+1024
'#------------------FN_DYNVARS_130_06-----------------------#'
-'Bug# 34877: OutOFMemeory errors are coming if we dont assign these values to variable before comparision statement';
SET @@global.query_alloc_block_size = 1;
Warnings:
Warning 1292 Truncated incorrect query_alloc_block_size value: '1'
@@ -172,6 +183,8 @@ SELECT @@query_alloc_block_size = @@global.query_alloc_block_size;
0
'#---------------------FN_DYNVARS_130_10----------------------#'
SET @@query_alloc_block_size = 5000;
+Warnings:
+Warning 1292 Truncated incorrect query_alloc_block_size value: '5000'
SELECT @@query_alloc_block_size = @@local.query_alloc_block_size;
@@query_alloc_block_size = @@local.query_alloc_block_size
1
diff --git a/mysql-test/suite/sys_vars/r/query_cache_limit_basic_32.result b/mysql-test/suite/sys_vars/r/query_cache_limit_basic_32.result
index 4fab29b8952..074075dd2f7 100644
--- a/mysql-test/suite/sys_vars/r/query_cache_limit_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/query_cache_limit_basic_32.result
@@ -66,7 +66,6 @@ Warning 1292 Truncated incorrect query_cache_limit value: '42949672950'
SELECT @@global.query_cache_limit;
@@global.query_cache_limit
4294967295
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@global.query_cache_limit = ON;
ERROR 42000: Incorrect argument type to variable 'query_cache_limit'
SELECT @@global.query_cache_limit;
diff --git a/mysql-test/suite/sys_vars/r/query_cache_limit_basic_64.result b/mysql-test/suite/sys_vars/r/query_cache_limit_basic_64.result
index 7b3e759deb4..3125ee4a415 100644
--- a/mysql-test/suite/sys_vars/r/query_cache_limit_basic_64.result
+++ b/mysql-test/suite/sys_vars/r/query_cache_limit_basic_64.result
@@ -60,7 +60,6 @@ SET @@global.query_cache_limit = 42949672950;
SELECT @@global.query_cache_limit;
@@global.query_cache_limit
42949672950
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@global.query_cache_limit = ON;
ERROR 42000: Incorrect argument type to variable 'query_cache_limit'
SELECT @@global.query_cache_limit;
diff --git a/mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic_32.result b/mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic_32.result
index b6e274d6ad2..c408a39fdc0 100644
--- a/mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic_32.result
@@ -22,7 +22,6 @@ SET @@global.query_cache_min_res_unit = 1;
SELECT @@global.query_cache_min_res_unit;
@@global.query_cache_min_res_unit
512
-'Bug#34842: FN_DYNVARS_132_03 - Minimum value according to documentation is 0, and here it is 512';
SET @@global.query_cache_min_res_unit = 512;
SELECT @@global.query_cache_min_res_unit;
@@global.query_cache_min_res_unit
@@ -31,7 +30,6 @@ SET @@global.query_cache_min_res_unit = 513;
SELECT @@global.query_cache_min_res_unit;
@@global.query_cache_min_res_unit
520
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
SET @@global.query_cache_min_res_unit = 1048576;
SELECT @@global.query_cache_min_res_unit;
@@global.query_cache_min_res_unit
@@ -74,7 +72,6 @@ Warning 1292 Truncated incorrect query_cache_min_res_unit value: '42949672950'
SELECT @@global.query_cache_min_res_unit;
@@global.query_cache_min_res_unit
0
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@global.query_cache_min_res_unit = ON;
ERROR 42000: Incorrect argument type to variable 'query_cache_min_res_unit'
SELECT @@global.query_cache_min_res_unit;
diff --git a/mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic_64.result b/mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic_64.result
index fdbbc71f108..8028098c3c5 100644
--- a/mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic_64.result
+++ b/mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic_64.result
@@ -22,7 +22,6 @@ SET @@global.query_cache_min_res_unit = 1;
SELECT @@global.query_cache_min_res_unit;
@@global.query_cache_min_res_unit
512
-'Bug#34842: FN_DYNVARS_132_03 - Minimum value according to documentation is 0, and here it is 512';
SET @@global.query_cache_min_res_unit = 512;
SELECT @@global.query_cache_min_res_unit;
@@global.query_cache_min_res_unit
@@ -31,7 +30,6 @@ SET @@global.query_cache_min_res_unit = 513;
SELECT @@global.query_cache_min_res_unit;
@@global.query_cache_min_res_unit
520
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
SET @@global.query_cache_min_res_unit = 1048576;
SELECT @@global.query_cache_min_res_unit;
@@global.query_cache_min_res_unit
@@ -70,7 +68,6 @@ SET @@global.query_cache_min_res_unit = 42949672950;
SELECT @@global.query_cache_min_res_unit;
@@global.query_cache_min_res_unit
42949672952
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@global.query_cache_min_res_unit = ON;
ERROR 42000: Incorrect argument type to variable 'query_cache_min_res_unit'
SELECT @@global.query_cache_min_res_unit;
diff --git a/mysql-test/suite/sys_vars/r/query_cache_type_basic.result b/mysql-test/suite/sys_vars/r/query_cache_type_basic.result
index 101853daa80..2a5af454b90 100644
--- a/mysql-test/suite/sys_vars/r/query_cache_type_basic.result
+++ b/mysql-test/suite/sys_vars/r/query_cache_type_basic.result
@@ -59,10 +59,7 @@ ERROR 42000: Variable 'query_cache_type' can't be set to the value of 'ONDEMAND'
SET @@global.query_cache_type = 'ON,OFF';
ERROR 42000: Variable 'query_cache_type' can't be set to the value of 'ON,OFF'
SET @@global.query_cache_type = 'OF';
-SELECT @@global.query_cache_type;
-@@global.query_cache_type
-OFF
-'Bug# 34828: OF is taken as OFF.'
+ERROR 42000: Variable 'query_cache_type' can't be set to the value of 'OF'
SET @@global.query_cache_type = YES;
ERROR 42000: Variable 'query_cache_type' can't be set to the value of 'YES'
SET @@global.query_cache_type = ' ';
@@ -93,35 +90,7 @@ SELECT @@global.query_cache_type;
@@global.query_cache_type
DEMAND
SET @@global.query_cache_type = 0.4;
-SELECT @@global.query_cache_type;
-@@global.query_cache_type
-OFF
-SET @@global.query_cache_type = 1.0;
-SELECT @@global.query_cache_type;
-@@global.query_cache_type
-ON
-SET @@global.query_cache_type = 1.1;
-SELECT @@global.query_cache_type;
-@@global.query_cache_type
-ON
-SET @@global.query_cache_type = 1.5;
-SELECT @@global.query_cache_type;
-@@global.query_cache_type
-DEMAND
-SET @@global.query_cache_type = 2.49;
-SELECT @@global.query_cache_type;
-@@global.query_cache_type
-DEMAND
-SET @@session.query_cache_type = 0.5;
-SELECT @@session.query_cache_type;
-@@session.query_cache_type
-ON
-SET @@session.query_cache_type = 1.6;
-SELECT @@session.query_cache_type;
-@@session.query_cache_type
-DEMAND
-'Bug: Decimal values can be used within the range [0.0-2.5). Values';
-'are rounded to 0,1,2 as evident from outcome.';
+ERROR 42000: Incorrect argument type to variable 'query_cache_type'
SET @@global.query_cache_type = 3;
ERROR 42000: Variable 'query_cache_type' can't be set to the value of '3'
'#---------------------FN_DYNVARS_134_08----------------------#'
diff --git a/mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_basic.result b/mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_basic.result
index bfbebab7ed1..96f42bbbda3 100644
--- a/mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_basic.result
+++ b/mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_basic.result
@@ -57,22 +57,19 @@ SELECT @@global.query_cache_wlock_invalidate;
SET @@session.query_cache_wlock_invalidate = -1;
ERROR 42000: Variable 'query_cache_wlock_invalidate' can't be set to the value of '-1'
SET @@session.query_cache_wlock_invalidate = 1.6;
-ERROR 42000: Variable 'query_cache_wlock_invalidate' can't be set to the value of '2'
+ERROR 42000: Incorrect argument type to variable 'query_cache_wlock_invalidate'
SET @@session.query_cache_wlock_invalidate = "T";
ERROR 42000: Variable 'query_cache_wlock_invalidate' can't be set to the value of 'T'
SET @@session.query_cache_wlock_invalidate = "Y";
ERROR 42000: Variable 'query_cache_wlock_invalidate' can't be set to the value of 'Y'
SET @@session.query_cache_wlock_invalidate = TRÜE;
-ERROR 42000: Variable 'query_cache_wlock_invalidate' can't be set to the value of 'TRÃœE'
+ERROR 42000: Variable 'query_cache_wlock_invalidate' can't be set to the value of 'TRÜE'
SET @@session.query_cache_wlock_invalidate = ÕN;
-ERROR 42000: Variable 'query_cache_wlock_invalidate' can't be set to the value of 'ÕN'
+ERROR 42000: Variable 'query_cache_wlock_invalidate' can't be set to the value of 'ÕN'
SET @@session.query_cache_wlock_invalidate = OF;
-SELECT @@session.query_cache_wlock_invalidate;
-@@session.query_cache_wlock_invalidate
-0
-'Bug# 34828: OF is taken as OFF and a value of 0 is set.'
+ERROR 42000: Variable 'query_cache_wlock_invalidate' can't be set to the value of 'OF'
SET @@session.query_cache_wlock_invalidate = ÓFF;
-ERROR 42000: Variable 'query_cache_wlock_invalidate' can't be set to the value of 'ÓFF'
+ERROR 42000: Variable 'query_cache_wlock_invalidate' can't be set to the value of 'ÓFF'
SET @@global.query_cache_wlock_invalidate = -1;
ERROR 42000: Variable 'query_cache_wlock_invalidate' can't be set to the value of '-1'
SET @@global.query_cache_wlock_invalidate = 2;
@@ -82,16 +79,13 @@ ERROR 42000: Variable 'query_cache_wlock_invalidate' can't be set to the value o
SET @@global.query_cache_wlock_invalidate = "Y";
ERROR 42000: Variable 'query_cache_wlock_invalidate' can't be set to the value of 'Y'
SET @@global.query_cache_wlock_invalidate = TRÜE;
-ERROR 42000: Variable 'query_cache_wlock_invalidate' can't be set to the value of 'TRÃœE'
+ERROR 42000: Variable 'query_cache_wlock_invalidate' can't be set to the value of 'TRÜE'
SET @@global.query_cache_wlock_invalidate = ÕN;
-ERROR 42000: Variable 'query_cache_wlock_invalidate' can't be set to the value of 'ÕN'
+ERROR 42000: Variable 'query_cache_wlock_invalidate' can't be set to the value of 'ÕN'
SET @@global.query_cache_wlock_invalidate = OF;
-SELECT @@global.query_cache_wlock_invalidate;
-@@global.query_cache_wlock_invalidate
-0
-'Bug 34828: OF is taken as OFF and a value of 0 is set.'
+ERROR 42000: Variable 'query_cache_wlock_invalidate' can't be set to the value of 'OF'
SET @@global.query_cache_wlock_invalidate = ÓFF;
-ERROR 42000: Variable 'query_cache_wlock_invalidate' can't be set to the value of 'ÓFF'
+ERROR 42000: Variable 'query_cache_wlock_invalidate' can't be set to the value of 'ÓFF'
'#-------------------FN_DYNVARS_135_05----------------------------#'
SET @@global.query_cache_wlock_invalidate = 0;
SET @@session.query_cache_wlock_invalidate = 1;
diff --git a/mysql-test/suite/sys_vars/r/query_prealloc_size_basic_64.result b/mysql-test/suite/sys_vars/r/query_prealloc_size_basic.result
index a16c56f95c5..1fd363ade16 100644
--- a/mysql-test/suite/sys_vars/r/query_prealloc_size_basic_64.result
+++ b/mysql-test/suite/sys_vars/r/query_prealloc_size_basic.result
@@ -36,6 +36,8 @@ SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
8192
SET @@global.query_prealloc_size = 655354;
+Warnings:
+Warning 1292 Truncated incorrect query_prealloc_size value: '655354'
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
654336
@@ -45,6 +47,8 @@ SELECT @@session.query_prealloc_size ;
@@session.query_prealloc_size
8192
SET @@session.query_prealloc_size = 655345;
+Warnings:
+Warning 1292 Truncated incorrect query_prealloc_size value: '655345'
SELECT @@session.query_prealloc_size ;
@@session.query_prealloc_size
654336
@@ -55,8 +59,8 @@ Warning 1292 Truncated incorrect query_prealloc_size value: '0'
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
8192
-SET @@global.query_prealloc_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.query_prealloc_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
8192
@@ -86,8 +90,8 @@ Warning 1292 Truncated incorrect query_prealloc_size value: '0'
SELECT @@session.query_prealloc_size ;
@@session.query_prealloc_size
8192
-SET @@session.query_prealloc_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.query_prealloc_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
SELECT @@session.query_prealloc_size ;
@@session.query_prealloc_size
8192
diff --git a/mysql-test/suite/sys_vars/r/query_prealloc_size_basic_32.result b/mysql-test/suite/sys_vars/r/query_prealloc_size_basic_32.result
deleted file mode 100644
index a16c56f95c5..00000000000
--- a/mysql-test/suite/sys_vars/r/query_prealloc_size_basic_32.result
+++ /dev/null
@@ -1,166 +0,0 @@
-SET @start_global_value = @@global.query_prealloc_size ;
-SELECT @start_global_value;
-@start_global_value
-8192
-SET @start_session_value = @@session.query_prealloc_size ;
-SELECT @start_session_value;
-@start_session_value
-8192
-'#--------------------FN_DYNVARS_005_01-------------------------#'
-SET @@global.query_prealloc_size = 100;
-Warnings:
-Warning 1292 Truncated incorrect query_prealloc_size value: '100'
-SET @@global.query_prealloc_size = DEFAULT;
-SELECT @@global.query_prealloc_size ;
-@@global.query_prealloc_size
-8192
-SET @@session.query_prealloc_size = 200;
-Warnings:
-Warning 1292 Truncated incorrect query_prealloc_size value: '200'
-SET @@session.query_prealloc_size = DEFAULT;
-SELECT @@session.query_prealloc_size ;
-@@session.query_prealloc_size
-8192
-'#--------------------FN_DYNVARS_005_02-------------------------#'
-SET @@global.query_prealloc_size = DEFAULT;
-SELECT @@global.query_prealloc_size = 8192;
-@@global.query_prealloc_size = 8192
-1
-SET @@session.query_prealloc_size = DEFAULT;
-SELECT @@session.query_prealloc_size = 8192;
-@@session.query_prealloc_size = 8192
-1
-'#--------------------FN_DYNVARS_005_03-------------------------#'
-SET @@global.query_prealloc_size = 8192;
-SELECT @@global.query_prealloc_size ;
-@@global.query_prealloc_size
-8192
-SET @@global.query_prealloc_size = 655354;
-SELECT @@global.query_prealloc_size ;
-@@global.query_prealloc_size
-654336
-'#--------------------FN_DYNVARS_005_04-------------------------#'
-SET @@session.query_prealloc_size = 8192;
-SELECT @@session.query_prealloc_size ;
-@@session.query_prealloc_size
-8192
-SET @@session.query_prealloc_size = 655345;
-SELECT @@session.query_prealloc_size ;
-@@session.query_prealloc_size
-654336
-'#------------------FN_DYNVARS_005_05-----------------------#'
-SET @@global.query_prealloc_size = 0;
-Warnings:
-Warning 1292 Truncated incorrect query_prealloc_size value: '0'
-SELECT @@global.query_prealloc_size ;
-@@global.query_prealloc_size
-8192
-SET @@global.query_prealloc_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@global.query_prealloc_size ;
-@@global.query_prealloc_size
-8192
-SET @@global.query_prealloc_size = test;
-ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
-SELECT @@global.query_prealloc_size ;
-@@global.query_prealloc_size
-8192
-SET @@global.query_prealloc_size = "test";
-ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
-SELECT @@global.query_prealloc_size ;
-@@global.query_prealloc_size
-8192
-SET @@global.query_prealloc_size = 'test';
-ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
-SELECT @@global.query_prealloc_size ;
-@@global.query_prealloc_size
-8192
-SET @@global.query_prealloc_size = ON;
-ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
-SELECT @@global.query_prealloc_size ;
-@@global.query_prealloc_size
-8192
-SET @@session.query_prealloc_size = 0;
-Warnings:
-Warning 1292 Truncated incorrect query_prealloc_size value: '0'
-SELECT @@session.query_prealloc_size ;
-@@session.query_prealloc_size
-8192
-SET @@session.query_prealloc_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@session.query_prealloc_size ;
-@@session.query_prealloc_size
-8192
-SET @@session.query_prealloc_size = test;
-ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
-SELECT @@session.query_prealloc_size ;
-@@session.query_prealloc_size
-8192
-SET @@session.query_prealloc_size = "test";
-ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
-SELECT @@session.query_prealloc_size ;
-@@session.query_prealloc_size
-8192
-'#------------------FN_DYNVARS_005_06-----------------------#'
-SELECT @@global.query_prealloc_size = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='query_prealloc_size ';
-@@global.query_prealloc_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_005_07-----------------------#'
-SELECT @@session.query_prealloc_size = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='query_prealloc_size ';
-@@session.query_prealloc_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_005_08-----------------------#'
-SET @@global.query_prealloc_size = TRUE;
-Warnings:
-Warning 1292 Truncated incorrect query_prealloc_size value: '1'
-SELECT @@global.query_prealloc_size ;
-@@global.query_prealloc_size
-8192
-SET @@global.query_prealloc_size = FALSE;
-Warnings:
-Warning 1292 Truncated incorrect query_prealloc_size value: '0'
-SELECT @@global.query_prealloc_size ;
-@@global.query_prealloc_size
-8192
-'#---------------------FN_DYNVARS_001_09----------------------#'
-SET @@global.query_prealloc_size = 10;
-Warnings:
-Warning 1292 Truncated incorrect query_prealloc_size value: '10'
-SELECT @@query_prealloc_size = @@global.query_prealloc_size ;
-@@query_prealloc_size = @@global.query_prealloc_size
-1
-'#---------------------FN_DYNVARS_001_10----------------------#'
-SET @@query_prealloc_size = 100;
-Warnings:
-Warning 1292 Truncated incorrect query_prealloc_size value: '100'
-SELECT @@query_prealloc_size = @@local.query_prealloc_size ;
-@@query_prealloc_size = @@local.query_prealloc_size
-1
-SELECT @@local.query_prealloc_size = @@session.query_prealloc_size ;
-@@local.query_prealloc_size = @@session.query_prealloc_size
-1
-'#---------------------FN_DYNVARS_001_11----------------------#'
-SET query_prealloc_size = 1;
-Warnings:
-Warning 1292 Truncated incorrect query_prealloc_size value: '1'
-SELECT @@query_prealloc_size ;
-@@query_prealloc_size
-8192
-SELECT local.query_prealloc_size ;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.query_prealloc_size ;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT query_prealloc_size = @@session.query_prealloc_size ;
-ERROR 42S22: Unknown column 'query_prealloc_size' in 'field list'
-SET @@global.query_prealloc_size = @start_global_value;
-SELECT @@global.query_prealloc_size ;
-@@global.query_prealloc_size
-8192
-SET @@session.query_prealloc_size = @start_session_value;
-SELECT @@session.query_prealloc_size ;
-@@session.query_prealloc_size
-8192
diff --git a/mysql-test/suite/sys_vars/r/rand_seed1_basic.result b/mysql-test/suite/sys_vars/r/rand_seed1_basic.result
new file mode 100644
index 00000000000..7b92d533c9e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/rand_seed1_basic.result
@@ -0,0 +1,27 @@
+select @@global.rand_seed1;
+ERROR HY000: Variable 'rand_seed1' is a SESSION variable
+select @@session.rand_seed1;
+@@session.rand_seed1
+0
+show global variables like 'rand_seed1';
+Variable_name Value
+show session variables like 'rand_seed1';
+Variable_name Value
+rand_seed1 0
+select * from information_schema.global_variables where variable_name='rand_seed1';
+VARIABLE_NAME VARIABLE_VALUE
+select * from information_schema.session_variables where variable_name='rand_seed1';
+VARIABLE_NAME VARIABLE_VALUE
+RAND_SEED1 0
+set session rand_seed1=1;
+select @@session.rand_seed1;
+@@session.rand_seed1
+0
+set global rand_seed1=1;
+ERROR HY000: Variable 'rand_seed1' is a SESSION variable and can't be used with SET GLOBAL
+set session rand_seed1=1.1;
+ERROR 42000: Incorrect argument type to variable 'rand_seed1'
+set session rand_seed1=1e1;
+ERROR 42000: Incorrect argument type to variable 'rand_seed1'
+set session rand_seed1="foo";
+ERROR 42000: Incorrect argument type to variable 'rand_seed1'
diff --git a/mysql-test/suite/sys_vars/r/rand_seed2_basic.result b/mysql-test/suite/sys_vars/r/rand_seed2_basic.result
new file mode 100644
index 00000000000..3d84aa3e37e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/rand_seed2_basic.result
@@ -0,0 +1,27 @@
+select @@global.rand_seed2;
+ERROR HY000: Variable 'rand_seed2' is a SESSION variable
+select @@session.rand_seed2;
+@@session.rand_seed2
+0
+show global variables like 'rand_seed2';
+Variable_name Value
+show session variables like 'rand_seed2';
+Variable_name Value
+rand_seed2 0
+select * from information_schema.global_variables where variable_name='rand_seed2';
+VARIABLE_NAME VARIABLE_VALUE
+select * from information_schema.session_variables where variable_name='rand_seed2';
+VARIABLE_NAME VARIABLE_VALUE
+RAND_SEED2 0
+set session rand_seed2=1;
+select @@session.rand_seed2;
+@@session.rand_seed2
+0
+set global rand_seed2=1;
+ERROR HY000: Variable 'rand_seed2' is a SESSION variable and can't be used with SET GLOBAL
+set session rand_seed2=1.1;
+ERROR 42000: Incorrect argument type to variable 'rand_seed2'
+set session rand_seed2=1e1;
+ERROR 42000: Incorrect argument type to variable 'rand_seed2'
+set session rand_seed2="foo";
+ERROR 42000: Incorrect argument type to variable 'rand_seed2'
diff --git a/mysql-test/suite/sys_vars/r/range_alloc_block_size_basic_32.result b/mysql-test/suite/sys_vars/r/range_alloc_block_size_basic_32.result
index 9e3b7851d8a..26b32b56e57 100644
--- a/mysql-test/suite/sys_vars/r/range_alloc_block_size_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/range_alloc_block_size_basic_32.result
@@ -37,7 +37,6 @@ Warning 1292 Truncated incorrect range_alloc_block_size value: '2048'
SELECT @@global.range_alloc_block_size;
@@global.range_alloc_block_size
4096
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
SET @@global.range_alloc_block_size = 4294967295;
Warnings:
Warning 1292 Truncated incorrect range_alloc_block_size value: '4294967295'
@@ -50,7 +49,6 @@ Warning 1292 Truncated incorrect range_alloc_block_size value: '4294967294'
SELECT @@global.range_alloc_block_size;
@@global.range_alloc_block_size
4294966272
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
'#--------------------FN_DYNVARS_137_04-------------------------#'
SET @@session.range_alloc_block_size = 2048;
Warnings:
@@ -89,8 +87,8 @@ Warning 1292 Truncated incorrect range_alloc_block_size value: '42949672951'
SELECT @@global.range_alloc_block_size;
@@global.range_alloc_block_size
4294966272
-SET @@global.range_alloc_block_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.range_alloc_block_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'range_alloc_block_size'
SELECT @@global.range_alloc_block_size;
@@global.range_alloc_block_size
4294966272
@@ -111,15 +109,14 @@ Warning 1292 Truncated incorrect range_alloc_block_size value: '-2'
SELECT @@session.range_alloc_block_size;
@@session.range_alloc_block_size
4096
-SET @@session.range_alloc_block_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.range_alloc_block_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'range_alloc_block_size'
SET @@session.range_alloc_block_size = 4294967296;
Warnings:
Warning 1292 Truncated incorrect range_alloc_block_size value: '4294967296'
SELECT @@session.range_alloc_block_size;
@@session.range_alloc_block_size
4294966272
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@session.range_alloc_block_size = test;
ERROR 42000: Incorrect argument type to variable 'range_alloc_block_size'
SELECT @@session.range_alloc_block_size;
diff --git a/mysql-test/suite/sys_vars/r/range_alloc_block_size_basic_64.result b/mysql-test/suite/sys_vars/r/range_alloc_block_size_basic_64.result
index 29bf939edac..ef91e91ca86 100644
--- a/mysql-test/suite/sys_vars/r/range_alloc_block_size_basic_64.result
+++ b/mysql-test/suite/sys_vars/r/range_alloc_block_size_basic_64.result
@@ -37,16 +37,18 @@ Warning 1292 Truncated incorrect range_alloc_block_size value: '2048'
SELECT @@global.range_alloc_block_size;
@@global.range_alloc_block_size
4096
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
SET @@global.range_alloc_block_size = 4294967295;
+Warnings:
+Warning 1292 Truncated incorrect range_alloc_block_size value: '4294967295'
SELECT @@global.range_alloc_block_size;
@@global.range_alloc_block_size
4294966272
SET @@global.range_alloc_block_size = 4294967294;
+Warnings:
+Warning 1292 Truncated incorrect range_alloc_block_size value: '4294967294'
SELECT @@global.range_alloc_block_size;
@@global.range_alloc_block_size
4294966272
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
'#--------------------FN_DYNVARS_137_04-------------------------#'
SET @@session.range_alloc_block_size = 2048;
Warnings:
@@ -55,10 +57,14 @@ SELECT @@session.range_alloc_block_size;
@@session.range_alloc_block_size
4096
SET @@session.range_alloc_block_size = 4294967295;
+Warnings:
+Warning 1292 Truncated incorrect range_alloc_block_size value: '4294967295'
SELECT @@session.range_alloc_block_size;
@@session.range_alloc_block_size
4294966272
SET @@session.range_alloc_block_size = 4294967294;
+Warnings:
+Warning 1292 Truncated incorrect range_alloc_block_size value: '4294967294'
SELECT @@session.range_alloc_block_size;
@@session.range_alloc_block_size
4294966272
@@ -76,11 +82,13 @@ SELECT @@global.range_alloc_block_size;
@@global.range_alloc_block_size
4096
SET @@global.range_alloc_block_size = 42949672951;
+Warnings:
+Warning 1292 Truncated incorrect range_alloc_block_size value: '42949672951'
SELECT @@global.range_alloc_block_size;
@@global.range_alloc_block_size
42949671936
-SET @@global.range_alloc_block_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.range_alloc_block_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'range_alloc_block_size'
SELECT @@global.range_alloc_block_size;
@@global.range_alloc_block_size
42949671936
@@ -101,13 +109,12 @@ Warning 1292 Truncated incorrect range_alloc_block_size value: '-2'
SELECT @@session.range_alloc_block_size;
@@session.range_alloc_block_size
4096
-SET @@session.range_alloc_block_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.range_alloc_block_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'range_alloc_block_size'
SET @@session.range_alloc_block_size = 4294967296;
SELECT @@session.range_alloc_block_size;
@@session.range_alloc_block_size
4294967296
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@session.range_alloc_block_size = test;
ERROR 42000: Incorrect argument type to variable 'range_alloc_block_size'
SELECT @@session.range_alloc_block_size;
diff --git a/mysql-test/suite/sys_vars/r/read_buffer_size_basic.result b/mysql-test/suite/sys_vars/r/read_buffer_size_basic.result
index 6aee841c939..bb1ed110ae2 100644
--- a/mysql-test/suite/sys_vars/r/read_buffer_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/read_buffer_size_basic.result
@@ -34,20 +34,22 @@ SELECT @@session.read_buffer_size = 131072;
SET @@global.read_buffer_size = 8201;
Warnings:
Warning 1292 Truncated incorrect read_buffer_size value: '8201'
-SELECT @@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228 ;
-@@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228
-1
+SELECT @@global.read_buffer_size;
+@@global.read_buffer_size
+8192
SET @@global.read_buffer_size = 8200;
Warnings:
Warning 1292 Truncated incorrect read_buffer_size value: '8200'
-SELECT @@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228 ;
-@@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228
-1
+SELECT @@global.read_buffer_size;
+@@global.read_buffer_size
+8192
SET @@global.read_buffer_size = 2147479552;
SELECT @@global.read_buffer_size;
@@global.read_buffer_size
2147479552
SET @@global.read_buffer_size = 2147479551;
+Warnings:
+Warning 1292 Truncated incorrect read_buffer_size value: '2147479551'
SELECT @@global.read_buffer_size;
@@global.read_buffer_size
2147475456
@@ -55,20 +57,22 @@ SELECT @@global.read_buffer_size;
SET @@session.read_buffer_size = 8200;
Warnings:
Warning 1292 Truncated incorrect read_buffer_size value: '8200'
-SELECT @@session.read_buffer_size= 8200 OR @@session.read_buffer_size= 8228 ;
-@@session.read_buffer_size= 8200 OR @@session.read_buffer_size= 8228
-1
+SELECT @@session.read_buffer_size;
+@@session.read_buffer_size
+8192
SET @@session.read_buffer_size = 8201;
Warnings:
Warning 1292 Truncated incorrect read_buffer_size value: '8201'
-SELECT @@session.read_buffer_size= 8200 OR @@session.read_buffer_size= 8228 ;
-@@session.read_buffer_size= 8200 OR @@session.read_buffer_size= 8228
-1
+SELECT @@session.read_buffer_size;
+@@session.read_buffer_size
+8192
SET @@session.read_buffer_size = 2147479552;
SELECT @@session.read_buffer_size;
@@session.read_buffer_size
2147479552
SET @@session.read_buffer_size = 2147479551;
+Warnings:
+Warning 1292 Truncated incorrect read_buffer_size value: '2147479551'
SELECT @@session.read_buffer_size;
@@session.read_buffer_size
2147475456
@@ -76,23 +80,23 @@ SELECT @@session.read_buffer_size;
SET @@global.read_buffer_size = 8199;
Warnings:
Warning 1292 Truncated incorrect read_buffer_size value: '8199'
-SELECT @@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228 ;
-@@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228
-1
+SELECT @@global.read_buffer_size;
+@@global.read_buffer_size
+8192
SET @@global.read_buffer_size = -1024;
Warnings:
Warning 1292 Truncated incorrect read_buffer_size value: '-1024'
-SELECT @@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228 ;
-@@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228
-1
+SELECT @@global.read_buffer_size;
+@@global.read_buffer_size
+8192
SET @@global.read_buffer_size = 2147479553;
Warnings:
Warning 1292 Truncated incorrect read_buffer_size value: '2147479553'
SELECT @@global.read_buffer_size;
@@global.read_buffer_size
2147479552
-SET @@global.read_buffer_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.read_buffer_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'read_buffer_size'
SELECT @@global.read_buffer_size;
@@global.read_buffer_size
2147479552
@@ -104,24 +108,23 @@ SELECT @@global.read_buffer_size;
SET @@session.read_buffer_size = 8199;
Warnings:
Warning 1292 Truncated incorrect read_buffer_size value: '8199'
-SELECT @@session.read_buffer_size= 8200 OR @@session.read_buffer_size= 8228 ;
-@@session.read_buffer_size= 8200 OR @@session.read_buffer_size= 8228
-1
+SELECT @@session.read_buffer_size;
+@@session.read_buffer_size
+8192
SET @@session.read_buffer_size = -2;
Warnings:
Warning 1292 Truncated incorrect read_buffer_size value: '-2'
-SELECT @@session.read_buffer_size= 8200 OR @@session.read_buffer_size= 8228 ;
-@@session.read_buffer_size= 8200 OR @@session.read_buffer_size= 8228
-1
-SET @@session.read_buffer_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@session.read_buffer_size;
+@@session.read_buffer_size
+8192
+SET @@session.read_buffer_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'read_buffer_size'
SET @@session.read_buffer_size = 2147479553;
Warnings:
Warning 1292 Truncated incorrect read_buffer_size value: '2147479553'
SELECT @@session.read_buffer_size;
@@session.read_buffer_size
2147479552
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@session.read_buffer_size = test;
ERROR 42000: Incorrect argument type to variable 'read_buffer_size'
SELECT @@session.read_buffer_size;
@@ -143,23 +146,26 @@ WHERE VARIABLE_NAME='read_buffer_size';
SET @@global.read_buffer_size = TRUE;
Warnings:
Warning 1292 Truncated incorrect read_buffer_size value: '1'
-SELECT @@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228 ;
-@@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228
-1
+SELECT @@global.read_buffer_size;
+@@global.read_buffer_size
+8192
SET @@global.read_buffer_size = FALSE;
Warnings:
Warning 1292 Truncated incorrect read_buffer_size value: '0'
-SELECT @@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228 ;
-@@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228
-1
-'Bug: FN_DYNVARS_138_08- Errors are not coming on assigning TRUE/FALSE to variable'
+SELECT @@global.read_buffer_size;
+@@global.read_buffer_size
+8192
'#---------------------FN_DYNVARS_138_09----------------------#'
SET @@global.read_buffer_size = 9000;
+Warnings:
+Warning 1292 Truncated incorrect read_buffer_size value: '9000'
SELECT @@read_buffer_size = @@global.read_buffer_size;
@@read_buffer_size = @@global.read_buffer_size
0
'#---------------------FN_DYNVARS_138_10----------------------#'
SET @@read_buffer_size = 9000;
+Warnings:
+Warning 1292 Truncated incorrect read_buffer_size value: '9000'
SELECT @@read_buffer_size = @@local.read_buffer_size;
@@read_buffer_size = @@local.read_buffer_size
1
@@ -168,9 +174,11 @@ SELECT @@local.read_buffer_size = @@session.read_buffer_size;
1
'#---------------------FN_DYNVARS_138_11----------------------#'
SET read_buffer_size = 9100;
-SELECT @@read_buffer_size= 8200 OR @@read_buffer_size= 8228 ;
-@@read_buffer_size= 8200 OR @@read_buffer_size= 8228
-1
+Warnings:
+Warning 1292 Truncated incorrect read_buffer_size value: '9100'
+SELECT @@read_buffer_size;
+@@read_buffer_size
+8192
SELECT local.read_buffer_size;
ERROR 42S02: Unknown table 'local' in field list
SELECT session.read_buffer_size;
diff --git a/mysql-test/suite/sys_vars/r/read_only_basic.result b/mysql-test/suite/sys_vars/r/read_only_basic.result
index 4ea316a41f1..0b344eeb932 100644
--- a/mysql-test/suite/sys_vars/r/read_only_basic.result
+++ b/mysql-test/suite/sys_vars/r/read_only_basic.result
@@ -55,7 +55,7 @@ SELECT @@global.read_only;
@@global.read_only
0
SET @@global.read_only = 10000.01;
-ERROR 42000: Variable 'read_only' can't be set to the value of '10000'
+ERROR 42000: Incorrect argument type to variable 'read_only'
SELECT @@global.read_only;
@@global.read_only
0
@@ -69,7 +69,6 @@ ERROR 42000: Variable 'read_only' can't be set to the value of '42949672950'
SELECT @@global.read_only;
@@global.read_only
0
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@global.read_only = 'test';
ERROR 42000: Variable 'read_only' can't be set to the value of 'test'
SELECT @@global.read_only;
diff --git a/mysql-test/suite/sys_vars/r/read_rnd_buffer_size_basic.result b/mysql-test/suite/sys_vars/r/read_rnd_buffer_size_basic.result
index f2645e4d527..8ee67e71b79 100644
--- a/mysql-test/suite/sys_vars/r/read_rnd_buffer_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/read_rnd_buffer_size_basic.result
@@ -8,42 +8,24 @@ SELECT @start_session_value;
262144
'#--------------------FN_DYNVARS_140_01-------------------------#'
SET @@global.read_rnd_buffer_size = 1000;
-Warnings:
-Warning 1292 Truncated incorrect read_rnd_buffer_size value: '1000'
SET @@global.read_rnd_buffer_size = DEFAULT;
SELECT @@global.read_rnd_buffer_size;
@@global.read_rnd_buffer_size
262144
SET @@session.read_rnd_buffer_size = 2000;
-Warnings:
-Warning 1292 Truncated incorrect read_rnd_buffer_size value: '2000'
SET @@session.read_rnd_buffer_size = DEFAULT;
SELECT @@session.read_rnd_buffer_size;
@@session.read_rnd_buffer_size
262144
-'#--------------------FN_DYNVARS_140_02-------------------------#'
-SET @@global.read_rnd_buffer_size = DEFAULT;
-SELECT @@global.read_rnd_buffer_size = 262144;
-@@global.read_rnd_buffer_size = 262144
-1
-SET @@session.read_rnd_buffer_size = DEFAULT;
-SELECT @@session.read_rnd_buffer_size = 262144;
-@@session.read_rnd_buffer_size = 262144
-1
-'Bug# 34876: This variable has invalid default value as compared to documentation';
'#--------------------FN_DYNVARS_140_03-------------------------#'
SET @@global.read_rnd_buffer_size = 8201;
-Warnings:
-Warning 1292 Truncated incorrect read_rnd_buffer_size value: '8201'
-SELECT @@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228;
-@@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228
-1
+SELECT @@global.read_rnd_buffer_size;
+@@global.read_rnd_buffer_size
+8201
SET @@global.read_rnd_buffer_size = 8200;
-Warnings:
-Warning 1292 Truncated incorrect read_rnd_buffer_size value: '8200'
-SELECT @@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228;
-@@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228
-1
+SELECT @@global.read_rnd_buffer_size;
+@@global.read_rnd_buffer_size
+8200
SET @@global.read_rnd_buffer_size = 2147479552;
SELECT @@global.read_rnd_buffer_size;
@@global.read_rnd_buffer_size
@@ -51,21 +33,16 @@ SELECT @@global.read_rnd_buffer_size;
SET @@global.read_rnd_buffer_size = 2147479551;
SELECT @@global.read_rnd_buffer_size;
@@global.read_rnd_buffer_size
-2147475456
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+2147479551
'#--------------------FN_DYNVARS_140_04-------------------------#'
SET @@session.read_rnd_buffer_size = 8200;
-Warnings:
-Warning 1292 Truncated incorrect read_rnd_buffer_size value: '8200'
-SELECT @@session.read_rnd_buffer_size= 8200 OR @@session.read_rnd_buffer_size= 8228;
-@@session.read_rnd_buffer_size= 8200 OR @@session.read_rnd_buffer_size= 8228
-1
+SELECT @@session.read_rnd_buffer_size;
+@@session.read_rnd_buffer_size
+8200
SET @@session.read_rnd_buffer_size = 8201;
-Warnings:
-Warning 1292 Truncated incorrect read_rnd_buffer_size value: '8201'
-SELECT @@session.read_rnd_buffer_size= 8200 OR @@session.read_rnd_buffer_size= 8228;
-@@session.read_rnd_buffer_size= 8200 OR @@session.read_rnd_buffer_size= 8228
-1
+SELECT @@session.read_rnd_buffer_size;
+@@session.read_rnd_buffer_size
+8201
SET @@session.read_rnd_buffer_size = 2147479552;
SELECT @@session.read_rnd_buffer_size;
@@session.read_rnd_buffer_size
@@ -73,62 +50,40 @@ SELECT @@session.read_rnd_buffer_size;
SET @@session.read_rnd_buffer_size = 2147479551;
SELECT @@session.read_rnd_buffer_size;
@@session.read_rnd_buffer_size
-2147475456
+2147479551
'#------------------FN_DYNVARS_140_05-----------------------#'
SET @@global.read_rnd_buffer_size = 8199;
-Warnings:
-Warning 1292 Truncated incorrect read_rnd_buffer_size value: '8199'
-SELECT @@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228;
-@@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228
-1
+SELECT @@global.read_rnd_buffer_size;
+@@global.read_rnd_buffer_size
+8199
SET @@global.read_rnd_buffer_size = -1024;
Warnings:
Warning 1292 Truncated incorrect read_rnd_buffer_size value: '-1024'
-SELECT @@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228;
-@@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228
-1
-SET @@global.read_rnd_buffer_size = 2147479553;
-Warnings:
-Warning 1292 Truncated incorrect read_rnd_buffer_size value: '2147479553'
SELECT @@global.read_rnd_buffer_size;
@@global.read_rnd_buffer_size
-2147479552
-SET @@global.read_rnd_buffer_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+1
+SET @@global.read_rnd_buffer_size = 2147479553;
SELECT @@global.read_rnd_buffer_size;
@@global.read_rnd_buffer_size
-2147479552
+2147479553
+SET @@global.read_rnd_buffer_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'read_rnd_buffer_size'
SET @@global.read_rnd_buffer_size = test;
ERROR 42000: Incorrect argument type to variable 'read_rnd_buffer_size'
-SELECT @@global.read_rnd_buffer_size;
-@@global.read_rnd_buffer_size
-2147479552
SET @@session.read_rnd_buffer_size = 8199;
-Warnings:
-Warning 1292 Truncated incorrect read_rnd_buffer_size value: '8199'
-SELECT @@session.read_rnd_buffer_size= 8200 OR @@session.read_rnd_buffer_size= 8228;
-@@session.read_rnd_buffer_size= 8200 OR @@session.read_rnd_buffer_size= 8228
-1
+SELECT @@session.read_rnd_buffer_size;
+@@session.read_rnd_buffer_size
+8199
SET @@session.read_rnd_buffer_size = -2;
Warnings:
Warning 1292 Truncated incorrect read_rnd_buffer_size value: '-2'
-SELECT @@session.read_rnd_buffer_size= 8200 OR @@session.read_rnd_buffer_size= 8228;
-@@session.read_rnd_buffer_size= 8200 OR @@session.read_rnd_buffer_size= 8228
-1
-SET @@session.read_rnd_buffer_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SET @@session.read_rnd_buffer_size = 2147479553;
-Warnings:
-Warning 1292 Truncated incorrect read_rnd_buffer_size value: '2147479553'
SELECT @@session.read_rnd_buffer_size;
@@session.read_rnd_buffer_size
-2147479552
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+1
+SET @@session.read_rnd_buffer_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'read_rnd_buffer_size'
SET @@session.read_rnd_buffer_size = test;
ERROR 42000: Incorrect argument type to variable 'read_rnd_buffer_size'
-SELECT @@session.read_rnd_buffer_size;
-@@session.read_rnd_buffer_size
-2147479552
'#------------------FN_DYNVARS_140_06-----------------------#'
SELECT @@global.read_rnd_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='read_rnd_buffer_size';
@@global.read_rnd_buffer_size = VARIABLE_VALUE
@@ -141,16 +96,14 @@ VARIABLE_VALUE
1
'#------------------FN_DYNVARS_140_08-----------------------#'
SET @@global.read_rnd_buffer_size = TRUE;
-Warnings:
-Warning 1292 Truncated incorrect read_rnd_buffer_size value: '1'
-SELECT @@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228;
-@@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228
+SELECT @@global.read_rnd_buffer_size;
+@@global.read_rnd_buffer_size
1
SET @@global.read_rnd_buffer_size = FALSE;
Warnings:
Warning 1292 Truncated incorrect read_rnd_buffer_size value: '0'
-SELECT @@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228;
-@@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228
+SELECT @@global.read_rnd_buffer_size;
+@@global.read_rnd_buffer_size
1
'#---------------------FN_DYNVARS_140_09----------------------#'
SET @@global.read_rnd_buffer_size = 9000;
@@ -167,9 +120,9 @@ SELECT @@local.read_rnd_buffer_size = @@session.read_rnd_buffer_size;
1
'#---------------------FN_DYNVARS_140_11----------------------#'
SET read_rnd_buffer_size = 9100;
-SELECT @@read_rnd_buffer_size= 8200 OR @@read_rnd_buffer_size= 8228;
-@@read_rnd_buffer_size= 8200 OR @@read_rnd_buffer_size= 8228
-1
+SELECT @@read_rnd_buffer_size;
+@@read_rnd_buffer_size
+9100
SELECT local.read_rnd_buffer_size;
ERROR 42S02: Unknown table 'local' in field list
SELECT session.read_rnd_buffer_size;
diff --git a/mysql-test/suite/sys_vars/r/relay_log_basic.result b/mysql-test/suite/sys_vars/r/relay_log_basic.result
new file mode 100644
index 00000000000..1b93db7442f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/relay_log_basic.result
@@ -0,0 +1,21 @@
+select @@global.relay_log;
+@@global.relay_log
+NULL
+select @@session.relay_log;
+ERROR HY000: Variable 'relay_log' is a GLOBAL variable
+show global variables like 'relay_log';
+Variable_name Value
+relay_log
+show session variables like 'relay_log';
+Variable_name Value
+relay_log
+select * from information_schema.global_variables where variable_name='relay_log';
+VARIABLE_NAME VARIABLE_VALUE
+RELAY_LOG
+select * from information_schema.session_variables where variable_name='relay_log';
+VARIABLE_NAME VARIABLE_VALUE
+RELAY_LOG
+set global relay_log=1;
+ERROR HY000: Variable 'relay_log' is a read only variable
+set session relay_log=1;
+ERROR HY000: Variable 'relay_log' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/relay_log_index_basic.result b/mysql-test/suite/sys_vars/r/relay_log_index_basic.result
new file mode 100644
index 00000000000..56a3a34957c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/relay_log_index_basic.result
@@ -0,0 +1,21 @@
+select @@global.relay_log_index;
+@@global.relay_log_index
+NULL
+select @@session.relay_log_index;
+ERROR HY000: Variable 'relay_log_index' is a GLOBAL variable
+show global variables like 'relay_log_index';
+Variable_name Value
+relay_log_index
+show session variables like 'relay_log_index';
+Variable_name Value
+relay_log_index
+select * from information_schema.global_variables where variable_name='relay_log_index';
+VARIABLE_NAME VARIABLE_VALUE
+RELAY_LOG_INDEX
+select * from information_schema.session_variables where variable_name='relay_log_index';
+VARIABLE_NAME VARIABLE_VALUE
+RELAY_LOG_INDEX
+set global relay_log_index=1;
+ERROR HY000: Variable 'relay_log_index' is a read only variable
+set session relay_log_index=1;
+ERROR HY000: Variable 'relay_log_index' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/relay_log_info_file_basic.result b/mysql-test/suite/sys_vars/r/relay_log_info_file_basic.result
new file mode 100644
index 00000000000..4c967b66882
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/relay_log_info_file_basic.result
@@ -0,0 +1,21 @@
+select @@global.relay_log_info_file;
+@@global.relay_log_info_file
+relay-log.info
+select @@session.relay_log_info_file;
+ERROR HY000: Variable 'relay_log_info_file' is a GLOBAL variable
+show global variables like 'relay_log_info_file';
+Variable_name Value
+relay_log_info_file relay-log.info
+show session variables like 'relay_log_info_file';
+Variable_name Value
+relay_log_info_file relay-log.info
+select * from information_schema.global_variables where variable_name='relay_log_info_file';
+VARIABLE_NAME VARIABLE_VALUE
+RELAY_LOG_INFO_FILE relay-log.info
+select * from information_schema.session_variables where variable_name='relay_log_info_file';
+VARIABLE_NAME VARIABLE_VALUE
+RELAY_LOG_INFO_FILE relay-log.info
+set global relay_log_info_file=1;
+ERROR HY000: Variable 'relay_log_info_file' is a read only variable
+set session relay_log_info_file=1;
+ERROR HY000: Variable 'relay_log_info_file' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/relay_log_recovery_basic.result b/mysql-test/suite/sys_vars/r/relay_log_recovery_basic.result
new file mode 100644
index 00000000000..97b991ce65b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/relay_log_recovery_basic.result
@@ -0,0 +1,41 @@
+SET @start_global_value = @@global.relay_log_recovery;
+SELECT @start_global_value;
+@start_global_value
+0
+select @@global.relay_log_recovery;
+@@global.relay_log_recovery
+0
+select @@session.relay_log_recovery;
+ERROR HY000: Variable 'relay_log_recovery' is a GLOBAL variable
+show global variables like 'relay_log_recovery';
+Variable_name Value
+relay_log_recovery OFF
+show session variables like 'relay_log_recovery';
+Variable_name Value
+relay_log_recovery OFF
+select * from information_schema.global_variables where variable_name='relay_log_recovery';
+VARIABLE_NAME VARIABLE_VALUE
+RELAY_LOG_RECOVERY OFF
+select * from information_schema.session_variables where variable_name='relay_log_recovery';
+VARIABLE_NAME VARIABLE_VALUE
+RELAY_LOG_RECOVERY OFF
+set global relay_log_recovery=1;
+select @@global.relay_log_recovery;
+@@global.relay_log_recovery
+1
+set global relay_log_recovery=OFF;
+select @@global.relay_log_recovery;
+@@global.relay_log_recovery
+0
+set session relay_log_recovery=1;
+ERROR HY000: Variable 'relay_log_recovery' is a GLOBAL variable and should be set with SET GLOBAL
+set global relay_log_recovery=1.1;
+ERROR 42000: Incorrect argument type to variable 'relay_log_recovery'
+set global relay_log_recovery=1e1;
+ERROR 42000: Incorrect argument type to variable 'relay_log_recovery'
+set global relay_log_recovery="foo";
+ERROR 42000: Variable 'relay_log_recovery' can't be set to the value of 'foo'
+SET @@global.relay_log_recovery = @start_global_value;
+SELECT @@global.relay_log_recovery;
+@@global.relay_log_recovery
+0
diff --git a/mysql-test/suite/sys_vars/r/relay_log_space_limit_basic.result b/mysql-test/suite/sys_vars/r/relay_log_space_limit_basic.result
new file mode 100644
index 00000000000..f107352f448
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/relay_log_space_limit_basic.result
@@ -0,0 +1,21 @@
+select @@global.relay_log_space_limit;
+@@global.relay_log_space_limit
+0
+select @@session.relay_log_space_limit;
+ERROR HY000: Variable 'relay_log_space_limit' is a GLOBAL variable
+show global variables like 'relay_log_space_limit';
+Variable_name Value
+relay_log_space_limit 0
+show session variables like 'relay_log_space_limit';
+Variable_name Value
+relay_log_space_limit 0
+select * from information_schema.global_variables where variable_name='relay_log_space_limit';
+VARIABLE_NAME VARIABLE_VALUE
+RELAY_LOG_SPACE_LIMIT 0
+select * from information_schema.session_variables where variable_name='relay_log_space_limit';
+VARIABLE_NAME VARIABLE_VALUE
+RELAY_LOG_SPACE_LIMIT 0
+set global relay_log_space_limit=1;
+ERROR HY000: Variable 'relay_log_space_limit' is a read only variable
+set session relay_log_space_limit=1;
+ERROR HY000: Variable 'relay_log_space_limit' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/report_host_basic.result b/mysql-test/suite/sys_vars/r/report_host_basic.result
new file mode 100644
index 00000000000..96775aeb65d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/report_host_basic.result
@@ -0,0 +1,21 @@
+select @@global.report_host;
+@@global.report_host
+NULL
+select @@session.report_host;
+ERROR HY000: Variable 'report_host' is a GLOBAL variable
+show global variables like 'report_host';
+Variable_name Value
+report_host
+show session variables like 'report_host';
+Variable_name Value
+report_host
+select * from information_schema.global_variables where variable_name='report_host';
+VARIABLE_NAME VARIABLE_VALUE
+REPORT_HOST
+select * from information_schema.session_variables where variable_name='report_host';
+VARIABLE_NAME VARIABLE_VALUE
+REPORT_HOST
+set global report_host=1;
+ERROR HY000: Variable 'report_host' is a read only variable
+set session report_host=1;
+ERROR HY000: Variable 'report_host' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/report_password_basic.result b/mysql-test/suite/sys_vars/r/report_password_basic.result
new file mode 100644
index 00000000000..290f1556b1c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/report_password_basic.result
@@ -0,0 +1,21 @@
+select @@global.report_password;
+@@global.report_password
+NULL
+select @@session.report_password;
+ERROR HY000: Variable 'report_password' is a GLOBAL variable
+show global variables like 'report_password';
+Variable_name Value
+report_password
+show session variables like 'report_password';
+Variable_name Value
+report_password
+select * from information_schema.global_variables where variable_name='report_password';
+VARIABLE_NAME VARIABLE_VALUE
+REPORT_PASSWORD
+select * from information_schema.session_variables where variable_name='report_password';
+VARIABLE_NAME VARIABLE_VALUE
+REPORT_PASSWORD
+set global report_password=1;
+ERROR HY000: Variable 'report_password' is a read only variable
+set session report_password=1;
+ERROR HY000: Variable 'report_password' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/report_port_basic.result b/mysql-test/suite/sys_vars/r/report_port_basic.result
new file mode 100644
index 00000000000..1a7849c1328
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/report_port_basic.result
@@ -0,0 +1,21 @@
+select @@global.report_port;
+@@global.report_port
+DEFAULT_MASTER_PORT
+select @@session.report_port;
+ERROR HY000: Variable 'report_port' is a GLOBAL variable
+show global variables like 'report_port';
+Variable_name Value
+report_port DEFAULT_MASTER_PORT
+show session variables like 'report_port';
+Variable_name Value
+report_port DEFAULT_MASTER_PORT
+select * from information_schema.global_variables where variable_name='report_port';
+VARIABLE_NAME VARIABLE_VALUE
+REPORT_PORT DEFAULT_MASTER_PORT
+select * from information_schema.session_variables where variable_name='report_port';
+VARIABLE_NAME VARIABLE_VALUE
+REPORT_PORT DEFAULT_MASTER_PORT
+set global report_port=1;
+ERROR HY000: Variable 'report_port' is a read only variable
+set session report_port=1;
+ERROR HY000: Variable 'report_port' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/report_user_basic.result b/mysql-test/suite/sys_vars/r/report_user_basic.result
new file mode 100644
index 00000000000..696c961974e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/report_user_basic.result
@@ -0,0 +1,21 @@
+select @@global.report_user;
+@@global.report_user
+NULL
+select @@session.report_user;
+ERROR HY000: Variable 'report_user' is a GLOBAL variable
+show global variables like 'report_user';
+Variable_name Value
+report_user
+show session variables like 'report_user';
+Variable_name Value
+report_user
+select * from information_schema.global_variables where variable_name='report_user';
+VARIABLE_NAME VARIABLE_VALUE
+REPORT_USER
+select * from information_schema.session_variables where variable_name='report_user';
+VARIABLE_NAME VARIABLE_VALUE
+REPORT_USER
+set global report_user=1;
+ERROR HY000: Variable 'report_user' is a read only variable
+set session report_user=1;
+ERROR HY000: Variable 'report_user' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/rpl_init_slave_func.result b/mysql-test/suite/sys_vars/r/rpl_init_slave_func.result
index bdb586e84c2..36b467696be 100644
--- a/mysql-test/suite/sys_vars/r/rpl_init_slave_func.result
+++ b/mysql-test/suite/sys_vars/r/rpl_init_slave_func.result
@@ -7,15 +7,19 @@ start slave;
connection slave
SET @start_max_connections= @@global.max_connections;
SET @start_init_slave= @@global.init_slave;
-SET @@global.init_slave = 'SET @@global.max_connections = @@global.max_connections + 1';
+SET NAMES utf8;
+SET @@global.init_slave = 'SET @@global.max_connections = @@global.max_connections + 1 -- комментарий';
DROP TABLE IF EXISTS t1;
CREATE TEMPORARY TABLE t1 AS SELECT @@global.init_slave AS my_column;
DESCRIBE t1;
Field Type Null Key Default Extra
-my_column varchar(59) YES NULL
+my_column varchar(74) YES NULL
+select length(my_column) from t1;
+length(my_column)
+85
DROP TABLE t1;
-SELECT @@global.init_slave = 'SET @@global.max_connections = @@global.max_connections + 1';
-@@global.init_slave = 'SET @@global.max_connections = @@global.max_connections + 1'
+SELECT @@global.init_slave = 'SET @@global.max_connections = @@global.max_connections + 1 -- комментарий';
+@@global.init_slave = 'SET @@global.max_connections = @@global.max_connections + 1 -- комментарий'
1
Expect 1
SELECT @@global.max_connections= @start_max_connections;
diff --git a/mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_32.result b/mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_32.result
index 3b7ecf9dc4a..f5b771c47cc 100644
--- a/mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_32.result
@@ -4,31 +4,43 @@ SELECT @start_global_value;
0
'#--------------------FN_DYNVARS_142_01-------------------------#'
SET @@global.rpl_recovery_rank = 500000;
+Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
SET @@global.rpl_recovery_rank = DEFAULT;
+Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
0
'#--------------------FN_DYNVARS_142_02-------------------------#'
SET @@global.rpl_recovery_rank = 0;
+Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
0
SET @@global.rpl_recovery_rank = 1024;
+Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
1024
SET @@global.rpl_recovery_rank = 123456789;
+Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
123456789
SET @@global.rpl_recovery_rank = 2147483648*2;
Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
Warning 1292 Truncated incorrect rpl_recovery_rank value: '4294967296'
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
4294967295
SET @@global.rpl_recovery_rank = 2147483648*1024;
Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
Warning 1292 Truncated incorrect rpl_recovery_rank value: '2199023255552'
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
@@ -38,6 +50,7 @@ SELECT @@global.rpl_recovery_rank;
4294967295
SET @@global.rpl_recovery_rank = 2147483648*2147483648;
Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
Warning 1292 Truncated incorrect rpl_recovery_rank value: '4611686018427387904'
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
@@ -52,30 +65,35 @@ ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set
'#------------------FN_DYNVARS_142_04-----------------------#'
SET @@global.rpl_recovery_rank = -1;
Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
Warning 1292 Truncated incorrect rpl_recovery_rank value: '-1'
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
0
SET @@global.rpl_recovery_rank = -2147483648;
Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
Warning 1292 Truncated incorrect rpl_recovery_rank value: '-2147483648'
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
0
SET @@global.rpl_recovery_rank = -2147483649;
Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
Warning 1292 Truncated incorrect rpl_recovery_rank value: '-2147483649'
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
0
-SET @@global.rpl_recovery_rank = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.rpl_recovery_rank = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'rpl_recovery_rank'
SET @@global.rpl_recovery_rank = 2147483649.56;
ERROR 42000: Incorrect argument type to variable 'rpl_recovery_rank'
SET @@global.rpl_recovery_rank = 1G;
ERROR 42000: Incorrect argument type to variable 'rpl_recovery_rank'
'#------------------FN_DYNVARS_142_05-----------------------#'
SET @@global.rpl_recovery_rank = 3000;
+Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
SELECT @@global.rpl_recovery_rank = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='rpl_recovery_rank';
@@ -89,15 +107,21 @@ count(VARIABLE_VALUE)
1
'#------------------FN_DYNVARS_142_07-----------------------#'
SET @@global.rpl_recovery_rank = TRUE;
+Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
1
SET @@global.rpl_recovery_rank = FALSE;
+Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
0
'#---------------------FN_DYNVARS_001_08----------------------#'
SET @@global.rpl_recovery_rank = 512;
+Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
SELECT @@rpl_recovery_rank = @@global.rpl_recovery_rank;
@@rpl_recovery_rank = @@global.rpl_recovery_rank
1
@@ -110,7 +134,11 @@ SELECT @@rpl_recovery_rank;
@@rpl_recovery_rank
512
SET global rpl_recovery_rank = 64;
+Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
SET @@global.rpl_recovery_rank = @start_global_value;
+Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
0
diff --git a/mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_64.result b/mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_64.result
index 9ec34c677e1..14a7cdd0046 100644
--- a/mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_64.result
+++ b/mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_64.result
@@ -4,28 +4,42 @@ SELECT @start_global_value;
0
'#--------------------FN_DYNVARS_142_01-------------------------#'
SET @@global.rpl_recovery_rank = 500000;
+Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
SET @@global.rpl_recovery_rank = DEFAULT;
+Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
0
'#--------------------FN_DYNVARS_142_02-------------------------#'
SET @@global.rpl_recovery_rank = 0;
+Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
0
SET @@global.rpl_recovery_rank = 1024;
+Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
1024
SET @@global.rpl_recovery_rank = 123456789;
+Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
123456789
SET @@global.rpl_recovery_rank = 2147483648*2;
+Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
4294967296
SET @@global.rpl_recovery_rank = 2147483648*1024;
+Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
2199023255552
@@ -33,6 +47,8 @@ SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
2199023255552
SET @@global.rpl_recovery_rank = 2147483648*2147483648;
+Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
4611686018427387904
@@ -46,30 +62,35 @@ ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set
'#------------------FN_DYNVARS_142_04-----------------------#'
SET @@global.rpl_recovery_rank = -1;
Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
Warning 1292 Truncated incorrect rpl_recovery_rank value: '-1'
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
0
SET @@global.rpl_recovery_rank = -2147483648;
Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
Warning 1292 Truncated incorrect rpl_recovery_rank value: '-2147483648'
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
0
SET @@global.rpl_recovery_rank = -2147483649;
Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
Warning 1292 Truncated incorrect rpl_recovery_rank value: '-2147483649'
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
0
-SET @@global.rpl_recovery_rank = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.rpl_recovery_rank = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'rpl_recovery_rank'
SET @@global.rpl_recovery_rank = 2147483649.56;
ERROR 42000: Incorrect argument type to variable 'rpl_recovery_rank'
SET @@global.rpl_recovery_rank = 1G;
ERROR 42000: Incorrect argument type to variable 'rpl_recovery_rank'
'#------------------FN_DYNVARS_142_05-----------------------#'
SET @@global.rpl_recovery_rank = 3000;
+Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
SELECT @@global.rpl_recovery_rank = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='rpl_recovery_rank';
@@ -83,15 +104,21 @@ count(VARIABLE_VALUE)
1
'#------------------FN_DYNVARS_142_07-----------------------#'
SET @@global.rpl_recovery_rank = TRUE;
+Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
1
SET @@global.rpl_recovery_rank = FALSE;
+Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
0
'#---------------------FN_DYNVARS_001_08----------------------#'
SET @@global.rpl_recovery_rank = 512;
+Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
SELECT @@rpl_recovery_rank = @@global.rpl_recovery_rank;
@@rpl_recovery_rank = @@global.rpl_recovery_rank
1
@@ -104,7 +131,11 @@ SELECT @@rpl_recovery_rank;
@@rpl_recovery_rank
512
SET global rpl_recovery_rank = 64;
+Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
SET @@global.rpl_recovery_rank = @start_global_value;
+Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
0
diff --git a/mysql-test/suite/sys_vars/r/secure_file_priv_basic.result b/mysql-test/suite/sys_vars/r/secure_file_priv_basic.result
new file mode 100644
index 00000000000..799b6468dd3
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/secure_file_priv_basic.result
@@ -0,0 +1,21 @@
+select @@global.secure_file_priv;
+@@global.secure_file_priv
+MYSQLTEST_VARDIR/
+select @@session.secure_file_priv;
+ERROR HY000: Variable 'secure_file_priv' is a GLOBAL variable
+show global variables like 'secure_file_priv';
+Variable_name Value
+secure_file_priv MYSQLTEST_VARDIR/
+show session variables like 'secure_file_priv';
+Variable_name Value
+secure_file_priv MYSQLTEST_VARDIR/
+select * from information_schema.global_variables where variable_name='secure_file_priv';
+VARIABLE_NAME VARIABLE_VALUE
+SECURE_FILE_PRIV MYSQLTEST_VARDIR/
+select * from information_schema.session_variables where variable_name='secure_file_priv';
+VARIABLE_NAME VARIABLE_VALUE
+SECURE_FILE_PRIV MYSQLTEST_VARDIR/
+set global secure_file_priv=1;
+ERROR HY000: Variable 'secure_file_priv' is a read only variable
+set session secure_file_priv=1;
+ERROR HY000: Variable 'secure_file_priv' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/server_id_basic_64.result b/mysql-test/suite/sys_vars/r/server_id_basic.result
index 12d49248f54..4059ca9e6a5 100644
--- a/mysql-test/suite/sys_vars/r/server_id_basic_64.result
+++ b/mysql-test/suite/sys_vars/r/server_id_basic.result
@@ -69,15 +69,14 @@ Warning 1292 Truncated incorrect server_id value: '4294967298'
SELECT @@global.server_id;
@@global.server_id
4294967295
-SET @@global.server_id = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.server_id = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'server_id'
SET @@global.server_id = '125';
ERROR 42000: Incorrect argument type to variable 'server_id'
SET @@global.server_id = 7483649.56;
ERROR 42000: Incorrect argument type to variable 'server_id'
SET @@global.server_id = 1G;
ERROR 42000: Incorrect argument type to variable 'server_id'
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
'#------------------FN_DYNVARS_144_06-----------------------#'
SET @@global.server_id = 3000;
SELECT @@global.server_id = VARIABLE_VALUE
diff --git a/mysql-test/suite/sys_vars/r/server_id_basic_32.result b/mysql-test/suite/sys_vars/r/server_id_basic_32.result
deleted file mode 100644
index 12d49248f54..00000000000
--- a/mysql-test/suite/sys_vars/r/server_id_basic_32.result
+++ /dev/null
@@ -1,121 +0,0 @@
-SET @@global.general_log= 0;
-SET @start_global_value = @@global.server_id;
-SELECT @start_global_value;
-@start_global_value
-1
-'#--------------------FN_DYNVARS_144_01-------------------------#'
-SET @@global.server_id = 500000;
-SET @@global.server_id = DEFAULT;
-SELECT @@global.server_id;
-@@global.server_id
-0
-'#--------------------FN_DYNVARS_144_02-------------------------#'
-SET @@global.server_id = DEFAULT;
-SELECT @@global.server_id = 0;
-@@global.server_id = 0
-1
-'#--------------------FN_DYNVARS_144_03-------------------------#'
-SET @@global.server_id = 0;
-SELECT @@global.server_id;
-@@global.server_id
-0
-SET @@global.server_id = 1;
-SELECT @@global.server_id;
-@@global.server_id
-1
-SET @@global.server_id = 15;
-SELECT @@global.server_id;
-@@global.server_id
-15
-SET @@global.server_id = 1024;
-SELECT @@global.server_id;
-@@global.server_id
-1024
-SET @@global.server_id = 123456789;
-SELECT @@global.server_id;
-@@global.server_id
-123456789
-SET @@global.server_id = 2147483648;
-SELECT @@global.server_id;
-@@global.server_id
-2147483648
-SET @@global.server_id = 2147483648*2-1;
-SELECT @@global.server_id;
-@@global.server_id
-4294967295
-'#--------------------FN_DYNVARS_144_04-------------------------#'
-SET @@server_id = 2;
-ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL
-SET @@session.server_id = 3;
-ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL
-SET @@local.server_id = 4;
-ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL
-'#------------------FN_DYNVARS_144_05-----------------------#'
-SET @@global.server_id = -1;
-Warnings:
-Warning 1292 Truncated incorrect server_id value: '-1'
-SELECT @@global.server_id;
-@@global.server_id
-0
-SET @@global.server_id = -2147483648;
-Warnings:
-Warning 1292 Truncated incorrect server_id value: '-2147483648'
-SELECT @@global.server_id;
-@@global.server_id
-0
-SET @@global.server_id = 2147483649*2;
-Warnings:
-Warning 1292 Truncated incorrect server_id value: '4294967298'
-SELECT @@global.server_id;
-@@global.server_id
-4294967295
-SET @@global.server_id = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SET @@global.server_id = '125';
-ERROR 42000: Incorrect argument type to variable 'server_id'
-SET @@global.server_id = 7483649.56;
-ERROR 42000: Incorrect argument type to variable 'server_id'
-SET @@global.server_id = 1G;
-ERROR 42000: Incorrect argument type to variable 'server_id'
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-'#------------------FN_DYNVARS_144_06-----------------------#'
-SET @@global.server_id = 3000;
-SELECT @@global.server_id = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='server_id';
-@@global.server_id = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_144_07-----------------------#'
-SELECT count(VARIABLE_VALUE)
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='server_id';
-count(VARIABLE_VALUE)
-1
-'#------------------FN_DYNVARS_144_08-----------------------#'
-SET @@global.server_id = TRUE;
-SELECT @@global.server_id;
-@@global.server_id
-1
-SET @@global.server_id = FALSE;
-SELECT @@global.server_id;
-@@global.server_id
-0
-'#---------------------FN_DYNVARS_001_09----------------------#'
-SET @@global.server_id = 512;
-SELECT @@server_id = @@global.server_id;
-@@server_id = @@global.server_id
-1
-'#---------------------FN_DYNVARS_001_10----------------------#'
-SET server_id = 2048;
-ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT server_id;
-ERROR 42S22: Unknown column 'server_id' in 'field list'
-SELECT @@server_id;
-@@server_id
-512
-SET global server_id = 99;
-SET @@global.server_id = @start_global_value;
-SELECT @@global.server_id;
-@@global.server_id
-1
-SET @@global.general_log= 1;
diff --git a/mysql-test/suite/sys_vars/r/shared_memory_base_name_basic.result b/mysql-test/suite/sys_vars/r/shared_memory_base_name_basic.result
new file mode 100644
index 00000000000..a94a906e121
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/shared_memory_base_name_basic.result
@@ -0,0 +1,21 @@
+select @@global.shared_memory_base_name;
+@@global.shared_memory_base_name
+MYSQLTEST_VARDIR/tmp/mysqld.1.sock
+select @@session.shared_memory_base_name;
+ERROR HY000: Variable 'shared_memory_base_name' is a GLOBAL variable
+show global variables like 'shared_memory_base_name';
+Variable_name Value
+shared_memory_base_name MYSQLTEST_VARDIR/tmp/mysqld.1.sock
+show session variables like 'shared_memory_base_name';
+Variable_name Value
+shared_memory_base_name MYSQLTEST_VARDIR/tmp/mysqld.1.sock
+select * from information_schema.global_variables where variable_name='shared_memory_base_name';
+VARIABLE_NAME VARIABLE_VALUE
+SHARED_MEMORY_BASE_NAME MYSQLTEST_VARDIR/tmp/mysqld.1.sock
+select * from information_schema.session_variables where variable_name='shared_memory_base_name';
+VARIABLE_NAME VARIABLE_VALUE
+SHARED_MEMORY_BASE_NAME MYSQLTEST_VARDIR/tmp/mysqld.1.sock
+set global shared_memory_base_name=1;
+ERROR HY000: Variable 'shared_memory_base_name' is a read only variable
+set session shared_memory_base_name=1;
+ERROR HY000: Variable 'shared_memory_base_name' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/shared_memory_basic.result b/mysql-test/suite/sys_vars/r/shared_memory_basic.result
new file mode 100644
index 00000000000..ab671af610c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/shared_memory_basic.result
@@ -0,0 +1,21 @@
+select @@global.shared_memory;
+@@global.shared_memory
+0
+select @@session.shared_memory;
+ERROR HY000: Variable 'shared_memory' is a GLOBAL variable
+show global variables like 'shared_memory';
+Variable_name Value
+shared_memory OFF
+show session variables like 'shared_memory';
+Variable_name Value
+shared_memory OFF
+select * from information_schema.global_variables where variable_name='shared_memory';
+VARIABLE_NAME VARIABLE_VALUE
+SHARED_MEMORY OFF
+select * from information_schema.session_variables where variable_name='shared_memory';
+VARIABLE_NAME VARIABLE_VALUE
+SHARED_MEMORY OFF
+set global shared_memory=1;
+ERROR HY000: Variable 'shared_memory' is a read only variable
+set session shared_memory=1;
+ERROR HY000: Variable 'shared_memory' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/skip_external_locking_basic.result b/mysql-test/suite/sys_vars/r/skip_external_locking_basic.result
new file mode 100644
index 00000000000..fd6446bed4c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/skip_external_locking_basic.result
@@ -0,0 +1,21 @@
+select @@global.skip_external_locking;
+@@global.skip_external_locking
+1
+select @@session.skip_external_locking;
+ERROR HY000: Variable 'skip_external_locking' is a GLOBAL variable
+show global variables like 'skip_external_locking';
+Variable_name Value
+skip_external_locking ON
+show session variables like 'skip_external_locking';
+Variable_name Value
+skip_external_locking ON
+select * from information_schema.global_variables where variable_name='skip_external_locking';
+VARIABLE_NAME VARIABLE_VALUE
+SKIP_EXTERNAL_LOCKING ON
+select * from information_schema.session_variables where variable_name='skip_external_locking';
+VARIABLE_NAME VARIABLE_VALUE
+SKIP_EXTERNAL_LOCKING ON
+set global skip_external_locking=1;
+ERROR HY000: Variable 'skip_external_locking' is a read only variable
+set session skip_external_locking=1;
+ERROR HY000: Variable 'skip_external_locking' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/skip_networking_basic.result b/mysql-test/suite/sys_vars/r/skip_networking_basic.result
new file mode 100644
index 00000000000..f2d4d5bce6c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/skip_networking_basic.result
@@ -0,0 +1,21 @@
+select @@global.skip_networking;
+@@global.skip_networking
+0
+select @@session.skip_networking;
+ERROR HY000: Variable 'skip_networking' is a GLOBAL variable
+show global variables like 'skip_networking';
+Variable_name Value
+skip_networking OFF
+show session variables like 'skip_networking';
+Variable_name Value
+skip_networking OFF
+select * from information_schema.global_variables where variable_name='skip_networking';
+VARIABLE_NAME VARIABLE_VALUE
+SKIP_NETWORKING OFF
+select * from information_schema.session_variables where variable_name='skip_networking';
+VARIABLE_NAME VARIABLE_VALUE
+SKIP_NETWORKING OFF
+set global skip_networking=1;
+ERROR HY000: Variable 'skip_networking' is a read only variable
+set session skip_networking=1;
+ERROR HY000: Variable 'skip_networking' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/skip_show_database_basic.result b/mysql-test/suite/sys_vars/r/skip_show_database_basic.result
new file mode 100644
index 00000000000..d5aad0f1c17
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/skip_show_database_basic.result
@@ -0,0 +1,21 @@
+select @@global.skip_show_database;
+@@global.skip_show_database
+0
+select @@session.skip_show_database;
+ERROR HY000: Variable 'skip_show_database' is a GLOBAL variable
+show global variables like 'skip_show_database';
+Variable_name Value
+skip_show_database OFF
+show session variables like 'skip_show_database';
+Variable_name Value
+skip_show_database OFF
+select * from information_schema.global_variables where variable_name='skip_show_database';
+VARIABLE_NAME VARIABLE_VALUE
+SKIP_SHOW_DATABASE OFF
+select * from information_schema.session_variables where variable_name='skip_show_database';
+VARIABLE_NAME VARIABLE_VALUE
+SKIP_SHOW_DATABASE OFF
+set global skip_show_database=1;
+ERROR HY000: Variable 'skip_show_database' is a read only variable
+set session skip_show_database=1;
+ERROR HY000: Variable 'skip_show_database' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/slave_allow_batching_basic.result b/mysql-test/suite/sys_vars/r/slave_allow_batching_basic.result
index 36f0978d3af..a01fffac004 100644
--- a/mysql-test/suite/sys_vars/r/slave_allow_batching_basic.result
+++ b/mysql-test/suite/sys_vars/r/slave_allow_batching_basic.result
@@ -1,6 +1,5 @@
SET @global_start_value = @@global.slave_allow_batching;
ERROR HY000: Unknown system variable 'slave_allow_batching'
-'Bug: This variable is not supported in mysql version 5.1.22'
'#--------------------FN_DYNVARS_145_01------------------------#'
'#---------------------FN_DYNVARS_145_02-------------------------#'
'#--------------------FN_DYNVARS_145_03------------------------#'
@@ -8,8 +7,5 @@ ERROR HY000: Unknown system variable 'slave_allow_batching'
'#-------------------FN_DYNVARS_145_05----------------------------#'
'#----------------------FN_DYNVARS_145_06------------------------#'
'#----------------------FN_DYNVARS_145_07------------------------#'
-SELECT IF(@@global.slave_allow_batching, "ON", "OFF") = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='slave_allow_batching';
-IF(@@global.slave_allow_batching, "ON", "OFF") = VARIABLE_VALUE
-1
'#---------------------FN_DYNVARS_145_08-------------------------#'
'#---------------------FN_DYNVARS_145_09----------------------#'
diff --git a/mysql-test/suite/sys_vars/r/slave_load_tmpdir_basic.result b/mysql-test/suite/sys_vars/r/slave_load_tmpdir_basic.result
new file mode 100644
index 00000000000..ae30fbacb2b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/slave_load_tmpdir_basic.result
@@ -0,0 +1,21 @@
+select @@global.slave_load_tmpdir;
+@@global.slave_load_tmpdir
+MYSQL_TMP_DIR/mysqld.1
+select @@session.slave_load_tmpdir;
+ERROR HY000: Variable 'slave_load_tmpdir' is a GLOBAL variable
+show global variables like 'slave_load_tmpdir';
+Variable_name Value
+slave_load_tmpdir MYSQL_TMP_DIR/mysqld.1
+show session variables like 'slave_load_tmpdir';
+Variable_name Value
+slave_load_tmpdir MYSQL_TMP_DIR/mysqld.1
+select * from information_schema.global_variables where variable_name='slave_load_tmpdir';
+VARIABLE_NAME VARIABLE_VALUE
+SLAVE_LOAD_TMPDIR MYSQL_TMP_DIR/mysqld.1
+select * from information_schema.session_variables where variable_name='slave_load_tmpdir';
+VARIABLE_NAME VARIABLE_VALUE
+SLAVE_LOAD_TMPDIR MYSQL_TMP_DIR/mysqld.1
+set global slave_load_tmpdir=1;
+ERROR HY000: Variable 'slave_load_tmpdir' is a read only variable
+set session slave_load_tmpdir=1;
+ERROR HY000: Variable 'slave_load_tmpdir' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/slave_net_timeout_basic.result b/mysql-test/suite/sys_vars/r/slave_net_timeout_basic.result
index 728ce106625..1ef0b27b756 100644
--- a/mysql-test/suite/sys_vars/r/slave_net_timeout_basic.result
+++ b/mysql-test/suite/sys_vars/r/slave_net_timeout_basic.result
@@ -74,15 +74,14 @@ Warning 1292 Truncated incorrect slave_net_timeout value: '4294967298'
SELECT @@global.slave_net_timeout;
@@global.slave_net_timeout
31536000
-SET @@global.slave_net_timeout = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.slave_net_timeout = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'slave_net_timeout'
SET @@global.slave_net_timeout = 100s;
ERROR 42000: Incorrect argument type to variable 'slave_net_timeout'
SET @@global.slave_net_timeout = 7483649.56;
ERROR 42000: Incorrect argument type to variable 'slave_net_timeout'
SET @@global.slave_net_timeout = 0.6;
ERROR 42000: Incorrect argument type to variable 'slave_net_timeout'
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
'#------------------FN_DYNVARS_146_06-----------------------#'
SET @@global.slave_net_timeout = 3000;
SELECT @@global.slave_net_timeout = VARIABLE_VALUE
diff --git a/mysql-test/suite/sys_vars/r/slave_skip_errors_basic.result b/mysql-test/suite/sys_vars/r/slave_skip_errors_basic.result
new file mode 100644
index 00000000000..b74c7d3847a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/slave_skip_errors_basic.result
@@ -0,0 +1,21 @@
+select @@global.slave_skip_errors;
+@@global.slave_skip_errors
+OFF
+select @@session.slave_skip_errors;
+ERROR HY000: Variable 'slave_skip_errors' is a GLOBAL variable
+show global variables like 'slave_skip_errors';
+Variable_name Value
+slave_skip_errors OFF
+show session variables like 'slave_skip_errors';
+Variable_name Value
+slave_skip_errors OFF
+select * from information_schema.global_variables where variable_name='slave_skip_errors';
+VARIABLE_NAME VARIABLE_VALUE
+SLAVE_SKIP_ERRORS OFF
+select * from information_schema.session_variables where variable_name='slave_skip_errors';
+VARIABLE_NAME VARIABLE_VALUE
+SLAVE_SKIP_ERRORS OFF
+set global slave_skip_errors=1;
+ERROR HY000: Variable 'slave_skip_errors' is a read only variable
+set session slave_skip_errors=1;
+ERROR HY000: Variable 'slave_skip_errors' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/slave_transaction_retries_basic_32.result b/mysql-test/suite/sys_vars/r/slave_transaction_retries_basic_32.result
index 1b6edb18f8d..86a760a5386 100644
--- a/mysql-test/suite/sys_vars/r/slave_transaction_retries_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/slave_transaction_retries_basic_32.result
@@ -68,9 +68,8 @@ Warning 1292 Truncated incorrect slave_transaction_retries value: '4611686022722
SELECT @@global.slave_transaction_retries;
@@global.slave_transaction_retries
4294967295
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-SET @@global.slave_transaction_retries = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.slave_transaction_retries = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'slave_transaction_retries'
SET @@global.slave_transaction_retries = '100';
ERROR 42000: Incorrect argument type to variable 'slave_transaction_retries'
SET @@global.slave_transaction_retries = 7483649.56;
diff --git a/mysql-test/suite/sys_vars/r/slave_transaction_retries_basic_64.result b/mysql-test/suite/sys_vars/r/slave_transaction_retries_basic_64.result
index 6e0bc659f9e..9bb422905b4 100644
--- a/mysql-test/suite/sys_vars/r/slave_transaction_retries_basic_64.result
+++ b/mysql-test/suite/sys_vars/r/slave_transaction_retries_basic_64.result
@@ -64,9 +64,8 @@ SET @@global.slave_transaction_retries = 2147483649*2147483649;
SELECT @@global.slave_transaction_retries;
@@global.slave_transaction_retries
4611686022722355201
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-SET @@global.slave_transaction_retries = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.slave_transaction_retries = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'slave_transaction_retries'
SET @@global.slave_transaction_retries = '100';
ERROR 42000: Incorrect argument type to variable 'slave_transaction_retries'
SET @@global.slave_transaction_retries = 7483649.56;
diff --git a/mysql-test/suite/sys_vars/r/slow_launch_time_basic.result b/mysql-test/suite/sys_vars/r/slow_launch_time_basic.result
index da13af4f4e8..4c7539be677 100644
--- a/mysql-test/suite/sys_vars/r/slow_launch_time_basic.result
+++ b/mysql-test/suite/sys_vars/r/slow_launch_time_basic.result
@@ -70,7 +70,6 @@ Warning 1292 Truncated incorrect slow_launch_time value: '42949672950'
SELECT @@global.slow_launch_time;
@@global.slow_launch_time
31536000
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@global.slow_launch_time = ON;
ERROR 42000: Incorrect argument type to variable 'slow_launch_time'
SELECT @@global.slow_launch_time;
diff --git a/mysql-test/suite/sys_vars/r/slow_query_log_file_basic.result b/mysql-test/suite/sys_vars/r/slow_query_log_file_basic.result
index 925f940a5c4..e3c48725998 100644
--- a/mysql-test/suite/sys_vars/r/slow_query_log_file_basic.result
+++ b/mysql-test/suite/sys_vars/r/slow_query_log_file_basic.result
@@ -1,9 +1,10 @@
SET @start_value = @@global.slow_query_log_file;
'#---------------------FN_DYNVARS_004_01-------------------------#'
SET @@global.slow_query_log_file = DEFAULT;
-SELECT RIGHT(@@global.slow_query_log_file,15);
-RIGHT(@@global.slow_query_log_file,15)
-mysqld-slow.log
+SET @a=concat(left(@@hostname, instr(concat(@@hostname, '.'), '.')-1), '-slow.log');
+SELECT RIGHT(@@global.slow_query_log_file, length(@a)) = @a;
+RIGHT(@@global.slow_query_log_file, length(@a)) = @a
+1
'#--------------------FN_DYNVARS_004_02------------------------#'
SET @@global.slow_query_log_file = mytest.log;
SET @@global.slow_query_log_file = 12;
diff --git a/mysql-test/suite/sys_vars/r/socket_basic.result b/mysql-test/suite/sys_vars/r/socket_basic.result
new file mode 100644
index 00000000000..51a09b9b762
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/socket_basic.result
@@ -0,0 +1,21 @@
+select @@global.socket;
+@@global.socket
+MYSQL_TMP_DIR/mysqld.1.sock
+select @@session.socket;
+ERROR HY000: Variable 'socket' is a GLOBAL variable
+show global variables like 'socket';
+Variable_name Value
+socket MYSQL_TMP_DIR/mysqld.1.sock
+show session variables like 'socket';
+Variable_name Value
+socket MYSQL_TMP_DIR/mysqld.1.sock
+select * from information_schema.global_variables where variable_name='socket';
+VARIABLE_NAME VARIABLE_VALUE
+SOCKET MYSQL_TMP_DIR/mysqld.1.sock
+select * from information_schema.session_variables where variable_name='socket';
+VARIABLE_NAME VARIABLE_VALUE
+SOCKET MYSQL_TMP_DIR/mysqld.1.sock
+set global socket=1;
+ERROR HY000: Variable 'socket' is a read only variable
+set session socket=1;
+ERROR HY000: Variable 'socket' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result b/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result
index 9d3eadcc26f..cddfa9f52c9 100644
--- a/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result
@@ -3,32 +3,32 @@ SET @start_session_value = @@session.sort_buffer_size;
'#--------------------FN_DYNVARS_151_01-------------------------#'
SET @@global.sort_buffer_size = 1000;
SET @@global.sort_buffer_size = DEFAULT;
-SELECT @@global.sort_buffer_size BETWEEN 2097116 AND 2100000;
-@@global.sort_buffer_size BETWEEN 2097116 AND 2100000
-1
+SELECT @@global.sort_buffer_size;
+@@global.sort_buffer_size
+2097152
SET @@session.sort_buffer_size = 2000;
SET @@session.sort_buffer_size = DEFAULT;
-SELECT @@session.sort_buffer_size BETWEEN 2097116 AND 2100000;
-@@session.sort_buffer_size BETWEEN 2097116 AND 2100000
-1
+SELECT @@session.sort_buffer_size;
+@@session.sort_buffer_size
+2097152
'#--------------------FN_DYNVARS_151_02-------------------------#'
SET @@global.sort_buffer_size = DEFAULT;
-SELECT @@global.sort_buffer_size BETWEEN 2097116 AND 2100000;
-@@global.sort_buffer_size BETWEEN 2097116 AND 2100000
-1
+SELECT @@global.sort_buffer_size;
+@@global.sort_buffer_size
+2097152
SET @@session.sort_buffer_size = DEFAULT;
-SELECT @@session.sort_buffer_size BETWEEN 2097116 AND 2100000;
-@@session.sort_buffer_size BETWEEN 2097116 AND 2100000
-1
+SELECT @@session.sort_buffer_size;
+@@session.sort_buffer_size
+2097152
'#--------------------FN_DYNVARS_151_03-------------------------#'
SET @@global.sort_buffer_size = 32776;
-SELECT @@global.sort_buffer_size BETWEEN 32776 AND 32999;
-@@global.sort_buffer_size BETWEEN 32776 AND 32999
-1
+SELECT @@global.sort_buffer_size;
+@@global.sort_buffer_size
+32776
SET @@global.sort_buffer_size = 32777;
-SELECT @@global.sort_buffer_size BETWEEN 32776 AND 32999;
-@@global.sort_buffer_size BETWEEN 32776 AND 32999
-1
+SELECT @@global.sort_buffer_size;
+@@global.sort_buffer_size
+32777
SET @@global.sort_buffer_size = 4294967295;
SELECT @@global.sort_buffer_size;
@@global.sort_buffer_size
@@ -39,13 +39,13 @@ SELECT @@global.sort_buffer_size;
4294967294
'#--------------------FN_DYNVARS_151_04-------------------------#'
SET @@session.sort_buffer_size = 32776;
-SELECT @@session.sort_buffer_size BETWEEN 32776 AND 32999;
-@@session.sort_buffer_size BETWEEN 32776 AND 32999
-1
+SELECT @@session.sort_buffer_size;
+@@session.sort_buffer_size
+32776
SET @@session.sort_buffer_size = 32777;
-SELECT @@session.sort_buffer_size BETWEEN 32776 AND 32999;
-@@session.sort_buffer_size BETWEEN 32776 AND 32999
-1
+SELECT @@session.sort_buffer_size;
+@@session.sort_buffer_size
+32777
SET @@session.sort_buffer_size = 4294967295;
SELECT @@session.sort_buffer_size;
@@session.sort_buffer_size
@@ -56,19 +56,19 @@ SELECT @@session.sort_buffer_size;
4294967294
'#------------------FN_DYNVARS_151_05-----------------------#'
SET @@global.sort_buffer_size = 32775;
-SELECT @@global.sort_buffer_size BETWEEN 32776 AND 32999;
-@@global.sort_buffer_size BETWEEN 32776 AND 32999
-1
+SELECT @@global.sort_buffer_size;
+@@global.sort_buffer_size
+32775
SET @@global.sort_buffer_size = -1024;
-SELECT @@global.sort_buffer_size BETWEEN 32776 AND 32999;
-@@global.sort_buffer_size BETWEEN 32776 AND 32999
-1
+SELECT @@global.sort_buffer_size;
+@@global.sort_buffer_size
+32768
SET @@global.sort_buffer_size = 4294967296;
SELECT @@global.sort_buffer_size;
@@global.sort_buffer_size
4294967295
-SET @@global.sort_buffer_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.sort_buffer_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'sort_buffer_size'
SELECT @@global.sort_buffer_size;
@@global.sort_buffer_size
4294967295
@@ -78,15 +78,15 @@ SELECT @@global.sort_buffer_size;
@@global.sort_buffer_size
4294967295
SET @@session.sort_buffer_size = 32775;
-SELECT @@session.sort_buffer_size BETWEEN 32776 AND 32999;
-@@session.sort_buffer_size BETWEEN 32776 AND 32999
-1
+SELECT @@session.sort_buffer_size;
+@@session.sort_buffer_size
+32775
SET @@session.sort_buffer_size = -2;
-SELECT @@session.sort_buffer_size BETWEEN 32776 AND 32999;
-@@session.sort_buffer_size BETWEEN 32776 AND 32999
-1
-SET @@session.sort_buffer_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@session.sort_buffer_size;
+@@session.sort_buffer_size
+32768
+SET @@session.sort_buffer_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'sort_buffer_size'
SET @@session.sort_buffer_size = 4294967296;
SELECT @@session.sort_buffer_size;
@@session.sort_buffer_size
@@ -105,13 +105,13 @@ INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
1
'#------------------FN_DYNVARS_151_08-----------------------#'
SET @@global.sort_buffer_size = TRUE;
-SELECT @@global.sort_buffer_size BETWEEN 32776 AND 32999;
-@@global.sort_buffer_size BETWEEN 32776 AND 32999
-1
+SELECT @@global.sort_buffer_size;
+@@global.sort_buffer_size
+32768
SET @@global.sort_buffer_size = FALSE;
-SELECT @@global.sort_buffer_size BETWEEN 32776 AND 32999;
-@@global.sort_buffer_size BETWEEN 32776 AND 32999
-1
+SELECT @@global.sort_buffer_size;
+@@global.sort_buffer_size
+32768
'#---------------------FN_DYNVARS_151_09----------------------#'
SET @@global.sort_buffer_size = 9000;
SELECT @@sort_buffer_size = @@global.sort_buffer_size;
@@ -127,9 +127,9 @@ SELECT @@local.sort_buffer_size = @@session.sort_buffer_size;
1
'#---------------------FN_DYNVARS_151_11----------------------#'
SET sort_buffer_size = 9100;
-SELECT @@sort_buffer_size BETWEEN 32776 AND 32999;
-@@sort_buffer_size BETWEEN 32776 AND 32999
-1
+SELECT @@sort_buffer_size;
+@@sort_buffer_size
+32768
SELECT local.sort_buffer_size;
ERROR 42S02: Unknown table 'local' in field list
SELECT session.sort_buffer_size;
diff --git a/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_64.result b/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_64.result
index c993c8a0a88..4fd96c154c3 100644
--- a/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_64.result
+++ b/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_64.result
@@ -3,32 +3,32 @@ SET @start_session_value = @@session.sort_buffer_size;
'#--------------------FN_DYNVARS_151_01-------------------------#'
SET @@global.sort_buffer_size = 1000;
SET @@global.sort_buffer_size = DEFAULT;
-SELECT @@global.sort_buffer_size BETWEEN 2097116 AND 2100000;
-@@global.sort_buffer_size BETWEEN 2097116 AND 2100000
-1
+SELECT @@global.sort_buffer_size;
+@@global.sort_buffer_size
+2097152
SET @@session.sort_buffer_size = 2000;
SET @@session.sort_buffer_size = DEFAULT;
-SELECT @@session.sort_buffer_size BETWEEN 2097116 AND 2100000;
-@@session.sort_buffer_size BETWEEN 2097116 AND 2100000
-1
+SELECT @@session.sort_buffer_size;
+@@session.sort_buffer_size
+2097152
'#--------------------FN_DYNVARS_151_02-------------------------#'
SET @@global.sort_buffer_size = DEFAULT;
-SELECT @@global.sort_buffer_size BETWEEN 2097116 AND 2100000;
-@@global.sort_buffer_size BETWEEN 2097116 AND 2100000
-1
+SELECT @@global.sort_buffer_size;
+@@global.sort_buffer_size
+2097152
SET @@session.sort_buffer_size = DEFAULT;
-SELECT @@session.sort_buffer_size BETWEEN 2097116 AND 2100000;
-@@session.sort_buffer_size BETWEEN 2097116 AND 2100000
-1
+SELECT @@session.sort_buffer_size;
+@@session.sort_buffer_size
+2097152
'#--------------------FN_DYNVARS_151_03-------------------------#'
SET @@global.sort_buffer_size = 32776;
-SELECT @@global.sort_buffer_size BETWEEN 32776 AND 32999;
-@@global.sort_buffer_size BETWEEN 32776 AND 32999
-1
+SELECT @@global.sort_buffer_size;
+@@global.sort_buffer_size
+32776
SET @@global.sort_buffer_size = 32777;
-SELECT @@global.sort_buffer_size BETWEEN 32776 AND 32999;
-@@global.sort_buffer_size BETWEEN 32776 AND 32999
-1
+SELECT @@global.sort_buffer_size;
+@@global.sort_buffer_size
+32777
SET @@global.sort_buffer_size = 4294967295;
SELECT @@global.sort_buffer_size;
@@global.sort_buffer_size
@@ -39,13 +39,13 @@ SELECT @@global.sort_buffer_size;
4294967294
'#--------------------FN_DYNVARS_151_04-------------------------#'
SET @@session.sort_buffer_size = 32776;
-SELECT @@session.sort_buffer_size BETWEEN 32776 AND 32999;
-@@session.sort_buffer_size BETWEEN 32776 AND 32999
-1
+SELECT @@session.sort_buffer_size;
+@@session.sort_buffer_size
+32776
SET @@session.sort_buffer_size = 32777;
-SELECT @@session.sort_buffer_size BETWEEN 32776 AND 32999;
-@@session.sort_buffer_size BETWEEN 32776 AND 32999
-1
+SELECT @@session.sort_buffer_size;
+@@session.sort_buffer_size
+32777
SET @@session.sort_buffer_size = 4294967295;
SELECT @@session.sort_buffer_size;
@@session.sort_buffer_size
@@ -56,19 +56,19 @@ SELECT @@session.sort_buffer_size;
4294967294
'#------------------FN_DYNVARS_151_05-----------------------#'
SET @@global.sort_buffer_size = 32775;
-SELECT @@global.sort_buffer_size BETWEEN 32776 AND 32999;
-@@global.sort_buffer_size BETWEEN 32776 AND 32999
-1
+SELECT @@global.sort_buffer_size;
+@@global.sort_buffer_size
+32775
SET @@global.sort_buffer_size = -1024;
-SELECT @@global.sort_buffer_size BETWEEN 32776 AND 32999;
-@@global.sort_buffer_size BETWEEN 32776 AND 32999
-1
+SELECT @@global.sort_buffer_size;
+@@global.sort_buffer_size
+32768
SET @@global.sort_buffer_size = 4294967296;
SELECT @@global.sort_buffer_size;
@@global.sort_buffer_size
4294967296
-SET @@global.sort_buffer_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.sort_buffer_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'sort_buffer_size'
SELECT @@global.sort_buffer_size;
@@global.sort_buffer_size
4294967296
@@ -78,15 +78,15 @@ SELECT @@global.sort_buffer_size;
@@global.sort_buffer_size
4294967296
SET @@session.sort_buffer_size = 32775;
-SELECT @@session.sort_buffer_size BETWEEN 32776 AND 32999;
-@@session.sort_buffer_size BETWEEN 32776 AND 32999
-1
+SELECT @@session.sort_buffer_size;
+@@session.sort_buffer_size
+32775
SET @@session.sort_buffer_size = -2;
-SELECT @@session.sort_buffer_size BETWEEN 32776 AND 32999;
-@@session.sort_buffer_size BETWEEN 32776 AND 32999
-1
-SET @@session.sort_buffer_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@session.sort_buffer_size;
+@@session.sort_buffer_size
+32768
+SET @@session.sort_buffer_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'sort_buffer_size'
SET @@session.sort_buffer_size = 4294967296;
SELECT @@session.sort_buffer_size;
@@session.sort_buffer_size
@@ -105,13 +105,13 @@ INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
1
'#------------------FN_DYNVARS_151_08-----------------------#'
SET @@global.sort_buffer_size = TRUE;
-SELECT @@global.sort_buffer_size BETWEEN 32776 AND 32999;
-@@global.sort_buffer_size BETWEEN 32776 AND 32999
-1
+SELECT @@global.sort_buffer_size;
+@@global.sort_buffer_size
+32768
SET @@global.sort_buffer_size = FALSE;
-SELECT @@global.sort_buffer_size BETWEEN 32776 AND 32999;
-@@global.sort_buffer_size BETWEEN 32776 AND 32999
-1
+SELECT @@global.sort_buffer_size;
+@@global.sort_buffer_size
+32768
'#---------------------FN_DYNVARS_151_09----------------------#'
SET @@global.sort_buffer_size = 9000;
SELECT @@sort_buffer_size = @@global.sort_buffer_size;
@@ -127,9 +127,9 @@ SELECT @@local.sort_buffer_size = @@session.sort_buffer_size;
1
'#---------------------FN_DYNVARS_151_11----------------------#'
SET sort_buffer_size = 9100;
-SELECT @@sort_buffer_size BETWEEN 32776 AND 32999;
-@@sort_buffer_size BETWEEN 32776 AND 32999
-1
+SELECT @@sort_buffer_size;
+@@sort_buffer_size
+32768
SELECT local.sort_buffer_size;
ERROR 42S02: Unknown table 'local' in field list
SELECT session.sort_buffer_size;
diff --git a/mysql-test/suite/sys_vars/r/sql_auto_is_null_basic.result b/mysql-test/suite/sys_vars/r/sql_auto_is_null_basic.result
index 0d8247ae1ef..ff614e9afcf 100644
--- a/mysql-test/suite/sys_vars/r/sql_auto_is_null_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_auto_is_null_basic.result
@@ -1,54 +1,32 @@
'#---------------------BS_STVARS_044_01----------------------#'
-SELECT COUNT(@@SESSION.sql_auto_is_null);
-COUNT(@@SESSION.sql_auto_is_null)
-1
-1 Expected
+SELECT @@session.sql_auto_is_null;
+@@session.sql_auto_is_null
+0
'#---------------------BS_STVARS_044_02----------------------#'
-SET @@SESSION.sql_auto_is_null=1;
-"BUG:It should give error on setting this variable as it is readonly variable"
-Expected error 'Read only variable'
-SELECT COUNT(@@SESSION.sql_auto_is_null);
-COUNT(@@SESSION.sql_auto_is_null)
+SET @@session.sql_auto_is_null=1;
+SELECT @@session.sql_auto_is_null;
+@@session.sql_auto_is_null
1
-1 Expected
'#---------------------BS_STVARS_044_03----------------------#'
-SELECT IF(@@SESSION.sql_auto_is_null, "ON", "OFF") = VARIABLE_VALUE
+SELECT IF(@@session.sql_auto_is_null, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_auto_is_null';
-IF(@@SESSION.sql_auto_is_null, "ON", "OFF") = VARIABLE_VALUE
-1
-1 Expected
-SELECT COUNT(@@SESSION.sql_auto_is_null);
-COUNT(@@SESSION.sql_auto_is_null)
+IF(@@session.sql_auto_is_null, "ON", "OFF") = VARIABLE_VALUE
1
-1 Expected
-SELECT COUNT(VARIABLE_VALUE)
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_auto_is_null';
-COUNT(VARIABLE_VALUE)
-1
-1 Expected
-'#---------------------BS_STVARS_044_04----------------------#'
-SELECT @@sql_auto_is_null = @@SESSION.sql_auto_is_null;
-@@sql_auto_is_null = @@SESSION.sql_auto_is_null
-1
-1 Expected
+VARIABLE_VALUE
+ON
'#---------------------BS_STVARS_044_05----------------------#'
-SELECT COUNT(@@sql_auto_is_null);
-COUNT(@@sql_auto_is_null)
+SELECT @@sql_auto_is_null;
+@@sql_auto_is_null
1
-1 Expected
-SELECT COUNT(@@local.sql_auto_is_null);
-COUNT(@@local.sql_auto_is_null)
+SELECT @@local.sql_auto_is_null;
+@@local.sql_auto_is_null
1
-1 Expected
-SELECT COUNT(@@SESSION.sql_auto_is_null);
-COUNT(@@SESSION.sql_auto_is_null)
+SELECT @@session.sql_auto_is_null;
+@@session.sql_auto_is_null
1
-1 Expected
-SELECT COUNT(@@GLOBAL.sql_auto_is_null);
-ERROR HY000: Variable 'sql_auto_is_null' is a SESSION variable
-Expected error 'Variable is a SESSION variable'
-SELECT COUNT(sql_auto_is_null = @@GLOBAL.sql_auto_is_null);
-ERROR 42S22: Unknown column 'sql_auto_is_null' in 'field list'
-Expected error 'Readonly variable'
+SELECT @@global.sql_auto_is_null;
+@@global.sql_auto_is_null
+0
diff --git a/mysql-test/suite/sys_vars/r/sql_big_selects_basic.result b/mysql-test/suite/sys_vars/r/sql_big_selects_basic.result
index cf071b5b417..98f05bda488 100644
--- a/mysql-test/suite/sys_vars/r/sql_big_selects_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_big_selects_basic.result
@@ -7,7 +7,7 @@ SET @@session.sql_big_selects = 0;
SET @@session.sql_big_selects = DEFAULT;
SELECT @@session.sql_big_selects;
@@session.sql_big_selects
-0
+1
'#---------------------FN_DYNVARS_153_02-------------------------#'
SET sql_big_selects = 1;
SELECT @@sql_big_selects;
@@ -40,25 +40,23 @@ ERROR 42000: Variable 'sql_big_selects' can't be set to the value of 'T'
SET @@session.sql_big_selects = "Y";
ERROR 42000: Variable 'sql_big_selects' can't be set to the value of 'Y'
SET @@session.sql_big_selects = TRÜE;
-ERROR 42000: Variable 'sql_big_selects' can't be set to the value of 'TRÃœE'
+ERROR 42000: Variable 'sql_big_selects' can't be set to the value of 'TRÜE'
SET @@session.sql_big_selects = ÕN;
-ERROR 42000: Variable 'sql_big_selects' can't be set to the value of 'ÕN'
+ERROR 42000: Variable 'sql_big_selects' can't be set to the value of 'ÕN'
SET @@session.sql_big_selects = OF;
-SELECT @@session.sql_big_selects;
-@@session.sql_big_selects
-0
-'Bug # 34828: OF is taken as OFF and a value of 0 is set.'
+ERROR 42000: Variable 'sql_big_selects' can't be set to the value of 'OF'
SET @@session.sql_big_selects = ÓFF;
-ERROR 42000: Variable 'sql_big_selects' can't be set to the value of 'ÓFF'
+ERROR 42000: Variable 'sql_big_selects' can't be set to the value of 'ÓFF'
SET @@session.sql_big_selects = '¹';
ERROR 42000: Variable 'sql_big_selects' can't be set to the value of '¹'
SET @@session.sql_big_selects = NO;
ERROR 42000: Variable 'sql_big_selects' can't be set to the value of 'NO'
'#-------------------FN_DYNVARS_153_05----------------------------#'
-SET @@global.sql_big_selects = 0;
-ERROR HY000: Variable 'sql_big_selects' is a SESSION variable and can't be used with SET GLOBAL
+SET @@global.sql_big_selects = 1-@@global.sql_big_selects;
SELECT @@global.sql_big_selects;
-ERROR HY000: Variable 'sql_big_selects' is a SESSION variable
+@@global.sql_big_selects
+0
+SET @@global.sql_big_selects = 1-@@global.sql_big_selects;
'#----------------------FN_DYNVARS_153_06------------------------#'
SELECT count(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@@ -73,12 +71,12 @@ IF(@@session.sql_big_selects, "ON", "OFF") = VARIABLE_VALUE
1
SELECT @@session.sql_big_selects;
@@session.sql_big_selects
-0
+1
SELECT VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_big_selects';
VARIABLE_VALUE
-OFF
+ON
'#---------------------FN_DYNVARS_153_08-------------------------#'
SET @@session.sql_big_selects = OFF;
SELECT @@session.sql_big_selects;
diff --git a/mysql-test/suite/sys_vars/r/sql_big_selects_func.result b/mysql-test/suite/sys_vars/r/sql_big_selects_func.result
index fc7e1f32e00..77a38e1b928 100644
--- a/mysql-test/suite/sys_vars/r/sql_big_selects_func.result
+++ b/mysql-test/suite/sys_vars/r/sql_big_selects_func.result
@@ -4,6 +4,8 @@ SET @session_sql_big_selects = @@SESSION.sql_big_selects;
SET @session_max_join_size = @@SESSION.max_join_size;
SET @global_max_join_size = @@GLOBAL.max_join_size;
SET SQL_MAX_JOIN_SIZE=9;
+Warnings:
+Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0.
CREATE TEMPORARY TABLE t1(a varchar(20) not null, b varchar(20));
CREATE TEMPORARY TABLE t2(a varchar(20) null, b varchar(20));
INSERT INTO t1 VALUES('aa','bb');
diff --git a/mysql-test/suite/sys_vars/r/sql_big_tables_basic.result b/mysql-test/suite/sys_vars/r/sql_big_tables_basic.result
index 46e93f7ff23..09553ae7d57 100644
--- a/mysql-test/suite/sys_vars/r/sql_big_tables_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_big_tables_basic.result
@@ -12,7 +12,7 @@ SET @@session.sql_big_tables = 1;
SET @@session.sql_big_tables = DEFAULT;
SELECT @@session.sql_big_tables;
@@session.sql_big_tables
-1
+0
'#---------------------FN_DYNVARS_154_02-------------------------#'
SET sql_big_tables = 1;
SELECT @@sql_big_tables;
@@ -45,25 +45,26 @@ ERROR 42000: Variable 'sql_big_tables' can't be set to the value of 'T'
SET @@session.sql_big_tables = "Y";
ERROR 42000: Variable 'sql_big_tables' can't be set to the value of 'Y'
SET @@session.sql_big_tables = TRÜE;
-ERROR 42000: Variable 'sql_big_tables' can't be set to the value of 'TRÃœE'
+ERROR 42000: Variable 'sql_big_tables' can't be set to the value of 'TRÜE'
SET @@session.sql_big_tables = ÕN;
-ERROR 42000: Variable 'sql_big_tables' can't be set to the value of 'ÕN'
+ERROR 42000: Variable 'sql_big_tables' can't be set to the value of 'ÕN'
SET @@session.sql_big_tables = OF;
-SELECT @@session.sql_big_tables;
-@@session.sql_big_tables
-0
-'Bug# 34828: OF is taken as OFF and a value of 0 is set.'
+ERROR 42000: Variable 'sql_big_tables' can't be set to the value of 'OF'
SET @@session.sql_big_tables = ÓFF;
-ERROR 42000: Variable 'sql_big_tables' can't be set to the value of 'ÓFF'
+ERROR 42000: Variable 'sql_big_tables' can't be set to the value of 'ÓFF'
SET @@session.sql_big_tables = '¹';
ERROR 42000: Variable 'sql_big_tables' can't be set to the value of '¹'
SET @@session.sql_big_tables = NO;
ERROR 42000: Variable 'sql_big_tables' can't be set to the value of 'NO'
'#-------------------FN_DYNVARS_154_05----------------------------#'
-SET @@global.sql_big_tables = 0;
-ERROR HY000: Variable 'sql_big_tables' is a SESSION variable and can't be used with SET GLOBAL
+SET @@global.sql_big_tables = 1-@@global.sql_big_tables;
SELECT @@global.sql_big_tables;
-ERROR HY000: Variable 'sql_big_tables' is a SESSION variable
+@@global.sql_big_tables
+1
+SET @@global.sql_big_tables = 1-@@global.sql_big_tables;
+SELECT @@global.sql_big_tables;
+@@global.sql_big_tables
+0
'#----------------------FN_DYNVARS_154_06------------------------#'
SELECT count(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@@ -78,12 +79,12 @@ IF(@@session.sql_big_tables, "ON", "OFF") = VARIABLE_VALUE
1
SELECT @@session.sql_big_tables;
@@session.sql_big_tables
-0
+1
SELECT VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_big_tables';
VARIABLE_VALUE
-OFF
+ON
'#---------------------FN_DYNVARS_154_08-------------------------#'
SET @@session.sql_big_tables = OFF;
SELECT @@session.sql_big_tables;
diff --git a/mysql-test/suite/sys_vars/r/sql_buffer_result_basic.result b/mysql-test/suite/sys_vars/r/sql_buffer_result_basic.result
index 146872afc1d..2dfdcb26898 100644
--- a/mysql-test/suite/sys_vars/r/sql_buffer_result_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_buffer_result_basic.result
@@ -12,7 +12,7 @@ SET @@session.sql_buffer_result = 1;
SET @@session.sql_buffer_result = DEFAULT;
SELECT @@session.sql_buffer_result;
@@session.sql_buffer_result
-1
+0
'#---------------------FN_DYNVARS_155_02-------------------------#'
SET sql_buffer_result = 1;
SELECT @@sql_buffer_result;
@@ -43,35 +43,28 @@ ERROR 42000: Variable 'sql_buffer_result' can't be set to the value of '2'
SET @@session.sql_buffer_result = "TRU";
ERROR 42000: Variable 'sql_buffer_result' can't be set to the value of 'TRU'
SET @@session.sql_buffer_result = 0.4;
-SELECT @@session.sql_buffer_result;
-@@session.sql_buffer_result
-0
-SET @@session.sql_buffer_result = 1.4;
-SELECT @@session.sql_buffer_result;
-@@session.sql_buffer_result
-1
-'Bug: Decimal values are accepted and rounded to an integer before';
-'assingment.';
+ERROR 42000: Incorrect argument type to variable 'sql_buffer_result'
SET @@session.sql_buffer_result = TRÜE;
-ERROR 42000: Variable 'sql_buffer_result' can't be set to the value of 'TRÃœE'
+ERROR 42000: Variable 'sql_buffer_result' can't be set to the value of 'TRÜE'
SET @@session.sql_buffer_result = ÕN;
-ERROR 42000: Variable 'sql_buffer_result' can't be set to the value of 'ÕN'
+ERROR 42000: Variable 'sql_buffer_result' can't be set to the value of 'ÕN'
SET @@session.sql_buffer_result = OF;
-SELECT @@session.sql_buffer_result;
-@@session.sql_buffer_result
-0
-'Bug# 34828: OF is taken as OFF and a value of 0 is set.'
+ERROR 42000: Variable 'sql_buffer_result' can't be set to the value of 'OF'
SET @@session.sql_buffer_result = ÓFF;
-ERROR 42000: Variable 'sql_buffer_result' can't be set to the value of 'ÓFF'
+ERROR 42000: Variable 'sql_buffer_result' can't be set to the value of 'ÓFF'
SET @@session.sql_buffer_result = '¹';
ERROR 42000: Variable 'sql_buffer_result' can't be set to the value of '¹'
SET @@session.sql_buffer_result = NO;
ERROR 42000: Variable 'sql_buffer_result' can't be set to the value of 'NO'
'#-------------------FN_DYNVARS_155_05----------------------------#'
-SET @@global.sql_buffer_result = 0;
-ERROR HY000: Variable 'sql_buffer_result' is a SESSION variable and can't be used with SET GLOBAL
+SET @@global.sql_buffer_result = 1-@@global.sql_buffer_result;
+SELECT @@global.sql_buffer_result;
+@@global.sql_buffer_result
+1
+SET @@global.sql_buffer_result = 1-@@global.sql_buffer_result;
SELECT @@global.sql_buffer_result;
-ERROR HY000: Variable 'sql_buffer_result' is a SESSION variable
+@@global.sql_buffer_result
+0
'#----------------------FN_DYNVARS_155_06------------------------#'
SELECT count(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@@ -86,12 +79,12 @@ IF(@@session.sql_buffer_result, "ON", "OFF") = VARIABLE_VALUE
1
SELECT @@session.sql_buffer_result;
@@session.sql_buffer_result
-0
+1
SELECT VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_buffer_result';
VARIABLE_VALUE
-OFF
+ON
'#---------------------FN_DYNVARS_155_08-------------------------#'
SET @@session.sql_buffer_result = OFF;
SELECT @@session.sql_buffer_result;
diff --git a/mysql-test/suite/sys_vars/r/sql_log_bin_basic.result b/mysql-test/suite/sys_vars/r/sql_log_bin_basic.result
index 751b801047c..5e8fe4e02f7 100644
--- a/mysql-test/suite/sys_vars/r/sql_log_bin_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_log_bin_basic.result
@@ -7,7 +7,7 @@ SET @@session.sql_log_bin = 0;
SET @@session.sql_log_bin = DEFAULT;
SELECT @@session.sql_log_bin;
@@session.sql_log_bin
-0
+1
SET @@session.sql_log_bin = 1;
SET @@session.sql_log_bin = DEFAULT;
SELECT @@session.sql_log_bin;
@@ -45,25 +45,23 @@ ERROR 42000: Variable 'sql_log_bin' can't be set to the value of 'T'
SET @@session.sql_log_bin = "Y";
ERROR 42000: Variable 'sql_log_bin' can't be set to the value of 'Y'
SET @@session.sql_log_bin = TRÜE;
-ERROR 42000: Variable 'sql_log_bin' can't be set to the value of 'TRÃœE'
+ERROR 42000: Variable 'sql_log_bin' can't be set to the value of 'TRÜE'
SET @@session.sql_log_bin = ÕN;
-ERROR 42000: Variable 'sql_log_bin' can't be set to the value of 'ÕN'
+ERROR 42000: Variable 'sql_log_bin' can't be set to the value of 'ÕN'
SET @@session.sql_log_bin = OF;
-SELECT @@session.sql_log_bin;
-@@session.sql_log_bin
-0
-'Bug# 34828: OF is taken as OFF and a value of 0 is set.'
+ERROR 42000: Variable 'sql_log_bin' can't be set to the value of 'OF'
SET @@session.sql_log_bin = ÓFF;
-ERROR 42000: Variable 'sql_log_bin' can't be set to the value of 'ÓFF'
+ERROR 42000: Variable 'sql_log_bin' can't be set to the value of 'ÓFF'
SET @@session.sql_log_bin = '¹';
ERROR 42000: Variable 'sql_log_bin' can't be set to the value of '¹'
SET @@session.sql_log_bin = NO;
ERROR 42000: Variable 'sql_log_bin' can't be set to the value of 'NO'
'#-------------------FN_DYNVARS_156_05----------------------------#'
SET @@global.sql_log_bin = 0;
-ERROR HY000: Variable 'sql_log_bin' is a SESSION variable and can't be used with SET GLOBAL
SELECT @@global.sql_log_bin;
-ERROR HY000: Variable 'sql_log_bin' is a SESSION variable
+@@global.sql_log_bin
+0
+SET @@global.sql_log_bin = 1;
'#----------------------FN_DYNVARS_156_06------------------------#'
SELECT count(VARIABLE_VALUE) FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sql_log_bin';
count(VARIABLE_VALUE)
@@ -76,12 +74,12 @@ IF(@@session.sql_log_bin, "ON", "OFF") = VARIABLE_VALUE
1
SELECT @@session.sql_log_bin;
@@session.sql_log_bin
-0
+1
SELECT VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_log_bin';
VARIABLE_VALUE
-OFF
+ON
'#---------------------FN_DYNVARS_156_08-------------------------#'
SET @@session.sql_log_bin = OFF;
SELECT @@session.sql_log_bin;
diff --git a/mysql-test/suite/sys_vars/r/sql_log_off_basic.result b/mysql-test/suite/sys_vars/r/sql_log_off_basic.result
index 9f610991ce2..c2ffa17c5fe 100644
--- a/mysql-test/suite/sys_vars/r/sql_log_off_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_log_off_basic.result
@@ -12,7 +12,7 @@ SET @@session.sql_log_off = 1;
SET @@session.sql_log_off = DEFAULT;
SELECT @@session.sql_log_off;
@@session.sql_log_off
-1
+0
'#---------------------FN_DYNVARS_157_02-------------------------#'
SET sql_log_off = 1;
SELECT @@sql_log_off;
@@ -45,25 +45,26 @@ ERROR 42000: Variable 'sql_log_off' can't be set to the value of 'T'
SET @@session.sql_log_off = "Y";
ERROR 42000: Variable 'sql_log_off' can't be set to the value of 'Y'
SET @@session.sql_log_off = TRÜE;
-ERROR 42000: Variable 'sql_log_off' can't be set to the value of 'TRÃœE'
+ERROR 42000: Variable 'sql_log_off' can't be set to the value of 'TRÜE'
SET @@session.sql_log_off = ÕN;
-ERROR 42000: Variable 'sql_log_off' can't be set to the value of 'ÕN'
+ERROR 42000: Variable 'sql_log_off' can't be set to the value of 'ÕN'
SET @@session.sql_log_off = OF;
-SELECT @@session.sql_log_off;
-@@session.sql_log_off
-0
-'Bug# 34828: OF is taken as OFF and a value of 0 is set.'
+ERROR 42000: Variable 'sql_log_off' can't be set to the value of 'OF'
SET @@session.sql_log_off = ÓFF;
-ERROR 42000: Variable 'sql_log_off' can't be set to the value of 'ÓFF'
+ERROR 42000: Variable 'sql_log_off' can't be set to the value of 'ÓFF'
SET @@session.sql_log_off = '¹';
ERROR 42000: Variable 'sql_log_off' can't be set to the value of '¹'
SET @@session.sql_log_off = NO;
ERROR 42000: Variable 'sql_log_off' can't be set to the value of 'NO'
'#-------------------FN_DYNVARS_157_05----------------------------#'
-SET @@global.sql_log_off = 0;
-ERROR HY000: Variable 'sql_log_off' is a SESSION variable and can't be used with SET GLOBAL
+SET @@global.sql_log_off = 1-@@global.sql_log_off;
SELECT @@global.sql_log_off;
-ERROR HY000: Variable 'sql_log_off' is a SESSION variable
+@@global.sql_log_off
+1
+SET @@global.sql_log_off = 1-@@global.sql_log_off;
+SELECT @@global.sql_log_off;
+@@global.sql_log_off
+0
'#----------------------FN_DYNVARS_157_06------------------------#'
SELECT count(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@@ -78,12 +79,12 @@ IF(@@session.sql_log_off, "ON", "OFF") = VARIABLE_VALUE
1
SELECT @@session.sql_log_off;
@@session.sql_log_off
-0
+1
SELECT VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_log_off';
VARIABLE_VALUE
-OFF
+ON
'#---------------------FN_DYNVARS_157_08-------------------------#'
SET @@session.sql_log_off = OFF;
SELECT @@session.sql_log_off;
diff --git a/mysql-test/suite/sys_vars/r/sql_log_off_func.result b/mysql-test/suite/sys_vars/r/sql_log_off_func.result
index e51860534f1..51c37a16795 100644
--- a/mysql-test/suite/sys_vars/r/sql_log_off_func.result
+++ b/mysql-test/suite/sys_vars/r/sql_log_off_func.result
@@ -19,7 +19,6 @@ UPDATE t1 SET a = 'aa1' WHERE a = 'aa1-updated';
Checking if log contains the executed statement
SELECT argument FROM mysql.general_log WHERE argument = 'UPDATE t1 SET a = \'aa1\' WHERE a = \'aa1-updated\'';
argument
-UPDATE t1 SET a = 'aa1' WHERE a = 'aa1-updated'
'#--------------------FN_DYNVARS_158_03--------------------------#'
** Connecting con_int1 using root **
** Connection con_int1 **
diff --git a/mysql-test/suite/sys_vars/r/sql_log_update_basic.result b/mysql-test/suite/sys_vars/r/sql_log_update_basic.result
new file mode 100644
index 00000000000..f48cf6870da
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/sql_log_update_basic.result
@@ -0,0 +1,46 @@
+SET @start_global_value = @@global.sql_log_update;
+SELECT @start_global_value;
+@start_global_value
+1
+select @@global.sql_log_update;
+@@global.sql_log_update
+1
+select @@session.sql_log_update;
+@@session.sql_log_update
+1
+show global variables like 'sql_log_update';
+Variable_name Value
+sql_log_update ON
+show session variables like 'sql_log_update';
+Variable_name Value
+sql_log_update ON
+select * from information_schema.global_variables where variable_name='sql_log_update';
+VARIABLE_NAME VARIABLE_VALUE
+SQL_LOG_UPDATE ON
+select * from information_schema.session_variables where variable_name='sql_log_update';
+VARIABLE_NAME VARIABLE_VALUE
+SQL_LOG_UPDATE ON
+set global sql_log_update=1;
+Warnings:
+Note 1315 The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored
+select @@global.sql_log_update;
+@@global.sql_log_update
+1
+set session sql_log_update=ON;
+Warnings:
+Note 1315 The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored
+select @@session.sql_log_update;
+@@session.sql_log_update
+1
+set global sql_log_update=1.1;
+ERROR 42000: Incorrect argument type to variable 'sql_log_update'
+set global sql_log_update=1e1;
+ERROR 42000: Incorrect argument type to variable 'sql_log_update'
+set global sql_log_update="foo";
+ERROR 42000: Variable 'sql_log_update' can't be set to the value of 'foo'
+SET @@global.sql_log_update = @start_global_value;
+Warnings:
+Note 1315 The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored
+SELECT @@global.sql_log_update;
+@@global.sql_log_update
+1
diff --git a/mysql-test/suite/sys_vars/r/sql_low_priority_updates_basic.result b/mysql-test/suite/sys_vars/r/sql_low_priority_updates_basic.result
index 7b834d70038..28bc53e5718 100644
--- a/mysql-test/suite/sys_vars/r/sql_low_priority_updates_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_low_priority_updates_basic.result
@@ -14,8 +14,6 @@ SELECT @@session.sql_low_priority_updates;
0
SET @@global.sql_low_priority_updates = 1;
SET @@global.sql_low_priority_updates = DEFAULT;
-ERROR 42000: Variable 'sql_low_priority_updates' doesn't have a default value
-'Bug: DEFAULT value is only associated with session'
'#---------------------FN_DYNVARS_159_02-------------------------#'
SET sql_low_priority_updates = 1;
SELECT @@sql_low_priority_updates;
@@ -56,22 +54,19 @@ SELECT @@global.sql_low_priority_updates;
SET @@session.sql_low_priority_updates = -1;
ERROR 42000: Variable 'sql_low_priority_updates' can't be set to the value of '-1'
SET @@session.sql_low_priority_updates = 1.6;
-ERROR 42000: Variable 'sql_low_priority_updates' can't be set to the value of '2'
+ERROR 42000: Incorrect argument type to variable 'sql_low_priority_updates'
SET @@session.sql_low_priority_updates = "T";
ERROR 42000: Variable 'sql_low_priority_updates' can't be set to the value of 'T'
SET @@session.sql_low_priority_updates = "Y";
ERROR 42000: Variable 'sql_low_priority_updates' can't be set to the value of 'Y'
SET @@session.sql_low_priority_updates = TRÜE;
-ERROR 42000: Variable 'sql_low_priority_updates' can't be set to the value of 'TRÃœE'
+ERROR 42000: Variable 'sql_low_priority_updates' can't be set to the value of 'TRÜE'
SET @@session.sql_low_priority_updates = ÕN;
-ERROR 42000: Variable 'sql_low_priority_updates' can't be set to the value of 'ÕN'
+ERROR 42000: Variable 'sql_low_priority_updates' can't be set to the value of 'ÕN'
SET @@session.sql_low_priority_updates = OF;
-SELECT @@session.sql_low_priority_updates;
-@@session.sql_low_priority_updates
-0
-'Bug# 34828: OF is taken as OFF and a value of 0 is set.'
+ERROR 42000: Variable 'sql_low_priority_updates' can't be set to the value of 'OF'
SET @@session.sql_low_priority_updates = ÓFF;
-ERROR 42000: Variable 'sql_low_priority_updates' can't be set to the value of 'ÓFF'
+ERROR 42000: Variable 'sql_low_priority_updates' can't be set to the value of 'ÓFF'
SET @@global.sql_low_priority_updates = -1;
ERROR 42000: Variable 'sql_low_priority_updates' can't be set to the value of '-1'
SET @@global.sql_low_priority_updates = 2;
@@ -81,16 +76,13 @@ ERROR 42000: Variable 'sql_low_priority_updates' can't be set to the value of 'T
SET @@global.sql_low_priority_updates = "Y";
ERROR 42000: Variable 'sql_low_priority_updates' can't be set to the value of 'Y'
SET @@global.sql_low_priority_updates = TRÜE;
-ERROR 42000: Variable 'sql_low_priority_updates' can't be set to the value of 'TRÃœE'
+ERROR 42000: Variable 'sql_low_priority_updates' can't be set to the value of 'TRÜE'
SET @@global.sql_low_priority_updates = ÕN;
-ERROR 42000: Variable 'sql_low_priority_updates' can't be set to the value of 'ÕN'
+ERROR 42000: Variable 'sql_low_priority_updates' can't be set to the value of 'ÕN'
SET @@global.sql_low_priority_updates = OF;
-SELECT @@global.sql_low_priority_updates;
-@@global.sql_low_priority_updates
-0
-'Bug# 34828: OF is taken as OFF and a value of 0 is set.'
+ERROR 42000: Variable 'sql_low_priority_updates' can't be set to the value of 'OF'
SET @@global.sql_low_priority_updates = ÓFF;
-ERROR 42000: Variable 'sql_low_priority_updates' can't be set to the value of 'ÓFF'
+ERROR 42000: Variable 'sql_low_priority_updates' can't be set to the value of 'ÓFF'
'#-------------------FN_DYNVARS_159_05----------------------------#'
SET @@global.sql_low_priority_updates = 0;
SET @@session.sql_low_priority_updates = 1;
diff --git a/mysql-test/suite/sys_vars/r/sql_max_join_size_basic.result b/mysql-test/suite/sys_vars/r/sql_max_join_size_basic.result
new file mode 100644
index 00000000000..8aaea049b94
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/sql_max_join_size_basic.result
@@ -0,0 +1,61 @@
+SET @start_global_value = @@global.sql_max_join_size;
+SELECT @start_global_value;
+@start_global_value
+18446744073709551615
+select @@global.sql_max_join_size;
+@@global.sql_max_join_size
+18446744073709551615
+select @@session.sql_max_join_size;
+@@session.sql_max_join_size
+18446744073709551615
+show global variables like 'sql_max_join_size';
+Variable_name Value
+sql_max_join_size 18446744073709551615
+show session variables like 'sql_max_join_size';
+Variable_name Value
+sql_max_join_size 18446744073709551615
+select * from information_schema.global_variables where variable_name='sql_max_join_size';
+VARIABLE_NAME VARIABLE_VALUE
+SQL_MAX_JOIN_SIZE 18446744073709551615
+select * from information_schema.session_variables where variable_name='sql_max_join_size';
+VARIABLE_NAME VARIABLE_VALUE
+SQL_MAX_JOIN_SIZE 18446744073709551615
+set global sql_max_join_size=10;
+Warnings:
+Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0.
+select @@global.sql_max_join_size;
+@@global.sql_max_join_size
+10
+set session sql_max_join_size=20;
+Warnings:
+Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0.
+select @@session.sql_max_join_size;
+@@session.sql_max_join_size
+20
+set global sql_max_join_size=1.1;
+ERROR 42000: Incorrect argument type to variable 'sql_max_join_size'
+set global sql_max_join_size=1e1;
+ERROR 42000: Incorrect argument type to variable 'sql_max_join_size'
+set global sql_max_join_size="foo";
+ERROR 42000: Incorrect argument type to variable 'sql_max_join_size'
+select @@sql_big_selects;
+@@sql_big_selects
+0
+set sql_max_join_size=cast(-1 as unsigned int);
+Warnings:
+Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0.
+select @@sql_big_selects;
+@@sql_big_selects
+1
+set sql_max_join_size=100;
+Warnings:
+Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0.
+select @@sql_big_selects;
+@@sql_big_selects
+0
+SET @@global.sql_max_join_size = @start_global_value;
+Warnings:
+Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0.
+SELECT @@global.sql_max_join_size;
+@@global.sql_max_join_size
+18446744073709551615
diff --git a/mysql-test/suite/sys_vars/r/sql_max_join_size_func.result b/mysql-test/suite/sys_vars/r/sql_max_join_size_func.result
index 0e406f6611e..0720f5dc965 100644
--- a/mysql-test/suite/sys_vars/r/sql_max_join_size_func.result
+++ b/mysql-test/suite/sys_vars/r/sql_max_join_size_func.result
@@ -16,6 +16,8 @@ INSERT INTO t2 VALUES('aa3','bb');
INSERT INTO t2 VALUES('aa4','bb');
'#--------------------FN_DYNVARS_161_01-------------------------#'
SET SESSION sql_max_join_size=9;
+Warnings:
+Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0.
SELECT * FROM t1 INNER JOIN t2 ON t1.a = t2.a;
ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
Expected error The SELECT would examine more than MAX_JOIN_SIZE rows.
@@ -30,6 +32,8 @@ aa3 bb aa3 bb
aa4 bb aa4 bb
This should work
SET SESSION sql_max_join_size=DEFAULT;
+Warnings:
+Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0.
DELETE FROM t2 WHERE a = 'aa4';
SELECT * FROM t1 INNER JOIN t2 ON t1.a = t2.a;
a b a b
@@ -40,6 +44,8 @@ aa3 bb aa3 bb
This should work
'#----------------------------FN_DYNVARS_136_05-------------------------#'
SET GLOBAL sql_max_join_size = 4;
+Warnings:
+Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0.
** Connecting con_int1 using root **
** Connection con_int1 **
SELECT @@SESSION.sql_max_join_size;
@@ -47,6 +53,8 @@ SELECT @@SESSION.sql_max_join_size;
4
4 Expected
SET SESSION sql_max_join_size = 2;
+Warnings:
+Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0.
** Connecting con_int2 using root **
** Connection con_int2 **
SELECT @@SESSION.sql_max_join_size;
@@ -54,6 +62,8 @@ SELECT @@SESSION.sql_max_join_size;
4
4 Expected
SET SESSION sql_max_join_size = 10;
+Warnings:
+Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0.
** Connection con_int2 **
SELECT @@SESSION.sql_max_join_size;
@@SESSION.sql_max_join_size
@@ -71,7 +81,11 @@ SELECT @@GLOBAL.sql_max_join_size;
** Connection default **
Disconnecting Connections con_int1, con_int2
SET @@SESSION.sql_max_join_size = @session_max_join_size;
+Warnings:
+Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0.
SET @@GLOBAL.sql_max_join_size = @global_max_join_size ;
+Warnings:
+Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0.
SET @@SESSION.sql_big_selects = @session_sql_big_selects;
DROP TABLE t1;
DROP TABLE t2;
diff --git a/mysql-test/suite/sys_vars/r/sql_mode_basic.result b/mysql-test/suite/sys_vars/r/sql_mode_basic.result
index 78a9f179824..19695fd3af6 100644
--- a/mysql-test/suite/sys_vars/r/sql_mode_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_mode_basic.result
@@ -17,8 +17,6 @@ SET @@session.sql_mode = DEFAULT;
SELECT @@session.sql_mode;
@@session.sql_mode
-'Bug# 34876: Default values for both session and global sql_mode is ""';
-'and not OFF.';
'#---------------------FN_DYNVARS_152_02-------------------------#'
SET @@global.sql_mode = NULL;
ERROR 42000: Variable 'sql_mode' can't be set to the value of 'NULL'
@@ -41,8 +39,6 @@ SELECT @@session.sql_mode;
@@session.sql_mode
'#--------------------FN_DYNVARS_152_03------------------------#'
-'Bug: Incomplete sql modes valid values at:';
-'http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html';
SET @@global.sql_mode = ANSI;
SELECT @@global.sql_mode;
@@global.sql_mode
@@ -54,7 +50,7 @@ STRICT_TRANS_TABLES
SET @@global.sql_mode = TRADITIONAL;
SELECT @@global.sql_mode;
@@global.sql_mode
-STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
+STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
SET @@global.sql_mode = ALLOW_INVALID_DATES;
SELECT @@global.sql_mode;
@@global.sql_mode
@@ -170,10 +166,9 @@ PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,POSTGRESQL,NO_KEY_OPTIONS,NO_TABLE_OPTI
SET @@global.sql_mode = TRADITIONAL;
SELECT @@global.sql_mode;
@@global.sql_mode
-STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
+STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
SET @@global.sql_mode = OFF;
ERROR 42000: Variable 'sql_mode' can't be set to the value of 'OFF'
-'Bug: OFF is documented as an sql mode but infact it is not';
SET @@session.sql_mode = ANSI;
SELECT @@session.sql_mode;
@@session.sql_mode
@@ -185,7 +180,7 @@ STRICT_TRANS_TABLES
SET @@session.sql_mode = TRADITIONAL;
SELECT @@session.sql_mode;
@@session.sql_mode
-STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
+STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
SET @@session.sql_mode = ALLOW_INVALID_DATES;
SELECT @@session.sql_mode;
@@session.sql_mode
@@ -301,18 +296,14 @@ PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,POSTGRESQL,NO_KEY_OPTIONS,NO_TABLE_OPTI
SET @@session.sql_mode = TRADITIONAL;
SELECT @@session.sql_mode;
@@session.sql_mode
-STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
+STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
SET @@session.sql_mode = OFF;
ERROR 42000: Variable 'sql_mode' can't be set to the value of 'OFF'
SET @@global.sql_mode = '?';
+ERROR 42000: Variable 'sql_mode' can't be set to the value of '?'
SELECT @@global.sql_mode;
@@global.sql_mode
-?
-SET @@session.sql_mode = '?';
-SELECT @@session.sql_mode;
-@@session.sql_mode
-?
-'Bug# 34834: ? is acceptable as a valid sql mode.'
+STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
'#--------------------FN_DYNVARS_152_04-------------------------#'
SET @@global.sql_mode = -1;
ERROR 42000: Variable 'sql_mode' can't be set to the value of '-1'
@@ -366,7 +357,7 @@ REAL_AS_FLOAT,PIPES_AS_CONCAT
SET @@global.sql_mode = 50000;
SELECT @@global.sql_mode;
@@global.sql_mode
-PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,?,NO_UNSIGNED_SUBTRACTION,POSTGRESQL,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER
+PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,,,NO_UNSIGNED_SUBTRACTION,POSTGRESQL,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER
SET @@global.sql_mode = 500000;
SELECT @@global.sql_mode;
@@global.sql_mode
@@ -374,39 +365,11 @@ REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ONLY_FULL_GROUP_BY,POSTGR
SET @@global.sql_mode = 4294967295;
SELECT @@global.sql_mode;
@@global.sql_mode
-REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,?,ONLY_FULL_GROUP_BY,NO_UNSIGNED_SUBTRACTION,NO_DIR_IN_CREATE,POSTGRESQL,ORACLE,MSSQL,DB2,MAXDB,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,MYSQL323,MYSQL40,ANSI,NO_AUTO_VALUE_ON_ZERO,NO_BACKSLASH_ESCAPES,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ALLOW_INVALID_DATES,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,HIGH_NOT_PRECEDENCE,NO_ENGINE_SUBSTITUTION,PAD_CHAR_TO_FULL_LENGTH
+REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,,,ONLY_FULL_GROUP_BY,NO_UNSIGNED_SUBTRACTION,NO_DIR_IN_CREATE,POSTGRESQL,ORACLE,MSSQL,DB2,MAXDB,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,MYSQL323,MYSQL40,ANSI,NO_AUTO_VALUE_ON_ZERO,NO_BACKSLASH_ESCAPES,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ALLOW_INVALID_DATES,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,HIGH_NOT_PRECEDENCE,NO_ENGINE_SUBSTITUTION,PAD_CHAR_TO_FULL_LENGTH
SET @@global.sql_mode = 4294967296;
ERROR 42000: Variable 'sql_mode' can't be set to the value of '4294967296'
SET @@global.sql_mode = 0.4;
-SELECT @@global.sql_mode;
-@@global.sql_mode
-
-SET @@global.sql_mode = 1.0;
-SELECT @@global.sql_mode;
-@@global.sql_mode
-REAL_AS_FLOAT
-SET @@global.sql_mode = 40000.1;
-SELECT @@global.sql_mode;
-@@global.sql_mode
-PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,NO_UNSIGNED_SUBTRACTION,MSSQL,DB2,MAXDB,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER
-SET @@global.sql_mode = 1.5;
-SELECT @@global.sql_mode;
-@@global.sql_mode
-PIPES_AS_CONCAT
-SET @@global.sql_mode = 124567.49;
-SELECT @@global.sql_mode;
-@@global.sql_mode
-REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,?,NO_DIR_IN_CREATE,ORACLE,MSSQL,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,MYSQL323,NO_AUTO_CREATE_USER,HIGH_NOT_PRECEDENCE
-SET @@session.sql_mode = 50000000.5;
-SELECT @@session.sql_mode;
-@@session.sql_mode
-REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,NO_DIR_IN_CREATE,MAXDB,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,MYSQL40,NO_AUTO_VALUE_ON_ZERO,NO_BACKSLASH_ESCAPES,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,ALLOW_INVALID_DATES,NO_AUTO_CREATE_USER,HIGH_NOT_PRECEDENCE
-SET @@session.sql_mode = 4294967295.4;
-SELECT @@session.sql_mode;
-@@session.sql_mode
-REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,?,ONLY_FULL_GROUP_BY,NO_UNSIGNED_SUBTRACTION,NO_DIR_IN_CREATE,POSTGRESQL,ORACLE,MSSQL,DB2,MAXDB,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,MYSQL323,MYSQL40,ANSI,NO_AUTO_VALUE_ON_ZERO,NO_BACKSLASH_ESCAPES,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ALLOW_INVALID_DATES,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,HIGH_NOT_PRECEDENCE,NO_ENGINE_SUBSTITUTION,PAD_CHAR_TO_FULL_LENGTH
-'Bug: Decimal values can be used within the range [0.0-4294967295.5).';
-'Values are rounded to numeric values as evident from outcome.';
+ERROR 42000: Incorrect argument type to variable 'sql_mode'
'#---------------------FN_DYNVARS_152_08----------------------#'
SET @@global.sql_mode = TRUE;
SELECT @@global.sql_mode;
@@ -434,15 +397,26 @@ SELECT @@global.sql_mode;
SET @@session.sql_mode = 'TRADITIONAL,ALLOW_INVALID_DATES,ANSI_QUOTES';
SELECT @@session.sql_mode;
@@session.sql_mode
-ANSI_QUOTES,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ALLOW_INVALID_DATES,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
+ANSI_QUOTES,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ALLOW_INVALID_DATES,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
SET @@global.sql_mode = 'ONLY_FULL_GROUP_BY,PIPES_AS_CONCAT,REAL_AS_FLOAT,ORACLE,POSTGRESQL';
SELECT @@global.sql_mode;
@@global.sql_mode
REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ONLY_FULL_GROUP_BY,POSTGRESQL,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER
-SET @@session.sql_mode = 'ERROR_FOR_DIVISION_BY_ZERO,HIGH_OR_PRECEDENCE,
-IGNORE_SPACE';
-ERROR 42000: Variable 'sql_mode' can't be set to the value of '
-IGNORE_SPACE'
+SET @@session.sql_mode = 'ERROR_FOR_DIVISION_BY_ZERO,FOOBAR,IGNORE_SPACE';
+ERROR 42000: Variable 'sql_mode' can't be set to the value of 'FOOBAR'
+SET @@sql_mode=',';
+SELECT @@sql_mode;
+@@sql_mode
+
+SET @@sql_mode=',,,,ANSI_QUOTES,,,';
+SELECT @@sql_mode;
+@@sql_mode
+ANSI_QUOTES
+SET @@sql_mode=',,,,FOOBAR,,,,,';
+ERROR 42000: Variable 'sql_mode' can't be set to the value of 'FOOBAR'
+SELECT @@sql_mode;
+@@sql_mode
+ANSI_QUOTES
SET @@global.sql_mode = @global_start_value;
SELECT @@global.sql_mode;
@@global.sql_mode
diff --git a/mysql-test/suite/sys_vars/r/sql_mode_func.result b/mysql-test/suite/sys_vars/r/sql_mode_func.result
index dbf0db4e1ad..bb9ffc0717e 100644
--- a/mysql-test/suite/sys_vars/r/sql_mode_func.result
+++ b/mysql-test/suite/sys_vars/r/sql_mode_func.result
@@ -52,7 +52,7 @@ TRADITIONAL mode
SET SESSION sql_mode = TRADITIONAL;
SELECT @@SESSION.sql_mode;
@@SESSION.sql_mode
-STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
+STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
INSERT INTO t1 VALUES('t1a1','t1b1');
INSERT INTO t1 VALUES('t1a2','t1b2');
INSERT INTO t1 VALUES('t1a3','t1b3');
@@ -91,7 +91,7 @@ REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI
** Connection con_int1 **
SELECT @@SESSION.sql_mode;
@@SESSION.sql_mode
-STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
+STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
'STRICT_TRANS_TABLES, STRICT_ALL_TABLES, NO_ZERO_IN_DATE, NO_ZERO_DATE, ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER, TRADITIONAL' Expected
SELECT @@GLOBAL.sql_mode;
@@GLOBAL.sql_mode
diff --git a/mysql-test/suite/sys_vars/r/sql_notes_basic.result b/mysql-test/suite/sys_vars/r/sql_notes_basic.result
index d6ec1239f45..7a54f90f8b7 100644
--- a/mysql-test/suite/sys_vars/r/sql_notes_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_notes_basic.result
@@ -7,7 +7,7 @@ SET @@session.sql_notes = 0;
SET @@session.sql_notes = DEFAULT;
SELECT @@session.sql_notes;
@@session.sql_notes
-0
+1
SET @@session.sql_notes = 1;
SET @@session.sql_notes = DEFAULT;
SELECT @@session.sql_notes;
@@ -45,25 +45,26 @@ ERROR 42000: Variable 'sql_notes' can't be set to the value of 'T'
SET @@session.sql_notes = "Y";
ERROR 42000: Variable 'sql_notes' can't be set to the value of 'Y'
SET @@session.sql_notes = TRÜE;
-ERROR 42000: Variable 'sql_notes' can't be set to the value of 'TRÃœE'
+ERROR 42000: Variable 'sql_notes' can't be set to the value of 'TRÜE'
SET @@session.sql_notes = ÕN;
-ERROR 42000: Variable 'sql_notes' can't be set to the value of 'ÕN'
+ERROR 42000: Variable 'sql_notes' can't be set to the value of 'ÕN'
SET @@session.sql_notes = OF;
-SELECT @@session.sql_notes;
-@@session.sql_notes
-0
-'Bug# 34828: OF is taken as OFF and a value of 0 is set.'
+ERROR 42000: Variable 'sql_notes' can't be set to the value of 'OF'
SET @@session.sql_notes = ÓFF;
-ERROR 42000: Variable 'sql_notes' can't be set to the value of 'ÓFF'
+ERROR 42000: Variable 'sql_notes' can't be set to the value of 'ÓFF'
SET @@session.sql_notes = '¹';
ERROR 42000: Variable 'sql_notes' can't be set to the value of '¹'
SET @@session.sql_notes = NO;
ERROR 42000: Variable 'sql_notes' can't be set to the value of 'NO'
'#-------------------FN_DYNVARS_161_05----------------------------#'
-SET @@global.sql_notes = 0;
-ERROR HY000: Variable 'sql_notes' is a SESSION variable and can't be used with SET GLOBAL
+SET @@global.sql_notes = 1-@@global.sql_notes;
SELECT @@global.sql_notes;
-ERROR HY000: Variable 'sql_notes' is a SESSION variable
+@@global.sql_notes
+0
+SET @@global.sql_notes = 1-@@global.sql_notes;
+SELECT @@global.sql_notes;
+@@global.sql_notes
+1
'#----------------------FN_DYNVARS_161_06------------------------#'
SELECT count(VARIABLE_VALUE) FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sql_notes';
count(VARIABLE_VALUE)
@@ -76,12 +77,12 @@ IF(@@session.sql_notes, "ON", "OFF") = VARIABLE_VALUE
1
SELECT @@session.sql_notes;
@@session.sql_notes
-0
+1
SELECT VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_notes';
VARIABLE_VALUE
-OFF
+ON
'#---------------------FN_DYNVARS_161_08-------------------------#'
SET @@session.sql_notes = OFF;
SELECT @@session.sql_notes;
diff --git a/mysql-test/suite/sys_vars/r/sql_quote_show_create_basic.result b/mysql-test/suite/sys_vars/r/sql_quote_show_create_basic.result
index ed9322618f0..8cf99233ef9 100644
--- a/mysql-test/suite/sys_vars/r/sql_quote_show_create_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_quote_show_create_basic.result
@@ -7,7 +7,7 @@ SET @@session.sql_quote_show_create = 0;
SET @@session.sql_quote_show_create = DEFAULT;
SELECT @@session.sql_quote_show_create;
@@session.sql_quote_show_create
-0
+1
SET @@session.sql_quote_show_create = 1;
SET @@session.sql_quote_show_create = DEFAULT;
SELECT @@session.sql_quote_show_create;
@@ -45,25 +45,26 @@ ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'T'
SET @@session.sql_quote_show_create = "Y";
ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'Y'
SET @@session.sql_quote_show_create = TRÜE;
-ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TRÃœE'
+ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TRÜE'
SET @@session.sql_quote_show_create = ÕN;
-ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'ÕN'
+ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'ÕN'
SET @@session.sql_quote_show_create = OF;
-SELECT @@session.sql_quote_show_create;
-@@session.sql_quote_show_create
-0
-'Bug# 34828: OF is taken as OFF and a value of 0 is set.'
+ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'OF'
SET @@session.sql_quote_show_create = ÓFF;
-ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'ÓFF'
+ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'ÓFF'
SET @@session.sql_quote_show_create = '¹';
ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of '¹'
SET @@session.sql_quote_show_create = NO;
ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'NO'
'#-------------------FN_DYNVARS_162_05----------------------------#'
-SET @@global.sql_quote_show_create = 0;
-ERROR HY000: Variable 'sql_quote_show_create' is a SESSION variable and can't be used with SET GLOBAL
+SET @@global.sql_quote_show_create = 1-@@global.sql_quote_show_create;
SELECT @@global.sql_quote_show_create;
-ERROR HY000: Variable 'sql_quote_show_create' is a SESSION variable
+@@global.sql_quote_show_create
+0
+SET @@global.sql_quote_show_create = 1-@@global.sql_quote_show_create;
+SELECT @@global.sql_quote_show_create;
+@@global.sql_quote_show_create
+1
'#----------------------FN_DYNVARS_162_06------------------------#'
SELECT count(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@@ -78,12 +79,12 @@ IF(@@session.sql_quote_show_create, "ON", "OFF") = VARIABLE_VALUE
1
SELECT @@session.sql_quote_show_create;
@@session.sql_quote_show_create
-0
+1
SELECT VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_quote_show_create';
VARIABLE_VALUE
-OFF
+ON
'#---------------------FN_DYNVARS_162_08-------------------------#'
SET @@session.sql_quote_show_create = OFF;
SELECT @@session.sql_quote_show_create;
diff --git a/mysql-test/suite/sys_vars/r/sql_safe_updates_basic.result b/mysql-test/suite/sys_vars/r/sql_safe_updates_basic.result
index 4daf78228f3..91bfcb2377e 100644
--- a/mysql-test/suite/sys_vars/r/sql_safe_updates_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_safe_updates_basic.result
@@ -12,7 +12,7 @@ SET @@session.sql_safe_updates = 1;
SET @@session.sql_safe_updates = DEFAULT;
SELECT @@session.sql_safe_updates;
@@session.sql_safe_updates
-1
+0
'#---------------------FN_DYNVARS_163_02-------------------------#'
SET sql_safe_updates = 1;
SELECT @@sql_safe_updates;
@@ -45,25 +45,26 @@ ERROR 42000: Variable 'sql_safe_updates' can't be set to the value of 'T'
SET @@session.sql_safe_updates = "Y";
ERROR 42000: Variable 'sql_safe_updates' can't be set to the value of 'Y'
SET @@session.sql_safe_updates = TRÜE;
-ERROR 42000: Variable 'sql_safe_updates' can't be set to the value of 'TRÃœE'
+ERROR 42000: Variable 'sql_safe_updates' can't be set to the value of 'TRÜE'
SET @@session.sql_safe_updates = ÕN;
-ERROR 42000: Variable 'sql_safe_updates' can't be set to the value of 'ÕN'
+ERROR 42000: Variable 'sql_safe_updates' can't be set to the value of 'ÕN'
SET @@session.sql_safe_updates = OF;
-SELECT @@session.sql_safe_updates;
-@@session.sql_safe_updates
-0
-'Bug# 34828: OF is taken as OFF and a value of 0 is set.'
+ERROR 42000: Variable 'sql_safe_updates' can't be set to the value of 'OF'
SET @@session.sql_safe_updates = ÓFF;
-ERROR 42000: Variable 'sql_safe_updates' can't be set to the value of 'ÓFF'
+ERROR 42000: Variable 'sql_safe_updates' can't be set to the value of 'ÓFF'
SET @@session.sql_safe_updates = '¹';
ERROR 42000: Variable 'sql_safe_updates' can't be set to the value of '¹'
SET @@session.sql_safe_updates = NO;
ERROR 42000: Variable 'sql_safe_updates' can't be set to the value of 'NO'
'#-------------------FN_DYNVARS_163_05----------------------------#'
-SET @@global.sql_safe_updates = 0;
-ERROR HY000: Variable 'sql_safe_updates' is a SESSION variable and can't be used with SET GLOBAL
+SET @@global.sql_safe_updates = 1-@@global.sql_safe_updates;
SELECT @@global.sql_safe_updates;
-ERROR HY000: Variable 'sql_safe_updates' is a SESSION variable
+@@global.sql_safe_updates
+1
+SET @@global.sql_safe_updates = 1-@@global.sql_safe_updates;
+SELECT @@global.sql_safe_updates;
+@@global.sql_safe_updates
+0
'#----------------------FN_DYNVARS_163_06------------------------#'
SELECT count(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@@ -78,12 +79,12 @@ IF(@@session.sql_safe_updates, "ON", "OFF") = VARIABLE_VALUE
1
SELECT @@session.sql_safe_updates;
@@session.sql_safe_updates
-0
+1
SELECT VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_safe_updates';
VARIABLE_VALUE
-OFF
+ON
'#---------------------FN_DYNVARS_163_08-------------------------#'
SET @@session.sql_safe_updates = OFF;
SELECT @@session.sql_safe_updates;
diff --git a/mysql-test/suite/sys_vars/r/sql_select_limit_basic.result b/mysql-test/suite/sys_vars/r/sql_select_limit_basic.result
new file mode 100644
index 00000000000..c601fa148ce
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/sql_select_limit_basic.result
@@ -0,0 +1,40 @@
+SET @start_global_value = @@global.sql_select_limit;
+SELECT @start_global_value;
+@start_global_value
+18446744073709551615
+select @@global.sql_select_limit;
+@@global.sql_select_limit
+18446744073709551615
+select @@session.sql_select_limit;
+@@session.sql_select_limit
+18446744073709551615
+show global variables like 'sql_select_limit';
+Variable_name Value
+sql_select_limit 18446744073709551615
+show session variables like 'sql_select_limit';
+Variable_name Value
+sql_select_limit 18446744073709551615
+select * from information_schema.global_variables where variable_name='sql_select_limit';
+VARIABLE_NAME VARIABLE_VALUE
+SQL_SELECT_LIMIT 18446744073709551615
+select * from information_schema.session_variables where variable_name='sql_select_limit';
+VARIABLE_NAME VARIABLE_VALUE
+SQL_SELECT_LIMIT 18446744073709551615
+set global sql_select_limit=10;
+select @@global.sql_select_limit;
+@@global.sql_select_limit
+10
+set session sql_select_limit=20;
+select @@session.sql_select_limit;
+@@session.sql_select_limit
+20
+set global sql_select_limit=1.1;
+ERROR 42000: Incorrect argument type to variable 'sql_select_limit'
+set global sql_select_limit=1e1;
+ERROR 42000: Incorrect argument type to variable 'sql_select_limit'
+set global sql_select_limit="foo";
+ERROR 42000: Incorrect argument type to variable 'sql_select_limit'
+SET @@global.sql_select_limit = @start_global_value;
+SELECT @@global.sql_select_limit;
+@@global.sql_select_limit
+18446744073709551615
diff --git a/mysql-test/suite/sys_vars/r/sql_slave_skip_counter_basic.result b/mysql-test/suite/sys_vars/r/sql_slave_skip_counter_basic.result
index 9ceef325483..2d709c486dd 100644
--- a/mysql-test/suite/sys_vars/r/sql_slave_skip_counter_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_slave_skip_counter_basic.result
@@ -1,20 +1,22 @@
'#--------------------FN_DYNVARS_165_01-------------------------#'
SET @start_global_value = @@global.sql_slave_skip_counter;
-ERROR HY000: Variable 'sql_slave_skip_counter' can only be set, not read
SELECT @@global.sql_slave_skip_counter;
-ERROR HY000: Variable 'sql_slave_skip_counter' can only be set, not read
-'Info:This value is write only. Value can not be read'
+@@global.sql_slave_skip_counter
+0
'#--------------------FN_DYNVARS_165_02-------------------------#'
SET @@global.sql_slave_skip_counter = DEFAULT;
-ERROR 42000: Variable 'sql_slave_skip_counter' doesn't have a default value
'#--------------------FN_DYNVARS_165_03-------------------------#'
SET @@global.sql_slave_skip_counter = 0;
SET @@global.sql_slave_skip_counter = 5;
SET @@global.sql_slave_skip_counter = 1024;
SET @@global.sql_slave_skip_counter = 2147483648;
SET @@global.sql_slave_skip_counter = 2147483648*2;
+Warnings:
+Warning 1292 Truncated incorrect sql_slave_skip_counter value: '4294967296'
SET @@global.sql_slave_skip_counter = 2147483648*2-1;
SET @@global.sql_slave_skip_counter = 4294967295*4294967295;
+Warnings:
+Warning 1292 Truncated incorrect sql_slave_skip_counter value: '-8589934591'
'#--------------------FN_DYNVARS_165_03-------------------------#'
SET @@global.sql_slave_skip_counter = '5';
ERROR 42000: Incorrect argument type to variable 'sql_slave_skip_counter'
@@ -30,7 +32,7 @@ SELECT VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_slave_skip_counter';
VARIABLE_VALUE
-
+1024
'#--------------------FN_DYNVARS_165_03-------------------------#'
SET @@sql_slave_skip_counter = 10;
ERROR HY000: Variable 'sql_slave_skip_counter' is a GLOBAL variable and should be set with SET GLOBAL
@@ -38,3 +40,4 @@ SET @@session.sql_slave_skip_counter = 12;
ERROR HY000: Variable 'sql_slave_skip_counter' is a GLOBAL variable and should be set with SET GLOBAL
SET @@local.sql_slave_skip_counter = 13;
ERROR HY000: Variable 'sql_slave_skip_counter' is a GLOBAL variable and should be set with SET GLOBAL
+SET @@global.sql_slave_skip_counter = 0;
diff --git a/mysql-test/suite/sys_vars/r/sql_warnings_basic.result b/mysql-test/suite/sys_vars/r/sql_warnings_basic.result
index cf39ef851d4..762182336c3 100644
--- a/mysql-test/suite/sys_vars/r/sql_warnings_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_warnings_basic.result
@@ -12,7 +12,7 @@ SET @@session.sql_warnings = 1;
SET @@session.sql_warnings = DEFAULT;
SELECT @@session.sql_warnings;
@@session.sql_warnings
-1
+0
'#---------------------FN_DYNVARS_166_02-------------------------#'
SET sql_warnings = 1;
SELECT @@sql_warnings;
@@ -36,34 +36,33 @@ SELECT @@session.sql_warnings;
@@session.sql_warnings
1
'#--------------------FN_DYNVARS_166_04-------------------------#'
-SET @@session.sql_warnings = -0.6;
-ERROR 42000: Variable 'sql_warnings' can't be set to the value of '-1'
-SET @@session.sql_warnings = 1.9;
-ERROR 42000: Variable 'sql_warnings' can't be set to the value of '2'
+SET @@session.sql_warnings = 0.6;
+ERROR 42000: Incorrect argument type to variable 'sql_warnings'
SET @@session.sql_warnings = "T";
ERROR 42000: Variable 'sql_warnings' can't be set to the value of 'T'
SET @@session.sql_warnings = "Y";
ERROR 42000: Variable 'sql_warnings' can't be set to the value of 'Y'
SET @@session.sql_warnings = TRÜE;
-ERROR 42000: Variable 'sql_warnings' can't be set to the value of 'TRÃœE'
+ERROR 42000: Variable 'sql_warnings' can't be set to the value of 'TRÜE'
SET @@session.sql_warnings = ÕN;
-ERROR 42000: Variable 'sql_warnings' can't be set to the value of 'ÕN'
+ERROR 42000: Variable 'sql_warnings' can't be set to the value of 'ÕN'
SET @@session.sql_warnings = OF;
-SELECT @@session.sql_warnings;
-@@session.sql_warnings
-0
-'Bug# 34828: OF is taken as OFF and a value of 0 is set.'
+ERROR 42000: Variable 'sql_warnings' can't be set to the value of 'OF'
SET @@session.sql_warnings = ÓFF;
-ERROR 42000: Variable 'sql_warnings' can't be set to the value of 'ÓFF'
+ERROR 42000: Variable 'sql_warnings' can't be set to the value of 'ÓFF'
SET @@session.sql_warnings = '¹';
ERROR 42000: Variable 'sql_warnings' can't be set to the value of '¹'
SET @@session.sql_warnings = NO;
ERROR 42000: Variable 'sql_warnings' can't be set to the value of 'NO'
'#-------------------FN_DYNVARS_166_05----------------------------#'
-SET @@global.sql_warnings = 0;
-ERROR HY000: Variable 'sql_warnings' is a SESSION variable and can't be used with SET GLOBAL
+SET @@global.sql_warnings = 1-@@global.sql_warnings;
SELECT @@global.sql_warnings;
-ERROR HY000: Variable 'sql_warnings' is a SESSION variable
+@@global.sql_warnings
+1
+SET @@global.sql_warnings = 1-@@global.sql_warnings;
+SELECT @@global.sql_warnings;
+@@global.sql_warnings
+0
'#----------------------FN_DYNVARS_166_06------------------------#'
SELECT count(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@@ -78,13 +77,12 @@ IF(@@session.sql_warnings, "ON", "OFF") = VARIABLE_VALUE
1
SELECT @@session.sql_warnings;
@@session.sql_warnings
-0
+1
SELECT VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_warnings';
VARIABLE_VALUE
-OFF
-'Bug: value in information schema does not match'
+ON
'#---------------------FN_DYNVARS_166_08-------------------------#'
SET @@session.sql_warnings = OFF;
SELECT @@session.sql_warnings;
diff --git a/mysql-test/suite/sys_vars/r/storage_engine_basic.result b/mysql-test/suite/sys_vars/r/storage_engine_basic.result
index 8d621ac5599..6af550c1f70 100644
--- a/mysql-test/suite/sys_vars/r/storage_engine_basic.result
+++ b/mysql-test/suite/sys_vars/r/storage_engine_basic.result
@@ -7,9 +7,8 @@ SELECT @start_session_value;
@start_session_value
MyISAM
'#--------------------FN_DYNVARS_005_01-------------------------#'
-SET @@global.storage_engine = MYISAM;
+SET @@global.storage_engine = INNODB;
SET @@global.storage_engine = DEFAULT;
-ERROR 42000: Variable 'storage_engine' doesn't have a default value
SELECT @@global.storage_engine;
@@global.storage_engine
MyISAM
@@ -55,16 +54,18 @@ InnoDB
'#------------------FN_DYNVARS_005_04-----------------------#'
SET @@global.storage_engine = 8199;
ERROR 42000: Incorrect argument type to variable 'storage_engine'
+SET @@global.storage_engine = NULL;
+ERROR 42000: Variable 'storage_engine' can't be set to the value of 'NULL'
SET @@global.storage_engine = -1024;
ERROR 42000: Incorrect argument type to variable 'storage_engine'
-SET @@global.storage_engine = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.storage_engine = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'storage_engine'
SET @@global.storage_engine = FILE;
ERROR 42000: Unknown table engine 'FILE'
SET @@session.storage_engine = 8199;
ERROR 42000: Incorrect argument type to variable 'storage_engine'
-SET @@session.storage_engine = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.storage_engine = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'storage_engine'
SET @@session.storage_engine = RECORD;
ERROR 42000: Unknown table engine 'RECORD'
'#------------------FN_DYNVARS_005_05-----------------------#'
@@ -105,6 +106,7 @@ SELECT session.storage_engine;
ERROR 42S02: Unknown table 'session' in field list
SELECT storage_engine = @@session.storage_engine;
ERROR 42S22: Unknown column 'storage_engine' in 'field list'
+SET @@storage_engine = @start_global_value;
SET @@global.storage_engine = @start_global_value;
SELECT @@global.storage_engine;
@@global.storage_engine
diff --git a/mysql-test/suite/sys_vars/r/sync_binlog_basic_32.result b/mysql-test/suite/sys_vars/r/sync_binlog_basic.result
index cae626ad63b..89f99fcbbee 100644
--- a/mysql-test/suite/sys_vars/r/sync_binlog_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/sync_binlog_basic.result
@@ -70,7 +70,6 @@ Warning 1292 Truncated incorrect sync_binlog value: '42949672950'
SELECT @@global.sync_binlog;
@@global.sync_binlog
4294967295
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@global.sync_binlog = ON;
ERROR 42000: Incorrect argument type to variable 'sync_binlog'
SELECT @@global.sync_binlog;
diff --git a/mysql-test/suite/sys_vars/r/sync_binlog_basic_64.result b/mysql-test/suite/sys_vars/r/sync_binlog_basic_64.result
deleted file mode 100644
index d3cc4e2a9c2..00000000000
--- a/mysql-test/suite/sys_vars/r/sync_binlog_basic_64.result
+++ /dev/null
@@ -1,109 +0,0 @@
-SET @start_value = @@global.sync_binlog;
-SELECT @start_value;
-@start_value
-0
-'#--------------------FN_DYNVARS_168_01------------------------#'
-SET @@global.sync_binlog = 99;
-SET @@global.sync_binlog = DEFAULT;
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-0
-'#---------------------FN_DYNVARS_168_02-------------------------#'
-SET @@global.sync_binlog = @start_value;
-SELECT @@global.sync_binlog = 0;
-@@global.sync_binlog = 0
-1
-'#--------------------FN_DYNVARS_168_03------------------------#'
-SET @@global.sync_binlog = 0;
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-0
-SET @@global.sync_binlog = 1;
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-1
-SET @@global.sync_binlog = 4294967295;
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-4294967295
-SET @@global.sync_binlog = 4294967294;
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-4294967294
-SET @@global.sync_binlog = 65536;
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-65536
-'#--------------------FN_DYNVARS_168_04-------------------------#'
-SET @@global.sync_binlog = -1;
-Warnings:
-Warning 1292 Truncated incorrect sync_binlog value: '-1'
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-0
-SET @@global.sync_binlog = 4294967296;
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-4294967296
-SET @@global.sync_binlog = 10240022115;
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-10240022115
-SET @@global.sync_binlog = 10000.01;
-ERROR 42000: Incorrect argument type to variable 'sync_binlog'
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-10240022115
-SET @@global.sync_binlog = -1024;
-Warnings:
-Warning 1292 Truncated incorrect sync_binlog value: '-1024'
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-0
-SET @@global.sync_binlog = 42949672950;
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-42949672950
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@global.sync_binlog = ON;
-ERROR 42000: Incorrect argument type to variable 'sync_binlog'
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-42949672950
-SET @@global.sync_binlog = 'test';
-ERROR 42000: Incorrect argument type to variable 'sync_binlog'
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-42949672950
-'#-------------------FN_DYNVARS_168_05----------------------------#'
-SET @@session.sync_binlog = 0;
-ERROR HY000: Variable 'sync_binlog' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@sync_binlog;
-@@sync_binlog
-42949672950
-'#----------------------FN_DYNVARS_168_06------------------------#'
-SELECT @@global.sync_binlog = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='sync_binlog';
-@@global.sync_binlog = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_168_07----------------------#'
-SET sync_binlog = 1;
-ERROR HY000: Variable 'sync_binlog' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@sync_binlog;
-@@sync_binlog
-42949672950
-SET local.sync_binlog = 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sync_binlog = 1' at line 1
-SELECT local.sync_binlog;
-ERROR 42S02: Unknown table 'local' in field list
-SET global.sync_binlog = 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sync_binlog = 1' at line 1
-SELECT global.sync_binlog;
-ERROR 42S02: Unknown table 'global' in field list
-SELECT sync_binlog = @@session.sync_binlog;
-ERROR 42S22: Unknown column 'sync_binlog' in 'field list'
-SET @@global.sync_binlog = @start_value;
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-0
diff --git a/mysql-test/suite/sys_vars/r/sync_master_info_basic.result b/mysql-test/suite/sys_vars/r/sync_master_info_basic.result
new file mode 100644
index 00000000000..47aafe21a59
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/sync_master_info_basic.result
@@ -0,0 +1,47 @@
+SET @start_global_value = @@global.sync_master_info;
+SELECT @start_global_value;
+@start_global_value
+0
+select @@global.sync_master_info;
+@@global.sync_master_info
+0
+select @@session.sync_master_info;
+ERROR HY000: Variable 'sync_master_info' is a GLOBAL variable
+show global variables like 'sync_master_info';
+Variable_name Value
+sync_master_info 0
+show session variables like 'sync_master_info';
+Variable_name Value
+sync_master_info 0
+select * from information_schema.global_variables where variable_name='sync_master_info';
+VARIABLE_NAME VARIABLE_VALUE
+SYNC_MASTER_INFO 0
+select * from information_schema.session_variables where variable_name='sync_master_info';
+VARIABLE_NAME VARIABLE_VALUE
+SYNC_MASTER_INFO 0
+set global sync_master_info=1;
+select @@global.sync_master_info;
+@@global.sync_master_info
+1
+set session sync_master_info=1;
+ERROR HY000: Variable 'sync_master_info' is a GLOBAL variable and should be set with SET GLOBAL
+set global sync_master_info=1.1;
+ERROR 42000: Incorrect argument type to variable 'sync_master_info'
+set global sync_master_info=1e1;
+ERROR 42000: Incorrect argument type to variable 'sync_master_info'
+set global sync_master_info="foo";
+ERROR 42000: Incorrect argument type to variable 'sync_master_info'
+set global sync_master_info=0;
+select @@global.sync_master_info;
+@@global.sync_master_info
+0
+set global sync_master_info=cast(-1 as unsigned int);
+Warnings:
+Warning 1292 Truncated incorrect sync_master_info value: '18446744073709551615'
+select @@global.sync_master_info;
+@@global.sync_master_info
+4294967295
+SET @@global.sync_master_info = @start_global_value;
+SELECT @@global.sync_master_info;
+@@global.sync_master_info
+0
diff --git a/mysql-test/suite/sys_vars/r/sync_relay_log_basic.result b/mysql-test/suite/sys_vars/r/sync_relay_log_basic.result
new file mode 100644
index 00000000000..75eac82f11e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/sync_relay_log_basic.result
@@ -0,0 +1,47 @@
+SET @start_global_value = @@global.sync_relay_log;
+SELECT @start_global_value;
+@start_global_value
+0
+select @@global.sync_relay_log;
+@@global.sync_relay_log
+0
+select @@session.sync_relay_log;
+ERROR HY000: Variable 'sync_relay_log' is a GLOBAL variable
+show global variables like 'sync_relay_log';
+Variable_name Value
+sync_relay_log 0
+show session variables like 'sync_relay_log';
+Variable_name Value
+sync_relay_log 0
+select * from information_schema.global_variables where variable_name='sync_relay_log';
+VARIABLE_NAME VARIABLE_VALUE
+SYNC_RELAY_LOG 0
+select * from information_schema.session_variables where variable_name='sync_relay_log';
+VARIABLE_NAME VARIABLE_VALUE
+SYNC_RELAY_LOG 0
+set global sync_relay_log=1;
+select @@global.sync_relay_log;
+@@global.sync_relay_log
+1
+set session sync_relay_log=1;
+ERROR HY000: Variable 'sync_relay_log' is a GLOBAL variable and should be set with SET GLOBAL
+set global sync_relay_log=1.1;
+ERROR 42000: Incorrect argument type to variable 'sync_relay_log'
+set global sync_relay_log=1e1;
+ERROR 42000: Incorrect argument type to variable 'sync_relay_log'
+set global sync_relay_log="foo";
+ERROR 42000: Incorrect argument type to variable 'sync_relay_log'
+set global sync_relay_log=0;
+select @@global.sync_relay_log;
+@@global.sync_relay_log
+0
+set global sync_relay_log=cast(-1 as unsigned int);
+Warnings:
+Warning 1292 Truncated incorrect sync_relay_log value: '18446744073709551615'
+select @@global.sync_relay_log;
+@@global.sync_relay_log
+4294967295
+SET @@global.sync_relay_log = @start_global_value;
+SELECT @@global.sync_relay_log;
+@@global.sync_relay_log
+0
diff --git a/mysql-test/suite/sys_vars/r/sync_relay_log_info_basic.result b/mysql-test/suite/sys_vars/r/sync_relay_log_info_basic.result
new file mode 100644
index 00000000000..fe0efdc0737
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/sync_relay_log_info_basic.result
@@ -0,0 +1,47 @@
+SET @start_global_value = @@global.sync_relay_log_info;
+SELECT @start_global_value;
+@start_global_value
+0
+select @@global.sync_relay_log_info;
+@@global.sync_relay_log_info
+0
+select @@session.sync_relay_log_info;
+ERROR HY000: Variable 'sync_relay_log_info' is a GLOBAL variable
+show global variables like 'sync_relay_log_info';
+Variable_name Value
+sync_relay_log_info 0
+show session variables like 'sync_relay_log_info';
+Variable_name Value
+sync_relay_log_info 0
+select * from information_schema.global_variables where variable_name='sync_relay_log_info';
+VARIABLE_NAME VARIABLE_VALUE
+SYNC_RELAY_LOG_INFO 0
+select * from information_schema.session_variables where variable_name='sync_relay_log_info';
+VARIABLE_NAME VARIABLE_VALUE
+SYNC_RELAY_LOG_INFO 0
+set global sync_relay_log_info=1;
+select @@global.sync_relay_log_info;
+@@global.sync_relay_log_info
+1
+set session sync_relay_log_info=1;
+ERROR HY000: Variable 'sync_relay_log_info' is a GLOBAL variable and should be set with SET GLOBAL
+set global sync_relay_log_info=1.1;
+ERROR 42000: Incorrect argument type to variable 'sync_relay_log_info'
+set global sync_relay_log_info=1e1;
+ERROR 42000: Incorrect argument type to variable 'sync_relay_log_info'
+set global sync_relay_log_info="foo";
+ERROR 42000: Incorrect argument type to variable 'sync_relay_log_info'
+set global sync_relay_log_info=0;
+select @@global.sync_relay_log_info;
+@@global.sync_relay_log_info
+0
+set global sync_relay_log_info=cast(-1 as unsigned int);
+Warnings:
+Warning 1292 Truncated incorrect sync_relay_log_info value: '18446744073709551615'
+select @@global.sync_relay_log_info;
+@@global.sync_relay_log_info
+4294967295
+SET @@global.sync_relay_log_info = @start_global_value;
+SELECT @@global.sync_relay_log_info;
+@@global.sync_relay_log_info
+0
diff --git a/mysql-test/suite/sys_vars/r/table_definition_cache_basic.result b/mysql-test/suite/sys_vars/r/table_definition_cache_basic.result
index 9e523f44d4b..0f5794aa329 100644
--- a/mysql-test/suite/sys_vars/r/table_definition_cache_basic.result
+++ b/mysql-test/suite/sys_vars/r/table_definition_cache_basic.result
@@ -61,7 +61,6 @@ Warning 1292 Truncated incorrect table_definition_cache value: '42949672950'
SELECT @@global.table_definition_cache;
@@global.table_definition_cache
524288
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@global.table_definition_cache = 21221204.10;
ERROR 42000: Incorrect argument type to variable 'table_definition_cache'
SET @@global.table_definition_cache = ON;
diff --git a/mysql-test/suite/sys_vars/r/table_lock_wait_timeout_basic.result b/mysql-test/suite/sys_vars/r/table_lock_wait_timeout_basic.result
index a500581c228..68c36242cc1 100644
--- a/mysql-test/suite/sys_vars/r/table_lock_wait_timeout_basic.result
+++ b/mysql-test/suite/sys_vars/r/table_lock_wait_timeout_basic.result
@@ -47,7 +47,6 @@ Warning 1292 Truncated incorrect table_lock_wait_timeout value: '-1024'
SET @@global.table_lock_wait_timeout= 0;
Warnings:
Warning 1292 Truncated incorrect table_lock_wait_timeout value: '0'
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@global.table_lock_wait_timeout= 10000.01;
ERROR 42000: Incorrect argument type to variable 'table_lock_wait_timeout'
SET @@global.table_lock_wait_timeout= ON;
diff --git a/mysql-test/suite/sys_vars/r/table_open_cache_basic.result b/mysql-test/suite/sys_vars/r/table_open_cache_basic.result
index da9b8c0d1aa..0b0c3230e5e 100644
--- a/mysql-test/suite/sys_vars/r/table_open_cache_basic.result
+++ b/mysql-test/suite/sys_vars/r/table_open_cache_basic.result
@@ -61,7 +61,6 @@ Warning 1292 Truncated incorrect table_open_cache value: '0'
SELECT @@global.table_open_cache ;
@@global.table_open_cache
1
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@global.table_open_cache = 10000.01;
ERROR 42000: Incorrect argument type to variable 'table_open_cache'
SET @@global.table_open_cache = ON;
diff --git a/mysql-test/suite/sys_vars/r/thread_cache_size_basic.result b/mysql-test/suite/sys_vars/r/thread_cache_size_basic.result
new file mode 100644
index 00000000000..1c802f1afdd
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/thread_cache_size_basic.result
@@ -0,0 +1,47 @@
+SET @start_global_value = @@global.thread_cache_size;
+SELECT @start_global_value;
+@start_global_value
+0
+select @@global.thread_cache_size;
+@@global.thread_cache_size
+0
+select @@session.thread_cache_size;
+ERROR HY000: Variable 'thread_cache_size' is a GLOBAL variable
+show global variables like 'thread_cache_size';
+Variable_name Value
+thread_cache_size 0
+show session variables like 'thread_cache_size';
+Variable_name Value
+thread_cache_size 0
+select * from information_schema.global_variables where variable_name='thread_cache_size';
+VARIABLE_NAME VARIABLE_VALUE
+THREAD_CACHE_SIZE 0
+select * from information_schema.session_variables where variable_name='thread_cache_size';
+VARIABLE_NAME VARIABLE_VALUE
+THREAD_CACHE_SIZE 0
+set global thread_cache_size=1;
+select @@global.thread_cache_size;
+@@global.thread_cache_size
+1
+set session thread_cache_size=1;
+ERROR HY000: Variable 'thread_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
+set global thread_cache_size=1.1;
+ERROR 42000: Incorrect argument type to variable 'thread_cache_size'
+set global thread_cache_size=1e1;
+ERROR 42000: Incorrect argument type to variable 'thread_cache_size'
+set global thread_cache_size="foo";
+ERROR 42000: Incorrect argument type to variable 'thread_cache_size'
+set global thread_cache_size=0;
+select @@global.thread_cache_size;
+@@global.thread_cache_size
+0
+set global thread_cache_size=cast(-1 as unsigned int);
+Warnings:
+Warning 1292 Truncated incorrect thread_cache_size value: '18446744073709551615'
+select @@global.thread_cache_size;
+@@global.thread_cache_size
+16384
+SET @@global.thread_cache_size = @start_global_value;
+SELECT @@global.thread_cache_size;
+@@global.thread_cache_size
+0
diff --git a/mysql-test/suite/sys_vars/r/thread_concurrency_basic.result b/mysql-test/suite/sys_vars/r/thread_concurrency_basic.result
new file mode 100644
index 00000000000..ea8c0168212
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/thread_concurrency_basic.result
@@ -0,0 +1,21 @@
+select @@global.thread_concurrency;
+@@global.thread_concurrency
+10
+select @@session.thread_concurrency;
+ERROR HY000: Variable 'thread_concurrency' is a GLOBAL variable
+show global variables like 'thread_concurrency';
+Variable_name Value
+thread_concurrency 10
+show session variables like 'thread_concurrency';
+Variable_name Value
+thread_concurrency 10
+select * from information_schema.global_variables where variable_name='thread_concurrency';
+VARIABLE_NAME VARIABLE_VALUE
+THREAD_CONCURRENCY 10
+select * from information_schema.session_variables where variable_name='thread_concurrency';
+VARIABLE_NAME VARIABLE_VALUE
+THREAD_CONCURRENCY 10
+set global thread_concurrency=1;
+ERROR HY000: Variable 'thread_concurrency' is a read only variable
+set session thread_concurrency=1;
+ERROR HY000: Variable 'thread_concurrency' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/thread_stack_basic.result b/mysql-test/suite/sys_vars/r/thread_stack_basic.result
new file mode 100644
index 00000000000..c9c458a28a9
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/thread_stack_basic.result
@@ -0,0 +1,21 @@
+select @@global.thread_stack;
+@@global.thread_stack
+262144
+select @@session.thread_stack;
+ERROR HY000: Variable 'thread_stack' is a GLOBAL variable
+show global variables like 'thread_stack';
+Variable_name Value
+thread_stack 262144
+show session variables like 'thread_stack';
+Variable_name Value
+thread_stack 262144
+select * from information_schema.global_variables where variable_name='thread_stack';
+VARIABLE_NAME VARIABLE_VALUE
+THREAD_STACK 262144
+select * from information_schema.session_variables where variable_name='thread_stack';
+VARIABLE_NAME VARIABLE_VALUE
+THREAD_STACK 262144
+set global thread_stack=1;
+ERROR HY000: Variable 'thread_stack' is a read only variable
+set session thread_stack=1;
+ERROR HY000: Variable 'thread_stack' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/time_format_basic.result b/mysql-test/suite/sys_vars/r/time_format_basic.result
new file mode 100644
index 00000000000..fcc23608d39
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/time_format_basic.result
@@ -0,0 +1,21 @@
+select @@global.time_format;
+@@global.time_format
+%H:%i:%s
+select @@session.time_format;
+ERROR HY000: Variable 'time_format' is a GLOBAL variable
+show global variables like 'time_format';
+Variable_name Value
+time_format %H:%i:%s
+show session variables like 'time_format';
+Variable_name Value
+time_format %H:%i:%s
+select * from information_schema.global_variables where variable_name='time_format';
+VARIABLE_NAME VARIABLE_VALUE
+TIME_FORMAT %H:%i:%s
+select * from information_schema.session_variables where variable_name='time_format';
+VARIABLE_NAME VARIABLE_VALUE
+TIME_FORMAT %H:%i:%s
+set global time_format=1;
+ERROR HY000: Variable 'time_format' is a read only variable
+set session time_format=1;
+ERROR HY000: Variable 'time_format' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/timestamp_basic_32.result b/mysql-test/suite/sys_vars/r/timestamp_basic.result
index a8be2201e68..a73de543815 100644
--- a/mysql-test/suite/sys_vars/r/timestamp_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/timestamp_basic.result
@@ -1,25 +1,24 @@
SET @session_start_value = @@session.timestamp;
'#--------------------FN_DYNVARS_001_01------------------------#'
SET @@timestamp = DEFAULT;
-'timestamp does not have any DEFAULT value'
+SELECT @@timestamp = UNIX_TIMESTAMP();
+@@timestamp = UNIX_TIMESTAMP()
+1
'#---------------------FN_DYNVARS_001_02-------------------------#'
SET @@global.timestamp = "1000";
ERROR HY000: Variable 'timestamp' is a SESSION variable and can't be used with SET GLOBAL
'#--------------------FN_DYNVARS_001_03------------------------#'
SET @@timestamp = 0;
+SELECT @@timestamp = UNIX_TIMESTAMP();
+@@timestamp = UNIX_TIMESTAMP()
+1
'Setting 0 resets timestamp to session default timestamp'
-SET @@timestamp = 123456789123456;
-SELECT @@timestamp;
-@@timestamp
-2249167232
-SET @@timestamp = 60*60*60*60*365;
-SELECT @@timestamp;
-@@timestamp
-435432704
SET @@timestamp = -1000000000;
-SELECT @@timestamp;
-@@timestamp
-3294967296
+Warnings:
+Warning 1292 Truncated incorrect timestamp value: '-1000000000'
+SELECT @@timestamp = UNIX_TIMESTAMP();
+@@timestamp = UNIX_TIMESTAMP()
+1
SET @temp_ts = @@timestamp - @@timestamp;
SELECT @temp_ts;
@temp_ts
@@ -27,7 +26,6 @@ SELECT @temp_ts;
'#--------------------FN_DYNVARS_001_04-------------------------#'
SET @@timestamp = "100";
ERROR 42000: Incorrect argument type to variable 'timestamp'
-'Bug# 34836: Documentation says its a string variable but infact its numeric'
SET @@timestamp = " ";
ERROR 42000: Incorrect argument type to variable 'timestamp'
SET @@timestamp = 1.1;
diff --git a/mysql-test/suite/sys_vars/r/timestamp_basic_64.result b/mysql-test/suite/sys_vars/r/timestamp_basic_64.result
deleted file mode 100644
index 824a3ea5529..00000000000
--- a/mysql-test/suite/sys_vars/r/timestamp_basic_64.result
+++ /dev/null
@@ -1,68 +0,0 @@
-SET @session_start_value = @@session.timestamp;
-'#--------------------FN_DYNVARS_001_01------------------------#'
-SET @@timestamp = DEFAULT;
-'timestamp does not have any DEFAULT value'
-'#---------------------FN_DYNVARS_001_02-------------------------#'
-SET @@global.timestamp = "1000";
-ERROR HY000: Variable 'timestamp' is a SESSION variable and can't be used with SET GLOBAL
-'#--------------------FN_DYNVARS_001_03------------------------#'
-SET @@timestamp = 0;
-'Setting 0 resets timestamp to session default timestamp'
-SET @@timestamp = 123456789123456;
-SELECT @@timestamp;
-@@timestamp
-123456789123456
-SET @@timestamp = 60*60*60*60*365;
-SELECT @@timestamp;
-@@timestamp
-4730400000
-SET @@timestamp = -1000000000;
-SELECT @@timestamp;
-@@timestamp
-18446744072709551616
-SET @temp_ts = @@timestamp - @@timestamp;
-SELECT @temp_ts;
-@temp_ts
-0
-'#--------------------FN_DYNVARS_001_04-------------------------#'
-SET @@timestamp = "100";
-ERROR 42000: Incorrect argument type to variable 'timestamp'
-'Bug# 34836: Documentation says its a string variable but infact its numeric'
-SET @@timestamp = " ";
-ERROR 42000: Incorrect argument type to variable 'timestamp'
-SET @@timestamp = 1.1;
-ERROR 42000: Incorrect argument type to variable 'timestamp'
-SET @@timestamp = 9999999999999999999999;
-ERROR 42000: Incorrect argument type to variable 'timestamp'
-'#----------------------FN_DYNVARS_001_06------------------------#'
-'#---------------------FN_DYNVARS_001_08-------------------------#'
-SET @@timestamp = OFF;
-ERROR 42000: Incorrect argument type to variable 'timestamp'
-SET @@timestamp = ON;
-ERROR 42000: Incorrect argument type to variable 'timestamp'
-SET @@timestamp = TRUE;
-SELECT @@timestamp;
-@@timestamp
-1
-SET @@timestamp = FALSE;
-'#---------------------FN_DYNVARS_001_10----------------------#'
-SET @@timestamp = 123456;
-SELECT @@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp;
-@@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp
-1
-SET @@timestamp = 654321;
-SELECT @@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp;
-@@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp
-1
-'#---------------------FN_DYNVARS_001_11----------------------#'
-SET timestamp = 1;
-SELECT @@timestamp;
-@@timestamp
-1
-SELECT local.timestamp;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.timestamp;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT timestamp = @@session.timestamp;
-ERROR 42S22: Unknown column 'timestamp' in 'field list'
-SET @@timestamp = @session_start_value;
diff --git a/mysql-test/suite/sys_vars/r/tmp_table_size_basic.result b/mysql-test/suite/sys_vars/r/tmp_table_size_basic.result
index 2ebeb8d61d8..06b624ad5c8 100644
--- a/mysql-test/suite/sys_vars/r/tmp_table_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/tmp_table_size_basic.result
@@ -100,8 +100,6 @@ SELECT @@session.tmp_table_size;
SET @@session.tmp_table_size = "Test";
ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
SET @@session.tmp_table_size = 12345678901;
-Warnings:
-Warning 1292 Truncated incorrect tmp_table_size value: '12345678901'
SELECT @@session.tmp_table_size IN (12345678901,4294967295);
@@session.tmp_table_size IN (12345678901,4294967295)
1
diff --git a/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_32.result b/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_32.result
index 8c6a788862d..a7afc334ba1 100644
--- a/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_32.result
@@ -36,6 +36,8 @@ SELECT @@global.transaction_alloc_block_size;
@@global.transaction_alloc_block_size
1024
SET @@global.transaction_alloc_block_size = 60020;
+Warnings:
+Warning 1292 Truncated incorrect transaction_alloc_block_size value: '60020'
SELECT @@global.transaction_alloc_block_size;
@@global.transaction_alloc_block_size
59392
@@ -45,7 +47,6 @@ Warning 1292 Truncated incorrect transaction_alloc_block_size value: '4294967295
SELECT @@global.transaction_alloc_block_size;
@@global.transaction_alloc_block_size
4294966272
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
'#--------------------FN_DYNVARS_005_04-------------------------#'
SET @@session.transaction_alloc_block_size = 1024;
SELECT @@session.transaction_alloc_block_size;
@@ -58,10 +59,11 @@ SELECT @@session.transaction_alloc_block_size;
@@session.transaction_alloc_block_size
4294966272
SET @@session.transaction_alloc_block_size = 65535;
+Warnings:
+Warning 1292 Truncated incorrect transaction_alloc_block_size value: '65535'
SELECT @@session.transaction_alloc_block_size;
@@session.transaction_alloc_block_size
64512
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
'#------------------FN_DYNVARS_005_05-----------------------#'
SET @@global.transaction_alloc_block_size = 0;
Warnings:
@@ -81,7 +83,6 @@ Warning 1292 Truncated incorrect transaction_alloc_block_size value: '1234567892
SELECT @@global.transaction_alloc_block_size;
@@global.transaction_alloc_block_size
4294966272
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@global.transaction_alloc_block_size = ON;
ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
SET @@global.transaction_alloc_block_size = OFF;
@@ -114,7 +115,6 @@ Warning 1292 Truncated incorrect transaction_alloc_block_size value: '1234567890
SELECT @@session.transaction_alloc_block_size;
@@session.transaction_alloc_block_size
4294966272
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@session.transaction_alloc_block_size = ON;
ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
SET @@session.transaction_alloc_block_size = OFF;
@@ -167,6 +167,8 @@ SELECT @@local.transaction_alloc_block_size = @@session.transaction_alloc_block_
1
'#---------------------FN_DYNVARS_001_10----------------------#'
SET transaction_alloc_block_size = 1027;
+Warnings:
+Warning 1292 Truncated incorrect transaction_alloc_block_size value: '1027'
SELECT @@transaction_alloc_block_size;
@@transaction_alloc_block_size
1024
diff --git a/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_64.result b/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_64.result
index 749df56c60b..3c958439231 100644
--- a/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_64.result
+++ b/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_64.result
@@ -36,28 +36,34 @@ SELECT @@global.transaction_alloc_block_size;
@@global.transaction_alloc_block_size
1024
SET @@global.transaction_alloc_block_size = 60020;
+Warnings:
+Warning 1292 Truncated incorrect transaction_alloc_block_size value: '60020'
SELECT @@global.transaction_alloc_block_size;
@@global.transaction_alloc_block_size
59392
SET @@global.transaction_alloc_block_size = 4294967295;
+Warnings:
+Warning 1292 Truncated incorrect transaction_alloc_block_size value: '4294967295'
SELECT @@global.transaction_alloc_block_size;
@@global.transaction_alloc_block_size
4294966272
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
'#--------------------FN_DYNVARS_005_04-------------------------#'
SET @@session.transaction_alloc_block_size = 1024;
SELECT @@session.transaction_alloc_block_size;
@@session.transaction_alloc_block_size
1024
SET @@session.transaction_alloc_block_size =4294967295;
+Warnings:
+Warning 1292 Truncated incorrect transaction_alloc_block_size value: '4294967295'
SELECT @@session.transaction_alloc_block_size;
@@session.transaction_alloc_block_size
4294966272
SET @@session.transaction_alloc_block_size = 65535;
+Warnings:
+Warning 1292 Truncated incorrect transaction_alloc_block_size value: '65535'
SELECT @@session.transaction_alloc_block_size;
@@session.transaction_alloc_block_size
64512
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
'#------------------FN_DYNVARS_005_05-----------------------#'
SET @@global.transaction_alloc_block_size = 0;
Warnings:
@@ -72,10 +78,11 @@ SELECT @@global.transaction_alloc_block_size;
@@global.transaction_alloc_block_size
1024
SET @@global.transaction_alloc_block_size = 123456789201;
+Warnings:
+Warning 1292 Truncated incorrect transaction_alloc_block_size value: '123456789201'
SELECT @@global.transaction_alloc_block_size;
@@global.transaction_alloc_block_size
123456788480
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@global.transaction_alloc_block_size = ON;
ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
SET @@global.transaction_alloc_block_size = OFF;
@@ -103,10 +110,11 @@ SELECT @@global.transaction_alloc_block_size;
@@global.transaction_alloc_block_size
1024
SET @@session.transaction_alloc_block_size = 12345678901;
+Warnings:
+Warning 1292 Truncated incorrect transaction_alloc_block_size value: '12345678901'
SELECT @@session.transaction_alloc_block_size;
@@session.transaction_alloc_block_size
12345678848
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@session.transaction_alloc_block_size = ON;
ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
SET @@session.transaction_alloc_block_size = OFF;
@@ -142,6 +150,8 @@ WHERE VARIABLE_NAME='transaction_alloc_block_size';
'#---------------------FN_DYNVARS_001_08----------------------#'
SET @@transaction_alloc_block_size = 1024;
SET @@global.transaction_alloc_block_size = 4294967295;
+Warnings:
+Warning 1292 Truncated incorrect transaction_alloc_block_size value: '4294967295'
SELECT @@transaction_alloc_block_size = @@global.transaction_alloc_block_size;
@@transaction_alloc_block_size = @@global.transaction_alloc_block_size
0
@@ -157,6 +167,8 @@ SELECT @@local.transaction_alloc_block_size = @@session.transaction_alloc_block_
1
'#---------------------FN_DYNVARS_001_10----------------------#'
SET transaction_alloc_block_size = 1027;
+Warnings:
+Warning 1292 Truncated incorrect transaction_alloc_block_size value: '1027'
SELECT @@transaction_alloc_block_size;
@@transaction_alloc_block_size
1024
diff --git a/mysql-test/suite/sys_vars/r/tx_isolation_basic.result b/mysql-test/suite/sys_vars/r/tx_isolation_basic.result
index d487a6d92a8..b784d6bb180 100644
--- a/mysql-test/suite/sys_vars/r/tx_isolation_basic.result
+++ b/mysql-test/suite/sys_vars/r/tx_isolation_basic.result
@@ -9,16 +9,13 @@ REPEATABLE-READ
'#--------------------FN_DYNVARS_183_01------------------------#'
SET @@global.tx_isolation = 'READ-UNCOMMITTED';
SET @@global.tx_isolation = DEFAULT;
-ERROR 42000: Variable 'tx_isolation' doesn't have a default value
-'Bug# 34878: Documentation specifies a DEFAULT value of REPEATABLE-READ';
-'where as DEFAULT is not supported here.';
-SET @@session.tx_isolation = 'SERIALIZABLE';
+SELECT @@global.tx_isolation;
+@@global.tx_isolation
+REPEATABLE-READ
SET @@session.tx_isolation = DEFAULT;
SELECT @@session.tx_isolation;
@@session.tx_isolation
-READ-UNCOMMITTED
-'Bug# 34876: Documentation specifies a DEFAULT value of REPEATABLE-READ';
-'where as DEFAULT here as no effect.';
+REPEATABLE-READ
'#---------------------FN_DYNVARS_183_02-------------------------#'
SET @@global.tx_isolation = NULL;
ERROR 42000: Variable 'tx_isolation' can't be set to the value of 'NULL'
@@ -67,10 +64,7 @@ ERROR 42000: Variable 'tx_isolation' can't be set to the value of '-1'
SET @@global.tx_isolation = READUNCOMMITTED;
ERROR 42000: Variable 'tx_isolation' can't be set to the value of 'READUNCOMMITTED'
SET @@global.tx_isolation = 'REPEATABLE';
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-'Bug# 34833: REPEATABLE is not documented as as valid tx_isolation level'
+ERROR 42000: Variable 'tx_isolation' can't be set to the value of 'REPEATABLE'
SET @@global.tx_isolation = OFF;
ERROR 42000: Variable 'tx_isolation' can't be set to the value of 'OFF'
SET @@global.tx_isolation = ON;
@@ -82,10 +76,7 @@ ERROR 42000: Variable 'tx_isolation' can't be set to the value of '-1'
SET @@tx_isolation = READUNCOMMITTED;
ERROR 42000: Variable 'tx_isolation' can't be set to the value of 'READUNCOMMITTED'
SET @@tx_isolation = 'REPEATABLE';
-SELECT @@tx_isolation;
-@@tx_isolation
-REPEATABLE-READ
-'Bug# 34833: REPEATABLE is not documented as as valid tx_isolation level'
+ERROR 42000: Variable 'tx_isolation' can't be set to the value of 'REPEATABLE'
SET @@tx_isolation = 'NONE';
ERROR 42000: Variable 'tx_isolation' can't be set to the value of 'NONE'
SET @@tx_isolation = 'ALL';
@@ -120,29 +111,7 @@ SELECT @@global.tx_isolation;
@@global.tx_isolation
SERIALIZABLE
SET @@global.tx_isolation = 0.4;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-READ-UNCOMMITTED
-SET @@global.tx_isolation = 1.1;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-READ-COMMITTED
-SET @@global.tx_isolation = 1.5;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-SET @@global.tx_isolation = 2.9;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-SERIALIZABLE
-SET @@session.tx_isolation = 3.49;
-SELECT @@session.tx_isolation;
-@@session.tx_isolation
-SERIALIZABLE
-SET @@session.tx_isolation = 3.6;
-ERROR 42000: Variable 'tx_isolation' can't be set to the value of '4'
-'Bug: Decimal values can be used within the range [0.0-3.5).';
-'Values are rounded to 0,1,2,3 as evident from outcome.';
+ERROR 42000: Incorrect argument type to variable 'tx_isolation'
'#---------------------FN_DYNVARS_183_08----------------------#'
SET @@global.tx_isolation = TRUE;
SELECT @@global.tx_isolation;
diff --git a/mysql-test/suite/sys_vars/r/unique_checks_basic.result b/mysql-test/suite/sys_vars/r/unique_checks_basic.result
index 50ca7317490..60cf2795309 100644
--- a/mysql-test/suite/sys_vars/r/unique_checks_basic.result
+++ b/mysql-test/suite/sys_vars/r/unique_checks_basic.result
@@ -7,12 +7,7 @@ SET @@session.unique_checks= 1;
SET @@session.unique_checks= DEFAULT;
SELECT @@session.unique_checks;
@@session.unique_checks
-1
-'#--------------------FN_DYNVARS_005_02-------------------------#'
-SET @@session.unique_checks = DEFAULT;
-SELECT @@session.unique_checks =1;
-@@session.unique_checks =1
-1
+0
'#--------------------FN_DYNVARS_005_04-------------------------#'
SET @@session.unique_checks =1;
SELECT @@session.unique_checks;
diff --git a/mysql-test/suite/sys_vars/r/updatable_views_with_limit_basic.result b/mysql-test/suite/sys_vars/r/updatable_views_with_limit_basic.result
index e2eebbd7a2c..fb31ae7f10a 100644
--- a/mysql-test/suite/sys_vars/r/updatable_views_with_limit_basic.result
+++ b/mysql-test/suite/sys_vars/r/updatable_views_with_limit_basic.result
@@ -118,7 +118,7 @@ ERROR 42000: Variable 'updatable_views_with_limit' can't be set to the value of
SET @@global.updatable_views_with_limit = "FALSE";
ERROR 42000: Variable 'updatable_views_with_limit' can't be set to the value of 'FALSE'
SET @@global.updatable_views_with_limit = 65530.34;
-ERROR 42000: Variable 'updatable_views_with_limit' can't be set to the value of '65530'
+ERROR 42000: Incorrect argument type to variable 'updatable_views_with_limit'
SET @@global.updatable_views_with_limit ="Testing";
ERROR 42000: Variable 'updatable_views_with_limit' can't be set to the value of 'Testing'
SET @@session.updatable_views_with_limit = "ON";
diff --git a/mysql-test/suite/sys_vars/r/wait_timeout_basic_32.result b/mysql-test/suite/sys_vars/r/wait_timeout_basic.result
index c9bffc61b6f..6dc99dcd5e3 100644
--- a/mysql-test/suite/sys_vars/r/wait_timeout_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/wait_timeout_basic.result
@@ -45,7 +45,6 @@ Warning 1292 Truncated incorrect wait_timeout value: '0'
SET @@global.wait_timeout = -1024;
Warnings:
Warning 1292 Truncated incorrect wait_timeout value: '-1024'
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@global.wait_timeout = ON;
ERROR 42000: Incorrect argument type to variable 'wait_timeout'
SET @@global.wait_timeout = OFF;
diff --git a/mysql-test/suite/sys_vars/r/wait_timeout_basic_64.result b/mysql-test/suite/sys_vars/r/wait_timeout_basic_64.result
deleted file mode 100644
index c9bffc61b6f..00000000000
--- a/mysql-test/suite/sys_vars/r/wait_timeout_basic_64.result
+++ /dev/null
@@ -1,129 +0,0 @@
-SET @start_global_value = @@global.wait_timeout;
-SET @start_session_value = @@session.wait_timeout;
-'#--------------------FN_DYNVARS_005_01-------------------------#'
-SET @@global.wait_timeout = 100;
-SET @@global.wait_timeout = DEFAULT;
-SELECT @@global.wait_timeout;
-@@global.wait_timeout
-28800
-SET @@session.wait_timeout = 200;
-SET @@session.wait_timeout = DEFAULT;
-SELECT @@session.wait_timeout;
-@@session.wait_timeout
-28800
-'#--------------------FN_DYNVARS_005_02-------------------------#'
-SET @@global.wait_timeout = DEFAULT;
-SELECT @@global.wait_timeout = @default_wait_timeout;
-@@global.wait_timeout = @default_wait_timeout
-1
-SET @@session.wait_timeout = DEFAULT;
-SELECT @@session.wait_timeout = @default_wait_timeout;
-@@session.wait_timeout = @default_wait_timeout
-1
-'#--------------------FN_DYNVARS_005_03-------------------------#'
-SET @@global.wait_timeout= 1;
-SELECT @@global.wait_timeout;
-@@global.wait_timeout
-1
-SET @@global.wait_timeout = 60020;
-SELECT @@global.wait_timeout;
-@@global.wait_timeout
-60020
-SET @@global.wait_timeout = 31536000;
-SELECT @@global.wait_timeout = @max_wait_timeout;
-@@global.wait_timeout = @max_wait_timeout
-1
-'#--------------------FN_DYNVARS_005_04-------------------------#'
-SET @@session.wait_timeout =6000;
-SELECT @@session.wait_timeout;
-@@session.wait_timeout
-6000
-'#------------------FN_DYNVARS_005_05-----------------------#'
-SET @@global.wait_timeout = 0;
-Warnings:
-Warning 1292 Truncated incorrect wait_timeout value: '0'
-SET @@global.wait_timeout = -1024;
-Warnings:
-Warning 1292 Truncated incorrect wait_timeout value: '-1024'
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@global.wait_timeout = ON;
-ERROR 42000: Incorrect argument type to variable 'wait_timeout'
-SET @@global.wait_timeout = OFF;
-ERROR 42000: Incorrect argument type to variable 'wait_timeout'
-SET @@global.wait_timeout = True;
-SELECT @@global.wait_timeout;
-@@global.wait_timeout
-1
-SET @@global.wait_timeout = False;
-Warnings:
-Warning 1292 Truncated incorrect wait_timeout value: '0'
-SELECT @@global.wait_timeout;
-@@global.wait_timeout
-1
-SET @@global.wait_timeout = 65530.34;
-ERROR 42000: Incorrect argument type to variable 'wait_timeout'
-SET @@global.wait_timeout ="Test";
-ERROR 42000: Incorrect argument type to variable 'wait_timeout'
-SET @@session.wait_timeout = ON;
-ERROR 42000: Incorrect argument type to variable 'wait_timeout'
-SET @@session.wait_timeout = OFF;
-ERROR 42000: Incorrect argument type to variable 'wait_timeout'
-SET @@session.wait_timeout = True;
-SELECT @@session.wait_timeout;
-@@session.wait_timeout
-1
-SET @@session.wait_timeout = False;
-Warnings:
-Warning 1292 Truncated incorrect wait_timeout value: '0'
-SELECT @@session.wait_timeout;
-@@session.wait_timeout
-1
-SET @@session.wait_timeout = "Test";
-ERROR 42000: Incorrect argument type to variable 'wait_timeout'
-SET @@session.wait_timeout = 'test';
-ERROR 42000: Incorrect argument type to variable 'wait_timeout'
-SET @@session.wait_timeout = 123456789031;
-Warnings:
-Warning 1292 Truncated incorrect wait_timeout value: '123456789031'
-SELECT @@session.wait_timeout = @max_wait_timeout;
-@@session.wait_timeout = @max_wait_timeout
-1
-'#------------------FN_DYNVARS_005_06-----------------------#'
-SELECT @@global.wait_timeout = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='wait_timeout';
-@@global.wait_timeout = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_005_07-----------------------#'
-SELECT @@session.wait_timeout = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='wait_timeout';
-@@session.wait_timeout = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_001_09----------------------#'
-SET @@global.wait_timeout = 30000;
-SET @@global.wait_timeout = 40000;
-SELECT @@wait_timeout = @@global.wait_timeout;
-@@wait_timeout = @@global.wait_timeout
-0
-'#---------------------FN_DYNVARS_001_10----------------------#'
-SET @@wait_timeout = 100;
-SELECT @@wait_timeout = @@local.wait_timeout;
-@@wait_timeout = @@local.wait_timeout
-1
-SELECT @@local.wait_timeout = @@session.wait_timeout;
-@@local.wait_timeout = @@session.wait_timeout
-1
-'#---------------------FN_DYNVARS_001_11----------------------#'
-SET wait_timeout = 1027;
-SELECT @@wait_timeout;
-@@wait_timeout
-1027
-SELECT local.wait_timeout;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.wait_timeout;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT wait_timeout = @@session.wait_timeout;
-ERROR 42S22: Unknown column 'wait_timeout' in 'field list'
-SET @@global.wait_timeout = @start_global_value;
-SET @@session.wait_timeout = @start_session_value;
diff --git a/mysql-test/suite/sys_vars/t/all_vars.test b/mysql-test/suite/sys_vars/t/all_vars.test
new file mode 100644
index 00000000000..c6c228d842f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/all_vars.test
@@ -0,0 +1,35 @@
+--source include/not_embedded.inc
+
+#
+# This test verifies that *all* system variables are tested
+# by the sys_vars suite. For every system variable
+# there must be a <variable_name>_basic.test file.
+#
+
+#
+# we can diff in perl or in sql, as it's my_SQL_test suite, do it in sql
+#
+
+perl;
+ use File::Basename;
+ my $dirname=dirname($ENV{MYSQLTEST_FILE});
+ my @all_tests=<$dirname/*_basic{,_32,_64}.test>;
+ open(F, '>', "$ENV{MYSQLTEST_VARDIR}/tmp/sys_vars.all_vars.txt") or die;
+ binmode F;
+ print F join "\n", sort map { s/_basic(_32|_64)?\.test$//; basename $_ } @all_tests;
+EOF
+
+create table t1 (test_name text);
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval load data infile "$MYSQLTEST_VARDIR/tmp/sys_vars.all_vars.txt" into table t1;
+
+select variable_name as `There should be *no* variables listed below:`
+ from information_schema.global_variables
+ left join t1 on variable_name=test_name where
+ test_name is null
+ union
+select variable_name from information_schema.session_variables
+ left join t1 on variable_name=test_name where
+ test_name is null;
+
+drop table t1;
diff --git a/mysql-test/suite/sys_vars/t/auto_increment_increment_basic.test b/mysql-test/suite/sys_vars/t/auto_increment_increment_basic.test
index 4acfb8f503b..d76880b149e 100644
--- a/mysql-test/suite/sys_vars/t/auto_increment_increment_basic.test
+++ b/mysql-test/suite/sys_vars/t/auto_increment_increment_basic.test
@@ -103,8 +103,8 @@ SET @@global.auto_increment_increment = -1024;
SELECT @@global.auto_increment_increment;
SET @@global.auto_increment_increment = 65536;
SELECT @@global.auto_increment_increment;
---Error ER_PARSE_ERROR
-SET @@global.auto_increment_increment = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.auto_increment_increment = 65530.34;
SELECT @@global.auto_increment_increment;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.auto_increment_increment = test;
@@ -114,11 +114,10 @@ SET @@session.auto_increment_increment = 0;
SELECT @@session.auto_increment_increment;
SET @@session.auto_increment_increment = -2;
SELECT @@session.auto_increment_increment;
---Error ER_PARSE_ERROR
-SET @@session.auto_increment_increment = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.auto_increment_increment = 65530.34;
SET @@session.auto_increment_increment = 65550;
SELECT @@session.auto_increment_increment;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.auto_increment_increment = test;
diff --git a/mysql-test/suite/sys_vars/t/auto_increment_increment_func.test b/mysql-test/suite/sys_vars/t/auto_increment_increment_func.test
index 7822775fb35..51c32669934 100644
--- a/mysql-test/suite/sys_vars/t/auto_increment_increment_func.test
+++ b/mysql-test/suite/sys_vars/t/auto_increment_increment_func.test
@@ -119,8 +119,6 @@ SELECT @@session.auto_increment_increment = 20;
SET @@session.auto_increment_increment = 5;
INSERT into t1(name) values('Record_10');
SELECT * from t1;
---echo 'Bug#35362: Here Record_10 id should be 120 instead of 115 because we'
---echo 'have set the value of variable to 5'
SET @@session.auto_increment_increment = 1;
SELECT @@auto_increment_increment;
@@ -176,9 +174,6 @@ INSERT into t1(name) values('Record_17');
INSERT into t1(name) values('Record_18');
SELECT * from t1;
---echo 'Bug#35364: Variable is incrementing some random values on assigning -ve value'
-
-
############################################################
# Disconnecting all connection & dropping table #
############################################################
diff --git a/mysql-test/suite/sys_vars/t/auto_increment_offset_basic.test b/mysql-test/suite/sys_vars/t/auto_increment_offset_basic.test
index a98fd6467ad..76261645b30 100644
--- a/mysql-test/suite/sys_vars/t/auto_increment_offset_basic.test
+++ b/mysql-test/suite/sys_vars/t/auto_increment_offset_basic.test
@@ -117,7 +117,6 @@ SET @@session.auto_increment_offset = -2;
SELECT @@session.auto_increment_offset;
SET @@session.auto_increment_offset = 65550;
SELECT @@session.auto_increment_offset;
-echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.auto_increment_offset = ON;
diff --git a/mysql-test/suite/sys_vars/t/auto_increment_offset_func.test b/mysql-test/suite/sys_vars/t/auto_increment_offset_func.test
index 7e1668452cc..0ac96255acf 100644
--- a/mysql-test/suite/sys_vars/t/auto_increment_offset_func.test
+++ b/mysql-test/suite/sys_vars/t/auto_increment_offset_func.test
@@ -111,8 +111,6 @@ SELECT * from t1;
--echo ## Setting value of variable less than last insert id ##
SET @@session.auto_increment_offset = 5;
INSERT into t1(name) values('Record_9');
---echo 'Bug#35367: Random value of id is increasing on assigning value to';
---echo 'variable that is less than current offset';
INSERT into t1(name) values('Record_10');
INSERT into t1(name) values('Record_11');
INSERT into t1(name) values('Record_12');
@@ -133,9 +131,6 @@ SET @@auto_increment_increment = 10;
INSERT into t1(name) values('Record_13');
INSERT into t1(name) values('Record_14');
SELECT * from t1;
---echo 'Bug#35369: Some invalid value of id is increasing on assigning value to';
---echo 'variable that is greater than auto_increment_increment';
-
--echo '#--------------------FN_DYNVARS_002_06-------------------------#'
###############################################################################
@@ -165,8 +160,6 @@ SELECT @@auto_increment_offset = -10;
INSERT into t1(name) values('Record_17');
INSERT into t1(name) values('Record_18');
SELECT * from t1;
---echo 'Bug#35370: Some invalid value of id is increasing on assigning negative';
---echo ' value in variable';
--echo ## Assigning value that is out of range of variable ##
SET @@auto_increment_offset = 65536;
diff --git a/mysql-test/suite/sys_vars/t/auto_commit_basic.test b/mysql-test/suite/sys_vars/t/autocommit_basic.test
index b899c273093..fa6654ae37c 100644
--- a/mysql-test/suite/sys_vars/t/auto_commit_basic.test
+++ b/mysql-test/suite/sys_vars/t/autocommit_basic.test
@@ -33,7 +33,7 @@
# Saving initial value of autocommit in a temporary variable #
########################################################################
-SET @start_value = @@autocommit;
+SET @start_value = @@global.autocommit;
SELECT @start_value;
@@ -45,7 +45,6 @@ SELECT @start_value;
SET @@autocommit = 0;
SET @@autocommit = DEFAULT;
SELECT @@autocommit;
-echo 'Bug: variable DEFAULT value not working and is not throwing error';
--echo '#---------------------FN_DYNVARS_003_02-------------------------#'
###############################################
@@ -102,10 +101,9 @@ SET @@autocommit = '';
# Test if accessing global autocommit gives error #
###########################################################################
---Error ER_LOCAL_VARIABLE
SET @@global.autocommit = 0;
---Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@global.autocommit;
+SET @@global.autocommit = 1;
--echo '#----------------------FN_DYNVARS_003_06------------------------#'
@@ -116,7 +114,6 @@ SELECT @@global.autocommit;
SELECT IF(@@session.autocommit, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='autocommit';
---echo Bug # 34839: Values in variable and information_schema do not match for autocommit
--echo '#----------------------FN_DYNVARS_003_07------------------------#'
#########################################################################
@@ -182,8 +179,8 @@ SELECT autocommit = @@session.autocommit;
# Restore initial value #
##############################
-SET @@autocommit = @start_value;
-SELECT @@autocommit;
+SET @@global.autocommit = @start_value;
+SELECT @@global.autocommit;
########################################################################
# END OF autocommit TESTS #
diff --git a/mysql-test/suite/sys_vars/t/autocommit_func-master.opt b/mysql-test/suite/sys_vars/t/autocommit_func-master.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/suite/sys_vars/t/autocommit_func-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/suite/sys_vars/t/autocommit_func.test b/mysql-test/suite/sys_vars/t/autocommit_func.test
index 07e15ce40da..06193448588 100644
--- a/mysql-test/suite/sys_vars/t/autocommit_func.test
+++ b/mysql-test/suite/sys_vars/t/autocommit_func.test
@@ -145,7 +145,6 @@ SELECT * from t1;
--echo ## Connecting with connection # 01 and inserting few records ##
CONNECTION test_con1;
SELECT * from t1;
---echo 'Bug#35373: Records donot get committed in transaction on switching connections'
INSERT into t1(name) values('Record_6');
SELECT * from t1;
diff --git a/mysql-test/suite/sys_vars/t/automatic_sp_privileges_basic.test b/mysql-test/suite/sys_vars/t/automatic_sp_privileges_basic.test
index 005aec91acf..dfa733a0b9b 100644
--- a/mysql-test/suite/sys_vars/t/automatic_sp_privileges_basic.test
+++ b/mysql-test/suite/sys_vars/t/automatic_sp_privileges_basic.test
@@ -116,7 +116,6 @@ SELECT @@session.automatic_sp_privileges;
SELECT IF(@@global.automatic_sp_privileges, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='automatic_sp_privileges';
-echo 'Bug# 34839: Values in variable and information_schema donot match';
--echo '#---------------------FN_DYNVARS_004_07----------------------#'
###################################################################
diff --git a/mysql-test/suite/sys_vars/t/back_log_basic.test b/mysql-test/suite/sys_vars/t/back_log_basic.test
new file mode 100644
index 00000000000..518ca2f0e5f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/back_log_basic.test
@@ -0,0 +1,19 @@
+#
+# show the global and session values;
+#
+select @@global.back_log;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.back_log;
+show global variables like 'back_log';
+show session variables like 'back_log';
+select * from information_schema.global_variables where variable_name='back_log';
+select * from information_schema.session_variables where variable_name='back_log';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global back_log=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session back_log=1;
+
diff --git a/mysql-test/suite/sys_vars/t/big_tables_basic.test b/mysql-test/suite/sys_vars/t/big_tables_basic.test
index 67215f2625d..89a7ee83bc8 100644
--- a/mysql-test/suite/sys_vars/t/big_tables_basic.test
+++ b/mysql-test/suite/sys_vars/t/big_tables_basic.test
@@ -45,7 +45,6 @@ SELECT @start_value;
SET @@big_tables = 1;
SET @@big_tables = DEFAULT;
SELECT @@big_tables;
---echo 'Bug# 34829: No default value for variable and setting default does not raise error';
--echo '#--------------------FN_DYNVARS_005_02------------------------#'
@@ -96,11 +95,9 @@ SET @@big_tables = '';
# Test if accessing global big_tables gives error #
###########################################################################
---Error ER_LOCAL_VARIABLE
-SET @@global.big_tables = 0;
---Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.big_tables = 1-@@global.big_tables;
SELECT @@global.big_tables;
-
+SET @@global.big_tables = 1-@@global.big_tables;
--echo '#----------------------FN_DYNVARS_005_05------------------------#'
##############################################################################
@@ -110,7 +107,6 @@ SELECT @@global.big_tables;
SELECT IF(@@big_tables, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='big_tables';
---echo Bug # 34839: Values in variable and information_schema do not match for autocommit
--echo '#---------------------FN_DYNVARS_005_06----------------------#'
diff --git a/mysql-test/suite/sys_vars/t/character_set_client_basic.test b/mysql-test/suite/sys_vars/t/character_set_client_basic.test
index 177a663c112..26912e89509 100644
--- a/mysql-test/suite/sys_vars/t/character_set_client_basic.test
+++ b/mysql-test/suite/sys_vars/t/character_set_client_basic.test
@@ -164,14 +164,8 @@ SELECT @@character_set_client;
SET @@character_set_client = utf8;
SELECT @@character_set_client;
-#SET @@character_set_client = ucs2;
-#--Error ER_PARSE_ERROR
-#SELECT @@session.character_set_client;
---echo 'Bug: Assignment of ucs2 to session character-set does not raise error';
---echo 'but selecting variable after setting it does.';
---echo 'Even catching this does not allow any further character-set to be set.';
---echo 'Offending querry seems to be:';
---echo 'SET @@character_set_client = ucs2;'
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@character_set_client = ucs2;
SET @@character_set_client = cp866;
SELECT @@character_set_client;
@@ -256,9 +250,6 @@ SET @@global.character_set_client = 100;
SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS);
SELECT @total_charset;
---echo 'Bug # 34843: character sets are mapped in such a way that 100 and following';
---echo 'numbers gives error, and before 100 the 36 mapped wraps arround';
---echo 'several times.';
--echo '#--------------------FN_DYNVARS_010_10-------------------------#'
###############################################################################
diff --git a/mysql-test/suite/sys_vars/t/character_set_client_func.test b/mysql-test/suite/sys_vars/t/character_set_client_func.test
index 19994672fa4..90f5cdaae0f 100644
--- a/mysql-test/suite/sys_vars/t/character_set_client_func.test
+++ b/mysql-test/suite/sys_vars/t/character_set_client_func.test
@@ -38,8 +38,6 @@ SELECT @@global.character_set_client;
SELECT @@session.character_set_client;
disconnect con1;
---echo 'Bug# 35372: session character_set_client is not effected by global character_set_client'
-
--echo '#--------------------FN_DYNVARS_010_02-------------------------#'
#############################################################
# Begin the functionality Testing of character_set_client #
@@ -62,13 +60,13 @@ CREATE TABLE t1(a CHAR(3) character set utf8);
--echo 'For latin1 characterset';
SET @@session.character_set_client = latin1;
INSERT INTO t1 values('è');
-SELECT a,CHAR_LENGTH(a) FROM t1;
+SELECT hex(a),CHAR_LENGTH(a) FROM t1;
DELETE FROM t1;
--echo 'For utf8 characterset';
SET @@session.character_set_client = utf8;
INSERT INTO t1 values('è');
-SELECT a,CHAR_LENGTH(a) FROM t1;
+SELECT hex(a),CHAR_LENGTH(a) FROM t1;
DELETE FROM t1;
--disable_warnings
diff --git a/mysql-test/suite/sys_vars/t/character_set_connection_basic.test b/mysql-test/suite/sys_vars/t/character_set_connection_basic.test
index 5e28d43ce3e..1a51843e0e8 100644
--- a/mysql-test/suite/sys_vars/t/character_set_connection_basic.test
+++ b/mysql-test/suite/sys_vars/t/character_set_connection_basic.test
@@ -182,9 +182,6 @@ SET @@global.character_set_connection = 100;
SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS);
SELECT @total_charset;
---echo 'Bug # 34843: character sets are mapped in such a way that 100 and following ';
---echo 'numbers gives error, and before 100 the 36 mapped wraps arround';
---echo 'several times.';
--echo '#--------------------FN_DYNVARS_011_10-------------------------#'
################################################################################
diff --git a/mysql-test/suite/sys_vars/t/character_set_database_basic.test b/mysql-test/suite/sys_vars/t/character_set_database_basic.test
index 08069c00ae0..07b4b31b25c 100644
--- a/mysql-test/suite/sys_vars/t/character_set_database_basic.test
+++ b/mysql-test/suite/sys_vars/t/character_set_database_basic.test
@@ -182,8 +182,6 @@ SET @@global.character_set_database = 100;
SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS);
SELECT @total_charset;
---echo 'Bug # 34843: character sets are mapped in such a way that 100 and following';
---echo 'numbers gives error, and before 100 the 36 mapped wraps arround several times.';
--echo '#--------------------FN_DYNVARS_012_10-------------------------#'
##############################################################################
diff --git a/mysql-test/suite/sys_vars/t/character_set_database_func.test b/mysql-test/suite/sys_vars/t/character_set_database_func.test
index 78b1f1ab49b..d3da8660766 100644
--- a/mysql-test/suite/sys_vars/t/character_set_database_func.test
+++ b/mysql-test/suite/sys_vars/t/character_set_database_func.test
@@ -38,7 +38,6 @@ connect (con1,localhost,root,,,,);
connection con1;
SELECT @@global.character_set_database;
SELECT @@session.character_set_database;
---echo 'Bug#35356: session character_set_database differ from global character_set_database'
disconnect con1;
--echo '#--------------------FN_DYNVARS_008_02-------------------------#'
@@ -70,8 +69,6 @@ SHOW CREATE TABLE t1;
DROP TABLE t1;
DROP DATABASE db1;
---echo 'Bug#35357: character_set_database does not effects CREATE DATABASE without characater set'
-
#==============================================================================
--echo '--ascii character set specified--'
#==============================================================================
@@ -109,9 +106,6 @@ DROP TABLE IF EXISTS t1;
#==============================================================================
---echo 'Bug#27208: If no current database, character_set_database !=character_set_server'
-#==============================================================================
-
SET GLOBAL character_set_server=latin5;
connect (con2, localhost, root,,);
diff --git a/mysql-test/suite/sys_vars/t/character_set_filesystem_basic.test b/mysql-test/suite/sys_vars/t/character_set_filesystem_basic.test
index 3ba9c269a84..928d02ee46b 100644
--- a/mysql-test/suite/sys_vars/t/character_set_filesystem_basic.test
+++ b/mysql-test/suite/sys_vars/t/character_set_filesystem_basic.test
@@ -165,8 +165,6 @@ SET @@character_set_filesystem = 100;
SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS);
SELECT @total_charset;
-echo 'Bug # 34843: character sets are mapped in such a way that 100 and following ';
-echo 'numbers give error, and before 100 the 36 mapped wraps arround several times.';
--echo '#--------------------FN_DYNVARS_008_10-------------------------#'
################################################################################
diff --git a/mysql-test/suite/sys_vars/t/character_set_server_basic.test b/mysql-test/suite/sys_vars/t/character_set_server_basic.test
index 21eb3fb36dc..d692c1f633c 100644
--- a/mysql-test/suite/sys_vars/t/character_set_server_basic.test
+++ b/mysql-test/suite/sys_vars/t/character_set_server_basic.test
@@ -72,6 +72,9 @@ SET global character_set_server=utf8;
--Error ER_BAD_FIELD_ERROR
SELECT global character_set_server;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@character_set_server = null;
+
--echo '#--------------------FN_DYNVARS_009_02-------------------------#'
###############################################################################
# Check the DEFAULT value of character_set_server for session and global #
@@ -178,12 +181,6 @@ SELECT @@global.character_set_server;
--Error ER_UNKNOWN_CHARACTER_SET
SET @@global.character_set_server = 100;
-SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS);
-SELECT @total_charset;
---echo 'Bug # 34843: character sets are mapped in such a way that 100 and following ';
---echo 'numbers gives error, and before 100 the 36 mapped wraps arround ';
---echo 'several times.';
-
--echo '#--------------------FN_DYNVARS_009_10-------------------------#'
###############################################################################
# Change the value of character_set_server to an invalid value for session #
diff --git a/mysql-test/suite/sys_vars/t/character_sets_dir_basic.test b/mysql-test/suite/sys_vars/t/character_sets_dir_basic.test
new file mode 100644
index 00000000000..30befb5b0f1
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/character_sets_dir_basic.test
@@ -0,0 +1,24 @@
+#
+# show the global and session values;
+#
+--replace_result $MYSQL_SHAREDIR MYSQL_SHAREDIR
+select @@global.character_sets_dir;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.character_sets_dir;
+--replace_result $MYSQL_SHAREDIR MYSQL_SHAREDIR
+show global variables like 'character_sets_dir';
+--replace_result $MYSQL_SHAREDIR MYSQL_SHAREDIR
+show session variables like 'character_sets_dir';
+--replace_result $MYSQL_SHAREDIR MYSQL_SHAREDIR
+select * from information_schema.global_variables where variable_name='character_sets_dir';
+--replace_result $MYSQL_SHAREDIR MYSQL_SHAREDIR
+select * from information_schema.session_variables where variable_name='character_sets_dir';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global character_sets_dir="foo";
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session character_sets_dir="foo";
+
diff --git a/mysql-test/suite/sys_vars/t/collation_connection_basic.test b/mysql-test/suite/sys_vars/t/collation_connection_basic.test
index bf82ea321b7..92f1766fc9c 100644
--- a/mysql-test/suite/sys_vars/t/collation_connection_basic.test
+++ b/mysql-test/suite/sys_vars/t/collation_connection_basic.test
@@ -121,7 +121,7 @@ SET @@collation_connection = latin7_general_ci + latin7_general_cs;
# Change the value of collation_connection to a valid value for session #
###############################################################################
-let collation_variable = @@session.collation_connection;
+let $collation_variable = @@session.collation_connection;
--source suite/sys_vars/inc/collation_basic.inc
@@ -130,7 +130,7 @@ let collation_variable = @@session.collation_connection;
# Change the value of collation_connection to a valid value for global #
###############################################################################
-let collation_variable = @@global.collation_connection;
+let $collation_variable = @@global.collation_connection;
--source suite/sys_vars/inc/collation_basic.inc
diff --git a/mysql-test/suite/sys_vars/t/collation_database_basic.test b/mysql-test/suite/sys_vars/t/collation_database_basic.test
index 557f32b86a0..da06778bb68 100644
--- a/mysql-test/suite/sys_vars/t/collation_database_basic.test
+++ b/mysql-test/suite/sys_vars/t/collation_database_basic.test
@@ -78,6 +78,7 @@ SELECT global collation_database;
##############################################################################
SET @@collation_database = latin1_bin;
SET @@collation_database = DEFAULT;
+SELECT DEFAULT_COLLATION_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME=DATABASE();
SELECT @@collation_database AS DEFAULT_VALUE;
SET @@global.collation_database = latin1_bin;
@@ -120,7 +121,7 @@ SET @@collation_database = latin7_general_ci + latin7_general_cs;
# Change the value of collation_database to a valid value for session #
###########################################################################
-let collation_variable = @@session.collation_database;
+let $collation_variable = @@session.collation_database;
--source suite/sys_vars/inc/collation_basic.inc
@@ -129,7 +130,7 @@ let collation_variable = @@session.collation_database;
# Change the value of collation_database to a valid value for global #
###############################################################################
-let collation_variable = @@global.collation_database;
+let $collation_variable = @@global.collation_database;
--source suite/sys_vars/inc/collation_basic.inc
diff --git a/mysql-test/suite/sys_vars/t/collation_database_func.test b/mysql-test/suite/sys_vars/t/collation_database_func.test
index ba8fc5a3d5e..aa8716408f7 100644
--- a/mysql-test/suite/sys_vars/t/collation_database_func.test
+++ b/mysql-test/suite/sys_vars/t/collation_database_func.test
@@ -38,8 +38,6 @@ SELECT @@global.collation_database;
SELECT @@session.collation_database;
disconnect con1;
---echo 'Bug#35378: New session collation_database is not change by global collation_database'
-
--echo '#--------------------FN_DYNVARS_011_02-------------------------#'
#########################################################
# Begin the functionality Testing of collation_database #
@@ -69,7 +67,6 @@ SET @@session.collation_database = latin2_croatian_ci;
CREATE DATABASE db1;
USE db1;
SHOW CREATE DATABASE db1;
---echo 'Bug#35380: collation_database does not effects CREATE DATABASE without characater set'
CREATE TABLE t1(a CHAR(20));
SHOW CREATE TABLE t1;
diff --git a/mysql-test/suite/sys_vars/t/collation_server_basic.test b/mysql-test/suite/sys_vars/t/collation_server_basic.test
index a8af13c13ae..0d01c7d3076 100644
--- a/mysql-test/suite/sys_vars/t/collation_server_basic.test
+++ b/mysql-test/suite/sys_vars/t/collation_server_basic.test
@@ -120,7 +120,7 @@ SET @@collation_server = latin7_general_ci + latin7_general_cs;
# Change the value of collation_server to a valid value for session #
##############################################################################
-let collation_variable = @@session.collation_server;
+let $collation_variable = @@session.collation_server;
--source suite/sys_vars/inc/collation_basic.inc
@@ -129,7 +129,7 @@ let collation_variable = @@session.collation_server;
# Change the value of collation_server to a valid value for global #
#############################################################################
-let collation_variable = @@global.collation_server;
+let $collation_variable = @@global.collation_server;
--source suite/sys_vars/inc/collation_basic.inc
diff --git a/mysql-test/suite/sys_vars/t/completion_type_basic.test b/mysql-test/suite/sys_vars/t/completion_type_basic.test
index 7ffc1aa593b..927654cd32a 100644
--- a/mysql-test/suite/sys_vars/t/completion_type_basic.test
+++ b/mysql-test/suite/sys_vars/t/completion_type_basic.test
@@ -53,18 +53,6 @@ SET @@session.completion_type = DEFAULT;
SELECT @@session.completion_type;
---echo '#--------------------FN_DYNVARS_017_02-------------------------#'
-###############################################################
-# Check the DEFAULT value of completion_type #
-###############################################################
-
-SET @@global.completion_type = @start_global_value;
-SELECT @@global.completion_type = 0;
-
-SET @@session.completion_type = @start_session_value;
-SELECT @@session.completion_type = 0;
-
-
--echo '#--------------------FN_DYNVARS_017_03-------------------------#'
#########################################################################
# Change the value of completion_type to a valid value for GLOBAL Scope #
@@ -77,6 +65,12 @@ SELECT @@global.completion_type;
SET @@global.completion_type = 2;
SELECT @@global.completion_type;
+SET @@global.completion_type = NO_CHAIN;
+SELECT @@global.completion_type;
+SET @@global.completion_type = CHAIN;
+SELECT @@global.completion_type;
+SET @@global.completion_type = 'RELEASE';
+SELECT @@global.completion_type;
--echo '#--------------------FN_DYNVARS_017_04-------------------------#'
##########################################################################
@@ -90,19 +84,25 @@ SELECT @@session.completion_type;
SET @@session.completion_type = 2;
SELECT @@session.completion_type;
+SET @@session.completion_type = 'NO_CHAIN';
+SELECT @@session.completion_type;
+SET @@session.completion_type = 'CHAIN';
+SELECT @@session.completion_type;
+SET @@session.completion_type = 'RELEASE';
+SELECT @@session.completion_type;
--echo '#------------------FN_DYNVARS_017_05-----------------------#'
###########################################################
# Change the value of completion_type to an invalid value #
###########################################################
-
+set sql_mode=TRADITIONAL;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.completion_type = 10;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.completion_type = -1024;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.completion_type = 2.4;
---Error ER_WRONG_TYPE_FOR_VAR
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.completion_type = OFF;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.completion_type = 10;
@@ -110,7 +110,7 @@ SET @@session.completion_type = 10;
SET @@session.completion_type = -2;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.completion_type = 1.2;
---Error ER_WRONG_TYPE_FOR_VAR
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.completion_type = ON;
@@ -177,6 +177,7 @@ SET @@global.completion_type = @start_global_value;
SELECT @@global.completion_type;
SET @@session.completion_type = @start_session_value;
SELECT @@session.completion_type;
+set sql_mode='';
############################################
# END OF completion_type TESTS #
diff --git a/mysql-test/suite/sys_vars/t/completion_type_func.test b/mysql-test/suite/sys_vars/t/completion_type_func.test
index 8e363ed2a7d..9495a8e118c 100644
--- a/mysql-test/suite/sys_vars/t/completion_type_func.test
+++ b/mysql-test/suite/sys_vars/t/completion_type_func.test
@@ -156,7 +156,7 @@ COMMIT;
--echo ## Inserting rows should give error here because connection should ##
--echo ## disconnect after using COMMIT ##
---Error 2006,2013,ER_SERVER_SHUTDOWN
+--Error 2006,2013,ER_QUERY_INTERRUPTED
INSERT INTO t1 VALUES(4,'Record_4');
--echo switch to connection test_con2
@@ -171,7 +171,7 @@ INSERT INTO t1 VALUES(12,'Record_12');
ROLLBACK;
--echo ## Expect a failure due to COMMIT/ROLLBACK AND RELEASE behavior ##
---Error 2006,2013,ER_SERVER_SHUTDOWN,
+--Error 2006,2013,ER_QUERY_INTERRUPTED
INSERT INTO t1 VALUES(4,'Record_4');
connection default;
diff --git a/mysql-test/suite/sys_vars/t/concurrent_insert_basic.test b/mysql-test/suite/sys_vars/t/concurrent_insert_basic.test
index bc401ef22a3..5be569e52d3 100644
--- a/mysql-test/suite/sys_vars/t/concurrent_insert_basic.test
+++ b/mysql-test/suite/sys_vars/t/concurrent_insert_basic.test
@@ -67,35 +67,41 @@ SELECT @@global.concurrent_insert;
SET @@global.concurrent_insert = 2;
SELECT @@global.concurrent_insert;
+SET @@global.concurrent_insert = NEVER;
+SELECT @@global.concurrent_insert;
+SET @@global.concurrent_insert = AUTO;
+SELECT @@global.concurrent_insert;
+SET @@global.concurrent_insert = ALWAYS;
+SELECT @@global.concurrent_insert;
+
--echo '#--------------------FN_DYNVARS_018_04-------------------------#'
###########################################################################
# Change the value of concurrent_insert to invalid value #
###########################################################################
+--error ER_WRONG_VALUE_FOR_VAR
SET @@global.concurrent_insert = -1;
-Select @@global.concurrent_insert;
+--error ER_WRONG_VALUE_FOR_VAR
SET @@global.concurrent_insert = 100;
-Select @@global.concurrent_insert;
-echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
---Error ER_WRONG_TYPE_FOR_VAR
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.concurrent_insert = TRUEF;
---Error ER_WRONG_TYPE_FOR_VAR
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.concurrent_insert = TRUE_F;
---Error ER_WRONG_TYPE_FOR_VAR
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.concurrent_insert = FALSE0;
---Error ER_WRONG_TYPE_FOR_VAR
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.concurrent_insert = OON;
---Error ER_WRONG_TYPE_FOR_VAR
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.concurrent_insert = ONN;
---Error ER_WRONG_TYPE_FOR_VAR
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.concurrent_insert = OOFF;
---Error ER_WRONG_TYPE_FOR_VAR
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.concurrent_insert = 0FF;
---Error ER_WRONG_TYPE_FOR_VAR
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.concurrent_insert = ' ';
---Error ER_WRONG_TYPE_FOR_VAR
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.concurrent_insert = " ";
---Error ER_WRONG_TYPE_FOR_VAR
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.concurrent_insert = '';
@@ -125,9 +131,9 @@ WHERE VARIABLE_NAME='concurrent_insert';
# Check if ON and OFF values can be used on variable #
###################################################################
---Error ER_WRONG_TYPE_FOR_VAR
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.concurrent_insert = OFF;
---Error ER_WRONG_TYPE_FOR_VAR
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.concurrent_insert = ON;
diff --git a/mysql-test/suite/sys_vars/t/connect_timeout_basic.test b/mysql-test/suite/sys_vars/t/connect_timeout_basic.test
index 095c85f8295..d89734a00c2 100644
--- a/mysql-test/suite/sys_vars/t/connect_timeout_basic.test
+++ b/mysql-test/suite/sys_vars/t/connect_timeout_basic.test
@@ -79,7 +79,6 @@ SET @@global.connect_timeout = -1024;
SELECT @@global.connect_timeout;
SET @@global.connect_timeout = 42949672950;
SELECT @@global.connect_timeout;
-echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.connect_timeout = 21221204.10;
--Error ER_WRONG_TYPE_FOR_VAR
diff --git a/mysql-test/suite/sys_vars/t/date_format_basic.test b/mysql-test/suite/sys_vars/t/date_format_basic.test
new file mode 100644
index 00000000000..a69295b405d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/date_format_basic.test
@@ -0,0 +1,18 @@
+#
+# show the global and session values;
+#
+select @@global.date_format;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.date_format;
+show global variables like 'date_format';
+show session variables like 'date_format';
+select * from information_schema.global_variables where variable_name='date_format';
+select * from information_schema.session_variables where variable_name='date_format';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global date_format="foo";
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session date_format="foo";
diff --git a/mysql-test/suite/sys_vars/t/datetime_format_basic.test b/mysql-test/suite/sys_vars/t/datetime_format_basic.test
new file mode 100644
index 00000000000..553d3126328
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/datetime_format_basic.test
@@ -0,0 +1,18 @@
+#
+# show the global and session values;
+#
+select @@global.datetime_format;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.datetime_format;
+show global variables like 'datetime_format';
+show session variables like 'datetime_format';
+select * from information_schema.global_variables where variable_name='datetime_format';
+select * from information_schema.session_variables where variable_name='datetime_format';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global datetime_format="foo";
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session datetime_format="foo";
diff --git a/mysql-test/suite/sys_vars/t/debug_basic.test b/mysql-test/suite/sys_vars/t/debug_basic.test
new file mode 100644
index 00000000000..b54626c38ca
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/debug_basic.test
@@ -0,0 +1,22 @@
+--source include/have_debug.inc
+#
+# exists both as global and session
+#
+set session debug="L";
+
+select @@global.debug="1"; # just to show that global.debug exists
+select @@session.debug; # here we know the value and can display it
+--replace_column 2 #
+show global variables like 'debug';
+show session variables like 'debug';
+--replace_column 2 #
+select * from information_schema.global_variables where variable_name="debug";
+select * from information_schema.session_variables where variable_name="debug";
+
+--error ER_WRONG_TYPE_FOR_VAR
+set @@global.debug=1;
+--error ER_WRONG_TYPE_FOR_VAR
+set @@global.debug=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set @@global.debug=1e1;
+
diff --git a/mysql-test/suite/sys_vars/t/debug_sync_basic.test b/mysql-test/suite/sys_vars/t/debug_sync_basic.test
new file mode 100644
index 00000000000..c2c4df95c32
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/debug_sync_basic.test
@@ -0,0 +1,21 @@
+--source include/have_debug_sync.inc
+#
+# exists as session only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@global.debug_sync;
+select @@session.debug_sync;
+
+show global variables like "debug_sync";
+show session variables like "debug_sync";
+
+select * from information_schema.global_variables where variable_name="debug_sync";
+select * from information_schema.session_variables where variable_name="debug_sync";
+
+--error ER_WRONG_TYPE_FOR_VAR
+set @@session.debug_sync=1;
+--error ER_WRONG_TYPE_FOR_VAR
+set @@session.debug_sync=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set @@session.debug_sync=1e1;
+
diff --git a/mysql-test/suite/sys_vars/t/default_storage_engine_basic.test b/mysql-test/suite/sys_vars/t/default_storage_engine_basic.test
new file mode 100644
index 00000000000..17f2d2cc852
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/default_storage_engine_basic.test
@@ -0,0 +1,183 @@
+############## mysql-test\t\storage_engine_basic.test ##################
+# #
+# #
+# Creation Date: 2008-02-14 #
+# Author: Salman Rawala #
+# #
+# Description: Test Cases of Dynamic System Variable #
+# default_storage_engine that check behavior of this #
+# variable with valid values, invalid values, accessing #
+# variable with scope that is allowed and with scope that #
+# is now allowed. #
+# #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
+# server-system-variables.html#option_mysqld_storage_engine #
+# #
+########################################################################
+
+--source include/have_innodb.inc
+--source include/load_sysvars.inc
+
+######################################################################
+# START OF default_storage_engine TESTS #
+######################################################################
+
+
+#############################################################
+# Save initial value #
+#############################################################
+
+SET @start_global_value = @@global.default_storage_engine;
+SELECT @start_global_value;
+SET @start_session_value = @@session.default_storage_engine;
+SELECT @start_session_value;
+
+
+--echo '#--------------------FN_DYNVARS_005_01-------------------------#'
+######################################################################
+# Display the DEFAULT value of default_storage_engine #
+######################################################################
+
+SET @@global.default_storage_engine = INNODB;
+SET @@global.default_storage_engine = DEFAULT;
+SELECT @@global.default_storage_engine;
+
+SET @@session.default_storage_engine = INNODB;
+SET @@session.default_storage_engine = DEFAULT;
+SELECT @@session.default_storage_engine;
+
+
+--echo '#--------------------FN_DYNVARS_005_02-------------------------#'
+########################################################################
+# Change the value of default_storage_engine to a valid value for GLOBAL Scope #
+########################################################################
+
+SET @@global.default_storage_engine = MYISAM;
+SELECT @@global.default_storage_engine;
+SET @@global.default_storage_engine = MERGE;
+SELECT @@global.default_storage_engine;
+SET @@global.default_storage_engine = MEMORY;
+SELECT @@global.default_storage_engine;
+SET @@global.default_storage_engine = INNODB;
+SELECT @@global.default_storage_engine;
+
+
+--echo '#--------------------FN_DYNVARS_005_03-------------------------#'
+#########################################################################
+# Change the value of default_storage_engine to a valid value for SESSION Scope #
+#########################################################################
+
+SET @@session.default_storage_engine = MYISAM;
+SELECT @@session.default_storage_engine;
+SET @@session.default_storage_engine = MERGE;
+SELECT @@session.default_storage_engine;
+SET @@session.default_storage_engine = MEMORY;
+SELECT @@session.default_storage_engine;
+SET @@session.default_storage_engine = INNODB;
+SELECT @@session.default_storage_engine;
+
+
+--echo '#------------------FN_DYNVARS_005_04-----------------------#'
+##################################################################
+# Change the value of default_storage_engine to an invalid value #
+##################################################################
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.default_storage_engine = 8199;
+
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.default_storage_engine = NULL;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.default_storage_engine = -1024;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.default_storage_engine = 65530.34;
+
+--Error ER_UNKNOWN_STORAGE_ENGINE
+SET @@global.default_storage_engine = FILE;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.default_storage_engine = 8199;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.default_storage_engine = 65530.34;
+
+--Error ER_UNKNOWN_STORAGE_ENGINE
+SET @@session.default_storage_engine = RECORD;
+
+
+--echo '#------------------FN_DYNVARS_005_05-----------------------#'
+####################################################################
+# Check if the value in GLOBAL Table matches value in variable #
+####################################################################
+
+
+SELECT @@global.default_storage_engine =
+ VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+ WHERE VARIABLE_NAME='default_storage_engine';
+
+--echo '#------------------FN_DYNVARS_005_06-----------------------#'
+####################################################################
+# Check if the value in SESSION Table matches value in variable #
+####################################################################
+
+SELECT @@session.default_storage_engine =
+ VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+ WHERE VARIABLE_NAME='default_storage_engine';
+
+
+--echo '#------------------FN_DYNVARS_005_07-----------------------#'
+####################################################################
+# Check if TRUE and FALSE values can be used on variable #
+####################################################################
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.default_storage_engine = TRUE;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.default_storage_engine = FALSE;
+
+
+--echo '#---------------------FN_DYNVARS_001_8----------------------#'
+###############################################################
+# Check if accessing variable with SESSION,LOCAL and without #
+# SCOPE points to same session variable #
+###############################################################
+
+SET @@default_storage_engine = MYISAM;
+SELECT @@default_storage_engine = @@local.default_storage_engine;
+SELECT @@local.default_storage_engine = @@session.default_storage_engine;
+
+
+--echo '#---------------------FN_DYNVARS_001_9----------------------#'
+#########################################################################
+# Check if default_storage_engine can be accessed with and without @@ sign #
+#########################################################################
+
+SET default_storage_engine = MEMORY;
+SELECT @@default_storage_engine;
+--Error ER_UNKNOWN_TABLE
+SELECT local.default_storage_engine;
+--Error ER_UNKNOWN_TABLE
+SELECT session.default_storage_engine;
+--Error ER_BAD_FIELD_ERROR
+SELECT default_storage_engine = @@session.default_storage_engine;
+
+# check the old obsolete name
+SET @@default_storage_engine = @start_global_value;
+
+####################################
+# Restore initial value #
+####################################
+
+SET @@global.default_storage_engine = @start_global_value;
+SELECT @@global.default_storage_engine;
+SET @@session.default_storage_engine = @start_session_value;
+SELECT @@session.default_storage_engine;
+
+
+#############################################################
+# END OF default_storage_engine TESTS #
+#############################################################
+
diff --git a/mysql-test/suite/sys_vars/t/default_week_format_basic.test b/mysql-test/suite/sys_vars/t/default_week_format_basic.test
index d8b4a09541f..e609cdc53f5 100644
--- a/mysql-test/suite/sys_vars/t/default_week_format_basic.test
+++ b/mysql-test/suite/sys_vars/t/default_week_format_basic.test
@@ -118,7 +118,6 @@ SET @@session.default_week_format = -2;
SELECT @@session.default_week_format;
SET @@session.default_week_format = 65550;
SELECT @@session.default_week_format;
-echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--echo '#------------------FN_DYNVARS_022_06-----------------------#'
###############################################################################
diff --git a/mysql-test/suite/sys_vars/t/delay_key_write_basic.test b/mysql-test/suite/sys_vars/t/delay_key_write_basic.test
index faa1cb3cc6e..25176879eb1 100644
--- a/mysql-test/suite/sys_vars/t/delay_key_write_basic.test
+++ b/mysql-test/suite/sys_vars/t/delay_key_write_basic.test
@@ -44,10 +44,7 @@ SELECT @start_value;
########################################################################
SET @@global.delay_key_write = OFF;
---Error ER_NO_DEFAULT
SET @@global.delay_key_write = DEFAULT;
---echo 'Bug # 34878: Documentation specifies a DEFAULT value of ON for variable but';
---echo 'its not supported';
SELECT @@global.delay_key_write;
@@ -92,10 +89,8 @@ SET @@global.delay_key_write = ERROR;
SET @@global.delay_key_write = FALSE0;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.delay_key_write = ONN;
-
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.delay_key_write = OF;
-SELECT @@global.delay_key_write;
---echo 'Bug# 34828: Variable is incorrectly accepting OF as a value'
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.delay_key_write = ' ';
diff --git a/mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test b/mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test
index 61f7d801a1a..e46ebc1e598 100644
--- a/mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test
+++ b/mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test
@@ -1,11 +1,11 @@
################################################################################
# #
-# Variable Name: sql_low_priority_updates #
+# Variable Name: delayed_insert_limit #
# Scope: GLOBAL #
# Access Type: Dynamic #
-# Data Type: BOOLEAN #
-# Default Value: 1 TRUE #
-# Values: 1 TRUE, 0 FALSE #
+# Data Type: Numeric #
+# Default Value: 100 #
+# Range: 1 - 4294967295 #
# #
# #
# Creation Date: 2008-02-25 #
@@ -13,7 +13,7 @@
# Modified: HHunger 2009-02-26 Replaced 2 sleeps by wait conditions #
# Modified: mleich 2009-03-18 Partially reimplemented #
# #
-# Description: Test Cases of Dynamic System Variable "sql_low_priority_updates"#
+# Description: Test Cases of Dynamic System Variable "delayed_insert_limit" #
# that checks behavior of this variable in the following ways #
# * Functionality based on different values #
# #
@@ -112,7 +112,6 @@ let $wait_condition=
SELECT variable_value > 0 FROM information_schema.global_status
WHERE variable_name like 'Not_flushed_delayed_rows';
--source include/wait_condition.inc
-let $my_select= SELECT COUNT(*) BETWEEN 21 AND 43 FROM t1;
let $my_select= SELECT COUNT(*) FROM t1;
send;
eval $my_select;
@@ -136,6 +135,13 @@ connection con0;
--echo Asynchronous "reap" result
--echo The next result suffers from
--echo '# Bug#35386 insert delayed inserts 1 + limit rows instead of just limit rows'
+#
+# on UNLOCK TABLES both SELECT in the con0 and delayed insert thread in the
+# con1 were awaken. There's no FIFO for TL_WRITE_DELAYED and TL_READ,
+# so either the first delayed_insert_limit rows will be inserted
+# before select (which will see 21 row) or select will go first (and see 6 rows)
+#
+--replace_result 6 21
reap;
--echo ** Connection default **
diff --git a/mysql-test/suite/sys_vars/t/delayed_insert_timeout_basic.test b/mysql-test/suite/sys_vars/t/delayed_insert_timeout_basic.test
index 8bad6b2dfe6..2486ff5800f 100644
--- a/mysql-test/suite/sys_vars/t/delayed_insert_timeout_basic.test
+++ b/mysql-test/suite/sys_vars/t/delayed_insert_timeout_basic.test
@@ -79,8 +79,6 @@ SET @@global.delayed_insert_timeout = -1024;
SELECT @@global.delayed_insert_timeout;
SET @@global.delayed_insert_timeout = 42949672950;
SELECT @@global.delayed_insert_timeout;
-echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.delayed_insert_timeout = 429496729.5;
diff --git a/mysql-test/suite/sys_vars/t/disabled.def b/mysql-test/suite/sys_vars/t/disabled.def
new file mode 100644
index 00000000000..483eea9daeb
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/disabled.def
@@ -0,0 +1,17 @@
+##############################################################################
+#
+# List the test cases that are to be disabled temporarily.
+#
+# Separate the test case name and the comment with ':'.
+#
+# <testcasename> : BUG#<xxxx> <date disabled> <disabler> <comment>
+#
+# Do not use any TAB characters for whitespace.
+#
+##############################################################################
+query_cache_size_basic_32 : Bug#36747: Allocating a large query cache is not deterministic
+query_cache_size_basic_64 : Bug#36747: Allocating a large query cache is not deterministic
+transaction_prealloc_size_basic_32 : Bug#36747
+transaction_prealloc_size_basic_64 : Bug#36747
+#thread_cache_size_func : Bug#40575: 2008-11-07 joro main.thread_cache_size_func fails in pushbuild when run with pool of threads
+
diff --git a/mysql-test/suite/sys_vars/t/div_precision_increment_basic.test b/mysql-test/suite/sys_vars/t/div_precision_increment_basic.test
index 40497e829df..65edf6dd76f 100644
--- a/mysql-test/suite/sys_vars/t/div_precision_increment_basic.test
+++ b/mysql-test/suite/sys_vars/t/div_precision_increment_basic.test
@@ -114,7 +114,6 @@ SET @@session.div_precision_increment = -2;
SELECT @@session.div_precision_increment;
SET @@session.div_precision_increment = 65550;
SELECT @@session.div_precision_increment;
-echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.div_precision_increment = 65530.30;
diff --git a/mysql-test/suite/sys_vars/t/div_precision_increment_func.test b/mysql-test/suite/sys_vars/t/div_precision_increment_func.test
index aebca88abf9..1c2cbfc24e9 100644
--- a/mysql-test/suite/sys_vars/t/div_precision_increment_func.test
+++ b/mysql-test/suite/sys_vars/t/div_precision_increment_func.test
@@ -37,7 +37,7 @@ CREATE TABLE t1
id INT NOT NULL auto_increment,
PRIMARY KEY (id),
name VARCHAR(30),
-salary LONG
+salary INT
);
--echo '#--------------------FN_DYNVARS_027_01-------------------------#'
@@ -55,7 +55,6 @@ INSERT into t1(name, salary) values('Record_2', 501);
INSERT into t1(name, salary) values('Record_3', 210);
SELECT name, salary, ((salary * 2.5)/1000) AS INCOME from t1;
---echo 'Bug#35374: div_precision is not working with table column'
--echo ## Verifying variable's behavior with direct division ##
SELECT 1/7;
@@ -80,7 +79,7 @@ CREATE TABLE t1
id INT NOT NULL auto_increment,
PRIMARY KEY (id),
name VARCHAR(30),
-salary LONG,
+salary INT,
income_tax FLOAT
);
diff --git a/mysql-test/suite/sys_vars/t/engine_condition_pushdown_basic.test b/mysql-test/suite/sys_vars/t/engine_condition_pushdown_basic.test
index 58ac196d1c2..b153ac50e1e 100644
--- a/mysql-test/suite/sys_vars/t/engine_condition_pushdown_basic.test
+++ b/mysql-test/suite/sys_vars/t/engine_condition_pushdown_basic.test
@@ -101,7 +101,7 @@ SELECT @@global.engine_condition_pushdown;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.engine_condition_pushdown = -1;
---Error ER_WRONG_VALUE_FOR_VAR
+--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.engine_condition_pushdown = 1.6;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.engine_condition_pushdown = "T";
@@ -111,16 +111,12 @@ SET @@session.engine_condition_pushdown = "Y";
SET @@session.engine_condition_pushdown = TRÜE;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.engine_condition_pushdown = ÕN;
-
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.engine_condition_pushdown = OF;
-SELECT @@session.engine_condition_pushdown;
---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.'
-
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.engine_condition_pushdown = ÓFF;
-
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.engine_condition_pushdown = -1;
--Error ER_WRONG_VALUE_FOR_VAR
@@ -133,12 +129,8 @@ SET @@global.engine_condition_pushdown = "Y";
SET @@global.engine_condition_pushdown = TRÜE;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.engine_condition_pushdown = ÕN;
-
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.engine_condition_pushdown = OF;
-SELECT @@global.engine_condition_pushdown;
-
---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.'
-
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.engine_condition_pushdown = ÓFF;
diff --git a/mysql-test/suite/sys_vars/t/event_scheduler_basic.test b/mysql-test/suite/sys_vars/t/event_scheduler_basic.test
index f7045651613..2e6aa3cba5c 100644
--- a/mysql-test/suite/sys_vars/t/event_scheduler_basic.test
+++ b/mysql-test/suite/sys_vars/t/event_scheduler_basic.test
@@ -43,10 +43,8 @@ SELECT @start_value;
# Verify default value of variable #
###############################################
---Error ER_NO_DEFAULT
SET @@global.event_scheduler = DEFAULT;
-#SELECT @@global.event_scheduler = OFF;
---echo 'Bug# 34878: According to documentation the default value of variable is OFF';
+SELECT @@global.event_scheduler;
--echo '#--------------------FN_DYNVARS_004_02------------------------#'
#######################################################################
diff --git a/mysql-test/suite/sys_vars/t/expire_logs_days_basic.test b/mysql-test/suite/sys_vars/t/expire_logs_days_basic.test
index 02448d1fd11..f19ab922c72 100644
--- a/mysql-test/suite/sys_vars/t/expire_logs_days_basic.test
+++ b/mysql-test/suite/sys_vars/t/expire_logs_days_basic.test
@@ -91,7 +91,6 @@ SET @@global.expire_logs_days = -1024;
SELECT @@global.expire_logs_days;
SET @@global.expire_logs_days = 42949672950;
SELECT @@global.expire_logs_days;
-echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.expire_logs_days = ON;
diff --git a/mysql-test/suite/sys_vars/t/flush_basic.test b/mysql-test/suite/sys_vars/t/flush_basic.test
index 0b8fc0388ee..4eb821e9af1 100644
--- a/mysql-test/suite/sys_vars/t/flush_basic.test
+++ b/mysql-test/suite/sys_vars/t/flush_basic.test
@@ -43,9 +43,7 @@ SELECT @start_value;
#############################################################
SET @@global.flush = ON;
---Error ER_NO_DEFAULT
SET @@global.flush = DEFAULT;
---echo 'Bug# 34878: FN_DYNVARS_002_01 - Default value is off according to Documentation of MySQL';
SELECT @@global.flush;
diff --git a/mysql-test/suite/sys_vars/t/flush_time_basic.test b/mysql-test/suite/sys_vars/t/flush_time_basic.test
new file mode 100644
index 00000000000..9604769d460
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/flush_time_basic.test
@@ -0,0 +1,50 @@
+
+#
+# note, the default is 1800 on windows, 0 everywhere else
+#
+
+SET @start_global_value = @@global.flush_time;
+
+#
+# exists as global only
+#
+--replace_result 1800 0
+select @@global.flush_time;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.flush_time;
+--replace_result 1800 0
+show global variables like 'flush_time';
+--replace_result 1800 0
+show session variables like 'flush_time';
+--replace_result 1800 0
+select * from information_schema.global_variables where variable_name='flush_time';
+--replace_result 1800 0
+select * from information_schema.session_variables where variable_name='flush_time';
+
+#
+# show that it's writable
+#
+set global flush_time=1;
+select @@global.flush_time;
+--error ER_GLOBAL_VARIABLE
+set session flush_time=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global flush_time=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global flush_time=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global flush_time="foo";
+
+#
+# min/max values
+#
+set global flush_time=0;
+select @@global.flush_time;
+set global flush_time=cast(-1 as unsigned int);
+select @@global.flush_time;
+
+SET @@global.flush_time = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/foreign_key_checks_basic.test b/mysql-test/suite/sys_vars/t/foreign_key_checks_basic.test
index d7a01f2bf71..8a327ab699b 100644
--- a/mysql-test/suite/sys_vars/t/foreign_key_checks_basic.test
+++ b/mysql-test/suite/sys_vars/t/foreign_key_checks_basic.test
@@ -46,7 +46,6 @@ SET @@session.foreign_key_checks = 1;
SET @@session.foreign_key_checks = DEFAULT;
SELECT @@session.foreign_key_checks;
---echo 'Bug# 34878: No DEFAULT value for variable. Also setting DEFAULT does not give error'
--echo '#---------------------FN_DYNVARS_032_02-------------------------#'
#############################################################################
@@ -94,12 +93,8 @@ SET @@session.foreign_key_checks = "Y";
SET @@session.foreign_key_checks = TRÜE;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.foreign_key_checks = ÕN;
-
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.foreign_key_checks = OF;
-SELECT @@session.foreign_key_checks;
-
---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.'
-
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.foreign_key_checks = ÓFF;
--Error ER_WRONG_VALUE_FOR_VAR
@@ -113,11 +108,9 @@ SET @@session.foreign_key_checks = NO;
# Test if accessing global foreign_key_checks gives error #
###########################################################################
---Error ER_LOCAL_VARIABLE
SET @@global.foreign_key_checks = 0;
-
---Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@global.foreign_key_checks;
+SET @@global.foreign_key_checks = 1;
--echo '#----------------------FN_DYNVARS_032_06------------------------#'
#########################################################################
diff --git a/mysql-test/suite/sys_vars/t/foreign_key_checks_func.test b/mysql-test/suite/sys_vars/t/foreign_key_checks_func.test
index 4d2c63bbce6..5786b9283be 100644
--- a/mysql-test/suite/sys_vars/t/foreign_key_checks_func.test
+++ b/mysql-test/suite/sys_vars/t/foreign_key_checks_func.test
@@ -93,9 +93,6 @@ INSERT INTO t2 values (20,4);
SET @@session.foreign_key_checks = 1;
UPDATE t2 SET b=4 where a=20;
---echo 'Bug#35358: Updating an incorrect foreign key(inserted by disabling '
---echo 'foreign_key_checks)to the same value does not raise error after '
---echo 'enabling foreign_key_checks'
#==============================================================================
--echo 'Check when foreign_key_checks is enabled and FK constraint is re-created'
diff --git a/mysql-test/suite/sys_vars/t/ft_boolean_syntax_basic.test b/mysql-test/suite/sys_vars/t/ft_boolean_syntax_basic.test
index 4117605c452..454b5d7477e 100644
--- a/mysql-test/suite/sys_vars/t/ft_boolean_syntax_basic.test
+++ b/mysql-test/suite/sys_vars/t/ft_boolean_syntax_basic.test
@@ -145,10 +145,7 @@ WHERE VARIABLE_NAME='ft_boolean_syntax') AS res;
#############################################################################
# Content of initial variable
SELECT @global_start_value;
---Error ER_WRONG_VALUE_FOR_VAR
SET @@global.ft_boolean_syntax = @global_start_value;
---echo 'Bug# 34883: ft_boolean_syntax cant be assigned values from session temporary';
---echo 'variables';
####################################
# Restore Default value #
diff --git a/mysql-test/suite/sys_vars/t/ft_boolean_syntax_func.test b/mysql-test/suite/sys_vars/t/ft_boolean_syntax_func.test
index 4ea28b015cb..242d404d244 100644
--- a/mysql-test/suite/sys_vars/t/ft_boolean_syntax_func.test
+++ b/mysql-test/suite/sys_vars/t/ft_boolean_syntax_func.test
@@ -92,15 +92,11 @@ SELECT * FROM articles WHERE MATCH (title,body)
AGAINST ('"faster than"' IN BOOLEAN MODE);
SELECT * FROM articles WHERE MATCH (title,body)
-AGAINST ('+run ~line' IN BOOLEAN MODE);
-
---Echo 'Bug#35359: ~ is not working correctly. Its behaving like -'
+AGAINST ('+tutorial ~line' IN BOOLEAN MODE);
SELECT * FROM articles WHERE MATCH (title,body)
AGAINST ('10*' IN BOOLEAN MODE);
---Echo 'Bug#35360: * is not working correctly. Not all rows are returned'
-
SELECT id,title,body, (MATCH (title,body)
AGAINST ('+MySQL +(>show <dbms)' IN BOOLEAN MODE)) AS relevance
FROM articles WHERE MATCH (title,body)
@@ -114,8 +110,6 @@ SET @@global.ft_boolean_syntax='~ /!@#$%^&*()-';
SELECT * FROM articles WHERE MATCH (title,body)
AGAINST ('~mySQL /yourSQL' IN BOOLEAN MODE);
---echo 'Bug#35361: Different syntax does not produce result as default operators'
-
#restore default
SET @@global.ft_boolean_syntax=DEFAULT;
diff --git a/mysql-test/suite/sys_vars/t/ft_max_word_len_basic.test b/mysql-test/suite/sys_vars/t/ft_max_word_len_basic.test
new file mode 100644
index 00000000000..525a5bc29e5
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/ft_max_word_len_basic.test
@@ -0,0 +1,19 @@
+#
+# only global
+#
+select @@global.ft_max_word_len;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.ft_max_word_len;
+show global variables like 'ft_max_word_len';
+show session variables like 'ft_max_word_len';
+select * from information_schema.global_variables where variable_name='ft_max_word_len';
+select * from information_schema.session_variables where variable_name='ft_max_word_len';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global ft_max_word_len=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session ft_max_word_len=1;
+
diff --git a/mysql-test/suite/sys_vars/t/ft_min_word_len_basic.test b/mysql-test/suite/sys_vars/t/ft_min_word_len_basic.test
new file mode 100644
index 00000000000..7819e9c00e7
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/ft_min_word_len_basic.test
@@ -0,0 +1,19 @@
+#
+# only global
+#
+select @@global.ft_min_word_len;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.ft_min_word_len;
+show global variables like 'ft_min_word_len';
+show session variables like 'ft_min_word_len';
+select * from information_schema.global_variables where variable_name='ft_min_word_len';
+select * from information_schema.session_variables where variable_name='ft_min_word_len';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global ft_min_word_len=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session ft_min_word_len=1;
+
diff --git a/mysql-test/suite/sys_vars/t/ft_query_expansion_limit_basic.test b/mysql-test/suite/sys_vars/t/ft_query_expansion_limit_basic.test
new file mode 100644
index 00000000000..988ee71ebdf
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/ft_query_expansion_limit_basic.test
@@ -0,0 +1,19 @@
+#
+# only global
+#
+select @@global.ft_query_expansion_limit;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.ft_query_expansion_limit;
+show global variables like 'ft_query_expansion_limit';
+show session variables like 'ft_query_expansion_limit';
+select * from information_schema.global_variables where variable_name='ft_query_expansion_limit';
+select * from information_schema.session_variables where variable_name='ft_query_expansion_limit';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global ft_query_expansion_limit=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session ft_query_expansion_limit=1;
+
diff --git a/mysql-test/suite/sys_vars/t/ft_stopword_file_basic.test b/mysql-test/suite/sys_vars/t/ft_stopword_file_basic.test
new file mode 100644
index 00000000000..3d527ff8ec1
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/ft_stopword_file_basic.test
@@ -0,0 +1,19 @@
+#
+# only global
+#
+select @@global.ft_stopword_file;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.ft_stopword_file;
+show global variables like 'ft_stopword_file';
+show session variables like 'ft_stopword_file';
+select * from information_schema.global_variables where variable_name='ft_stopword_file';
+select * from information_schema.session_variables where variable_name='ft_stopword_file';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global ft_stopword_file=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session ft_stopword_file=1;
+
diff --git a/mysql-test/suite/sys_vars/t/general_log_file_basic.test b/mysql-test/suite/sys_vars/t/general_log_file_basic.test
index 014108f88d2..43d7414a0c2 100644
--- a/mysql-test/suite/sys_vars/t/general_log_file_basic.test
+++ b/mysql-test/suite/sys_vars/t/general_log_file_basic.test
@@ -45,7 +45,8 @@ SELECT @start_value;
###############################################
SET @@global.general_log_file = DEFAULT;
-SELECT RIGHT(@@global.general_log_file,10) AS log_file;
+SET @a=concat(left(@@hostname, instr(concat(@@hostname, '.'), '.')-1), '.log');
+SELECT RIGHT(@@global.general_log_file, length(@a)) = @a;
--echo '#--------------------FN_DYNVARS_004_02------------------------#'
diff --git a/mysql-test/suite/sys_vars/t/general_log_func.test b/mysql-test/suite/sys_vars/t/general_log_func.test
index 24d535e88e5..55ed944c6b2 100644
--- a/mysql-test/suite/sys_vars/t/general_log_func.test
+++ b/mysql-test/suite/sys_vars/t/general_log_func.test
@@ -46,8 +46,18 @@ name VARCHAR(30)
SET @@global.general_log = OFF;
SELECT @@general_log;
-
let $MYSQLD_LOGFILE= `select @@global.general_log_file`;
+
+#
+# truncate the existing log - it could be larger than max_allowed_packet
+# and that would cause load_file() below to fail
+#
+--remove_file $MYSQLD_LOGFILE
+flush logs;
+SET @@global.general_log = ON;
+flush logs;
+SET @@global.general_log = OFF;
+
--copy_file $MYSQLD_LOGFILE $MYSQLD_LOGFILE.copy
--echo ## Inserting some Records & Verifying output in log ##
@@ -78,13 +88,12 @@ INSERT into t1(name) values('Record_4');
--copy_file $MYSQLD_LOGFILE $MYSQLD_LOGFILE.orig
--chmod 0777 $MYSQLD_LOGFILE.orig
---echo ## There should be a difference ##
-SET @@global.max_allowed_packet= 1024*1024*1024;
+--echo ## old log is a proper prefix of the new log ##
--replace_result $MYSQLD_LOGFILE MYSQLD_LOGFILE
eval SET @orig_file= load_file('$MYSQLD_LOGFILE.orig');
--replace_result $MYSQLD_LOGFILE MYSQLD_LOGFILE
eval SET @copy_file= load_file('$MYSQLD_LOGFILE.copy');
-eval SELECT STRCMP(@orig_file, @copy_file);
+SELECT @orig_file > @copy_file, left(@orig_file, length(@copy_file)) = @copy_file;
--remove_file $MYSQLD_LOGFILE.copy
--remove_file $MYSQLD_LOGFILE.orig
diff --git a/mysql-test/suite/sys_vars/t/group_concat_max_len_basic.test b/mysql-test/suite/sys_vars/t/group_concat_max_len_basic.test
index 1bc707f4b5d..5a78b4b0571 100644
--- a/mysql-test/suite/sys_vars/t/group_concat_max_len_basic.test
+++ b/mysql-test/suite/sys_vars/t/group_concat_max_len_basic.test
@@ -103,8 +103,8 @@ SET @@global.group_concat_max_len = -1024;
SELECT @@global.group_concat_max_len;
SET @@global.group_concat_max_len = 65536;
SELECT @@global.group_concat_max_len;
---Error ER_PARSE_ERROR
-SET @@global.group_concat_max_len = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.group_concat_max_len = 65530.34;
SELECT @@global.group_concat_max_len;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.group_concat_max_len = test;
@@ -114,11 +114,10 @@ SET @@session.group_concat_max_len = 0;
SELECT @@session.group_concat_max_len;
SET @@session.group_concat_max_len = -2;
SELECT @@session.group_concat_max_len;
---Error ER_PARSE_ERROR
-SET @@session.group_concat_max_len = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.group_concat_max_len = 65530.34;
SET @@session.group_concat_max_len = 65550;
SELECT @@session.group_concat_max_len;
-echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.group_concat_max_len = test;
diff --git a/mysql-test/suite/sys_vars/t/have_profiling_basic.test b/mysql-test/suite/sys_vars/t/have_profiling_basic.test
new file mode 100644
index 00000000000..da0ca88d2e3
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/have_profiling_basic.test
@@ -0,0 +1,23 @@
+#
+# only global
+#
+select @@global.have_profiling="1";
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.have_profiling;
+--replace_column 2 #
+show global variables like 'have_profiling';
+--replace_column 2 #
+show session variables like 'have_profiling';
+--replace_column 2 #
+select * from information_schema.global_variables where variable_name='have_profiling';
+--replace_column 2 #
+select * from information_schema.session_variables where variable_name='have_profiling';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global have_profiling=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session have_profiling=1;
+
diff --git a/mysql-test/suite/sys_vars/t/identity_basic.test b/mysql-test/suite/sys_vars/t/identity_basic.test
index fa5fc807414..2ddec32a621 100644
--- a/mysql-test/suite/sys_vars/t/identity_basic.test
+++ b/mysql-test/suite/sys_vars/t/identity_basic.test
@@ -89,7 +89,6 @@ SET @@session.identity = -1024;
SELECT @@session.identity;
SET @@session.identity = 42949672950;
SELECT @@session.identity;
-echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.identity = ON;
diff --git a/mysql-test/suite/sys_vars/t/ignore_builtin_innodb_basic.test b/mysql-test/suite/sys_vars/t/ignore_builtin_innodb_basic.test
new file mode 100644
index 00000000000..7295c466974
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/ignore_builtin_innodb_basic.test
@@ -0,0 +1,19 @@
+#
+# only global
+#
+select @@global.ignore_builtin_innodb;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.ignore_builtin_innodb;
+show global variables like 'ignore_builtin_innodb';
+show session variables like 'ignore_builtin_innodb';
+select * from information_schema.global_variables where variable_name='ignore_builtin_innodb';
+select * from information_schema.session_variables where variable_name='ignore_builtin_innodb';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global ignore_builtin_innodb=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session ignore_builtin_innodb=1;
+
diff --git a/mysql-test/suite/sys_vars/t/init_connect_basic.test b/mysql-test/suite/sys_vars/t/init_connect_basic.test
index 8557dfbf4fc..b2f2cb92e40 100644
--- a/mysql-test/suite/sys_vars/t/init_connect_basic.test
+++ b/mysql-test/suite/sys_vars/t/init_connect_basic.test
@@ -94,6 +94,11 @@ SELECT @@global.init_connect;
SET @@global.init_connect="SET autocomit=0;REVOKE ALL ON INFORMATION_SCHEMA.*";
SELECT @@global.init_connect;
+SET @@global.init_connect='set @a="12\034"';
+SELECT @@global.init_connect;
+SELECT hex(@@global.init_connect);
+SHOW VARIABLES LIKE 'init_connect';
+
SET @@global.init_connect='SHOW VARIABLES';
SELECT @@global.init_connect;
diff --git a/mysql-test/suite/sys_vars/t/init_file_basic.test b/mysql-test/suite/sys_vars/t/init_file_basic.test
new file mode 100644
index 00000000000..0b59fcd7be5
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/init_file_basic.test
@@ -0,0 +1,19 @@
+#
+# only global
+#
+select @@global.init_file;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.init_file;
+show global variables like 'init_file';
+show session variables like 'init_file';
+select * from information_schema.global_variables where variable_name='init_file';
+select * from information_schema.session_variables where variable_name='init_file';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global init_file=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session init_file=1;
+
diff --git a/mysql-test/suite/sys_vars/t/innodb_commit_concurrency_basic.test b/mysql-test/suite/sys_vars/t/innodb_commit_concurrency_basic.test
index 1ef69e34999..42d172934d1 100644
--- a/mysql-test/suite/sys_vars/t/innodb_commit_concurrency_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_commit_concurrency_basic.test
@@ -74,29 +74,25 @@ SELECT @@global.innodb_commit_concurrency;
SET @@global.innodb_commit_concurrency = 0;
SELECT @@global.innodb_commit_concurrency;
-SET @@global.innodb_commit_concurrency = 1;
-SELECT @@global.innodb_commit_concurrency;
-SET @@global.innodb_commit_concurrency = 1000;
-SELECT @@global.innodb_commit_concurrency;
-
--echo '#--------------------FN_DYNVARS_046_04-------------------------#'
###########################################################################
# Change the value of innodb_commit_concurrency to invalid value #
###########################################################################
+#
+# InnoDB doesn't allow innodb_commit_concurrency to change from
+# zero to non-zero or vice versa
+#
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.innodb_commit_concurrency = 1;
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.innodb_commit_concurrency = -1;
-SELECT @@global.innodb_commit_concurrency;
-
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.innodb_commit_concurrency = "T";
-SELECT @@global.innodb_commit_concurrency;
-
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.innodb_commit_concurrency = "Y";
-SELECT @@global.innodb_commit_concurrency;
-
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.innodb_commit_concurrency = 1001;
-SELECT @@global.innodb_commit_concurrency;
--echo '#----------------------FN_DYNVARS_046_05------------------------#'
#########################################################################
@@ -123,17 +119,6 @@ SELECT @@global.innodb_commit_concurrency;
SET @@global.innodb_commit_concurrency = ON;
SELECT @@global.innodb_commit_concurrency;
---echo '#---------------------FN_DYNVARS_046_07----------------------#'
-###################################################################
-# Check if TRUE and FALSE values can be used on variable #
-###################################################################
-
-
-SET @@global.innodb_commit_concurrency = TRUE;
-SELECT @@global.innodb_commit_concurrency;
-SET @@global.innodb_commit_concurrency = FALSE;
-SELECT @@global.innodb_commit_concurrency;
-
##############################
# Restore initial value #
##############################
diff --git a/mysql-test/suite/sys_vars/inc/innodb_concurrency_tickets_basic.inc b/mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic.test
index 67b0247d169..67b0247d169 100644
--- a/mysql-test/suite/sys_vars/inc/innodb_concurrency_tickets_basic.inc
+++ b/mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic.test
diff --git a/mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic_32.test b/mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic_32.test
deleted file mode 100644
index 13e1b205a4d..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger 2008-05-07 #
-# #
-# Wrapper for 32 bit machines #
-################################################################################
-
---source include/have_32bit.inc
---source suite/sys_vars/inc/innodb_concurrency_tickets_basic.inc
-
diff --git a/mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic_64.test b/mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic_64.test
deleted file mode 100644
index fc26c903de5..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger 2008-05-07 #
-# #
-# Wrapper for 64 bit machines #
-################################################################################
-
---source include/have_64bit.inc
---source suite/sys_vars/inc/innodb_concurrency_tickets_basic.inc
-
diff --git a/mysql-test/suite/sys_vars/inc/innodb_max_purge_lag_basic.inc b/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic.test
index 9e6b8201e3d..9e6b8201e3d 100644
--- a/mysql-test/suite/sys_vars/inc/innodb_max_purge_lag_basic.inc
+++ b/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic.test
diff --git a/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic_32.test b/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic_32.test
deleted file mode 100644
index 8396755844e..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger 2008-05-07 #
-# #
-# Wrapper for 32 bit machines #
-################################################################################
-
---source include/have_32bit.inc
---source suite/sys_vars/inc/innodb_max_purge_lag_basic.inc
-
diff --git a/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic_64.test b/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic_64.test
deleted file mode 100644
index 4744cee20d9..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger 2008-05-07 #
-# #
-# Wrapper for 64 bit machines #
-################################################################################
-
---source include/have_64bit.inc
---source suite/sys_vars/inc/innodb_max_purge_lag_basic.inc
-
diff --git a/mysql-test/suite/sys_vars/t/innodb_support_xa_basic.test b/mysql-test/suite/sys_vars/t/innodb_support_xa_basic.test
index 840fd240bde..65681c4a544 100644
--- a/mysql-test/suite/sys_vars/t/innodb_support_xa_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_support_xa_basic.test
@@ -105,9 +105,9 @@ SELECT @@global.innodb_support_xa;
###########################################################################
# for session
---Error ER_WRONG_VALUE_FOR_VAR
+--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.innodb_support_xa = -0.6;
---Error ER_WRONG_VALUE_FOR_VAR
+--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.innodb_support_xa = 1.6;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.innodb_support_xa = "T";
@@ -121,8 +121,6 @@ SET @@session.innodb_support_xa = ÕN;
SET @@session.innodb_support_xa = OF;
SELECT @@session.innodb_support_xa;
---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.'
-
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.innodb_support_xa = ÓFF;
@@ -146,8 +144,6 @@ SET @@global.innodb_support_xa = ÕN;
SET @@global.innodb_support_xa = OF;
SELECT @@global.innodb_support_xa;
---echo 'Bug# 34828 : OF is taken as OFF and a value of 0 is set.'
-
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.innodb_support_xa = ÓFF;
diff --git a/mysql-test/suite/sys_vars/inc/innodb_sync_spin_loops_basic.inc b/mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic.test
index 35460fe47f2..35460fe47f2 100644
--- a/mysql-test/suite/sys_vars/inc/innodb_sync_spin_loops_basic.inc
+++ b/mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic.test
diff --git a/mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic_32.test b/mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic_32.test
deleted file mode 100644
index 981b6c4e992..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger 2008-05-07 #
-# #
-# Wrapper for 32 bit machines #
-################################################################################
-
---source include/have_32bit.inc
---source suite/sys_vars/inc/innodb_sync_spin_loops_basic.inc
-
diff --git a/mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic_64.test b/mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic_64.test
deleted file mode 100644
index ab7c01c5b6d..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger 2008-05-07 #
-# #
-# Wrapper for 64 bit machines #
-################################################################################
-
---source include/have_64bit.inc
---source suite/sys_vars/inc/innodb_sync_spin_loops_basic.inc
-
diff --git a/mysql-test/suite/sys_vars/t/innodb_table_locks_basic.test b/mysql-test/suite/sys_vars/t/innodb_table_locks_basic.test
index f7d06d18ada..7af8f700f39 100644
--- a/mysql-test/suite/sys_vars/t/innodb_table_locks_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_table_locks_basic.test
@@ -107,7 +107,7 @@ SELECT @@global.innodb_table_locks;
# for session
SET @@session.innodb_table_locks = -6;
---Error ER_WRONG_VALUE_FOR_VAR
+--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.innodb_table_locks = 1.6;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.innodb_table_locks = "T";
@@ -121,8 +121,6 @@ SET @@session.innodb_table_locks = ÕN;
SET @@session.innodb_table_locks = OF;
SELECT @@session.innodb_table_locks;
---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.'
-
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.innodb_table_locks = ÓFF;
@@ -144,8 +142,6 @@ SET @@global.innodb_table_locks = QN;
SET @@global.innodb_table_locks = OF;
SELECT @@global.innodb_table_locks;
---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.'
-
--Error ER_WRONG_TYPE_FOR_VAR
#SET @@global.innodb_table_locks = ÓFF;
diff --git a/mysql-test/suite/sys_vars/t/insert_id_basic.test b/mysql-test/suite/sys_vars/t/insert_id_basic.test
index cfae87095bc..c9d3e1f4e52 100644
--- a/mysql-test/suite/sys_vars/t/insert_id_basic.test
+++ b/mysql-test/suite/sys_vars/t/insert_id_basic.test
@@ -90,8 +90,6 @@ SET @@session.insert_id = -1024;
SELECT @@session.insert_id;
SET @@session.insert_id = 42949672950;
SELECT @@session.insert_id;
-echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.insert_id = ON;
SELECT @@session.insert_id;
diff --git a/mysql-test/suite/sys_vars/t/interactive_timeout_basic.test b/mysql-test/suite/sys_vars/t/interactive_timeout_basic.test
index 0c1a6716348..5f7d0e157f8 100644
--- a/mysql-test/suite/sys_vars/t/interactive_timeout_basic.test
+++ b/mysql-test/suite/sys_vars/t/interactive_timeout_basic.test
@@ -104,8 +104,8 @@ SET @@global.interactive_timeout = -1024;
SELECT @@global.interactive_timeout;
SET @@global.interactive_timeout = 1000000000;
SELECT @@global.interactive_timeout;
---Error ER_PARSE_ERROR
-SET @@global.interactive_timeout = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.interactive_timeout = 65530.34;
SELECT @@global.interactive_timeout;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.interactive_timeout = test;
@@ -115,11 +115,10 @@ SET @@session.interactive_timeout = 0;
SELECT @@session.interactive_timeout;
SET @@session.interactive_timeout = -2;
SELECT @@session.interactive_timeout;
---Error ER_PARSE_ERROR
-SET @@session.interactive_timeout = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.interactive_timeout = 65530.34;
SET @@session.interactive_timeout = 100000000;
SELECT @@session.interactive_timeout;
-echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.interactive_timeout = test;
diff --git a/mysql-test/suite/sys_vars/t/keep_files_on_create_basic.test b/mysql-test/suite/sys_vars/t/keep_files_on_create_basic.test
index bc6ac8687f7..e6141af4bbe 100644
--- a/mysql-test/suite/sys_vars/t/keep_files_on_create_basic.test
+++ b/mysql-test/suite/sys_vars/t/keep_files_on_create_basic.test
@@ -122,7 +122,7 @@ SET @@global.keep_files_on_create = FELSE;
SET @@global.keep_files_on_create = -1024;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.keep_files_on_create = 65536;
---Error ER_WRONG_VALUE_FOR_VAR
+--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.keep_files_on_create = 65530.34;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.keep_files_on_create = test;
@@ -131,17 +131,14 @@ SET @@global.keep_files_on_create = test;
SET @@session.keep_files_on_create = ONN;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.keep_files_on_create = ONF;
-
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.keep_files_on_create = OF;
-SELECT @@session.keep_files_on_create;
---echo 'Bug# 34828: FN_DYNVARS_054_05 - OF is also working as OFF and no error is coming';
-
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.keep_files_on_create = 'OFN';
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.keep_files_on_create = -2;
---Error ER_PARSE_ERROR
-SET @@session.keep_files_on_create = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.keep_files_on_create = 65530.34;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.keep_files_on_create = 65550;
diff --git a/mysql-test/suite/sys_vars/inc/key_buffer_size_basic.inc b/mysql-test/suite/sys_vars/t/key_buffer_size_basic.test
index e55673fd045..354c65490a4 100644
--- a/mysql-test/suite/sys_vars/inc/key_buffer_size_basic.inc
+++ b/mysql-test/suite/sys_vars/t/key_buffer_size_basic.test
@@ -28,12 +28,10 @@
--source include/load_sysvars.inc
-let $minimum_range= BETWEEN 8 AND 36;
########################################################################
# START OF key_buffer_size TESTS #
########################################################################
---disable_warnings
########################################################################
# Saving initial value of key_buffer_size in a temporary variable #
########################################################################
@@ -45,10 +43,8 @@ SET @start_value = @@global.key_buffer_size;
# Display the DEFAULT value of key_buffer_size #
########################################################################
-SET @@global.key_buffer_size = 99;
---Error ER_NO_DEFAULT
SET @@global.key_buffer_size = DEFAULT;
-eval SELECT @@global.key_buffer_size $minimum_range;
+SELECT @@global.key_buffer_size;
--echo '#---------------------FN_DYNVARS_055_02-------------------------#'
###############################################
@@ -63,18 +59,6 @@ SELECT @@global.key_buffer_size = @start_value;
# Change the value of key_buffer_size to a valid value #
########################################################################
-SET @@global.key_buffer_size = 8 ;
-eval SELECT @@global.key_buffer_size $minimum_range;
---disable_warnings
-# The next subtest is set to comment because it will
-# be tried to allocate the buffer instantly which
-# might lead to a message about missing resources,
-# excessive runtime etc. especially if the main memory is less than 4GB.
-#SET @@global.key_buffer_size = 4294967295;
---enable_warnings
-#SELECT @@global.key_buffer_size;
-SET @@global.key_buffer_size = 1800;
-eval SELECT @@global.key_buffer_size $minimum_range;
SET @@global.key_buffer_size = 65535;
SELECT @@global.key_buffer_size;
@@ -83,31 +67,20 @@ SELECT @@global.key_buffer_size;
# Change the value of key_buffer_size to invalid value #
###########################################################################
-# The next subtests are set to comment because they will
-# be tried to allocate the buffer instantly which
-# might lead to a message about missing resources,
-# excessive runtime etc. especially if the main memory is less than 4GB.
-# The negative values lead to very big numbers, e.g. -1 to
-# a size of 18446744073709551615 bytes with a 32bit binary.
-# See Bug #42103.
-#SET @@global.key_buffer_size = -1;
-#SELECT @@global.key_buffer_size;
-#SET @@global.key_buffer_size = 100000000000;
-#SELECT @@global.key_buffer_size;
+--Error ER_WARN_CANT_DROP_DEFAULT_KEYCACHE
+SET @@global.key_buffer_size = -1;
+--Error ER_WARN_CANT_DROP_DEFAULT_KEYCACHE
+SET @@global.key_buffer_size = 4;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.key_buffer_size = 10000.01;
SELECT @@global.key_buffer_size;
-#SET @@global.key_buffer_size = -1024;
-#SELECT @@global.key_buffer_size;
-SET @@global.key_buffer_size = 4;
-eval SELECT @@global.key_buffer_size $minimum_range;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.key_buffer_size = ON;
-eval SELECT @@global.key_buffer_size $minimum_range;
+SELECT @@global.key_buffer_size;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.key_buffer_size = 'test';
-eval SELECT @@global.key_buffer_size $minimum_range;
+SELECT @@global.key_buffer_size;
--echo '#-------------------FN_DYNVARS_055_05----------------------------#'
###########################################################################
@@ -116,7 +89,6 @@ eval SELECT @@global.key_buffer_size $minimum_range;
--Error ER_GLOBAL_VARIABLE
SET @@session.key_buffer_size = 0;
-eval SELECT @@global.key_buffer_size $minimum_range;
--echo '#----------------------FN_DYNVARS_055_06------------------------#'
##############################################################################
@@ -136,13 +108,10 @@ WHERE VARIABLE_NAME='key_buffer_size';
# Check if TRUE and FALSE values can be used on variable #
###################################################################
-# The following assignment are accepted, but should be rejected
-# like the value ON (see above).
-# See Bug #42104
+--Error ER_WARN_CANT_DROP_DEFAULT_KEYCACHE
SET @@global.key_buffer_size = TRUE;
-eval SELECT @@global.key_buffer_size $minimum_range;
+--Error ER_WARN_CANT_DROP_DEFAULT_KEYCACHE
SET @@global.key_buffer_size = FALSE;
-eval SELECT @@global.key_buffer_size $minimum_range;
--echo '#---------------------FN_DYNVARS_055_08----------------------#'
#####################################################################
@@ -150,11 +119,7 @@ eval SELECT @@global.key_buffer_size $minimum_range;
# points to same session variable #
#####################################################################
-# due to differences in contents of the warnings
---disable_warnings
-SET @@global.key_buffer_size = 8 ;
SELECT @@key_buffer_size = @@global.key_buffer_size;
---enable_warnings
--echo '#---------------------FN_DYNVARS_055_09----------------------#'
##########################################################################
@@ -163,7 +128,6 @@ SELECT @@key_buffer_size = @@global.key_buffer_size;
--Error ER_GLOBAL_VARIABLE
SET key_buffer_size = 8 ;
-eval SELECT @@global.key_buffer_size $minimum_range;
--Error ER_PARSE_ERROR
SET local.key_buffer_size = 10;
--Error ER_UNKNOWN_TABLE
@@ -181,7 +145,6 @@ SELECT key_buffer_size = @@session.key_buffer_size;
SET @@global.key_buffer_size = @start_value;
---enable_warnings
#######################################################################
# END OF key_buffer_size TESTS #
#######################################################################
diff --git a/mysql-test/suite/sys_vars/t/key_buffer_size_basic_32.test b/mysql-test/suite/sys_vars/t/key_buffer_size_basic_32.test
deleted file mode 100644
index 086e51e185c..00000000000
--- a/mysql-test/suite/sys_vars/t/key_buffer_size_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger 2008-05-07 #
-# #
-# Wrapper for 32 bit machines #
-################################################################################
-
---source include/have_32bit.inc
---source suite/sys_vars/inc/key_buffer_size_basic.inc
-
diff --git a/mysql-test/suite/sys_vars/t/key_buffer_size_basic_64.test b/mysql-test/suite/sys_vars/t/key_buffer_size_basic_64.test
deleted file mode 100644
index 5604c56480b..00000000000
--- a/mysql-test/suite/sys_vars/t/key_buffer_size_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger 2008-05-07 #
-# #
-# Wrapper for 64 bit machines #
-################################################################################
-
---source include/have_64bit.inc
---source suite/sys_vars/inc/key_buffer_size_basic.inc
-
diff --git a/mysql-test/suite/sys_vars/t/key_buffer_size_func.test b/mysql-test/suite/sys_vars/t/key_buffer_size_func.test
index 8ee305a3ac1..df0ce62c69c 100644
--- a/mysql-test/suite/sys_vars/t/key_buffer_size_func.test
+++ b/mysql-test/suite/sys_vars/t/key_buffer_size_func.test
@@ -86,11 +86,6 @@ connection test_con2;
--echo ## Key_reads must be zero (no disk access) ##
show status like 'Key_reads';
-CONNECTION default;
---disable_warnings
-SET @@global.key_buffer_size = 36;
---enable_warnings
-
--echo ## Connecting with connection test_con1 ##
CONNECTION test_con1;
diff --git a/mysql-test/suite/sys_vars/inc/key_cache_block_size_basic.inc b/mysql-test/suite/sys_vars/t/key_cache_block_size_basic.test
index b12ea45b762..99a3c5dc327 100644
--- a/mysql-test/suite/sys_vars/inc/key_cache_block_size_basic.inc
+++ b/mysql-test/suite/sys_vars/t/key_cache_block_size_basic.test
@@ -43,10 +43,7 @@ SELECT @start_value;
# Display the DEFAULT value of key_cache_block_size #
################################################################################
-SET @@global.key_cache_block_size = 600;
---Error ER_NO_DEFAULT
SET @@global.key_cache_block_size = DEFAULT;
---echo 'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming';
SELECT @@global.key_cache_block_size;
@@ -72,8 +69,6 @@ SET @@global.key_cache_block_size = 1800;
SELECT @@global.key_cache_block_size;
SET @@global.key_cache_block_size = 16383;
SELECT @@global.key_cache_block_size;
---echo 'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming';
-
--echo '#--------------------FN_DYNVARS_057_04-------------------------#'
###########################################################################
@@ -96,8 +91,6 @@ SELECT @@global.key_cache_block_size;
SET @@global.key_cache_block_size = 16385;
SELECT @@global.key_cache_block_size;
-echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.key_cache_block_size = ON;
SELECT @@global.key_cache_block_size;
diff --git a/mysql-test/suite/sys_vars/t/key_cache_block_size_basic_32.test b/mysql-test/suite/sys_vars/t/key_cache_block_size_basic_32.test
deleted file mode 100644
index db0c0bd67a2..00000000000
--- a/mysql-test/suite/sys_vars/t/key_cache_block_size_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger 2008-05-07 #
-# #
-# Wrapper for 32 bit machines #
-################################################################################
-
---source include/have_32bit.inc
---source suite/sys_vars/inc/key_cache_block_size_basic.inc
-
diff --git a/mysql-test/suite/sys_vars/t/key_cache_block_size_basic_64.test b/mysql-test/suite/sys_vars/t/key_cache_block_size_basic_64.test
deleted file mode 100644
index 7403d762dc4..00000000000
--- a/mysql-test/suite/sys_vars/t/key_cache_block_size_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger 2008-05-07 #
-# #
-# Wrapper for 64 bit machines #
-################################################################################
-
---source include/have_64bit.inc
---source suite/sys_vars/inc/key_cache_block_size_basic.inc
-
diff --git a/mysql-test/suite/sys_vars/inc/key_cache_division_limit_basic.inc b/mysql-test/suite/sys_vars/t/key_cache_division_limit_basic.test
index a2cc49a1f38..dd41e4d37a0 100644
--- a/mysql-test/suite/sys_vars/inc/key_cache_division_limit_basic.inc
+++ b/mysql-test/suite/sys_vars/t/key_cache_division_limit_basic.test
@@ -43,10 +43,7 @@ SELECT @start_value;
# Display the DEFAULT value of key_cache_division_limit #
################################################################################
-SET @@global.key_cache_division_limit = 50;
---Error ER_NO_DEFAULT
SET @@global.key_cache_division_limit = DEFAULT;
---echo 'Bug# 34878: This variable has default value according to documentation';
SELECT @@global.key_cache_division_limit;
@@ -95,8 +92,6 @@ SELECT @@global.key_cache_division_limit;
SET @@global.key_cache_division_limit = 65535;
SELECT @@global.key_cache_division_limit;
-echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.key_cache_division_limit = ON;
SELECT @@global.key_cache_division_limit;
diff --git a/mysql-test/suite/sys_vars/t/key_cache_division_limit_basic_32.test b/mysql-test/suite/sys_vars/t/key_cache_division_limit_basic_32.test
deleted file mode 100644
index fcc28438866..00000000000
--- a/mysql-test/suite/sys_vars/t/key_cache_division_limit_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger 2008-05-07 #
-# #
-# Wrapper for 32 bit machines #
-################################################################################
-
---source include/have_32bit.inc
---source suite/sys_vars/inc/key_cache_division_limit_basic.inc
-
diff --git a/mysql-test/suite/sys_vars/t/key_cache_division_limit_basic_64.test b/mysql-test/suite/sys_vars/t/key_cache_division_limit_basic_64.test
deleted file mode 100644
index ac4dd1c96d3..00000000000
--- a/mysql-test/suite/sys_vars/t/key_cache_division_limit_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger 2008-05-07 #
-# #
-# Wrapper for 64 bit machines #
-################################################################################
-
---source include/have_64bit.inc
---source suite/sys_vars/inc/key_cache_division_limit_basic.inc
-
diff --git a/mysql-test/suite/sys_vars/t/large_files_support_basic.test b/mysql-test/suite/sys_vars/t/large_files_support_basic.test
new file mode 100644
index 00000000000..690b32fce66
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/large_files_support_basic.test
@@ -0,0 +1,19 @@
+#
+# only global
+#
+select @@global.large_files_support;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.large_files_support;
+show global variables like 'large_files_support';
+show session variables like 'large_files_support';
+select * from information_schema.global_variables where variable_name='large_files_support';
+select * from information_schema.session_variables where variable_name='large_files_support';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global large_files_support=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session large_files_support=1;
+
diff --git a/mysql-test/suite/sys_vars/t/large_page_size_basic.test b/mysql-test/suite/sys_vars/t/large_page_size_basic.test
new file mode 100644
index 00000000000..cff90336fa0
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/large_page_size_basic.test
@@ -0,0 +1,23 @@
+#
+# only global
+#
+select @@global.large_page_size = 1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.large_page_size;
+--replace_column 2 #
+show global variables like 'large_page_size';
+--replace_column 2 #
+show session variables like 'large_page_size';
+--replace_column 2 #
+select * from information_schema.global_variables where variable_name='large_page_size';
+--replace_column 2 #
+select * from information_schema.session_variables where variable_name='large_page_size';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global large_page_size=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session large_page_size=1;
+
diff --git a/mysql-test/suite/sys_vars/t/large_pages_basic.test b/mysql-test/suite/sys_vars/t/large_pages_basic.test
new file mode 100644
index 00000000000..840b9176832
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/large_pages_basic.test
@@ -0,0 +1,19 @@
+#
+# show the global and session values;
+#
+select @@global.large_pages;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.large_pages;
+show global variables like 'large_pages';
+show session variables like 'large_pages';
+select * from information_schema.global_variables where variable_name='large_pages';
+select * from information_schema.session_variables where variable_name='large_pages';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global large_pages=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session large_pages=1;
+
diff --git a/mysql-test/suite/sys_vars/t/last_insert_id_basic.test b/mysql-test/suite/sys_vars/t/last_insert_id_basic.test
new file mode 100644
index 00000000000..a2e0116f11d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/last_insert_id_basic.test
@@ -0,0 +1,30 @@
+
+#
+# exists as a session only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@global.last_insert_id;
+select @@session.last_insert_id;
+show global variables like 'last_insert_id';
+show session variables like 'last_insert_id';
+select * from information_schema.global_variables where variable_name='last_insert_id';
+select * from information_schema.session_variables where variable_name='last_insert_id';
+
+#
+# show that it's writable
+#
+set session last_insert_id=1;
+select @@session.last_insert_id;
+--error ER_LOCAL_VARIABLE
+set global last_insert_id=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set session last_insert_id=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set session last_insert_id=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set session last_insert_id="foo";
+
diff --git a/mysql-test/suite/sys_vars/t/lc_messages_basic.test b/mysql-test/suite/sys_vars/t/lc_messages_basic.test
new file mode 100644
index 00000000000..f8a25738285
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/lc_messages_basic.test
@@ -0,0 +1,35 @@
+SET @start_global_value = @@global.lc_messages;
+SELECT @start_global_value;
+
+#
+# exists as global and session
+#
+select @@global.lc_messages;
+select @@session.lc_messages;
+show global variables like 'lc_messages';
+show session variables like 'lc_messages';
+select * from information_schema.global_variables where variable_name='lc_messages';
+select * from information_schema.session_variables where variable_name='lc_messages';
+
+#
+# show that it's writable
+#
+set global lc_messages=1;
+select @@global.lc_messages;
+set session lc_messages=2;
+select @@session.lc_messages;
+set global lc_messages="en_US";
+select @@global.lc_messages;
+set session lc_messages="en_GB";
+select @@session.lc_messages;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global lc_messages=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global lc_messages=1e1;
+
+SET @@global.lc_messages = @start_global_value;
+SELECT @@global.lc_messages;
diff --git a/mysql-test/suite/sys_vars/t/lc_messages_dir_basic.test b/mysql-test/suite/sys_vars/t/lc_messages_dir_basic.test
new file mode 100644
index 00000000000..6d452a3655c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/lc_messages_dir_basic.test
@@ -0,0 +1,23 @@
+#
+# only global
+#
+--replace_result $MYSQL_SHAREDIR MYSQL_SHAREDIR
+select @@global.lc_messages_dir;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.lc_messages_dir;
+--replace_result $MYSQL_SHAREDIR MYSQL_SHAREDIR
+show global variables like 'lc_messages_dir';
+--replace_result $MYSQL_SHAREDIR MYSQL_SHAREDIR
+show session variables like 'lc_messages_dir';
+--replace_result $MYSQL_SHAREDIR MYSQL_SHAREDIR
+select * from information_schema.global_variables where variable_name='lc_messages_dir';
+--replace_result $MYSQL_SHAREDIR MYSQL_SHAREDIR
+select * from information_schema.session_variables where variable_name='lc_messages_dir';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global lc_messages_dir=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session lc_messages_dir=1;
diff --git a/mysql-test/suite/sys_vars/t/lc_time_names_basic.test b/mysql-test/suite/sys_vars/t/lc_time_names_basic.test
index d0aa0c56937..68ee00b6ee0 100644
--- a/mysql-test/suite/sys_vars/t/lc_time_names_basic.test
+++ b/mysql-test/suite/sys_vars/t/lc_time_names_basic.test
@@ -178,7 +178,7 @@ SELECT @@session.lc_time_names;
SET @@session.lc_time_names=de_LU;
SELECT @@session.lc_time_names;
---Error ER_UNKNOWN_ERROR
+--error ER_UNKNOWN_LOCALE
SET @@session.lc_time_names=EE;
--echo 'Bug: The locale for Estonian - Estonia is not supported. It is present';
--echo 'in manual';
@@ -322,6 +322,8 @@ SET @@session.lc_time_names=sr_YU;
SELECT @@session.lc_time_names;
SET @@session.lc_time_names=sv_FI;
SELECT @@session.lc_time_names;
+SET @@session.lc_time_names=sr_RS;
+SELECT @@session.lc_time_names;
SET @@session.lc_time_names=sv_SE;
SELECT @@session.lc_time_names;
SET @@session.lc_time_names=ta_IN;
@@ -407,7 +409,7 @@ SELECT @@global.lc_time_names;
SET @@global.lc_time_names=de_LU;
SELECT @@global.lc_time_names;
---Error ER_UNKNOWN_ERROR
+--error ER_UNKNOWN_LOCALE
SET @@global.lc_time_names=EE;
--echo 'Bug: The locale for Estonian - Estonia is not supported. It is';
--echo 'present in manual';
@@ -553,6 +555,8 @@ SET @@global.lc_time_names=sr_YU;
SELECT @@global.lc_time_names;
SET @@global.lc_time_names=sv_FI;
SELECT @@global.lc_time_names;
+SET @@global.lc_time_names=sr_RS;
+SELECT @@global.lc_time_names;
SET @@global.lc_time_names=sv_SE;
SELECT @@global.lc_time_names;
SET @@global.lc_time_names=ta_IN;
@@ -616,27 +620,27 @@ SET @@lc_time_names = 107;
SELECT @@lc_time_names;
SET @@lc_time_names = 108;
SELECT @@lc_time_names;
-
---Error ER_UNKNOWN_ERROR
SET @@lc_time_names = 109;
-
+SELECT @@lc_time_names;
+--Error ER_UNKNOWN_LOCALE
+SET @@lc_time_names = 110;
--echo '#--------------------FN_DYNVARS_060_10-------------------------#'
#############################################################################
# Change the value of lc_time_names to an invalid value for session #
#############################################################################
---Error ER_UNKNOWN_ERROR
+--Error ER_UNKNOWN_LOCALE
SET @@lc_time_names = en_EN;
---Error ER_UNKNOWN_ERROR
+--Error ER_UNKNOWN_LOCALE
SET @@lc_time_names = US_en;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@lc_time_names = 1.1;
---Error ER_UNKNOWN_ERROR
+--Error ER_UNKNOWN_LOCALE
SET @@lc_time_names = -1;
---Error ER_UNKNOWN_ERROR
+--Error ER_UNKNOWN_LOCALE
SET @@lc_time_names = 'en US';
---Error ER_UNKNOWN_ERROR
+--Error ER_UNKNOWN_LOCALE
SET @@lc_time_names = 'enUS';
SET @@lc_time_names = true;
@@ -644,7 +648,7 @@ SELECT @@lc_time_names AS res_with_true;
SET @@lc_time_names = false;
SELECT @@lc_time_names AS res_with_false;
---Error ER_UNKNOWN_ERROR
+--Error ER_UNKNOWN_LOCALE
SET @@lc_time_names = ON;
@@ -653,17 +657,17 @@ SET @@lc_time_names = ON;
# Change the value of lc_time_names to an invalid value for global #
############################################################################
---Error ER_UNKNOWN_ERROR
+--Error ER_UNKNOWN_LOCALE
SET @@global.lc_time_names = en_EN;
---Error ER_UNKNOWN_ERROR
+--Error ER_UNKNOWN_LOCALE
SET @@global.lc_time_names = US_en;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.lc_time_names = 1.1;
---Error ER_UNKNOWN_ERROR
+--Error ER_UNKNOWN_LOCALE
SET @@global.lc_time_names = -1;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.lc_time_names = NULL;
---Error ER_UNKNOWN_ERROR
+--Error ER_UNKNOWN_LOCALE
SET @@global.lc_time_names = 'enUS';
SET @@global.lc_time_names = true;
@@ -671,7 +675,7 @@ SELECT @@global.lc_time_names;
SET @@global.lc_time_names = false;
SELECT @@global.lc_time_names;
---Error ER_UNKNOWN_ERROR
+--Error ER_UNKNOWN_LOCALE
SET @@global.lc_time_names = ON;
--echo '#--------------------FN_DYNVARS_060_12-------------------------#'
diff --git a/mysql-test/suite/sys_vars/t/locked_in_memory_basic.test b/mysql-test/suite/sys_vars/t/locked_in_memory_basic.test
new file mode 100644
index 00000000000..97313b7f608
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/locked_in_memory_basic.test
@@ -0,0 +1,20 @@
+--source include/not_windows.inc
+#
+# only global
+#
+select @@global.locked_in_memory;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.locked_in_memory;
+show global variables like 'locked_in_memory';
+show session variables like 'locked_in_memory';
+select * from information_schema.global_variables where variable_name='locked_in_memory';
+select * from information_schema.session_variables where variable_name='locked_in_memory';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global locked_in_memory=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session locked_in_memory=1;
+
diff --git a/mysql-test/suite/sys_vars/t/log_basic.test b/mysql-test/suite/sys_vars/t/log_basic.test
index 98e99fa4e4f..74b344cff6d 100644
--- a/mysql-test/suite/sys_vars/t/log_basic.test
+++ b/mysql-test/suite/sys_vars/t/log_basic.test
@@ -41,13 +41,9 @@ SELECT @@global.log AS INIT_VALUE;
SELECT @@log AS INIT_VALUE;
-SET @@global.general_log = ON;
-
-SET global general_log = 0;
-
---echo 'Bug# 34832: log is a system but it is not accessible using SET @@global.log;'
---echo 'SET GLOBAL log; and SELECT @@global.log. SHOW VARIABLES shows the value of log.'
+SET @@global.log = ON;
+SET global log = 0;
--echo '#--------------------FN_DYNVARS_062_02-------------------------#'
################################################################################
diff --git a/mysql-test/suite/sys_vars/t/log_bin_basic.test b/mysql-test/suite/sys_vars/t/log_bin_basic.test
new file mode 100644
index 00000000000..0712b42a370
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/log_bin_basic.test
@@ -0,0 +1,19 @@
+#
+# only global
+#
+select @@global.log_bin;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.log_bin;
+show global variables like 'log_bin';
+show session variables like 'log_bin';
+select * from information_schema.global_variables where variable_name='log_bin';
+select * from information_schema.session_variables where variable_name='log_bin';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global log_bin=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session log_bin=1;
+
diff --git a/mysql-test/suite/sys_vars/t/log_bin_trust_function_creators_basic.test b/mysql-test/suite/sys_vars/t/log_bin_trust_function_creators_basic.test
index e7bdb433971..15ffad2742a 100644
--- a/mysql-test/suite/sys_vars/t/log_bin_trust_function_creators_basic.test
+++ b/mysql-test/suite/sys_vars/t/log_bin_trust_function_creators_basic.test
@@ -37,10 +37,6 @@
SET @start_global_value = @@global.log_bin_trust_function_creators;
SELECT @start_global_value;
---echo 'Bug# 34876: TRUE value is coming as Default'
---Error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SET @start_session_value = @@session.log_bin_trust_function_creators;
---echo 'Bug# 34881: According to documentation the scope of this variable is GLOBAL as well as SESSION too';
--echo '#--------------------FN_DYNVARS_063_01-------------------------#'
########################################################################
@@ -99,10 +95,8 @@ SELECT @@session.log_bin_trust_function_creators;
SET @@global.log_bin_trust_function_creators = 'ONN';
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.log_bin_trust_function_creators = "OFFF";
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.log_bin_trust_function_creators = OF;
-
---echo 'Bug# 34828: OF is also working as OFF and no error is coming';
-
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.log_bin_trust_function_creators = TTRUE;
--Error ER_WRONG_VALUE_FOR_VAR
@@ -111,7 +105,7 @@ SET @@global.log_bin_trust_function_creators = FELSE;
SET @@global.log_bin_trust_function_creators = -1024;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.log_bin_trust_function_creators = 65536;
---Error ER_WRONG_VALUE_FOR_VAR
+--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.log_bin_trust_function_creators = 65530.34;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.log_bin_trust_function_creators = test;
diff --git a/mysql-test/suite/sys_vars/t/log_bin_trust_routine_creators_basic.test b/mysql-test/suite/sys_vars/t/log_bin_trust_routine_creators_basic.test
deleted file mode 100644
index 1d44c77b1a7..00000000000
--- a/mysql-test/suite/sys_vars/t/log_bin_trust_routine_creators_basic.test
+++ /dev/null
@@ -1,164 +0,0 @@
-############## mysql-test\t\log_bin_trust_routine_creators_basic.test #########
-# #
-# Variable Name: log_bin_trust_routine_creators #
-# Scope: GLOBAL #
-# Access Type: Dynamic #
-# Data Type: boolean #
-# Default Value: False #
-# Range: #
-# #
-# #
-# Creation Date: 2008-02-12 #
-# Author: Salman #
-# #
-# Description: Test Cases of Dynamic System Variable #
-# log_bin_trust_routine_creators that checks the #
-# behavior of this variable in the following ways #
-# * Default Value #
-# * Valid & Invalid values #
-# * Scope & Access method #
-# * Data Integrity #
-# #
-# Reference: (Not given on website) #
-# #
-###############################################################################
-
---source include/load_sysvars.inc
-####################################################################
-# START OF log_bin_trust_routine_creators TESTS #
-####################################################################
-
-
-#############################################################
-# Save initial value #
-#############################################################
-
-SET @start_global_value = @@global.log_bin_trust_routine_creators;
-SELECT @start_global_value;
-
-
---echo '#--------------------FN_DYNVARS_064_01-------------------------#'
-########################################################################
-# Display the DEFAULT value of log_bin_trust_routine_creators #
-########################################################################
-
-SET @@global.log_bin_trust_routine_creators = TRUE;
-SET @@global.log_bin_trust_routine_creators = DEFAULT;
-SELECT @@global.log_bin_trust_routine_creators;
-
-
---echo '#--------------------FN_DYNVARS_064_02-------------------------#'
-##############################################################################
-# Check the DEFAULT value of log_bin_trust_routine_creators #
-##############################################################################
-
-SET @@global.log_bin_trust_routine_creators = DEFAULT;
-SELECT @@global.log_bin_trust_routine_creators = 'FALSE';
-
-
---echo '#--------------------FN_DYNVARS_064_03-------------------------#'
-##################################################################
-# Change the value of variable to a valid value for GLOBAL Scope #
-##################################################################
-
-SET @@global.log_bin_trust_routine_creators = ON;
-SELECT @@global.log_bin_trust_routine_creators;
-SET @@global.log_bin_trust_routine_creators = OFF;
-SELECT @@global.log_bin_trust_routine_creators;
-SET @@global.log_bin_trust_routine_creators = 0;
-SELECT @@global.log_bin_trust_routine_creators;
-SET @@global.log_bin_trust_routine_creators = 1;
-SELECT @@global.log_bin_trust_routine_creators;
-SET @@global.log_bin_trust_routine_creators = TRUE;
-SELECT @@global.log_bin_trust_routine_creators;
-SET @@global.log_bin_trust_routine_creators = FALSE;
-SELECT @@global.log_bin_trust_routine_creators;
-
-
---echo '#-------------------FN_DYNVARS_064_04----------------------------#'
-###########################################################################
-# Test if accessing session log_bin_trust_routine_creators gives error #
-###########################################################################
-
---Error ER_GLOBAL_VARIABLE
-SET @@session.log_bin_trust_routine_creators = 0;
---Error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT @@session.log_bin_trust_routine_creators;
-
-
---echo '#------------------FN_DYNVARS_064_05-----------------------#'
-##########################################################################
-# Change the value of log_bin_trust_routine_creators to an invalid value #
-##########################################################################
-
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.log_bin_trust_routine_creators = 'ONN';
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.log_bin_trust_routine_creators = "OFFF";
-SET @@global.log_bin_trust_routine_creators = OF;
-SELECT @@global.log_bin_trust_routine_creators;
---echo 'Bug# 34828: OF is also working as OFF and no error is coming';
-
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.log_bin_trust_routine_creators = TTRUE;
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.log_bin_trust_routine_creators = FELSE;
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.log_bin_trust_routine_creators = -1024;
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.log_bin_trust_routine_creators = 65536;
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.log_bin_trust_routine_creators = 65530.34;
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.log_bin_trust_routine_creators = test;
-
-
---echo '#------------------FN_DYNVARS_064_06-----------------------#'
-###############################################################################
-# Check if the value in GLOBAL & SESSION Tables matches value in variable #
-###############################################################################
-
-
-SELECT @@global.log_bin_trust_routine_creators = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='log_bin_trust_routine_creators';
-
---Error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT @@session.log_bin_trust_routine_creators = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='log_bin_trust_routine_creators';
-
-
---echo '#---------------------FN_DYNVARS_064_07----------------------#'
-#################################################################################
-# Check if accessing variable with and without GLOBAL point to same variable #
-#################################################################################
-
-
-SET @@global.log_bin_trust_routine_creators = TRUE;
-SELECT @@log_bin_trust_routine_creators = @@global.log_bin_trust_routine_creators;
-
-
---echo '#---------------------FN_DYNVARS_064_08----------------------#'
-###################################################################
-# Check if variable can be accessed with and without @@ sign #
-###################################################################
-
-SET @@global.log_bin_trust_routine_creators = TRUE;
-SELECT @@log_bin_trust_routine_creators;
---Error ER_UNKNOWN_TABLE
-SELECT local.log_bin_trust_routine_creators;
---Error ER_UNKNOWN_TABLE
-SELECT session.log_bin_trust_routine_creators;
---Error ER_BAD_FIELD_ERROR
-SELECT log_bin_trust_routine_creators = @@session.log_bin_trust_routine_creators;
-
-
-####################################
-# Restore initial value #
-####################################
-
-SET @@global.log_bin_trust_routine_creators = @start_global_value;
-SELECT @@global.log_bin_trust_routine_creators;
-
-
-###################################################################
-# END OF log_bin_trust_routine_creators TESTS #
-###################################################################
-
diff --git a/mysql-test/suite/sys_vars/t/log_error_basic.test b/mysql-test/suite/sys_vars/t/log_error_basic.test
new file mode 100644
index 00000000000..67bd33cb31b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/log_error_basic.test
@@ -0,0 +1,18 @@
+#
+# only global
+#
+select @@global.log_error;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.log_error;
+show global variables like 'log_error';
+show session variables like 'log_error';
+select * from information_schema.global_variables where variable_name='log_error';
+select * from information_schema.session_variables where variable_name='log_error';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global log_error=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session log_error=1;
diff --git a/mysql-test/suite/sys_vars/t/log_output_basic.test b/mysql-test/suite/sys_vars/t/log_output_basic.test
index 45998e85480..b45d30f16a3 100644
--- a/mysql-test/suite/sys_vars/t/log_output_basic.test
+++ b/mysql-test/suite/sys_vars/t/log_output_basic.test
@@ -46,10 +46,6 @@ SELECT @start_value;
SET @@global.log_output = FILE;
SET @@global.log_output = DEFAULT;
SELECT @@global.log_output;
---echo 'Bug# 34876: Documentation specifies a DEFAULT value of TABLE whereas';
---echo 'DEFAULT value is FILE. Also note that initial value is different';
---echo 'from DEFAULT';
-
--echo '#---------------------FN_DYNVARS_065_02-------------------------#'
##################################################
@@ -61,9 +57,6 @@ SET @@global.log_output = NULL;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.log_output = "";
-SELECT @@global.log_output;
---echo 'Bug# 34838: Empty value is allowed where as it is not specified in';
---echo 'documentation';
--echo '#--------------------FN_DYNVARS_065_03------------------------#'
########################################################################
@@ -103,9 +96,6 @@ SELECT @@global.log_output;
SET @@global.log_output = ',TABLE';
SELECT @@global.log_output;
-SET @@global.log_output = ',';
-SELECT @@global.log_output;
-
SET @@global.log_output = 'TABLE,,FILE,,,';
SELECT @@global.log_output;
@@ -117,34 +107,26 @@ SELECT @@global.log_output;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.log_output = -1;
+
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.log_output = TAB;
+
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.log_output = NIL;
+
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.log_output = 'FIL';
+
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.log_output = 'T';
# use of space in value
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.log_output = 'TABLE, FILE';
+
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.log_output = ' TABLE,FILE';
-SET @@global.log_output = ', ';
-SELECT @@global.log_output;
-SET @@global.log_output = ' ';
-SELECT @@global.log_output;
-SET @@global.log_output = ' ';
-SELECT @@global.log_output;
-
---echo 'Bug: The behavior of space in value is not consistent.';
---echo 'Some times it is trimmed and some times not.';
---echo 'The space before and after value is not accepted where as space';
---echo 'between comma is accepted.';
-
-
--echo '#-------------------FN_DYNVARS_065_05----------------------------#'
######################################################################
# Test if accessing session log_output gives error #
@@ -208,6 +190,7 @@ SET @@global.log_output = 8;
SET @@global.log_output = TRUE;
SELECT @@global.log_output;
+
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.log_output = FALSE;
SELECT @@global.log_output;
diff --git a/mysql-test/suite/sys_vars/t/log_queries_not_using_indexes_basic.test b/mysql-test/suite/sys_vars/t/log_queries_not_using_indexes_basic.test
index f7e6e8df640..a726bff08d7 100644
--- a/mysql-test/suite/sys_vars/t/log_queries_not_using_indexes_basic.test
+++ b/mysql-test/suite/sys_vars/t/log_queries_not_using_indexes_basic.test
@@ -56,30 +56,12 @@ SELECT @@global.log_queries_not_using_indexes;
SET GLOBAL log_queries_not_using_indexes= -0;
SELECT @@global.log_queries_not_using_indexes;
+--error ER_WRONG_TYPE_FOR_VAR
SET GLOBAL log_queries_not_using_indexes= 0.00;
-SELECT @@global.log_queries_not_using_indexes;
-
-SET GLOBAL log_queries_not_using_indexes= -0.0;
-SELECT @@global.log_queries_not_using_indexes;
-
-SET GLOBAL log_queries_not_using_indexes= 001.00;
-SELECT @@global.log_queries_not_using_indexes;
-
-SET GLOBAL log_queries_not_using_indexes= +1.0;
-SELECT @@global.log_queries_not_using_indexes;
SET GLOBAL log_queries_not_using_indexes= +0;
SELECT @@global.log_queries_not_using_indexes;
-SET GLOBAL log_queries_not_using_indexes= +0.000000;
-SELECT @@global.log_queries_not_using_indexes;
-
-SET GLOBAL log_queries_not_using_indexes= 0000.00000;
-SELECT @@global.log_queries_not_using_indexes;
-
-SET GLOBAL log_queries_not_using_indexes= .0;
-SELECT @@global.log_queries_not_using_indexes;
-
#################################################################
# Check if the value in GLOBAL Table matches value in variable #
#################################################################
@@ -97,9 +79,6 @@ SET @@global.log_queries_not_using_indexes= BLABLA;
SET @@global.log_queries_not_using_indexes= 25;
--error ER_WRONG_VALUE_FOR_VAR
-SET @@global.log_queries_not_using_indexes= 12.34;
-
---error ER_WRONG_VALUE_FOR_VAR
SET GLOBAL log_queries_not_using_indexes= -1;
SET @badvar= 'true';
@@ -127,7 +106,5 @@ SET @@global log_queries_not_using_indexes= TRUE;
--error ER_PARSE_ERROR
SET @@SESSION log_queries_not_using_indexes= TRUE;
-
SET @@global.log_queries_not_using_indexes= @start_value;
-SELECT IF(@@GLOBAL.log_queries_not_using_indexes, "ON", "OFF") = VARIABLE_VALUE
diff --git a/mysql-test/suite/sys_vars/t/log_slave_updates_basic.test b/mysql-test/suite/sys_vars/t/log_slave_updates_basic.test
new file mode 100644
index 00000000000..93212e4f1ae
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/log_slave_updates_basic.test
@@ -0,0 +1,19 @@
+--source include/not_embedded.inc
+#
+# only global
+#
+select @@global.log_slave_updates;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.log_slave_updates;
+show global variables like 'log_slave_updates';
+show session variables like 'log_slave_updates';
+select * from information_schema.global_variables where variable_name='log_slave_updates';
+select * from information_schema.session_variables where variable_name='log_slave_updates';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global log_slave_updates=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session log_slave_updates=1;
diff --git a/mysql-test/suite/sys_vars/t/log_slow_queries_basic.test b/mysql-test/suite/sys_vars/t/log_slow_queries_basic.test
new file mode 100644
index 00000000000..95dda5b73c9
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/log_slow_queries_basic.test
@@ -0,0 +1,170 @@
+##################### mysql-test\t\slow_query_log_basic.test ###################
+# #
+# Variable Name: log_slow_queries #
+# Scope: GLOBAL #
+# Access Type: Dynamic #
+# Data Type: BOOLEAN #
+# Default Value: OFF #
+# Valid Values: ON, OFF #
+# #
+# #
+# Creation Date: 2008-03-16 #
+# Author: Salman Rawala #
+# #
+# Description: Test Cases of Dynamic System Variable "log_slow_queries" #
+# that checks behavior of this variable in the following ways #
+# * Default Value #
+# * Valid & Invalid values #
+# * Scope & Access method #
+# * Data Integrity #
+# #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
+# server-options.html#option_mysqld_event-scheduler #
+# #
+################################################################################
+
+--source include/load_sysvars.inc
+
+###########################################################
+# START OF log_slow_queries TESTS #
+###########################################################
+
+
+######################################################################
+# Saving initial value of log_slow_queries in a temporary variable #
+######################################################################
+
+SET @start_value = @@global.log_slow_queries;
+SELECT @start_value;
+
+
+--echo '#---------------------FN_DYNVARS_004_01-------------------------#'
+###############################################
+# Verify default value of variable #
+###############################################
+
+SET @@global.log_slow_queries = DEFAULT;
+SELECT @@global.log_slow_queries = 0;
+
+
+--echo '#--------------------FN_DYNVARS_004_02------------------------#'
+######################################################################
+# Change the value of log_slow_queries to a valid value #
+######################################################################
+
+SET @@global.log_slow_queries = ON;
+SELECT @@global.log_slow_queries;
+SET @@global.log_slow_queries = OFF;
+SELECT @@global.log_slow_queries;
+
+--echo '#--------------------FN_DYNVARS_004_03-------------------------#'
+######################################################################
+# Change the value of log_slow_queries to invalid value #
+######################################################################
+
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.log_slow_queries = 2;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.log_slow_queries = -1;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.log_slow_queries = TRUEF;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.log_slow_queries = TRUE_F;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.log_slow_queries = FALSE0;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.log_slow_queries = OON;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.log_slow_queries = ONN;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.log_slow_queries = OOFF;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.log_slow_queries = 0FF;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.log_slow_queries = ' ';
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.log_slow_queries = " ";
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.log_slow_queries = '';
+
+
+--echo '#-------------------FN_DYNVARS_004_04----------------------------#'
+##################################################################
+# Test if accessing session log_slow_queries gives error #
+##################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET @@session.log_slow_queries = OFF;
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.log_slow_queries;
+
+
+--echo '#----------------------FN_DYNVARS_004_05------------------------#'
+##############################################################################
+# Check if the value in GLOBAL Tables matches values in variable #
+##############################################################################
+
+SELECT IF(@@global.log_slow_queries, "ON", "OFF") = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='log_slow_queries';
+
+
+--echo '#---------------------FN_DYNVARS_004_06----------------------#'
+################################################################
+# Check if 0 and 1 values can be used on variable #
+################################################################
+
+SET @@global.log_slow_queries = 0;
+SELECT @@global.log_slow_queries;
+SET @@global.log_slow_queries = 1;
+SELECT @@global.log_slow_queries;
+
+--echo '#---------------------FN_DYNVARS_004_07----------------------#'
+###################################################################
+# Check if TRUE and FALSE values can be used on variable #
+###################################################################
+
+SET @@global.log_slow_queries = TRUE;
+SELECT @@global.log_slow_queries;
+SET @@global.log_slow_queries = FALSE;
+SELECT @@global.log_slow_queries;
+
+--echo '#---------------------FN_DYNVARS_004_08----------------------#'
+##############################################################################
+# Check if accessing variable with SESSION,LOCAL and without SCOPE points #
+# to same session variable #
+##############################################################################
+
+SET @@global.log_slow_queries = ON;
+SELECT @@log_slow_queries = @@global.log_slow_queries;
+
+--echo '#---------------------FN_DYNVARS_004_09----------------------#'
+######################################################################
+# Check if log_slow_queries can be accessed with and without @@ sign #
+######################################################################
+--Error ER_GLOBAL_VARIABLE
+SET log_slow_queries = ON;
+--Error ER_PARSE_ERROR
+SET local.log_slow_queries = OFF;
+--Error ER_UNKNOWN_TABLE
+SELECT local.log_slow_queries;
+--Error ER_PARSE_ERROR
+SET global.log_slow_queries = ON;
+--Error ER_UNKNOWN_TABLE
+SELECT global.log_slow_queries;
+--Error ER_BAD_FIELD_ERROR
+SELECT log_slow_queries = @@session.log_slow_queries;
+
+
+
+##############################
+# Restore initial value #
+##############################
+
+SET @@global.log_slow_queries = @start_value;
+SELECT @@global.log_slow_queries;
+
+
+####################################################
+# END OF log_slow_queries TESTS #
+####################################################
diff --git a/mysql-test/suite/sys_vars/t/long_query_time_basic.test b/mysql-test/suite/sys_vars/t/long_query_time_basic.test
index c21e0a751c1..25b4a698008 100644
--- a/mysql-test/suite/sys_vars/t/long_query_time_basic.test
+++ b/mysql-test/suite/sys_vars/t/long_query_time_basic.test
@@ -105,24 +105,25 @@ SELECT @@session.long_query_time;
# Change the value of long_query_time to an invalid value #
########################################################
+# windows *is* different
+--replace_result +011 +11
SET @@global.long_query_time = 100000000000;
SELECT @@global.long_query_time;
SET @@global.long_query_time = -1;
SELECT @@global.long_query_time;
---Error ER_PARSE_ERROR
-SET @@global.long_query_time = 65530.34.;
+SET @@global.long_query_time = 65530.34;
SELECT @@global.long_query_time;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.long_query_time = test;
SELECT @@global.long_query_time;
+--replace_result +011 +11
SET @@session.long_query_time = 100000000000;
SELECT @@session.long_query_time;
SET @@session.long_query_time = -2;
SELECT @@session.long_query_time;
---Error ER_PARSE_ERROR
-SET @@session.long_query_time = 65530.34.;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@session.long_query_time = 65530.34;
+SELECT @@session.long_query_time;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.long_query_time = test;
diff --git a/mysql-test/suite/sys_vars/t/low_priority_updates_basic.test b/mysql-test/suite/sys_vars/t/low_priority_updates_basic.test
index 762fa726f1f..e00688ef974 100644
--- a/mysql-test/suite/sys_vars/t/low_priority_updates_basic.test
+++ b/mysql-test/suite/sys_vars/t/low_priority_updates_basic.test
@@ -122,7 +122,7 @@ SET @@global.low_priority_updates = FELSE;
SET @@global.low_priority_updates = -1024;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.low_priority_updates = 65536;
---Error ER_WRONG_VALUE_FOR_VAR
+--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.low_priority_updates = 65530.34;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.low_priority_updates = test;
@@ -131,20 +131,16 @@ SET @@global.low_priority_updates = test;
SET @@session.low_priority_updates = ONN;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.low_priority_updates = ONF;
-
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.low_priority_updates = OF;
-SELECT @@session.low_priority_updates;
---echo 'Bug# 34828: OF is also working as OFF and no error is coming';
-
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.low_priority_updates = 'OFN';
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.low_priority_updates = -2;
---Error ER_PARSE_ERROR
-SET @@session.low_priority_updates = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.low_priority_updates = 65530.34;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.low_priority_updates = 65550;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.low_priority_updates = test;
diff --git a/mysql-test/suite/sys_vars/t/lower_case_file_system_basic.test b/mysql-test/suite/sys_vars/t/lower_case_file_system_basic.test
new file mode 100644
index 00000000000..6c15f188880
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/lower_case_file_system_basic.test
@@ -0,0 +1,23 @@
+#
+# only global
+#
+select @@global.lower_case_file_system=2;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.lower_case_file_system;
+--replace_column 2 #
+show global variables like 'lower_case_file_system';
+--replace_column 2 #
+show session variables like 'lower_case_file_system';
+--replace_column 2 #
+select * from information_schema.global_variables where variable_name='lower_case_file_system';
+--replace_column 2 #
+select * from information_schema.session_variables where variable_name='lower_case_file_system';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global lower_case_file_system=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session lower_case_file_system=1;
+
diff --git a/mysql-test/suite/sys_vars/t/lower_case_table_names_basic.test b/mysql-test/suite/sys_vars/t/lower_case_table_names_basic.test
new file mode 100644
index 00000000000..8d6a3bb5ca6
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/lower_case_table_names_basic.test
@@ -0,0 +1,23 @@
+#
+# only global
+#
+select @@global.lower_case_table_names=20;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.lower_case_table_names;
+--replace_column 2 #
+show global variables like 'lower_case_table_names';
+--replace_column 2 #
+show session variables like 'lower_case_table_names';
+--replace_column 2 #
+select * from information_schema.global_variables where variable_name='lower_case_table_names';
+--replace_column 2 #
+select * from information_schema.session_variables where variable_name='lower_case_table_names';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global lower_case_table_names=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session lower_case_table_names=1;
+
diff --git a/mysql-test/suite/sys_vars/t/max_allowed_packet_basic.test b/mysql-test/suite/sys_vars/t/max_allowed_packet_basic.test
index 8be0e5f670e..93303b78639 100644
--- a/mysql-test/suite/sys_vars/t/max_allowed_packet_basic.test
+++ b/mysql-test/suite/sys_vars/t/max_allowed_packet_basic.test
@@ -56,7 +56,7 @@ SELECT @@global.max_allowed_packet;
--Error ER_VARIABLE_IS_READONLY
SET @@session.max_allowed_packet = 20000;
---Error ER_NO_DEFAULT
+--Error ER_VARIABLE_IS_READONLY
SET @@session.max_allowed_packet = DEFAULT;
SELECT @@session.max_allowed_packet;
@@ -79,7 +79,6 @@ SET @@global.max_allowed_packet = 1024;
SELECT @@global.max_allowed_packet;
SET @@global.max_allowed_packet = 1025;
SELECT @@global.max_allowed_packet;
---echo : 'Bug# 34841: "Invalid values are coming in variable on assigning valid value';
SET @@global.max_allowed_packet = 1073741824;
SELECT @@global.max_allowed_packet;
SET @@global.max_allowed_packet = 1073741823;
@@ -120,8 +119,8 @@ SET @@global.max_allowed_packet = 1023;
SELECT @@global.max_allowed_packet;
SET @@global.max_allowed_packet = 10737418241;
SELECT @@global.max_allowed_packet;
---Error ER_PARSE_ERROR
-SET @@global.max_allowed_packet = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.max_allowed_packet = 65530.34;
SELECT @@global.max_allowed_packet;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.max_allowed_packet = test;
@@ -136,12 +135,11 @@ SELECT @@session.max_allowed_packet;
--Error ER_VARIABLE_IS_READONLY
SET @@session.max_allowed_packet = -2;
SELECT @@session.max_allowed_packet;
---Error ER_PARSE_ERROR
-SET @@session.max_allowed_packet = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.max_allowed_packet = 65530.34;
--Error ER_VARIABLE_IS_READONLY
SET @@session.max_allowed_packet = 10737418241;
SELECT @@session.max_allowed_packet;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.max_allowed_packet = test;
diff --git a/mysql-test/suite/sys_vars/inc/max_binlog_cache_size_basic.inc b/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic.test
index 9f3416d2e31..158c21a9489 100644
--- a/mysql-test/suite/sys_vars/inc/max_binlog_cache_size_basic.inc
+++ b/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic.test
@@ -58,7 +58,6 @@ SELECT @@global.max_binlog_cache_size;
SET @@global.max_binlog_cache_size = @start_value;
SELECT @@global.max_binlog_cache_size = 4294967295;
---echo 'Bug# 34876: Incorrect Default Value is assigned to variable';
--echo '#--------------------FN_DYNVARS_072_03------------------------#'
########################################################################
@@ -75,7 +74,6 @@ SET @@global.max_binlog_cache_size = 4097;
SELECT @@global.max_binlog_cache_size;
SET @@global.max_binlog_cache_size = 65535;
SELECT @@global.max_binlog_cache_size;
---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
--echo '#--------------------FN_DYNVARS_072_04-------------------------#'
@@ -99,8 +97,6 @@ SELECT @@global.max_binlog_cache_size;
SET @@global.max_binlog_cache_size = 4095;
SELECT @@global.max_binlog_cache_size;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.max_binlog_cache_size = ON;
SELECT @@global.max_binlog_cache_size;
diff --git a/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic_32.test b/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic_32.test
deleted file mode 100644
index 51386b1f994..00000000000
--- a/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger 2008-05-07 #
-# #
-# Wrapper for 32 bit machines #
-################################################################################
-
---source include/have_32bit.inc
---source suite/sys_vars/inc/max_binlog_cache_size_basic.inc
-
diff --git a/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic_64.test b/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic_64.test
deleted file mode 100644
index c7c757341fa..00000000000
--- a/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger 2008-05-07 #
-# #
-# Wrapper for 64 bit machines #
-################################################################################
-
---source include/have_64bit.inc
---source suite/sys_vars/inc/max_binlog_cache_size_basic.inc
-
diff --git a/mysql-test/suite/sys_vars/t/max_binlog_size_basic.test b/mysql-test/suite/sys_vars/t/max_binlog_size_basic.test
index 11d01b5c10f..4d2574a7890 100644
--- a/mysql-test/suite/sys_vars/t/max_binlog_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/max_binlog_size_basic.test
@@ -45,7 +45,6 @@ SELECT @start_value;
SET @@global.max_binlog_size = 5000;
SET @@global.max_binlog_size = DEFAULT;
SELECT @@global.max_binlog_size;
---echo 'Bug# 34878: This variable has invalid default value as compared to documentation';
--echo '#---------------------FN_DYNVARS_072_02-------------------------#'
###############################################
@@ -70,7 +69,6 @@ SET @@global.max_binlog_size = 4097;
SELECT @@global.max_binlog_size;
SET @@global.max_binlog_size = 65535;
SELECT @@global.max_binlog_size;
---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
--echo '#--------------------FN_DYNVARS_072_04-------------------------#'
@@ -94,8 +92,6 @@ SELECT @@global.max_binlog_size;
SET @@global.max_binlog_size = 4095;
SELECT @@global.max_binlog_size;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.max_binlog_size = ON;
SELECT @@global.max_binlog_size;
diff --git a/mysql-test/suite/sys_vars/t/max_connections_basic.test b/mysql-test/suite/sys_vars/t/max_connections_basic.test
index ffc964db28f..346f7d8f460 100644
--- a/mysql-test/suite/sys_vars/t/max_connections_basic.test
+++ b/mysql-test/suite/sys_vars/t/max_connections_basic.test
@@ -46,8 +46,6 @@ SELECT @start_value;
SET @@global.max_connections = 5000;
SET @@global.max_connections = DEFAULT;
SELECT @@global.max_connections;
---echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
-
--echo '#---------------------FN_DYNVARS_074_02-------------------------#'
###############################################
@@ -73,7 +71,6 @@ SET @@global.max_connections = 1;
SELECT @@global.max_connections;
SET @@global.max_connections = 2;
SELECT @@global.max_connections;
---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
--echo '#--------------------FN_DYNVARS_074_04-------------------------#'
@@ -95,8 +92,6 @@ SELECT @@global.max_connections;
SET @@global.max_connections = 100001;
SELECT @@global.max_connections;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.max_connections = ON;
SELECT @@global.max_connections;
diff --git a/mysql-test/suite/sys_vars/t/max_delayed_threads_basic.test b/mysql-test/suite/sys_vars/t/max_delayed_threads_basic.test
index dc908c8396b..43947500339 100644
--- a/mysql-test/suite/sys_vars/t/max_delayed_threads_basic.test
+++ b/mysql-test/suite/sys_vars/t/max_delayed_threads_basic.test
@@ -51,7 +51,6 @@ SELECT @@global.max_delayed_threads;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.max_delayed_threads = 1000;
---echo 'Bug# 34882: Valid values are not allowed to assign in this variable';
SET @@session.max_delayed_threads = DEFAULT;
SELECT @@session.max_delayed_threads;
@@ -77,7 +76,6 @@ SET @@global.max_delayed_threads = 1;
SELECT @@global.max_delayed_threads;
SET @@global.max_delayed_threads = 1025;
SELECT @@global.max_delayed_threads;
---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
SET @@global.max_delayed_threads = 0;
SELECT @@global.max_delayed_threads;
@@ -119,24 +117,20 @@ SET @@global.max_delayed_threads = -1;
SELECT @@global.max_delayed_threads;
SET @@global.max_delayed_threads = 16385;
SELECT @@global.max_delayed_threads;
---Error ER_PARSE_ERROR
-SET @@global.max_delayed_threads = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.max_delayed_threads = 65530.34;
SELECT @@global.max_delayed_threads;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.max_delayed_threads = test;
SELECT @@global.max_delayed_threads;
---Error ER_WRONG_VALUE_FOR_VAR
SET @@session.max_delayed_threads = 16385;
SELECT @@session.max_delayed_threads;
---Error ER_WRONG_VALUE_FOR_VAR
SET @@session.max_delayed_threads = -1;
SELECT @@session.max_delayed_threads;
---Error ER_WRONG_VALUE_FOR_VAR
SET @@session.max_delayed_threads = -2;
SELECT @@session.max_delayed_threads;
---Error ER_PARSE_ERROR
-SET @@session.max_delayed_threads = 65530.34.;
---Error ER_WRONG_VALUE_FOR_VAR
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.max_delayed_threads = 65530.34;
SET @@session.max_delayed_threads = 10737418241;
SELECT @@session.max_delayed_threads;
diff --git a/mysql-test/suite/sys_vars/t/max_error_count_basic.test b/mysql-test/suite/sys_vars/t/max_error_count_basic.test
index 2b1e12843cf..987cc1592df 100644
--- a/mysql-test/suite/sys_vars/t/max_error_count_basic.test
+++ b/mysql-test/suite/sys_vars/t/max_error_count_basic.test
@@ -75,7 +75,6 @@ SET @@global.max_error_count = 1;
SELECT @@global.max_error_count;
SET @@global.max_error_count = 0;
SELECT @@global.max_error_count;
---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
SET @@global.max_error_count = 65535;
SELECT @@global.max_error_count;
@@ -110,8 +109,8 @@ SET @@global.max_error_count = 65536;
SELECT @@global.max_error_count;
SET @@global.max_error_count = 10737418241;
SELECT @@global.max_error_count;
---Error ER_PARSE_ERROR
-SET @@global.max_error_count = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.max_error_count = 65530.34;
SELECT @@global.max_error_count;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.max_error_count = test;
@@ -123,11 +122,10 @@ SET @@session.max_error_count = 65536;
SELECT @@session.max_error_count;
SET @@session.max_error_count = -2;
SELECT @@session.max_error_count;
---Error ER_PARSE_ERROR
-SET @@session.max_error_count = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.max_error_count = 65530.34;
SET @@session.max_error_count = 10737418241;
SELECT @@session.max_error_count;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.max_error_count = test;
diff --git a/mysql-test/suite/sys_vars/inc/max_heap_table_size_basic.inc b/mysql-test/suite/sys_vars/t/max_heap_table_size_basic.test
index d07ae094cde..4b9c7cf3b8e 100644
--- a/mysql-test/suite/sys_vars/inc/max_heap_table_size_basic.inc
+++ b/mysql-test/suite/sys_vars/t/max_heap_table_size_basic.test
@@ -81,8 +81,6 @@ SET @@global.max_heap_table_size = 4294967294;
SELECT @@global.max_heap_table_size;
SET @@global.max_heap_table_size = 4294967295;
SELECT @@global.max_heap_table_size;
---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-
--echo '#--------------------FN_DYNVARS_077_04-------------------------#'
#############################################################################
@@ -99,8 +97,6 @@ SET @@session.max_heap_table_size = 4294967294;
SELECT @@session.max_heap_table_size;
SET @@session.max_heap_table_size = 4294967295;
SELECT @@session.max_heap_table_size;
---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-
--echo '#------------------FN_DYNVARS_077_05-----------------------#'
##############################################################
@@ -117,8 +113,8 @@ SET @@global.max_heap_table_size = 16383;
SELECT @@global.max_heap_table_size;
SET @@global.max_heap_table_size = 4294967296;
SELECT @@global.max_heap_table_size;
---Error ER_PARSE_ERROR
-SET @@global.max_heap_table_size = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.max_heap_table_size = 65530.34;
SELECT @@global.max_heap_table_size;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.max_heap_table_size = test;
@@ -130,11 +126,10 @@ SET @@session.max_heap_table_size = 16383;
SELECT @@session.max_heap_table_size;
SET @@session.max_heap_table_size = 4294967296;
SELECT @@session.max_heap_table_size;
---Error ER_PARSE_ERROR
-SET @@session.max_heap_table_size = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.max_heap_table_size = 65530.34;
SET @@session.max_heap_table_size = 10737418241;
SELECT @@session.max_heap_table_size;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.max_heap_table_size = test;
diff --git a/mysql-test/suite/sys_vars/t/max_heap_table_size_basic_32.test b/mysql-test/suite/sys_vars/t/max_heap_table_size_basic_32.test
deleted file mode 100644
index 180c41a5ecf..00000000000
--- a/mysql-test/suite/sys_vars/t/max_heap_table_size_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger 2008-05-07 #
-# #
-# Wrapper for 32 bit machines #
-################################################################################
-
---source include/have_32bit.inc
---source suite/sys_vars/inc/max_heap_table_size_basic.inc
-
diff --git a/mysql-test/suite/sys_vars/t/max_heap_table_size_basic_64.test b/mysql-test/suite/sys_vars/t/max_heap_table_size_basic_64.test
deleted file mode 100644
index 89d234f5399..00000000000
--- a/mysql-test/suite/sys_vars/t/max_heap_table_size_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger 2008-05-07 #
-# #
-# Wrapper for 64 bit machines #
-################################################################################
-
---source include/have_64bit.inc
---source suite/sys_vars/inc/max_heap_table_size_basic.inc
-
diff --git a/mysql-test/suite/sys_vars/t/max_insert_delayed_threads_basic.test b/mysql-test/suite/sys_vars/t/max_insert_delayed_threads_basic.test
index d165ddc11fe..3646743a9ae 100644
--- a/mysql-test/suite/sys_vars/t/max_insert_delayed_threads_basic.test
+++ b/mysql-test/suite/sys_vars/t/max_insert_delayed_threads_basic.test
@@ -1,17 +1,17 @@
############## mysql-test\t\max_insert_delayed_threads_basic.test ###############
# #
-# Variable Name: max_insert_delayed_threads #
+# Variable Name: max_insert_delayed_threads #
# Scope: GLOBAL | SESSION #
# Access Type: Dynamic #
-# Data Type: numeric #
-# Default Value: - #
-# Range: - #
+# Data Type: numeric #
+# Default Value: 20 #
+# Range: 0-16384 #
# #
# #
# Creation Date: 2008-02-07 #
-# Author: Salman #
+# Author: Salman #
# #
-# Description: Test Cases of Dynamic System Variable max_insert_delayed_threads #
+# Description: Test Cases of Dynamic System Variable max_insert_delayed_threads #
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
@@ -26,7 +26,7 @@
--source include/load_sysvars.inc
##################################################################
-# START OF max_insert_delayed_threads TESTS #
+# START OF max_insert_delayed_threads TESTS #
##################################################################
@@ -40,47 +40,42 @@ SET @start_session_value = @@session.max_insert_delayed_threads;
SELECT @start_session_value;
---echo '#--------------------FN_DYNVARS_078_01-------------------------#'
+--echo '#--------------------FN_DYNVARS_075_01-------------------------#'
##################################################################
-# Display the DEFAULT value of max_insert_delayed_threads #
+# Display the DEFAULT value of max_insert_delayed_threads #
##################################################################
SET @@global.max_insert_delayed_threads = 1000;
---Error ER_NO_DEFAULT
SET @@global.max_insert_delayed_threads = DEFAULT;
SELECT @@global.max_insert_delayed_threads;
-
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.max_insert_delayed_threads = 1000;
SET @@session.max_insert_delayed_threads = DEFAULT;
SELECT @@session.max_insert_delayed_threads;
---echo '#--------------------FN_DYNVARS_078_02-------------------------#'
+--echo '#--------------------FN_DYNVARS_075_02-------------------------#'
##################################################################
-# Check the DEFAULT value of max_insert_delayed_threads #
+# Check the DEFAULT value of max_insert_delayed_threads #
##################################################################
---Error ER_NO_DEFAULT
SET @@global.max_insert_delayed_threads = DEFAULT;
SELECT @@global.max_insert_delayed_threads = 20;
SET @@session.max_insert_delayed_threads = DEFAULT;
SELECT @@session.max_insert_delayed_threads = 20;
---echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
---echo '#--------------------FN_DYNVARS_078_03-------------------------#'
-###############################################################$$$$$$$$#############
+--echo '#--------------------FN_DYNVARS_075_03-------------------------#'
+############################################################################
# Change the value of max_insert_delayed_threads to a valid value for GLOBAL Scope #
-###############################################################$$$$$$$$#############
+############################################################################
SET @@global.max_insert_delayed_threads = 1;
SELECT @@global.max_insert_delayed_threads;
SET @@global.max_insert_delayed_threads = 1025;
SELECT @@global.max_insert_delayed_threads;
---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-
SET @@global.max_insert_delayed_threads = 0;
SELECT @@global.max_insert_delayed_threads;
SET @@global.max_insert_delayed_threads = 16384;
@@ -88,10 +83,10 @@ SELECT @@global.max_insert_delayed_threads;
SET @@global.max_insert_delayed_threads = 16383;
SELECT @@global.max_insert_delayed_threads;
---echo '#--------------------FN_DYNVARS_078_04-------------------------#'
-#####################################################################################
+--echo '#--------------------FN_DYNVARS_075_04-------------------------#'
+#############################################################################
# Change the value of max_insert_delayed_threads to a valid value for SESSION Scope #
-#####################################################################################
+#############################################################################
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.max_insert_delayed_threads = 1;
@@ -99,7 +94,7 @@ SELECT @@session.max_insert_delayed_threads;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.max_insert_delayed_threads = 1025;
SELECT @@session.max_insert_delayed_threads;
-
+
SET @@session.max_insert_delayed_threads = 0;
SELECT @@session.max_insert_delayed_threads;
--Error ER_WRONG_VALUE_FOR_VAR
@@ -110,10 +105,10 @@ SET @@session.max_insert_delayed_threads = 16383;
SELECT @@session.max_insert_delayed_threads;
---echo '#------------------FN_DYNVARS_078_05-----------------------#'
-######################################################################
+--echo '#------------------FN_DYNVARS_075_05-----------------------#'
+##############################################################
# Change the value of max_insert_delayed_threads to an invalid value #
-######################################################################
+##############################################################
SET @@global.max_insert_delayed_threads = -1024;
SELECT @@global.max_insert_delayed_threads;
@@ -121,24 +116,20 @@ SET @@global.max_insert_delayed_threads = -1;
SELECT @@global.max_insert_delayed_threads;
SET @@global.max_insert_delayed_threads = 16385;
SELECT @@global.max_insert_delayed_threads;
---Error ER_PARSE_ERROR
-SET @@global.max_insert_delayed_threads = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.max_insert_delayed_threads = 65530.34;
SELECT @@global.max_insert_delayed_threads;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.max_insert_delayed_threads = test;
SELECT @@global.max_insert_delayed_threads;
---Error ER_WRONG_VALUE_FOR_VAR
SET @@session.max_insert_delayed_threads = 16385;
SELECT @@session.max_insert_delayed_threads;
---Error ER_WRONG_VALUE_FOR_VAR
SET @@session.max_insert_delayed_threads = -1;
SELECT @@session.max_insert_delayed_threads;
---Error ER_WRONG_VALUE_FOR_VAR
SET @@session.max_insert_delayed_threads = -2;
SELECT @@session.max_insert_delayed_threads;
---Error ER_PARSE_ERROR
-SET @@session.max_insert_delayed_threads = 65530.34.;
---Error ER_WRONG_VALUE_FOR_VAR
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.max_insert_delayed_threads = 65530.34;
SET @@session.max_insert_delayed_threads = 10737418241;
SELECT @@session.max_insert_delayed_threads;
@@ -148,7 +139,7 @@ SET @@session.max_insert_delayed_threads = test;
SELECT @@session.max_insert_delayed_threads;
---echo '#------------------FN_DYNVARS_078_06-----------------------#'
+--echo '#------------------FN_DYNVARS_075_06-----------------------#'
####################################################################
# Check if the value in GLOBAL Table matches value in variable #
####################################################################
@@ -158,7 +149,7 @@ SELECT @@global.max_insert_delayed_threads = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='max_insert_delayed_threads';
---echo '#------------------FN_DYNVARS_078_07-----------------------#'
+--echo '#------------------FN_DYNVARS_075_07-----------------------#'
####################################################################
# Check if the value in SESSION Table matches value in variable #
####################################################################
@@ -168,7 +159,7 @@ FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='max_insert_delayed_threads';
---echo '#------------------FN_DYNVARS_078_08-----------------------#'
+--echo '#------------------FN_DYNVARS_075_08-----------------------#'
####################################################################
# Check if TRUE and FALSE values can be used on variable #
####################################################################
@@ -179,7 +170,7 @@ SET @@global.max_insert_delayed_threads = FALSE;
SELECT @@global.max_insert_delayed_threads;
---echo '#---------------------FN_DYNVARS_078_09----------------------#'
+--echo '#---------------------FN_DYNVARS_001_09----------------------#'
#################################################################################
# Check if accessing variable with and without GLOBAL point to same variable #
#################################################################################
@@ -188,7 +179,7 @@ SET @@global.max_insert_delayed_threads = 2048;
SELECT @@max_insert_delayed_threads = @@global.max_insert_delayed_threads;
---echo '#---------------------FN_DYNVARS_078_10----------------------#'
+--echo '#---------------------FN_DYNVARS_001_10----------------------#'
########################################################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
########################################################################################################
@@ -199,10 +190,10 @@ SELECT @@max_insert_delayed_threads = @@local.max_insert_delayed_threads;
SELECT @@local.max_insert_delayed_threads = @@session.max_insert_delayed_threads;
---echo '#---------------------FN_DYNVARS_078_11----------------------#'
-#####################################################################################
+--echo '#---------------------FN_DYNVARS_001_11----------------------#'
+#############################################################################
# Check if max_insert_delayed_threads can be accessed with and without @@ sign #
-#####################################################################################
+#############################################################################
--Error ER_WRONG_VALUE_FOR_VAR
SET max_insert_delayed_threads = 1024;
@@ -225,7 +216,7 @@ SET @@session.max_insert_delayed_threads = @start_session_value;
SELECT @@session.max_insert_delayed_threads;
-###############################################################
+#######################################################
# END OF max_insert_delayed_threads TESTS #
-###############################################################
+#######################################################
diff --git a/mysql-test/suite/sys_vars/t/max_join_size_basic.test b/mysql-test/suite/sys_vars/t/max_join_size_basic.test
new file mode 100644
index 00000000000..7566ab11520
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/max_join_size_basic.test
@@ -0,0 +1,42 @@
+SET @start_global_value = @@global.max_join_size;
+SELECT @start_global_value;
+
+#
+# exists as global and session
+#
+select @@global.max_join_size;
+select @@session.max_join_size;
+show global variables like 'max_join_size';
+show session variables like 'max_join_size';
+select * from information_schema.global_variables where variable_name='max_join_size';
+select * from information_schema.session_variables where variable_name='max_join_size';
+
+#
+# show that it's writable
+#
+set global max_join_size=10;
+select @@global.max_join_size;
+set session max_join_size=20;
+select @@session.max_join_size;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global max_join_size=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global max_join_size=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global max_join_size="foo";
+
+#
+# affects OPTION_BIG_SELECTS
+#
+select @@sql_big_selects;
+set max_join_size=cast(-1 as unsigned int);
+select @@sql_big_selects;
+set max_join_size=100;
+select @@sql_big_selects;
+
+SET @@global.max_join_size = @start_global_value;
+SELECT @@global.max_join_size;
diff --git a/mysql-test/suite/sys_vars/t/max_length_for_sort_data_basic.test b/mysql-test/suite/sys_vars/t/max_length_for_sort_data_basic.test
index 682e14146d7..167c2052d11 100644
--- a/mysql-test/suite/sys_vars/t/max_length_for_sort_data_basic.test
+++ b/mysql-test/suite/sys_vars/t/max_length_for_sort_data_basic.test
@@ -118,8 +118,8 @@ SET @@global.max_length_for_sort_data = 8388609;
SELECT @@global.max_length_for_sort_data;
SET @@global.max_length_for_sort_data = 0;
SELECT @@global.max_length_for_sort_data;
---Error ER_PARSE_ERROR
-SET @@global.max_length_for_sort_data = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.max_length_for_sort_data = 65530.34;
SELECT @@global.max_length_for_sort_data;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.max_length_for_sort_data = test;
@@ -133,8 +133,8 @@ SET @@session.max_length_for_sort_data = 3;
SELECT @@session.max_length_for_sort_data;
SET @@session.max_length_for_sort_data = 0;
SELECT @@session.max_length_for_sort_data;
---Error ER_PARSE_ERROR
-SET @@session.max_length_for_sort_data = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.max_length_for_sort_data = 65530.34;
SET @@session.max_length_for_sort_data = 10737418241;
SELECT @@session.max_length_for_sort_data;
--Error ER_WRONG_TYPE_FOR_VAR
diff --git a/mysql-test/suite/sys_vars/t/max_prepared_stmt_count_basic.test b/mysql-test/suite/sys_vars/t/max_prepared_stmt_count_basic.test
index 2206a388abb..5bf5d9c8834 100644
--- a/mysql-test/suite/sys_vars/t/max_prepared_stmt_count_basic.test
+++ b/mysql-test/suite/sys_vars/t/max_prepared_stmt_count_basic.test
@@ -97,8 +97,6 @@ SELECT @@global.max_prepared_stmt_count;
SET @@global.max_prepared_stmt_count = 104857612;
SELECT @@global.max_prepared_stmt_count;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.max_prepared_stmt_count = ON;
SELECT @@global.max_prepared_stmt_count;
diff --git a/mysql-test/suite/sys_vars/t/max_relay_log_size_basic.test b/mysql-test/suite/sys_vars/t/max_relay_log_size_basic.test
index b780aa2b444..e39778baca8 100644
--- a/mysql-test/suite/sys_vars/t/max_relay_log_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/max_relay_log_size_basic.test
@@ -56,8 +56,6 @@ SELECT @@global.max_relay_log_size;
SET @@global.max_relay_log_size = @start_value;
SELECT @@global.max_relay_log_size = 1024;
---echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
-
--echo '#--------------------FN_DYNVARS_082_03------------------------#'
#####################################################################
@@ -74,7 +72,6 @@ SET @@global.max_relay_log_size = 1073741823;
SELECT @@global.max_relay_log_size;
SET @@global.max_relay_log_size = 65535;
SELECT @@global.max_relay_log_size;
---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
--echo '#--------------------FN_DYNVARS_082_04-------------------------#'
########################################################################
@@ -95,8 +92,6 @@ SELECT @@global.max_relay_log_size;
SET @@global.max_relay_log_size = 10737418241;
SELECT @@global.max_relay_log_size;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.max_relay_log_size = ON;
SELECT @@global.max_relay_log_size;
diff --git a/mysql-test/suite/sys_vars/t/max_sort_length_basic.test b/mysql-test/suite/sys_vars/t/max_sort_length_basic.test
index 1198d7b1851..9c3b88d3c3c 100644
--- a/mysql-test/suite/sys_vars/t/max_sort_length_basic.test
+++ b/mysql-test/suite/sys_vars/t/max_sort_length_basic.test
@@ -119,8 +119,8 @@ SET @@global.max_sort_length = 8388609;
SELECT @@global.max_sort_length;
SET @@global.max_sort_length = 0;
SELECT @@global.max_sort_length;
---Error ER_PARSE_ERROR
-SET @@global.max_sort_length = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.max_sort_length = 65530.34;
SELECT @@global.max_sort_length;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.max_sort_length = test;
@@ -134,8 +134,8 @@ SET @@session.max_sort_length = 3;
SELECT @@session.max_sort_length;
SET @@session.max_sort_length = 0;
SELECT @@session.max_sort_length;
---Error ER_PARSE_ERROR
-SET @@session.max_sort_length = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.max_sort_length = 65530.34;
SET @@session.max_sort_length = 10737418241;
SELECT @@session.max_sort_length;
--Error ER_WRONG_TYPE_FOR_VAR
diff --git a/mysql-test/suite/sys_vars/t/max_sp_recursion_depth_basic.test b/mysql-test/suite/sys_vars/t/max_sp_recursion_depth_basic.test
index 8089951c8a2..1d3d69548f8 100644
--- a/mysql-test/suite/sys_vars/t/max_sp_recursion_depth_basic.test
+++ b/mysql-test/suite/sys_vars/t/max_sp_recursion_depth_basic.test
@@ -119,8 +119,8 @@ SET @@global.max_sp_recursion_depth = -1;
SELECT @@global.max_sp_recursion_depth;
SET @@global.max_sp_recursion_depth = 3000;
SELECT @@global.max_sp_recursion_depth;
---Error ER_PARSE_ERROR
-SET @@global.max_sp_recursion_depth = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.max_sp_recursion_depth = 65530.34;
SELECT @@global.max_sp_recursion_depth;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.max_sp_recursion_depth = test;
@@ -134,8 +134,8 @@ SET @@session.max_sp_recursion_depth = 500000;
SELECT @@session.max_sp_recursion_depth;
SET @@session.max_sp_recursion_depth = -001;
SELECT @@session.max_sp_recursion_depth;
---Error ER_PARSE_ERROR
-SET @@session.max_sp_recursion_depth = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.max_sp_recursion_depth = 65530.34;
SET @@session.max_sp_recursion_depth = 10737418241;
SELECT @@session.max_sp_recursion_depth;
--Error ER_WRONG_TYPE_FOR_VAR
diff --git a/mysql-test/suite/sys_vars/t/max_user_connections_basic.test b/mysql-test/suite/sys_vars/t/max_user_connections_basic.test
index eb231bd8076..1adcc012bc4 100644
--- a/mysql-test/suite/sys_vars/t/max_user_connections_basic.test
+++ b/mysql-test/suite/sys_vars/t/max_user_connections_basic.test
@@ -49,12 +49,8 @@ SET @@global.max_user_connections = 1000;
SET @@global.max_user_connections = DEFAULT;
SELECT @@global.max_user_connections;
---Error ER_GLOBAL_VARIABLE
+--Error ER_VARIABLE_IS_READONLY
SET @@session.max_user_connections = 1000;
---Error ER_NO_DEFAULT
-SET @@session.max_user_connections = DEFAULT;
-SELECT @@session.max_user_connections;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--echo '#--------------------FN_DYNVARS_087_02-------------------------#'
@@ -65,10 +61,9 @@ SELECT @@session.max_user_connections;
SET @@global.max_user_connections = DEFAULT;
SELECT @@global.max_user_connections = 0;
---Error ER_NO_DEFAULT
+--Error ER_VARIABLE_IS_READONLY
SET @@session.max_user_connections = DEFAULT;
-SELECT @@session.max_user_connections = 0;
-
+SELECT @@session.max_user_connections;
--echo '#--------------------FN_DYNVARS_087_03-------------------------#'
@@ -102,8 +97,8 @@ SET @@global.max_user_connections = -1;
SELECT @@global.max_user_connections;
SET @@global.max_user_connections = 429496729500;
SELECT @@global.max_user_connections;
---Error ER_PARSE_ERROR
-SET @@global.max_user_connections = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.max_user_connections = 65530.34;
SELECT @@global.max_user_connections;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.max_user_connections = test;
diff --git a/mysql-test/suite/sys_vars/t/maximum_basic-master.opt b/mysql-test/suite/sys_vars/t/maximum_basic-master.opt
new file mode 100644
index 00000000000..b6e5666f4fb
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/maximum_basic-master.opt
@@ -0,0 +1,3 @@
+--maximum-auto-increment-increment=8192
+--maximum-tmp-table-size=8192
+--maximum-max-join-size=8192
diff --git a/mysql-test/suite/sys_vars/t/maximum_basic.test b/mysql-test/suite/sys_vars/t/maximum_basic.test
new file mode 100644
index 00000000000..9961f65883a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/maximum_basic.test
@@ -0,0 +1,20 @@
+#
+# test for --maximum- my_getopt prefix
+#
+
+#
+# ulong
+#
+SET @@session.auto_increment_increment=40960;
+SELECT @@session.auto_increment_increment;
+#
+# ulonglong
+#
+SET @@session.tmp_table_size=40960;
+SELECT @@session.tmp_table_size;
+#
+# ha_rows
+#
+SET @@session.max_join_size=40960;
+SELECT @@session.max_join_size;
+
diff --git a/mysql-test/suite/sys_vars/t/myisam_data_pointer_size_basic.test b/mysql-test/suite/sys_vars/t/myisam_data_pointer_size_basic.test
index d151c6000b8..bd1992500d3 100644
--- a/mysql-test/suite/sys_vars/t/myisam_data_pointer_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/myisam_data_pointer_size_basic.test
@@ -101,16 +101,13 @@ SET @@global.myisam_data_pointer_size = 1;
SELECT @@global.myisam_data_pointer_size;
SET @@global.myisam_data_pointer_size = 4294967296;
SELECT @@global.myisam_data_pointer_size;
---Error ER_PARSE_ERROR
-SET @@global.myisam_data_pointer_size = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.myisam_data_pointer_size = 65530.34;
SELECT @@global.myisam_data_pointer_size;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.myisam_data_pointer_size = two;
SELECT @@global.myisam_data_pointer_size;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
-
--echo '#------------------FN_DYNVARS_093_06-----------------------#'
####################################################################
# Check if the value in GLOBAL Table matches value in variable #
diff --git a/mysql-test/suite/sys_vars/t/myisam_data_pointer_size_func.test b/mysql-test/suite/sys_vars/t/myisam_data_pointer_size_func.test
index 37dd3a5a297..6f1a50cf64e 100644
--- a/mysql-test/suite/sys_vars/t/myisam_data_pointer_size_func.test
+++ b/mysql-test/suite/sys_vars/t/myisam_data_pointer_size_func.test
@@ -19,6 +19,8 @@
# #
################################################################################
+call mtr.add_suppression("The table 't1' is full");
+
--echo '#--------------------FN_DYNVARS_093_01-------------------------#'
###############################################################################
# Check if setting myisam_data_pointer_size is changed in every new connection#
diff --git a/mysql-test/suite/sys_vars/t/myisam_mmap_size_basic.test b/mysql-test/suite/sys_vars/t/myisam_mmap_size_basic.test
new file mode 100644
index 00000000000..ac887711514
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/myisam_mmap_size_basic.test
@@ -0,0 +1,18 @@
+#
+# only global
+#
+select @@global.myisam_mmap_size;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.myisam_mmap_size;
+show global variables like 'myisam_mmap_size';
+show session variables like 'myisam_mmap_size';
+select * from information_schema.global_variables where variable_name='myisam_mmap_size';
+select * from information_schema.session_variables where variable_name='myisam_mmap_size';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global myisam_mmap_size=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session myisam_mmap_size=1;
diff --git a/mysql-test/suite/sys_vars/t/myisam_recover_options_basic.test b/mysql-test/suite/sys_vars/t/myisam_recover_options_basic.test
new file mode 100644
index 00000000000..4d1b07844b6
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/myisam_recover_options_basic.test
@@ -0,0 +1,18 @@
+#
+# only global
+#
+select @@global.myisam_recover_options;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.myisam_recover_options;
+show global variables like 'myisam_recover_options';
+show session variables like 'myisam_recover_options';
+select * from information_schema.global_variables where variable_name='myisam_recover_options';
+select * from information_schema.session_variables where variable_name='myisam_recover_options';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global myisam_recover_options=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session myisam_recover_options=1;
diff --git a/mysql-test/suite/sys_vars/t/myisam_stats_method_basic.test b/mysql-test/suite/sys_vars/t/myisam_stats_method_basic.test
index 0045842269b..f70431b5580 100644
--- a/mysql-test/suite/sys_vars/t/myisam_stats_method_basic.test
+++ b/mysql-test/suite/sys_vars/t/myisam_stats_method_basic.test
@@ -154,30 +154,8 @@ SELECT @@global.myisam_stats_method;
# use of decimal values
+--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.myisam_stats_method = 0.4;
-SELECT @@global.myisam_stats_method;
-
-SET @@global.myisam_stats_method = 1.0;
-SELECT @@global.myisam_stats_method;
-
-SET @@global.myisam_stats_method = 1.1;
-SELECT @@global.myisam_stats_method;
-
-SET @@global.myisam_stats_method = 1.5;
-SELECT @@global.myisam_stats_method;
-
-SET @@global.myisam_stats_method = 2.49;
-SELECT @@global.myisam_stats_method;
-
-SET @@session.myisam_stats_method = 0.5;
-SELECT @@session.myisam_stats_method;
-
-SET @@session.myisam_stats_method = 1.6;
-SELECT @@session.myisam_stats_method;
-
-
---echo 'Bug# 34877: Decimal values can be used within the range [0.0-2.5). Values';
---echo 'are rounded to 0,1,2 as evident from outcome.';
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.myisam_stats_method = 3;
diff --git a/mysql-test/suite/sys_vars/t/named_pipe_basic.test b/mysql-test/suite/sys_vars/t/named_pipe_basic.test
new file mode 100644
index 00000000000..f3b83a71974
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/named_pipe_basic.test
@@ -0,0 +1,19 @@
+--source include/windows.inc
+#
+# only global
+#
+select @@global.named_pipe;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.named_pipe;
+show global variables like 'named_pipe';
+show session variables like 'named_pipe';
+select * from information_schema.global_variables where variable_name='named_pipe';
+select * from information_schema.session_variables where variable_name='named_pipe';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global named_pipe=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session named_pipe=1;
diff --git a/mysql-test/suite/sys_vars/t/net_buffer_length_basic.test b/mysql-test/suite/sys_vars/t/net_buffer_length_basic.test
index 6e1e0559c61..b8336910021 100644
--- a/mysql-test/suite/sys_vars/t/net_buffer_length_basic.test
+++ b/mysql-test/suite/sys_vars/t/net_buffer_length_basic.test
@@ -57,7 +57,7 @@ SELECT @@global.net_buffer_length;
--Error ER_VARIABLE_IS_READONLY
SET @@session.net_buffer_length = 20000;
---Error ER_NO_DEFAULT
+--Error ER_VARIABLE_IS_READONLY
SET @@session.net_buffer_length = DEFAULT;
SELECT @@session.net_buffer_length;
@@ -86,15 +86,13 @@ SET @@global.net_buffer_length = 1048575;
SELECT @@global.net_buffer_length;
SET @@global.net_buffer_length = 65535;
SELECT @@global.net_buffer_length;
---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-
--echo '#--------------------FN_DYNVARS_109_04-------------------------#'
############################################################################
# Change the value of net_buffer_length to a valid value for SESSION Scope #
############################################################################
-# Bug#22891: SESSION net_buffer_length is now read-only; assignments skipped
+# SESSION net_buffer_length is now read-only; assignments skipped
--echo '#------------------FN_DYNVARS_109_05-----------------------#'
@@ -112,16 +110,14 @@ SET @@global.net_buffer_length = 1048577;
SELECT @@global.net_buffer_length;
SET @@global.net_buffer_length = 104857633;
SELECT @@global.net_buffer_length;
---Error ER_PARSE_ERROR
-SET @@global.net_buffer_length = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.net_buffer_length = 65530.34;
SELECT @@global.net_buffer_length;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.net_buffer_length = test;
SELECT @@global.net_buffer_length;
-# Bug#22891: SESSION net_buffer_length is now read-only; assignments skipped
-
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+# SESSION net_buffer_length is now read-only; assignments skipped
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.net_buffer_length = test;
@@ -173,7 +169,7 @@ SELECT @@net_buffer_length = @@global.net_buffer_length;
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
########################################################################################################
-# Bug#22891: SESSION net_buffer_length is now read-only; assignments skipped
+# SESSION net_buffer_length is now read-only; assignments skipped
--echo '#---------------------FN_DYNVARS_109_11----------------------#'
@@ -181,7 +177,7 @@ SELECT @@net_buffer_length = @@global.net_buffer_length;
# Check if net_buffer_length can be accessed with and without @@ sign #
############################################################################
-# Bug#22891: SESSION net_buffer_length is now read-only; assignments skipped
+# SESSION net_buffer_length is now read-only; assignments skipped
SELECT @@net_buffer_length;
--Error ER_UNKNOWN_TABLE
SELECT local.net_buffer_length;
diff --git a/mysql-test/suite/sys_vars/t/net_read_timeout_basic.test b/mysql-test/suite/sys_vars/t/net_read_timeout_basic.test
index f0d32302e4f..0eb78e412e3 100644
--- a/mysql-test/suite/sys_vars/t/net_read_timeout_basic.test
+++ b/mysql-test/suite/sys_vars/t/net_read_timeout_basic.test
@@ -104,8 +104,8 @@ SET @@global.net_read_timeout = -1024;
SELECT @@global.net_read_timeout;
SET @@global.net_read_timeout = 655360354;
SELECT @@global.net_read_timeout;
---Error ER_PARSE_ERROR
-SET @@global.net_read_timeout = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.net_read_timeout = 65530.34;
SELECT @@global.net_read_timeout;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.net_read_timeout = test;
@@ -115,11 +115,10 @@ SET @@session.net_read_timeout = 0;
SELECT @@session.net_read_timeout;
SET @@session.net_read_timeout = -2;
SELECT @@session.net_read_timeout;
---Error ER_PARSE_ERROR
-SET @@session.net_read_timeout = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.net_read_timeout = 65530.34;
SET @@session.net_read_timeout = 6555015425;
SELECT @@session.net_read_timeout;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.net_read_timeout = test;
diff --git a/mysql-test/suite/sys_vars/t/net_write_timeout_basic.test b/mysql-test/suite/sys_vars/t/net_write_timeout_basic.test
index 84c682561e3..bd8a8b0530d 100644
--- a/mysql-test/suite/sys_vars/t/net_write_timeout_basic.test
+++ b/mysql-test/suite/sys_vars/t/net_write_timeout_basic.test
@@ -104,8 +104,8 @@ SET @@global.net_write_timeout = -1024;
SELECT @@global.net_write_timeout;
SET @@global.net_write_timeout = 655360354;
SELECT @@global.net_write_timeout;
---Error ER_PARSE_ERROR
-SET @@global.net_write_timeout = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.net_write_timeout = 65530.34;
SELECT @@global.net_write_timeout;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.net_write_timeout = test;
@@ -115,11 +115,10 @@ SET @@session.net_write_timeout = 0;
SELECT @@session.net_write_timeout;
SET @@session.net_write_timeout = -2;
SELECT @@session.net_write_timeout;
---Error ER_PARSE_ERROR
-SET @@session.net_write_timeout = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.net_write_timeout = 65530.34;
SET @@session.net_write_timeout = 6555015425;
SELECT @@session.net_write_timeout;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.net_write_timeout = test;
diff --git a/mysql-test/suite/sys_vars/t/new_basic.test b/mysql-test/suite/sys_vars/t/new_basic.test
index cf0ba08dfdb..017ba2eb264 100644
--- a/mysql-test/suite/sys_vars/t/new_basic.test
+++ b/mysql-test/suite/sys_vars/t/new_basic.test
@@ -121,7 +121,7 @@ SET @@global.new = FELSE;
SET @@global.new = -1024;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.new = 65536;
---Error ER_WRONG_VALUE_FOR_VAR
+--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.new = 65530.34;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.new = test;
@@ -130,17 +130,14 @@ SET @@global.new = test;
SET @@session.new = ONN;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.new = ONF;
-
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.new = OF;
-SELECT @@session.new;
---echo 'Bug# 34828: FN_DYNVARS_113_05 - OF is also working as OFF and no error is coming';
-
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.new = 'OFN';
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.new = -2;
---Error ER_PARSE_ERROR
-SET @@session.new = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.new = 65530.34;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.new = 65550;
diff --git a/mysql-test/suite/sys_vars/t/old_alter_table_basic.test b/mysql-test/suite/sys_vars/t/old_alter_table_basic.test
new file mode 100644
index 00000000000..32d0f45ad25
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/old_alter_table_basic.test
@@ -0,0 +1,33 @@
+SET @start_global_value = @@global.old_alter_table;
+SELECT @start_global_value;
+
+#
+# exists as global and session
+#
+select @@global.old_alter_table;
+select @@session.old_alter_table;
+show global variables like 'old_alter_table';
+show session variables like 'old_alter_table';
+select * from information_schema.global_variables where variable_name='old_alter_table';
+select * from information_schema.session_variables where variable_name='old_alter_table';
+
+#
+# show that it's writable
+#
+set global old_alter_table=1;
+select @@global.old_alter_table;
+set session old_alter_table=ON;
+select @@session.old_alter_table;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global old_alter_table=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global old_alter_table=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global old_alter_table="foo";
+
+SET @@global.old_alter_table = @start_global_value;
+SELECT @@global.old_alter_table;
diff --git a/mysql-test/suite/sys_vars/t/old_basic.test b/mysql-test/suite/sys_vars/t/old_basic.test
new file mode 100644
index 00000000000..2c123d17165
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/old_basic.test
@@ -0,0 +1,19 @@
+#
+# show the global and session values;
+#
+select @@global.old;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.old;
+show global variables like 'old';
+show session variables like 'old';
+select * from information_schema.global_variables where variable_name='old';
+select * from information_schema.session_variables where variable_name='old';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global old=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session old=1;
+
diff --git a/mysql-test/suite/sys_vars/t/old_passwords_basic.test b/mysql-test/suite/sys_vars/t/old_passwords_basic.test
index 34a9394a1e7..f4965ad7528 100644
--- a/mysql-test/suite/sys_vars/t/old_passwords_basic.test
+++ b/mysql-test/suite/sys_vars/t/old_passwords_basic.test
@@ -121,7 +121,7 @@ SET @@global.old_passwords = FELSE;
SET @@global.old_passwords = -1024;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.old_passwords = 65536;
---Error ER_WRONG_VALUE_FOR_VAR
+--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.old_passwords = 65530.34;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.old_passwords = test;
@@ -130,17 +130,14 @@ SET @@global.old_passwords = test;
SET @@session.old_passwords = ONN;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.old_passwords = ONF;
-
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.old_passwords = OF;
-SELECT @@session.old_passwords;
---echo 'Bug# 34828: OF is also working as OFF and no error is coming';
-
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.old_passwords = 'OFN';
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.old_passwords = -2;
---Error ER_PARSE_ERROR
-SET @@session.old_passwords = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.old_passwords = 65530.34;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.old_passwords = 65550;
diff --git a/mysql-test/suite/sys_vars/t/open_files_limit_basic.test b/mysql-test/suite/sys_vars/t/open_files_limit_basic.test
new file mode 100644
index 00000000000..50c0b2d5b6e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/open_files_limit_basic.test
@@ -0,0 +1,24 @@
+#
+# show the global and session values;
+#
+--replace_result 3072 1024 16384 1024
+select @@global.open_files_limit;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.open_files_limit;
+--replace_result 3072 1024 16384 1024
+show global variables like 'open_files_limit';
+--replace_result 3072 1024 16384 1024
+show session variables like 'open_files_limit';
+--replace_result 3072 1024 16384 1024
+select * from information_schema.global_variables where variable_name='open_files_limit';
+--replace_result 3072 1024 16384 1024
+select * from information_schema.session_variables where variable_name='open_files_limit';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global open_files_limit=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session open_files_limit=1;
+
diff --git a/mysql-test/suite/sys_vars/t/optimizer_prune_level_basic.test b/mysql-test/suite/sys_vars/t/optimizer_prune_level_basic.test
index 58c074d7d5e..1e3a8bc3d7f 100644
--- a/mysql-test/suite/sys_vars/t/optimizer_prune_level_basic.test
+++ b/mysql-test/suite/sys_vars/t/optimizer_prune_level_basic.test
@@ -146,12 +146,11 @@ SET @@session.optimizer_prune_level = OF;
SET @@session.optimizer_prune_level = 'OFN';
SET @@session.optimizer_prune_level = -2;
SELECT @@session.optimizer_prune_level;
---Error ER_PARSE_ERROR
-SET @@session.optimizer_prune_level = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.optimizer_prune_level = 65530.34;
SET @@session.optimizer_prune_level = 65550;
SELECT @@session.optimizer_prune_level;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.optimizer_prune_level = test;
diff --git a/mysql-test/suite/sys_vars/t/optimizer_search_depth_basic.test b/mysql-test/suite/sys_vars/t/optimizer_search_depth_basic.test
index 42548c59d40..eda7992bbd5 100644
--- a/mysql-test/suite/sys_vars/t/optimizer_search_depth_basic.test
+++ b/mysql-test/suite/sys_vars/t/optimizer_search_depth_basic.test
@@ -107,8 +107,8 @@ SET @@global.optimizer_search_depth = -1;
SELECT @@global.optimizer_search_depth;
SET @@global.optimizer_search_depth = 65536;
SELECT @@global.optimizer_search_depth;
---Error ER_PARSE_ERROR
-SET @@global.optimizer_search_depth = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.optimizer_search_depth = 65530.34;
SELECT @@global.optimizer_search_depth;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.optimizer_search_depth = test;
@@ -118,11 +118,10 @@ SET @@session.optimizer_search_depth = 64;
SELECT @@session.optimizer_search_depth;
SET @@session.optimizer_search_depth = -2;
SELECT @@session.optimizer_search_depth;
---Error ER_PARSE_ERROR
-SET @@session.optimizer_search_depth = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.optimizer_search_depth = 65530.34;
SET @@session.optimizer_search_depth = 65550;
SELECT @@session.optimizer_search_depth;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.optimizer_search_depth = test;
diff --git a/mysql-test/suite/sys_vars/t/optimizer_switch_basic.test b/mysql-test/suite/sys_vars/t/optimizer_switch_basic.test
new file mode 100644
index 00000000000..32a77c90b34
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/optimizer_switch_basic.test
@@ -0,0 +1,41 @@
+SET @start_global_value = @@global.optimizer_switch;
+SELECT @start_global_value;
+
+#
+# exists as global and session
+#
+select @@global.optimizer_switch;
+select @@session.optimizer_switch;
+show global variables like 'optimizer_switch';
+show session variables like 'optimizer_switch';
+select * from information_schema.global_variables where variable_name='optimizer_switch';
+select * from information_schema.session_variables where variable_name='optimizer_switch';
+
+#
+# show that it's writable
+#
+set global optimizer_switch=10;
+select @@global.optimizer_switch;
+set session optimizer_switch=5;
+select @@session.optimizer_switch;
+set global optimizer_switch="index_merge_sort_union=on";
+select @@global.optimizer_switch;
+set session optimizer_switch="index_merge=off";
+select @@session.optimizer_switch;
+set session optimizer_switch="default";
+select @@session.optimizer_switch;
+
+#
+# incorrect assignments
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global optimizer_switch=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global optimizer_switch=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set session optimizer_switch="index_merge";
+--error ER_WRONG_VALUE_FOR_VAR
+set session optimizer_switch="foobar";
+
+SET @@global.optimizer_switch = @start_global_value;
+SELECT @@global.optimizer_switch;
diff --git a/mysql-test/suite/sys_vars/t/pid_file_basic.test b/mysql-test/suite/sys_vars/t/pid_file_basic.test
new file mode 100644
index 00000000000..f4253593bc6
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/pid_file_basic.test
@@ -0,0 +1,23 @@
+#
+# only global
+#
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+select @@global.pid_file;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.pid_file;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+show global variables like 'pid_file';
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+show session variables like 'pid_file';
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+select * from information_schema.global_variables where variable_name='pid_file';
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+select * from information_schema.session_variables where variable_name='pid_file';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global pid_file=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session pid_file=1;
diff --git a/mysql-test/suite/sys_vars/t/plugin_dir_basic.test b/mysql-test/suite/sys_vars/t/plugin_dir_basic.test
new file mode 100644
index 00000000000..d714950c807
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/plugin_dir_basic.test
@@ -0,0 +1,29 @@
+#
+# only global
+#
+
+#
+# on windows it's <basedir>/lib/plugin
+# on unix it's <basedir>/lib/mysql/plugin
+#
+--replace_result $MYSQL_LIBDIR MYSQL_LIBDIR /mysql/ /
+select @@global.plugin_dir;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.plugin_dir;
+--replace_result $MYSQL_LIBDIR MYSQL_LIBDIR /mysql/ /
+show global variables like 'plugin_dir';
+--replace_result $MYSQL_LIBDIR MYSQL_LIBDIR /mysql/ /
+show session variables like 'plugin_dir';
+--replace_result $MYSQL_LIBDIR MYSQL_LIBDIR /mysql/ /
+select * from information_schema.global_variables where variable_name='plugin_dir';
+--replace_result $MYSQL_LIBDIR MYSQL_LIBDIR /mysql/ /
+select * from information_schema.session_variables where variable_name='plugin_dir';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global plugin_dir=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session plugin_dir=1;
+
diff --git a/mysql-test/suite/sys_vars/t/port_basic.test b/mysql-test/suite/sys_vars/t/port_basic.test
new file mode 100644
index 00000000000..e20ee119f5e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/port_basic.test
@@ -0,0 +1,23 @@
+#
+# only global
+#
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+select @@global.port;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.port;
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+show global variables like 'port';
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+show session variables like 'port';
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+select * from information_schema.global_variables where variable_name='port';
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+select * from information_schema.session_variables where variable_name='port';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global port=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session port=1;
diff --git a/mysql-test/suite/sys_vars/t/preload_buffer_size_basic.test b/mysql-test/suite/sys_vars/t/preload_buffer_size_basic.test
index 48b1e32676a..8eba7bba079 100644
--- a/mysql-test/suite/sys_vars/t/preload_buffer_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/preload_buffer_size_basic.test
@@ -112,8 +112,8 @@ SET @@global.preload_buffer_size = 1023;
SELECT @@global.preload_buffer_size;
SET @@global.preload_buffer_size = 1073741825;
SELECT @@global.preload_buffer_size;
---Error ER_PARSE_ERROR
-SET @@global.preload_buffer_size = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.preload_buffer_size = 65530.34;
SELECT @@global.preload_buffer_size;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.preload_buffer_size = test;
@@ -123,13 +123,12 @@ SET @@session.preload_buffer_size = 64;
SELECT @@session.preload_buffer_size;
SET @@session.preload_buffer_size = -2;
SELECT @@session.preload_buffer_size;
---Error ER_PARSE_ERROR
-SET @@session.preload_buffer_size = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.preload_buffer_size = 65530.34;
SET @@session.preload_buffer_size = 1023;
SELECT @@session.preload_buffer_size;
SET @@session.preload_buffer_size = 1073741825;
SELECT @@session.preload_buffer_size;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.preload_buffer_size = test;
diff --git a/mysql-test/suite/sys_vars/t/profiling_basic.test b/mysql-test/suite/sys_vars/t/profiling_basic.test
new file mode 100644
index 00000000000..aef56e50900
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/profiling_basic.test
@@ -0,0 +1,35 @@
+--source include/have_profiling.inc
+
+SET @start_global_value = @@global.profiling;
+SELECT @start_global_value;
+
+#
+# exists as global and session
+#
+select @@global.profiling;
+select @@session.profiling;
+show global variables like 'profiling';
+show session variables like 'profiling';
+select * from information_schema.global_variables where variable_name='profiling';
+select * from information_schema.session_variables where variable_name='profiling';
+
+#
+# show that it's writable
+#
+set global profiling=1;
+select @@global.profiling;
+set session profiling=ON;
+select @@session.profiling;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global profiling=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global profiling=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global profiling="foo";
+
+SET @@global.profiling = @start_global_value;
+SELECT @@global.profiling;
diff --git a/mysql-test/suite/sys_vars/t/profiling_history_size_basic.test b/mysql-test/suite/sys_vars/t/profiling_history_size_basic.test
new file mode 100644
index 00000000000..01d3533be3d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/profiling_history_size_basic.test
@@ -0,0 +1,43 @@
+--source include/have_profiling.inc
+
+SET @start_global_value = @@global.profiling_history_size;
+SELECT @start_global_value;
+
+#
+# exists as global and session
+#
+select @@global.profiling_history_size;
+select @@session.profiling_history_size;
+show global variables like 'profiling_history_size';
+show session variables like 'profiling_history_size';
+select * from information_schema.global_variables where variable_name='profiling_history_size';
+select * from information_schema.session_variables where variable_name='profiling_history_size';
+
+#
+# show that it's writable
+#
+set global profiling_history_size=10;
+select @@global.profiling_history_size;
+set session profiling_history_size=20;
+select @@session.profiling_history_size;
+
+#
+# incorrect assignments
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global profiling_history_size=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global profiling_history_size=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global profiling_history_size="foo";
+
+#
+# min/max
+#
+set session profiling_history_size=0;
+select @@profiling_history_size;
+set session profiling_history_size=101;
+select @@profiling_history_size;
+
+SET @@global.profiling_history_size = @start_global_value;
+SELECT @@global.profiling_history_size;
diff --git a/mysql-test/suite/sys_vars/t/protocol_version_basic.test b/mysql-test/suite/sys_vars/t/protocol_version_basic.test
new file mode 100644
index 00000000000..3446932b7e1
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/protocol_version_basic.test
@@ -0,0 +1,18 @@
+#
+# only global
+#
+select @@global.protocol_version;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.protocol_version;
+show global variables like 'protocol_version';
+show session variables like 'protocol_version';
+select * from information_schema.global_variables where variable_name='protocol_version';
+select * from information_schema.session_variables where variable_name='protocol_version';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global protocol_version=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session protocol_version=1;
diff --git a/mysql-test/suite/sys_vars/t/pseudo_thread_id_basic.test b/mysql-test/suite/sys_vars/t/pseudo_thread_id_basic.test
new file mode 100644
index 00000000000..a948f2a8ff0
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/pseudo_thread_id_basic.test
@@ -0,0 +1,32 @@
+
+#
+# exists as a session only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@global.pseudo_thread_id;
+select @@session.pseudo_thread_id=0;
+show global variables like 'pseudo_thread_id';
+--replace_column 2 #
+show session variables like 'pseudo_thread_id';
+select * from information_schema.global_variables where variable_name='pseudo_thread_id';
+--replace_column 2 #
+select * from information_schema.session_variables where variable_name='pseudo_thread_id';
+
+#
+# show that it's writable
+#
+set session pseudo_thread_id=1;
+select @@session.pseudo_thread_id;
+--error ER_LOCAL_VARIABLE
+set global pseudo_thread_id=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set session pseudo_thread_id=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set session pseudo_thread_id=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set session pseudo_thread_id="foo";
+
diff --git a/mysql-test/suite/sys_vars/t/query_cache_type_basic.test b/mysql-test/suite/sys_vars/t/query_cache_type_basic.test
index ba7e26a3065..5c395fde1e6 100644
--- a/mysql-test/suite/sys_vars/t/query_cache_type_basic.test
+++ b/mysql-test/suite/sys_vars/t/query_cache_type_basic.test
@@ -107,15 +107,10 @@ SET @@global.query_cache_type = -1;
SET @@global.query_cache_type = ONDEMAND;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.query_cache_type = 'ON,OFF';
-
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.query_cache_type = 'OF';
-SELECT @@global.query_cache_type;
-
---echo 'Bug# 34828: OF is taken as OFF.'
-
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.query_cache_type = YES;
-
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.query_cache_type = ' ';
@@ -156,30 +151,8 @@ SELECT @@global.query_cache_type;
# use of decimal values
+--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.query_cache_type = 0.4;
-SELECT @@global.query_cache_type;
-
-SET @@global.query_cache_type = 1.0;
-SELECT @@global.query_cache_type;
-
-SET @@global.query_cache_type = 1.1;
-SELECT @@global.query_cache_type;
-
-SET @@global.query_cache_type = 1.5;
-SELECT @@global.query_cache_type;
-
-SET @@global.query_cache_type = 2.49;
-SELECT @@global.query_cache_type;
-
-SET @@session.query_cache_type = 0.5;
-SELECT @@session.query_cache_type;
-
-SET @@session.query_cache_type = 1.6;
-SELECT @@session.query_cache_type;
-
-
---echo 'Bug: Decimal values can be used within the range [0.0-2.5). Values';
---echo 'are rounded to 0,1,2 as evident from outcome.';
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.query_cache_type = 3;
diff --git a/mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_basic.test b/mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_basic.test
index 5acb36961af..055c3629d15 100644
--- a/mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_basic.test
+++ b/mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_basic.test
@@ -105,7 +105,7 @@ SELECT @@global.query_cache_wlock_invalidate;
# for session
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.query_cache_wlock_invalidate = -1;
---Error ER_WRONG_VALUE_FOR_VAR
+--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.query_cache_wlock_invalidate = 1.6;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.query_cache_wlock_invalidate = "T";
@@ -115,12 +115,8 @@ SET @@session.query_cache_wlock_invalidate = "Y";
SET @@session.query_cache_wlock_invalidate = TRÜE;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.query_cache_wlock_invalidate = ÕN;
-
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.query_cache_wlock_invalidate = OF;
-SELECT @@session.query_cache_wlock_invalidate;
-
---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.'
-
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.query_cache_wlock_invalidate = ÓFF;
@@ -138,12 +134,8 @@ SET @@global.query_cache_wlock_invalidate = "Y";
SET @@global.query_cache_wlock_invalidate = TRÜE;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.query_cache_wlock_invalidate = ÕN;
-
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.query_cache_wlock_invalidate = OF;
-SELECT @@global.query_cache_wlock_invalidate;
-
---echo 'Bug 34828: OF is taken as OFF and a value of 0 is set.'
-
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.query_cache_wlock_invalidate = ÓFF;
diff --git a/mysql-test/suite/sys_vars/inc/query_prealloc_size_basic.inc b/mysql-test/suite/sys_vars/t/query_prealloc_size_basic.test
index 64eb3c4b329..3914bff4ca9 100644
--- a/mysql-test/suite/sys_vars/inc/query_prealloc_size_basic.inc
+++ b/mysql-test/suite/sys_vars/t/query_prealloc_size_basic.test
@@ -113,8 +113,8 @@ SELECT @@global.query_prealloc_size ;
#SELECT @@global.query_prealloc_size ;
---Error ER_PARSE_ERROR
-SET @@global.query_prealloc_size = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.query_prealloc_size = 65530.34;
SELECT @@global.query_prealloc_size ;
--Error ER_WRONG_TYPE_FOR_VAR
@@ -140,9 +140,8 @@ SELECT @@session.query_prealloc_size ;
#SET @@session.query_prealloc_size = -2;
#SELECT @@session.query_prealloc_size ;
---Error ER_PARSE_ERROR
-
-SET @@session.query_prealloc_size = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.query_prealloc_size = 65530.34;
SELECT @@session.query_prealloc_size ;
diff --git a/mysql-test/suite/sys_vars/t/query_prealloc_size_basic_32.test b/mysql-test/suite/sys_vars/t/query_prealloc_size_basic_32.test
deleted file mode 100644
index 34dafc71c9c..00000000000
--- a/mysql-test/suite/sys_vars/t/query_prealloc_size_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger 2008-05-07 #
-# #
-# Wrapper for 32 bit machines #
-################################################################################
-
---source include/have_32bit.inc
---source suite/sys_vars/inc/query_prealloc_size_basic.inc
-
diff --git a/mysql-test/suite/sys_vars/t/query_prealloc_size_basic_64.test b/mysql-test/suite/sys_vars/t/query_prealloc_size_basic_64.test
deleted file mode 100644
index c1f04c0788c..00000000000
--- a/mysql-test/suite/sys_vars/t/query_prealloc_size_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger 2008-05-07 #
-# #
-# Wrapper for 64 bit machines #
-################################################################################
-
---source include/have_64bit.inc
---source suite/sys_vars/inc/query_prealloc_size_basic.inc
-
diff --git a/mysql-test/suite/sys_vars/t/rand_seed1_basic.test b/mysql-test/suite/sys_vars/t/rand_seed1_basic.test
new file mode 100644
index 00000000000..79c946a3d2f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/rand_seed1_basic.test
@@ -0,0 +1,30 @@
+
+#
+# exists as a session only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@global.rand_seed1;
+select @@session.rand_seed1;
+show global variables like 'rand_seed1';
+show session variables like 'rand_seed1';
+select * from information_schema.global_variables where variable_name='rand_seed1';
+select * from information_schema.session_variables where variable_name='rand_seed1';
+
+#
+# show that it's writable
+#
+set session rand_seed1=1;
+select @@session.rand_seed1;
+--error ER_LOCAL_VARIABLE
+set global rand_seed1=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set session rand_seed1=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set session rand_seed1=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set session rand_seed1="foo";
+
diff --git a/mysql-test/suite/sys_vars/t/rand_seed2_basic.test b/mysql-test/suite/sys_vars/t/rand_seed2_basic.test
new file mode 100644
index 00000000000..18e2a62557c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/rand_seed2_basic.test
@@ -0,0 +1,30 @@
+
+#
+# exists as a session only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@global.rand_seed2;
+select @@session.rand_seed2;
+show global variables like 'rand_seed2';
+show session variables like 'rand_seed2';
+select * from information_schema.global_variables where variable_name='rand_seed2';
+select * from information_schema.session_variables where variable_name='rand_seed2';
+
+#
+# show that it's writable
+#
+set session rand_seed2=1;
+select @@session.rand_seed2;
+--error ER_LOCAL_VARIABLE
+set global rand_seed2=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set session rand_seed2=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set session rand_seed2=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set session rand_seed2="foo";
+
diff --git a/mysql-test/suite/sys_vars/t/read_buffer_size_basic.test b/mysql-test/suite/sys_vars/t/read_buffer_size_basic.test
index 405bb9da6d8..8ce826bf327 100644
--- a/mysql-test/suite/sys_vars/t/read_buffer_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/read_buffer_size_basic.test
@@ -72,9 +72,9 @@ SELECT @@session.read_buffer_size = 131072;
################################################################################
SET @@global.read_buffer_size = 8201;
-SELECT @@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228 ;
+SELECT @@global.read_buffer_size;
SET @@global.read_buffer_size = 8200;
-SELECT @@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228 ;
+SELECT @@global.read_buffer_size;
SET @@global.read_buffer_size = 2147479552;
SELECT @@global.read_buffer_size;
SET @@global.read_buffer_size = 2147479551;
@@ -86,9 +86,9 @@ SELECT @@global.read_buffer_size;
###################################################################################
SET @@session.read_buffer_size = 8200;
-SELECT @@session.read_buffer_size= 8200 OR @@session.read_buffer_size= 8228 ;
+SELECT @@session.read_buffer_size;
SET @@session.read_buffer_size = 8201;
-SELECT @@session.read_buffer_size= 8200 OR @@session.read_buffer_size= 8228 ;
+SELECT @@session.read_buffer_size;
SET @@session.read_buffer_size = 2147479552;
SELECT @@session.read_buffer_size;
SET @@session.read_buffer_size = 2147479551;
@@ -101,27 +101,26 @@ SELECT @@session.read_buffer_size;
##################################################################
SET @@global.read_buffer_size = 8199;
-SELECT @@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228 ;
+SELECT @@global.read_buffer_size;
SET @@global.read_buffer_size = -1024;
-SELECT @@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228 ;
+SELECT @@global.read_buffer_size;
SET @@global.read_buffer_size = 2147479553;
SELECT @@global.read_buffer_size;
---Error ER_PARSE_ERROR
-SET @@global.read_buffer_size = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.read_buffer_size = 65530.34;
SELECT @@global.read_buffer_size;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.read_buffer_size = test;
SELECT @@global.read_buffer_size;
SET @@session.read_buffer_size = 8199;
-SELECT @@session.read_buffer_size= 8200 OR @@session.read_buffer_size= 8228 ;
+SELECT @@session.read_buffer_size;
SET @@session.read_buffer_size = -2;
-SELECT @@session.read_buffer_size= 8200 OR @@session.read_buffer_size= 8228 ;
---Error ER_PARSE_ERROR
-SET @@session.read_buffer_size = 65530.34.;
+SELECT @@session.read_buffer_size;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.read_buffer_size = 65530.34;
SET @@session.read_buffer_size = 2147479553;
SELECT @@session.read_buffer_size;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.read_buffer_size = test;
@@ -154,11 +153,9 @@ WHERE VARIABLE_NAME='read_buffer_size';
####################################################################
SET @@global.read_buffer_size = TRUE;
-SELECT @@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228 ;
+SELECT @@global.read_buffer_size;
SET @@global.read_buffer_size = FALSE;
-SELECT @@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228 ;
-echo 'Bug: FN_DYNVARS_138_08- Errors are not coming on assigning TRUE/FALSE to variable';
-
+SELECT @@global.read_buffer_size;
--echo '#---------------------FN_DYNVARS_138_09----------------------#'
####################################################################################
@@ -185,7 +182,7 @@ SELECT @@local.read_buffer_size = @@session.read_buffer_size;
###################################################################################
SET read_buffer_size = 9100;
-SELECT @@read_buffer_size= 8200 OR @@read_buffer_size= 8228 ;
+SELECT @@read_buffer_size;
--Error ER_UNKNOWN_TABLE
SELECT local.read_buffer_size;
--Error ER_UNKNOWN_TABLE
diff --git a/mysql-test/suite/sys_vars/t/read_only_basic.test b/mysql-test/suite/sys_vars/t/read_only_basic.test
index 9d8078b8c68..0f77e983f92 100644
--- a/mysql-test/suite/sys_vars/t/read_only_basic.test
+++ b/mysql-test/suite/sys_vars/t/read_only_basic.test
@@ -90,7 +90,7 @@ SELECT @@global.read_only;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.read_only = 10240022115;
SELECT @@global.read_only;
---Error ER_WRONG_VALUE_FOR_VAR
+--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.read_only = 10000.01;
SELECT @@global.read_only;
--Error ER_WRONG_VALUE_FOR_VAR
@@ -99,7 +99,6 @@ SELECT @@global.read_only;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.read_only = 42949672950;
SELECT @@global.read_only;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.read_only = 'test';
diff --git a/mysql-test/suite/sys_vars/t/read_rnd_buffer_size_basic.test b/mysql-test/suite/sys_vars/t/read_rnd_buffer_size_basic.test
index e3d2a4b89f7..f883a1bed3f 100644
--- a/mysql-test/suite/sys_vars/t/read_rnd_buffer_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/read_rnd_buffer_size_basic.test
@@ -54,35 +54,19 @@ SET @@session.read_rnd_buffer_size = 2000;
SET @@session.read_rnd_buffer_size = DEFAULT;
SELECT @@session.read_rnd_buffer_size;
-
---echo '#--------------------FN_DYNVARS_140_02-------------------------#'
-######################################################################
-# Check the DEFAULT value of read_rnd_buffer_size #
-######################################################################
-
-SET @@global.read_rnd_buffer_size = DEFAULT;
-SELECT @@global.read_rnd_buffer_size = 262144;
-
-SET @@session.read_rnd_buffer_size = DEFAULT;
-SELECT @@session.read_rnd_buffer_size = 262144;
---echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
-
-
--echo '#--------------------FN_DYNVARS_140_03-------------------------#'
################################################################################
# Change the value of read_rnd_buffer_size to a valid value for GLOBAL Scope #
################################################################################
SET @@global.read_rnd_buffer_size = 8201;
-SELECT @@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228;
+SELECT @@global.read_rnd_buffer_size;
SET @@global.read_rnd_buffer_size = 8200;
-SELECT @@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228;
+SELECT @@global.read_rnd_buffer_size;
SET @@global.read_rnd_buffer_size = 2147479552;
SELECT @@global.read_rnd_buffer_size;
SET @@global.read_rnd_buffer_size = 2147479551;
SELECT @@global.read_rnd_buffer_size;
---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-
--echo '#--------------------FN_DYNVARS_140_04-------------------------#'
###################################################################################
@@ -90,9 +74,9 @@ SELECT @@global.read_rnd_buffer_size;
###################################################################################
SET @@session.read_rnd_buffer_size = 8200;
-SELECT @@session.read_rnd_buffer_size= 8200 OR @@session.read_rnd_buffer_size= 8228;
+SELECT @@session.read_rnd_buffer_size;
SET @@session.read_rnd_buffer_size = 8201;
-SELECT @@session.read_rnd_buffer_size= 8200 OR @@session.read_rnd_buffer_size= 8228;
+SELECT @@session.read_rnd_buffer_size;
SET @@session.read_rnd_buffer_size = 2147479552;
SELECT @@session.read_rnd_buffer_size;
SET @@session.read_rnd_buffer_size = 2147479551;
@@ -105,32 +89,24 @@ SELECT @@session.read_rnd_buffer_size;
##################################################################
SET @@global.read_rnd_buffer_size = 8199;
-SELECT @@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228;
+SELECT @@global.read_rnd_buffer_size;
SET @@global.read_rnd_buffer_size = -1024;
-SELECT @@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228;
-SET @@global.read_rnd_buffer_size = 2147479553;
SELECT @@global.read_rnd_buffer_size;
---Error ER_PARSE_ERROR
-SET @@global.read_rnd_buffer_size = 65530.34.;
+SET @@global.read_rnd_buffer_size = 2147479553;
SELECT @@global.read_rnd_buffer_size;
--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.read_rnd_buffer_size = 65530.34;
+--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.read_rnd_buffer_size = test;
-SELECT @@global.read_rnd_buffer_size;
SET @@session.read_rnd_buffer_size = 8199;
-SELECT @@session.read_rnd_buffer_size= 8200 OR @@session.read_rnd_buffer_size= 8228;
+SELECT @@session.read_rnd_buffer_size;
SET @@session.read_rnd_buffer_size = -2;
-SELECT @@session.read_rnd_buffer_size= 8200 OR @@session.read_rnd_buffer_size= 8228;
---Error ER_PARSE_ERROR
-SET @@session.read_rnd_buffer_size = 65530.34.;
-SET @@session.read_rnd_buffer_size = 2147479553;
SELECT @@session.read_rnd_buffer_size;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.read_rnd_buffer_size = 65530.34;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.read_rnd_buffer_size = test;
-SELECT @@session.read_rnd_buffer_size;
-
--echo '#------------------FN_DYNVARS_140_06-----------------------#'
####################################################################
@@ -155,9 +131,9 @@ VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='re
####################################################################
SET @@global.read_rnd_buffer_size = TRUE;
-SELECT @@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228;
+SELECT @@global.read_rnd_buffer_size;
SET @@global.read_rnd_buffer_size = FALSE;
-SELECT @@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228;
+SELECT @@global.read_rnd_buffer_size;
--echo '#---------------------FN_DYNVARS_140_09----------------------#'
@@ -185,7 +161,7 @@ SELECT @@local.read_rnd_buffer_size = @@session.read_rnd_buffer_size;
###################################################################################
SET read_rnd_buffer_size = 9100;
-SELECT @@read_rnd_buffer_size= 8200 OR @@read_rnd_buffer_size= 8228;
+SELECT @@read_rnd_buffer_size;
--Error ER_UNKNOWN_TABLE
SELECT local.read_rnd_buffer_size;
--Error ER_UNKNOWN_TABLE
diff --git a/mysql-test/suite/sys_vars/t/relay_log_basic.test b/mysql-test/suite/sys_vars/t/relay_log_basic.test
new file mode 100644
index 00000000000..1ea60577556
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/relay_log_basic.test
@@ -0,0 +1,19 @@
+--source include/not_embedded.inc
+#
+# only global
+#
+select @@global.relay_log;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.relay_log;
+show global variables like 'relay_log';
+show session variables like 'relay_log';
+select * from information_schema.global_variables where variable_name='relay_log';
+select * from information_schema.session_variables where variable_name='relay_log';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global relay_log=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session relay_log=1;
diff --git a/mysql-test/suite/sys_vars/t/relay_log_index_basic.test b/mysql-test/suite/sys_vars/t/relay_log_index_basic.test
new file mode 100644
index 00000000000..fa69d978016
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/relay_log_index_basic.test
@@ -0,0 +1,19 @@
+--source include/not_embedded.inc
+#
+# only global
+#
+select @@global.relay_log_index;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.relay_log_index;
+show global variables like 'relay_log_index';
+show session variables like 'relay_log_index';
+select * from information_schema.global_variables where variable_name='relay_log_index';
+select * from information_schema.session_variables where variable_name='relay_log_index';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global relay_log_index=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session relay_log_index=1;
diff --git a/mysql-test/suite/sys_vars/t/relay_log_info_file_basic.test b/mysql-test/suite/sys_vars/t/relay_log_info_file_basic.test
new file mode 100644
index 00000000000..4709b8e3e47
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/relay_log_info_file_basic.test
@@ -0,0 +1,19 @@
+--source include/not_embedded.inc
+#
+# only global
+#
+select @@global.relay_log_info_file;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.relay_log_info_file;
+show global variables like 'relay_log_info_file';
+show session variables like 'relay_log_info_file';
+select * from information_schema.global_variables where variable_name='relay_log_info_file';
+select * from information_schema.session_variables where variable_name='relay_log_info_file';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global relay_log_info_file=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session relay_log_info_file=1;
diff --git a/mysql-test/suite/sys_vars/t/relay_log_recovery_basic.test b/mysql-test/suite/sys_vars/t/relay_log_recovery_basic.test
new file mode 100644
index 00000000000..57c28468bd1
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/relay_log_recovery_basic.test
@@ -0,0 +1,39 @@
+--source include/not_embedded.inc
+
+SET @start_global_value = @@global.relay_log_recovery;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+select @@global.relay_log_recovery;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.relay_log_recovery;
+show global variables like 'relay_log_recovery';
+show session variables like 'relay_log_recovery';
+select * from information_schema.global_variables where variable_name='relay_log_recovery';
+select * from information_schema.session_variables where variable_name='relay_log_recovery';
+
+#
+# show that it's writable
+#
+set global relay_log_recovery=1;
+select @@global.relay_log_recovery;
+set global relay_log_recovery=OFF;
+select @@global.relay_log_recovery;
+--error ER_GLOBAL_VARIABLE
+set session relay_log_recovery=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global relay_log_recovery=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global relay_log_recovery=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global relay_log_recovery="foo";
+
+SET @@global.relay_log_recovery = @start_global_value;
+SELECT @@global.relay_log_recovery;
+
diff --git a/mysql-test/suite/sys_vars/t/relay_log_space_limit_basic.test b/mysql-test/suite/sys_vars/t/relay_log_space_limit_basic.test
new file mode 100644
index 00000000000..99c9fb37493
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/relay_log_space_limit_basic.test
@@ -0,0 +1,19 @@
+--source include/not_embedded.inc
+#
+# only global
+#
+select @@global.relay_log_space_limit;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.relay_log_space_limit;
+show global variables like 'relay_log_space_limit';
+show session variables like 'relay_log_space_limit';
+select * from information_schema.global_variables where variable_name='relay_log_space_limit';
+select * from information_schema.session_variables where variable_name='relay_log_space_limit';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global relay_log_space_limit=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session relay_log_space_limit=1;
diff --git a/mysql-test/suite/sys_vars/t/report_host_basic.test b/mysql-test/suite/sys_vars/t/report_host_basic.test
new file mode 100644
index 00000000000..5565370f88c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/report_host_basic.test
@@ -0,0 +1,19 @@
+--source include/not_embedded.inc
+#
+# only global
+#
+select @@global.report_host;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.report_host;
+show global variables like 'report_host';
+show session variables like 'report_host';
+select * from information_schema.global_variables where variable_name='report_host';
+select * from information_schema.session_variables where variable_name='report_host';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global report_host=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session report_host=1;
diff --git a/mysql-test/suite/sys_vars/t/report_password_basic.test b/mysql-test/suite/sys_vars/t/report_password_basic.test
new file mode 100644
index 00000000000..ed564cfe2ad
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/report_password_basic.test
@@ -0,0 +1,19 @@
+--source include/not_embedded.inc
+#
+# only global
+#
+select @@global.report_password;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.report_password;
+show global variables like 'report_password';
+show session variables like 'report_password';
+select * from information_schema.global_variables where variable_name='report_password';
+select * from information_schema.session_variables where variable_name='report_password';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global report_password=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session report_password=1;
diff --git a/mysql-test/suite/sys_vars/t/report_port_basic.test b/mysql-test/suite/sys_vars/t/report_port_basic.test
new file mode 100644
index 00000000000..122c92c5446
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/report_port_basic.test
@@ -0,0 +1,24 @@
+--source include/not_embedded.inc
+#
+# only global
+#
+--replace_result $DEFAULT_MASTER_PORT DEFAULT_MASTER_PORT
+select @@global.report_port;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.report_port;
+--replace_result $DEFAULT_MASTER_PORT DEFAULT_MASTER_PORT
+show global variables like 'report_port';
+--replace_result $DEFAULT_MASTER_PORT DEFAULT_MASTER_PORT
+show session variables like 'report_port';
+--replace_result $DEFAULT_MASTER_PORT DEFAULT_MASTER_PORT
+select * from information_schema.global_variables where variable_name='report_port';
+--replace_result $DEFAULT_MASTER_PORT DEFAULT_MASTER_PORT
+select * from information_schema.session_variables where variable_name='report_port';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global report_port=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session report_port=1;
diff --git a/mysql-test/suite/sys_vars/t/report_user_basic.test b/mysql-test/suite/sys_vars/t/report_user_basic.test
new file mode 100644
index 00000000000..192e6b772b8
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/report_user_basic.test
@@ -0,0 +1,19 @@
+--source include/not_embedded.inc
+#
+# only global
+#
+select @@global.report_user;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.report_user;
+show global variables like 'report_user';
+show session variables like 'report_user';
+select * from information_schema.global_variables where variable_name='report_user';
+select * from information_schema.session_variables where variable_name='report_user';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global report_user=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session report_user=1;
diff --git a/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test b/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test
index f2c66eb3a0a..2a241b58807 100644
--- a/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test
+++ b/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test
@@ -39,8 +39,9 @@ SET @start_init_slave= @@global.init_slave;
# setting of a global value with an effect on the next start of the slave server
# check that @@global.init_slave could be set
+SET NAMES utf8;
let $my_init_slave=
- 'SET @@global.max_connections = @@global.max_connections + 1';
+ 'SET @@global.max_connections = @@global.max_connections + 1 -- комментарий';
eval SET @@global.init_slave = $my_init_slave;
# show the data type of the variable
@@ -49,6 +50,7 @@ DROP TABLE IF EXISTS t1;
CREATE TEMPORARY TABLE t1 AS SELECT @@global.init_slave AS my_column;
--enable_warnings
DESCRIBE t1;
+select length(my_column) from t1;
DROP TABLE t1;
#
# check that the new setting of @@global.init_slave becomes immediately visible
diff --git a/mysql-test/suite/sys_vars/t/secure_file_priv_basic.test b/mysql-test/suite/sys_vars/t/secure_file_priv_basic.test
new file mode 100644
index 00000000000..fee18e441d1
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/secure_file_priv_basic.test
@@ -0,0 +1,23 @@
+#
+# only global
+#
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+select @@global.secure_file_priv;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.secure_file_priv;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+show global variables like 'secure_file_priv';
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+show session variables like 'secure_file_priv';
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+select * from information_schema.global_variables where variable_name='secure_file_priv';
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+select * from information_schema.session_variables where variable_name='secure_file_priv';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global secure_file_priv=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session secure_file_priv=1;
diff --git a/mysql-test/suite/sys_vars/inc/server_id_basic.inc b/mysql-test/suite/sys_vars/t/server_id_basic.test
index 47afadb5016..9d41823053a 100644
--- a/mysql-test/suite/sys_vars/inc/server_id_basic.inc
+++ b/mysql-test/suite/sys_vars/t/server_id_basic.test
@@ -107,8 +107,8 @@ SELECT @@global.server_id;
SET @@global.server_id = 2147483649*2;
SELECT @@global.server_id;
---Error ER_PARSE_ERROR
-SET @@global.server_id = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.server_id = 65530.34;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.server_id = '125';
--Error ER_WRONG_TYPE_FOR_VAR
@@ -116,9 +116,6 @@ SET @@global.server_id = 7483649.56;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.server_id = 1G;
---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-
-
--echo '#------------------FN_DYNVARS_144_06-----------------------#'
####################################################################
# Check if the value in GLOBAL Table matches value in variable #
diff --git a/mysql-test/suite/sys_vars/t/server_id_basic_32.test b/mysql-test/suite/sys_vars/t/server_id_basic_32.test
deleted file mode 100644
index e01b271e002..00000000000
--- a/mysql-test/suite/sys_vars/t/server_id_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger 2008-05-07 #
-# #
-# Wrapper for 32 bit machines #
-################################################################################
-
---source include/have_32bit.inc
---source suite/sys_vars/inc/server_id_basic.inc
-
diff --git a/mysql-test/suite/sys_vars/t/server_id_basic_64.test b/mysql-test/suite/sys_vars/t/server_id_basic_64.test
deleted file mode 100644
index 4ef870aa977..00000000000
--- a/mysql-test/suite/sys_vars/t/server_id_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger 2008-05-07 #
-# #
-# Wrapper for 64 bit machines #
-################################################################################
-
---source include/have_64bit.inc
---source suite/sys_vars/inc/server_id_basic.inc
-
diff --git a/mysql-test/suite/sys_vars/t/shared_memory_base_name_basic.test b/mysql-test/suite/sys_vars/t/shared_memory_base_name_basic.test
new file mode 100644
index 00000000000..591f3cec5e5
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/shared_memory_base_name_basic.test
@@ -0,0 +1,24 @@
+--source include/windows.inc
+#
+# only global
+#
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+select @@global.shared_memory_base_name;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.shared_memory_base_name;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+show global variables like 'shared_memory_base_name';
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+show session variables like 'shared_memory_base_name';
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+select * from information_schema.global_variables where variable_name='shared_memory_base_name';
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+select * from information_schema.session_variables where variable_name='shared_memory_base_name';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global shared_memory_base_name=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session shared_memory_base_name=1;
diff --git a/mysql-test/suite/sys_vars/t/shared_memory_basic.test b/mysql-test/suite/sys_vars/t/shared_memory_basic.test
new file mode 100644
index 00000000000..ff2c5fad81d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/shared_memory_basic.test
@@ -0,0 +1,19 @@
+--source include/windows.inc
+#
+# only global
+#
+select @@global.shared_memory;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.shared_memory;
+show global variables like 'shared_memory';
+show session variables like 'shared_memory';
+select * from information_schema.global_variables where variable_name='shared_memory';
+select * from information_schema.session_variables where variable_name='shared_memory';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global shared_memory=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session shared_memory=1;
diff --git a/mysql-test/suite/sys_vars/t/skip_external_locking_basic.test b/mysql-test/suite/sys_vars/t/skip_external_locking_basic.test
new file mode 100644
index 00000000000..67b58ab8ff4
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/skip_external_locking_basic.test
@@ -0,0 +1,18 @@
+#
+# only global
+#
+select @@global.skip_external_locking;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.skip_external_locking;
+show global variables like 'skip_external_locking';
+show session variables like 'skip_external_locking';
+select * from information_schema.global_variables where variable_name='skip_external_locking';
+select * from information_schema.session_variables where variable_name='skip_external_locking';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global skip_external_locking=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session skip_external_locking=1;
diff --git a/mysql-test/suite/sys_vars/t/skip_networking_basic.test b/mysql-test/suite/sys_vars/t/skip_networking_basic.test
new file mode 100644
index 00000000000..09a775cc257
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/skip_networking_basic.test
@@ -0,0 +1,18 @@
+#
+# only global
+#
+select @@global.skip_networking;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.skip_networking;
+show global variables like 'skip_networking';
+show session variables like 'skip_networking';
+select * from information_schema.global_variables where variable_name='skip_networking';
+select * from information_schema.session_variables where variable_name='skip_networking';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global skip_networking=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session skip_networking=1;
diff --git a/mysql-test/suite/sys_vars/t/skip_show_database_basic.test b/mysql-test/suite/sys_vars/t/skip_show_database_basic.test
new file mode 100644
index 00000000000..9e0fddd120c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/skip_show_database_basic.test
@@ -0,0 +1,18 @@
+#
+# only global
+#
+select @@global.skip_show_database;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.skip_show_database;
+show global variables like 'skip_show_database';
+show session variables like 'skip_show_database';
+select * from information_schema.global_variables where variable_name='skip_show_database';
+select * from information_schema.session_variables where variable_name='skip_show_database';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global skip_show_database=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session skip_show_database=1;
diff --git a/mysql-test/suite/sys_vars/t/slave_allow_batching_basic.test b/mysql-test/suite/sys_vars/t/slave_allow_batching_basic.test
index 020fd9c84c2..e8b52259051 100644
--- a/mysql-test/suite/sys_vars/t/slave_allow_batching_basic.test
+++ b/mysql-test/suite/sys_vars/t/slave_allow_batching_basic.test
@@ -37,8 +37,6 @@
--Error ER_UNKNOWN_SYSTEM_VARIABLE
SET @global_start_value = @@global.slave_allow_batching;
---echo 'Bug: This variable is not supported in mysql version 5.1.22'
-
--echo '#--------------------FN_DYNVARS_145_01------------------------#'
########################################################################
# Display the DEFAULT value of slave_allow_batching #
diff --git a/mysql-test/suite/sys_vars/t/slave_exec_mode_basic.test b/mysql-test/suite/sys_vars/t/slave_exec_mode_basic.test
index 5c5b4e7da1b..503fb382602 100644
--- a/mysql-test/suite/sys_vars/t/slave_exec_mode_basic.test
+++ b/mysql-test/suite/sys_vars/t/slave_exec_mode_basic.test
@@ -23,6 +23,7 @@
# #
################################################################################
+--source include/not_embedded.inc
--source include/load_sysvars.inc
########################################################################
diff --git a/mysql-test/suite/sys_vars/t/slave_load_tmpdir_basic.test b/mysql-test/suite/sys_vars/t/slave_load_tmpdir_basic.test
new file mode 100644
index 00000000000..4121c881ee5
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/slave_load_tmpdir_basic.test
@@ -0,0 +1,24 @@
+--source include/not_embedded.inc
+#
+# only global
+#
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+select @@global.slave_load_tmpdir;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.slave_load_tmpdir;
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+show global variables like 'slave_load_tmpdir';
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+show session variables like 'slave_load_tmpdir';
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+select * from information_schema.global_variables where variable_name='slave_load_tmpdir';
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+select * from information_schema.session_variables where variable_name='slave_load_tmpdir';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global slave_load_tmpdir=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session slave_load_tmpdir=1;
diff --git a/mysql-test/suite/sys_vars/t/slave_net_timeout_basic.test b/mysql-test/suite/sys_vars/t/slave_net_timeout_basic.test
index 5662eec3957..f534bd2f28c 100644
--- a/mysql-test/suite/sys_vars/t/slave_net_timeout_basic.test
+++ b/mysql-test/suite/sys_vars/t/slave_net_timeout_basic.test
@@ -105,8 +105,8 @@ SELECT @@global.slave_net_timeout;
SET @@global.slave_net_timeout = 2147483649*2;
SELECT @@global.slave_net_timeout;
---Error ER_PARSE_ERROR
-SET @@global.slave_net_timeout = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.slave_net_timeout = 65530.34;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.slave_net_timeout = 100s;
--Error ER_WRONG_TYPE_FOR_VAR
@@ -114,9 +114,6 @@ SET @@global.slave_net_timeout = 7483649.56;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.slave_net_timeout = 0.6;
---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-
-
--echo '#------------------FN_DYNVARS_146_06-----------------------#'
####################################################################
# Check if the value in GLOBAL Table matches value in variable #
diff --git a/mysql-test/suite/sys_vars/t/slave_skip_errors_basic.test b/mysql-test/suite/sys_vars/t/slave_skip_errors_basic.test
new file mode 100644
index 00000000000..c5c8aba7e3a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/slave_skip_errors_basic.test
@@ -0,0 +1,19 @@
+--source include/not_embedded.inc
+#
+# only global
+#
+select @@global.slave_skip_errors;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.slave_skip_errors;
+show global variables like 'slave_skip_errors';
+show session variables like 'slave_skip_errors';
+select * from information_schema.global_variables where variable_name='slave_skip_errors';
+select * from information_schema.session_variables where variable_name='slave_skip_errors';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global slave_skip_errors=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session slave_skip_errors=1;
diff --git a/mysql-test/suite/sys_vars/t/slow_launch_time_basic.test b/mysql-test/suite/sys_vars/t/slow_launch_time_basic.test
index 6289a91abb3..bedcb6201b1 100644
--- a/mysql-test/suite/sys_vars/t/slow_launch_time_basic.test
+++ b/mysql-test/suite/sys_vars/t/slow_launch_time_basic.test
@@ -90,7 +90,6 @@ SET @@global.slow_launch_time = -1024;
SELECT @@global.slow_launch_time;
SET @@global.slow_launch_time = 42949672950;
SELECT @@global.slow_launch_time;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.slow_launch_time = ON;
diff --git a/mysql-test/suite/sys_vars/t/slow_query_log_file_basic.test b/mysql-test/suite/sys_vars/t/slow_query_log_file_basic.test
index 9125b686cad..bac0d0c8198 100644
--- a/mysql-test/suite/sys_vars/t/slow_query_log_file_basic.test
+++ b/mysql-test/suite/sys_vars/t/slow_query_log_file_basic.test
@@ -43,7 +43,8 @@ SET @start_value = @@global.slow_query_log_file;
###############################################
SET @@global.slow_query_log_file = DEFAULT;
-SELECT RIGHT(@@global.slow_query_log_file,15);
+SET @a=concat(left(@@hostname, instr(concat(@@hostname, '.'), '.')-1), '-slow.log');
+SELECT RIGHT(@@global.slow_query_log_file, length(@a)) = @a;
--echo '#--------------------FN_DYNVARS_004_02------------------------#'
diff --git a/mysql-test/suite/sys_vars/t/socket_basic.test b/mysql-test/suite/sys_vars/t/socket_basic.test
new file mode 100644
index 00000000000..f96a863a216
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/socket_basic.test
@@ -0,0 +1,23 @@
+#
+# only global
+#
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+select @@global.socket;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.socket;
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+show global variables like 'socket';
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+show session variables like 'socket';
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+select * from information_schema.global_variables where variable_name='socket';
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+select * from information_schema.session_variables where variable_name='socket';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global socket=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session socket=1;
diff --git a/mysql-test/suite/sys_vars/t/sql_auto_is_null_basic.test b/mysql-test/suite/sys_vars/t/sql_auto_is_null_basic.test
index da01a3b4459..07bf38773af 100644
--- a/mysql-test/suite/sys_vars/t/sql_auto_is_null_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_auto_is_null_basic.test
@@ -27,75 +27,36 @@
# Displaying default value #
####################################################################
-SELECT COUNT(@@SESSION.sql_auto_is_null);
---echo 1 Expected
+SELECT @@session.sql_auto_is_null;
--echo '#---------------------BS_STVARS_044_02----------------------#'
-#
-# Test case for Bug #35433
-#
####################################################################
# Check if Value can set #
####################################################################
-
-#--error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SET @@SESSION.sql_auto_is_null=1;
---ECHO "BUG:It should give error on setting this variable as it is readonly variable"
---echo Expected error 'Read only variable'
-
-SELECT COUNT(@@SESSION.sql_auto_is_null);
---echo 1 Expected
-
-
-
+SET @@session.sql_auto_is_null=1;
+SELECT @@session.sql_auto_is_null;
--echo '#---------------------BS_STVARS_044_03----------------------#'
#################################################################
-# Check if the value in SESSION Table matches value in variable #
+# Check if the value in session Table matches value in variable #
#################################################################
-SELECT IF(@@SESSION.sql_auto_is_null, "ON", "OFF") = VARIABLE_VALUE
+SELECT IF(@@session.sql_auto_is_null, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_auto_is_null';
---echo 1 Expected
-
-SELECT COUNT(@@SESSION.sql_auto_is_null);
---echo 1 Expected
-SELECT COUNT(VARIABLE_VALUE)
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_auto_is_null';
---echo 1 Expected
-
-
---echo '#---------------------BS_STVARS_044_04----------------------#'
-################################################################################
-# Check if accessing variable with and without SESSION point to same variable #
-################################################################################
-SELECT @@sql_auto_is_null = @@SESSION.sql_auto_is_null;
---echo 1 Expected
-
-
--echo '#---------------------BS_STVARS_044_05----------------------#'
################################################################################
# Check if sql_auto_is_null can be accessed with and without @@ sign #
################################################################################
-SELECT COUNT(@@sql_auto_is_null);
---echo 1 Expected
-SELECT COUNT(@@local.sql_auto_is_null);
---echo 1 Expected
-SELECT COUNT(@@SESSION.sql_auto_is_null);
---echo 1 Expected
-
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT COUNT(@@GLOBAL.sql_auto_is_null);
---echo Expected error 'Variable is a SESSION variable'
-
---error ER_BAD_FIELD_ERROR
-SELECT COUNT(sql_auto_is_null = @@GLOBAL.sql_auto_is_null);
---echo Expected error 'Readonly variable'
+SELECT @@sql_auto_is_null;
+SELECT @@local.sql_auto_is_null;
+SELECT @@session.sql_auto_is_null;
+SELECT @@global.sql_auto_is_null;
diff --git a/mysql-test/suite/sys_vars/t/sql_big_selects_basic.test b/mysql-test/suite/sys_vars/t/sql_big_selects_basic.test
index dd9b585cc84..42331d766be 100644
--- a/mysql-test/suite/sys_vars/t/sql_big_selects_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_big_selects_basic.test
@@ -93,12 +93,8 @@ SET @@session.sql_big_selects = "Y";
SET @@session.sql_big_selects = TRÜE;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.sql_big_selects = ÕN;
-
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.sql_big_selects = OF;
-SELECT @@session.sql_big_selects;
-
---echo 'Bug # 34828: OF is taken as OFF and a value of 0 is set.'
-
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.sql_big_selects = ÓFF;
--Error ER_WRONG_VALUE_FOR_VAR
@@ -112,11 +108,9 @@ SET @@session.sql_big_selects = NO;
# Test if accessing global sql_big_selects gives error #
########################################################################
---Error ER_LOCAL_VARIABLE
-SET @@global.sql_big_selects = 0;
-
---Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.sql_big_selects = 1-@@global.sql_big_selects;
SELECT @@global.sql_big_selects;
+SET @@global.sql_big_selects = 1-@@global.sql_big_selects;
--echo '#----------------------FN_DYNVARS_153_06------------------------#'
#########################################################################
diff --git a/mysql-test/suite/sys_vars/t/sql_big_tables_basic.test b/mysql-test/suite/sys_vars/t/sql_big_tables_basic.test
index 64ce47b044b..373ae06c850 100644
--- a/mysql-test/suite/sys_vars/t/sql_big_tables_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_big_tables_basic.test
@@ -96,12 +96,8 @@ SET @@session.sql_big_tables = "Y";
SET @@session.sql_big_tables = TRÜE;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.sql_big_tables = ÕN;
-
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.sql_big_tables = OF;
-SELECT @@session.sql_big_tables;
-
---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.'
-
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.sql_big_tables = ÓFF;
--Error ER_WRONG_VALUE_FOR_VAR
@@ -115,10 +111,9 @@ SET @@session.sql_big_tables = NO;
# Test if accessing global sql_big_tables gives error #
###########################################################################
---Error ER_LOCAL_VARIABLE
-SET @@global.sql_big_tables = 0;
-
---Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.sql_big_tables = 1-@@global.sql_big_tables;
+SELECT @@global.sql_big_tables;
+SET @@global.sql_big_tables = 1-@@global.sql_big_tables;
SELECT @@global.sql_big_tables;
--echo '#----------------------FN_DYNVARS_154_06------------------------#'
diff --git a/mysql-test/suite/sys_vars/t/sql_buffer_result_basic.test b/mysql-test/suite/sys_vars/t/sql_buffer_result_basic.test
index 04e65239ccb..f5f99efeb0a 100644
--- a/mysql-test/suite/sys_vars/t/sql_buffer_result_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_buffer_result_basic.test
@@ -92,25 +92,15 @@ SET @@session.sql_buffer_result = 2;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.sql_buffer_result = "TRU";
+--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.sql_buffer_result = 0.4;
-SELECT @@session.sql_buffer_result;
-
-SET @@session.sql_buffer_result = 1.4;
-SELECT @@session.sql_buffer_result;
-
---echo 'Bug: Decimal values are accepted and rounded to an integer before';
---echo 'assingment.';
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.sql_buffer_result = TRÜE;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.sql_buffer_result = ÕN;
-
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.sql_buffer_result = OF;
-SELECT @@session.sql_buffer_result;
-
---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.'
-
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.sql_buffer_result = ÓFF;
--Error ER_WRONG_VALUE_FOR_VAR
@@ -124,10 +114,9 @@ SET @@session.sql_buffer_result = NO;
# Test if accessing global sql_buffer_result gives error #
###########################################################################
---Error ER_LOCAL_VARIABLE
-SET @@global.sql_buffer_result = 0;
-
---Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.sql_buffer_result = 1-@@global.sql_buffer_result;
+SELECT @@global.sql_buffer_result;
+SET @@global.sql_buffer_result = 1-@@global.sql_buffer_result;
SELECT @@global.sql_buffer_result;
--echo '#----------------------FN_DYNVARS_155_06------------------------#'
diff --git a/mysql-test/suite/sys_vars/t/sql_log_bin_basic.test b/mysql-test/suite/sys_vars/t/sql_log_bin_basic.test
index 9ac0474f982..153a0be0b8f 100644
--- a/mysql-test/suite/sys_vars/t/sql_log_bin_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_log_bin_basic.test
@@ -97,12 +97,8 @@ SET @@session.sql_log_bin = "Y";
SET @@session.sql_log_bin = TRÜE;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.sql_log_bin = ÕN;
-
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.sql_log_bin = OF;
-SELECT @@session.sql_log_bin;
-
---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.'
-
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.sql_log_bin = ÓFF;
--Error ER_WRONG_VALUE_FOR_VAR
@@ -116,11 +112,9 @@ SET @@session.sql_log_bin = NO;
# Test if accessing global sql_log_bin gives error #
###########################################################################
---Error ER_LOCAL_VARIABLE
SET @@global.sql_log_bin = 0;
-
---Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@global.sql_log_bin;
+SET @@global.sql_log_bin = 1;
--echo '#----------------------FN_DYNVARS_156_06------------------------#'
#########################################################################
diff --git a/mysql-test/suite/sys_vars/t/sql_log_off_basic.test b/mysql-test/suite/sys_vars/t/sql_log_off_basic.test
index a208d30a39b..38549ac35d2 100644
--- a/mysql-test/suite/sys_vars/t/sql_log_off_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_log_off_basic.test
@@ -96,12 +96,8 @@ SET @@session.sql_log_off = "Y";
SET @@session.sql_log_off = TRÜE;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.sql_log_off = ÕN;
-
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.sql_log_off = OF;
-SELECT @@session.sql_log_off;
-
---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.'
-
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.sql_log_off = ÓFF;
--Error ER_WRONG_VALUE_FOR_VAR
@@ -115,10 +111,9 @@ SET @@session.sql_log_off = NO;
# Test if accessing global sql_log_off gives error #
###########################################################################
---Error ER_LOCAL_VARIABLE
-SET @@global.sql_log_off = 0;
-
---Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.sql_log_off = 1-@@global.sql_log_off;
+SELECT @@global.sql_log_off;
+SET @@global.sql_log_off = 1-@@global.sql_log_off;
SELECT @@global.sql_log_off;
--echo '#----------------------FN_DYNVARS_157_06------------------------#'
diff --git a/mysql-test/suite/sys_vars/t/sql_log_update_basic.test b/mysql-test/suite/sys_vars/t/sql_log_update_basic.test
new file mode 100644
index 00000000000..c48840d4a81
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/sql_log_update_basic.test
@@ -0,0 +1,35 @@
+--source include/have_profiling.inc
+
+SET @start_global_value = @@global.sql_log_update;
+SELECT @start_global_value;
+
+#
+# exists as global and session
+#
+select @@global.sql_log_update;
+select @@session.sql_log_update;
+show global variables like 'sql_log_update';
+show session variables like 'sql_log_update';
+select * from information_schema.global_variables where variable_name='sql_log_update';
+select * from information_schema.session_variables where variable_name='sql_log_update';
+
+#
+# show that it's writable
+#
+set global sql_log_update=1;
+select @@global.sql_log_update;
+set session sql_log_update=ON;
+select @@session.sql_log_update;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global sql_log_update=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global sql_log_update=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global sql_log_update="foo";
+
+SET @@global.sql_log_update = @start_global_value;
+SELECT @@global.sql_log_update;
diff --git a/mysql-test/suite/sys_vars/t/sql_low_priority_updates_basic.test b/mysql-test/suite/sys_vars/t/sql_low_priority_updates_basic.test
index 8d75349b851..5b21bd4c79a 100644
--- a/mysql-test/suite/sys_vars/t/sql_low_priority_updates_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_low_priority_updates_basic.test
@@ -50,12 +50,8 @@ SET @@session.sql_low_priority_updates = DEFAULT;
SELECT @@session.sql_low_priority_updates;
SET @@global.sql_low_priority_updates = 1;
---Error ER_NO_DEFAULT
SET @@global.sql_low_priority_updates = DEFAULT;
---echo 'Bug: DEFAULT value is only associated with session'
-
-
--echo '#---------------------FN_DYNVARS_159_02-------------------------#'
####################################################################################
# Check if sql_low_priority_updates can be accessed with and without @@ sign #
@@ -106,7 +102,7 @@ SELECT @@global.sql_low_priority_updates;
# for session
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.sql_low_priority_updates = -1;
---Error ER_WRONG_VALUE_FOR_VAR
+--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.sql_low_priority_updates = 1.6;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.sql_low_priority_updates = "T";
@@ -116,12 +112,8 @@ SET @@session.sql_low_priority_updates = "Y";
SET @@session.sql_low_priority_updates = TRÜE;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.sql_low_priority_updates = ÕN;
-
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.sql_low_priority_updates = OF;
-SELECT @@session.sql_low_priority_updates;
-
---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.'
-
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.sql_low_priority_updates = ÓFF;
@@ -139,12 +131,8 @@ SET @@global.sql_low_priority_updates = "Y";
SET @@global.sql_low_priority_updates = TRÜE;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.sql_low_priority_updates = ÕN;
-
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.sql_low_priority_updates = OF;
-SELECT @@global.sql_low_priority_updates;
-
---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.'
-
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.sql_low_priority_updates = ÓFF;
diff --git a/mysql-test/suite/sys_vars/t/sql_max_join_size_basic.test b/mysql-test/suite/sys_vars/t/sql_max_join_size_basic.test
new file mode 100644
index 00000000000..bafa11379aa
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/sql_max_join_size_basic.test
@@ -0,0 +1,42 @@
+SET @start_global_value = @@global.sql_max_join_size;
+SELECT @start_global_value;
+
+#
+# exists as global and session
+#
+select @@global.sql_max_join_size;
+select @@session.sql_max_join_size;
+show global variables like 'sql_max_join_size';
+show session variables like 'sql_max_join_size';
+select * from information_schema.global_variables where variable_name='sql_max_join_size';
+select * from information_schema.session_variables where variable_name='sql_max_join_size';
+
+#
+# show that it's writable
+#
+set global sql_max_join_size=10;
+select @@global.sql_max_join_size;
+set session sql_max_join_size=20;
+select @@session.sql_max_join_size;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global sql_max_join_size=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global sql_max_join_size=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global sql_max_join_size="foo";
+
+#
+# affects OPTION_BIG_SELECTS
+#
+select @@sql_big_selects;
+set sql_max_join_size=cast(-1 as unsigned int);
+select @@sql_big_selects;
+set sql_max_join_size=100;
+select @@sql_big_selects;
+
+SET @@global.sql_max_join_size = @start_global_value;
+SELECT @@global.sql_max_join_size;
diff --git a/mysql-test/suite/sys_vars/t/sql_mode_basic.test b/mysql-test/suite/sys_vars/t/sql_mode_basic.test
index 24f1e8aefcb..83f938925d5 100644
--- a/mysql-test/suite/sys_vars/t/sql_mode_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_mode_basic.test
@@ -57,9 +57,6 @@ SET @@session.sql_mode = ANSI;
SET @@session.sql_mode = DEFAULT;
SELECT @@session.sql_mode;
---echo 'Bug# 34876: Default values for both session and global sql_mode is ""';
---echo 'and not OFF.';
-
--echo '#---------------------FN_DYNVARS_152_02-------------------------#'
#########################################################
# Check if NULL or empty value is accepeted #
@@ -92,9 +89,6 @@ SELECT @@session.sql_mode;
# sql modes ref: http://dev.mysql.com/doc/refman/5.1/en/server-sql-mode.html
---echo 'Bug: Incomplete sql modes valid values at:';
---echo 'http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html';
-
# check valid values for global
SET @@global.sql_mode = ANSI;
@@ -164,7 +158,6 @@ SELECT @@global.sql_mode;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.sql_mode = OFF;
---echo 'Bug: OFF is documented as an sql mode but infact it is not';
#check valid values for session
SET @@session.sql_mode = ANSI;
@@ -235,15 +228,10 @@ SELECT @@session.sql_mode;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.sql_mode = OFF;
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.sql_mode = '?';
SELECT @@global.sql_mode;
-SET @@session.sql_mode = '?';
-SELECT @@session.sql_mode;
-
---echo 'Bug# 34834: ? is acceptable as a valid sql mode.'
-
-
--echo '#--------------------FN_DYNVARS_152_04-------------------------#'
###########################################################################
# Change the value of sql_mode to invalid value #
@@ -327,30 +315,8 @@ SET @@global.sql_mode = 4294967296;
# use of decimal values
+--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.sql_mode = 0.4;
-SELECT @@global.sql_mode;
-
-SET @@global.sql_mode = 1.0;
-SELECT @@global.sql_mode;
-
-SET @@global.sql_mode = 40000.1;
-SELECT @@global.sql_mode;
-
-SET @@global.sql_mode = 1.5;
-SELECT @@global.sql_mode;
-
-SET @@global.sql_mode = 124567.49;
-SELECT @@global.sql_mode;
-
-SET @@session.sql_mode = 50000000.5;
-SELECT @@session.sql_mode;
-
-SET @@session.sql_mode = 4294967295.4;
-SELECT @@session.sql_mode;
-
---echo 'Bug: Decimal values can be used within the range [0.0-4294967295.5).';
---echo 'Values are rounded to numeric values as evident from outcome.';
-
--echo '#---------------------FN_DYNVARS_152_08----------------------#'
###################################################################
@@ -394,8 +360,16 @@ SELECT @@global.sql_mode;
#try combining invalid mode with correct mode
--Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.sql_mode = 'ERROR_FOR_DIVISION_BY_ZERO,HIGH_OR_PRECEDENCE,
-IGNORE_SPACE';
+SET @@session.sql_mode = 'ERROR_FOR_DIVISION_BY_ZERO,FOOBAR,IGNORE_SPACE';
+
+#zero-length values are ok
+SET @@sql_mode=',';
+SELECT @@sql_mode;
+SET @@sql_mode=',,,,ANSI_QUOTES,,,';
+SELECT @@sql_mode;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@sql_mode=',,,,FOOBAR,,,,,';
+SELECT @@sql_mode;
##############################
# Restore initial value #
diff --git a/mysql-test/suite/sys_vars/t/sql_notes_basic.test b/mysql-test/suite/sys_vars/t/sql_notes_basic.test
index 461e5d35e4f..9af5fa35ea2 100644
--- a/mysql-test/suite/sys_vars/t/sql_notes_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_notes_basic.test
@@ -98,12 +98,8 @@ SET @@session.sql_notes = "Y";
SET @@session.sql_notes = TRÜE;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.sql_notes = ÕN;
-
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.sql_notes = OF;
-SELECT @@session.sql_notes;
-
---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.'
-
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.sql_notes = ÓFF;
--Error ER_WRONG_VALUE_FOR_VAR
@@ -117,10 +113,9 @@ SET @@session.sql_notes = NO;
# Test if accessing global sql_notes gives error #
#########################################################################
---Error ER_LOCAL_VARIABLE
-SET @@global.sql_notes = 0;
-
---Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.sql_notes = 1-@@global.sql_notes;
+SELECT @@global.sql_notes;
+SET @@global.sql_notes = 1-@@global.sql_notes;
SELECT @@global.sql_notes;
--echo '#----------------------FN_DYNVARS_161_06------------------------#'
diff --git a/mysql-test/suite/sys_vars/t/sql_quote_show_create_basic.test b/mysql-test/suite/sys_vars/t/sql_quote_show_create_basic.test
index 5e0edef55e5..020b5f51e9f 100644
--- a/mysql-test/suite/sys_vars/t/sql_quote_show_create_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_quote_show_create_basic.test
@@ -97,12 +97,8 @@ SET @@session.sql_quote_show_create = "Y";
SET @@session.sql_quote_show_create = TRÜE;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.sql_quote_show_create = ÕN;
-
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.sql_quote_show_create = OF;
-SELECT @@session.sql_quote_show_create;
-
---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.'
-
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.sql_quote_show_create = ÓFF;
--Error ER_WRONG_VALUE_FOR_VAR
@@ -116,10 +112,9 @@ SET @@session.sql_quote_show_create = NO;
# Test if accessing global sql_quote_show_create gives error #
##########################################################################
---Error ER_LOCAL_VARIABLE
-SET @@global.sql_quote_show_create = 0;
-
---Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.sql_quote_show_create = 1-@@global.sql_quote_show_create;
+SELECT @@global.sql_quote_show_create;
+SET @@global.sql_quote_show_create = 1-@@global.sql_quote_show_create;
SELECT @@global.sql_quote_show_create;
--echo '#----------------------FN_DYNVARS_162_06------------------------#'
diff --git a/mysql-test/suite/sys_vars/t/sql_safe_updates_basic.test b/mysql-test/suite/sys_vars/t/sql_safe_updates_basic.test
index 4f2c57bdb81..66148b65aaf 100644
--- a/mysql-test/suite/sys_vars/t/sql_safe_updates_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_safe_updates_basic.test
@@ -96,12 +96,8 @@ SET @@session.sql_safe_updates = "Y";
SET @@session.sql_safe_updates = TRÜE;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.sql_safe_updates = ÕN;
-
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.sql_safe_updates = OF;
-SELECT @@session.sql_safe_updates;
-
---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.'
-
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.sql_safe_updates = ÓFF;
--Error ER_WRONG_VALUE_FOR_VAR
@@ -115,10 +111,9 @@ SET @@session.sql_safe_updates = NO;
# Test if accessing global sql_safe_updates gives error #
###########################################################################
---Error ER_LOCAL_VARIABLE
-SET @@global.sql_safe_updates = 0;
-
---Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.sql_safe_updates = 1-@@global.sql_safe_updates;
+SELECT @@global.sql_safe_updates;
+SET @@global.sql_safe_updates = 1-@@global.sql_safe_updates;
SELECT @@global.sql_safe_updates;
--echo '#----------------------FN_DYNVARS_163_06------------------------#'
diff --git a/mysql-test/suite/sys_vars/t/sql_select_limit_basic.test b/mysql-test/suite/sys_vars/t/sql_select_limit_basic.test
new file mode 100644
index 00000000000..0b941d25f42
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/sql_select_limit_basic.test
@@ -0,0 +1,33 @@
+SET @start_global_value = @@global.sql_select_limit;
+SELECT @start_global_value;
+
+#
+# exists as global and session
+#
+select @@global.sql_select_limit;
+select @@session.sql_select_limit;
+show global variables like 'sql_select_limit';
+show session variables like 'sql_select_limit';
+select * from information_schema.global_variables where variable_name='sql_select_limit';
+select * from information_schema.session_variables where variable_name='sql_select_limit';
+
+#
+# show that it's writable
+#
+set global sql_select_limit=10;
+select @@global.sql_select_limit;
+set session sql_select_limit=20;
+select @@session.sql_select_limit;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global sql_select_limit=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global sql_select_limit=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global sql_select_limit="foo";
+
+SET @@global.sql_select_limit = @start_global_value;
+SELECT @@global.sql_select_limit;
diff --git a/mysql-test/suite/sys_vars/t/sql_slave_skip_counter_basic.test b/mysql-test/suite/sys_vars/t/sql_slave_skip_counter_basic.test
index e7d9098aee9..86cb3824d07 100644
--- a/mysql-test/suite/sys_vars/t/sql_slave_skip_counter_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_slave_skip_counter_basic.test
@@ -35,22 +35,16 @@
# Try accessing initial value #
#############################################################
---Error ER_VAR_CANT_BE_READ
SET @start_global_value = @@global.sql_slave_skip_counter;
---Error ER_VAR_CANT_BE_READ
SELECT @@global.sql_slave_skip_counter;
---echo 'Info:This value is write only. Value can not be read'
-
--echo '#--------------------FN_DYNVARS_165_02-------------------------#'
###################################################################
# Try setting DEFAULT value to variable #
###################################################################
---Error ER_NO_DEFAULT
SET @@global.sql_slave_skip_counter = DEFAULT;
-
--echo '#--------------------FN_DYNVARS_165_03-------------------------#'
###################################################################
# Try setting any valid value to variable #
@@ -64,7 +58,6 @@ SET @@global.sql_slave_skip_counter = 2147483648*2;
SET @@global.sql_slave_skip_counter = 2147483648*2-1;
SET @@global.sql_slave_skip_counter = 4294967295*4294967295;
-
--echo '#--------------------FN_DYNVARS_165_03-------------------------#'
###################################################################
# Checking invalid value for variable #
@@ -90,7 +83,6 @@ SELECT VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_slave_skip_counter';
-
--echo '#--------------------FN_DYNVARS_165_03-------------------------#'
###################################################################
# Checking if variable is accessible with session scope #
@@ -103,6 +95,7 @@ SET @@session.sql_slave_skip_counter = 12;
--Error ER_GLOBAL_VARIABLE
SET @@local.sql_slave_skip_counter = 13;
+SET @@global.sql_slave_skip_counter = 0;
########################################################
# END OF sql_slave_skip_counter TESTS #
########################################################
diff --git a/mysql-test/suite/sys_vars/t/sql_warnings_basic.test b/mysql-test/suite/sys_vars/t/sql_warnings_basic.test
index 99a9ad8dda2..ced58f96e15 100644
--- a/mysql-test/suite/sys_vars/t/sql_warnings_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_warnings_basic.test
@@ -87,10 +87,8 @@ SELECT @@session.sql_warnings;
# Change the value of sql_warnings to invalid value #
###########################################################################
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.sql_warnings = -0.6;
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.sql_warnings = 1.9;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.sql_warnings = 0.6;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.sql_warnings = "T";
--Error ER_WRONG_VALUE_FOR_VAR
@@ -99,12 +97,8 @@ SET @@session.sql_warnings = "Y";
SET @@session.sql_warnings = TRÜE;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.sql_warnings = ÕN;
-
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.sql_warnings = OF;
-SELECT @@session.sql_warnings;
-
---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.'
-
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.sql_warnings = ÓFF;
--Error ER_WRONG_VALUE_FOR_VAR
@@ -118,10 +112,9 @@ SET @@session.sql_warnings = NO;
# Test if accessing global sql_warnings gives error #
###########################################################################
---Error ER_LOCAL_VARIABLE
-SET @@global.sql_warnings = 0;
-
---Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.sql_warnings = 1-@@global.sql_warnings;
+SELECT @@global.sql_warnings;
+SET @@global.sql_warnings = 1-@@global.sql_warnings;
SELECT @@global.sql_warnings;
@@ -147,7 +140,6 @@ SELECT @@session.sql_warnings;
SELECT VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='sql_warnings';
---echo 'Bug: value in information schema does not match'
--echo '#---------------------FN_DYNVARS_166_08-------------------------#'
###################################################################
diff --git a/mysql-test/suite/sys_vars/t/storage_engine_basic.test b/mysql-test/suite/sys_vars/t/storage_engine_basic.test
index 689afcd1010..e62390cb384 100644
--- a/mysql-test/suite/sys_vars/t/storage_engine_basic.test
+++ b/mysql-test/suite/sys_vars/t/storage_engine_basic.test
@@ -38,9 +38,7 @@ SELECT @start_session_value;
# Display the DEFAULT value of storage_engine #
######################################################################
-SET @@global.storage_engine = MYISAM;
-
---Error ER_NO_DEFAULT
+SET @@global.storage_engine = INNODB;
SET @@global.storage_engine = DEFAULT;
SELECT @@global.storage_engine;
@@ -87,11 +85,14 @@ SELECT @@session.storage_engine;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.storage_engine = 8199;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.storage_engine = NULL;
+
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.storage_engine = -1024;
---Error ER_PARSE_ERROR
-SET @@global.storage_engine = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.storage_engine = 65530.34;
--Error ER_UNKNOWN_STORAGE_ENGINE
SET @@global.storage_engine = FILE;
@@ -99,8 +100,8 @@ SET @@global.storage_engine = FILE;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.storage_engine = 8199;
---Error ER_PARSE_ERROR
-SET @@session.storage_engine = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.storage_engine = 65530.34;
--Error ER_UNKNOWN_STORAGE_ENGINE
SET @@session.storage_engine = RECORD;
@@ -163,6 +164,8 @@ SELECT session.storage_engine;
--Error ER_BAD_FIELD_ERROR
SELECT storage_engine = @@session.storage_engine;
+# check the old obsolete name
+SET @@storage_engine = @start_global_value;
####################################
# Restore initial value #
diff --git a/mysql-test/suite/sys_vars/inc/sync_binlog_basic.inc b/mysql-test/suite/sys_vars/t/sync_binlog_basic.test
index 04adab85ac8..71a35a30c58 100644
--- a/mysql-test/suite/sys_vars/inc/sync_binlog_basic.inc
+++ b/mysql-test/suite/sys_vars/t/sync_binlog_basic.test
@@ -93,7 +93,6 @@ SET @@global.sync_binlog = -1024;
SELECT @@global.sync_binlog;
SET @@global.sync_binlog = 42949672950;
SELECT @@global.sync_binlog;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.sync_binlog = ON;
diff --git a/mysql-test/suite/sys_vars/t/sync_binlog_basic_32.test b/mysql-test/suite/sys_vars/t/sync_binlog_basic_32.test
deleted file mode 100644
index 275b95cf775..00000000000
--- a/mysql-test/suite/sys_vars/t/sync_binlog_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger 2008-05-07 #
-# #
-# Wrapper for 32 bit machines #
-################################################################################
-
---source include/have_32bit.inc
---source suite/sys_vars/inc/sync_binlog_basic.inc
-
diff --git a/mysql-test/suite/sys_vars/t/sync_binlog_basic_64.test b/mysql-test/suite/sys_vars/t/sync_binlog_basic_64.test
deleted file mode 100644
index e6f9bf668a0..00000000000
--- a/mysql-test/suite/sys_vars/t/sync_binlog_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger 2008-05-07 #
-# #
-# Wrapper for 64 bit machines #
-################################################################################
-
---source include/have_64bit.inc
---source suite/sys_vars/inc/sync_binlog_basic.inc
-
diff --git a/mysql-test/suite/sys_vars/t/sync_master_info_basic.test b/mysql-test/suite/sys_vars/t/sync_master_info_basic.test
new file mode 100644
index 00000000000..a080aa4c880
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/sync_master_info_basic.test
@@ -0,0 +1,43 @@
+
+SET @start_global_value = @@global.sync_master_info;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+select @@global.sync_master_info;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.sync_master_info;
+show global variables like 'sync_master_info';
+show session variables like 'sync_master_info';
+select * from information_schema.global_variables where variable_name='sync_master_info';
+select * from information_schema.session_variables where variable_name='sync_master_info';
+
+#
+# show that it's writable
+#
+set global sync_master_info=1;
+select @@global.sync_master_info;
+--error ER_GLOBAL_VARIABLE
+set session sync_master_info=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global sync_master_info=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global sync_master_info=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global sync_master_info="foo";
+
+#
+# min/max values
+#
+set global sync_master_info=0;
+select @@global.sync_master_info;
+set global sync_master_info=cast(-1 as unsigned int);
+select @@global.sync_master_info;
+
+SET @@global.sync_master_info = @start_global_value;
+SELECT @@global.sync_master_info;
diff --git a/mysql-test/suite/sys_vars/t/sync_relay_log_basic.test b/mysql-test/suite/sys_vars/t/sync_relay_log_basic.test
new file mode 100644
index 00000000000..112eaca7538
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/sync_relay_log_basic.test
@@ -0,0 +1,44 @@
+--source include/not_embedded.inc
+
+SET @start_global_value = @@global.sync_relay_log;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+select @@global.sync_relay_log;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.sync_relay_log;
+show global variables like 'sync_relay_log';
+show session variables like 'sync_relay_log';
+select * from information_schema.global_variables where variable_name='sync_relay_log';
+select * from information_schema.session_variables where variable_name='sync_relay_log';
+
+#
+# show that it's writable
+#
+set global sync_relay_log=1;
+select @@global.sync_relay_log;
+--error ER_GLOBAL_VARIABLE
+set session sync_relay_log=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global sync_relay_log=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global sync_relay_log=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global sync_relay_log="foo";
+
+#
+# min/max values
+#
+set global sync_relay_log=0;
+select @@global.sync_relay_log;
+set global sync_relay_log=cast(-1 as unsigned int);
+select @@global.sync_relay_log;
+
+SET @@global.sync_relay_log = @start_global_value;
+SELECT @@global.sync_relay_log;
diff --git a/mysql-test/suite/sys_vars/t/sync_relay_log_info_basic.test b/mysql-test/suite/sys_vars/t/sync_relay_log_info_basic.test
new file mode 100644
index 00000000000..2ef4b3c0880
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/sync_relay_log_info_basic.test
@@ -0,0 +1,44 @@
+--source include/not_embedded.inc
+
+SET @start_global_value = @@global.sync_relay_log_info;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+select @@global.sync_relay_log_info;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.sync_relay_log_info;
+show global variables like 'sync_relay_log_info';
+show session variables like 'sync_relay_log_info';
+select * from information_schema.global_variables where variable_name='sync_relay_log_info';
+select * from information_schema.session_variables where variable_name='sync_relay_log_info';
+
+#
+# show that it's writable
+#
+set global sync_relay_log_info=1;
+select @@global.sync_relay_log_info;
+--error ER_GLOBAL_VARIABLE
+set session sync_relay_log_info=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global sync_relay_log_info=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global sync_relay_log_info=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global sync_relay_log_info="foo";
+
+#
+# min/max values
+#
+set global sync_relay_log_info=0;
+select @@global.sync_relay_log_info;
+set global sync_relay_log_info=cast(-1 as unsigned int);
+select @@global.sync_relay_log_info;
+
+SET @@global.sync_relay_log_info = @start_global_value;
+SELECT @@global.sync_relay_log_info;
diff --git a/mysql-test/suite/sys_vars/t/table_definition_cache_basic.test b/mysql-test/suite/sys_vars/t/table_definition_cache_basic.test
index 741079091bc..69f29108645 100644
--- a/mysql-test/suite/sys_vars/t/table_definition_cache_basic.test
+++ b/mysql-test/suite/sys_vars/t/table_definition_cache_basic.test
@@ -83,7 +83,6 @@ SET @@global.table_definition_cache = 524289;
SELECT @@global.table_definition_cache;
SET @@global.table_definition_cache = 42949672950;
SELECT @@global.table_definition_cache;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.table_definition_cache = 21221204.10;
diff --git a/mysql-test/suite/sys_vars/t/table_lock_wait_timeout_basic.test b/mysql-test/suite/sys_vars/t/table_lock_wait_timeout_basic.test
index 43186c70874..f33e5660c5d 100644
--- a/mysql-test/suite/sys_vars/t/table_lock_wait_timeout_basic.test
+++ b/mysql-test/suite/sys_vars/t/table_lock_wait_timeout_basic.test
@@ -87,7 +87,6 @@ SET @@global.table_lock_wait_timeout= 100000000000;
SET @@global.table_lock_wait_timeout= -1024;
SET @@global.table_lock_wait_timeout= 0;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.table_lock_wait_timeout= 10000.01;
diff --git a/mysql-test/suite/sys_vars/t/table_open_cache_basic.test b/mysql-test/suite/sys_vars/t/table_open_cache_basic.test
index c32463ca030..7d2549cd87f 100644
--- a/mysql-test/suite/sys_vars/t/table_open_cache_basic.test
+++ b/mysql-test/suite/sys_vars/t/table_open_cache_basic.test
@@ -95,9 +95,6 @@ SELECT @@global.table_open_cache ;
SET @@global.table_open_cache = 0;
SELECT @@global.table_open_cache ;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
-
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.table_open_cache = 10000.01;
diff --git a/mysql-test/suite/sys_vars/t/thread_cache_size_basic.test b/mysql-test/suite/sys_vars/t/thread_cache_size_basic.test
new file mode 100644
index 00000000000..48a4c0797e5
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/thread_cache_size_basic.test
@@ -0,0 +1,43 @@
+
+SET @start_global_value = @@global.thread_cache_size;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+select @@global.thread_cache_size;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.thread_cache_size;
+show global variables like 'thread_cache_size';
+show session variables like 'thread_cache_size';
+select * from information_schema.global_variables where variable_name='thread_cache_size';
+select * from information_schema.session_variables where variable_name='thread_cache_size';
+
+#
+# show that it's writable
+#
+set global thread_cache_size=1;
+select @@global.thread_cache_size;
+--error ER_GLOBAL_VARIABLE
+set session thread_cache_size=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global thread_cache_size=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global thread_cache_size=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global thread_cache_size="foo";
+
+#
+# min/max values
+#
+set global thread_cache_size=0;
+select @@global.thread_cache_size;
+set global thread_cache_size=cast(-1 as unsigned int);
+select @@global.thread_cache_size;
+
+SET @@global.thread_cache_size = @start_global_value;
+SELECT @@global.thread_cache_size;
diff --git a/mysql-test/suite/sys_vars/t/thread_concurrency_basic.test b/mysql-test/suite/sys_vars/t/thread_concurrency_basic.test
new file mode 100644
index 00000000000..d4acc961752
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/thread_concurrency_basic.test
@@ -0,0 +1,19 @@
+--source include/have_thread_concurrency.inc
+#
+# only global
+#
+select @@global.thread_concurrency;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.thread_concurrency;
+show global variables like 'thread_concurrency';
+show session variables like 'thread_concurrency';
+select * from information_schema.global_variables where variable_name='thread_concurrency';
+select * from information_schema.session_variables where variable_name='thread_concurrency';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global thread_concurrency=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session thread_concurrency=1;
diff --git a/mysql-test/suite/sys_vars/t/thread_stack_basic.test b/mysql-test/suite/sys_vars/t/thread_stack_basic.test
new file mode 100644
index 00000000000..2d4d144572d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/thread_stack_basic.test
@@ -0,0 +1,23 @@
+#
+# only global
+#
+--replace_result 196608 262144
+select @@global.thread_stack;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.thread_stack;
+--replace_result 196608 262144
+show global variables like 'thread_stack';
+--replace_result 196608 262144
+show session variables like 'thread_stack';
+--replace_result 196608 262144
+select * from information_schema.global_variables where variable_name='thread_stack';
+--replace_result 196608 262144
+select * from information_schema.session_variables where variable_name='thread_stack';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global thread_stack=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session thread_stack=1;
diff --git a/mysql-test/suite/sys_vars/t/time_format_basic.test b/mysql-test/suite/sys_vars/t/time_format_basic.test
new file mode 100644
index 00000000000..ec737b8c621
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/time_format_basic.test
@@ -0,0 +1,18 @@
+#
+# only global
+#
+select @@global.time_format;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.time_format;
+show global variables like 'time_format';
+show session variables like 'time_format';
+select * from information_schema.global_variables where variable_name='time_format';
+select * from information_schema.session_variables where variable_name='time_format';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global time_format=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session time_format=1;
diff --git a/mysql-test/suite/sys_vars/inc/timestamp_basic.inc b/mysql-test/suite/sys_vars/t/timestamp_basic.test
index 9ef57c97043..a5baf304bf3 100644
--- a/mysql-test/suite/sys_vars/inc/timestamp_basic.inc
+++ b/mysql-test/suite/sys_vars/t/timestamp_basic.test
@@ -1,4 +1,4 @@
-################## mysql-test\t\timestamp_basic.test ##########################
+################## mysql-test/t/timestamp_basic.test ##########################
# #
# Variable Name: timestamp #
# Scope: SESSION #
@@ -43,9 +43,7 @@ SET @session_start_value = @@session.timestamp;
SET @@timestamp = DEFAULT;
-#SELECT @@timestamp;
-
---echo 'timestamp does not have any DEFAULT value'
+SELECT @@timestamp = UNIX_TIMESTAMP();
--echo '#---------------------FN_DYNVARS_001_02-------------------------#'
##############################################################
@@ -55,23 +53,18 @@ SET @@timestamp = DEFAULT;
--Error ER_LOCAL_VARIABLE
SET @@global.timestamp = "1000";
-
--echo '#--------------------FN_DYNVARS_001_03------------------------#'
########################################################################
# Change the value of timestamp to a valid value #
########################################################################
SET @@timestamp = 0;
-#SELECT @@timestamp;
+SELECT @@timestamp = UNIX_TIMESTAMP();
--echo 'Setting 0 resets timestamp to session default timestamp'
-SET @@timestamp = 123456789123456;
-SELECT @@timestamp;
-SET @@timestamp = 60*60*60*60*365;
-SELECT @@timestamp;
SET @@timestamp = -1000000000;
-SELECT @@timestamp;
+SELECT @@timestamp = UNIX_TIMESTAMP();
SET @temp_ts = @@timestamp - @@timestamp;
SELECT @temp_ts;
@@ -84,7 +77,6 @@ SELECT @temp_ts;
# for session scope
--Error ER_WRONG_TYPE_FOR_VAR
SET @@timestamp = "100";
---echo 'Bug# 34836: Documentation says its a string variable but infact its numeric'
--Error ER_WRONG_TYPE_FOR_VAR
SET @@timestamp = " ";
diff --git a/mysql-test/suite/sys_vars/t/timestamp_basic_32.test b/mysql-test/suite/sys_vars/t/timestamp_basic_32.test
deleted file mode 100644
index a2b6139aef9..00000000000
--- a/mysql-test/suite/sys_vars/t/timestamp_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger 2008-05-07 #
-# #
-# Wrapper for 32 bit machines #
-################################################################################
-
---source include/have_32bit.inc
---source suite/sys_vars/inc/timestamp_basic.inc
-
diff --git a/mysql-test/suite/sys_vars/t/timestamp_basic_64.test b/mysql-test/suite/sys_vars/t/timestamp_basic_64.test
deleted file mode 100644
index fbc86316ed9..00000000000
--- a/mysql-test/suite/sys_vars/t/timestamp_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger 2008-05-07 #
-# #
-# Wrapper for 64 bit machines #
-################################################################################
-
---source include/have_64bit.inc
---source suite/sys_vars/inc/timestamp_basic.inc
-
diff --git a/mysql-test/suite/sys_vars/t/tx_isolation_basic.test b/mysql-test/suite/sys_vars/t/tx_isolation_basic.test
index 136a9b4331e..0a15aa08b6b 100644
--- a/mysql-test/suite/sys_vars/t/tx_isolation_basic.test
+++ b/mysql-test/suite/sys_vars/t/tx_isolation_basic.test
@@ -46,16 +46,11 @@ SELECT @session_start_value;
####################################################################
SET @@global.tx_isolation = 'READ-UNCOMMITTED';
---Error ER_NO_DEFAULT
SET @@global.tx_isolation = DEFAULT;
---echo 'Bug# 34878: Documentation specifies a DEFAULT value of REPEATABLE-READ';
---echo 'where as DEFAULT is not supported here.';
+SELECT @@global.tx_isolation;
-SET @@session.tx_isolation = 'SERIALIZABLE';
SET @@session.tx_isolation = DEFAULT;
SELECT @@session.tx_isolation;
---echo 'Bug# 34876: Documentation specifies a DEFAULT value of REPEATABLE-READ';
---echo 'where as DEFAULT here as no effect.';
--echo '#---------------------FN_DYNVARS_183_02-------------------------#'
#########################################################
@@ -115,18 +110,12 @@ SELECT @@session.tx_isolation;
SET @@global.tx_isolation = -1;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.tx_isolation = READUNCOMMITTED;
-
-
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.tx_isolation = 'REPEATABLE';
-SELECT @@global.tx_isolation;
---echo 'Bug# 34833: REPEATABLE is not documented as as valid tx_isolation level'
-
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.tx_isolation = OFF;
-
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.tx_isolation = ON;
-
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.tx_isolation = 'NON-SERIALIZABLE';
@@ -136,11 +125,8 @@ SET @@global.tx_isolation = 'NON-SERIALIZABLE';
SET @@tx_isolation = -1;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@tx_isolation = READUNCOMMITTED;
-
+--Error ER_WRONG_VALUE_FOR_VAR
SET @@tx_isolation = 'REPEATABLE';
-SELECT @@tx_isolation;
---echo 'Bug# 34833: REPEATABLE is not documented as as valid tx_isolation level'
-
--Error ER_WRONG_VALUE_FOR_VAR
SET @@tx_isolation = 'NONE';
--Error ER_WRONG_VALUE_FOR_VAR
@@ -183,29 +169,8 @@ SELECT @@global.tx_isolation;
SET @@global.tx_isolation = 3;
SELECT @@global.tx_isolation;
-# use of decimal values
-
+--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.tx_isolation = 0.4;
-SELECT @@global.tx_isolation;
-
-SET @@global.tx_isolation = 1.1;
-SELECT @@global.tx_isolation;
-
-SET @@global.tx_isolation = 1.5;
-SELECT @@global.tx_isolation;
-
-SET @@global.tx_isolation = 2.9;
-SELECT @@global.tx_isolation;
-
-SET @@session.tx_isolation = 3.49;
-SELECT @@session.tx_isolation;
-
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.tx_isolation = 3.6;
-
---echo 'Bug: Decimal values can be used within the range [0.0-3.5).';
---echo 'Values are rounded to 0,1,2,3 as evident from outcome.';
-
--echo '#---------------------FN_DYNVARS_183_08----------------------#'
###################################################################
diff --git a/mysql-test/suite/sys_vars/t/unique_checks_basic.test b/mysql-test/suite/sys_vars/t/unique_checks_basic.test
index 364dfc07cd1..af2ab6e58bd 100644
--- a/mysql-test/suite/sys_vars/t/unique_checks_basic.test
+++ b/mysql-test/suite/sys_vars/t/unique_checks_basic.test
@@ -46,16 +46,6 @@ SET @@session.unique_checks= 1;
SET @@session.unique_checks= DEFAULT;
SELECT @@session.unique_checks;
---echo '#--------------------FN_DYNVARS_005_02-------------------------#'
-#############################################################
-# Check the DEFAULT value of unique_checks #
-#############################################################
-
-
-SET @@session.unique_checks = DEFAULT;
-SELECT @@session.unique_checks =1;
-
-
--echo '#--------------------FN_DYNVARS_005_04-------------------------#'
########################################################################
# Change the value of unique_checks to a valid value for SESSION Scope #
diff --git a/mysql-test/suite/sys_vars/t/updatable_views_with_limit_basic.test b/mysql-test/suite/sys_vars/t/updatable_views_with_limit_basic.test
index 61a45793d39..941eb1db61a 100644
--- a/mysql-test/suite/sys_vars/t/updatable_views_with_limit_basic.test
+++ b/mysql-test/suite/sys_vars/t/updatable_views_with_limit_basic.test
@@ -166,7 +166,7 @@ SET @@global.updatable_views_with_limit = 2345;
SET @@global.updatable_views_with_limit = "FALSE";
---Error ER_WRONG_VALUE_FOR_VAR
+--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.updatable_views_with_limit = 65530.34;
--Error ER_WRONG_VALUE_FOR_VAR
diff --git a/mysql-test/suite/sys_vars/inc/wait_timeout_basic.inc b/mysql-test/suite/sys_vars/t/wait_timeout_basic.test
index b6e19e235ba..e92a3294b86 100644
--- a/mysql-test/suite/sys_vars/inc/wait_timeout_basic.inc
+++ b/mysql-test/suite/sys_vars/t/wait_timeout_basic.test
@@ -104,8 +104,6 @@ SELECT @@session.wait_timeout;
SET @@global.wait_timeout = 0;
SET @@global.wait_timeout = -1024;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.wait_timeout = ON;
diff --git a/mysql-test/suite/sys_vars/t/wait_timeout_basic_32.test b/mysql-test/suite/sys_vars/t/wait_timeout_basic_32.test
deleted file mode 100644
index 613a5543b14..00000000000
--- a/mysql-test/suite/sys_vars/t/wait_timeout_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger 2008-05-07 #
-# #
-# Wrapper for 32 bit machines #
-################################################################################
-
---source include/have_32bit.inc
---source suite/sys_vars/inc/wait_timeout_basic.inc
-
diff --git a/mysql-test/suite/sys_vars/t/wait_timeout_basic_64.test b/mysql-test/suite/sys_vars/t/wait_timeout_basic_64.test
deleted file mode 100644
index d1138cbc105..00000000000
--- a/mysql-test/suite/sys_vars/t/wait_timeout_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger 2008-05-07 #
-# #
-# Wrapper for 64 bit machines #
-################################################################################
-
---source include/have_64bit.inc
---source suite/sys_vars/inc/wait_timeout_basic.inc
-
diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test
index bd5f8c96518..a4a4bafcc5a 100644
--- a/mysql-test/t/archive.test
+++ b/mysql-test/t/archive.test
@@ -1615,7 +1615,7 @@ DROP TABLE t1;
# BUG#46961 - archive engine loses rows during self joining select!
#
SET @save_join_buffer_size= @@join_buffer_size;
-SET @@join_buffer_size= 8228;
+SET @@join_buffer_size= 8192;
CREATE TABLE t1(a CHAR(255)) ENGINE=archive;
INSERT INTO t1 VALUES('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),
('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),
diff --git a/mysql-test/t/bug46080-master.opt b/mysql-test/t/bug46080-master.opt
index f59740afe60..edcc54fa428 100644
--- a/mysql-test/t/bug46080-master.opt
+++ b/mysql-test/t/bug46080-master.opt
@@ -1 +1 @@
---skip-grant-tables --skip-name-resolve --safemalloc-mem-limit=4000000
+--skip-grant-tables --skip-name-resolve --loose-safemalloc-mem-limit=4000000
diff --git a/mysql-test/t/bug46080.test b/mysql-test/t/bug46080.test
index 8b4cee4d8b0..6daf12cf1c5 100644
--- a/mysql-test/t/bug46080.test
+++ b/mysql-test/t/bug46080.test
@@ -3,6 +3,8 @@
--echo # sort_buffer_size cannot allocate
--echo #
+--source include/have_debug.inc
+
call mtr.add_suppression("Out of memory at line .*, 'my_alloc.c'");
call mtr.add_suppression("needed .* byte .*k., memory in use: .* bytes .*k");
diff --git a/mysql-test/t/change_user.test b/mysql-test/t/change_user.test
index 89f35116a2c..3ed798e8d36 100644
--- a/mysql-test/t/change_user.test
+++ b/mysql-test/t/change_user.test
@@ -20,7 +20,7 @@ SET @@session.max_join_size = default;
SELECT @@session.sql_big_selects;
# On some machines the following will result into a warning
--disable_warnings
-SET @@global.max_join_size = -1;
+SET @@global.max_join_size = 18446744073709551615;
--enable_warnings
SET @@session.max_join_size = default;
--echo change_user
diff --git a/mysql-test/t/date_formats.test b/mysql-test/t/date_formats.test
index e5dc7ffa53e..a83e18c44d9 100644
--- a/mysql-test/t/date_formats.test
+++ b/mysql-test/t/date_formats.test
@@ -17,82 +17,77 @@ WHERE variable_name IN ('date_format', 'datetime_format', 'time_format')
ORDER BY variable_name;
#
-# Test setting a lot of different formats to see which formats are accepted and
-# which aren't
-#
-
-SET time_format='%H%i%s';
-SET time_format='%H:%i:%s.%f';
-SET time_format='%h-%i-%s.%f%p';
-SET time_format='%h:%i:%s.%f %p';
-SET time_format='%h:%i:%s%p';
-
-SET date_format='%Y%m%d';
-SET date_format='%Y.%m.%d';
-SET date_format='%d.%m.%Y';
-SET date_format='%m-%d-%Y';
-
-set datetime_format= '%Y%m%d%H%i%s';
-set datetime_format= '%Y-%m-%d %H:%i:%s';
-set datetime_format= '%m-%d-%y %H:%i:%s.%f';
-set datetime_format= '%d-%m-%Y %h:%i:%s%p';
-set datetime_format= '%H:%i:%s %Y-%m-%d';
-set datetime_format= '%H:%i:%s.%f %m-%d-%Y';
-set datetime_format= '%h:%i:%s %p %Y-%m-%d';
-set datetime_format= '%h:%i:%s.%f %p %Y-%m-%d';
-
-SELECT variable_name, variable_value
-FROM information_schema.session_variables
-WHERE variable_name IN ('date_format', 'datetime_format', 'time_format')
-ORDER BY variable_name;
-
---error 1231
-SET time_format='%h:%i:%s';
---error 1231
-SET time_format='%H %i:%s';
---error 1231
-SET time_format='%H::%i:%s';
---error 1231
-SET time_format='%H:%i:%s%f';
---error 1231
-SET time_format='%H:%i.%f:%s';
---error 1231
-SET time_format='%H:%i:%s%p';
---error 1231
-SET time_format='%h:%i:%s.%f %p %Y-%m-%d';
---error 1231
-SET time_format='%H%i%s.%f';
---error 1231
-SET time_format='%H:%i-%s.%f';
---error 1231
-SET date_format='%d.%m.%d';
---error 1231
-SET datetime_format='%h.%m.%y %d.%i.%s';
---error 1231
-set datetime_format= '%H:%i:%s.%f %p %Y-%m-%d';
-
-#
-# Test GLOBAL values
-
-set GLOBAL datetime_format= '%H:%i:%s %Y-%m-%d';
-SET SESSION datetime_format=default;
-select @@global.datetime_format, @@session.datetime_format;
-SET GLOBAL datetime_format=default;
-SET SESSION datetime_format=default;
-select @@global.datetime_format, @@session.datetime_format;
-
-SET GLOBAL date_format=default;
-SET GLOBAL time_format=default;
-SET GLOBAL datetime_format=default;
-SET time_format=default;
-SET date_format=default;
-SET datetime_format=default;
-
-#
# The following tests will work only when we at some point will enable
# dynamic changing of formats
#
+# SET time_format='%H%i%s';
+# SET time_format='%H:%i:%s.%f';
+# SET time_format='%h-%i-%s.%f%p';
+# SET time_format='%h:%i:%s.%f %p';
+# SET time_format='%h:%i:%s%p';
+#
+# SET date_format='%Y%m%d';
+# SET date_format='%Y.%m.%d';
+# SET date_format='%d.%m.%Y';
+# SET date_format='%m-%d-%Y';
+#
+# set datetime_format= '%Y%m%d%H%i%s';
+# set datetime_format= '%Y-%m-%d %H:%i:%s';
+# set datetime_format= '%m-%d-%y %H:%i:%s.%f';
+# set datetime_format= '%d-%m-%Y %h:%i:%s%p';
+# set datetime_format= '%H:%i:%s %Y-%m-%d';
+# set datetime_format= '%H:%i:%s.%f %m-%d-%Y';
+# set datetime_format= '%h:%i:%s %p %Y-%m-%d';
+# set datetime_format= '%h:%i:%s.%f %p %Y-%m-%d';
+#
+# SELECT variable_name, variable_value
+# FROM information_schema.session_variables
+# WHERE variable_name IN ('date_format', 'datetime_format', 'time_format')
+# ORDER BY variable_name;
+#
+# --error 1231
+# SET time_format='%h:%i:%s';
+# --error 1231
+# SET time_format='%H %i:%s';
+# --error 1231
+# SET time_format='%H::%i:%s';
+# --error 1231
+# SET time_format='%H:%i:%s%f';
+# --error 1231
+# SET time_format='%H:%i.%f:%s';
+# --error 1231
+# SET time_format='%H:%i:%s%p';
+# --error 1231
+# SET time_format='%h:%i:%s.%f %p %Y-%m-%d';
+# --error 1231
+# SET time_format='%H%i%s.%f';
+# --error 1231
+# SET time_format='%H:%i-%s.%f';
+# --error 1231
+# SET date_format='%d.%m.%d';
+# --error 1231
+# SET datetime_format='%h.%m.%y %d.%i.%s';
+# --error 1231
+# set datetime_format= '%H:%i:%s.%f %p %Y-%m-%d';
+#
+# #
+# # Test GLOBAL values
+#
+# set GLOBAL datetime_format= '%H:%i:%s %Y-%m-%d';
+# SET SESSION datetime_format=default;
+# select @@global.datetime_format, @@session.datetime_format;
+# SET GLOBAL datetime_format=default;
+# SET SESSION datetime_format=default;
+# select @@global.datetime_format, @@session.datetime_format;
+#
+# SET GLOBAL date_format=default;
+# SET GLOBAL time_format=default;
+# SET GLOBAL datetime_format=default;
+# SET time_format=default;
+# SET date_format=default;
+# SET datetime_format=default;
+
# SET date_format='%d.%m.%Y';
# select CAST('01.01.2001' as DATE) as a;
# SET datetime_format='%d.%m.%Y %H.%i.%s';
diff --git a/mysql-test/t/ddl_i18n_koi8r.test b/mysql-test/t/ddl_i18n_koi8r.test
index fecef2f95d5..7ad46ae5f61 100644
--- a/mysql-test/t/ddl_i18n_koi8r.test
+++ b/mysql-test/t/ddl_i18n_koi8r.test
@@ -148,7 +148,7 @@ set names koi8r|
--echo
--echo ---> Dumping mysqltest1 to ddl_i18n_koi8r.views.mysqltest1.sql
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --databases mysqltest1 > $views_dump1
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --databases mysqltest1 > $views_dump1
# - Clean mysqltest1;
@@ -408,22 +408,22 @@ set names koi8r|
--echo
--echo ---> Dump of mysqltest1
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --routines --databases mysqltest1
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --routines --databases mysqltest1
--echo
--echo ---> Dumping mysqltest1 to ddl_i18n_koi8r.sp.mysqltest1.sql
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --routines --databases mysqltest1 > $sp_dump1
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --routines --databases mysqltest1 > $sp_dump1
--echo
--echo ---> Dump of mysqltest2
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --routines --databases mysqltest2
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --routines --databases mysqltest2
--echo
--echo ---> Dumping mysqltest2 to ddl_i18n_koi8r.sp.mysqltest2.sql
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --routines --databases mysqltest2 > $sp_dump2
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --routines --databases mysqltest2 > $sp_dump2
# - Clean mysqltest1, mysqltest2;
@@ -685,22 +685,22 @@ use mysqltest1|
--echo
--echo ---> Dump of mysqltest1
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --triggers --databases mysqltest1
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --triggers --databases mysqltest1
--echo
--echo ---> Dumping mysqltest1 to ddl_i18n_koi8r.triggers.mysqltest1.sql
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --triggers --databases mysqltest1 > $triggers_dump1
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --triggers --databases mysqltest1 > $triggers_dump1
--echo
--echo ---> Dump of mysqltest2
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --triggers --databases mysqltest2
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --triggers --databases mysqltest2
--echo
--echo ---> Dumping mysqltest2 to ddl_i18n_koi8r.triggers.mysqltest2.sql
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --triggers --databases mysqltest2 > $triggers_dump2
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --triggers --databases mysqltest2 > $triggers_dump2
# - Clean mysqltest1, mysqltest2;
@@ -946,22 +946,22 @@ set names koi8r|
--echo
--echo ---> Dump of mysqltest1
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --events --databases mysqltest1
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --events --databases mysqltest1
--echo
--echo ---> Dumping mysqltest1 to ddl_i18n_koi8r.events.mysqltest1.sql
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --events --databases mysqltest1 > $events_dump1
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --events --databases mysqltest1 > $events_dump1
--echo
--echo ---> Dump of mysqltest2
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --events --databases mysqltest2
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --events --databases mysqltest2
--echo
--echo ---> Dumping mysqltest2 to ddl_i18n_koi8r.events.mysqltest2.sql
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --events --databases mysqltest2 > $events_dump2
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --events --databases mysqltest2 > $events_dump2
# - Clean mysqltest1, mysqltest2;
diff --git a/mysql-test/t/ddl_i18n_utf8.test b/mysql-test/t/ddl_i18n_utf8.test
index 8788d0604f2..6ef418fc6e7 100644
--- a/mysql-test/t/ddl_i18n_utf8.test
+++ b/mysql-test/t/ddl_i18n_utf8.test
@@ -148,7 +148,7 @@ set names utf8|
--echo
--echo ---> Dumping mysqltest1 to ddl_i18n_utf8views.mysqltest1.sql
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --databases mysqltest1 > $views_dump1
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --databases mysqltest1 > $views_dump1
# - Clean mysqltest1;
@@ -408,22 +408,22 @@ set names utf8|
--echo
--echo ---> Dump of mysqltest1
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --routines --databases mysqltest1
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --routines --databases mysqltest1
--echo
--echo ---> Dumping mysqltest1 to ddl_i18n_utf8sp.mysqltest1.sql
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --routines --databases mysqltest1 > $sp_dump1
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --routines --databases mysqltest1 > $sp_dump1
--echo
--echo ---> Dump of mysqltest2
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --routines --databases mysqltest2
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --routines --databases mysqltest2
--echo
--echo ---> Dumping mysqltest2 to ddl_i18n_utf8sp.mysqltest2.sql
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --routines --databases mysqltest2 > $sp_dump2
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --routines --databases mysqltest2 > $sp_dump2
# - Clean mysqltest1, mysqltest2;
@@ -685,22 +685,22 @@ use mysqltest1|
--echo
--echo ---> Dump of mysqltest1
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --triggers --databases mysqltest1
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --triggers --databases mysqltest1
--echo
--echo ---> Dumping mysqltest1 to ddl_i18n_utf8triggers.mysqltest1.sql
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --triggers --databases mysqltest1 > $triggers_dump1
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --triggers --databases mysqltest1 > $triggers_dump1
--echo
--echo ---> Dump of mysqltest2
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --triggers --databases mysqltest2
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --triggers --databases mysqltest2
--echo
--echo ---> Dumping mysqltest2 to ddl_i18n_utf8triggers.mysqltest2.sql
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --triggers --databases mysqltest2 > $triggers_dump2
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --triggers --databases mysqltest2 > $triggers_dump2
# - Clean mysqltest1, mysqltest2;
@@ -946,22 +946,22 @@ set names utf8|
--echo
--echo ---> Dump of mysqltest1
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --events --databases mysqltest1
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --events --databases mysqltest1
--echo
--echo ---> Dumping mysqltest1 to ddl_i18n_utf8events.mysqltest1.sql
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --events --databases mysqltest1 > $events_dump1
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --events --databases mysqltest1 > $events_dump1
--echo
--echo ---> Dump of mysqltest2
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --events --databases mysqltest2
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --events --databases mysqltest2
--echo
--echo ---> Dumping mysqltest2 to ddl_i18n_utf8events.mysqltest2.sql
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --events --databases mysqltest2 > $events_dump2
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --events --databases mysqltest2 > $events_dump2
# - Clean mysqltest1, mysqltest2;
diff --git a/mysql-test/t/errors.test b/mysql-test/t/errors.test
index 44c514f1244..5e53eaf0a52 100644
--- a/mysql-test/t/errors.test
+++ b/mysql-test/t/errors.test
@@ -102,8 +102,11 @@ drop table t1;
drop table t2;
drop function f1;
drop function f2;
+
+#
+# testing the value encoding in the error messages
#
-# testing the value encoding in the error messages of set_var
+# should be TR\xC3\x9CE, TRÜE, TRÜE
#
SET NAMES utf8;
--error ER_WRONG_VALUE_FOR_VAR
@@ -125,9 +128,9 @@ SET sql_quote_show_create= _utf8 x'5452C39C45';
--error ER_WRONG_VALUE_FOR_VAR
SET sql_quote_show_create=_latin1 x'5452DC45';
--error ER_WRONG_VALUE_FOR_VAR
-SET sql_quote_show_create='TR.E';
+SET sql_quote_show_create='TRÜE';
--error ER_WRONG_VALUE_FOR_VAR
-SET sql_quote_show_create=TR.E;
+SET sql_quote_show_create=TRÜE;
SET NAMES binary;
--error ER_WRONG_VALUE_FOR_VAR
@@ -136,3 +139,4 @@ SET sql_quote_show_create= _binary x'5452C39C45';
SET sql_quote_show_create= _utf8 x'5452C39C45';
--error ER_WRONG_VALUE_FOR_VAR
SET sql_quote_show_create=_latin1 x'5452DC45';
+
diff --git a/mysql-test/t/events_2.test b/mysql-test/t/events_2.test
index a50255e9f8b..08412d2f5b0 100644
--- a/mysql-test/t/events_2.test
+++ b/mysql-test/t/events_2.test
@@ -25,15 +25,6 @@ set names utf8;
create event задачка on schedule every 123 minute starts now() ends now() + interval 1 month do select 1;
drop event задачка;
-# event_scheduler is a global var
---error ER_GLOBAL_VARIABLE
-set event_scheduler=off;
-# event_scheduler could be only either 1 or 2
---error ER_WRONG_VALUE_FOR_VAR
-set global event_scheduler=3;
---error ER_WRONG_VALUE_FOR_VAR
-set global event_scheduler=disabled;
-
--echo "DISABLE the scheduler. Testing that it does not work when the variable is 0"
set global event_scheduler=off;
select definer, name, db from mysql.event;
diff --git a/mysql-test/t/events_bugs.test b/mysql-test/t/events_bugs.test
index 81397b333f9..8d9959f1b0a 100644
--- a/mysql-test/t/events_bugs.test
+++ b/mysql-test/t/events_bugs.test
@@ -1199,14 +1199,14 @@ DROP USER mysqltest_u1@localhost;
drop procedure if exists p;
--enable_warnings
set @old_mode= @@sql_mode;
-set @@sql_mode= pow(2,32)-1;
+set @@sql_mode= cast(pow(2,32)-1 as unsigned integer);
create event e1 on schedule every 1 day do select 1;
-select @@sql_mode;
+select @@sql_mode into @full_mode;
set @@sql_mode= @old_mode;
# Rename SQL modes that differ in name between the server and the table definition.
-select replace(@full_mode, '?', 'NOT_USED') into @full_mode;
+select replace(@full_mode, ',,,', ',NOT_USED,') into @full_mode;
select replace(@full_mode, 'ALLOW_INVALID_DATES', 'INVALID_DATES') into @full_mode;
-select name from mysql.event where name = 'p' and sql_mode = @full_mode;
+select name from mysql.event where name = 'e1' and sql_mode = @full_mode;
drop event e1;
#
diff --git a/mysql-test/t/index_merge_myisam.test b/mysql-test/t/index_merge_myisam.test
index dccaecef20a..86195cc3cd9 100644
--- a/mysql-test/t/index_merge_myisam.test
+++ b/mysql-test/t/index_merge_myisam.test
@@ -36,7 +36,6 @@ select @@optimizer_switch;
set optimizer_switch='default,index_merge_sort_union=off';
select @@optimizer_switch;
---error ER_WRONG_VALUE_FOR_VAR
set optimizer_switch=4;
--error ER_WRONG_VALUE_FOR_VAR
diff --git a/mysql-test/t/innodb_bug42101-nonzero.test b/mysql-test/t/innodb_bug42101-nonzero.test
index 685fdf20489..2e4cf1f46dd 100644
--- a/mysql-test/t/innodb_bug42101-nonzero.test
+++ b/mysql-test/t/innodb_bug42101-nonzero.test
@@ -5,7 +5,7 @@
-- source include/have_innodb.inc
---error ER_WRONG_ARGUMENTS
+--error ER_WRONG_VALUE_FOR_VAR
set global innodb_commit_concurrency=0;
select @@innodb_commit_concurrency;
set global innodb_commit_concurrency=1;
@@ -14,7 +14,7 @@ set global innodb_commit_concurrency=42;
select @@innodb_commit_concurrency;
set global innodb_commit_concurrency=DEFAULT;
select @@innodb_commit_concurrency;
---error ER_WRONG_ARGUMENTS
+--error ER_WRONG_VALUE_FOR_VAR
set global innodb_commit_concurrency=0;
select @@innodb_commit_concurrency;
set global innodb_commit_concurrency=1;
diff --git a/mysql-test/t/innodb_bug42101.test b/mysql-test/t/innodb_bug42101.test
index b6536490d48..f0b88e034a0 100644
--- a/mysql-test/t/innodb_bug42101.test
+++ b/mysql-test/t/innodb_bug42101.test
@@ -7,10 +7,10 @@
set global innodb_commit_concurrency=0;
select @@innodb_commit_concurrency;
---error ER_WRONG_ARGUMENTS
+--error ER_WRONG_VALUE_FOR_VAR
set global innodb_commit_concurrency=1;
select @@innodb_commit_concurrency;
---error ER_WRONG_ARGUMENTS
+--error ER_WRONG_VALUE_FOR_VAR
set global innodb_commit_concurrency=42;
select @@innodb_commit_concurrency;
set global innodb_commit_concurrency=0;
diff --git a/mysql-test/t/key_cache.test b/mysql-test/t/key_cache.test
index 4c14dc96aaa..a404e9bf15a 100644
--- a/mysql-test/t/key_cache.test
+++ b/mysql-test/t/key_cache.test
@@ -149,10 +149,13 @@ show status like 'key_blocks_used';
--replace_result 1812 KEY_BLOCKS_UNUSED 1793 KEY_BLOCKS_UNUSED 1674 KEY_BLOCKS_UNUSED 1818 KEY_BLOCKS_UNUSED 1824 KEY_BLOCKS_UNUSED
show status like 'key_blocks_unused';
-
-# Cleanup
-# We don't reset keycache2 as we want to ensure that mysqld will reset it
+create table t1 (a int primary key);
+cache index t1 in keycache2;
+insert t1 values (1),(2),(3),(4),(5),(6),(7),(8);
+# delete keycache2, t1 is reassigned to default
set global keycache2.key_buffer_size=0;
+select * from t1;
+drop table t1;
# Test to set up a too small size for a key cache (bug #2064)
set global keycache3.key_buffer_size=100;
@@ -216,6 +219,7 @@ set global key_cache_block_size= @my_key_cache_block_size;
# Bug#10473 - Can't set 'key_buffer_size' system variable to ZERO
# (One cannot drop the default key cache.)
#
+--error ER_WARN_CANT_DROP_DEFAULT_KEYCACHE
set @@global.key_buffer_size=0;
select @@global.key_buffer_size;
diff --git a/mysql-test/t/mysql-bug45236-master.opt b/mysql-test/t/mysql-bug45236-master.opt
new file mode 100644
index 00000000000..fc1887bca47
--- /dev/null
+++ b/mysql-test/t/mysql-bug45236-master.opt
@@ -0,0 +1 @@
+--loose-skip-safemalloc
diff --git a/mysql-test/t/mysql_locale_posix.test b/mysql-test/t/mysql_locale_posix.test
index 7d306dfc6c4..c047b7b1ae9 100644
--- a/mysql-test/t/mysql_locale_posix.test
+++ b/mysql-test/t/mysql_locale_posix.test
@@ -128,10 +128,10 @@ DROP DATABASE IF EXISTS `ó`;
#
--echo
--echo iso88592
---exec LC_ALL=cs_CZ.iso88592 $MYSQL --character-sets-dir=$CHARSETSDIR --default-character-set=auto test -e "SELECT @@character_set_client"
---exec LC_ALL=cs_CZ.iso88592 $MYSQLADMIN --character-sets-dir=$CHARSETSDIR -uroot -S $MASTER_MYSOCK -P $MASTER_MYPORT --default-character-set=auto create ó
---exec LC_ALL=cs_CZ.iso88592 $MYSQL_SHOW --character-sets-dir=$CHARSETSDIR --default-character-set=auto ó
---exec LC_ALL=cs_CZ.iso88592 $MYSQL_CHECK --character-sets-dir=$CHARSETSDIR--default-character-set=auto "ó"
+--exec LC_ALL=cs_CZ.iso88592 $MYSQL --character-sets-dir=$MYSQL_SHAREDIR/charsets --default-character-set=auto test -e "SELECT @@character_set_client"
+--exec LC_ALL=cs_CZ.iso88592 $MYSQLADMIN --character-sets-dir=$MYSQL_SHAREDIR/charsets -uroot -S $MASTER_MYSOCK -P $MASTER_MYPORT --default-character-set=auto create ó
+--exec LC_ALL=cs_CZ.iso88592 $MYSQL_SHOW --character-sets-dir=$MYSQL_SHAREDIR/charsets --default-character-set=auto ó
+--exec LC_ALL=cs_CZ.iso88592 $MYSQL_CHECK --character-sets-dir=$MYSQL_SHAREDIR/charsets--default-character-set=auto "ó"
# {"iso88597", "greek", my_cs_exact},
@@ -163,10 +163,10 @@ DROP DATABASE IF EXISTS `ó`;
--echo
--echo koi8r
---exec LC_ALL=ru_RU.koi8r $MYSQL --character-sets-dir=$CHARSETSDIR --default-character-set=auto test -e "SELECT @@character_set_client"
---exec LC_ALL=ru_RU.koi8r $MYSQLADMIN --character-sets-dir=$CHARSETSDIR -uroot -S $MASTER_MYSOCK -P $MASTER_MYPORT --default-character-set=auto create ó
---exec LC_ALL=ru_RU.koi8r $MYSQL_SHOW --character-sets-dir=$CHARSETSDIR --default-character-set=auto ó
---exec LC_ALL=ru_RU.koi8r $MYSQL_CHECK --character-sets-dir=$CHARSETSDIR --default-character-set=auto "ó"
+--exec LC_ALL=ru_RU.koi8r $MYSQL --character-sets-dir=$MYSQL_SHAREDIR/charsets --default-character-set=auto test -e "SELECT @@character_set_client"
+--exec LC_ALL=ru_RU.koi8r $MYSQLADMIN --character-sets-dir=$MYSQL_SHAREDIR/charsets -uroot -S $MASTER_MYSOCK -P $MASTER_MYPORT --default-character-set=auto create ó
+--exec LC_ALL=ru_RU.koi8r $MYSQL_SHOW --character-sets-dir=$MYSQL_SHAREDIR/charsets --default-character-set=auto ó
+--exec LC_ALL=ru_RU.koi8r $MYSQL_CHECK --character-sets-dir=$MYSQL_SHAREDIR/charsets --default-character-set=auto "ó"
# {"Shift_JIS", "sjis", my_cs_exact},
diff --git a/mysql-test/t/mysqld--help-notwin.test b/mysql-test/t/mysqld--help-notwin.test
new file mode 100644
index 00000000000..6db5dd830a6
--- /dev/null
+++ b/mysql-test/t/mysqld--help-notwin.test
@@ -0,0 +1,8 @@
+#
+# mysqld --help
+#
+--source include/not_embedded.inc
+--source include/not_windows.inc
+
+--source include/mysqld--help.inc
+
diff --git a/mysql-test/t/mysqld--help-win.test b/mysql-test/t/mysqld--help-win.test
new file mode 100644
index 00000000000..416beb1d34c
--- /dev/null
+++ b/mysql-test/t/mysqld--help-win.test
@@ -0,0 +1,8 @@
+#
+# mysqld --help
+#
+--source include/not_embedded.inc
+--source include/windows.inc
+
+--source include/mysqld--help.inc
+
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index 07ab9cecd28..1b9a3fde8e4 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -168,7 +168,7 @@ drop database mysqldump_test_db;
CREATE TABLE t1 (a CHAR(10));
INSERT INTO t1 VALUES (_latin1 'ÄÖÜß');
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments test t1
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --skip-comments test t1
--echo #
--echo # Bug#8063 make test mysqldump [ fail ]
@@ -178,10 +178,10 @@ INSERT INTO t1 VALUES (_latin1 'ÄÖÜß');
--echo # checking that "mysqldump" is compiled with "latin1"
--echo #
-#--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --compatible=mysql323 test t1
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --compatible=mysql323 --default-character-set=cp850 test t1
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=cp850 --compatible=mysql323 test t1
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=utf8 --compatible=mysql323 test t1
+#--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --skip-comments --compatible=mysql323 test t1
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --skip-comments --compatible=mysql323 --default-character-set=cp850 test t1
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --skip-comments --default-character-set=cp850 --compatible=mysql323 test t1
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --skip-comments --default-character-set=utf8 --compatible=mysql323 test t1
DROP TABLE t1;
--echo #
@@ -1673,14 +1673,14 @@ drop database db42635;
SET NAMES utf8;
CREATE TABLE `straße` ( f1 INT );
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=utf8 --compatible=mysql323 test
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=latin1 --compatible=mysql323 test
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --skip-comments --default-character-set=utf8 --compatible=mysql323 test
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --skip-comments --default-character-set=latin1 --compatible=mysql323 test
DROP TABLE `straße`;
CREATE TABLE `כדשגכחךלדגכחשךדגחכךלדגכ` ( f1 INT );
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=utf8 --compatible=mysql323 test
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --skip-comments --default-character-set=utf8 --compatible=mysql323 test
--error 2
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=latin1 --compatible=mysql323 test
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --skip-comments --default-character-set=latin1 --compatible=mysql323 test
DROP TABLE `כדשגכחךלדגכחשךדגחכךלדגכ`;
SET NAMES latin1;
@@ -1837,7 +1837,7 @@ set names latin1;
--echo
--echo # Dump mysqldump_test_db to bug30027.sql.
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --default-character-set=latin1 --databases mysqldump_test_db > $MYSQLTEST_VARDIR/tmp/bug30027.sql
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --default-character-set=latin1 --databases mysqldump_test_db > $MYSQLTEST_VARDIR/tmp/bug30027.sql
--echo
--echo # Drop mysqldump_test_db.
@@ -1923,7 +1923,7 @@ WHERE table_schema = 'mysqldump_test_db' AND table_name = 'v1';
--echo
--echo ---> Dumping mysqldump_test_db to bug30217.sql
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --databases mysqldump_test_db > $MYSQLTEST_VARDIR/tmp/bug30217.sql
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --databases mysqldump_test_db > $MYSQLTEST_VARDIR/tmp/bug30217.sql
--echo
@@ -2079,7 +2079,7 @@ INSERT INTO t1 VALUES (1, 'ABC-ÐБВ', 'DEF-ÂÃÄ'), (2, NULL, NULL);
--echo # default '--default-charset' (binary):
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --tab=$MYSQLTEST_VARDIR/tmp/ test t1
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --tab=$MYSQLTEST_VARDIR/tmp/ test t1
--echo ##################################################
--cat_file $file
--echo ##################################################
@@ -2092,7 +2092,7 @@ SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
--echo # utf8:
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --default-character-set=utf8 --tab=$MYSQLTEST_VARDIR/tmp/ test t1
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --default-character-set=utf8 --tab=$MYSQLTEST_VARDIR/tmp/ test t1
--echo ##################################################
--cat_file $file
--echo ##################################################
@@ -2105,7 +2105,7 @@ SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
--echo # latin1 (data corruption is expected):
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --default-character-set=latin1 --tab=$MYSQLTEST_VARDIR/tmp/ test t1
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --default-character-set=latin1 --tab=$MYSQLTEST_VARDIR/tmp/ test t1
--echo ##################################################
--cat_file $file
--echo ##################################################
@@ -2118,7 +2118,7 @@ SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
--echo # koi8r (data corruption is expected):
---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --default-character-set=koi8r --tab=$MYSQLTEST_VARDIR/tmp/ test t1
+--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --default-character-set=koi8r --tab=$MYSQLTEST_VARDIR/tmp/ test t1
--echo ##################################################
--cat_file $file
--echo ##################################################
diff --git a/mysql-test/t/partition_key_cache.test b/mysql-test/t/partition_key_cache.test
index f6ea974ba96..4beb9506b05 100644
--- a/mysql-test/t/partition_key_cache.test
+++ b/mysql-test/t/partition_key_cache.test
@@ -9,7 +9,7 @@ DROP TABLE IF EXISTS t1, t2, v, x;
--echo # Verifing that reads/writes use the key cache correctly
SELECT @org_key_cache_buffer_size:= @@global.default.key_buffer_size;
--echo # Minimize default key cache (almost disabled).
-SET @@global.default.key_buffer_size = 1;
+SET @@global.default.key_buffer_size = 4096;
CREATE TABLE t1 (
a INT,
b INT,
diff --git a/mysql-test/t/profiling.test b/mysql-test/t/profiling.test
index afbce04b966..1e1aada7c15 100644
--- a/mysql-test/t/profiling.test
+++ b/mysql-test/t/profiling.test
@@ -9,10 +9,6 @@ show profile all;
show session variables like 'profil%';
select @@profiling;
-# setting global variable is an error
---error ER_LOCAL_VARIABLE
-set global profiling = ON;
-
# But size is okay
set @start_value= @@global.profiling_history_size;
set global profiling_history_size=100;
diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test
index d6e73cbc88d..993f231759b 100644
--- a/mysql-test/t/query_cache.test
+++ b/mysql-test/t/query_cache.test
@@ -940,9 +940,9 @@ set global query_cache_size=0;
create table t1 (a int);
insert into t1 values (1),(2),(3);
set GLOBAL query_cache_type=1;
-set GLOBAL query_cache_limit=10000;
+set GLOBAL query_cache_limit=10240;
set GLOBAL query_cache_min_res_unit=0;
-set GLOBAL query_cache_size= 100000;
+set GLOBAL query_cache_size= 102400;
# default_week_format
reset query cache;
@@ -1010,7 +1010,7 @@ set GLOBAL query_cache_size= default;
# Bug#28897 UUID() returns non-unique values when query cache is enabled
#
-set GLOBAL query_cache_size=1000000;
+set GLOBAL query_cache_size=1024000;
create table t1 (a char);
insert into t1 values ('c');
@@ -1179,7 +1179,7 @@ SET GLOBAL query_cache_size= default;
--echo #
--echo # Bug#25132 disabled query cache: Qcache_free_blocks = 1
--echo #
-set global query_cache_size=100000;
+set global query_cache_size=102400;
set global query_cache_size=0;
set global query_cache_type=0;
show status like 'Qcache_free_blocks';
diff --git a/mysql-test/t/select_safe.test b/mysql-test/t/select_safe.test
index 481779e76d7..cca736d4c1d 100644
--- a/mysql-test/t/select_safe.test
+++ b/mysql-test/t/select_safe.test
@@ -6,7 +6,7 @@
drop table if exists t1;
--enable_warnings
-SET SQL_SAFE_UPDATES=1,SQL_SELECT_LIMIT=4, SQL_MAX_JOIN_SIZE=9;
+SET SQL_SAFE_UPDATES=1,SQL_SELECT_LIMIT=4, MAX_JOIN_SIZE=9;
create table t1 (a int auto_increment primary key, b char(20));
insert into t1 values(1,"test");
SELECT SQL_BUFFER_RESULT * from t1;
@@ -85,6 +85,6 @@ set local max_join_size=1;
select * from (select 1 union select 2 union select 3) x;
drop table t1;
-SET SQL_SAFE_UPDATES=0,SQL_SELECT_LIMIT=DEFAULT, SQL_MAX_JOIN_SIZE=DEFAULT;
+SET SQL_SAFE_UPDATES=0,SQL_SELECT_LIMIT=DEFAULT, MAX_JOIN_SIZE=DEFAULT;
# End of 4.1 tests
diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test
index 9d80650da2f..4f98b8b5128 100644
--- a/mysql-test/t/show_check.test
+++ b/mysql-test/t/show_check.test
@@ -903,7 +903,7 @@ CREATE TABLE t1(ËÏÌÏÎËÁ1 INT);
--echo
--echo ---> Dumping mysqltest1 to outfile1
---exec $MYSQL_DUMP --default-character-set=latin1 --character-sets-dir=$CHARSETSDIR --databases mysqltest1 > $outfile1
+--exec $MYSQL_DUMP --default-character-set=latin1 --character-sets-dir=$MYSQL_SHAREDIR/charsets --databases mysqltest1 > $outfile1
# - Clean mysqltest1;
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index e314e2419be..db4d57649d8 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -3748,7 +3748,7 @@ begin
end|
set @qcs1 = @@query_cache_size|
-set global query_cache_size = 100000|
+set global query_cache_size = 102400|
set @x = 1|
insert into t1 values ("qc", 42)|
select bug9902() from t1|
@@ -8204,14 +8204,13 @@ DROP FUNCTION f1;
drop procedure if exists p;
--enable_warnings
set @old_mode= @@sql_mode;
-set @@sql_mode= pow(2,32)-1;
+set @@sql_mode= cast(pow(2,32)-1 as unsigned integer);
select @@sql_mode into @full_mode;
create procedure p() begin end;
call p();
-select @@sql_mode;
set @@sql_mode= @old_mode;
# Rename SQL modes that differ in name between the server and the table definition.
-select replace(@full_mode, '?', 'NOT_USED') into @full_mode;
+select replace(@full_mode, ',,,', ',NOT_USED,') into @full_mode;
select replace(@full_mode, 'ALLOW_INVALID_DATES', 'INVALID_DATES') into @full_mode;
select name from mysql.proc where name = 'p' and sql_mode = @full_mode;
drop procedure p;
diff --git a/mysql-test/t/user_limits.test b/mysql-test/t/user_limits.test
index 41af032b97e..1bf3f9a3103 100644
--- a/mysql-test/t/user_limits.test
+++ b/mysql-test/t/user_limits.test
@@ -132,7 +132,7 @@ drop user mysqltest_1@localhost;
select @@session.max_user_connections, @@global.max_user_connections;
# Local max_user_connections variable can't be set directly
# since this limit is per-account
---error ER_GLOBAL_VARIABLE
+--error ER_VARIABLE_IS_READONLY
set session max_user_connections= 2;
# But it is ok to set global max_user_connections
set global max_user_connections= 2;
diff --git a/mysql-test/t/user_var.test b/mysql-test/t/user_var.test
index c0740458a88..19c70c76139 100644
--- a/mysql-test/t/user_var.test
+++ b/mysql-test/t/user_var.test
@@ -122,8 +122,6 @@ select coercibility(@v1),coercibility(@v2),coercibility(@v3),coercibility(@v4);
#
--error 1064
set session @honk=99;
---error 1382
-set one_shot @honk=99;
#
# Bug #10724 @@local not preserved in column name of select
diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test
index 2252577926c..d4b88fc6f9c 100644
--- a/mysql-test/t/variables.test
+++ b/mysql-test/t/variables.test
@@ -33,7 +33,7 @@ set @my_query_cache_type =@@global.query_cache_type;
set @my_rpl_recovery_rank =@@global.rpl_recovery_rank;
set @my_server_id =@@global.server_id;
set @my_slow_launch_time =@@global.slow_launch_time;
-set @my_storage_engine =@@global.storage_engine;
+set @my_storage_engine =@@global.default_storage_engine;
set @my_thread_cache_size =@@global.thread_cache_size;
set @my_max_allowed_packet =@@global.max_allowed_packet;
set @my_join_buffer_size =@@global.join_buffer_size;
@@ -132,12 +132,12 @@ set global timed_mutexes=0;
show variables like 'timed_mutexes';
select * from information_schema.session_variables where variable_name like 'timed_mutexes';
-set storage_engine=MYISAM, storage_engine="HEAP", global storage_engine="MERGE";
-show local variables like 'storage_engine';
-select * from information_schema.session_variables where variable_name like 'storage_engine';
-show global variables like 'storage_engine';
-select * from information_schema.global_variables where variable_name like 'storage_engine';
-set GLOBAL query_cache_size=100000;
+set default_storage_engine=MYISAM, default_storage_engine="HEAP", global default_storage_engine="MERGE";
+show local variables like 'default_storage_engine';
+select * from information_schema.session_variables where variable_name like 'default_storage_engine';
+show global variables like 'default_storage_engine';
+select * from information_schema.global_variables where variable_name like 'default_storage_engine';
+set GLOBAL query_cache_size=102400;
set GLOBAL myisam_max_sort_file_size=2000000;
show global variables like 'myisam_max_sort_file_size';
@@ -213,7 +213,6 @@ set @@query_alloc_block_size=1024*17+2;
set @@query_prealloc_size=1024*18-1023;
set @@transaction_alloc_block_size=1024*20-1;
set @@transaction_prealloc_size=1024*21-1;
-select @@query_alloc_block_size;
--echo ==+ Check manipulated values ==+
SHOW VARIABLES WHERE variable_name IN ('range_alloc_block_size',
'query_alloc_block_size', 'query_prealloc_size',
@@ -250,14 +249,12 @@ set unknown_variable=1;
--error ER_WRONG_TYPE_FOR_VAR
set max_join_size="hello";
--error ER_UNKNOWN_STORAGE_ENGINE
-set storage_engine=UNKNOWN_TABLE_TYPE;
+set default_storage_engine=UNKNOWN_TABLE_TYPE;
--error ER_WRONG_VALUE_FOR_VAR
-set storage_engine=MERGE, big_tables=2;
-show local variables like 'storage_engine';
+set default_storage_engine=MERGE, big_tables=2;
+show local variables like 'default_storage_engine';
--error ER_GLOBAL_VARIABLE
set SESSION query_cache_size=10000;
---error ER_NO_DEFAULT
-set GLOBAL storage_engine=DEFAULT;
--error ER_UNKNOWN_CHARACTER_SET
set character_set_client=UNKNOWN_CHARACTER_SET;
--error ER_UNKNOWN_COLLATION
@@ -266,18 +263,12 @@ set collation_connection=UNKNOWN_COLLATION;
set character_set_client=NULL;
--error ER_WRONG_VALUE_FOR_VAR
set collation_connection=NULL;
---error ER_LOCAL_VARIABLE
-set global autocommit=1;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@global.timestamp;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set @@version='';
--error ER_GLOBAL_VARIABLE
set @@concurrent_insert=1;
---error ER_LOCAL_VARIABLE
-set @@global.sql_auto_is_null=1;
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-select @@global.sql_auto_is_null;
--error ER_GLOBAL_VARIABLE
set myisam_max_sort_file_size=100;
--error ER_WRONG_VALUE_FOR_VAR
@@ -357,8 +348,6 @@ set sql_log_bin=1;
set sql_log_off=1;
set sql_log_update=1;
set sql_low_priority_updates=1;
-set sql_max_join_size=200;
-select @@sql_max_join_size,@@max_join_size;
set sql_quote_show_create=1;
set sql_safe_updates=1;
set sql_select_limit=1;
@@ -366,7 +355,7 @@ set sql_select_limit=1;
set sql_select_limit=default;
set sql_warnings=1;
set global table_open_cache=100;
-set storage_engine=myisam;
+set default_storage_engine=myisam;
set global thread_cache_size=100;
set timestamp=1, timestamp=default;
set tmp_table_size=100;
@@ -832,7 +821,7 @@ set global query_cache_type =@my_query_cache_type;
set global rpl_recovery_rank =@my_rpl_recovery_rank;
set global server_id =@my_server_id;
set global slow_launch_time =@my_slow_launch_time;
-set global storage_engine =@my_storage_engine;
+set global default_storage_engine =@my_storage_engine;
set global thread_cache_size =@my_thread_cache_size;
set global max_allowed_packet =@my_max_allowed_packet;
set global join_buffer_size =@my_join_buffer_size;
@@ -1187,7 +1176,7 @@ SET GLOBAL auto_increment_offset=0;
#
--enable_metadata
-select @@storage_engine;
+select @@default_storage_engine;
--disable_metadata
#
diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c
index f5854043459..6b81ff66c7f 100644
--- a/mysys/my_getopt.c
+++ b/mysys/my_getopt.c
@@ -22,30 +22,21 @@
#include <errno.h>
#include <m_string.h>
-typedef void (*init_func_p)(const struct my_option *option, uchar* *variable,
+typedef void (*init_func_p)(const struct my_option *option, uchar **variable,
longlong value);
static void default_reporter(enum loglevel level, const char *format, ...);
my_error_reporter my_getopt_error_reporter= &default_reporter;
-static int findopt(char *optpat, uint length,
- const struct my_option **opt_res,
- char **ffname);
-my_bool getopt_compare_strings(const char *s,
- const char *t,
- uint length);
+static int findopt(char *, uint, const struct my_option **, char **);
+my_bool getopt_compare_strings(const char *, const char *, uint);
static longlong getopt_ll(char *arg, const struct my_option *optp, int *err);
-static ulonglong getopt_ull(char *arg, const struct my_option *optp,
- int *err);
+static ulonglong getopt_ull(char *, const struct my_option *, int *);
static double getopt_double(char *arg, const struct my_option *optp, int *err);
-static void init_variables(const struct my_option *options,
- init_func_p init_one_value);
-static void init_one_value(const struct my_option *option, uchar* *variable,
- longlong value);
-static void fini_one_value(const struct my_option *option, uchar* *variable,
- longlong value);
-static int setval(const struct my_option *opts, uchar* *value, char *argument,
- my_bool set_maximum_value);
+static void init_variables(const struct my_option *, init_func_p);
+static void init_one_value(const struct my_option *, uchar **, longlong);
+static void fini_one_value(const struct my_option *, uchar **, longlong);
+static int setval(const struct my_option *, uchar **, char *, my_bool);
static char *check_struct_option(char *cur_arg, char *key_name);
/*
@@ -60,6 +51,7 @@ enum enum_special_opt
{ OPT_SKIP, OPT_DISABLE, OPT_ENABLE, OPT_MAXIMUM, OPT_LOOSE};
char *disabled_my_option= (char*) "0";
+char *enabled_my_option= (char*) "1";
/*
This is a flag that can be set in client programs. 0 means that
@@ -282,7 +274,7 @@ int handle_options(int *argc, char ***argv,
my_getopt_error_reporter(ERROR_LEVEL,
"%s: ambiguous option '--%s-%s' (--%s-%s)",
my_progname, special_opt_prefix[i],
- cur_arg, special_opt_prefix[i],
+ opt_str, special_opt_prefix[i],
prev_found);
return EXIT_AMBIGUOUS_OPTION;
}
@@ -294,11 +286,11 @@ int handle_options(int *argc, char ***argv,
for example: --skip-option=0 -> option = TRUE
*/
optend= (optend && *optend == '0' && !(*(optend + 1))) ?
- (char*) "1" : disabled_my_option;
+ enabled_my_option : disabled_my_option;
break;
case OPT_ENABLE:
optend= (optend && *optend == '0' && !(*(optend + 1))) ?
- disabled_my_option : (char*) "1";
+ disabled_my_option : enabled_my_option;
break;
case OPT_MAXIMUM:
set_maximum_value= 1;
@@ -386,7 +378,7 @@ int handle_options(int *argc, char ***argv,
}
return EXIT_OPTION_DISABLED;
}
- if (must_be_var && (optp->var_type & GET_TYPE_MASK) == GET_NO_ARG)
+ if (must_be_var && optp->arg_type == NO_ARG)
{
if (my_getopt_print_errors)
my_getopt_error_reporter(ERROR_LEVEL,
@@ -428,33 +420,19 @@ int handle_options(int *argc, char ***argv,
else
{
my_getopt_error_reporter(WARNING_LEVEL,
- "%s: ignoring option '--%s' due to \
-invalid value '%s'",
+ "%s: ignoring option '--%s' "
+ "due to invalid value '%s'",
my_progname, optp->name, optend);
continue;
}
if (get_one_option && get_one_option(optp->id, optp,
- *((my_bool*) value) ?
- (char*) "1" : disabled_my_option))
+ *((my_bool*) value) ?
+ enabled_my_option : disabled_my_option))
return EXIT_ARGUMENT_INVALID;
continue;
}
argument= optend;
}
- else if (optp->arg_type == OPT_ARG &&
- (((optp->var_type & GET_TYPE_MASK) == GET_BOOL) ||
- (optp->var_type & GET_TYPE_MASK) == GET_ENUM))
- {
- if (optend == disabled_my_option)
- init_one_value(optp, value, 0);
- else
- {
- if (!optend) /* No argument -> enable option */
- init_one_value(optp, value, 1);
- else
- argument= optend;
- }
- }
else if (optp->arg_type == REQUIRED_ARG && !optend)
{
/* Check if there are more arguments after this one,
@@ -481,9 +459,9 @@ invalid value '%s'",
for (optend= cur_arg; *optend; optend++)
{
opt_found= 0;
- for (optp= longopts; optp->id; optp++)
+ for (optp= longopts; optp->name; optp++)
{
- if (optp->id == (int) (uchar) *optend)
+ if (optp->id && optp->id == (int) (uchar) *optend)
{
/* Option recognized. Find next what to do with it */
opt_found= 1;
@@ -539,12 +517,7 @@ invalid value '%s'",
}
if ((error= setval(optp, optp->value, argument,
set_maximum_value)))
- {
- my_getopt_error_reporter(ERROR_LEVEL,
- "%s: Error while setting value '%s' to '%s'",
- my_progname, argument, optp->name);
return error;
- }
if (get_one_option && get_one_option(optp->id, optp, argument))
return EXIT_UNSPECIFIED_ERROR;
break;
@@ -563,12 +536,7 @@ invalid value '%s'",
continue;
}
if ((error= setval(optp, value, argument, set_maximum_value)))
- {
- my_getopt_error_reporter(ERROR_LEVEL,
- "%s: Error while setting value '%s' to '%s'",
- my_progname, argument, optp->name);
return error;
- }
if (get_one_option && get_one_option(optp->id, optp, argument))
return EXIT_UNSPECIFIED_ERROR;
@@ -637,79 +605,130 @@ static char *check_struct_option(char *cur_arg, char *key_name)
Will set the option value to given value
*/
-static int setval(const struct my_option *opts, uchar* *value, char *argument,
+static int setval(const struct my_option *opts, uchar **value, char *argument,
my_bool set_maximum_value)
{
- int err= 0;
+ int err= 0, res= 0;
- if (value && argument)
- {
- uchar* *result_pos= ((set_maximum_value) ?
- opts->u_max_value : value);
+ if (!argument)
+ argument= enabled_my_option;
- if (!result_pos)
+ if (value)
+ {
+ if (set_maximum_value && !(value= opts->u_max_value))
+ {
+ my_getopt_error_reporter(ERROR_LEVEL,
+ "%s: Maximum value of '%s' cannot be set",
+ my_progname, opts->name);
return EXIT_NO_PTR_TO_VARIABLE;
+ }
switch ((opts->var_type & GET_TYPE_MASK)) {
case GET_BOOL: /* If argument differs from 0, enable option, else disable */
- *((my_bool*) result_pos)= (my_bool) atoi(argument) != 0;
+ *((my_bool*) value)= (my_bool) atoi(argument) != 0;
break;
case GET_INT:
- *((int*) result_pos)= (int) getopt_ll(argument, opts, &err);
+ *((int*) value)= (int) getopt_ll(argument, opts, &err);
break;
case GET_UINT:
- *((uint*) result_pos)= (uint) getopt_ull(argument, opts, &err);
+ *((uint*) value)= (uint) getopt_ull(argument, opts, &err);
break;
case GET_LONG:
- *((long*) result_pos)= (long) getopt_ll(argument, opts, &err);
+ *((long*) value)= (long) getopt_ll(argument, opts, &err);
break;
case GET_ULONG:
- *((long*) result_pos)= (long) getopt_ull(argument, opts, &err);
+ *((long*) value)= (long) getopt_ull(argument, opts, &err);
break;
case GET_LL:
- *((longlong*) result_pos)= getopt_ll(argument, opts, &err);
+ *((longlong*) value)= getopt_ll(argument, opts, &err);
break;
case GET_ULL:
- *((ulonglong*) result_pos)= getopt_ull(argument, opts, &err);
+ *((ulonglong*) value)= getopt_ull(argument, opts, &err);
break;
case GET_DOUBLE:
- *((double*) result_pos)= getopt_double(argument, opts, &err);
+ *((double*) value)= getopt_double(argument, opts, &err);
break;
case GET_STR:
- *((char**) result_pos)= argument;
+ if (argument == enabled_my_option)
+ break; /* string options don't use this default of "1" */
+ *((char**) value)= argument;
break;
case GET_STR_ALLOC:
- if ((*((char**) result_pos)))
- my_free((*(char**) result_pos), MYF(MY_WME | MY_FAE));
- if (!(*((char**) result_pos)= my_strdup(argument, MYF(MY_WME))))
- return EXIT_OUT_OF_MEMORY;
+ if (argument == enabled_my_option)
+ break; /* string options don't use this default of "1" */
+ if ((*((char**) value)))
+ my_free((*(char**) value), MYF(MY_WME | MY_FAE));
+ if (!(*((char**) value)= my_strdup(argument, MYF(MY_WME))))
+ {
+ res= EXIT_OUT_OF_MEMORY;
+ goto ret;
+ };
break;
case GET_ENUM:
- if (((*(int*)result_pos)=
- find_type(argument, opts->typelib, 2) - 1) < 0)
+ if (((*(uint*)value)=
+ find_type(argument, opts->typelib, 2) - 1) == (uint)-1)
{
- /*
- Accept an integer representation of the enumerated item.
- */
+ /* Accept an integer representation of the enumerated item */
char *endptr;
- unsigned int arg= (unsigned int) strtol(argument, &endptr, 10);
+ uint arg= (uint) strtol(argument, &endptr, 10);
if (*endptr || arg >= opts->typelib->count)
- return EXIT_ARGUMENT_INVALID;
- *(int*)result_pos= arg;
+ {
+ res= EXIT_ARGUMENT_INVALID;
+ goto ret;
+ };
+ *(uint*)value= arg;
}
break;
case GET_SET:
- *((ulonglong*)result_pos)= find_typeset(argument, opts->typelib, &err);
+ *((ulonglong*)value)= find_typeset(argument, opts->typelib, &err);
if (err)
- return EXIT_ARGUMENT_INVALID;
+ {
+ /* Accept an integer representation of the set */
+ char *endptr;
+ ulonglong arg= (ulonglong) strtol(argument, &endptr, 10);
+ if (*endptr || (arg >> 1) >= (1ULL << (opts->typelib->count-1)))
+ {
+ res= EXIT_ARGUMENT_INVALID;
+ goto ret;
+ };
+ *(ulonglong*)value= arg;
+ err= 0;
+ }
+ break;
+ case GET_FLAGSET:
+ {
+ char *error;
+ uint error_len;
+
+ *((ulonglong*)value)=
+ find_set_from_flags(opts->typelib, opts->typelib->count,
+ *(ulonglong *)value, opts->def_value,
+ argument, strlen(argument),
+ &error, &error_len);
+ if (error)
+ {
+ res= EXIT_ARGUMENT_INVALID;
+ goto ret;
+ };
+ }
break;
- default: /* dummy default to avoid compiler warnings */
+ case GET_NO_ARG: /* get_one_option has taken care of the value already */
+ default: /* dummy default to avoid compiler warnings */
break;
}
if (err)
- return EXIT_UNKNOWN_SUFFIX;
+ {
+ res= EXIT_UNKNOWN_SUFFIX;
+ goto ret;
+ };
}
return 0;
+
+ret:
+ my_getopt_error_reporter(ERROR_LEVEL,
+ "%s: Error while setting value '%s' to '%s'",
+ my_progname, argument, opts->name);
+ return res;
}
@@ -887,7 +906,7 @@ longlong getopt_ll_limit_value(longlong num, const struct my_option *optp,
break;
}
- num= ((num - optp->sub_size) / block_size);
+ num= (num / block_size);
num= (longlong) (num * block_size);
if (num < optp->min_value)
@@ -898,7 +917,7 @@ longlong getopt_ll_limit_value(longlong num, const struct my_option *optp,
}
if (fix)
- *fix= adjusted;
+ *fix= old != num;
else if (adjusted)
my_getopt_error_reporter(WARNING_LEVEL,
"option '%s': signed value %s adjusted to %s",
@@ -970,7 +989,7 @@ ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp,
}
if (fix)
- *fix= adjusted;
+ *fix= old != num;
else if (adjusted)
my_getopt_error_reporter(WARNING_LEVEL,
"option '%s': unsigned value %s adjusted to %s",
@@ -979,6 +998,29 @@ ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp,
return num;
}
+double getopt_double_limit_value(double num, const struct my_option *optp,
+ my_bool *fix)
+{
+ my_bool adjusted= FALSE;
+ double old= num;
+ if (optp->max_value && num > (double) optp->max_value)
+ {
+ num= (double) optp->max_value;
+ adjusted= TRUE;
+ }
+ if (num < (double) optp->min_value)
+ {
+ num= (double) optp->min_value;
+ adjusted= TRUE;
+ }
+ if (fix)
+ *fix= adjusted;
+ else if (adjusted)
+ my_getopt_error_reporter(WARNING_LEVEL,
+ "option '%s': value %g adjusted to %g",
+ optp->name, old, num);
+ return num;
+}
/*
Get double value withing ranges
@@ -1000,15 +1042,12 @@ static double getopt_double(char *arg, const struct my_option *optp, int *err)
num= my_strtod(arg, &end, &error);
if (end[0] != 0 || error)
{
- fprintf(stderr,
- "%s: ERROR: Invalid decimal value for option '%s'\n",
- my_progname, optp->name);
+ my_getopt_error_reporter(ERROR_LEVEL,
+ "Invalid decimal value for option '%s'\n", optp->name);
*err= EXIT_ARGUMENT_INVALID;
return 0.0;
}
- if (optp->max_value && num > (double) optp->max_value)
- num= (double) optp->max_value;
- return max(num, (double) optp->min_value);
+ return getopt_double_limit_value(num, optp, NULL);
}
/*
@@ -1050,6 +1089,7 @@ static void init_one_value(const struct my_option *option, uchar* *variable,
*((ulonglong*) variable)= (ulonglong) getopt_ull_limit_value((ulonglong) value, option, NULL);
break;
case GET_SET:
+ case GET_FLAGSET:
*((ulonglong*) variable)= (ulonglong) value;
break;
case GET_DOUBLE:
@@ -1125,7 +1165,7 @@ void my_cleanup_options(const struct my_option *options)
NOTES
We will initialize the value that is pointed to by options->value.
- If the value is of type GET_ASK_ADDR, we will also ask for the address
+ If the value is of type GET_ASK_ADDR, we will ask for the address
for a value and initialize.
*/
@@ -1135,7 +1175,7 @@ static void init_variables(const struct my_option *options,
DBUG_ENTER("init_variables");
for (; options->name; options++)
{
- uchar* *variable;
+ uchar **value;
DBUG_PRINT("options", ("name: '%s'", options->name));
/*
We must set u_max_value first as for some variables
@@ -1144,15 +1184,22 @@ static void init_variables(const struct my_option *options,
*/
if (options->u_max_value)
init_one_value(options, options->u_max_value, options->max_value);
- if (options->value)
- init_one_value(options, options->value, options->def_value);
- if (options->var_type & GET_ASK_ADDR &&
- (variable= (*getopt_get_addr)("", 0, options, 0)))
- init_one_value(options, variable, options->def_value);
+ value= (options->var_type & GET_ASK_ADDR ?
+ (*getopt_get_addr)("", 0, options, 0) : options->value);
+ if (value)
+ init_one_value(options, value, options->def_value);
}
DBUG_VOID_RETURN;
}
+/** Prints variable or option name, replacing _ with - */
+static uint print_name(const struct my_option *optp)
+{
+ const char *s= optp->name;
+ for (;*s;s++)
+ putchar(*s == '_' ? '-' : *s);
+ return s - optp->name;
+}
/*
function: my_print_options
@@ -1168,9 +1215,9 @@ void my_print_help(const struct my_option *options)
const char *line_end;
const struct my_option *optp;
- for (optp= options; optp->id; optp++)
+ for (optp= options; optp->name; optp++)
{
- if (optp->id < 256)
+ if (optp->id && optp->id < 256)
{
printf(" -%c%s", optp->id, strlen(optp->name) ? ", " : " ");
col= 6;
@@ -1182,21 +1229,24 @@ void my_print_help(const struct my_option *options)
}
if (strlen(optp->name))
{
- printf("--%s", optp->name);
- col+= 2 + (uint) strlen(optp->name);
- if ((optp->var_type & GET_TYPE_MASK) == GET_STR ||
- (optp->var_type & GET_TYPE_MASK) == GET_STR_ALLOC)
+ printf("--");
+ col+= 2 + print_name(optp);
+ if (optp->arg_type == NO_ARG ||
+ (optp->var_type & GET_TYPE_MASK) == GET_BOOL)
+ {
+ putchar(' ');
+ col++;
+ }
+ else if ((optp->var_type & GET_TYPE_MASK) == GET_STR ||
+ (optp->var_type & GET_TYPE_MASK) == GET_STR_ALLOC ||
+ (optp->var_type & GET_TYPE_MASK) == GET_ENUM ||
+ (optp->var_type & GET_TYPE_MASK) == GET_SET ||
+ (optp->var_type & GET_TYPE_MASK) == GET_FLAGSET )
{
printf("%s=name%s ", optp->arg_type == OPT_ARG ? "[" : "",
optp->arg_type == OPT_ARG ? "]" : "");
col+= (optp->arg_type == OPT_ARG) ? 8 : 6;
}
- else if ((optp->var_type & GET_TYPE_MASK) == GET_NO_ARG ||
- (optp->var_type & GET_TYPE_MASK) == GET_BOOL)
- {
- putchar(' ');
- col++;
- }
else
{
printf("%s=#%s ", optp->arg_type == OPT_ARG ? "[" : "",
@@ -1228,12 +1278,13 @@ void my_print_help(const struct my_option *options)
printf("%s", comment);
}
putchar('\n');
- if ((optp->var_type & GET_TYPE_MASK) == GET_NO_ARG ||
- (optp->var_type & GET_TYPE_MASK) == GET_BOOL)
+ if ((optp->var_type & GET_TYPE_MASK) == GET_BOOL)
{
if (optp->def_value != 0)
{
- printf("%*s(Defaults to on; use --skip-%s to disable.)\n", name_space, "", optp->name);
+ printf("%*s(Defaults to on; use --skip-", name_space, "");
+ print_name(optp);
+ printf(" to disable.)\n");
}
}
}
@@ -1249,36 +1300,53 @@ void my_print_help(const struct my_option *options)
void my_print_variables(const struct my_option *options)
{
uint name_space= 34, length, nr;
- ulonglong bit, llvalue;
+ ulonglong llvalue;
char buff[255];
const struct my_option *optp;
+ for (optp= options; optp->name; optp++)
+ {
+ length= strlen(optp->name)+1;
+ if (length > name_space)
+ name_space= length;
+ }
+
printf("\nVariables (--variable-name=value)\n");
- printf("and boolean options {FALSE|TRUE} Value (after reading options)\n");
- printf("--------------------------------- -----------------------------\n");
- for (optp= options; optp->id; optp++)
+ printf("%-*s%s", name_space, "and boolean options {FALSE|TRUE}",
+ "Value (after reading options)\n");
+ for (length=1; length < 75; length++)
+ putchar(length == name_space ? ' ' : '-');
+ putchar('\n');
+
+ for (optp= options; optp->name; optp++)
{
- uchar* *value= (optp->var_type & GET_ASK_ADDR ?
+ uchar **value= (optp->var_type & GET_ASK_ADDR ?
(*getopt_get_addr)("", 0, optp, 0) : optp->value);
if (value)
{
- printf("%s ", optp->name);
- length= (uint) strlen(optp->name)+1;
+ length= print_name(optp);
for (; length < name_space; length++)
putchar(' ');
switch ((optp->var_type & GET_TYPE_MASK)) {
case GET_SET:
if (!(llvalue= *(ulonglong*) value))
- printf("%s\n", "(No default value)");
+ printf("%s\n", "");
else
- for (nr= 0, bit= 1; llvalue && nr < optp->typelib->count; nr++, bit<<=1)
+ for (nr= 0; llvalue && nr < optp->typelib->count; nr++, llvalue >>=1)
{
- if (!(bit & llvalue))
- continue;
- llvalue&= ~bit;
- printf( llvalue ? "%s," : "%s\n", get_type(optp->typelib, nr));
+ if (llvalue & 1)
+ printf( llvalue > 1 ? "%s," : "%s\n", get_type(optp->typelib, nr));
}
break;
+ case GET_FLAGSET:
+ llvalue= *(ulonglong*) value;
+ for (nr= 0; llvalue && nr < optp->typelib->count; nr++, llvalue >>=1)
+ {
+ printf("%s%s=", (nr ? "," : ""), get_type(optp->typelib, nr));
+ printf(llvalue & 1 ? "on" : "off");
+ }
+ printf("\n");
+ break;
case GET_ENUM:
printf("%s\n", get_type(optp->typelib, *(uint*) value));
break;
@@ -1312,6 +1380,9 @@ void my_print_variables(const struct my_option *options)
case GET_DOUBLE:
printf("%g\n", *(double*) value);
break;
+ case GET_NO_ARG:
+ printf("(No default value)\n");
+ break;
default:
printf("(Disabled)\n");
break;
diff --git a/mysys/safemalloc.c b/mysys/safemalloc.c
index 675fa62380a..efe281ba1bb 100644
--- a/mysys/safemalloc.c
+++ b/mysys/safemalloc.c
@@ -158,7 +158,7 @@ void *_mymalloc(size_t size, const char *filename, uint lineno, myf MyFlags)
my_message(EE_OUTOFMEMORY, buff, MYF(ME_BELL+ME_WAITTANG+ME_NOREFRESH));
}
DBUG_PRINT("error",("Out of memory, in use: %ld at line %d, '%s'",
- sf_malloc_max_memory,lineno, filename));
+ (long)sf_malloc_max_memory,lineno, filename));
if (MyFlags & MY_FAE)
exit(1);
DBUG_RETURN ((void*) 0);
diff --git a/mysys/typelib.c b/mysys/typelib.c
index cb72c91e20d..73dab610bed 100644
--- a/mysys/typelib.c
+++ b/mysys/typelib.c
@@ -20,7 +20,7 @@
#include <m_ctype.h>
-static const char field_separator=',';
+#define is_field_separator(X) ((X) == ',' || (X) == '=')
int find_type_or_exit(const char *x, TYPELIB *typelib, const char *option)
{
@@ -44,26 +44,26 @@ int find_type_or_exit(const char *x, TYPELIB *typelib, const char *option)
}
-/*
+/**
Search after a string in a list of strings. Endspace in x is not compared.
- SYNOPSIS
- find_type()
- x String to find
- lib TYPELIB (struct of pointer to values + count)
- full_name bitmap of what to do
- If & 1 accept only whole names
- If & 2 don't expand if half field
- If & 4 allow #number# as type
- If & 8 use ',' as string terminator
-
- NOTES
- If part, uniq field is found and full_name == 0 then x is expanded
- to full field.
-
- RETURN
- -1 Too many matching values
- 0 No matching value
+ @param x String to find
+ @param lib TYPELIB (struct of pointer to values + count)
+ @param full_name bitmap of what to do
+ If & 1 accept only whole names
+ If & 2 don't expand if half field
+ If & 4 allow #number# as type
+ If & 8 use ',' as string terminator
+
+ @note
+ If part, uniq field is found and full_name == 0 then x is expanded
+ to full field.
+
+ @retval
+ -1 Too many matching values
+ @retval
+ 0 No matching value
+ @retval
>0 Offset+1 in typelib for matched string
*/
@@ -86,17 +86,17 @@ int find_type(char *x, const TYPELIB *typelib, uint full_name)
for (pos=0 ; (j=typelib->type_names[pos]) ; pos++)
{
for (i=x ;
- *i && (!(full_name & 8) || *i != field_separator) &&
+ *i && (!(full_name & 8) || !is_field_separator(*i)) &&
my_toupper(&my_charset_latin1,*i) ==
my_toupper(&my_charset_latin1,*j) ; i++, j++) ;
if (! *j)
{
while (*i == ' ')
i++; /* skip_end_space */
- if (! *i || ((full_name & 8) && *i == field_separator))
+ if (! *i || ((full_name & 8) && is_field_separator(*i)))
DBUG_RETURN(pos+1);
}
- if ((!*i && (!(full_name & 8) || *i != field_separator)) &&
+ if ((!*i && (!(full_name & 8) || !is_field_separator(*i))) &&
(!*j || !(full_name & 1)))
{
find++;
@@ -122,8 +122,12 @@ int find_type(char *x, const TYPELIB *typelib, uint full_name)
} /* find_type */
- /* Get name of type nr 'nr' */
- /* Warning first type is 1, 0 = empty field */
+/**
+ Get name of type nr
+
+ @note
+ first type is 1, 0 = empty field
+*/
void make_type(register char * to, register uint nr,
register TYPELIB *typelib)
@@ -137,8 +141,12 @@ void make_type(register char * to, register uint nr,
} /* make_type */
- /* Get type */
- /* Warning first type is 0 */
+/**
+ Get type
+
+ @note
+ first type is 0
+*/
const char *get_type(TYPELIB *typelib, uint nr)
{
@@ -148,18 +156,16 @@ const char *get_type(TYPELIB *typelib, uint nr)
}
-/*
+/**
Create an integer value to represent the supplied comma-seperated
string where each string in the TYPELIB denotes a bit position.
- SYNOPSIS
- find_typeset()
- x string to decompose
- lib TYPELIB (struct of pointer to values + count)
- err index (not char position) of string element which was not
+ @param x string to decompose
+ @param lib TYPELIB (struct of pointer to values + count)
+ @param err index (not char position) of string element which was not
found or 0 if there was no error
- RETURN
+ @retval
a integer representation of the supplied string
*/
@@ -182,9 +188,9 @@ my_ulonglong find_typeset(char *x, TYPELIB *lib, int *err)
{
(*err)++;
i= x;
- while (*x && *x != field_separator)
+ while (*x && !is_field_separator(*x))
x++;
- if (x[0] && x[1]) /* skip separator if found */
+ if (x[0] && x[1]) /* skip separator if found */
x++;
if ((find= find_type(i, lib, 2 | 8) - 1) < 0)
DBUG_RETURN(0);
@@ -195,16 +201,15 @@ my_ulonglong find_typeset(char *x, TYPELIB *lib, int *err)
} /* find_set */
-/*
+/**
Create a copy of a specified TYPELIB structure.
- SYNOPSIS
- copy_typelib()
- root pointer to a MEM_ROOT object for allocations
- from pointer to a source TYPELIB structure
+ @param root pointer to a MEM_ROOT object for allocations
+ @param from pointer to a source TYPELIB structure
- RETURN
- pointer to the new TYPELIB structure on successful copy, or
+ @retval
+ pointer to the new TYPELIB structure on successful copy
+ @retval
NULL otherwise
*/
@@ -244,3 +249,140 @@ TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from)
return to;
}
+
+
+static const char *on_off_default_names[]= { "off","on","default", 0};
+static TYPELIB on_off_default_typelib= {array_elements(on_off_default_names)-1,
+ "", on_off_default_names, 0};
+
+/**
+ Parse a TYPELIB name from the buffer
+
+ @param lib Set of names to scan for.
+ @param strpos INOUT Start of the buffer (updated to point to the next
+ character after the name)
+ @param end End of the buffer
+
+ @note
+ The buffer is assumed to contain one of the names specified in the TYPELIB,
+ followed by comma, '=', or end of the buffer.
+
+ @retval
+ 0 No matching name
+ @retval
+ >0 Offset+1 in typelib for matched name
+*/
+
+static uint parse_name(const TYPELIB *lib, const char **strpos, const char *end)
+{
+ const char *pos= *strpos;
+ uint find= find_type((char*)pos, lib, 8);
+ for (; pos != end && *pos != '=' && *pos !=',' ; pos++);
+ *strpos= pos;
+ return find;
+}
+
+/**
+ Parse and apply a set of flag assingments
+
+ @param lib Flag names
+ @param default_name Number of "default" in the typelib
+ @param cur_set Current set of flags (start from this state)
+ @param default_set Default set of flags (use this for assign-default
+ keyword and flag=default assignments)
+ @param str String to be parsed
+ @param length Length of the string
+ @param err_pos OUT If error, set to point to start of wrong set string
+ NULL on success
+ @param err_len OUT If error, set to the length of wrong set string
+
+ @details
+ Parse a set of flag assignments, that is, parse a string in form:
+
+ param_name1=value1,param_name2=value2,...
+
+ where the names are specified in the TYPELIB, and each value can be
+ either 'on','off', or 'default'. Setting the same name twice is not
+ allowed.
+
+ Besides param=val assignments, we support the "default" keyword (keyword
+ #default_name in the typelib). It can be used one time, if specified it
+ causes us to build the new set over the default_set rather than cur_set
+ value.
+
+ @note
+ it's not charset aware
+
+ @retval
+ Parsed set value if (*errpos == NULL), otherwise undefined
+*/
+
+my_ulonglong find_set_from_flags(const TYPELIB *lib, uint default_name,
+ my_ulonglong cur_set, my_ulonglong default_set,
+ const char *str, uint length,
+ char **err_pos, uint *err_len)
+{
+ const char *end= str + length;
+ my_ulonglong flags_to_set= 0, flags_to_clear= 0, res;
+ my_bool set_defaults= 0;
+
+ *err_pos= 0; // No error yet
+ if (str != end)
+ {
+ const char *start= str;
+ for (;;)
+ {
+ const char *pos= start;
+ uint flag_no, value;
+
+ if (!(flag_no= parse_name(lib, &pos, end)))
+ goto err;
+
+ if (flag_no == default_name)
+ {
+ /* Using 'default' twice isn't allowed. */
+ if (set_defaults)
+ goto err;
+ set_defaults= TRUE;
+ }
+ else
+ {
+ my_ulonglong bit= (1ULL << (flag_no - 1));
+ /* parse the '=on|off|default' */
+ if ((flags_to_clear | flags_to_set) & bit ||
+ pos >= end || *pos++ != '=' ||
+ !(value= parse_name(&on_off_default_typelib, &pos, end)))
+ goto err;
+
+ if (value == 1) // this is '=off'
+ flags_to_clear|= bit;
+ else if (value == 2) // this is '=on'
+ flags_to_set|= bit;
+ else // this is '=default'
+ {
+ if (default_set & bit)
+ flags_to_set|= bit;
+ else
+ flags_to_clear|= bit;
+ }
+ }
+ if (pos >= end)
+ break;
+
+ if (*pos++ != ',')
+ goto err;
+
+ start=pos;
+ continue;
+ err:
+ *err_pos= (char*)start;
+ *err_len= end - start;
+ break;
+ }
+ }
+ res= set_defaults? default_set : cur_set;
+ res|= flags_to_set;
+ res&= ~flags_to_clear;
+ return res;
+}
+
diff --git a/sql-common/my_time.c b/sql-common/my_time.c
index 95078a50097..0a09e945022 100644
--- a/sql-common/my_time.c
+++ b/sql-common/my_time.c
@@ -76,7 +76,7 @@ uint calc_days_in_year(uint year)
*/
my_bool check_date(const MYSQL_TIME *ltime, my_bool not_zero_date,
- ulong flags, int *was_cut)
+ ulonglong flags, int *was_cut)
{
if (not_zero_date)
{
@@ -158,7 +158,7 @@ my_bool check_date(const MYSQL_TIME *ltime, my_bool not_zero_date,
enum enum_mysql_timestamp_type
str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time,
- uint flags, int *was_cut)
+ ulonglong flags, int *was_cut)
{
uint field_length, UNINIT_VAR(year_length), digits, i, number_of_fields;
uint date[MAX_DATE_PARTS], date_len[MAX_DATE_PARTS];
@@ -1109,7 +1109,7 @@ int my_TIME_to_str(const MYSQL_TIME *l_time, char *to)
*/
longlong number_to_datetime(longlong nr, MYSQL_TIME *time_res,
- uint flags, int *was_cut)
+ ulonglong flags, int *was_cut)
{
long part1,part2;
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index 15c2d950ff9..82a94b64365 100755..100644
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -53,7 +53,7 @@ SET (SQL_SOURCE
log_event.cc rpl_record.cc rpl_reporting.cc
log_event_old.cc rpl_record_old.cc
message.h mf_iocache.cc my_decimal.cc ../sql-common/my_time.c
- mysqld.cc net_serv.cc
+ mysqld.cc net_serv.cc keycaches.cc
nt_servc.cc nt_servc.h opt_range.cc opt_range.h opt_sum.cc
../sql-common/pack.c parse_file.cc password.c procedure.cc
protocol.cc records.cc repl_failsafe.cc rpl_filter.cc set_var.cc
@@ -76,7 +76,7 @@ SET (SQL_SOURCE
rpl_rli.cc rpl_mi.cc sql_servers.cc
sql_connect.cc scheduler.cc
sql_profile.cc event_parse_data.cc
- sql_signal.cc rpl_handler.cc
+ sql_signal.cc rpl_handler.cc sys_vars.cc
${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
${PROJECT_SOURCE_DIR}/sql/sql_yacc.h
${PROJECT_SOURCE_DIR}/include/mysqld_error.h
diff --git a/sql/Makefile.am b/sql/Makefile.am
index 15ee0d588c4..5f8bc8ef112 100644
--- a/sql/Makefile.am
+++ b/sql/Makefile.am
@@ -101,9 +101,9 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \
sql_repl.h slave.h rpl_filter.h rpl_injector.h \
log_event.h rpl_record.h \
log_event_old.h rpl_record_old.h \
- sql_sort.h sql_cache.h set_var.h \
+ sql_sort.h sql_cache.h set_var.h sys_vars_shared.h \
spatial.h gstream.h client_settings.h tzfile.h \
- tztime.h my_decimal.h\
+ tztime.h my_decimal.h keycaches.h \
sp_head.h sp_pcontext.h sp_rcontext.h sp.h sp_cache.h \
parse_file.h sql_view.h sql_trigger.h \
sql_array.h sql_cursor.h events.h scheduler.h \
@@ -112,7 +112,7 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \
event_data_objects.h event_scheduler.h \
sql_partition.h partition_info.h partition_element.h \
contributors.h sql_servers.h sql_signal.h records.h \
- sql_prepare.h rpl_handler.h replication.h
+ sql_prepare.h rpl_handler.h replication.h sys_vars.h
mysqld_SOURCES = sql_lex.cc sql_handler.cc sql_partition.cc \
item.cc item_sum.cc item_buff.cc item_func.cc \
@@ -125,7 +125,7 @@ mysqld_SOURCES = sql_lex.cc sql_handler.cc sql_partition.cc \
sql_string.cc sql_manager.cc sql_map.cc \
mysqld.cc password.c hash_filo.cc hostname.cc \
sql_connect.cc scheduler.cc sql_parse.cc \
- set_var.cc sql_yacc.yy \
+ keycaches.cc set_var.cc sql_yacc.yy sys_vars.cc \
sql_base.cc table.cc sql_select.cc sql_insert.cc \
sql_profile.cc \
sql_prepare.cc sql_error.cc sql_locale.cc \
diff --git a/sql/debug_sync.cc b/sql/debug_sync.cc
index 3c8e24f6901..517aab93707 100644
--- a/sql/debug_sync.cc
+++ b/sql/debug_sync.cc
@@ -1561,56 +1561,6 @@ static bool debug_sync_eval_action(THD *thd, char *action_str)
DBUG_RETURN(FALSE);
}
-
-/**
- Check if the system variable 'debug_sync' can be set.
-
- @param[in] thd thread handle
- @param[in] var set variable request
-
- @return status
- @retval FALSE ok, variable can be set
- @retval TRUE error, variable cannot be set
-*/
-
-bool sys_var_debug_sync::check(THD *thd, set_var *var)
-{
- DBUG_ENTER("sys_var_debug_sync::check");
- DBUG_ASSERT(thd);
- DBUG_ASSERT(var);
-
- /*
- Variable can be set for the session only.
-
- This could be changed later. Then we need to have a global array of
- actions in addition to the thread local ones. SET GLOBAL would
- manage the global array, SET [SESSION] the local array. A sync point
- would need to look for a local and a global action. Setting and
- executing of global actions need to be protected by a mutex.
-
- The purpose of global actions could be to allow synchronizing with
- connectionless threads that cannot execute SET statements.
- */
- if (var->type == OPT_GLOBAL)
- {
- my_error(ER_LOCAL_VARIABLE, MYF(0), name);
- DBUG_RETURN(TRUE);
- }
-
- /*
- Do not check for disabled facility. Test result should not
- unnecessarily differ from enabled facility.
- */
-
- /*
- Facility requires SUPER privilege. Sync points could be inside
- global mutexes (e.g. LOCK_open). Waiting there forever would
- stall the whole server.
- */
- DBUG_RETURN(check_global_access(thd, SUPER_ACL));
-}
-
-
/**
Set the system variable 'debug_sync'.
@@ -1631,28 +1581,9 @@ bool sys_var_debug_sync::check(THD *thd, set_var *var)
terminators in the string. So we need to take a copy here.
*/
-bool sys_var_debug_sync::update(THD *thd, set_var *var)
+bool debug_sync_update(THD *thd, char *val_str)
{
- char *val_str;
- String *val_ptr;
- String val_buf;
- DBUG_ENTER("sys_var_debug_sync::update");
- DBUG_ASSERT(thd);
-
- /*
- Depending on the value type (string literal, user variable, ...)
- val_buf receives a copy of the value or not. But we always need
- a copy. So we take a copy, if it is not done by val_str().
- If val_str() puts a copy into val_buf, then it returns &val_buf,
- otherwise it returns a pointer to the string object that we need
- to copy.
- */
- val_ptr= var ? var->value->val_str(&val_buf) : &val_buf;
- if (val_ptr != &val_buf)
- {
- val_buf.copy(*val_ptr);
- }
- val_str= val_buf.c_ptr();
+ DBUG_ENTER("debug_sync_update");
DBUG_PRINT("debug_sync", ("set action: '%s'", val_str));
/*
@@ -1669,8 +1600,6 @@ bool sys_var_debug_sync::update(THD *thd, set_var *var)
Retrieve the value of the system variable 'debug_sync'.
@param[in] thd thread handle
- @param[in] type variable type, unused
- @param[in] base variable base, unused
@return string
@retval != NULL ok, string pointer
@@ -1683,13 +1612,10 @@ bool sys_var_debug_sync::update(THD *thd, set_var *var)
When "ON", the current signal is added.
*/
-uchar *sys_var_debug_sync::value_ptr(THD *thd,
- enum_var_type type __attribute__((unused)),
- LEX_STRING *base __attribute__((unused)))
+uchar *debug_sync_value_ptr(THD *thd)
{
char *value;
- DBUG_ENTER("sys_var_debug_sync::value_ptr");
- DBUG_ASSERT(thd);
+ DBUG_ENTER("debug_sync_value_ptr");
if (opt_debug_sync_timeout)
{
@@ -1718,7 +1644,7 @@ uchar *sys_var_debug_sync::value_ptr(THD *thd,
else
{
/* purecov: begin tested */
- value= strmake_root(thd->mem_root, STRING_WITH_LEN("OFF"));
+ value= const_cast<char*>("OFF");
/* purecov: end */
}
diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc
index 31bb3d39b85..00d03e04b70 100644
--- a/sql/event_scheduler.cc
+++ b/sql/event_scheduler.cc
@@ -188,7 +188,7 @@ pre_init_event_thread(THD* thd)
thd->security_ctx->set_user((char*)"event_scheduler");
thd->net.read_timeout= slave_net_timeout;
thd->slave_thread= 0;
- thd->options|= OPTION_AUTO_IS_NULL;
+ thd->variables.option_bits|= OPTION_AUTO_IS_NULL;
thd->client_capabilities|= CLIENT_MULTI_RESULTS;
pthread_mutex_lock(&LOCK_thread_count);
thd->thread_id= thd->variables.pseudo_thread_id= thread_id++;
diff --git a/sql/events.cc b/sql/events.cc
index f5f837930c0..b0803ab57d0 100644
--- a/sql/events.cc
+++ b/sql/events.cc
@@ -20,6 +20,7 @@
#include "event_queue.h"
#include "event_scheduler.h"
#include "sp_head.h" // for Stored_program_creation_ctx
+#include "set_var.h"
/**
@addtogroup Event_Scheduler
@@ -63,43 +64,10 @@
eligible for execution.
*/
-/*
- Keep the order of the first to as in var_typelib
- sys_var_event_scheduler::value_ptr() references this array. Keep in
- mind!
-*/
-static const char *opt_event_scheduler_state_names[]=
- { "OFF", "ON", "0", "1", "DISABLED", NullS };
-
-const TYPELIB Events::opt_typelib=
-{
- array_elements(opt_event_scheduler_state_names)-1,
- "",
- opt_event_scheduler_state_names,
- NULL
-};
-
-
-/*
- The order should not be changed. We consider OFF to be equivalent of INT 0
- And ON of 1. If OFF & ON are interchanged the logic in
- sys_var_event_scheduler::update() will be broken!
-*/
-static const char *var_event_scheduler_state_names[]= { "OFF", "ON", NullS };
-
-const TYPELIB Events::var_typelib=
-{
- array_elements(var_event_scheduler_state_names)-1,
- "",
- var_event_scheduler_state_names,
- NULL
-};
-
Event_queue *Events::event_queue;
Event_scheduler *Events::scheduler;
Event_db_repository *Events::db_repository;
-enum Events::enum_opt_event_scheduler
-Events::opt_event_scheduler= Events::EVENTS_OFF;
+uint Events::opt_event_scheduler= Events::EVENTS_OFF;
pthread_mutex_t Events::LOCK_event_metadata;
bool Events::check_system_tables_error= FALSE;
@@ -127,69 +95,6 @@ int sortcmp_lex_string(LEX_STRING s, LEX_STRING t, CHARSET_INFO *cs)
/**
- @brief Initialize the start up option of the Events scheduler.
-
- Do not initialize the scheduler subsystem yet - the initialization
- is split into steps as it has to fit into the common MySQL
- initialization framework.
- No locking as this is called only at start up.
-
- @param[in,out] argument The value of the argument. If this value
- is found in the typelib, the argument is
- updated.
-
- @retval TRUE unknown option value
- @retval FALSE success
-*/
-
-bool
-Events::set_opt_event_scheduler(char *argument)
-{
- if (argument == NULL)
- opt_event_scheduler= Events::EVENTS_ON;
- else
- {
- int type;
- /*
- type= 1 2 3 4 5
- (OFF | ON) - (0 | 1) (DISABLE )
- */
- const static enum enum_opt_event_scheduler type2state[]=
- { EVENTS_OFF, EVENTS_ON, EVENTS_OFF, EVENTS_ON, EVENTS_DISABLED };
-
- type= find_type(argument, &opt_typelib, 1);
-
- DBUG_ASSERT(type >= 0 && type <= 5); /* guaranteed by find_type */
-
- if (type == 0)
- {
- fprintf(stderr, "Unknown option to event-scheduler: %s\n", argument);
- return TRUE;
- }
- opt_event_scheduler= type2state[type-1];
- }
- return FALSE;
-}
-
-
-/**
- Return a string representation of the current scheduler mode.
-*/
-
-const char *
-Events::get_opt_event_scheduler_str()
-{
- const char *str;
-
- pthread_mutex_lock(&LOCK_event_metadata);
- str= opt_typelib.type_names[(int) opt_event_scheduler];
- pthread_mutex_unlock(&LOCK_event_metadata);
-
- return str;
-}
-
-
-/**
Push an error into the error stack if the system tables are
not up to date.
*/
@@ -734,8 +639,7 @@ send_show_create_event(THD *thd, Event_timed *et, Protocol *protocol)
field_list.push_back(new Item_empty_string("Event", NAME_CHAR_LEN));
- if (sys_var_thd_sql_mode::symbolic_mode_representation(thd, et->sql_mode,
- &sql_mode))
+ if (sql_mode_string_representation(thd, et->sql_mode, &sql_mode))
DBUG_RETURN(TRUE);
field_list.push_back(new Item_empty_string("sql_mode", (uint) sql_mode.length));
@@ -1091,60 +995,15 @@ Events::dump_internal_status()
DBUG_VOID_RETURN;
}
-
-/**
- Starts or stops the event scheduler thread.
-
- @retval FALSE success
- @retval TRUE error
-*/
-
-bool
-Events::switch_event_scheduler_state(enum_opt_event_scheduler new_state)
+bool Events::start()
{
- bool ret= FALSE;
-
- DBUG_ENTER("Events::switch_event_scheduler_state");
-
- DBUG_ASSERT(new_state == Events::EVENTS_ON ||
- new_state == Events::EVENTS_OFF);
-
- /*
- If the scheduler was disabled because there are no/bad
- system tables, produce a more meaningful error message
- than ER_OPTION_PREVENTS_STATEMENT
- */
- if (check_if_system_tables_error())
- DBUG_RETURN(TRUE);
-
- pthread_mutex_lock(&LOCK_event_metadata);
-
- if (opt_event_scheduler == EVENTS_DISABLED)
- {
- my_error(ER_OPTION_PREVENTS_STATEMENT,
- MYF(0), "--event-scheduler=DISABLED or --skip-grant-tables");
- ret= TRUE;
- goto end;
- }
-
- if (new_state == EVENTS_ON)
- ret= scheduler->start();
- else
- ret= scheduler->stop();
-
- if (ret)
- {
- my_error(ER_EVENT_SET_VAR_ERROR, MYF(0));
- goto end;
- }
-
- opt_event_scheduler= new_state;
-
-end:
- pthread_mutex_unlock(&LOCK_event_metadata);
- DBUG_RETURN(ret);
+ return scheduler->start();
}
+bool Events::stop()
+{
+ return scheduler->stop();
+}
/**
Loads all ENABLED events from mysql.event into a prioritized
diff --git a/sql/events.h b/sql/events.h
index 2bc87517748..8f68d5a8029 100644
--- a/sql/events.h
+++ b/sql/events.h
@@ -56,7 +56,7 @@ sortcmp_lex_string(LEX_STRING s, LEX_STRING t, CHARSET_INFO *cs);
The life cycle of the Events module is the following:
At server start up:
- set_opt_event_scheduler() -> init_mutexes() -> init()
+ init_mutexes() -> init()
When the server is running:
create_event(), drop_event(), start_or_stop_event_scheduler(), etc
At shutdown:
@@ -70,23 +70,19 @@ sortcmp_lex_string(LEX_STRING s, LEX_STRING t, CHARSET_INFO *cs);
class Events
{
public:
- /* The order should match the order in opt_typelib */
- enum enum_opt_event_scheduler
- {
- EVENTS_OFF= 0,
- EVENTS_ON= 1,
- EVENTS_DISABLED= 4
- };
-
- /* Possible values of @@event_scheduler variable */
- static const TYPELIB var_typelib;
-
- static bool
- set_opt_event_scheduler(char *argument);
-
- static const char *
- get_opt_event_scheduler_str();
+ /*
+ the following block is to support --event-scheduler command line option
+ and the @@global.event_scheduler SQL variable.
+ See sys_var.cc
+ */
+ enum enum_opt_event_scheduler { EVENTS_OFF, EVENTS_ON, EVENTS_DISABLED };
+ static uint opt_event_scheduler;
+ static pthread_mutex_t LOCK_event_metadata;
+ static bool check_if_system_tables_error();
+ static bool start();
+ static bool stop();
+public:
/* A hack needed for Event_queue_element */
static Event_db_repository *
get_db_repository() { return db_repository; }
@@ -134,20 +130,14 @@ public:
dump_internal_status();
private:
- static bool check_if_system_tables_error();
static bool
load_events_from_db(THD *thd);
private:
- /* Command line option names */
- static const TYPELIB opt_typelib;
- static pthread_mutex_t LOCK_event_metadata;
static Event_queue *event_queue;
static Event_scheduler *scheduler;
static Event_db_repository *db_repository;
- /* Current state of Event Scheduler */
- static enum enum_opt_event_scheduler opt_event_scheduler;
/* Set to TRUE if an error at start up */
static bool check_system_tables_error;
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index 1103683b56c..b820b6d939d 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -56,26 +56,125 @@ int ha_ndb_dummy;
#define assert(x) do { if(x) break; ::printf("%s %d: assert failed: %s\n", __FILE__, __LINE__, #x); ::fflush(stdout); ::signal(SIGABRT,SIG_DFL); ::abort(); ::kill(::getpid(),6); ::kill(::getpid(),9); } while (0)
#endif
-// options from from mysqld.cc
-extern my_bool opt_ndb_optimized_node_selection;
-extern const char *opt_ndbcluster_connectstring;
-extern ulong opt_ndb_cache_check_time;
-
-// ndb interface initialization/cleanup
-#ifdef __cplusplus
-extern "C" {
-#endif
-extern void ndb_init_internal();
-extern void ndb_end_internal();
-#ifdef __cplusplus
-}
-#endif
-
-const char *ndb_distribution_names[]= {"KEYHASH", "LINHASH", NullS};
-TYPELIB ndb_distribution_typelib= { array_elements(ndb_distribution_names)-1,
- "", ndb_distribution_names, NULL };
-const char *opt_ndb_distribution= ndb_distribution_names[ND_KEYHASH];
-enum ndb_distribution opt_ndb_distribution_id= ND_KEYHASH;
+// ndb interface initialization/cleanup functions
+extern "C" void ndb_init_internal();
+extern "C" void ndb_end_internal();
+
+static const int DEFAULT_PARALLELISM= 0;
+static const ha_rows DEFAULT_AUTO_PREFETCH= 32;
+static const ulong ONE_YEAR_IN_SECONDS= (ulong) 3600L*24L*365L;
+
+ulong opt_ndb_extra_logging;
+static ulong opt_ndb_cache_check_time;
+static char* opt_ndb_connectstring;
+static char* opt_ndb_mgmd_host;
+static uint opt_ndb_nodeid;
+
+
+static MYSQL_THDVAR_UINT(
+ autoincrement_prefetch_sz, /* name */
+ PLUGIN_VAR_RQCMDARG,
+ "Specify number of autoincrement values that are prefetched.",
+ NULL, /* check func. */
+ NULL, /* update func. */
+ 1, /* default */
+ 1, /* min */
+ 256, /* max */
+ 0 /* block */
+);
+
+
+static MYSQL_THDVAR_BOOL(
+ force_send, /* name */
+ PLUGIN_VAR_OPCMDARG,
+ "Force send of buffers to ndb immediately without waiting for "
+ "other threads.",
+ NULL, /* check func. */
+ NULL, /* update func. */
+ 1 /* default */
+);
+
+
+static MYSQL_THDVAR_BOOL(
+ use_exact_count, /* name */
+ PLUGIN_VAR_OPCMDARG,
+ "Use exact records count during query planning and for fast "
+ "select count(*), disable for faster queries.",
+ NULL, /* check func. */
+ NULL, /* update func. */
+ 1 /* default */
+);
+
+
+static MYSQL_THDVAR_BOOL(
+ use_transactions, /* name */
+ PLUGIN_VAR_OPCMDARG,
+ "Use transactions for large inserts, if enabled then large "
+ "inserts will be split into several smaller transactions",
+ NULL, /* check func. */
+ NULL, /* update func. */
+ 1 /* default */
+);
+
+
+static MYSQL_THDVAR_BOOL(
+ use_copying_alter_table, /* name */
+ PLUGIN_VAR_OPCMDARG,
+ "Force ndbcluster to always copy tables at alter table (should "
+ "only be used if on-line alter table fails).",
+ NULL, /* check func. */
+ NULL, /* update func. */
+ 0 /* default */
+);
+
+
+static MYSQL_THDVAR_UINT(
+ optimized_node_selection, /* name */
+ PLUGIN_VAR_OPCMDARG,
+ "Select nodes for transactions in a more optimal way.",
+ NULL, /* check func. */
+ NULL, /* update func. */
+ 3, /* default */
+ 0, /* min */
+ 3, /* max */
+ 0 /* block */
+);
+
+
+static MYSQL_THDVAR_BOOL(
+ index_stat_enable, /* name */
+ PLUGIN_VAR_OPCMDARG,
+ "Use ndb index statistics in query optimization.",
+ NULL, /* check func. */
+ NULL, /* update func. */
+ FALSE /* default */
+);
+
+
+static MYSQL_THDVAR_ULONG(
+ index_stat_cache_entries, /* name */
+ PLUGIN_VAR_NOCMDARG,
+ "",
+ NULL, /* check func. */
+ NULL, /* update func. */
+ 32, /* default */
+ 0, /* min */
+ ULONG_MAX, /* max */
+ 0 /* block */
+);
+
+
+static MYSQL_THDVAR_ULONG(
+ index_stat_update_freq, /* name */
+ PLUGIN_VAR_NOCMDARG,
+ "",
+ NULL, /* check func. */
+ NULL, /* update func. */
+ 20, /* default */
+ 0, /* min */
+ ULONG_MAX, /* max */
+ 0 /* block */
+);
// Default value for parallelism
static const int parallelism= 0;
@@ -186,7 +285,6 @@ pthread_mutex_t LOCK_ndb_util_thread;
pthread_cond_t COND_ndb_util_thread;
pthread_cond_t COND_ndb_util_ready;
pthread_handler_t ndb_util_thread_func(void *arg);
-ulong ndb_cache_check_time;
/**
Dummy buffer to read zero pack_length fields
@@ -321,7 +419,7 @@ int execute_commit(THD *thd, NdbTransaction *trans)
{
return trans->execute(NdbTransaction::Commit,
NdbOperation::AbortOnError,
- thd->variables.ndb_force_send);
+ THDVAR(thd, force_send));
}
inline
@@ -1250,11 +1348,11 @@ int ha_ndbcluster::add_index_handle(THD *thd, NDBDICT *dict, KEY *key_info,
NDB_INDEX_DATA& d=m_index[index_no];
delete d.index_stat;
d.index_stat=NULL;
- if (thd->variables.ndb_index_stat_enable)
+ if (THDVAR(thd, index_stat_enable))
{
d.index_stat=new NdbIndexStat(index);
- d.index_stat_cache_entries=thd->variables.ndb_index_stat_cache_entries;
- d.index_stat_update_freq=thd->variables.ndb_index_stat_update_freq;
+ d.index_stat_cache_entries=THDVAR(thd, index_stat_cache_entries);
+ d.index_stat_update_freq=THDVAR(thd, index_stat_update_freq);
d.index_stat_query_count=0;
d.index_stat->alloc_cache(d.index_stat_cache_entries);
DBUG_PRINT("info", ("index %s stat=on cache_entries=%u update_freq=%u",
@@ -1314,10 +1412,12 @@ int ha_ndbcluster::open_indexes(Ndb *ndb, TABLE *tab, bool ignore_error)
for (i= 0; i < tab->s->keys; i++, key_info++, key_name++)
{
if ((error= add_index_handle(thd, dict, key_info, *key_name, i)))
+ {
if (ignore_error)
m_index[i].index= m_index[i].unique_index= NULL;
else
break;
+ }
m_index[i].null_in_unique_index= FALSE;
if (check_index_fields_not_null(key_info))
m_index[i].null_in_unique_index= TRUE;
@@ -4082,7 +4182,7 @@ int ha_ndbcluster::info(uint flag)
{
DBUG_RETURN(my_errno= HA_ERR_OUT_OF_MEM);
}
- if (current_thd->variables.ndb_use_exact_count &&
+ if (THDVAR(current_thd, use_exact_count) &&
(result= ndb_get_table_statistics(this, TRUE, ndb, m_table, &stat))
== 0)
{
@@ -4412,12 +4512,12 @@ THR_LOCK_DATA **ha_ndbcluster::store_lock(THD *thd,
#ifndef DBUG_OFF
#define PRINT_OPTION_FLAGS(t) { \
- if (t->options & OPTION_NOT_AUTOCOMMIT) \
- DBUG_PRINT("thd->options", ("OPTION_NOT_AUTOCOMMIT")); \
- if (t->options & OPTION_BEGIN) \
- DBUG_PRINT("thd->options", ("OPTION_BEGIN")); \
- if (t->options & OPTION_TABLE_LOCK) \
- DBUG_PRINT("thd->options", ("OPTION_TABLE_LOCK")); \
+ if (t->variables.option_bits & OPTION_NOT_AUTOCOMMIT) \
+ DBUG_PRINT("thd->variables.option_bits", ("OPTION_NOT_AUTOCOMMIT")); \
+ if (t->variables.option_bits & OPTION_BEGIN) \
+ DBUG_PRINT("thd->variables.option_bits", ("OPTION_BEGIN")); \
+ if (t->variables.option_bits & OPTION_TABLE_LOCK) \
+ DBUG_PRINT("thd->variables.option_bits", ("OPTION_TABLE_LOCK")); \
}
#else
#define PRINT_OPTION_FLAGS(t)
@@ -4504,7 +4604,7 @@ void ha_ndbcluster::transaction_checks(THD *thd)
else if (!thd->transaction.on)
m_transaction_on= FALSE;
else
- m_transaction_on= thd->variables.ndb_use_transactions;
+ m_transaction_on= THDVAR(thd, use_transactions);
}
int ha_ndbcluster::start_statement(THD *thd,
@@ -4517,7 +4617,7 @@ int ha_ndbcluster::start_statement(THD *thd,
trans_register_ha(thd, FALSE, ndbcluster_hton);
if (!thd_ndb->trans)
{
- if (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))
+ if (thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))
trans_register_ha(thd, TRUE, ndbcluster_hton);
DBUG_PRINT("trans",("Starting transaction"));
thd_ndb->trans= ndb->startTransaction();
@@ -4527,7 +4627,7 @@ int ha_ndbcluster::start_statement(THD *thd,
thd_ndb->query_state&= NDB_QUERY_NORMAL;
thd_ndb->trans_options= 0;
thd_ndb->m_slow_path= FALSE;
- if (!(thd->options & OPTION_BIN_LOG) ||
+ if (!(thd->variables.option_bits & OPTION_BIN_LOG) ||
thd->variables.binlog_format == BINLOG_FORMAT_STMT)
{
thd_ndb->trans_options|= TNTO_NO_LOGGING;
@@ -4542,7 +4642,7 @@ int ha_ndbcluster::start_statement(THD *thd,
Check if it should be read or write lock
*/
- if (thd->options & (OPTION_TABLE_LOCK))
+ if (thd->variables.option_bits & OPTION_TABLE_LOCK)
{
//lockThisTable();
DBUG_PRINT("info", ("Locking the table..." ));
@@ -4566,13 +4666,13 @@ int ha_ndbcluster::init_handler_for_statement(THD *thd, Thd_ndb *thd_ndb)
DBUG_ENTER("ha_ndbcluster::init_handler_for_statement");
// store thread specific data first to set the right context
- m_force_send= thd->variables.ndb_force_send;
- m_ha_not_exact_count= !thd->variables.ndb_use_exact_count;
+ m_force_send= THDVAR(thd, force_send);
+ m_ha_not_exact_count= !THDVAR(thd, use_exact_count);
m_autoincrement_prefetch=
- (thd->variables.ndb_autoincrement_prefetch_sz >
- NDB_DEFAULT_AUTO_PREFETCH) ?
- (ha_rows) thd->variables.ndb_autoincrement_prefetch_sz
- : (ha_rows) NDB_DEFAULT_AUTO_PREFETCH;
+ (THDVAR(thd, autoincrement_prefetch_sz) >
+ DEFAULT_AUTO_PREFETCH) ?
+ (ha_rows) THDVAR(thd, autoincrement_prefetch_sz)
+ : (ha_rows) DEFAULT_AUTO_PREFETCH;
m_active_trans= thd_ndb->trans;
DBUG_ASSERT(m_active_trans);
// Start of transaction
@@ -4587,7 +4687,7 @@ int ha_ndbcluster::init_handler_for_statement(THD *thd, Thd_ndb *thd_ndb)
}
#endif
- if (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))
+ if (thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))
{
const void *key= m_table;
HASH_SEARCH_STATE state;
@@ -4668,10 +4768,10 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type)
{
DBUG_PRINT("info", ("lock_type == F_UNLCK"));
- if (ndb_cache_check_time && m_rows_changed)
+ if (opt_ndb_cache_check_time && m_rows_changed)
{
DBUG_PRINT("info", ("Rows has changed and util thread is running"));
- if (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))
+ if (thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))
{
DBUG_PRINT("info", ("Add share to list of tables to be invalidated"));
/* NOTE push_back allocates memory using transactions mem_root! */
@@ -4690,7 +4790,7 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type)
DBUG_PRINT("trans", ("Last external_lock"));
PRINT_OPTION_FLAGS(thd);
- if (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))
+ if (!(thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))
{
if (thd_ndb->trans)
{
@@ -4801,7 +4901,7 @@ static int ndbcluster_commit(handlerton *hton, THD *thd, bool all)
DBUG_PRINT("enter", ("Commit %s", (all ? "all" : "stmt")));
thd_ndb->start_stmt_count= 0;
if (trans == NULL || (!all &&
- thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))
+ thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))
{
/*
An odditity in the handler interface is that commit on handlerton
@@ -4871,7 +4971,7 @@ static int ndbcluster_rollback(handlerton *hton, THD *thd, bool all)
DBUG_ASSERT(ndb);
thd_ndb->start_stmt_count= 0;
if (trans == NULL || (!all &&
- thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))
+ thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))
{
/* Ignore end-of-statement until real rollback or commit is called */
DBUG_PRINT("info", ("Rollback before start or end-of-statement only"));
@@ -5567,7 +5667,7 @@ int ha_ndbcluster::create(const char *name,
if (!ndbcluster_create_event(ndb, m_table, event_name.c_ptr(), share,
share && do_event_op ? 2 : 1/* push warning */))
{
- if (ndb_extra_logging)
+ if (opt_ndb_extra_logging)
sql_print_information("NDB Binlog: CREATE TABLE Event: %s",
event_name.c_ptr());
if (share &&
@@ -6010,7 +6110,7 @@ int ha_ndbcluster::rename_table(const char *from, const char *to)
if (!ndbcluster_create_event(ndb, ndbtab, event_name.c_ptr(), share,
share && ndb_binlog_running ? 2 : 1/* push warning */))
{
- if (ndb_extra_logging)
+ if (opt_ndb_extra_logging)
sql_print_information("NDB Binlog: RENAME Event: %s",
event_name.c_ptr());
if (share &&
@@ -6313,10 +6413,9 @@ void ha_ndbcluster::get_auto_increment(ulonglong offset, ulonglong increment,
m_rows_to_insert+= m_autoincrement_prefetch;
}
uint remaining= m_rows_to_insert - m_rows_inserted;
+ ha_rows prefetch= THDVAR(thd, autoincrement_prefetch_sz);
uint min_prefetch=
- (remaining < thd->variables.ndb_autoincrement_prefetch_sz) ?
- thd->variables.ndb_autoincrement_prefetch_sz
- : remaining;
+ (remaining < prefetch) ? prefetch : remaining;
cache_size= ((remaining < m_autoincrement_prefetch) ?
min_prefetch
: remaining);
@@ -6406,7 +6505,7 @@ ha_ndbcluster::ha_ndbcluster(handlerton *hton, TABLE_SHARE *table_arg):
m_dupkey((uint) -1),
m_ha_not_exact_count(FALSE),
m_force_send(TRUE),
- m_autoincrement_prefetch((ha_rows) NDB_DEFAULT_AUTO_PREFETCH),
+ m_autoincrement_prefetch(DEFAULT_AUTO_PREFETCH),
m_transaction_on(TRUE),
m_cond(NULL),
m_multi_cursor(NULL)
@@ -7417,17 +7516,31 @@ static int ndbcluster_init(void *p)
h->table_exists_in_engine= ndbcluster_table_exists_in_engine;
}
+ // Format the connect string to be used for connecting to the cluster
+ int pos= 0;
+ char connectstring_buf[1024] = {0};
+ if (opt_ndb_nodeid != 0)
+ pos+= my_snprintf(connectstring_buf, sizeof(connectstring_buf),
+ "nodeid=%u", opt_ndb_nodeid);
+ if (opt_ndb_mgmd_host)
+ pos+= my_snprintf(connectstring_buf+pos, sizeof(connectstring_buf)-pos,
+ "%s%s", pos ? "," : "", opt_ndb_mgmd_host);
+ if (opt_ndb_connectstring)
+ pos+= my_snprintf(connectstring_buf+pos, sizeof(connectstring_buf)-pos,
+ "%s%s", pos ? "," : "", opt_ndb_connectstring);
+
+
// Initialize ndb interface
ndb_init_internal();
// Set connectstring if specified
- if (opt_ndbcluster_connectstring != 0)
- DBUG_PRINT("connectstring", ("%s", opt_ndbcluster_connectstring));
+ if (opt_ndb_connectstring != 0)
+ DBUG_PRINT("connectstring", ("%s", opt_ndb_connectstring));
if ((g_ndb_cluster_connection=
- new Ndb_cluster_connection(opt_ndbcluster_connectstring)) == 0)
+ new Ndb_cluster_connection(opt_ndb_connectstring)) == 0)
{
DBUG_PRINT("error",("Ndb_cluster_connection(%s)",
- opt_ndbcluster_connectstring));
+ opt_ndb_connectstring));
my_errno= HA_ERR_OUT_OF_MEM;
goto ndbcluster_init_error;
}
@@ -7437,7 +7550,7 @@ static int ndbcluster_init(void *p)
g_ndb_cluster_connection->set_name(buf);
}
g_ndb_cluster_connection->set_optimized_node_selection
- (opt_ndb_optimized_node_selection);
+ (THDVAR(0, optimized_node_selection));
// Create a Ndb object to open the connection to NDB
if ( (g_ndb= new Ndb(g_ndb_cluster_connection, "sys")) == 0 )
@@ -7493,7 +7606,6 @@ static int ndbcluster_init(void *p)
goto ndbcluster_init_error;
#endif /* HAVE_NDB_BINLOG */
- ndb_cache_check_time = opt_ndb_cache_check_time;
// Create utility thread
pthread_t tmp;
if (pthread_create(&tmp, &connection_attrib, ndb_util_thread_func, 0))
@@ -7953,7 +8065,7 @@ uint ndb_get_commitcount(THD *thd, char *dbname, char *tabname,
pthread_mutex_unlock(&ndbcluster_mutex);
pthread_mutex_lock(&share->mutex);
- if (ndb_cache_check_time > 0)
+ if (opt_ndb_cache_check_time > 0)
{
if (share->commit_count != 0)
{
@@ -8056,7 +8168,7 @@ ndbcluster_cache_retrieval_allowed(THD *thd,
ulonglong *engine_data)
{
Uint64 commit_count;
- bool is_autocommit= !(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
+ bool is_autocommit= !(thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
char *dbname= full_name;
char *tabname= dbname+strlen(dbname)+1;
#ifndef DBUG_OFF
@@ -8131,7 +8243,7 @@ ha_ndbcluster::register_query_cache_table(THD *thd,
#ifndef DBUG_OFF
char buff[22];
#endif
- bool is_autocommit= !(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
+ bool is_autocommit= !(thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
DBUG_ENTER("ha_ndbcluster::register_query_cache_table");
DBUG_PRINT("enter",("dbname: %s, tabname: %s, is_autocommit: %d",
m_dbname, m_tabname, is_autocommit));
@@ -8255,7 +8367,7 @@ int handle_trailing_share(NDB_SHARE *share)
share->key, share->use_count));
if (!--share->use_count)
{
- if (ndb_extra_logging)
+ if (opt_ndb_extra_logging)
sql_print_information("NDB_SHARE: trailing share "
"%s(connect_count: %u) "
"released by close_cached_tables at "
@@ -8281,7 +8393,7 @@ int handle_trailing_share(NDB_SHARE *share)
if (share->use_count == 0)
{
- if (ndb_extra_logging)
+ if (opt_ndb_extra_logging)
sql_print_information("NDB_SHARE: trailing share "
"%s(connect_count: %u) "
"released after NSS_DROPPED check "
@@ -9287,7 +9399,7 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
my_thread_init();
DBUG_ENTER("ndb_util_thread");
- DBUG_PRINT("enter", ("ndb_cache_check_time: %lu", ndb_cache_check_time));
+ DBUG_PRINT("enter", ("cache_check_time: %lu", opt_ndb_cache_check_time));
pthread_mutex_lock(&LOCK_ndb_util_thread);
@@ -9367,7 +9479,7 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
thd_ndb->options|= TNO_NO_LOG_SCHEMA_OP;
#ifdef HAVE_NDB_BINLOG
- if (ndb_extra_logging && ndb_binlog_running)
+ if (opt_ndb_extra_logging && ndb_binlog_running)
sql_print_information("NDB Binlog: Ndb tables initially read only.");
/* create tables needed by the replication */
ndbcluster_setup_binlog_table_shares(thd);
@@ -9390,8 +9502,8 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
goto ndb_util_thread_end;
pthread_mutex_unlock(&LOCK_ndb_util_thread);
#ifdef NDB_EXTRA_DEBUG_UTIL_THREAD
- DBUG_PRINT("ndb_util_thread", ("Started, ndb_cache_check_time: %lu",
- ndb_cache_check_time));
+ DBUG_PRINT("ndb_util_thread", ("Started, opt_ndb_cache_check_time: %lu",
+ opt_ndb_cache_check_time));
#endif
#ifdef HAVE_NDB_BINLOG
@@ -9404,7 +9516,7 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
ndbcluster_setup_binlog_table_shares(thd);
#endif
- if (ndb_cache_check_time == 0)
+ if (opt_ndb_cache_check_time == 0)
{
/* Wake up in 1 second to check if value has changed */
set_timespec(abstime, 1);
@@ -9520,7 +9632,7 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
next:
/* Calculate new time to wake up */
int secs= 0;
- int msecs= ndb_cache_check_time;
+ int msecs= opt_ndb_cache_check_time;
struct timeval tick_time;
gettimeofday(&tick_time, 0);
@@ -9796,12 +9908,33 @@ int ha_ndbcluster::get_default_no_partitions(HA_CREATE_INFO *create_info)
and partition by hidden key otherwise.
*/
+
+enum ndb_distribution_enum { ND_KEYHASH= 0, ND_LINHASH= 1 };
+static const char* distribution_names[]= { "KEYHASH", "LINHASH", NullS };
+static ulong default_ndb_distribution= ND_KEYHASH;
+static TYPELIB distribution_typelib= {
+ array_elements(distribution_names) - 1,
+ "",
+ distribution_names,
+ NULL
+};
+static MYSQL_SYSVAR_ENUM(
+ distribution, /* name */
+ default_ndb_distribution, /* var */
+ PLUGIN_VAR_RQCMDARG,
+ "Default distribution for new tables in ndb",
+ NULL, /* check func. */
+ NULL, /* update func. */
+ ND_KEYHASH, /* default */
+ &distribution_typelib /* typelib */
+);
+
void ha_ndbcluster::set_auto_partitions(partition_info *part_info)
{
DBUG_ENTER("ha_ndbcluster::set_auto_partitions");
part_info->list_of_part_fields= TRUE;
part_info->part_type= HASH_PARTITION;
- switch (opt_ndb_distribution_id)
+ switch (default_ndb_distribution)
{
case ND_KEYHASH:
part_info->linear_hash_ind= FALSE;
@@ -10037,7 +10170,7 @@ bool ha_ndbcluster::check_if_incompatible_data(HA_CREATE_INFO *create_info,
uint i;
const NDBTAB *tab= (const NDBTAB *) m_table;
- if (current_thd->variables.ndb_use_copying_alter_table)
+ if (THDVAR(current_thd, use_copying_alter_table))
{
DBUG_PRINT("info", ("On-line alter table disabled"));
DBUG_RETURN(COMPATIBLE_DATA_NO);
@@ -10669,6 +10802,132 @@ SHOW_VAR ndb_status_variables_export[]= {
{NullS, NullS, SHOW_LONG}
};
+static MYSQL_SYSVAR_ULONG(
+ cache_check_time, /* name */
+ opt_ndb_cache_check_time, /* var */
+ PLUGIN_VAR_RQCMDARG,
+ "A dedicated thread is created to, at the given "
+ "millisecond interval, invalidate the query cache "
+ "if another MySQL server in the cluster has changed "
+ "the data in the database.",
+ NULL, /* check func. */
+ NULL, /* update func. */
+ 0, /* default */
+ 0, /* min */
+ ONE_YEAR_IN_SECONDS, /* max */
+ 0 /* block */
+);
+
+
+static MYSQL_SYSVAR_ULONG(
+ extra_logging, /* name */
+ opt_ndb_extra_logging, /* var */
+ PLUGIN_VAR_OPCMDARG,
+ "Turn on more logging in the error log.",
+ NULL, /* check func. */
+ NULL, /* update func. */
+ 1, /* default */
+ 0, /* min */
+ 0, /* max */
+ 0 /* block */
+);
+
+
+ulong opt_ndb_report_thresh_binlog_epoch_slip;
+static MYSQL_SYSVAR_ULONG(
+ report_thresh_binlog_epoch_slip, /* name */
+ opt_ndb_report_thresh_binlog_epoch_slip,/* var */
+ PLUGIN_VAR_RQCMDARG,
+ "Threshold on number of epochs to be behind before reporting binlog "
+ "status. E.g. 3 means that if the difference between what epoch has "
+ "been received from the storage nodes and what has been applied to "
+ "the binlog is 3 or more, a status message will be sent to the cluster "
+ "log.",
+ NULL, /* check func. */
+ NULL, /* update func. */
+ 3, /* default */
+ 0, /* min */
+ 256, /* max */
+ 0 /* block */
+);
+
+
+ulong opt_ndb_report_thresh_binlog_mem_usage;
+static MYSQL_SYSVAR_ULONG(
+ report_thresh_binlog_mem_usage, /* name */
+ opt_ndb_report_thresh_binlog_mem_usage,/* var */
+ PLUGIN_VAR_RQCMDARG,
+ "Threshold on percentage of free memory before reporting binlog "
+ "status. E.g. 10 means that if amount of available memory for "
+ "receiving binlog data from the storage nodes goes below 10%, "
+ "a status message will be sent to the cluster log.",
+ NULL, /* check func. */
+ NULL, /* update func. */
+ 10, /* default */
+ 0, /* min */
+ 100, /* max */
+ 0 /* block */
+);
+
+
+static MYSQL_SYSVAR_STR(
+ connectstring, /* name */
+ opt_ndb_connectstring, /* var */
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
+ "Connect string for ndbcluster.",
+ NULL, /* check func. */
+ NULL, /* update func. */
+ NULL /* default */
+);
+
+
+static MYSQL_SYSVAR_STR(
+ mgmd_host, /* name */
+ opt_ndb_mgmd_host, /* var */
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
+ "Set host and port for ndb_mgmd. Syntax: hostname[:port]",
+ NULL, /* check func. */
+ NULL, /* update func. */
+ NULL /* default */
+);
+
+
+static MYSQL_SYSVAR_UINT(
+ nodeid, /* name */
+ opt_ndb_nodeid, /* var */
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
+ "Nodeid for this mysqld in the cluster.",
+ NULL, /* check func. */
+ NULL, /* update func. */
+ 0, /* default */
+ 0, /* min */
+ 255, /* max */
+ 0 /* block */
+);
+
+static struct st_mysql_sys_var* system_variables[]= {
+ MYSQL_SYSVAR(cache_check_time),
+ MYSQL_SYSVAR(extra_logging),
+ MYSQL_SYSVAR(report_thresh_binlog_mem_usage),
+ MYSQL_SYSVAR(report_thresh_binlog_epoch_slip),
+ MYSQL_SYSVAR(distribution),
+ MYSQL_SYSVAR(autoincrement_prefetch_sz),
+ MYSQL_SYSVAR(force_send),
+ MYSQL_SYSVAR(use_exact_count),
+ MYSQL_SYSVAR(use_transactions),
+ MYSQL_SYSVAR(use_copying_alter_table),
+ MYSQL_SYSVAR(optimized_node_selection),
+ MYSQL_SYSVAR(index_stat_enable),
+ MYSQL_SYSVAR(index_stat_cache_entries),
+ MYSQL_SYSVAR(index_stat_update_freq),
+ MYSQL_SYSVAR(connectstring),
+ MYSQL_SYSVAR(mgmd_host),
+ MYSQL_SYSVAR(nodeid),
+
+ NULL
+};
+
+
struct st_mysql_storage_engine ndbcluster_storage_engine=
{ MYSQL_HANDLERTON_INTERFACE_VERSION };
@@ -10684,7 +10943,7 @@ mysql_declare_plugin(ndbcluster)
NULL, /* Plugin Deinit */
0x0100 /* 1.0 */,
ndb_status_variables_export,/* status variables */
- NULL, /* system variables */
+ system_variables, /* system variables */
NULL /* config options */
}
mysql_declare_plugin_end;
diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h
index ac3e7329136..a51dc38bf93 100644
--- a/sql/ha_ndbcluster.h
+++ b/sql/ha_ndbcluster.h
@@ -34,7 +34,6 @@
#include <ndbapi_limits.h>
#define NDB_HIDDEN_PRIMARY_KEY_LENGTH 8
-#define NDB_DEFAULT_AUTO_PREFETCH 32
class Ndb; // Forward declaration
@@ -50,11 +49,6 @@ class ha_ndbcluster_cond;
// connectstring to cluster if given by mysqld
extern const char *ndbcluster_connectstring;
-extern ulong ndb_cache_check_time;
-#ifdef HAVE_NDB_BINLOG
-extern ulong ndb_report_thresh_binlog_epoch_slip;
-extern ulong ndb_report_thresh_binlog_mem_usage;
-#endif
typedef enum ndb_index_type {
UNDEFINED_INDEX = 0,
diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc
index bdbb57224b0..b59e686d131 100644
--- a/sql/ha_ndbcluster_binlog.cc
+++ b/sql/ha_ndbcluster_binlog.cc
@@ -33,6 +33,8 @@
#define assert(x) do { if(x) break; ::printf("%s %d: assert failed: %s\n", __FILE__, __LINE__, #x); ::fflush(stdout); ::signal(SIGABRT,SIG_DFL); ::abort(); ::kill(::getpid(),6); ::kill(::getpid(),9); } while (0)
#endif
+extern my_bool opt_ndb_log_binlog_index;
+extern ulong opt_ndb_extra_logging;
/*
defines for cluster replication table names
*/
@@ -44,14 +46,16 @@
Timeout for syncing schema events between
mysql servers, and between mysql server and the binlog
*/
-const int opt_ndb_sync_timeout= 120;
+static const int DEFAULT_SYNC_TIMEOUT= 120;
+
/*
Flag showing if the ndb injector thread is running, if so == 1
-1 if it was started but later stopped for some reason
0 if never started
*/
-int ndb_binlog_thread_running= 0;
+static int ndb_binlog_thread_running= 0;
+
/*
Flag showing if the ndb binlog should be created, if so == TRUE
FALSE if not
@@ -247,8 +251,8 @@ static void run_query(THD *thd, char *buf, char *end,
struct system_status_var save_thd_status_var= thd->status_var;
THD_TRANS save_thd_transaction_all= thd->transaction.all;
THD_TRANS save_thd_transaction_stmt= thd->transaction.stmt;
- ulonglong save_thd_options= thd->options;
- DBUG_ASSERT(sizeof(save_thd_options) == sizeof(thd->options));
+ ulonglong save_thd_options= thd->variables.option_bits;
+ DBUG_ASSERT(sizeof(save_thd_options) == sizeof(thd->variables.option_bits));
NET save_thd_net= thd->net;
const char* found_semicolon= NULL;
@@ -257,7 +261,7 @@ static void run_query(THD *thd, char *buf, char *end,
thd->variables.pseudo_thread_id= thread_id;
thd->transaction.stmt.modified_non_trans_table= FALSE;
if (disable_binlog)
- thd->options&= ~OPTION_BIN_LOG;
+ thd->variables.option_bits&= ~OPTION_BIN_LOG;
DBUG_PRINT("query", ("%s", thd->query()));
@@ -295,7 +299,7 @@ static void run_query(THD *thd, char *buf, char *end,
*/
thd->stmt_da->reset_diagnostics_area();
- thd->options= save_thd_options;
+ thd->variables.option_bits= save_thd_options;
thd->set_query(save_thd_query, save_thd_query_length);
thd->variables.pseudo_thread_id= save_thread_id;
thd->status_var= save_thd_status_var;
@@ -788,7 +792,7 @@ static int ndbcluster_create_ndb_apply_status_table(THD *thd)
char buf[1024 + 1], *end;
- if (ndb_extra_logging)
+ if (opt_ndb_extra_logging)
sql_print_information("NDB: Creating " NDB_REP_DB "." NDB_APPLY_TABLE);
/*
@@ -846,7 +850,7 @@ static int ndbcluster_create_schema_table(THD *thd)
char buf[1024 + 1], *end;
- if (ndb_extra_logging)
+ if (opt_ndb_extra_logging)
sql_print_information("NDB: Creating " NDB_REP_DB "." NDB_SCHEMA_TABLE);
/*
@@ -919,7 +923,7 @@ int ndbcluster_setup_binlog_table_shares(THD *thd)
{
mysql_mutex_lock(&LOCK_open);
ndb_binlog_tables_inited= TRUE;
- if (ndb_extra_logging)
+ if (opt_ndb_extra_logging)
sql_print_information("NDB Binlog: ndb tables writable");
close_cached_tables(NULL, NULL, TRUE, FALSE, FALSE);
mysql_mutex_unlock(&LOCK_open);
@@ -1498,7 +1502,7 @@ int ndbcluster_log_schema_op(THD *thd, NDB_SHARE *share,
r|= op->setValue(SCHEMA_TYPE_I, log_type);
DBUG_ASSERT(r == 0);
/* any value */
- if (!(thd->options & OPTION_BIN_LOG))
+ if (!(thd->variables.option_bits & OPTION_BIN_LOG))
r|= op->setAnyValue(NDB_ANYVALUE_FOR_NOLOGGING);
else
r|= op->setAnyValue(thd->server_id);
@@ -1561,7 +1565,7 @@ end:
else
dict->forceGCPWait();
- int max_timeout= opt_ndb_sync_timeout;
+ int max_timeout= DEFAULT_SYNC_TIMEOUT;
(void) pthread_mutex_lock(&ndb_schema_object->mutex);
if (have_lock_open)
{
@@ -1618,7 +1622,7 @@ end:
type_str, ndb_schema_object->key);
break;
}
- if (ndb_extra_logging)
+ if (opt_ndb_extra_logging)
ndb_report_waiting(type_str, max_timeout,
"distributing", ndb_schema_object->key);
}
@@ -1767,7 +1771,7 @@ ndb_handle_schema_change(THD *thd, Ndb *ndb, NdbEventOperation *pOp,
DBUG_PRINT("info", ("Detected name change of table %s.%s",
share->db, share->table_name));
/* ToDo: remove printout */
- if (ndb_extra_logging)
+ if (opt_ndb_extra_logging)
sql_print_information("NDB Binlog: rename table %s%s/%s -> %s.",
share_prefix, share->table->s->db.str,
share->table->s->table_name.str,
@@ -2057,12 +2061,12 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb,
// skip
break;
case NDBEVENT::TE_CLUSTER_FAILURE:
- if (ndb_extra_logging)
+ if (opt_ndb_extra_logging)
sql_print_information("NDB Binlog: cluster failure for %s at epoch %u.",
ndb_schema_share->key, (unsigned) pOp->getGCI());
// fall through
case NDBEVENT::TE_DROP:
- if (ndb_extra_logging &&
+ if (opt_ndb_extra_logging &&
ndb_binlog_tables_inited && ndb_binlog_running)
sql_print_information("NDB Binlog: ndb tables initially "
"read only on reconnect.");
@@ -2091,7 +2095,7 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb,
(void) pthread_mutex_lock(&tmp_share->mutex);
bitmap_clear_all(&tmp_share->subscriber_bitmap[node_id]);
DBUG_PRINT("info",("NODE_FAILURE UNSUBSCRIBE[%d]", node_id));
- if (ndb_extra_logging)
+ if (opt_ndb_extra_logging)
{
sql_print_information("NDB Binlog: Node: %d, down,"
" Subscriber bitmask %x%x",
@@ -2111,7 +2115,7 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb,
(void) pthread_mutex_lock(&tmp_share->mutex);
bitmap_set_bit(&tmp_share->subscriber_bitmap[node_id], req_id);
DBUG_PRINT("info",("SUBSCRIBE[%d] %d", node_id, req_id));
- if (ndb_extra_logging)
+ if (opt_ndb_extra_logging)
{
sql_print_information("NDB Binlog: Node: %d, subscribe from node %d,"
" Subscriber bitmask %x%x",
@@ -2132,7 +2136,7 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb,
(void) pthread_mutex_lock(&tmp_share->mutex);
bitmap_clear_bit(&tmp_share->subscriber_bitmap[node_id], req_id);
DBUG_PRINT("info",("UNSUBSCRIBE[%d] %d", node_id, req_id));
- if (ndb_extra_logging)
+ if (opt_ndb_extra_logging)
{
sql_print_information("NDB Binlog: Node: %d, unsubscribe from node %d,"
" Subscriber bitmask %x%x",
@@ -2369,8 +2373,8 @@ int ndb_add_ndb_binlog_index(THD *thd, void *_row)
Turn of binlogging to prevent the table changes to be written to
the binary log.
*/
- ulong saved_options= thd->options;
- thd->options&= ~(OPTION_BIN_LOG);
+ ulong saved_options= thd->variables.option_bits;
+ thd->variables.option_bits&= ~OPTION_BIN_LOG;
for ( ; ; ) /* loop for need_reopen */
{
@@ -2420,12 +2424,12 @@ int ndb_add_ndb_binlog_index(THD *thd, void *_row)
mysql_unlock_tables(thd, thd->lock);
thd->lock= 0;
- thd->options= saved_options;
+ thd->variables.option_bits= saved_options;
return 0;
add_ndb_binlog_index_err:
close_thread_tables(thd);
ndb_binlog_index= 0;
- thd->options= saved_options;
+ thd->variables.option_bits= saved_options;
return error;
}
@@ -2655,7 +2659,7 @@ int ndbcluster_create_binlog_setup(Ndb *ndb, const char *key,
const NDBTAB *ndbtab= ndbtab_g.get_table();
if (ndbtab == 0)
{
- if (ndb_extra_logging)
+ if (opt_ndb_extra_logging)
sql_print_information("NDB Binlog: Failed to get table %s from ndb: "
"%s, %d", key, dict->getNdbError().message,
dict->getNdbError().code);
@@ -2677,7 +2681,7 @@ int ndbcluster_create_binlog_setup(Ndb *ndb, const char *key,
event_name.c_ptr());
break; // error
}
- if (ndb_extra_logging)
+ if (opt_ndb_extra_logging)
sql_print_information("NDB Binlog: "
"CREATE (DISCOVER) TABLE Event: %s",
event_name.c_ptr());
@@ -2685,7 +2689,7 @@ int ndbcluster_create_binlog_setup(Ndb *ndb, const char *key,
else
{
delete ev;
- if (ndb_extra_logging)
+ if (opt_ndb_extra_logging)
sql_print_information("NDB Binlog: DISCOVER TABLE Event: %s",
event_name.c_ptr());
}
@@ -3089,7 +3093,7 @@ ndbcluster_create_event_ops(NDB_SHARE *share, const NDBTAB *ndbtab,
DBUG_PRINT("info",("%s share->op: 0x%lx share->use_count: %u",
share->key, (long) share->op, share->use_count));
- if (ndb_extra_logging)
+ if (opt_ndb_extra_logging)
sql_print_information("NDB Binlog: logging %s", share->key);
DBUG_RETURN(0);
}
@@ -3157,7 +3161,7 @@ ndbcluster_handle_drop_table(Ndb *ndb, const char *event_name,
(void) pthread_mutex_lock(&share->mutex);
mysql_mutex_assert_owner(&LOCK_open);
mysql_mutex_unlock(&LOCK_open);
- int max_timeout= opt_ndb_sync_timeout;
+ int max_timeout= DEFAULT_SYNC_TIMEOUT;
while (share->op)
{
struct timespec abstime;
@@ -3177,7 +3181,7 @@ ndbcluster_handle_drop_table(Ndb *ndb, const char *event_name,
type_str, share->key);
break;
}
- if (ndb_extra_logging)
+ if (opt_ndb_extra_logging)
ndb_report_waiting(type_str, max_timeout,
type_str, share->key);
}
@@ -3255,12 +3259,12 @@ ndb_binlog_thread_handle_non_data_event(THD *thd, Ndb *ndb,
switch (type)
{
case NDBEVENT::TE_CLUSTER_FAILURE:
- if (ndb_extra_logging)
+ if (opt_ndb_extra_logging)
sql_print_information("NDB Binlog: cluster failure for %s at epoch %u.",
share->key, (unsigned) pOp->getGCI());
if (ndb_apply_status_share == share)
{
- if (ndb_extra_logging &&
+ if (opt_ndb_extra_logging &&
ndb_binlog_tables_inited && ndb_binlog_running)
sql_print_information("NDB Binlog: ndb tables initially "
"read only on reconnect.");
@@ -3280,7 +3284,7 @@ ndb_binlog_thread_handle_non_data_event(THD *thd, Ndb *ndb,
case NDBEVENT::TE_DROP:
if (ndb_apply_status_share == share)
{
- if (ndb_extra_logging &&
+ if (opt_ndb_extra_logging &&
ndb_binlog_tables_inited && ndb_binlog_running)
sql_print_information("NDB Binlog: ndb tables initially "
"read only on reconnect.");
@@ -3292,7 +3296,7 @@ ndb_binlog_thread_handle_non_data_event(THD *thd, Ndb *ndb,
ndb_binlog_tables_inited= 0;
}
/* ToDo: remove printout */
- if (ndb_extra_logging)
+ if (opt_ndb_extra_logging)
sql_print_information("NDB Binlog: drop table %s.", share->key);
// fall through
case NDBEVENT::TE_ALTER:
@@ -3623,6 +3627,8 @@ static void ndb_free_schema_object(NDB_SCHEMA_OBJECT **ndb_schema_object,
DBUG_VOID_RETURN;
}
+extern ulong opt_ndb_report_thresh_binlog_epoch_slip;
+extern ulong opt_ndb_report_thresh_binlog_mem_usage;
pthread_handler_t ndb_binlog_thread_func(void *arg)
{
@@ -3881,7 +3887,7 @@ restart:
"Changes to the database that occured while "
"disconnected will not be in the binlog");
}
- if (ndb_extra_logging)
+ if (opt_ndb_extra_logging)
{
sql_print_information("NDB Binlog: starting log at epoch %u",
(unsigned)schema_gci);
@@ -3983,9 +3989,9 @@ restart:
{
thd->proc_info= "Processing events from schema table";
s_ndb->
- setReportThreshEventGCISlip(ndb_report_thresh_binlog_epoch_slip);
+ setReportThreshEventGCISlip(opt_ndb_report_thresh_binlog_epoch_slip);
s_ndb->
- setReportThreshEventFreeMem(ndb_report_thresh_binlog_mem_usage);
+ setReportThreshEventFreeMem(opt_ndb_report_thresh_binlog_mem_usage);
NdbEventOperation *pOp= s_ndb->nextEvent();
while (pOp != NULL)
{
@@ -4048,8 +4054,8 @@ restart:
/* initialize some variables for this epoch */
g_ndb_log_slave_updates= opt_log_slave_updates;
i_ndb->
- setReportThreshEventGCISlip(ndb_report_thresh_binlog_epoch_slip);
- i_ndb->setReportThreshEventFreeMem(ndb_report_thresh_binlog_mem_usage);
+ setReportThreshEventGCISlip(opt_ndb_report_thresh_binlog_epoch_slip);
+ i_ndb->setReportThreshEventFreeMem(opt_ndb_report_thresh_binlog_mem_usage);
bzero((char*) &row, sizeof(row));
thd->variables.character_set_client= &my_charset_latin1;
diff --git a/sql/ha_ndbcluster_binlog.h b/sql/ha_ndbcluster_binlog.h
index d80dfe9ee74..4c64aa23c5b 100644
--- a/sql/ha_ndbcluster_binlog.h
+++ b/sql/ha_ndbcluster_binlog.h
@@ -27,8 +27,6 @@ typedef NdbDictionary::Event NDBEVENT;
#define IS_TMP_PREFIX(A) (is_prefix(A, tmp_file_prefix))
-extern ulong ndb_extra_logging;
-
#define INJECTOR_EVENT_LEN 200
#define NDB_INVALID_SCHEMA_OBJECT 241
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 2ec92173d14..d46d416e275 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -1145,7 +1145,7 @@ int ha_partition::handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt,
{
if (part_elem->part_state == PART_ADMIN)
part_elem->part_state= PART_NORMAL;
- } while (part_elem= part_it++);
+ } while ((part_elem= part_it++));
DBUG_RETURN(error);
}
} while (++j < num_subparts);
@@ -1177,7 +1177,7 @@ int ha_partition::handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt,
{
if (part_elem->part_state == PART_ADMIN)
part_elem->part_state= PART_NORMAL;
- } while (part_elem= part_it++);
+ } while ((part_elem= part_it++));
DBUG_RETURN(error);
}
}
@@ -6483,7 +6483,7 @@ void ha_partition::get_auto_increment(ulonglong offset, ulonglong increment,
thd->lex->sql_command != SQLCOM_INSERT &&
mysql_bin_log.is_open() &&
!thd->current_stmt_binlog_row_based &&
- (thd->options & OPTION_BIN_LOG))
+ (thd->variables.option_bits & OPTION_BIN_LOG))
{
DBUG_PRINT("info", ("locking auto_increment_safe_stmt_log_lock"));
auto_increment_safe_stmt_log_lock= TRUE;
diff --git a/sql/handler.cc b/sql/handler.cc
index dd8eb93099d..784d02d7f4c 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -307,7 +307,6 @@ const char **get_handler_errmsgs()
int ha_init_errors(void)
{
#define SETMSG(nr, msg) handler_errmsgs[(nr) - HA_ERR_FIRST]= (msg)
- const char **errmsgs;
/* Allocate a pointer array for the error message strings. */
/* Zerofill it to avoid uninitialized gaps. */
@@ -3696,7 +3695,6 @@ int ha_create_table_from_engine(THD* thd, const char *db, const char *name)
void st_ha_check_opt::init()
{
flags= sql_flags= 0;
- sort_buffer_size = current_thd->variables.myisam_sort_buff_size;
}
@@ -3774,15 +3772,6 @@ int ha_change_key_cache_param(KEY_CACHE *key_cache)
}
/**
- Free memory allocated by a key cache.
-*/
-int ha_end_key_cache(KEY_CACHE *key_cache)
-{
- end_key_cache(key_cache, 1); // Can never fail
- return 0;
-}
-
-/**
Move all tables from one key cache to another one.
*/
int ha_change_key_cache(KEY_CACHE *old_key_cache,
@@ -4489,7 +4478,7 @@ static bool check_table_binlog_row_based(THD *thd, TABLE *table)
return (thd->current_stmt_binlog_row_based &&
table->s->cached_row_logging_check &&
- (thd->options & OPTION_BIN_LOG) &&
+ (thd->variables.option_bits & OPTION_BIN_LOG) &&
mysql_bin_log.is_open());
}
diff --git a/sql/handler.h b/sql/handler.h
index e5d868dc608..6d43c56edbf 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -941,9 +941,6 @@ enum enum_tx_isolation { ISO_READ_UNCOMMITTED, ISO_READ_COMMITTED,
ISO_REPEATABLE_READ, ISO_SERIALIZABLE};
-enum ndb_distribution { ND_KEYHASH= 0, ND_LINHASH= 1 };
-
-
typedef struct {
ulonglong data_file_length;
ulonglong max_data_file_length;
@@ -1075,7 +1072,6 @@ typedef class Item COND;
typedef struct st_ha_check_opt
{
st_ha_check_opt() {} /* Remove gcc warning */
- ulong sort_buffer_size;
uint flags; /* isam layer flags (e.g. for myisamchk) */
uint sql_flags; /* sql layer flags - for something myisamchk cannot do */
KEY_CACHE *key_cache; /* new key cache when changing key cache */
@@ -2006,7 +2002,7 @@ extern const char *ha_row_type[];
extern MYSQL_PLUGIN_IMPORT const char *tx_isolation_names[];
extern MYSQL_PLUGIN_IMPORT const char *binlog_format_names[];
extern TYPELIB tx_isolation_typelib;
-extern TYPELIB myisam_stats_method_typelib;
+extern const char *myisam_stats_method_names[];
extern ulong total_ha, total_ha_2pc;
/* Wrapper functions */
@@ -2080,7 +2076,6 @@ extern "C" int ha_init_key_cache(const char *name, KEY_CACHE *key_cache);
int ha_resize_key_cache(KEY_CACHE *key_cache);
int ha_change_key_cache_param(KEY_CACHE *key_cache);
int ha_change_key_cache(KEY_CACHE *old_key_cache, KEY_CACHE *new_key_cache);
-int ha_end_key_cache(KEY_CACHE *key_cache);
/* report to InnoDB that control passes to the client */
int ha_release_temporary_latches(THD *thd);
diff --git a/sql/item.cc b/sql/item.cc
index f4b2e549667..8168316b187 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -975,7 +975,7 @@ int Item::save_in_field_no_warnings(Field *field, bool no_conversions)
THD *thd= table->in_use;
enum_check_fields tmp= thd->count_cuted_fields;
my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->write_set);
- ulong sql_mode= thd->variables.sql_mode;
+ ulonglong sql_mode= thd->variables.sql_mode;
thd->variables.sql_mode&= ~(MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE);
thd->count_cuted_fields= CHECK_FIELD_IGNORE;
res= save_in_field(field, no_conversions);
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index ec50e6c5708..1da383ce3e9 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -404,7 +404,7 @@ static bool convert_constant_item(THD *thd, Item_field *field_item,
if (!(*item)->with_subselect && (*item)->const_item())
{
TABLE *table= field->table;
- ulong orig_sql_mode= thd->variables.sql_mode;
+ ulonglong orig_sql_mode= thd->variables.sql_mode;
enum_check_fields orig_count_cuted_fields= thd->count_cuted_fields;
my_bitmap_map *old_maps[2];
ulonglong UNINIT_VAR(orig_field_val); /* original field value if valid */
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 6f14e69e101..ec0f76717fd 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -37,6 +37,7 @@
#include "sp_head.h"
#include "sp_rcontext.h"
#include "sp.h"
+#include "set_var.h"
#ifdef NO_EMBEDDED_ACCESS_CHECKS
#define sp_restore_security_context(A,B) while (0) {}
@@ -4984,7 +4985,7 @@ void Item_func_get_system_var::fix_length_and_dec()
if (var_type != OPT_DEFAULT)
{
my_error(ER_INCORRECT_GLOBAL_LOCAL_VAR, MYF(0),
- var->name, var_type == OPT_GLOBAL ? "SESSION" : "GLOBAL");
+ var->name.str, var_type == OPT_GLOBAL ? "SESSION" : "GLOBAL");
return;
}
/* As there was no local variable, return the global value */
@@ -5001,22 +5002,38 @@ void Item_func_get_system_var::fix_length_and_dec()
decimals=0;
break;
case SHOW_LONGLONG:
- unsigned_flag= FALSE;
+ unsigned_flag= TRUE;
max_length= MY_INT64_NUM_DECIMAL_DIGITS;
decimals=0;
break;
case SHOW_CHAR:
case SHOW_CHAR_PTR:
pthread_mutex_lock(&LOCK_global_system_variables);
- cptr= var->show_type() == SHOW_CHAR_PTR ?
- *(char**) var->value_ptr(current_thd, var_type, &component) :
- (char*) var->value_ptr(current_thd, var_type, &component);
+ cptr= var->show_type() == SHOW_CHAR ?
+ (char*) var->value_ptr(current_thd, var_type, &component) :
+ *(char**) var->value_ptr(current_thd, var_type, &component);
if (cptr)
- max_length= strlen(cptr) * system_charset_info->mbmaxlen;
+ max_length= system_charset_info->cset->numchars(system_charset_info,
+ cptr,
+ cptr + strlen(cptr));
pthread_mutex_unlock(&LOCK_global_system_variables);
collation.set(system_charset_info, DERIVATION_SYSCONST);
+ max_length*= system_charset_info->mbmaxlen;
decimals=NOT_FIXED_DEC;
break;
+ case SHOW_LEX_STRING:
+ {
+ pthread_mutex_lock(&LOCK_global_system_variables);
+ LEX_STRING *ls= ((LEX_STRING*)var->value_ptr(current_thd, var_type, &component));
+ max_length= system_charset_info->cset->numchars(system_charset_info,
+ ls->str,
+ ls->str + ls->length);
+ pthread_mutex_unlock(&LOCK_global_system_variables);
+ collation.set(system_charset_info, DERIVATION_SYSCONST);
+ max_length*= system_charset_info->mbmaxlen;
+ decimals=NOT_FIXED_DEC;
+ }
+ break;
case SHOW_BOOL:
case SHOW_MY_BOOL:
unsigned_flag= FALSE;
@@ -5029,7 +5046,7 @@ void Item_func_get_system_var::fix_length_and_dec()
max_length= DBL_DIG + 6;
break;
default:
- my_error(ER_VAR_CANT_BE_READ, MYF(0), var->name);
+ my_error(ER_VAR_CANT_BE_READ, MYF(0), var->name.str);
break;
}
}
@@ -5054,11 +5071,12 @@ enum Item_result Item_func_get_system_var::result_type() const
return INT_RESULT;
case SHOW_CHAR:
case SHOW_CHAR_PTR:
+ case SHOW_LEX_STRING:
return STRING_RESULT;
case SHOW_DOUBLE:
return REAL_RESULT;
default:
- my_error(ER_VAR_CANT_BE_READ, MYF(0), var->name);
+ my_error(ER_VAR_CANT_BE_READ, MYF(0), var->name.str);
return STRING_RESULT; // keep the compiler happy
}
}
@@ -5077,11 +5095,12 @@ enum_field_types Item_func_get_system_var::field_type() const
return MYSQL_TYPE_LONGLONG;
case SHOW_CHAR:
case SHOW_CHAR_PTR:
+ case SHOW_LEX_STRING:
return MYSQL_TYPE_VARCHAR;
case SHOW_DOUBLE:
return MYSQL_TYPE_DOUBLE;
default:
- my_error(ER_VAR_CANT_BE_READ, MYF(0), var->name);
+ my_error(ER_VAR_CANT_BE_READ, MYF(0), var->name.str);
return MYSQL_TYPE_VARCHAR; // keep the compiler happy
}
}
@@ -5142,7 +5161,7 @@ longlong Item_func_get_system_var::val_int()
{
case SHOW_INT: get_sys_var_safe (uint);
case SHOW_LONG: get_sys_var_safe (ulong);
- case SHOW_LONGLONG: get_sys_var_safe (longlong);
+ case SHOW_LONGLONG: get_sys_var_safe (ulonglong);
case SHOW_HA_ROWS: get_sys_var_safe (ha_rows);
case SHOW_BOOL: get_sys_var_safe (bool);
case SHOW_MY_BOOL: get_sys_var_safe (my_bool);
@@ -5157,6 +5176,7 @@ longlong Item_func_get_system_var::val_int()
}
case SHOW_CHAR:
case SHOW_CHAR_PTR:
+ case SHOW_LEX_STRING:
{
String *str_val= val_str(NULL);
@@ -5176,7 +5196,7 @@ longlong Item_func_get_system_var::val_int()
}
default:
- my_error(ER_VAR_CANT_BE_READ, MYF(0), var->name);
+ my_error(ER_VAR_CANT_BE_READ, MYF(0), var->name.str);
return 0; // keep the compiler happy
}
}
@@ -5216,14 +5236,18 @@ String* Item_func_get_system_var::val_str(String* str)
{
case SHOW_CHAR:
case SHOW_CHAR_PTR:
+ case SHOW_LEX_STRING:
{
pthread_mutex_lock(&LOCK_global_system_variables);
- char *cptr= var->show_type() == SHOW_CHAR_PTR ?
- *(char**) var->value_ptr(thd, var_type, &component) :
- (char*) var->value_ptr(thd, var_type, &component);
+ char *cptr= var->show_type() == SHOW_CHAR ?
+ (char*) var->value_ptr(thd, var_type, &component) :
+ *(char**) var->value_ptr(thd, var_type, &component);
if (cptr)
{
- if (str->copy(cptr, strlen(cptr), collation.collation))
+ size_t len= var->show_type() == SHOW_LEX_STRING ?
+ ((LEX_STRING*)(var->value_ptr(thd, var_type, &component)))->length :
+ strlen(cptr);
+ if (str->copy(cptr, len, collation.collation))
{
null_value= TRUE;
str= NULL;
@@ -5251,7 +5275,7 @@ String* Item_func_get_system_var::val_str(String* str)
break;
default:
- my_error(ER_VAR_CANT_BE_READ, MYF(0), var->name);
+ my_error(ER_VAR_CANT_BE_READ, MYF(0), var->name.str);
str= NULL;
break;
}
@@ -5309,12 +5333,11 @@ double Item_func_get_system_var::val_real()
cache_present|= GET_SYS_VAR_CACHE_DOUBLE;
return cached_dval;
case SHOW_CHAR:
+ case SHOW_LEX_STRING:
case SHOW_CHAR_PTR:
{
- char *cptr;
-
pthread_mutex_lock(&LOCK_global_system_variables);
- cptr= var->show_type() == SHOW_CHAR ?
+ char *cptr= var->show_type() == SHOW_CHAR ?
(char*) var->value_ptr(thd, var_type, &component) :
*(char**) var->value_ptr(thd, var_type, &component);
if (cptr)
@@ -5343,7 +5366,7 @@ double Item_func_get_system_var::val_real()
cached_null_value= null_value;
return cached_dval;
default:
- my_error(ER_VAR_CANT_BE_READ, MYF(0), var->name);
+ my_error(ER_VAR_CANT_BE_READ, MYF(0), var->name.str);
return 0;
}
}
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 831f0287266..c33088e0276 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -778,8 +778,8 @@ bool Aggregator_distinct::setup(THD *thd)
}
if (!(table= create_tmp_table(thd, tmp_table_param, list, (ORDER*) 0, 1,
0,
- (select_lex->options | thd->options),
- HA_POS_ERROR, (char*)"")))
+ (select_lex->options | thd->variables.option_bits),
+ HA_POS_ERROR, "")))
return TRUE;
table->file->extra(HA_EXTRA_NO_ROWS); // Don't update rows
table->no_rows=1;
@@ -3324,7 +3324,7 @@ bool Item_func_group_concat::setup(THD *thd)
*/
if (!(table= create_tmp_table(thd, tmp_table_param, all_fields,
(ORDER*) 0, 0, TRUE,
- (select_lex->options | thd->options),
+ (select_lex->options | thd->variables.option_bits),
HA_POS_ERROR, (char*) "")))
DBUG_RETURN(TRUE);
table->file->extra(HA_EXTRA_NO_ROWS);
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h
index f6c316c15c6..860bd983184 100644
--- a/sql/item_timefunc.h
+++ b/sql/item_timefunc.h
@@ -96,7 +96,7 @@ public:
{
int *input_version= (int*)int_arg;
/* This function was introduced in 5.5 */
- int output_version= (*input_version, 50500);
+ int output_version= max(*input_version, 50500);
*input_version= output_version;
return 0;
}
diff --git a/sql/keycaches.cc b/sql/keycaches.cc
new file mode 100644
index 00000000000..d68e2bccd96
--- /dev/null
+++ b/sql/keycaches.cc
@@ -0,0 +1,163 @@
+/* Copyright (C) 2002-2006 MySQL AB, 2009 Sun Microsystems, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#include "keycaches.h"
+
+/****************************************************************************
+ Named list handling
+****************************************************************************/
+
+NAMED_ILIST key_caches;
+
+/**
+ ilink (intrusive list element) with a name
+*/
+class NAMED_ILINK :public ilink
+{
+public:
+ const char *name;
+ uint name_length;
+ uchar* data;
+
+ NAMED_ILINK(I_List<NAMED_ILINK> *links, const char *name_arg,
+ uint name_length_arg, uchar* data_arg)
+ :name_length(name_length_arg), data(data_arg)
+ {
+ name= my_strndup(name_arg, name_length, MYF(MY_WME));
+ links->push_back(this);
+ }
+ inline bool cmp(const char *name_cmp, uint length)
+ {
+ return length == name_length && !memcmp(name, name_cmp, length);
+ }
+ ~NAMED_ILINK()
+ {
+ my_free((uchar*) name, MYF(0));
+ }
+};
+
+uchar* find_named(I_List<NAMED_ILINK> *list, const char *name, uint length,
+ NAMED_ILINK **found)
+{
+ I_List_iterator<NAMED_ILINK> it(*list);
+ NAMED_ILINK *element;
+ while ((element= it++))
+ {
+ if (element->cmp(name, length))
+ {
+ if (found)
+ *found= element;
+ return element->data;
+ }
+ }
+ return 0;
+}
+
+
+void NAMED_ILIST::delete_elements(void (*free_element)(const char *name, uchar*))
+{
+ NAMED_ILINK *element;
+ DBUG_ENTER("NAMED_ILIST::delete_elements");
+ while ((element= get()))
+ {
+ (*free_element)(element->name, element->data);
+ delete element;
+ }
+ DBUG_VOID_RETURN;
+}
+
+
+/* Key cache functions */
+
+LEX_STRING default_key_cache_base= {C_STRING_WITH_LEN("default")};
+
+KEY_CACHE zero_key_cache; ///< @@nonexistent_cache.param->value_ptr() points here
+
+KEY_CACHE *get_key_cache(LEX_STRING *cache_name)
+{
+ if (!cache_name || ! cache_name->length)
+ cache_name= &default_key_cache_base;
+ return ((KEY_CACHE*) find_named(&key_caches,
+ cache_name->str, cache_name->length, 0));
+}
+
+KEY_CACHE *create_key_cache(const char *name, uint length)
+{
+ KEY_CACHE *key_cache;
+ DBUG_ENTER("create_key_cache");
+ DBUG_PRINT("enter",("name: %.*s", length, name));
+
+ if ((key_cache= (KEY_CACHE*) my_malloc(sizeof(KEY_CACHE),
+ MYF(MY_ZEROFILL | MY_WME))))
+ {
+ if (!new NAMED_ILINK(&key_caches, name, length, (uchar*) key_cache))
+ {
+ my_free((char*) key_cache, MYF(0));
+ key_cache= 0;
+ }
+ else
+ {
+ /*
+ Set default values for a key cache
+ The values in dflt_key_cache_var is set by my_getopt() at startup
+
+ We don't set 'buff_size' as this is used to enable the key cache
+ */
+ key_cache->param_block_size= dflt_key_cache_var.param_block_size;
+ key_cache->param_division_limit= dflt_key_cache_var.param_division_limit;
+ key_cache->param_age_threshold= dflt_key_cache_var.param_age_threshold;
+ }
+ }
+ DBUG_RETURN(key_cache);
+}
+
+
+KEY_CACHE *get_or_create_key_cache(const char *name, uint length)
+{
+ LEX_STRING key_cache_name;
+ KEY_CACHE *key_cache;
+
+ key_cache_name.str= (char *) name;
+ key_cache_name.length= length;
+ if (!(key_cache= get_key_cache(&key_cache_name)))
+ key_cache= create_key_cache(name, length);
+ return key_cache;
+}
+
+
+void free_key_cache(const char *name, KEY_CACHE *key_cache)
+{
+ end_key_cache(key_cache, 1); // Can never fail
+ my_free((char*) key_cache, MYF(0));
+}
+
+
+bool process_key_caches(process_key_cache_t func)
+{
+ I_List_iterator<NAMED_ILINK> it(key_caches);
+ NAMED_ILINK *element;
+
+ while ((element= it++))
+ {
+ KEY_CACHE *key_cache= (KEY_CACHE *) element->data;
+ func(element->name, key_cache);
+ }
+ return 0;
+}
+
+#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
+template class I_List_iterator<NAMED_ILINK>;
+#endif
+
diff --git a/sql/keycaches.h b/sql/keycaches.h
new file mode 100644
index 00000000000..542a4d14c3d
--- /dev/null
+++ b/sql/keycaches.h
@@ -0,0 +1,41 @@
+/* Copyright (C) 2002-2006 MySQL AB, 2009 Sun Microsystems, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#include "sql_list.h"
+#include <keycache.h>
+
+extern "C"
+{
+ typedef int (*process_key_cache_t) (const char *, KEY_CACHE *);
+}
+
+class NAMED_ILINK;
+
+class NAMED_ILIST: public I_List<NAMED_ILINK>
+{
+ public:
+ void delete_elements(void (*free_element)(const char*, uchar*));
+};
+
+extern LEX_STRING default_key_cache_base;
+extern KEY_CACHE zero_key_cache;
+extern NAMED_ILIST key_caches;
+
+KEY_CACHE *create_key_cache(const char *name, uint length);
+KEY_CACHE *get_key_cache(LEX_STRING *cache_name);
+KEY_CACHE *get_or_create_key_cache(const char *name, uint length);
+void free_key_cache(const char *name, KEY_CACHE *key_cache);
+bool process_key_caches(process_key_cache_t func);
+
diff --git a/sql/log.cc b/sql/log.cc
index fb990d60186..74239555c88 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -138,18 +138,22 @@ sql_print_message_func sql_print_message_handlers[3] =
sql_print_error
};
-
/**
- Create the name of the default general log file
-
+ Create the name of the log specified.
+
+ This method forms a new path + file name for the
+ log specified in @c name.
+
@param[IN] buff Location for building new string.
- @param[IN] log_ext The extension for the file (e.g .log)
- @returns Pointer to a new string containing the name
+ @param[IN] name Name of the log file.
+ @param[IN] log_ext The extension for the log (e.g. .log).
+
+ @returns Pointer to new string containing the name.
*/
-char *make_default_log_name(char *buff,const char* log_ext)
+char *make_log_name(char *buff, const char *name, const char* log_ext)
{
- strmake(buff, default_logfile_name, FN_REFLEN-5);
- return fn_format(buff, buff, mysql_data_home, log_ext,
+ strmake(buff, name, FN_REFLEN-5);
+ return fn_format(buff, buff, mysql_real_data_home, log_ext,
MYF(MY_UNPACK_FILENAME|MY_REPLACE_EXT));
}
@@ -420,8 +424,8 @@ bool Log_to_csv_event_handler::
*/
save_time_zone_used= thd->time_zone_used;
- save_thd_options= thd->options;
- thd->options&= ~OPTION_BIN_LOG;
+ save_thd_options= thd->variables.option_bits;
+ thd->variables.option_bits&= ~OPTION_BIN_LOG;
bzero(& table_list, sizeof(TABLE_LIST));
table_list.alias= table_list.table_name= GENERAL_LOG_NAME.str;
@@ -529,7 +533,7 @@ err:
if (need_close)
close_performance_schema_table(thd, & open_tables_backup);
- thd->options= save_thd_options;
+ thd->variables.option_bits= save_thd_options;
thd->time_zone_used= save_time_zone_used;
return result;
}
@@ -838,10 +842,10 @@ bool Log_to_file_event_handler::init()
if (!is_initialized)
{
if (opt_slow_log)
- mysql_slow_log.open_slow_log(sys_var_slow_log_path.value);
+ mysql_slow_log.open_slow_log(opt_slow_logname);
if (opt_log)
- mysql_log.open_query_log(sys_var_general_log_path.value);
+ mysql_log.open_query_log(opt_logname);
is_initialized= TRUE;
}
@@ -1202,7 +1206,7 @@ bool LOGGER::activate_log_handler(THD* thd, uint log_type)
{
file_log= file_log_handler->get_mysql_slow_log();
- file_log->open_slow_log(sys_var_slow_log_path.value);
+ file_log->open_slow_log(opt_slow_logname);
if (table_log_handler->activate_log(thd, QUERY_LOG_SLOW))
{
/* Error printed by open table in activate_log() */
@@ -1221,7 +1225,7 @@ bool LOGGER::activate_log_handler(THD* thd, uint log_type)
{
file_log= file_log_handler->get_mysql_log();
- file_log->open_query_log(sys_var_general_log_path.value);
+ file_log->open_query_log(opt_logname);
if (table_log_handler->activate_log(thd, QUERY_LOG_GENERAL))
{
/* Error printed by open table in activate_log() */
@@ -1454,8 +1458,8 @@ binlog_end_trans(THD *thd, binlog_trx_data *trx_data,
DBUG_PRINT("enter", ("transaction: %s end_ev: 0x%lx",
all ? "all" : "stmt", (long) end_ev));
DBUG_PRINT("info", ("thd->options={ %s%s}",
- FLAGSTR(thd->options, OPTION_NOT_AUTOCOMMIT),
- FLAGSTR(thd->options, OPTION_BEGIN)));
+ FLAGSTR(thd->variables.option_bits, OPTION_NOT_AUTOCOMMIT),
+ FLAGSTR(thd->variables.option_bits, OPTION_BEGIN)));
/*
NULL denotes ROLLBACK with nothing to replicate: i.e., rollback of
@@ -1503,7 +1507,7 @@ binlog_end_trans(THD *thd, binlog_trx_data *trx_data,
transaction cache to remove the statement.
*/
thd->binlog_remove_pending_rows_event(TRUE);
- if (all || !(thd->options & (OPTION_BEGIN | OPTION_NOT_AUTOCOMMIT)))
+ if (all || !(thd->variables.option_bits & (OPTION_BEGIN | OPTION_NOT_AUTOCOMMIT)))
{
if (trx_data->has_incident())
error= mysql_bin_log.write_incident(thd, TRUE);
@@ -1572,7 +1576,7 @@ static int binlog_commit(handlerton *hton, THD *thd, bool all)
Otherwise, we accumulate the statement
*/
ulonglong const in_transaction=
- thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN);
+ thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN);
DBUG_PRINT("debug",
("all: %d, empty: %s, in_transaction: %s, all.modified_non_trans_table: %s, stmt.modified_non_trans_table: %s",
all,
@@ -1647,7 +1651,7 @@ static int binlog_rollback(handlerton *hton, THD *thd, bool all)
back.
*/
if ((thd->transaction.stmt.modified_non_trans_table ||
- (thd->options & OPTION_KEEP_LOG)) &&
+ (thd->variables.option_bits & OPTION_KEEP_LOG)) &&
mysql_bin_log.check_write_error(thd))
trx_data->set_incident();
error= binlog_end_trans(thd, trx_data, 0, all);
@@ -1664,11 +1668,11 @@ static int binlog_rollback(handlerton *hton, THD *thd, bool all)
*/
if ((all && thd->transaction.all.modified_non_trans_table) ||
(!all && thd->transaction.stmt.modified_non_trans_table &&
- !(thd->options & (OPTION_BEGIN | OPTION_NOT_AUTOCOMMIT))) ||
+ !(thd->variables.option_bits & (OPTION_BEGIN | OPTION_NOT_AUTOCOMMIT))) ||
(!all && thd->transaction.stmt.modified_non_trans_table &&
!trx_data->at_least_one_stmt_committed &&
thd->current_stmt_binlog_row_based) ||
- ((thd->options & OPTION_KEEP_LOG)))
+ ((thd->variables.option_bits & OPTION_KEEP_LOG)))
{
Query_log_event qev(thd, STRING_WITH_LEN("ROLLBACK"), TRUE, TRUE, 0);
error= binlog_end_trans(thd, trx_data, &qev, all);
@@ -1772,7 +1776,7 @@ static int binlog_savepoint_rollback(handlerton *hton, THD *thd, void *sv)
from the SAVEPOINT command.
*/
if (unlikely(thd->transaction.all.modified_non_trans_table ||
- (thd->options & OPTION_KEEP_LOG)))
+ (thd->variables.option_bits & OPTION_KEEP_LOG)))
{
int errcode= query_error_code(thd, thd->killed == THD::NOT_KILLED);
int error=
@@ -1948,7 +1952,7 @@ updating the index files.", max_found);
*/
if (((strlen(ext_buf) + (end - name)) >= FN_REFLEN))
{
- sql_print_error("Log filename too large: %s%s (%lu). \
+ sql_print_error("Log filename too large: %s%s (%zu). \
Please fix this by archiving old logs and updating the \
index files.", name, ext_buf, (strlen(ext_buf) + (end - name)));
error= 1;
@@ -4118,7 +4122,7 @@ THD::binlog_start_trans_and_stmt()
trx_data->before_stmt_pos == MY_OFF_T_UNDEF)
{
this->binlog_set_stmt_begin();
- if (options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))
+ if (variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))
trans_register_ha(this, TRUE, binlog_hton);
trans_register_ha(this, FALSE, binlog_hton);
/*
@@ -4380,7 +4384,7 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info)
binlog_[wild_]{do|ignore}_table?" (WL#1049)"
*/
const char *local_db= event_info->get_db();
- if ((thd && !(thd->options & OPTION_BIN_LOG)) ||
+ if ((thd && !(thd->variables.option_bits & OPTION_BIN_LOG)) ||
(!binlog_filter->db_ok(local_db)))
{
pthread_mutex_unlock(&LOCK_log);
@@ -4549,7 +4553,7 @@ bool LOGGER::log_command(THD *thd, enum enum_server_command command)
*/
if (*general_log_handler_list && (what_to_log & (1L << (uint) command)))
{
- if ((thd->options & OPTION_LOG_OFF)
+ if ((thd->variables.option_bits & OPTION_LOG_OFF)
#ifndef NO_EMBEDDED_ACCESS_CHECKS
&& (sctx->master_access & SUPER_ACL)
#endif
diff --git a/sql/log.h b/sql/log.h
index fa24a2c5803..847fa3db6f9 100644
--- a/sql/log.h
+++ b/sql/log.h
@@ -608,13 +608,13 @@ public:
void init_general_log(uint general_log_printer);
void deactivate_log_handler(THD* thd, uint log_type);
bool activate_log_handler(THD* thd, uint log_type);
- MYSQL_QUERY_LOG *get_slow_log_file_handler()
+ MYSQL_QUERY_LOG *get_slow_log_file_handler() const
{
if (file_log_handler)
return file_log_handler->get_mysql_slow_log();
return NULL;
}
- MYSQL_QUERY_LOG *get_log_file_handler()
+ MYSQL_QUERY_LOG *get_log_file_handler() const
{
if (file_log_handler)
return file_log_handler->get_mysql_log();
@@ -623,19 +623,10 @@ public:
};
enum enum_binlog_format {
- /*
- statement-based except for cases where only row-based can work (UUID()
- etc):
- */
- BINLOG_FORMAT_MIXED= 0,
- BINLOG_FORMAT_STMT= 1, // statement-based
- BINLOG_FORMAT_ROW= 2, // row_based
-/*
- This value is last, after the end of binlog_format_typelib: it has no
- corresponding cell in this typelib. We use this value to be able to know if
- the user has explicitely specified a binlog format at startup or not.
-*/
- BINLOG_FORMAT_UNSPEC= 3
+ BINLOG_FORMAT_MIXED= 0, ///< statement if safe, otherwise row - autodetected
+ BINLOG_FORMAT_STMT= 1, ///< statement-based
+ BINLOG_FORMAT_ROW= 2, ///< row-based
+ BINLOG_FORMAT_UNSPEC=3 ///< thd_binlog_format() returns it when binlog is closed
};
extern TYPELIB binlog_format_typelib;
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 9cfa6cf1540..fa5a78917ef 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -1200,15 +1200,11 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len,
*/
if (description_event->event_type_permutation)
{
-#ifndef DBUG_OFF
- int new_event_type=
- description_event->event_type_permutation[event_type];
- DBUG_PRINT("info",
- ("converting event type %d to %d (%s)",
- event_type, new_event_type,
- get_type_str((Log_event_type)new_event_type)));
-#endif
- event_type= description_event->event_type_permutation[event_type];
+ int new_event_type= description_event->event_type_permutation[event_type];
+ DBUG_PRINT("info", ("converting event type %d to %d (%s)",
+ event_type, new_event_type,
+ get_type_str((Log_event_type)new_event_type)));
+ event_type= new_event_type;
}
switch(event_type) {
@@ -2415,7 +2411,7 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg,
the autocommit flag as written by the master to the binlog. This
behavior may change after WL#4162 has been implemented.
*/
- flags2= (uint32) (thd_arg->options &
+ flags2= (uint32) (thd_arg->variables.option_bits &
(OPTIONS_WRITTEN_TO_BIN_LOG & ~OPTION_NOT_AUTOCOMMIT));
DBUG_ASSERT(thd_arg->variables.character_set_client->number < 256*256);
DBUG_ASSERT(thd_arg->variables.collation_connection->number < 256*256);
@@ -3064,13 +3060,13 @@ int Query_log_event::do_apply_event(Relay_log_info const *rli,
{
if (flags2_inited)
/*
- all bits of thd->options which are 1 in OPTIONS_WRITTEN_TO_BIN_LOG
+ all bits of thd->variables.option_bits which are 1 in OPTIONS_WRITTEN_TO_BIN_LOG
must take their value from flags2.
*/
- thd->options= flags2|(thd->options & ~OPTIONS_WRITTEN_TO_BIN_LOG);
+ thd->variables.option_bits= flags2|(thd->variables.option_bits & ~OPTIONS_WRITTEN_TO_BIN_LOG);
/*
else, we are in a 3.23/4.0 binlog; we previously received a
- Rotate_log_event which reset thd->options and sql_mode etc, so
+ Rotate_log_event which reset thd->variables.option_bits and sql_mode etc, so
nothing to do.
*/
/*
@@ -3347,13 +3343,13 @@ Query_log_event::do_shall_skip(Relay_log_info *rli)
{
if (strcmp("BEGIN", query) == 0)
{
- thd->options|= OPTION_BEGIN;
+ thd->variables.option_bits|= OPTION_BEGIN;
DBUG_RETURN(Log_event::continue_group(rli));
}
if (strcmp("COMMIT", query) == 0 || strcmp("ROLLBACK", query) == 0)
{
- thd->options&= ~OPTION_BEGIN;
+ thd->variables.option_bits&= ~OPTION_BEGIN;
DBUG_RETURN(Log_event::EVENT_SKIP_COUNT);
}
}
@@ -3609,8 +3605,7 @@ Format_description_log_event(uint8 binlog_ver, const char* server_ver)
#ifndef DBUG_OFF
// Allows us to sanity-check that all events initialized their
// events (see the end of this 'if' block).
- memset(post_header_len, 255,
- number_of_event_types*sizeof(uint8));
+ memset(post_header_len, 255, number_of_event_types*sizeof(uint8));
#endif
/* Note: all event types must explicitly fill in their lengths here. */
@@ -4953,7 +4948,7 @@ int Rotate_log_event::do_update_pos(Relay_log_info *rli)
flush_relay_log_info(rli);
/*
- Reset thd->options and sql_mode etc, because this could be the signal of
+ Reset thd->variables.option_bits and sql_mode etc, because this could be the signal of
a master's downgrade from 5.0 to 4.0.
However, no need to reset description_event_for_exec: indeed, if the next
master is 5.0 (even 5.0.1) we will soon get a Format_desc; if the next
@@ -5323,7 +5318,7 @@ Xid_log_event::do_shall_skip(Relay_log_info *rli)
{
DBUG_ENTER("Xid_log_event::do_shall_skip");
if (rli->slave_skip_counter > 0) {
- thd->options&= ~OPTION_BEGIN;
+ thd->variables.option_bits&= ~OPTION_BEGIN;
DBUG_RETURN(Log_event::EVENT_SKIP_COUNT);
}
DBUG_RETURN(Log_event::do_shall_skip(rli));
@@ -5924,7 +5919,7 @@ int Stop_log_event::do_update_pos(Relay_log_info *rli)
could give false triggers in MASTER_POS_WAIT() that we have reached
the target position when in fact we have not.
*/
- if (thd->options & OPTION_BEGIN)
+ if (thd->variables.option_bits & OPTION_BEGIN)
rli->inc_event_relay_log_pos();
else
{
@@ -6991,9 +6986,9 @@ Rows_log_event::Rows_log_event(THD *thd_arg, TABLE *tbl_arg, ulong tid,
DBUG_ASSERT((tbl_arg && tbl_arg->s && tid != ~0UL) ||
(!tbl_arg && !cols && tid == ~0UL));
- if (thd_arg->options & OPTION_NO_FOREIGN_KEY_CHECKS)
+ if (thd_arg->variables.option_bits & OPTION_NO_FOREIGN_KEY_CHECKS)
set_flags(NO_FOREIGN_KEY_CHECKS_F);
- if (thd_arg->options & OPTION_RELAXED_UNIQUE_CHECKS)
+ if (thd_arg->variables.option_bits & OPTION_RELAXED_UNIQUE_CHECKS)
set_flags(RELAXED_UNIQUE_CHECKS_F);
/* if bitmap_init fails, caught in is_valid() */
if (likely(!bitmap_init(&m_cols,
@@ -7282,7 +7277,7 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli)
STMT_END_F or next error.
*/
if (!thd->current_stmt_binlog_row_based &&
- mysql_bin_log.is_open() && (thd->options & OPTION_BIN_LOG))
+ mysql_bin_log.is_open() && (thd->variables.option_bits & OPTION_BIN_LOG))
{
thd->set_current_stmt_binlog_row_based();
}
@@ -7294,16 +7289,16 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli)
the event.
*/
if (get_flags(NO_FOREIGN_KEY_CHECKS_F))
- thd->options|= OPTION_NO_FOREIGN_KEY_CHECKS;
+ thd->variables.option_bits|= OPTION_NO_FOREIGN_KEY_CHECKS;
else
- thd->options&= ~OPTION_NO_FOREIGN_KEY_CHECKS;
+ thd->variables.option_bits&= ~OPTION_NO_FOREIGN_KEY_CHECKS;
if (get_flags(RELAXED_UNIQUE_CHECKS_F))
- thd->options|= OPTION_RELAXED_UNIQUE_CHECKS;
+ thd->variables.option_bits|= OPTION_RELAXED_UNIQUE_CHECKS;
else
- thd->options&= ~OPTION_RELAXED_UNIQUE_CHECKS;
+ thd->variables.option_bits&= ~OPTION_RELAXED_UNIQUE_CHECKS;
/* A small test to verify that objects have consistent types */
- DBUG_ASSERT(sizeof(thd->options) == sizeof(OPTION_RELAXED_UNIQUE_CHECKS));
+ DBUG_ASSERT(sizeof(thd->variables.option_bits) == sizeof(OPTION_RELAXED_UNIQUE_CHECKS));
if (simple_open_n_lock_tables(thd, rli->tables_to_lock))
{
@@ -7457,8 +7452,7 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli)
{
int actual_error= convert_handler_error(error, thd, table);
bool idempotent_error= (idempotent_error_code(error) &&
- ((bit_is_set(slave_exec_mode,
- SLAVE_EXEC_MODE_IDEMPOTENT)) == 1));
+ (slave_exec_mode == SLAVE_EXEC_MODE_IDEMPOTENT));
bool ignored_error= (idempotent_error == 0 ?
ignored_error_code(actual_error) : 0);
@@ -7526,7 +7520,7 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli)
if (!cache_stmt)
{
DBUG_PRINT("info", ("Marked that we need to keep log"));
- thd->options|= OPTION_KEEP_LOG;
+ thd->variables.option_bits|= OPTION_KEEP_LOG;
}
} // if (table)
@@ -8270,8 +8264,8 @@ Write_rows_log_event::do_before_row_operations(const Slave_reporting_capability
todo: to introduce a property for the event (handler?) which forces
applying the event in the replace (idempotent) fashion.
*/
- if (bit_is_set(slave_exec_mode, SLAVE_EXEC_MODE_IDEMPOTENT) == 1 ||
- m_table->s->db_type()->db_type == DB_TYPE_NDBCLUSTER)
+ if ((slave_exec_mode == SLAVE_EXEC_MODE_IDEMPOTENT) ||
+ (m_table->s->db_type()->db_type == DB_TYPE_NDBCLUSTER))
{
/*
We are using REPLACE semantics and not INSERT IGNORE semantics
@@ -8349,7 +8343,7 @@ Write_rows_log_event::do_after_row_operations(const Slave_reporting_capability *
int local_error= 0;
m_table->next_number_field=0;
m_table->auto_increment_field_not_null= FALSE;
- if (bit_is_set(slave_exec_mode, SLAVE_EXEC_MODE_IDEMPOTENT) == 1 ||
+ if ((slave_exec_mode == SLAVE_EXEC_MODE_IDEMPOTENT) ||
m_table->s->db_type()->db_type == DB_TYPE_NDBCLUSTER)
{
m_table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
@@ -8650,9 +8644,7 @@ int
Write_rows_log_event::do_exec_row(const Relay_log_info *const rli)
{
DBUG_ASSERT(m_table != NULL);
- int error=
- write_row(rli, /* if 1 then overwrite */
- bit_is_set(slave_exec_mode, SLAVE_EXEC_MODE_IDEMPOTENT) == 1);
+ int error= write_row(rli, slave_exec_mode == SLAVE_EXEC_MODE_IDEMPOTENT);
if (error && !thd->is_error())
{
diff --git a/sql/log_event_old.cc b/sql/log_event_old.cc
index 72affd2bee9..3ebd4b1864a 100644
--- a/sql/log_event_old.cc
+++ b/sql/log_event_old.cc
@@ -71,7 +71,7 @@ Old_rows_log_event::do_apply_event(Old_rows_log_event *ev, const Relay_log_info
STMT_END_F or next error.
*/
if (!thd->current_stmt_binlog_row_based &&
- mysql_bin_log.is_open() && (thd->options & OPTION_BIN_LOG))
+ mysql_bin_log.is_open() && (thd->variables.option_bits & OPTION_BIN_LOG))
{
thd->set_current_stmt_binlog_row_based();
}
@@ -166,16 +166,16 @@ Old_rows_log_event::do_apply_event(Old_rows_log_event *ev, const Relay_log_info
the event.
*/
if (ev->get_flags(Old_rows_log_event::NO_FOREIGN_KEY_CHECKS_F))
- thd->options|= OPTION_NO_FOREIGN_KEY_CHECKS;
+ thd->variables.option_bits|= OPTION_NO_FOREIGN_KEY_CHECKS;
else
- thd->options&= ~OPTION_NO_FOREIGN_KEY_CHECKS;
+ thd->variables.option_bits&= ~OPTION_NO_FOREIGN_KEY_CHECKS;
if (ev->get_flags(Old_rows_log_event::RELAXED_UNIQUE_CHECKS_F))
- thd->options|= OPTION_RELAXED_UNIQUE_CHECKS;
+ thd->variables.option_bits|= OPTION_RELAXED_UNIQUE_CHECKS;
else
- thd->options&= ~OPTION_RELAXED_UNIQUE_CHECKS;
+ thd->variables.option_bits&= ~OPTION_RELAXED_UNIQUE_CHECKS;
/* A small test to verify that objects have consistent types */
- DBUG_ASSERT(sizeof(thd->options) == sizeof(OPTION_RELAXED_UNIQUE_CHECKS));
+ DBUG_ASSERT(sizeof(thd->variables.option_bits) == sizeof(OPTION_RELAXED_UNIQUE_CHECKS));
/*
Now we are in a statement and will stay in a statement until we
@@ -232,7 +232,7 @@ Old_rows_log_event::do_apply_event(Old_rows_log_event *ev, const Relay_log_info
if (!ev->cache_stmt)
{
DBUG_PRINT("info", ("Marked that we need to keep log"));
- thd->options|= OPTION_KEEP_LOG;
+ thd->variables.option_bits|= OPTION_KEEP_LOG;
}
}
@@ -1220,9 +1220,9 @@ Old_rows_log_event::Old_rows_log_event(THD *thd_arg, TABLE *tbl_arg, ulong tid,
DBUG_ASSERT((tbl_arg && tbl_arg->s && tid != ~0UL) ||
(!tbl_arg && !cols && tid == ~0UL));
- if (thd_arg->options & OPTION_NO_FOREIGN_KEY_CHECKS)
+ if (thd_arg->variables.option_bits & OPTION_NO_FOREIGN_KEY_CHECKS)
set_flags(NO_FOREIGN_KEY_CHECKS_F);
- if (thd_arg->options & OPTION_RELAXED_UNIQUE_CHECKS)
+ if (thd_arg->variables.option_bits & OPTION_RELAXED_UNIQUE_CHECKS)
set_flags(RELAXED_UNIQUE_CHECKS_F);
/* if bitmap_init fails, caught in is_valid() */
if (likely(!bitmap_init(&m_cols,
@@ -1619,16 +1619,16 @@ int Old_rows_log_event::do_apply_event(Relay_log_info const *rli)
the event.
*/
if (get_flags(NO_FOREIGN_KEY_CHECKS_F))
- thd->options|= OPTION_NO_FOREIGN_KEY_CHECKS;
+ thd->variables.option_bits|= OPTION_NO_FOREIGN_KEY_CHECKS;
else
- thd->options&= ~OPTION_NO_FOREIGN_KEY_CHECKS;
+ thd->variables.option_bits&= ~OPTION_NO_FOREIGN_KEY_CHECKS;
if (get_flags(RELAXED_UNIQUE_CHECKS_F))
- thd->options|= OPTION_RELAXED_UNIQUE_CHECKS;
+ thd->variables.option_bits|= OPTION_RELAXED_UNIQUE_CHECKS;
else
- thd->options&= ~OPTION_RELAXED_UNIQUE_CHECKS;
+ thd->variables.option_bits&= ~OPTION_RELAXED_UNIQUE_CHECKS;
/* A small test to verify that objects have consistent types */
- DBUG_ASSERT(sizeof(thd->options) == sizeof(OPTION_RELAXED_UNIQUE_CHECKS));
+ DBUG_ASSERT(sizeof(thd->variables.option_bits) == sizeof(OPTION_RELAXED_UNIQUE_CHECKS));
/*
Now we are in a statement and will stay in a statement until we
@@ -1730,7 +1730,7 @@ int Old_rows_log_event::do_apply_event(Relay_log_info const *rli)
if (!cache_stmt)
{
DBUG_PRINT("info", ("Marked that we need to keep log"));
- thd->options|= OPTION_KEEP_LOG;
+ thd->variables.option_bits|= OPTION_KEEP_LOG;
}
} // if (table)
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index 3ddaf114673..50fbf128660 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -36,7 +36,7 @@
#define SHOW_always_last SHOW_KEY_CACHE_LONG, \
SHOW_KEY_CACHE_LONGLONG, SHOW_LONG_STATUS, SHOW_DOUBLE_STATUS, \
SHOW_HAVE, SHOW_MY_BOOL, SHOW_HA_ROWS, SHOW_SYS, \
- SHOW_LONG_NOFLUSH, SHOW_LONGLONG_STATUS
+ SHOW_LONG_NOFLUSH, SHOW_LONGLONG_STATUS, SHOW_LEX_STRING
#include <my_global.h>
#include <mysql_version.h>
@@ -492,12 +492,6 @@ protected:
#define FLUSH_TIME 0 /**< Don't flush tables */
#define MAX_CONNECT_ERRORS 10 ///< errors before disabling host
-#ifdef __NETWARE__
-#define IF_NETWARE(A,B) A
-#else
-#define IF_NETWARE(A,B) B
-#endif
-
#if defined(__WIN__)
#undef FLUSH_TIME
#define FLUSH_TIME 1800 /**< Flush every half hour */
@@ -522,7 +516,7 @@ protected:
This is included in the server and in the client.
Options for select set by the yacc parser (stored in lex->options).
- XXX:
+ NOTE
log_event.h defines OPTIONS_WRITTEN_TO_BIN_LOG to specify what THD
options list are written into binlog. These options can NOT change their
values, or it will break replication between version.
@@ -536,53 +530,52 @@ protected:
TODO: separate three contexts above, move them to separate bitfields.
*/
-#define SELECT_DISTINCT (ULL(1) << 0) // SELECT, user
-#define SELECT_STRAIGHT_JOIN (ULL(1) << 1) // SELECT, user
-#define SELECT_DESCRIBE (ULL(1) << 2) // SELECT, user
-#define SELECT_SMALL_RESULT (ULL(1) << 3) // SELECT, user
-#define SELECT_BIG_RESULT (ULL(1) << 4) // SELECT, user
-#define OPTION_FOUND_ROWS (ULL(1) << 5) // SELECT, user
-#define OPTION_TO_QUERY_CACHE (ULL(1) << 6) // SELECT, user
-#define SELECT_NO_JOIN_CACHE (ULL(1) << 7) // intern
-#define OPTION_BIG_TABLES (ULL(1) << 8) // THD, user
-#define OPTION_BIG_SELECTS (ULL(1) << 9) // THD, user
-#define OPTION_LOG_OFF (ULL(1) << 10) // THD, user
-#define OPTION_QUOTE_SHOW_CREATE (ULL(1) << 11) // THD, user, unused
-#define TMP_TABLE_ALL_COLUMNS (ULL(1) << 12) // SELECT, intern
-#define OPTION_WARNINGS (ULL(1) << 13) // THD, user
-#define OPTION_AUTO_IS_NULL (ULL(1) << 14) // THD, user, binlog
-#define OPTION_FOUND_COMMENT (ULL(1) << 15) // SELECT, intern, parser
-#define OPTION_SAFE_UPDATES (ULL(1) << 16) // THD, user
-#define OPTION_BUFFER_RESULT (ULL(1) << 17) // SELECT, user
-#define OPTION_BIN_LOG (ULL(1) << 18) // THD, user
-#define OPTION_NOT_AUTOCOMMIT (ULL(1) << 19) // THD, user
-#define OPTION_BEGIN (ULL(1) << 20) // THD, intern
-#define OPTION_TABLE_LOCK (ULL(1) << 21) // THD, intern
-#define OPTION_QUICK (ULL(1) << 22) // SELECT (for DELETE)
-#define OPTION_KEEP_LOG (ULL(1) << 23) // THD, user
+#define SELECT_DISTINCT (1ULL << 0) // SELECT, user
+#define SELECT_STRAIGHT_JOIN (1ULL << 1) // SELECT, user
+#define SELECT_DESCRIBE (1ULL << 2) // SELECT, user
+#define SELECT_SMALL_RESULT (1ULL << 3) // SELECT, user
+#define SELECT_BIG_RESULT (1ULL << 4) // SELECT, user
+#define OPTION_FOUND_ROWS (1ULL << 5) // SELECT, user
+#define OPTION_TO_QUERY_CACHE (1ULL << 6) // SELECT, user
+#define SELECT_NO_JOIN_CACHE (1ULL << 7) // intern
+/** always the opposite of OPTION_NOT_AUTOCOMMIT except when in fix_autocommit() */
+#define OPTION_AUTOCOMMIT (1ULL << 8) // THD, user
+#define OPTION_BIG_SELECTS (1ULL << 9) // THD, user
+#define OPTION_LOG_OFF (1ULL << 10) // THD, user
+#define OPTION_QUOTE_SHOW_CREATE (1ULL << 11) // THD, user, unused
+#define TMP_TABLE_ALL_COLUMNS (1ULL << 12) // SELECT, intern
+#define OPTION_WARNINGS (1ULL << 13) // THD, user
+#define OPTION_AUTO_IS_NULL (1ULL << 14) // THD, user, binlog
+#define OPTION_FOUND_COMMENT (1ULL << 15) // SELECT, intern, parser
+#define OPTION_SAFE_UPDATES (1ULL << 16) // THD, user
+#define OPTION_BUFFER_RESULT (1ULL << 17) // SELECT, user
+#define OPTION_BIN_LOG (1ULL << 18) // THD, user
+#define OPTION_NOT_AUTOCOMMIT (1ULL << 19) // THD, user
+#define OPTION_BEGIN (1ULL << 20) // THD, intern
+#define OPTION_TABLE_LOCK (1ULL << 21) // THD, intern
+#define OPTION_QUICK (1ULL << 22) // SELECT (for DELETE)
+#define OPTION_KEEP_LOG (1ULL << 23) // THD, user
/* The following is used to detect a conflict with DISTINCT */
-#define SELECT_ALL (ULL(1) << 24) // SELECT, user, parser
-
+#define SELECT_ALL (1ULL << 24) // SELECT, user, parser
/** The following can be set when importing tables in a 'wrong order'
to suppress foreign key checks */
-#define OPTION_NO_FOREIGN_KEY_CHECKS (ULL(1) << 26) // THD, user, binlog
+#define OPTION_NO_FOREIGN_KEY_CHECKS (1ULL << 26) // THD, user, binlog
/** The following speeds up inserts to InnoDB tables by suppressing unique
key checks in some cases */
-#define OPTION_RELAXED_UNIQUE_CHECKS (ULL(1) << 27) // THD, user, binlog
-#define SELECT_NO_UNLOCK (ULL(1) << 28) // SELECT, intern
-#define OPTION_SCHEMA_TABLE (ULL(1) << 29) // SELECT, intern
+#define OPTION_RELAXED_UNIQUE_CHECKS (1ULL << 27) // THD, user, binlog
+#define SELECT_NO_UNLOCK (1ULL << 28) // SELECT, intern
+#define OPTION_SCHEMA_TABLE (1ULL << 29) // SELECT, intern
/** Flag set if setup_tables already done */
-#define OPTION_SETUP_TABLES_DONE (ULL(1) << 30) // intern
+#define OPTION_SETUP_TABLES_DONE (1ULL << 30) // intern
/** If not set then the thread will ignore all warnings with level notes. */
-#define OPTION_SQL_NOTES (ULL(1) << 31) // THD, user
+#define OPTION_SQL_NOTES (1ULL << 31) // THD, user
/**
Force the used temporary table to be a MyISAM table (because we will use
fulltext functions when reading from it.
*/
-#define TMP_TABLE_FORCE_MYISAM (ULL(1) << 32)
-#define OPTION_PROFILING (ULL(1) << 33)
-
+#define TMP_TABLE_FORCE_MYISAM (1ULL << 32)
+#define OPTION_PROFILING (1ULL << 33)
/**
@@ -1320,7 +1313,7 @@ bool wait_for_tables(THD *thd);
bool table_is_used(TABLE *table, bool wait_for_name_lock);
TABLE *drop_locked_tables(THD *thd,const char *db, const char *table_name);
void abort_locked_tables(THD *thd,const char *db, const char *table_name);
-void execute_init_command(THD *thd, sys_var_str *init_command_var,
+void execute_init_command(THD *thd, LEX_STRING *init_command,
rw_lock_t *var_mutex);
extern Field *not_found_field;
extern Field *view_ref_found;
@@ -1594,7 +1587,8 @@ bool rename_temporary_table(THD* thd, TABLE *table, const char *new_db,
void remove_db_from_cache(const char *db);
void flush_tables();
bool is_equal(const LEX_STRING *a, const LEX_STRING *b);
-char *make_default_log_name(char *buff,const char* log_ext);
+char *make_log_name(char *buff, const char *name, const char* log_ext);
+extern char default_logfile_name[FN_REFLEN];
#ifdef WITH_PARTITION_STORAGE_ENGINE
uint fast_alter_partition_table(THD *thd, TABLE *table,
@@ -1860,10 +1854,6 @@ extern enum_field_types agg_field_type(Item **items, uint nitems);
/* strfunc.cc */
ulonglong find_set(TYPELIB *lib, const char *x, uint length, CHARSET_INFO *cs,
char **err_pos, uint *err_len, bool *set_warning);
-ulonglong find_set_from_flags(TYPELIB *lib, uint default_name,
- ulonglong cur_set, ulonglong default_set,
- const char *str, uint length, CHARSET_INFO *cs,
- char **err_pos, uint *err_len, bool *set_warning);
uint find_type(const TYPELIB *lib, const char *find, uint length,
bool part_match);
uint find_type2(const TYPELIB *lib, const char *find, uint length,
@@ -1873,6 +1863,10 @@ uint check_word(TYPELIB *lib, const char *val, const char *end,
const char **end_of_word);
int find_string_in_array(LEX_STRING * const haystack, LEX_STRING * const needle,
CHARSET_INFO * const cs);
+char *set_to_string(THD *thd, LEX_STRING *result, ulonglong set,
+ const char *lib[]);
+char *flagset_to_string(THD *thd, LEX_STRING *result, ulonglong set,
+ const char *lib[]);
bool is_keyword(const char *name, uint len);
@@ -1897,7 +1891,9 @@ extern int creating_table; // How many mysql_create_table() are running
extern time_t server_start_time, flush_status_time;
#endif /* MYSQL_SERVER */
#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
-extern uint mysql_data_home_len;
+extern uint mysql_data_home_len, mysql_real_data_home_len;
+extern const char *mysql_real_data_home_ptr;
+extern uint thread_handling;
extern MYSQL_PLUGIN_IMPORT char *mysql_data_home;
extern char server_version[SERVER_VERSION_LENGTH];
@@ -1907,18 +1903,18 @@ extern char mysql_unpacked_real_data_home[];
extern CHARSET_INFO *character_set_filesystem;
#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
#ifdef MYSQL_SERVER
-extern char *opt_mysql_tmpdir, mysql_charsets_dir[],
- def_ft_boolean_syntax[sizeof(ft_boolean_syntax)];
+extern char *opt_mysql_tmpdir, mysql_charsets_dir[];
extern int mysql_unpacked_real_data_home_len;
#define mysql_tmpdir (my_tmpdir(&mysql_tmpdir_list))
extern MYSQL_PLUGIN_IMPORT MY_TMPDIR mysql_tmpdir_list;
extern const LEX_STRING command_name[];
+extern LEX_STRING opt_init_connect, opt_init_slave;
+
extern const char *first_keyword, *delayed_user, *binary_keyword;
extern MYSQL_PLUGIN_IMPORT const char *my_localhost;
extern MYSQL_PLUGIN_IMPORT const char **errmesg; /* Error messages */
-extern const char *myisam_recover_options_str;
extern const char *in_left_expr_name, *in_additional_cond, *in_having_cond;
extern const char * const TRG_EXT;
extern const char * const TRN_EXT;
@@ -1929,15 +1925,16 @@ extern Lt_creator lt_creator;
extern Ge_creator ge_creator;
extern Le_creator le_creator;
extern char lc_messages_dir[FN_REFLEN];
+extern char *lc_messages_dir_ptr, *log_error_file_ptr;
#endif /* MYSQL_SERVER */
#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
extern MYSQL_PLUGIN_IMPORT char reg_ext[FN_EXTLEN];
extern MYSQL_PLUGIN_IMPORT uint reg_ext_length;
#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
#ifdef MYSQL_SERVER
+extern char *mysql_home_ptr, *pidfile_name_ptr;
extern char glob_hostname[FN_REFLEN], mysql_home[FN_REFLEN];
extern char pidfile_name[FN_REFLEN], system_time_zone[30], *opt_init_file;
-extern char default_logfile_name[FN_REFLEN];
extern char log_error_file[FN_REFLEN], *opt_tc_log_file;
extern ulonglong log_10_int[20];
extern ulonglong keybuff_size;
@@ -1956,7 +1953,6 @@ extern ulong table_cache_size, table_def_size;
extern MYSQL_PLUGIN_IMPORT ulong max_connections;
extern ulong max_connect_errors, connect_timeout;
extern ulong slave_net_timeout, slave_trans_retries;
-extern uint max_user_connections;
extern ulong what_to_log,flush_time;
extern ulong query_buff_size;
extern ulong max_prepared_stmt_count, prepared_stmt_count;
@@ -1998,7 +1994,7 @@ extern MYSQL_PLUGIN_IMPORT bool mysqld_embedded;
extern bool opt_large_files, server_id_supplied;
extern bool opt_update_log, opt_bin_log, opt_error_log;
extern my_bool opt_log, opt_slow_log;
-extern ulong log_output_options;
+extern ulonglong log_output_options;
extern my_bool opt_log_queries_not_using_indexes;
extern bool opt_disable_networking, opt_skip_show_db;
extern bool opt_ignore_builtin_innodb;
@@ -2010,18 +2006,20 @@ extern uint connection_count;
extern my_bool opt_sql_bin_update, opt_safe_user_create, opt_no_mix_types;
extern my_bool opt_safe_show_db, opt_local_infile, opt_myisam_use_mmap;
extern my_bool opt_slave_compressed_protocol, use_temp_pool;
-extern ulong slave_exec_mode_options;
+extern uint slave_exec_mode_options;
extern my_bool opt_readonly, lower_case_file_system;
extern my_bool opt_enable_named_pipe, opt_sync_frm, opt_allow_suspicious_udfs;
extern my_bool opt_secure_auth;
extern char* opt_secure_file_priv;
extern my_bool opt_log_slow_admin_statements, opt_log_slow_slave_statements;
-extern my_bool sp_automatic_privileges, opt_noacl;
+extern my_bool sp_automatic_privileges, opt_noacl, disable_slaves;
extern my_bool opt_old_style_user_limits, trust_function_creators;
extern uint opt_crash_binlog_innodb;
extern char *shared_memory_base_name, *mysqld_unix_port;
extern my_bool opt_enable_shared_memory;
extern char *default_tz_name;
+extern Time_zone *default_tz;
+extern char *default_storage_engine;
#endif /* MYSQL_SERVER */
#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
extern my_bool opt_large_pages;
@@ -2030,6 +2028,7 @@ extern uint opt_large_page_size;
#ifdef MYSQL_SERVER
extern char *opt_logname, *opt_slow_logname;
extern const char *log_output_str;
+extern my_bool old_mode;
extern MYSQL_PLUGIN_IMPORT MYSQL_BIN_LOG mysql_bin_log;
extern LOGGER logger;
@@ -2061,7 +2060,6 @@ extern pthread_cond_t COND_thread_count, COND_manager;
extern pthread_cond_t COND_global_read_lock;
extern pthread_attr_t connection_attrib;
extern I_List<THD> threads;
-extern I_List<NAMED_LIST> key_caches;
extern MY_BITMAP temp_pool;
extern String my_empty_string;
extern const String my_null_string;
@@ -2075,7 +2073,7 @@ extern struct system_variables max_system_variables;
extern struct system_status_var global_status_var;
extern struct rand_struct sql_rand;
-extern const char *opt_date_time_formats[];
+extern DATE_TIME_FORMAT global_date_format, global_datetime_format, global_time_format;
extern KNOWN_DATE_TIME_FORMAT known_date_time_formats[];
extern String null_string;
@@ -2089,8 +2087,11 @@ extern TYPELIB thread_handling_typelib;
extern uint8 uc_update_queries[SQLCOM_END+1];
extern uint sql_command_flags[];
extern TYPELIB log_output_typelib;
+extern const char *log_output_names[];
/* optional things, have_* variables */
+extern SHOW_COMP_OPTION have_csv, have_innodb;
+extern SHOW_COMP_OPTION have_ndbcluster, have_partitioning;
extern SHOW_COMP_OPTION have_profiling;
extern handlerton *partition_hton;
@@ -2111,6 +2112,9 @@ extern const char *load_default_groups[];
extern pthread_t signal_thread;
#endif
+extern char *opt_ssl_ca, *opt_ssl_capath, *opt_ssl_cert, *opt_ssl_cipher,
+ *opt_ssl_key;
+
#ifdef HAVE_OPENSSL
extern struct st_VioSSLFd * ssl_acceptor_fd;
#endif /* HAVE_OPENSSL */
@@ -2221,6 +2225,20 @@ bool calc_time_diff(MYSQL_TIME *l_time1, MYSQL_TIME *l_time2, int l_sign,
extern LEX_STRING interval_type_to_name[];
+
+bool parse_date_time_format(timestamp_type format_type,
+ const char *format, uint format_length,
+ DATE_TIME_FORMAT *date_time_format);
+/* convenience wrapper */
+inline bool parse_date_time_format(timestamp_type format_type,
+ DATE_TIME_FORMAT *date_time_format)
+{
+ return parse_date_time_format(format_type,
+ date_time_format->format.str,
+ date_time_format->format.length,
+ date_time_format);
+}
+
extern DATE_TIME_FORMAT *date_time_format_make(timestamp_type format_type,
const char *format_str,
uint format_length);
@@ -2488,6 +2506,11 @@ inline void kill_delayed_threads(void) {}
#define check_stack_overrun(A, B, C) 0
#endif
+/* This must match the path length limit in the ER_NOT_RW_DIR error msg. */
+#define ER_NOT_RW_DIR_PATHSIZE 200
+bool is_usable_directory(THD *thd, const char *varname,
+ const char *path, const char *prefix);
+
/* Used by handlers to store things in schema tables */
#define IS_FILES_FILE_ID 0
#define IS_FILES_FILE_NAME 1
@@ -2563,6 +2586,58 @@ bool load_collation(MEM_ROOT *mem_root,
CHARSET_INFO *dflt_cl,
CHARSET_INFO **cl);
+#define LONG_TIMEOUT ((ulong) 3600L*24L*365L)
+
+/**
+ only options that need special treatment in get_one_option() deserve
+ to be listed below
+*/
+enum options_mysqld
+{
+ OPT_to_set_the_start_number=256,
+ OPT_BIND_ADDRESS,
+ OPT_BINLOG_DO_DB,
+ OPT_BINLOG_FORMAT,
+ OPT_BINLOG_IGNORE_DB,
+ OPT_BIN_LOG,
+ OPT_BOOTSTRAP,
+ OPT_CONSOLE,
+ OPT_DEBUG_SYNC_TIMEOUT,
+ OPT_DELAY_KEY_WRITE_ALL,
+ OPT_ISAM_LOG,
+ OPT_KEY_BUFFER_SIZE,
+ OPT_KEY_CACHE_AGE_THRESHOLD,
+ OPT_KEY_CACHE_BLOCK_SIZE,
+ OPT_KEY_CACHE_DIVISION_LIMIT,
+ OPT_LOWER_CASE_TABLE_NAMES,
+ OPT_ONE_THREAD,
+ OPT_POOL_OF_THREADS,
+ OPT_REPLICATE_DO_DB,
+ OPT_REPLICATE_DO_TABLE,
+ OPT_REPLICATE_IGNORE_DB,
+ OPT_REPLICATE_IGNORE_TABLE,
+ OPT_REPLICATE_REWRITE_DB,
+ OPT_REPLICATE_WILD_DO_TABLE,
+ OPT_REPLICATE_WILD_IGNORE_TABLE,
+ OPT_SAFE,
+ OPT_SERVER_ID,
+ OPT_SKIP_HOST_CACHE,
+ OPT_SKIP_LOCK,
+ OPT_SKIP_NEW,
+ OPT_SKIP_PRIOR,
+ OPT_SKIP_RESOLVE,
+ OPT_SKIP_STACK_TRACE,
+ OPT_SKIP_SYMLINKS,
+ OPT_SLOW_QUERY_LOG,
+ OPT_SSL_CA,
+ OPT_SSL_CAPATH,
+ OPT_SSL_CERT,
+ OPT_SSL_CIPHER,
+ OPT_SSL_KEY,
+ OPT_UPDATE_LOG,
+ OPT_WANT_CORE
+};
+
#endif /* MYSQL_SERVER */
extern "C" int test_if_data_home_dir(const char *dir);
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 826e8a6c980..068a49d0ae6 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -28,8 +28,9 @@
#include "events.h"
#include "probes_mysql.h"
#include "debug_sync.h"
-
+#include "keycaches.h"
#include "../storage/myisam/ha_myisam.h"
+#include "set_var.h"
#include "rpl_injector.h"
@@ -39,15 +40,6 @@
#include <sys/prctl.h>
#endif
-#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
-#if defined(NOT_ENOUGH_TESTED) \
- && defined(NDB_SHM_TRANSPORTER) && MYSQL_VERSION_ID >= 50000
-#define OPT_NDB_SHM_DEFAULT 1
-#else
-#define OPT_NDB_SHM_DEFAULT 0
-#endif
-#endif
-
#include <thr_alarm.h>
#include <ft_global.h>
#include <errmsg.h>
@@ -56,18 +48,6 @@
#define mysqld_charset &my_charset_latin1
-#ifdef HAVE_purify
-#define IF_PURIFY(A,B) (A)
-#else
-#define IF_PURIFY(A,B) (B)
-#endif
-
-#if SIZEOF_CHARP == 4
-#define MAX_MEM_TABLE_SIZE ~(ulong) 0
-#else
-#define MAX_MEM_TABLE_SIZE ~(ulonglong) 0
-#endif
-
/* stack traces are only supported on linux intel */
#if defined(__linux__) && defined(__i386__) && defined(USE_PSTACK)
#define HAVE_STACK_TRACE_ON_SEGV
@@ -247,85 +227,6 @@ extern "C" sig_handler handle_segfault(int sig);
/* Constants */
const char *show_comp_option_name[]= {"YES", "NO", "DISABLED"};
-/*
- WARNING: When adding new SQL modes don't forget to update the
- tables definitions that stores it's value.
- (ie: mysql.event, mysql.proc)
-*/
-static const char *sql_mode_names[]=
-{
- "REAL_AS_FLOAT", "PIPES_AS_CONCAT", "ANSI_QUOTES", "IGNORE_SPACE",
- "?", "ONLY_FULL_GROUP_BY", "NO_UNSIGNED_SUBTRACTION",
- "NO_DIR_IN_CREATE",
- "POSTGRESQL", "ORACLE", "MSSQL", "DB2", "MAXDB", "NO_KEY_OPTIONS",
- "NO_TABLE_OPTIONS", "NO_FIELD_OPTIONS", "MYSQL323", "MYSQL40", "ANSI",
- "NO_AUTO_VALUE_ON_ZERO", "NO_BACKSLASH_ESCAPES", "STRICT_TRANS_TABLES",
- "STRICT_ALL_TABLES",
- "NO_ZERO_IN_DATE", "NO_ZERO_DATE", "ALLOW_INVALID_DATES",
- "ERROR_FOR_DIVISION_BY_ZERO",
- "TRADITIONAL", "NO_AUTO_CREATE_USER", "HIGH_NOT_PRECEDENCE",
- "NO_ENGINE_SUBSTITUTION",
- "PAD_CHAR_TO_FULL_LENGTH",
- NullS
-};
-
-static const unsigned int sql_mode_names_len[]=
-{
- /*REAL_AS_FLOAT*/ 13,
- /*PIPES_AS_CONCAT*/ 15,
- /*ANSI_QUOTES*/ 11,
- /*IGNORE_SPACE*/ 12,
- /*?*/ 1,
- /*ONLY_FULL_GROUP_BY*/ 18,
- /*NO_UNSIGNED_SUBTRACTION*/ 23,
- /*NO_DIR_IN_CREATE*/ 16,
- /*POSTGRESQL*/ 10,
- /*ORACLE*/ 6,
- /*MSSQL*/ 5,
- /*DB2*/ 3,
- /*MAXDB*/ 5,
- /*NO_KEY_OPTIONS*/ 14,
- /*NO_TABLE_OPTIONS*/ 16,
- /*NO_FIELD_OPTIONS*/ 16,
- /*MYSQL323*/ 8,
- /*MYSQL40*/ 7,
- /*ANSI*/ 4,
- /*NO_AUTO_VALUE_ON_ZERO*/ 21,
- /*NO_BACKSLASH_ESCAPES*/ 20,
- /*STRICT_TRANS_TABLES*/ 19,
- /*STRICT_ALL_TABLES*/ 17,
- /*NO_ZERO_IN_DATE*/ 15,
- /*NO_ZERO_DATE*/ 12,
- /*ALLOW_INVALID_DATES*/ 19,
- /*ERROR_FOR_DIVISION_BY_ZERO*/ 26,
- /*TRADITIONAL*/ 11,
- /*NO_AUTO_CREATE_USER*/ 19,
- /*HIGH_NOT_PRECEDENCE*/ 19,
- /*NO_ENGINE_SUBSTITUTION*/ 22,
- /*PAD_CHAR_TO_FULL_LENGTH*/ 23
-};
-
-TYPELIB sql_mode_typelib= { array_elements(sql_mode_names)-1,"",
- sql_mode_names,
- (unsigned int *)sql_mode_names_len };
-
-static const char *optimizer_switch_names[]=
-{
- "index_merge","index_merge_union","index_merge_sort_union",
- "index_merge_intersection", "default", NullS
-};
-/* Corresponding defines are named OPTIMIZER_SWITCH_XXX */
-static const unsigned int optimizer_switch_names_len[]=
-{
- sizeof("index_merge") - 1,
- sizeof("index_merge_union") - 1,
- sizeof("index_merge_sort_union") - 1,
- sizeof("index_merge_intersection") - 1,
- sizeof("default") - 1
-};
-TYPELIB optimizer_switch_typelib= { array_elements(optimizer_switch_names)-1,"",
- optimizer_switch_names,
- (unsigned int *)optimizer_switch_names_len };
static const char *tc_heuristic_recover_names[]=
{
@@ -337,26 +238,8 @@ static TYPELIB tc_heuristic_recover_typelib=
tc_heuristic_recover_names, NULL
};
-static const char *thread_handling_names[]=
-{ "one-thread-per-connection", "no-threads",
-#if HAVE_POOL_OF_THREADS == 1
- "pool-of-threads",
-#endif
- NullS};
-
-TYPELIB thread_handling_typelib=
-{
- array_elements(thread_handling_names) - 1, "",
- thread_handling_names, NULL
-};
-
const char *first_keyword= "first", *binary_keyword= "BINARY";
const char *my_localhost= "localhost", *delayed_user= "DELAYED";
-#if SIZEOF_OFF_T > 4 && defined(BIG_TABLES)
-#define GET_HA_ROWS GET_ULL
-#else
-#define GET_HA_ROWS GET_ULONG
-#endif
bool opt_large_files= sizeof(my_off_t) > 4;
@@ -387,26 +270,22 @@ static bool volatile ready_to_exit;
static my_bool opt_debugging= 0, opt_external_locking= 0, opt_console= 0;
static my_bool opt_short_log_format= 0;
static uint kill_cached_threads, wake_thread;
-static ulong killed_threads, thread_created;
+static ulong killed_threads;
static ulong max_used_connections;
static volatile ulong cached_thread_count= 0;
-static const char *sql_mode_str= "OFF";
-/* Text representation for OPTIMIZER_SWITCH_DEFAULT */
-static const char *optimizer_switch_str="index_merge=on,index_merge_union=on,"
- "index_merge_sort_union=on,"
- "index_merge_intersection=on";
-static char *mysqld_user, *mysqld_chroot, *log_error_file_ptr;
-static char *opt_init_slave, *lc_messages_dir_ptr, *opt_init_connect;
+static char *mysqld_user, *mysqld_chroot;
static char *default_character_set_name;
static char *character_set_filesystem_name;
static char *lc_messages;
static char *lc_time_names_name;
static char *my_bind_addr_str;
-static char *default_collation_name;
-static char *default_storage_engine_str;
+static char *default_collation_name;
+char *default_storage_engine;
static char compiled_default_collation_name[]= MYSQL_DEFAULT_COLLATION_NAME;
static I_List<THD> thread_cache;
-static double long_query_time;
+static bool binlog_format_used= false;
+
+LEX_STRING opt_init_connect, opt_init_slave;
static pthread_cond_t COND_thread_cache, COND_flush_thread_cache;
@@ -414,7 +293,7 @@ static pthread_cond_t COND_thread_cache, COND_flush_thread_cache;
bool opt_update_log, opt_bin_log, opt_ignore_builtin_innodb= 0;
my_bool opt_log, opt_slow_log;
-ulong log_output_options;
+ulonglong log_output_options;
my_bool opt_log_queries_not_using_indexes= 0;
bool opt_error_log= IF_WIN(1,0);
bool opt_disable_networking=0, opt_skip_show_db=0;
@@ -456,6 +335,13 @@ my_bool opt_local_infile, opt_slave_compressed_protocol;
my_bool opt_safe_user_create = 0, opt_no_mix_types = 0;
my_bool opt_show_slave_auth_info, opt_sql_bin_update = 0;
my_bool opt_log_slave_updates= 0;
+char *opt_slave_skip_errors;
+
+/**
+ compatibility option:
+ - index usage hints (USE INDEX without a FOR clause) behave as in 5.0
+*/
+my_bool old_mode;
/*
Legacy global handlerton. These will be removed (please do not add more).
@@ -464,38 +350,18 @@ handlerton *heap_hton;
handlerton *myisam_hton;
handlerton *partition_hton;
-#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
-const char *opt_ndbcluster_connectstring= 0;
-const char *opt_ndb_connectstring= 0;
-char opt_ndb_constrbuf[1024]= {0};
-unsigned opt_ndb_constrbuf_len= 0;
-my_bool opt_ndb_shm, opt_ndb_optimized_node_selection;
-ulong opt_ndb_cache_check_time;
-const char *opt_ndb_mgmd;
-ulong opt_ndb_nodeid;
-ulong ndb_extra_logging;
-#ifdef HAVE_NDB_BINLOG
-ulong ndb_report_thresh_binlog_epoch_slip;
-ulong ndb_report_thresh_binlog_mem_usage;
-#endif
-
-extern const char *ndb_distribution_names[];
-extern TYPELIB ndb_distribution_typelib;
-extern const char *opt_ndb_distribution;
-extern enum ndb_distribution opt_ndb_distribution_id;
-#endif
-my_bool opt_readonly, use_temp_pool, relay_log_purge;
+my_bool opt_readonly= 0, use_temp_pool, relay_log_purge;
my_bool relay_log_recovery;
my_bool opt_sync_frm, opt_allow_suspicious_udfs;
my_bool opt_secure_auth= 0;
-char* opt_secure_file_priv= 0;
+char* opt_secure_file_priv;
my_bool opt_log_slow_admin_statements= 0;
my_bool opt_log_slow_slave_statements= 0;
my_bool lower_case_file_system= 0;
my_bool opt_large_pages= 0;
my_bool opt_super_large_pages= 0;
my_bool opt_myisam_use_mmap= 0;
-uint opt_large_page_size= 0;
+uint opt_large_page_size= 0;
#if defined(ENABLED_DEBUG_SYNC)
uint opt_debug_sync_timeout= 0;
#endif /* defined(ENABLED_DEBUG_SYNC) */
@@ -514,27 +380,25 @@ const char *binlog_format_names[]= {"MIXED", "STATEMENT", "ROW", NullS};
TYPELIB binlog_format_typelib=
{ array_elements(binlog_format_names) - 1, "",
binlog_format_names, NULL };
-ulong opt_binlog_format_id= (ulong) BINLOG_FORMAT_UNSPEC;
-const char *opt_binlog_format= binlog_format_names[opt_binlog_format_id];
#ifdef HAVE_INITGROUPS
static bool calling_initgroups= FALSE; /**< Used in SIGSEGV handler. */
#endif
uint mysqld_port, test_flags, select_errors, dropping_tables, ha_open_options;
uint mysqld_port_timeout;
-uint delay_key_write_options, protocol_version;
+uint delay_key_write_options;
+uint protocol_version;
uint lower_case_table_names;
uint tc_heuristic_recover= 0;
uint volatile thread_count;
int32 thread_running;
-ulonglong thd_startup_options;
+ulong thread_created;
ulong back_log, connect_timeout, concurrency, server_id;
ulong table_cache_size, table_def_size;
ulong what_to_log;
ulong query_buff_size, slow_launch_time, slave_open_temp_tables;
ulong open_files_limit, max_binlog_size, max_relay_log_size;
ulong slave_net_timeout, slave_trans_retries;
-ulong slave_exec_mode_options;
-const char *slave_exec_mode_str= "STRICT";
+uint slave_exec_mode_options;
ulong thread_cache_size=0, thread_pool_size= 0;
ulong binlog_cache_size=0;
ulonglong max_binlog_cache_size=0;
@@ -550,7 +414,6 @@ ulong delayed_insert_errors,flush_time;
ulong specialflag=0;
ulong binlog_cache_use= 0, binlog_cache_disk_use= 0;
ulong max_connections, max_connect_errors;
-uint max_user_connections= 0;
/**
Limit of the total number of prepared statements in the server.
Is necessary to protect the server against out-of-memory attacks.
@@ -573,7 +436,6 @@ uint sync_binlog_period= 0, sync_relaylog_period= 0,
sync_relayloginfo_period= 0, sync_masterinfo_period= 0;
ulong expire_logs_days = 0;
ulong rpl_recovery_rank=0;
-const char *log_output_str= "FILE";
time_t server_start_time, flush_status_time;
@@ -584,25 +446,26 @@ char log_error_file[FN_REFLEN], glob_hostname[FN_REFLEN];
char mysql_real_data_home[FN_REFLEN],
lc_messages_dir[FN_REFLEN], reg_ext[FN_EXTLEN],
mysql_charsets_dir[FN_REFLEN],
- *opt_init_file, *opt_tc_log_file,
- def_ft_boolean_syntax[sizeof(ft_boolean_syntax)];
+ *opt_init_file, *opt_tc_log_file;
+char *lc_messages_dir_ptr, *log_error_file_ptr;
char err_shared_dir[FN_REFLEN];
char mysql_unpacked_real_data_home[FN_REFLEN];
int mysql_unpacked_real_data_home_len;
+uint mysql_real_data_home_len, mysql_data_home_len= 1;
uint reg_ext_length;
const key_map key_map_empty(0);
key_map key_map_full(0); // Will be initialized later
-const char *opt_date_time_formats[3];
+DATE_TIME_FORMAT global_date_format, global_datetime_format, global_time_format;
+Time_zone *default_tz;
-uint mysql_data_home_len;
-char mysql_data_home_buff[2], *mysql_data_home=mysql_real_data_home;
+char *mysql_data_home= const_cast<char*>(".");
+const char *mysql_real_data_home_ptr= mysql_real_data_home;
char server_version[SERVER_VERSION_LENGTH];
char *mysqld_unix_port, *opt_mysql_tmpdir;
-const char *myisam_recover_options_str="OFF";
-const char *myisam_stats_method_str="nulls_unequal";
+uint thread_handling;
-/** name of reference on left espression in rewritten IN subquery */
+/** name of reference on left expression in rewritten IN subquery */
const char *in_left_expr_name= "<left expr>";
/** name of additional condition */
const char *in_additional_cond= "<IN COND>";
@@ -622,7 +485,6 @@ int bootstrap_error;
FILE *stderror_file=0;
I_List<THD> threads;
-I_List<NAMED_LIST> key_caches;
Rpl_filter* rpl_filter;
Rpl_filter* binlog_filter;
@@ -700,10 +562,9 @@ static my_bool opt_do_pstack;
#endif /* HAVE_STACK_TRACE_ON_SEGV */
static my_bool opt_bootstrap, opt_myisam_log;
static int cleanup_done;
-static ulong opt_specialflag, opt_myisam_block_size;
+static ulong opt_specialflag;
static char *opt_update_logname, *opt_binlog_index_name;
-static char *opt_tc_heuristic_recover;
-static char *mysql_home_ptr, *pidfile_name_ptr;
+char *mysql_home_ptr, *pidfile_name_ptr;
static int defaults_argc;
static char **defaults_argv;
static char *opt_bin_logname;
@@ -764,7 +625,6 @@ int allow_severity = LOG_INFO;
int deny_severity = LOG_WARNING;
#endif
#ifdef HAVE_QUERY_CACHE
-static ulong query_cache_limit= 0;
ulong query_cache_min_res_unit= QUERY_CACHE_MIN_RESULT_DATA_SIZE;
Query_cache query_cache;
#endif
@@ -776,8 +636,10 @@ HANDLE smem_event_connect_request= 0;
scheduler_functions thread_scheduler;
-#define SSL_VARS_NOT_STATIC
-#include "sslopt-vars.h"
+my_bool opt_use_ssl = 0;
+char *opt_ssl_ca= NULL, *opt_ssl_capath= NULL, *opt_ssl_cert= NULL,
+ *opt_ssl_cipher= NULL, *opt_ssl_key= NULL;
+
#ifdef HAVE_OPENSSL
#include <openssl/crypto.h>
#ifndef HAVE_YASSL
@@ -827,9 +689,6 @@ pthread_handler_t handle_connections_namedpipes(void *arg);
pthread_handler_t handle_connections_shared_memory(void *arg);
#endif
pthread_handler_t handle_slave(void *arg);
-static ulong find_bit_type(const char *x, TYPELIB *bit_lib);
-static ulong find_bit_type_or_exit(const char *x, TYPELIB *bit_lib,
- const char *option, int *error);
static void clean_up(bool print_message);
static int test_if_case_insensitive(const char *dir_name);
@@ -1306,7 +1165,6 @@ void clean_up(bool print_message)
item_user_lock_free();
lex_free(); /* Free some memory */
item_create_cleanup();
- set_var_free();
if (!opt_noacl)
{
#ifdef HAVE_DLOPEN
@@ -1319,30 +1177,15 @@ void clean_up(bool print_message)
tc_log->close();
delegates_destroy();
xid_cache_free();
- delete_elements(&key_caches, (void (*)(const char*, uchar*)) free_key_cache);
+ key_caches.delete_elements((void (*)(const char*, uchar*)) free_key_cache);
multi_keycache_free();
free_status_vars();
end_thr_alarm(1); /* Free allocated memory */
my_free_open_file_info();
- my_free((char*) global_system_variables.date_format,
- MYF(MY_ALLOW_ZERO_PTR));
- my_free((char*) global_system_variables.time_format,
- MYF(MY_ALLOW_ZERO_PTR));
- my_free((char*) global_system_variables.datetime_format,
- MYF(MY_ALLOW_ZERO_PTR));
if (defaults_argv)
free_defaults(defaults_argv);
- my_free(sys_init_connect.value, MYF(MY_ALLOW_ZERO_PTR));
- my_free(sys_init_slave.value, MYF(MY_ALLOW_ZERO_PTR));
- my_free(sys_var_general_log_path.value, MYF(MY_ALLOW_ZERO_PTR));
- my_free(sys_var_slow_log_path.value, MYF(MY_ALLOW_ZERO_PTR));
free_tmpdir(&mysql_tmpdir_list);
-#ifdef HAVE_REPLICATION
- my_free(slave_load_tmpdir,MYF(MY_ALLOW_ZERO_PTR));
-#endif
x_free(opt_bin_logname);
- x_free(opt_relay_logname);
- x_free(opt_secure_file_priv);
bitmap_free(&temp_pool);
free_max_user_conn();
#ifdef HAVE_REPLICATION
@@ -1366,7 +1209,7 @@ void clean_up(bool print_message)
if (!opt_bootstrap)
(void) my_delete(pidfile_name,MYF(0)); // This may not always exist
#endif
- if (print_message && /*errmesg &&*/ server_start_time)
+ if (print_message && my_default_lc_messages && server_start_time)
sql_print_information(ER_DEFAULT(ER_SHUTDOWN_COMPLETE),my_progname);
cleanup_errmsgs();
thread_scheduler.end();
@@ -1382,6 +1225,7 @@ void clean_up(bool print_message)
/* do the broadcast inside the lock to ensure that my_end() is not called */
(void) pthread_cond_broadcast(&COND_thread_count);
(void) pthread_mutex_unlock(&LOCK_thread_count);
+ sys_var_end();
/*
The following lines may never be executed as the main thread may have
@@ -1461,7 +1305,6 @@ static void clean_up_mutexes()
(void) pthread_cond_destroy(&COND_flush_thread_cache);
(void) pthread_cond_destroy(&COND_manager);
}
-
#endif /*EMBEDDED_LIBRARY*/
@@ -2989,10 +2832,6 @@ sizeof(load_default_groups)/sizeof(load_default_groups[0]);
@param format_type What kind of format should be supported
@param var_ptr Pointer to variable that should be updated
- @note
- The default value is taken from either opt_date_time_formats[] or
- the ISO format (ANSI SQL)
-
@retval
0 ok
@retval
@@ -3000,27 +2839,21 @@ sizeof(load_default_groups)/sizeof(load_default_groups[0]);
*/
static bool init_global_datetime_format(timestamp_type format_type,
- DATE_TIME_FORMAT **var_ptr)
+ DATE_TIME_FORMAT *format)
{
- /* Get command line option */
- const char *str= opt_date_time_formats[format_type];
+ /*
+ Get command line option
+ format->format.str is already set by my_getopt
+ */
+ format->format.length= strlen(format->format.str);
- if (!str) // No specified format
+ if (parse_date_time_format(format_type, format))
{
- str= get_date_time_format_str(&known_date_time_formats[ISO_FORMAT],
- format_type);
- /*
- Set the "command line" option to point to the generated string so
- that we can set global formats back to default
- */
- opt_date_time_formats[format_type]= str;
+ fprintf(stderr, "Wrong date/time format specifier: %s\n",
+ format->format.str);
+ return true;
}
- if (!(*var_ptr= date_time_format_make(format_type, str, strlen(str))))
- {
- fprintf(stderr, "Wrong date/time format specifier: %s\n", str);
- return 1;
- }
- return 0;
+ return false;
}
SHOW_VAR com_status_vars[]= {
@@ -3173,10 +3006,22 @@ SHOW_VAR com_status_vars[]= {
{NullS, NullS, SHOW_LONG}
};
+/**
+ Create the name of the default general log file
+
+ @param[IN] buff Location for building new string.
+ @param[IN] log_ext The extension for the file (e.g .log)
+ @returns Pointer to a new string containing the name
+*/
+static inline char *make_default_log_name(char *buff,const char* log_ext)
+{
+ return make_log_name(buff, default_logfile_name, log_ext);
+}
+
static int init_common_variables(const char *conf_file_name, int argc,
char **argv, const char **groups)
{
- char buff[FN_REFLEN], *s;
+ char buff[FN_REFLEN];
umask(((~my_umask) & 0666));
my_decimal_set_zero(&decimal_zero); // set decimal_zero constant;
tzset(); // Set tzname
@@ -3418,12 +3263,6 @@ static int init_common_variables(const char *conf_file_name, int argc,
if (item_create_init())
return 1;
item_init();
- if (set_var_init())
- return 1;
-#ifdef HAVE_REPLICATION
- if (init_replication_sys_vars())
- return 1;
-#endif
mysys_uses_curses=0;
#ifdef USE_REGEX
my_regex_init(&my_charset_latin1);
@@ -3478,8 +3317,7 @@ static int init_common_variables(const char *conf_file_name, int argc,
global_system_variables.collation_database= default_charset_info;
global_system_variables.collation_connection= default_charset_info;
global_system_variables.character_set_results= default_charset_info;
- global_system_variables.character_set_client= default_charset_info;
-
+ global_system_variables.character_set_client= default_charset_info;
if (!(character_set_filesystem=
get_charset_by_csname(character_set_filesystem_name,
MY_CS_PRIMARY, MYF(MY_WME))))
@@ -3493,20 +3331,6 @@ static int init_common_variables(const char *conf_file_name, int argc,
return 1;
}
global_system_variables.lc_time_names= my_default_lc_time_names;
-
- sys_init_connect.value_length= 0;
- if ((sys_init_connect.value= opt_init_connect))
- sys_init_connect.value_length= strlen(opt_init_connect);
- else
- sys_init_connect.value=my_strdup("",MYF(0));
- sys_init_connect.is_os_charset= TRUE;
-
- sys_init_slave.value_length= 0;
- if ((sys_init_slave.value= opt_init_slave))
- sys_init_slave.value_length= strlen(opt_init_slave);
- else
- sys_init_slave.value=my_strdup("",MYF(0));
- sys_init_slave.is_os_charset= TRUE;
/* check log options and issue warnings if needed */
if (opt_log && opt_logname && !(log_output_options & LOG_FILE) &&
@@ -3521,13 +3345,17 @@ static int init_common_variables(const char *conf_file_name, int argc,
"--log-slow-queries option, log tables are used. "
"To enable logging to files use the --log-output=file option.");
- s= opt_logname ? opt_logname : make_default_log_name(buff, ".log");
- sys_var_general_log_path.value= my_strdup(s, MYF(0));
- sys_var_general_log_path.value_length= strlen(s);
+#define FIX_LOG_VAR(VAR, ALT) \
+ if (!VAR || !*VAR) \
+ { \
+ x_free(VAR); /* it could be an allocated empty string "" */ \
+ VAR= my_strdup(ALT, MYF(0)); \
+ }
- s= opt_slow_logname ? opt_slow_logname : make_default_log_name(buff, "-slow.log");
- sys_var_slow_log_path.value= my_strdup(s, MYF(0));
- sys_var_slow_log_path.value_length= strlen(s);
+ FIX_LOG_VAR(opt_logname,
+ make_default_log_name(buff, ".log"));
+ FIX_LOG_VAR(opt_slow_logname,
+ make_default_log_name(buff, "-slow.log"));
#if defined(ENABLED_DEBUG_SYNC)
/* Initialize the debug sync facility. See debug_sync.cc. */
@@ -3790,7 +3618,7 @@ static void end_ssl()
static int init_server_components()
{
- FILE* reopen;
+ FILE *reopen;
DBUG_ENTER("init_server_components");
/*
We need to call each of these following functions to ensure that
@@ -3799,7 +3627,6 @@ static int init_server_components()
if (table_cache_init() | table_def_init() | hostname_cache_init())
unireg_abort(1);
- query_cache_result_size_limit(query_cache_limit);
query_cache_set_min_res_unit(query_cache_min_res_unit);
query_cache_init();
query_cache_resize(query_cache_size);
@@ -3826,7 +3653,7 @@ static int init_server_components()
fn_format(log_error_file, log_error_file_ptr, mysql_data_home, ".err",
MY_UNPACK_FILENAME | MY_SAFE_PATH);
if (!log_error_file[0])
- opt_error_log= 1; // Too long file name
+ opt_error_log= 0; // Too long file name
else
{
#ifndef EMBEDDED_LIBRARY
@@ -3913,27 +3740,9 @@ with --log-bin instead.");
sql_print_warning("You need to use --log-bin to make "
"--log-slave-updates work.");
}
- if (!opt_bin_log)
- {
- if (opt_binlog_format_id != BINLOG_FORMAT_UNSPEC)
- {
- sql_print_warning("You need to use --log-bin to make "
- "--binlog-format work.");
-
- global_system_variables.binlog_format= opt_binlog_format_id;
- }
- else
- {
- global_system_variables.binlog_format= BINLOG_FORMAT_STMT;
- }
- }
- else
- if (opt_binlog_format_id == BINLOG_FORMAT_UNSPEC)
- global_system_variables.binlog_format= BINLOG_FORMAT_STMT;
- else
- {
- DBUG_ASSERT(global_system_variables.binlog_format != BINLOG_FORMAT_UNSPEC);
- }
+ if (!opt_bin_log && binlog_format_used)
+ sql_print_warning("You need to use --log-bin to make "
+ "--binlog-format work.");
/* Check that we have not let the format to unspecified at this point */
DBUG_ASSERT((uint)global_system_variables.binlog_format <=
@@ -4015,19 +3824,21 @@ a file name for --log-bin-index option", opt_binlog_index_name);
if (ha_init_errors())
DBUG_RETURN(1);
- {
- if (plugin_init(&defaults_argc, defaults_argv,
- (opt_noacl ? PLUGIN_INIT_SKIP_PLUGIN_TABLE : 0) |
- (opt_help ? PLUGIN_INIT_SKIP_INITIALIZATION : 0)))
- {
- sql_print_error("Failed to initialize plugins.");
- unireg_abort(1);
- }
- plugins_are_initialized= TRUE; /* Don't separate from init function */
+ if (plugin_init(&defaults_argc, defaults_argv,
+ (opt_noacl ? PLUGIN_INIT_SKIP_PLUGIN_TABLE : 0) |
+ (opt_help ? PLUGIN_INIT_SKIP_INITIALIZATION : 0)))
+ {
+ sql_print_error("Failed to initialize plugins.");
+ unireg_abort(1);
}
+ plugins_are_initialized= TRUE; /* Don't separate from init function */
- if (opt_help)
- unireg_abort(0);
+ have_csv= plugin_status(STRING_WITH_LEN("csv"),
+ MYSQL_STORAGE_ENGINE_PLUGIN);
+ have_ndbcluster= plugin_status(STRING_WITH_LEN("ndbcluster"),
+ MYSQL_STORAGE_ENGINE_PLUGIN);
+ have_partitioning= plugin_status(STRING_WITH_LEN("partition"),
+ MYSQL_STORAGE_ENGINE_PLUGIN);
/* we do want to exit if there are any other unknown options */
if (defaults_argc > 1)
@@ -4060,6 +3871,9 @@ a file name for --log-bin-index option", opt_binlog_index_name);
}
}
+ if (opt_help)
+ unireg_abort(0);
+
/* if the errmsg.sys is not loaded, terminate to maintain behaviour */
if (!DEFAULT_ERRMSGS[0][0])
unireg_abort(1);
@@ -4111,42 +3925,37 @@ a file name for --log-bin-index option", opt_binlog_index_name);
#endif
/*
- Check that the default storage engine is actually available.
+ Set the default storage engine
*/
- if (default_storage_engine_str)
+ LEX_STRING name= { default_storage_engine, strlen(default_storage_engine) };
+ plugin_ref plugin;
+ handlerton *hton;
+ if ((plugin= ha_resolve_by_name(0, &name)))
+ hton= plugin_data(plugin, handlerton*);
+ else
{
- LEX_STRING name= { default_storage_engine_str,
- strlen(default_storage_engine_str) };
- plugin_ref plugin;
- handlerton *hton;
-
- if ((plugin= ha_resolve_by_name(0, &name)))
- hton= plugin_data(plugin, handlerton*);
- else
+ sql_print_error("Unknown/unsupported storage engine: %s",
+ default_storage_engine);
+ unireg_abort(1);
+ }
+ if (!ha_storage_engine_is_enabled(hton))
+ {
+ if (!opt_bootstrap)
{
- sql_print_error("Unknown/unsupported table type: %s",
- default_storage_engine_str);
+ sql_print_error("Default storage engine (%s) is not available",
+ default_storage_engine);
unireg_abort(1);
}
- if (!ha_storage_engine_is_enabled(hton))
- {
- if (!opt_bootstrap)
- {
- sql_print_error("Default storage engine (%s) is not available",
- default_storage_engine_str);
- unireg_abort(1);
- }
- DBUG_ASSERT(global_system_variables.table_plugin);
- }
- else
- {
- /*
- Need to unlock as global_system_variables.table_plugin
- was acquired during plugin_init()
- */
- plugin_unlock(0, global_system_variables.table_plugin);
- global_system_variables.table_plugin= plugin;
- }
+ DBUG_ASSERT(global_system_variables.table_plugin);
+ }
+ else
+ {
+ /*
+ Need to unlock as global_system_variables.table_plugin
+ was acquired during plugin_init()
+ */
+ plugin_unlock(0, global_system_variables.table_plugin);
+ global_system_variables.table_plugin= plugin;
}
tc_log= (total_ha_2pc > 1 ? (opt_bin_log ?
@@ -4446,10 +4255,6 @@ int main(int argc, char **argv)
check_data_home(mysql_real_data_home);
if (my_setwd(mysql_real_data_home,MYF(MY_WME)) && !opt_help)
unireg_abort(1); /* purecov: inspected */
- mysql_data_home= mysql_data_home_buff;
- mysql_data_home[0]=FN_CURLIB; // all paths are relative from here
- mysql_data_home[1]=0;
- mysql_data_home_len= 2;
if ((user_info= check_user(mysqld_user)))
{
@@ -4517,6 +4322,7 @@ int main(int argc, char **argv)
unlink(mysqld_unix_port);
exit(1);
}
+
if (!opt_noacl)
(void) grant_init();
@@ -4555,7 +4361,7 @@ int main(int argc, char **argv)
bootstrap(stdin);
unireg_abort(bootstrap_error ? 1 : 0);
}
- if (opt_init_file)
+ if (opt_init_file && *opt_init_file)
{
if (read_init_file(opt_init_file))
unireg_abort(1);
@@ -5611,179 +5417,13 @@ error:
Handle start options
******************************************************************************/
-enum options_mysqld
-{
- 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_SHORT_LOG_FORMAT,
- OPT_FLUSH, OPT_SAFE,
- OPT_BOOTSTRAP, OPT_SKIP_SHOW_DB,
- OPT_STORAGE_ENGINE, OPT_INIT_FILE,
- OPT_DELAY_KEY_WRITE_ALL, OPT_SLOW_QUERY_LOG,
- OPT_DELAY_KEY_WRITE, OPT_CHARSETS_DIR,
- OPT_MASTER_INFO_FILE,
- OPT_MASTER_RETRY_COUNT, OPT_LOG_TC, OPT_LOG_TC_SIZE,
- 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_BINLOG_FORMAT,
-#ifndef DBUG_OFF
- OPT_BINLOG_SHOW_XID,
-#endif
- OPT_BINLOG_ROWS_EVENT_MAX_SIZE,
- OPT_WANT_CORE, OPT_CONCURRENT_INSERT,
- OPT_MEMLOCK, OPT_MYISAM_RECOVER,
- OPT_REPLICATE_REWRITE_DB, OPT_SERVER_ID,
- OPT_SKIP_SLAVE_START, OPT_SAFE_SHOW_DB,
- OPT_SAFEMALLOC_MEM_LIMIT, OPT_REPLICATE_DO_TABLE,
- OPT_REPLICATE_IGNORE_TABLE, OPT_REPLICATE_WILD_DO_TABLE,
- OPT_REPLICATE_WILD_IGNORE_TABLE, OPT_REPLICATE_SAME_SERVER_ID,
- OPT_DISCONNECT_SLAVE_EVENT_COUNT, OPT_TC_HEURISTIC_RECOVER,
- OPT_ABORT_SLAVE_EVENT_COUNT,
- OPT_LOG_BIN_TRUST_FUNCTION_CREATORS,
- OPT_ENGINE_CONDITION_PUSHDOWN, OPT_NDB_CONNECTSTRING,
- OPT_NDB_USE_EXACT_COUNT, OPT_NDB_USE_TRANSACTIONS,
- OPT_NDB_FORCE_SEND, OPT_NDB_AUTOINCREMENT_PREFETCH_SZ,
- OPT_NDB_SHM, OPT_NDB_OPTIMIZED_NODE_SELECTION, OPT_NDB_CACHE_CHECK_TIME,
- OPT_NDB_MGMD, OPT_NDB_NODEID,
- OPT_NDB_DISTRIBUTION,
- OPT_NDB_INDEX_STAT_ENABLE,
- OPT_NDB_EXTRA_LOGGING,
- OPT_NDB_REPORT_THRESH_BINLOG_EPOCH_SLIP,
- OPT_NDB_REPORT_THRESH_BINLOG_MEM_USAGE,
- OPT_NDB_USE_COPYING_ALTER_TABLE,
- OPT_SKIP_SAFEMALLOC,
- OPT_TEMP_POOL, OPT_TX_ISOLATION, OPT_COMPLETION_TYPE,
- OPT_SKIP_STACK_TRACE, OPT_SKIP_SYMLINKS,
- OPT_MAX_BINLOG_DUMP_EVENTS, OPT_SPORADIC_BINLOG_DUMP_FAIL,
- OPT_SAFE_USER_CREATE, OPT_SQL_MODE,
- OPT_HAVE_NAMED_PIPE,
- OPT_DO_PSTACK, OPT_EVENT_SCHEDULER, OPT_REPORT_HOST,
- OPT_REPORT_USER, OPT_REPORT_PASSWORD, OPT_REPORT_PORT,
- OPT_SHOW_SLAVE_AUTH_INFO,
- OPT_SLAVE_LOAD_TMPDIR, OPT_NO_MIX_TYPE,
- OPT_RPL_RECOVERY_RANK,OPT_INIT_RPL_ROLE,
- OPT_RELAY_LOG, OPT_RELAY_LOG_INDEX, OPT_RELAY_LOG_INFO_FILE,
- OPT_SLAVE_SKIP_ERRORS, OPT_DES_KEY_FILE, OPT_LOCAL_INFILE,
- OPT_SSL_SSL, OPT_SSL_KEY, OPT_SSL_CERT, OPT_SSL_CA,
- OPT_SSL_CAPATH, OPT_SSL_CIPHER,
- OPT_BACK_LOG, OPT_BINLOG_CACHE_SIZE,
- OPT_CONNECT_TIMEOUT, OPT_DELAYED_INSERT_TIMEOUT,
- OPT_DELAYED_INSERT_LIMIT, OPT_DELAYED_QUEUE_SIZE,
- OPT_FLUSH_TIME, OPT_FT_MIN_WORD_LEN, OPT_FT_BOOLEAN_SYNTAX,
- OPT_FT_MAX_WORD_LEN, OPT_FT_QUERY_EXPANSION_LIMIT, OPT_FT_STOPWORD_FILE,
- OPT_INTERACTIVE_TIMEOUT, OPT_JOIN_BUFF_SIZE,
- OPT_KEY_BUFFER_SIZE, OPT_KEY_CACHE_BLOCK_SIZE,
- OPT_KEY_CACHE_DIVISION_LIMIT, OPT_KEY_CACHE_AGE_THRESHOLD,
- OPT_LONG_QUERY_TIME,
- OPT_LOWER_CASE_TABLE_NAMES, OPT_MAX_ALLOWED_PACKET,
- OPT_MAX_BINLOG_CACHE_SIZE, OPT_MAX_BINLOG_SIZE,
- OPT_MAX_CONNECTIONS, OPT_MAX_CONNECT_ERRORS,
- OPT_MAX_DELAYED_THREADS, OPT_MAX_HEP_TABLE_SIZE,
- OPT_MAX_JOIN_SIZE, OPT_MAX_PREPARED_STMT_COUNT,
- OPT_MAX_RELAY_LOG_SIZE, OPT_MAX_SORT_LENGTH,
- OPT_MAX_SEEKS_FOR_KEY, OPT_MAX_TMP_TABLES, OPT_MAX_USER_CONNECTIONS,
- OPT_MAX_LENGTH_FOR_SORT_DATA,
- OPT_MAX_WRITE_LOCK_COUNT, OPT_BULK_INSERT_BUFFER_SIZE,
- OPT_MAX_ERROR_COUNT, OPT_MULTI_RANGE_COUNT, OPT_MYISAM_DATA_POINTER_SIZE,
- OPT_MYISAM_BLOCK_SIZE, OPT_MYISAM_MAX_EXTRA_SORT_FILE_SIZE,
- OPT_MYISAM_MAX_SORT_FILE_SIZE, OPT_MYISAM_SORT_BUFFER_SIZE,
- OPT_MYISAM_USE_MMAP, OPT_MYISAM_REPAIR_THREADS,
- OPT_MYISAM_MMAP_SIZE,
- OPT_MYISAM_STATS_METHOD,
- OPT_NET_BUFFER_LENGTH, OPT_NET_RETRY_COUNT,
- OPT_NET_READ_TIMEOUT, OPT_NET_WRITE_TIMEOUT,
- OPT_OPEN_FILES_LIMIT,
- OPT_PRELOAD_BUFFER_SIZE,
- OPT_QUERY_CACHE_LIMIT, OPT_QUERY_CACHE_MIN_RES_UNIT, OPT_QUERY_CACHE_SIZE,
- OPT_QUERY_CACHE_TYPE, OPT_QUERY_CACHE_WLOCK_INVALIDATE, OPT_RECORD_BUFFER,
- OPT_RECORD_RND_BUFFER, OPT_DIV_PRECINCREMENT, OPT_RELAY_LOG_SPACE_LIMIT,
- OPT_RELAY_LOG_PURGE,
- OPT_RELAY_LOG_RECOVERY,
- OPT_SLAVE_NET_TIMEOUT, OPT_SLAVE_COMPRESSED_PROTOCOL, OPT_SLOW_LAUNCH_TIME,
- OPT_SLAVE_TRANS_RETRIES, OPT_READONLY, OPT_DEBUGGING,
- OPT_SORT_BUFFER, OPT_TABLE_OPEN_CACHE, OPT_TABLE_DEF_CACHE,
- OPT_THREAD_CONCURRENCY, OPT_THREAD_CACHE_SIZE,
- OPT_TMP_TABLE_SIZE, OPT_THREAD_STACK,
- OPT_WAIT_TIMEOUT,
- OPT_ERROR_LOG_FILE,
- OPT_DEFAULT_WEEK_FORMAT,
- OPT_RANGE_ALLOC_BLOCK_SIZE, OPT_ALLOW_SUSPICIOUS_UDFS,
- OPT_QUERY_ALLOC_BLOCK_SIZE, OPT_QUERY_PREALLOC_SIZE,
- OPT_TRANS_ALLOC_BLOCK_SIZE, OPT_TRANS_PREALLOC_SIZE,
- OPT_SYNC_FRM, OPT_SYNC_BINLOG,
- OPT_SYNC_REPLICATION,
- OPT_SYNC_REPLICATION_SLAVE_ID,
- OPT_SYNC_REPLICATION_TIMEOUT,
- OPT_ENABLE_SHARED_MEMORY,
- OPT_SHARED_MEMORY_BASE_NAME,
- OPT_OLD_PASSWORDS,
- OPT_OLD_ALTER_TABLE,
- OPT_EXPIRE_LOGS_DAYS,
- OPT_GROUP_CONCAT_MAX_LEN,
- OPT_DEFAULT_COLLATION,
- OPT_CHARACTER_SET_CLIENT_HANDSHAKE,
- OPT_CHARACTER_SET_FILESYSTEM,
- OPT_LC_ERROR_MESSAGES,
- OPT_LC_TIME_NAMES,
- OPT_INIT_CONNECT,
- OPT_INIT_SLAVE,
- OPT_SECURE_AUTH,
- OPT_DATE_FORMAT,
- OPT_TIME_FORMAT,
- OPT_DATETIME_FORMAT,
- OPT_LOG_QUERIES_NOT_USING_INDEXES,
- OPT_DEFAULT_TIME_ZONE,
- OPT_SYSDATE_IS_NOW,
- OPT_OPTIMIZER_SEARCH_DEPTH,
- OPT_OPTIMIZER_PRUNE_LEVEL,
- OPT_OPTIMIZER_SWITCH,
- OPT_UPDATABLE_VIEWS_WITH_LIMIT,
- OPT_SP_AUTOMATIC_PRIVILEGES,
- OPT_MAX_SP_RECURSION_DEPTH,
- OPT_AUTO_INCREMENT, OPT_AUTO_INCREMENT_OFFSET,
- OPT_ENABLE_LARGE_PAGES,
- OPT_ENABLE_SUPER_LARGE_PAGES,
- OPT_TIMED_MUTEXES,
- OPT_OLD_STYLE_USER_LIMITS,
- OPT_LOG_SLOW_ADMIN_STATEMENTS,
- OPT_TABLE_LOCK_WAIT_TIMEOUT,
- OPT_PLUGIN_LOAD,
- OPT_PLUGIN_DIR,
- OPT_LOG_OUTPUT,
- OPT_PORT_OPEN_TIMEOUT,
- OPT_PROFILING,
- OPT_KEEP_FILES_ON_CREATE,
- OPT_GENERAL_LOG,
- OPT_SLOW_LOG,
- OPT_THREAD_HANDLING,
- OPT_INNODB_ROLLBACK_ON_TIMEOUT,
- OPT_SECURE_FILE_PRIV,
- OPT_MIN_EXAMINED_ROW_LIMIT,
- OPT_LOG_SLOW_SLAVE_STATEMENTS,
-#if defined(ENABLED_DEBUG_SYNC)
- OPT_DEBUG_SYNC_TIMEOUT,
-#endif /* defined(ENABLED_DEBUG_SYNC) */
- OPT_OLD_MODE,
- OPT_SLAVE_EXEC_MODE,
- OPT_GENERAL_LOG_FILE,
- OPT_SLOW_QUERY_LOG_FILE,
- OPT_IGNORE_BUILTIN_INNODB,
- OPT_SYNC_RELAY_LOG,
- OPT_SYNC_RELAY_LOG_INFO,
- OPT_SYNC_MASTER_INFO
-};
-
+DYNAMIC_ARRAY all_options;
-#define LONG_TIMEOUT ((ulong) 3600L*24L*365L)
+/**
+ System variables are automatically command-line options (few
+ exceptions are documented in sys_var.h), so don't need
+ to be listed here.
+*/
struct my_option my_long_options[] =
{
@@ -5791,12 +5431,12 @@ struct my_option my_long_options[] =
(uchar**) &opt_help, (uchar**) &opt_help, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
#ifdef HAVE_REPLICATION
- {"abort-slave-event-count", OPT_ABORT_SLAVE_EVENT_COUNT,
+ {"abort-slave-event-count", 0,
"Option used by mysql-test for debugging and testing of replication.",
(uchar**) &abort_slave_event_count, (uchar**) &abort_slave_event_count,
0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif /* HAVE_REPLICATION */
- {"allow-suspicious-udfs", OPT_ALLOW_SUSPICIOUS_UDFS,
+ {"allow-suspicious-udfs", 0,
"Allows use of UDFs consisting of only one symbol xxx() "
"without corresponding xxx_init() or xxx_deinit(). That also means "
"that one can load any function from any library, for example exit() "
@@ -5805,51 +5445,16 @@ struct my_option my_long_options[] =
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"ansi", 'a', "Use ANSI SQL syntax instead of MySQL syntax. This mode will also set transaction isolation level 'serializable'.", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"auto-increment-increment", OPT_AUTO_INCREMENT,
- "Auto-increment columns are incremented by this",
- (uchar**) &global_system_variables.auto_increment_increment,
- (uchar**) &max_system_variables.auto_increment_increment, 0, GET_ULONG,
- OPT_ARG, 1, 1, 65535, 0, 1, 0 },
- {"auto-increment-offset", OPT_AUTO_INCREMENT_OFFSET,
- "Offset added to Auto-increment columns. Used when auto-increment-increment != 1",
- (uchar**) &global_system_variables.auto_increment_offset,
- (uchar**) &max_system_variables.auto_increment_offset, 0, GET_ULONG, OPT_ARG,
- 1, 1, 65535, 0, 1, 0 },
- {"automatic-sp-privileges", OPT_SP_AUTOMATIC_PRIVILEGES,
- "Creating and dropping stored procedures alters ACLs. Disable with --skip-automatic-sp-privileges.",
- (uchar**) &sp_automatic_privileges, (uchar**) &sp_automatic_privileges,
- 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
- {"basedir", 'b',
- "Path to installation directory. All paths are usually resolved relative to this.",
- (uchar**) &mysql_home_ptr, (uchar**) &mysql_home_ptr, 0, GET_STR, REQUIRED_ARG,
- 0, 0, 0, 0, 0, 0},
- {"big-tables", OPT_BIG_TABLES,
- "Allow big result sets by saving all temporary sets on file (Solves most 'table full' errors).",
- 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"bind-address", OPT_BIND_ADDRESS, "IP address to bind to.",
(uchar**) &my_bind_addr_str, (uchar**) &my_bind_addr_str, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"binlog_format", OPT_BINLOG_FORMAT,
- "Does not have any effect without '--log-bin'. "
- "Tell the master the form of binary logging to use: either 'row' for "
- "row-based binary logging, or 'statement' for statement-based binary "
- "logging, or 'mixed'. 'mixed' is statement-based binary logging except "
- "for those statements where only row-based is correct: those which "
- "involve user-defined functions (i.e. UDFs) or the UUID() function; for "
- "those, row-based binary logging is automatically used. "
-#ifdef HAVE_NDB_BINLOG
- "If ndbcluster is enabled and binlog_format is `mixed', the format switches"
- " to 'row' and back implicitly per each query accessing a NDB table."
-#endif
- ,(uchar**) &opt_binlog_format, (uchar**) &opt_binlog_format,
- 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"binlog-do-db", OPT_BINLOG_DO_DB,
"Tells the master it should log updates for the specified database, and exclude all others not explicitly mentioned.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"binlog-ignore-db", OPT_BINLOG_IGNORE_DB,
"Tells the master that updates to the given database should not be logged tothe binary log.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"binlog-row-event-max-size", OPT_BINLOG_ROWS_EVENT_MAX_SIZE,
+ {"binlog-row-event-max-size", 0,
"The maximum size of a row-based binary log event in bytes. Rows will be "
"grouped into events smaller than this size if possible. "
"The value has to be a multiple of 256.",
@@ -5864,12 +5469,12 @@ struct my_option my_long_options[] =
{"bootstrap", OPT_BOOTSTRAP, "Used by mysql installation scripts.", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"character-set-client-handshake", OPT_CHARACTER_SET_CLIENT_HANDSHAKE,
+ {"character-set-client-handshake", 0,
"Don't ignore client side character set value sent during handshake.",
(uchar**) &opt_character_set_client_handshake,
(uchar**) &opt_character_set_client_handshake,
0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
- {"character-set-filesystem", OPT_CHARACTER_SET_FILESYSTEM,
+ {"character-set-filesystem", 0,
"Set the filesystem character set.",
(uchar**) &character_set_filesystem_name,
(uchar**) &character_set_filesystem_name,
@@ -5877,229 +5482,114 @@ struct my_option my_long_options[] =
{"character-set-server", 'C', "Set the default character set.",
(uchar**) &default_character_set_name, (uchar**) &default_character_set_name,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
- {"character-sets-dir", OPT_CHARSETS_DIR,
- "Directory where character sets are.", (uchar**) &charsets_dir,
- (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"chroot", 'r', "Chroot mysqld daemon during startup.",
(uchar**) &mysqld_chroot, (uchar**) &mysqld_chroot, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
- {"collation-server", OPT_DEFAULT_COLLATION, "Set the default collation.",
+ {"collation-server", 0, "Set the default collation.",
(uchar**) &default_collation_name, (uchar**) &default_collation_name,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
- {"completion-type", OPT_COMPLETION_TYPE, "Default completion type.",
- (uchar**) &global_system_variables.completion_type,
- (uchar**) &max_system_variables.completion_type, 0, GET_ULONG,
- REQUIRED_ARG, 0, 0, 2, 0, 1, 0},
- {"concurrent-insert", OPT_CONCURRENT_INSERT,
- "Use concurrent insert with MyISAM. Disable with --concurrent-insert=0",
- (uchar**) &myisam_concurrent_insert, (uchar**) &myisam_concurrent_insert,
- 0, GET_ULONG, OPT_ARG, 1, 0, 2, 0, 0, 0},
{"console", OPT_CONSOLE, "Write error output on screen; Don't remove the console window on windows.",
(uchar**) &opt_console, (uchar**) &opt_console, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
{"core-file", OPT_WANT_CORE, "Write core on errors.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
- {"datadir", 'h', "Path to the database root.", (uchar**) &mysql_data_home,
- (uchar**) &mysql_data_home, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-#ifndef DBUG_OFF
- {"debug", '#', "Debug log.", (uchar**) &default_dbug_option,
- (uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
-#endif
{"default-character-set", 'C', "Set the default character set (deprecated option, use --character-set-server instead).",
(uchar**) &default_character_set_name, (uchar**) &default_character_set_name,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
- {"default-collation", OPT_DEFAULT_COLLATION, "Set the default collation (deprecated option, use --collation-server instead).",
+ {"default-collation", 0, "Set the default collation (deprecated option, use --collation-server instead).",
(uchar**) &default_collation_name, (uchar**) &default_collation_name,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
- {"default-storage-engine", OPT_STORAGE_ENGINE,
- "Set the default storage engine (table type) for tables.",
- (uchar**)&default_storage_engine_str, (uchar**)&default_storage_engine_str,
- 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"default-time-zone", OPT_DEFAULT_TIME_ZONE, "Set the default time zone.",
+ {"default-storage-engine", 0, "The default storage engine for new tables",
+ (uchar**) &default_storage_engine, 0, 0, GET_STR, REQUIRED_ARG,
+ (longlong)"MyISAM", 0, 0, 0, 0, 0 },
+ {"default-time-zone", 0, "Set the default time zone.",
(uchar**) &default_tz_name, (uchar**) &default_tz_name,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
- {"delay-key-write", OPT_DELAY_KEY_WRITE, "Type of DELAY_KEY_WRITE.",
- 0,0,0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"delay-key-write-for-all-tables", OPT_DELAY_KEY_WRITE_ALL,
"Don't flush key buffers between writes for any MyISAM table (Deprecated option, use --delay-key-write=all instead).",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_OPENSSL
- {"des-key-file", OPT_DES_KEY_FILE,
+ {"des-key-file", 0,
"Load keys for des_encrypt() and des_encrypt from given file.",
(uchar**) &des_key_file, (uchar**) &des_key_file, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
#endif /* HAVE_OPENSSL */
#ifdef HAVE_REPLICATION
- {"disconnect-slave-event-count", OPT_DISCONNECT_SLAVE_EVENT_COUNT,
+ {"disconnect-slave-event-count", 0,
"Option used by mysql-test for debugging and testing of replication.",
(uchar**) &disconnect_slave_event_count,
(uchar**) &disconnect_slave_event_count, 0, GET_INT, REQUIRED_ARG, 0, 0, 0,
0, 0, 0},
#endif /* HAVE_REPLICATION */
- {"enable-locking", OPT_ENABLE_LOCK,
+ {"enable-locking", 0,
"Deprecated option, use --external-locking instead.",
(uchar**) &opt_external_locking, (uchar**) &opt_external_locking,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-#ifdef _WIN32
- {"enable-named-pipe", OPT_HAVE_NAMED_PIPE, "Enable the named pipe (NT).",
- (uchar**) &opt_enable_named_pipe, (uchar**) &opt_enable_named_pipe, 0, GET_BOOL,
- NO_ARG, 0, 0, 0, 0, 0, 0},
-#endif
#ifdef HAVE_STACK_TRACE_ON_SEGV
- {"enable-pstack", OPT_DO_PSTACK, "Print a symbolic stack trace on failure.",
+ {"enable-pstack", 0, "Print a symbolic stack trace on failure.",
(uchar**) &opt_do_pstack, (uchar**) &opt_do_pstack, 0, GET_BOOL, NO_ARG, 0, 0,
0, 0, 0, 0},
#endif /* HAVE_STACK_TRACE_ON_SEGV */
- {"engine-condition-pushdown",
- OPT_ENGINE_CONDITION_PUSHDOWN,
- "Push supported query conditions to the storage engine.",
- (uchar**) &global_system_variables.engine_condition_pushdown,
- (uchar**) &global_system_variables.engine_condition_pushdown,
- 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
/* See how it's handled in get_one_option() */
- {"event-scheduler", OPT_EVENT_SCHEDULER, "Enable/disable the event scheduler.",
- NULL, NULL, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"exit-info", 'T', "Used for debugging; Use at your own risk!", 0, 0, 0,
GET_LONG, OPT_ARG, 0, 0, 0, 0, 0, 0},
- {"external-locking", OPT_USE_LOCKING, "Use system (external) locking (disabled by default). With this option enabled you can run myisamchk to test (not repair) tables while the MySQL server is running. Disable with --skip-external-locking.",
+ {"external-locking", 0, "Use system (external) locking (disabled by default). With this option enabled you can run myisamchk to test (not repair) tables while the MySQL server is running. Disable with --skip-external-locking.",
(uchar**) &opt_external_locking, (uchar**) &opt_external_locking,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"flush", OPT_FLUSH, "Flush tables to disk between SQL commands.", 0, 0, 0,
- GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
/* We must always support the next option to make scripts like mysqltest
easier to do */
- {"gdb", OPT_DEBUGGING,
+ {"gdb", 0,
"Set up signals usable for debugging",
(uchar**) &opt_debugging, (uchar**) &opt_debugging,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"general_log", OPT_GENERAL_LOG,
- "Enable|disable general log", (uchar**) &opt_log,
- (uchar**) &opt_log, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_LARGE_PAGE_OPTION
- {"large-pages", OPT_ENABLE_LARGE_PAGES, "Enable support for large pages. \
-Disable with --skip-large-pages.",
- (uchar**) &opt_large_pages, (uchar**) &opt_large_pages, 0, GET_BOOL,
- NO_ARG, 0, 0, 1, 0, 1, 0},
- {"super-large-pages", OPT_ENABLE_SUPER_LARGE_PAGES,
- "Enable support for super large pages. \
-Disable with --skip-super-large-pages.",
+ {"super-large-pages", 0, "Enable support for super large pages.",
(uchar**) &opt_super_large_pages, (uchar**) &opt_super_large_pages, 0,
- GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0},
+ GET_BOOL, OPT_ARG, 0, 0, 1, 0, 1, 0},
#endif
- {"ignore-builtin-innodb", OPT_IGNORE_BUILTIN_INNODB ,
- "Disable initialization of builtin InnoDB plugin",
- 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"init-connect", OPT_INIT_CONNECT, "Command(s) that are executed for each new connection",
- (uchar**) &opt_init_connect, (uchar**) &opt_init_connect, 0, GET_STR_ALLOC,
- REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-#ifndef DISABLE_GRANT_OPTIONS
- {"init-file", OPT_INIT_FILE, "Read SQL commands from this file at startup.",
- (uchar**) &opt_init_file, (uchar**) &opt_init_file, 0, GET_STR, REQUIRED_ARG,
- 0, 0, 0, 0, 0, 0},
-#endif
- {"init-rpl-role", OPT_INIT_RPL_ROLE, "Set the replication role.", 0, 0, 0,
- GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"init-slave", OPT_INIT_SLAVE, "Command(s) that are executed by a slave server \
-each time the SQL thread starts.",
- (uchar**) &opt_init_slave, (uchar**) &opt_init_slave, 0, GET_STR_ALLOC,
- REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"language", 'L',
"Client error messages in given language. May be given as a full path. "
"Deprecated. Use --lc-messages-dir instead.",
(uchar**) &lc_messages_dir_ptr, (uchar**) &lc_messages_dir_ptr, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"lc-messages-dir", 'L',
- "Directory where error messages are.", (uchar**) &lc_messages_dir_ptr,
- (uchar**) &lc_messages_dir_ptr, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"lc-messages", OPT_LC_ERROR_MESSAGES,
+ {"lc-messages", 0,
"Set the language used for the error messages.",
(uchar**) &lc_messages, (uchar**) &lc_messages, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0 },
- {"lc-time-names", OPT_LC_TIME_NAMES,
+ {"lc-time-names", 0,
"Set the language used for the month names and the days of the week.",
(uchar**) &lc_time_names_name,
(uchar**) &lc_time_names_name,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
- {"local-infile", OPT_LOCAL_INFILE,
- "Enable/disable LOAD DATA LOCAL INFILE (takes values 1|0).",
- (uchar**) &opt_local_infile,
- (uchar**) &opt_local_infile, 0, GET_BOOL, OPT_ARG,
- 1, 0, 0, 0, 0, 0},
{"log", 'l', "Log connections and queries to file (deprecated option, use "
- "--general_log/--general_log_file instead).", (uchar**) &opt_logname,
- (uchar**) &opt_logname, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
- {"general_log_file", OPT_GENERAL_LOG_FILE,
- "Log connections and queries to given file.", (uchar**) &opt_logname,
- (uchar**) &opt_logname, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ "--general-log/--general-log-file instead).", (uchar**) &opt_logname,
+ (uchar**) &opt_logname, 0, GET_STR_ALLOC, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"log-bin", OPT_BIN_LOG,
"Log update queries in binary format. Optional (but strongly recommended "
"to avoid replication problems if server's hostname changes) argument "
"should be the chosen location for the binary log files.",
(uchar**) &opt_bin_logname, (uchar**) &opt_bin_logname, 0, GET_STR_ALLOC,
OPT_ARG, 0, 0, 0, 0, 0, 0},
- {"log-bin-index", OPT_BIN_LOG_INDEX,
+ {"log-bin-index", 0,
"File that holds the names for last binary log files.",
(uchar**) &opt_binlog_index_name, (uchar**) &opt_binlog_index_name, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-#ifndef TO_BE_REMOVED_IN_5_1_OR_6_0
- /*
- In 5.0.6 we introduced the below option, then in 5.0.16 we renamed it to
- log-bin-trust-function-creators but kept also the old name for
- compatibility; the behaviour was also changed to apply only to functions
- (and triggers). In a future release this old name could be removed.
- */
- {"log-bin-trust-routine-creators", OPT_LOG_BIN_TRUST_FUNCTION_CREATORS,
- "(deprecated) Use log-bin-trust-function-creators.",
- (uchar**) &trust_function_creators, (uchar**) &trust_function_creators, 0,
- GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-#endif
- /*
- This option starts with "log-bin" to emphasize that it is specific of
- binary logging.
- */
- {"log-bin-trust-function-creators", OPT_LOG_BIN_TRUST_FUNCTION_CREATORS,
- "If equal to 0 (the default), then when --log-bin is used, creation of "
- "a stored function (or trigger) is allowed only to users having the SUPER privilege "
- "and only if this stored function (trigger) may not break binary logging."
- "Note that if ALL connections to this server ALWAYS use row-based binary "
- "logging, the security issues do not exist and the binary logging cannot "
- "break, so you can safely set this to 1."
- ,(uchar**) &trust_function_creators, (uchar**) &trust_function_creators, 0,
- GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"log-error", OPT_ERROR_LOG_FILE, "Error log file.",
- (uchar**) &log_error_file_ptr, (uchar**) &log_error_file_ptr, 0, GET_STR,
- OPT_ARG, 0, 0, 0, 0, 0, 0},
{"log-isam", OPT_ISAM_LOG, "Log all MyISAM changes to file.",
(uchar**) &myisam_log_filename, (uchar**) &myisam_log_filename, 0, GET_STR,
OPT_ARG, 0, 0, 0, 0, 0, 0},
{"log-long-format", '0',
"Log some extra information to update log. Please note that this option is deprecated; see --log-short-format option.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-#ifdef WITH_CSV_STORAGE_ENGINE
- {"log-output", OPT_LOG_OUTPUT,
- "Syntax: log-output[=value[,value...]], where \"value\" could be TABLE, "
- "FILE or NONE.",
- (uchar**) &log_output_str, (uchar**) &log_output_str, 0,
- GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
-#endif
- {"log-queries-not-using-indexes", OPT_LOG_QUERIES_NOT_USING_INDEXES,
- "Log queries that are executed without benefit of any index to the slow log if it is open.",
- (uchar**) &opt_log_queries_not_using_indexes, (uchar**) &opt_log_queries_not_using_indexes,
- 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"log-short-format", OPT_SHORT_LOG_FORMAT,
+ {"log-short-format", 0,
"Don't log extra information to update and slow-query logs.",
(uchar**) &opt_short_log_format, (uchar**) &opt_short_log_format,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"log-slave-updates", OPT_LOG_SLAVE_UPDATES,
- "Tells the slave to log the updates from the slave thread to the binary log. You will need to turn it on if you plan to daisy-chain the slaves.",
- (uchar**) &opt_log_slave_updates, (uchar**) &opt_log_slave_updates, 0, GET_BOOL,
- NO_ARG, 0, 0, 0, 0, 0, 0},
- {"log-slow-admin-statements", OPT_LOG_SLOW_ADMIN_STATEMENTS,
+ {"log-slow-admin-statements", 0,
"Log slow OPTIMIZE, ANALYZE, ALTER and other administrative statements to the slow log if it is open.",
(uchar**) &opt_log_slow_admin_statements,
(uchar**) &opt_log_slow_admin_statements,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"log-slow-slave-statements", OPT_LOG_SLOW_SLAVE_STATEMENTS,
+ {"log-slow-slave-statements", 0,
"Log slow statements executed by slave thread to the slow log if it is open.",
(uchar**) &opt_log_slow_slave_statements,
(uchar**) &opt_log_slow_slave_statements,
@@ -6109,19 +5599,15 @@ each time the SQL thread starts.",
"mysql.slow_log or hostname-slow.log if --log-output=file is used. "
"Must be enabled to activate other slow log options. "
"Deprecated option, use --slow-query-log/--slow-query-log-file instead.",
- (uchar**) &opt_slow_logname, (uchar**) &opt_slow_logname, 0, GET_STR, OPT_ARG,
+ (uchar**) &opt_slow_logname, (uchar**) &opt_slow_logname, 0, GET_STR_ALLOC, OPT_ARG,
0, 0, 0, 0, 0, 0},
- {"slow-query-log-file", OPT_SLOW_QUERY_LOG_FILE,
- "Log slow queries to given log file. Defaults logging to hostname-slow.log. Must be enabled to activate other slow log options.",
- (uchar**) &opt_slow_logname, (uchar**) &opt_slow_logname, 0, GET_STR,
- REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"log-tc", OPT_LOG_TC,
+ {"log-tc", 0,
"Path to transaction coordinator log (used for transactions that affect "
"more than one storage engine, when binary log is disabled)",
(uchar**) &opt_tc_log_file, (uchar**) &opt_tc_log_file, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_MMAP
- {"log-tc-size", OPT_LOG_TC_SIZE, "Size of transaction coordinator log.",
+ {"log-tc-size", 0, "Size of transaction coordinator log.",
(uchar**) &opt_tc_log_size, (uchar**) &opt_tc_log_size, 0, GET_ULONG,
REQUIRED_ARG, TC_LOG_MIN_SIZE, TC_LOG_MIN_SIZE, ULONG_MAX, 0,
TC_LOG_PAGE_SIZE, 0},
@@ -6131,199 +5617,37 @@ each time the SQL thread starts.",
log and this option justs turns on --log-bin instead.",
(uchar**) &opt_update_logname, (uchar**) &opt_update_logname, 0, GET_STR,
OPT_ARG, 0, 0, 0, 0, 0, 0},
- {"log-warnings", 'W', "Log some not critical warnings to the log file.",
- (uchar**) &global_system_variables.log_warnings,
- (uchar**) &max_system_variables.log_warnings, 0, GET_ULONG, OPT_ARG, 1, 0, 0,
- 0, 0, 0},
- {"low-priority-updates", OPT_LOW_PRIORITY_UPDATES,
- "INSERT/DELETE/UPDATE has lower priority than selects.",
- (uchar**) &global_system_variables.low_priority_updates,
- (uchar**) &max_system_variables.low_priority_updates,
- 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"master-info-file", OPT_MASTER_INFO_FILE,
+ {"master-info-file", 0,
"The location and name of the file that remembers the master and where the I/O replication \
thread is in the master's binlogs.",
(uchar**) &master_info_file, (uchar**) &master_info_file, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"master-retry-count", OPT_MASTER_RETRY_COUNT,
+ {"master-retry-count", 0,
"The number of tries the slave will make to connect to the master before giving up.",
(uchar**) &master_retry_count, (uchar**) &master_retry_count, 0, GET_ULONG,
REQUIRED_ARG, 3600*24, 0, 0, 0, 0, 0},
#ifdef HAVE_REPLICATION
- {"max-binlog-dump-events", OPT_MAX_BINLOG_DUMP_EVENTS,
+ {"init-rpl-role", 0, "Set the replication role.",
+ (uchar**)&rpl_status, (uchar**)&rpl_status, &rpl_role_typelib,
+ GET_ENUM, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"max-binlog-dump-events", 0,
"Option used by mysql-test for debugging and testing of replication.",
(uchar**) &max_binlog_dump_events, (uchar**) &max_binlog_dump_events, 0,
GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif /* HAVE_REPLICATION */
- {"memlock", OPT_MEMLOCK, "Lock mysqld in memory.", (uchar**) &locked_in_memory,
+ {"memlock", 0, "Lock mysqld in memory.", (uchar**) &locked_in_memory,
(uchar**) &locked_in_memory, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"myisam-recover", OPT_MYISAM_RECOVER,
- "Syntax: myisam-recover[=option[,option...]], where option can be DEFAULT, BACKUP, FORCE or QUICK.",
- (uchar**) &myisam_recover_options_str, (uchar**) &myisam_recover_options_str, 0,
- GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
-#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
- {"ndb-connectstring", OPT_NDB_CONNECTSTRING,
- "Connect string for ndbcluster.",
- (uchar**) &opt_ndb_connectstring,
- (uchar**) &opt_ndb_connectstring,
- 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"ndb-mgmd-host", OPT_NDB_MGMD,
- "Set host and port for ndb_mgmd. Syntax: hostname[:port]",
- (uchar**) &opt_ndb_mgmd,
- (uchar**) &opt_ndb_mgmd,
- 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"ndb-nodeid", OPT_NDB_NODEID,
- "Nodeid for this mysqlserver in the cluster.",
- (uchar**) &opt_ndb_nodeid,
- (uchar**) &opt_ndb_nodeid,
- 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"ndb-autoincrement-prefetch-sz", OPT_NDB_AUTOINCREMENT_PREFETCH_SZ,
- "Specify number of autoincrement values that are prefetched.",
- (uchar**) &global_system_variables.ndb_autoincrement_prefetch_sz,
- (uchar**) &max_system_variables.ndb_autoincrement_prefetch_sz,
- 0, GET_ULONG, REQUIRED_ARG, 1, 1, 256, 0, 0, 0},
- {"ndb-force-send", OPT_NDB_FORCE_SEND,
- "Force send of buffers to ndb immediately without waiting for "
- "other threads.",
- (uchar**) &global_system_variables.ndb_force_send,
- (uchar**) &global_system_variables.ndb_force_send,
- 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
- {"ndb_force_send", OPT_NDB_FORCE_SEND,
- "same as --ndb-force-send.",
- (uchar**) &global_system_variables.ndb_force_send,
- (uchar**) &global_system_variables.ndb_force_send,
- 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
- {"ndb-extra-logging", OPT_NDB_EXTRA_LOGGING,
- "Turn on more logging in the error log.",
- (uchar**) &ndb_extra_logging,
- (uchar**) &ndb_extra_logging,
- 0, GET_INT, OPT_ARG, 0, 0, 0, 0, 0, 0},
-#ifdef HAVE_NDB_BINLOG
- {"ndb-report-thresh-binlog-epoch-slip", OPT_NDB_REPORT_THRESH_BINLOG_EPOCH_SLIP,
- "Threshold on number of epochs to be behind before reporting binlog status. "
- "E.g. 3 means that if the difference between what epoch has been received "
- "from the storage nodes and what has been applied to the binlog is 3 or more, "
- "a status message will be sent to the cluster log.",
- (uchar**) &ndb_report_thresh_binlog_epoch_slip,
- (uchar**) &ndb_report_thresh_binlog_epoch_slip,
- 0, GET_ULONG, REQUIRED_ARG, 3, 0, 256, 0, 0, 0},
- {"ndb-report-thresh-binlog-mem-usage", OPT_NDB_REPORT_THRESH_BINLOG_MEM_USAGE,
- "Threshold on percentage of free memory before reporting binlog status. E.g. "
- "10 means that if amount of available memory for receiving binlog data from "
- "the storage nodes goes below 10%, "
- "a status message will be sent to the cluster log.",
- (uchar**) &ndb_report_thresh_binlog_mem_usage,
- (uchar**) &ndb_report_thresh_binlog_mem_usage,
- 0, GET_ULONG, REQUIRED_ARG, 10, 0, 100, 0, 0, 0},
-#endif
- {"ndb-use-exact-count", OPT_NDB_USE_EXACT_COUNT,
- "Use exact records count during query planning and for fast "
- "select count(*), disable for faster queries.",
- (uchar**) &global_system_variables.ndb_use_exact_count,
- (uchar**) &global_system_variables.ndb_use_exact_count,
- 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
- {"ndb_use_exact_count", OPT_NDB_USE_EXACT_COUNT,
- "same as --ndb-use-exact-count.",
- (uchar**) &global_system_variables.ndb_use_exact_count,
- (uchar**) &global_system_variables.ndb_use_exact_count,
- 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
- {"ndb-use-transactions", OPT_NDB_USE_TRANSACTIONS,
- "Use transactions for large inserts, if enabled then large "
- "inserts will be split into several smaller transactions",
- (uchar**) &global_system_variables.ndb_use_transactions,
- (uchar**) &global_system_variables.ndb_use_transactions,
- 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
- {"ndb_use_transactions", OPT_NDB_USE_TRANSACTIONS,
- "same as --ndb-use-transactions.",
- (uchar**) &global_system_variables.ndb_use_transactions,
- (uchar**) &global_system_variables.ndb_use_transactions,
- 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
- {"ndb-shm", OPT_NDB_SHM,
- "Use shared memory connections when available.",
- (uchar**) &opt_ndb_shm,
- (uchar**) &opt_ndb_shm,
- 0, GET_BOOL, OPT_ARG, OPT_NDB_SHM_DEFAULT, 0, 0, 0, 0, 0},
- {"ndb-optimized-node-selection", OPT_NDB_OPTIMIZED_NODE_SELECTION,
- "Select nodes for transactions in a more optimal way.",
- (uchar**) &opt_ndb_optimized_node_selection,
- (uchar**) &opt_ndb_optimized_node_selection,
- 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
- { "ndb-cache-check-time", OPT_NDB_CACHE_CHECK_TIME,
- "A dedicated thread is created to, at the given millisecons interval, invalidate the query cache if another MySQL server in the cluster has changed the data in the database.",
- (uchar**) &opt_ndb_cache_check_time, (uchar**) &opt_ndb_cache_check_time, 0, GET_ULONG, REQUIRED_ARG,
- 0, 0, LONG_TIMEOUT, 0, 1, 0},
- {"ndb-index-stat-enable", OPT_NDB_INDEX_STAT_ENABLE,
- "Use ndb index statistics in query optimization.",
- (uchar**) &global_system_variables.ndb_index_stat_enable,
- (uchar**) &max_system_variables.ndb_index_stat_enable,
- 0, GET_BOOL, OPT_ARG, 0, 0, 1, 0, 0, 0},
-#endif
- {"ndb-use-copying-alter-table",
- OPT_NDB_USE_COPYING_ALTER_TABLE,
- "Force ndbcluster to always copy tables at alter table (should only be used if on-line alter table fails).",
- (uchar**) &global_system_variables.ndb_use_copying_alter_table,
- (uchar**) &global_system_variables.ndb_use_copying_alter_table,
- 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"new", 'n', "Use very new possible 'unsafe' functions.",
- (uchar**) &global_system_variables.new_mode,
- (uchar**) &max_system_variables.new_mode,
- 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-#ifdef NOT_YET
- {"no-mix-table-types", OPT_NO_MIX_TYPE, "Don't allow commands with uses two different table types.",
- (uchar**) &opt_no_mix_types, (uchar**) &opt_no_mix_types, 0, GET_BOOL, NO_ARG,
- 0, 0, 0, 0, 0, 0},
-#endif
- {"old-alter-table", OPT_OLD_ALTER_TABLE,
- "Use old, non-optimized alter table.",
- (uchar**) &global_system_variables.old_alter_table,
- (uchar**) &max_system_variables.old_alter_table, 0, GET_BOOL, NO_ARG,
- 0, 0, 0, 0, 0, 0},
- {"old-passwords", OPT_OLD_PASSWORDS, "Use old password encryption method (needed for 4.0 and older clients).",
- (uchar**) &global_system_variables.old_passwords,
- (uchar**) &max_system_variables.old_passwords, 0, GET_BOOL, NO_ARG,
- 0, 0, 0, 0, 0, 0},
{"one-thread", OPT_ONE_THREAD,
"(deprecated): Only use one thread (for debugging under Linux). Use thread-handling=no-threads instead",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"old-style-user-limits", OPT_OLD_STYLE_USER_LIMITS,
+ {"old-style-user-limits", 0,
"Enable old-style user limits (before 5.0.3 user resources were counted per each user+host vs. per account)",
(uchar**) &opt_old_style_user_limits, (uchar**) &opt_old_style_user_limits,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"pid-file", OPT_PID_FILE, "Pid file used by safe_mysqld.",
- (uchar**) &pidfile_name_ptr, (uchar**) &pidfile_name_ptr, 0, GET_STR,
- REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"port", 'P', "Port number to use for connection or 0 for default to, in "
- "order of preference, my.cnf, $MYSQL_TCP_PORT, "
-#if MYSQL_PORT_DEFAULT == 0
- "/etc/services, "
-#endif
- "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
- (uchar**) &mysqld_port,
- (uchar**) &mysqld_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"port-open-timeout", OPT_PORT_OPEN_TIMEOUT,
+ {"port-open-timeout", 0,
"Maximum time in seconds to wait for the port to become free. "
"(Default: no wait)", (uchar**) &mysqld_port_timeout,
(uchar**) &mysqld_port_timeout, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-#if defined(ENABLED_PROFILING)
- {"profiling_history_size", OPT_PROFILING, "Limit of query profiling memory",
- (uchar**) &global_system_variables.profiling_history_size,
- (uchar**) &max_system_variables.profiling_history_size,
- 0, GET_ULONG, REQUIRED_ARG, 15, 0, 100, 0, 0, 0},
-#endif
- {"relay-log", OPT_RELAY_LOG,
- "The location and name to use for relay logs.",
- (uchar**) &opt_relay_logname, (uchar**) &opt_relay_logname, 0,
- GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"relay-log-index", OPT_RELAY_LOG_INDEX,
- "The location and name to use for the file that keeps a list of the last \
-relay logs.",
- (uchar**) &opt_relaylog_index_name, (uchar**) &opt_relaylog_index_name, 0,
- GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"relay-log-info-file", OPT_RELAY_LOG_INFO_FILE,
- "The location and name of the file that remembers where the SQL replication \
-thread is in the relay logs.",
- (uchar**) &relay_log_info_file, (uchar**) &relay_log_info_file, 0, GET_STR,
- REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"replicate-do-db", OPT_REPLICATE_DO_DB,
"Tells the slave thread to restrict replication to the specified database. To specify more than one database, use the directive multiple times, once for each database. Note that this will only work if you do not use cross-database queries such as UPDATE some_db.some_table SET foo='bar' while having selected a different or no database. If you need cross database updates to work, make sure you have 3.23.28 or later, and use replicate-wild-do-table=db_name.%.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -6340,7 +5664,7 @@ thread is in the relay logs.",
"Updates to a database with a different name than the original. Example: replicate-rewrite-db=master_db_name->slave_db_name.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_REPLICATION
- {"replicate-same-server-id", OPT_REPLICATE_SAME_SERVER_ID,
+ {"replicate-same-server-id", 0,
"In replication, if set to 1, do not skip events having our server id. \
Default value is 0 (to break infinite loops in circular replication). \
Can't be set to 1 if --log-slave-updates is used.",
@@ -6354,67 +5678,34 @@ Can't be set to 1 if --log-slave-updates is used.",
{"replicate-wild-ignore-table", OPT_REPLICATE_WILD_IGNORE_TABLE,
"Tells the slave thread to not replicate to the tables that match the given wildcard pattern. To specify more than one table to ignore, use the directive multiple times, once for each table. This will work for cross-database updates. Example: replicate-wild-ignore-table=foo%.bar% will not do updates to tables in databases that start with foo and whose table names start with bar.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- // In replication, we may need to tell the other servers how to connect
- {"report-host", OPT_REPORT_HOST,
- "Hostname or IP of the slave to be reported to to the master during slave registration. Will appear in the output of SHOW SLAVE HOSTS. Leave unset if you do not want the slave to register itself with the master. Note that it is not sufficient for the master to simply read the IP of the slave off the socket once the slave connects. Due to NAT and other routing issues, that IP may not be valid for connecting to the slave from the master or other hosts.",
- (uchar**) &report_host, (uchar**) &report_host, 0, GET_STR, REQUIRED_ARG, 0, 0,
- 0, 0, 0, 0},
- {"report-password", OPT_REPORT_PASSWORD, "Undocumented.",
- (uchar**) &report_password, (uchar**) &report_password, 0, GET_STR,
- REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"report-port", OPT_REPORT_PORT,
- "Port for connecting to slave reported to the master during slave registration. Set it only if the slave is listening on a non-default port or if you have a special tunnel from the master or other clients to the slave. If not sure, leave this option unset.",
- (uchar**) &report_port, (uchar**) &report_port, 0, GET_UINT, REQUIRED_ARG,
- MYSQL_PORT, 0, 0, 0, 0, 0},
- {"report-user", OPT_REPORT_USER, "Undocumented.", (uchar**) &report_user,
- (uchar**) &report_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"rpl-recovery-rank", OPT_RPL_RECOVERY_RANK, "Undocumented.",
- (uchar**) &rpl_recovery_rank, (uchar**) &rpl_recovery_rank, 0, GET_ULONG,
- REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"safe-mode", OPT_SAFE, "Skip some optimize stages (for testing).",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifndef TO_BE_DELETED
- {"safe-show-database", OPT_SAFE_SHOW_DB,
+ {"safe-show-database", 0,
"Deprecated option; use GRANT SHOW DATABASES instead...",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"safe-user-create", OPT_SAFE_USER_CREATE,
+ {"safe-user-create", 0,
"Don't allow new user creation by the user who has no write privileges to the mysql.user table.",
(uchar**) &opt_safe_user_create, (uchar**) &opt_safe_user_create, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0},
- {"safemalloc-mem-limit", OPT_SAFEMALLOC_MEM_LIMIT,
- "Simulate memory shortage when compiled with the --with-debug=full option.",
- 0, 0, 0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"secure-auth", OPT_SECURE_AUTH, "Disallow authentication for accounts that have old (pre-4.1) passwords.",
- (uchar**) &opt_secure_auth, (uchar**) &opt_secure_auth, 0, GET_BOOL, NO_ARG,
- my_bool(0), 0, 0, 0, 0, 0},
- {"secure-file-priv", OPT_SECURE_FILE_PRIV,
- "Limit LOAD DATA, SELECT ... OUTFILE, and LOAD_FILE() to files within specified directory",
- (uchar**) &opt_secure_file_priv, (uchar**) &opt_secure_file_priv, 0,
- GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"server-id", OPT_SERVER_ID,
- "Uniquely identifies the server instance in the community of replication partners.",
- (uchar**) &server_id, (uchar**) &server_id, 0, GET_ULONG, REQUIRED_ARG, 0, 0, UINT_MAX32,
- 0, 0, 0},
+#if !defined(DBUG_OFF) && defined(SAFEMALLOC)
+ {"safemalloc", 0, "Enable the memory allocation checking.",
+ (uchar**) &sf_malloc_quick, (uchar**) &sf_malloc_quick, 0,
+ GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
+ {"safemalloc-mem-limit", 0, "Simulate memory shortage.",
+ (uchar**)&sf_malloc_mem_limit, (uchar**)&sf_malloc_mem_limit, 0, GET_UINT,
+ REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+#endif
{"set-variable", 'O',
"Change the value of a variable. Please note that this option is deprecated;you can set variables directly with --variable-name=value.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-#ifdef HAVE_SMEM
- {"shared-memory", OPT_ENABLE_SHARED_MEMORY,
- "Enable the shared memory.",(uchar**) &opt_enable_shared_memory, (uchar**) &opt_enable_shared_memory,
- 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-#endif
-#ifdef HAVE_SMEM
- {"shared-memory-base-name",OPT_SHARED_MEMORY_BASE_NAME,
- "Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name,
- 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-#endif
- {"show-slave-auth-info", OPT_SHOW_SLAVE_AUTH_INFO,
+ {"show-slave-auth-info", 0,
"Show user and password in SHOW SLAVE HOSTS on this master",
(uchar**) &opt_show_slave_auth_info, (uchar**) &opt_show_slave_auth_info, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifndef DISABLE_GRANT_OPTIONS
- {"skip-grant-tables", OPT_SKIP_GRANT,
+ {"skip-grant-tables", 0,
"Start without grant tables. This gives all users FULL ACCESS to all tables!",
(uchar**) &opt_noacl, (uchar**) &opt_noacl, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
0},
@@ -6427,22 +5718,9 @@ Can't be set to 1 if --log-slave-updates is used.",
{"skip-name-resolve", OPT_SKIP_RESOLVE,
"Don't resolve hostnames. All hostnames are IP's or 'localhost'.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"skip-networking", OPT_SKIP_NETWORKING,
- "Don't allow connection with TCP/IP.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0,
- 0, 0, 0},
{"skip-new", OPT_SKIP_NEW, "Don't use new, possible wrong routines.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-#ifndef DBUG_OFF
-#ifdef SAFEMALLOC
- {"skip-safemalloc", OPT_SKIP_SAFEMALLOC,
- "Don't use the memory allocation checking.", 0, 0, 0, GET_NO_ARG, NO_ARG,
- 0, 0, 0, 0, 0, 0},
-#endif
-#endif
- {"skip-show-database", OPT_SKIP_SHOW_DB,
- "Don't allow 'SHOW DATABASE' commands.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
- 0, 0, 0, 0},
- {"skip-slave-start", OPT_SKIP_SLAVE_START,
+ {"skip-slave-start", 0,
"If set, slave is not autostarted.", (uchar**) &opt_skip_slave_start,
(uchar**) &opt_skip_slave_start, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"skip-stack-trace", OPT_SKIP_STACK_TRACE,
@@ -6455,44 +5733,22 @@ Can't be set to 1 if --log-slave-updates is used.",
"because it has no effect; the implied behavior is already the default.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_REPLICATION
- {"slave-load-tmpdir", OPT_SLAVE_LOAD_TMPDIR,
- "The location where the slave should put its temporary files when \
-replicating a LOAD DATA INFILE command.",
- (uchar**) &slave_load_tmpdir, (uchar**) &slave_load_tmpdir, 0, GET_STR_ALLOC,
- REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"slave-skip-errors", OPT_SLAVE_SKIP_ERRORS,
- "Tells the slave thread to continue replication when a query event returns an error from the provided list.",
- 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"slave-exec-mode", OPT_SLAVE_EXEC_MODE,
- "Modes for how replication events should be executed. Legal values are STRICT (default) and IDEMPOTENT. In IDEMPOTENT mode, replication will not stop for operations that are idempotent. In STRICT mode, replication will stop on any unexpected difference between the master and the slave.",
- (uchar**) &slave_exec_mode_str, (uchar**) &slave_exec_mode_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-#endif
- {"slow-query-log", OPT_SLOW_LOG,
- "Enable|disable slow query log", (uchar**) &opt_slow_log,
- (uchar**) &opt_slow_log, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
- {"socket", OPT_SOCKET, "Socket file to use for connection.",
- (uchar**) &mysqld_unix_port, (uchar**) &mysqld_unix_port, 0, GET_STR,
- REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-#ifdef HAVE_REPLICATION
- {"sporadic-binlog-dump-fail", OPT_SPORADIC_BINLOG_DUMP_FAIL,
+ {"sporadic-binlog-dump-fail", 0,
"Option used by mysql-test for debugging and testing of replication.",
(uchar**) &opt_sporadic_binlog_dump_fail,
(uchar**) &opt_sporadic_binlog_dump_fail, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
0},
#endif /* HAVE_REPLICATION */
- {"sql-bin-update-same", OPT_SQL_BIN_UPDATE_SAME,
- "The update log is deprecated since version 5.0, is replaced by the binary \
-log and this option does nothing anymore.",
+ {"sql-bin-update-same", 0,
+ "The update log is deprecated since version 5.0, is replaced by the "
+ "binary log and this option does nothing anymore.",
0, 0, 0, GET_DISABLED, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"sql-mode", OPT_SQL_MODE,
- "Syntax: sql-mode=option[,option[,option...]] where option can be one of: REAL_AS_FLOAT, PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE, ONLY_FULL_GROUP_BY, NO_UNSIGNED_SUBTRACTION.",
- (uchar**) &sql_mode_str, (uchar**) &sql_mode_str, 0, GET_STR, REQUIRED_ARG, 0,
- 0, 0, 0, 0, 0},
-#ifdef HAVE_OPENSSL
-#include "sslopt-longopts.h"
-#endif
+ {"ssl", 0,
+ "Enable SSL for connection (automatically enabled with other flags).",
+ (uchar **) &opt_use_ssl, (uchar **) &opt_use_ssl, 0, GET_BOOL, OPT_ARG, 0, 0, 0,
+ 0, 0, 0},
#ifdef __WIN__
- {"standalone", OPT_STANDALONE,
+ {"standalone", 0,
"Dummy option to start as a standalone program (NT).", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
@@ -6504,14 +5760,14 @@ log and this option does nothing anymore.",
option if compiled with valgrind support.
*/
IF_PURIFY(0,1), 0, 0, 0, 0, 0},
- {"sysdate-is-now", OPT_SYSDATE_IS_NOW,
+ {"sysdate-is-now", 0,
"Non-default option to alias SYSDATE() to NOW() to make it safe-replicable. Since 5.0, SYSDATE() returns a `dynamic' value different for different invocations, even within the same statement.",
(uchar**) &global_system_variables.sysdate_is_now,
0, 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0},
- {"tc-heuristic-recover", OPT_TC_HEURISTIC_RECOVER,
+ {"tc-heuristic-recover", 0,
"Decision to use in heuristic recover process. Possible values are COMMIT or ROLLBACK.",
- (uchar**) &opt_tc_heuristic_recover, (uchar**) &opt_tc_heuristic_recover,
- 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ (uchar**) &tc_heuristic_recover, (uchar**) &tc_heuristic_recover,
+ &tc_heuristic_recover_typelib, GET_ENUM, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#if defined(ENABLED_DEBUG_SYNC)
{"debug-sync-timeout", OPT_DEBUG_SYNC_TIMEOUT,
"Enable the debug sync facility "
@@ -6520,7 +5776,7 @@ log and this option does nothing anymore.",
(uchar**) &opt_debug_sync_timeout, 0,
0, GET_UINT, OPT_ARG, 0, 0, UINT_MAX, 0, 0, 0},
#endif /* defined(ENABLED_DEBUG_SYNC) */
- {"temp-pool", OPT_TEMP_POOL,
+ {"temp-pool", 0,
#if (ENABLE_TEMP_POOL)
"Using this option will cause most temporary files created to use a small set of names, rather than a unique name for each new file.",
#else
@@ -6528,24 +5784,11 @@ log and this option does nothing anymore.",
#endif
(uchar**) &use_temp_pool, (uchar**) &use_temp_pool, 0, GET_BOOL, NO_ARG, 1,
0, 0, 0, 0, 0},
-
- {"timed_mutexes", OPT_TIMED_MUTEXES,
- "Specify whether to time mutexes (only InnoDB mutexes are currently supported)",
- (uchar**) &timed_mutexes, (uchar**) &timed_mutexes, 0, GET_BOOL, NO_ARG, 0,
- 0, 0, 0, 0, 0},
- {"tmpdir", 't',
- "Path for temporary files. Several paths may be specified, separated by a "
-#if defined(__WIN__) || defined(__NETWARE__)
- "semicolon (;)"
-#else
- "colon (:)"
-#endif
- ", in this case they are used in a round-robin fashion.",
- (uchar**) &opt_mysql_tmpdir,
- (uchar**) &opt_mysql_tmpdir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"transaction-isolation", OPT_TX_ISOLATION,
- "Default transaction isolation level.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0,
- 0, 0, 0, 0, 0},
+ {"transaction-isolation", 0,
+ "Default transaction isolation level.",
+ (uchar**)&global_system_variables.tx_isolation,
+ (uchar**)&global_system_variables.tx_isolation, &tx_isolation_typelib,
+ GET_ENUM, REQUIRED_ARG, ISO_REPEATABLE_READ, 0, 0, 0, 0, 0},
{"use-symbolic-links", 's', "Enable symbolic link support. Deprecated option; use --symbolic-links instead.",
(uchar**) &my_use_symdir, (uchar**) &my_use_symdir, 0, GET_BOOL, NO_ARG,
IF_PURIFY(0,1), 0, 0, 0, 0, 0},
@@ -6560,556 +5803,19 @@ log and this option does nothing anymore.",
(uchar**) &global_system_variables.log_warnings,
(uchar**) &max_system_variables.log_warnings, 0, GET_ULONG, OPT_ARG,
1, 0, ULONG_MAX, 0, 0, 0},
- { "back_log", OPT_BACK_LOG,
- "The number of outstanding connection requests MySQL can have. This comes into play when the main MySQL thread gets very many connection requests in a very short time.",
- (uchar**) &back_log, (uchar**) &back_log, 0, GET_ULONG,
- REQUIRED_ARG, 50, 1, 65535, 0, 1, 0 },
- {"binlog_cache_size", OPT_BINLOG_CACHE_SIZE,
- "The size of the cache to hold the SQL statements for the binary log during a transaction. If you often use big, multi-statement transactions you can increase this to get more performance.",
- (uchar**) &binlog_cache_size, (uchar**) &binlog_cache_size, 0, GET_ULONG,
- REQUIRED_ARG, 32*1024L, IO_SIZE, ULONG_MAX, 0, IO_SIZE, 0},
- {"bulk_insert_buffer_size", OPT_BULK_INSERT_BUFFER_SIZE,
- "Size of tree cache used in bulk insert optimisation. Note that this is a limit per thread!",
- (uchar**) &global_system_variables.bulk_insert_buff_size,
- (uchar**) &max_system_variables.bulk_insert_buff_size,
- 0, GET_ULONG, REQUIRED_ARG, 8192*1024, 0, ULONG_MAX, 0, 1, 0},
- {"connect_timeout", OPT_CONNECT_TIMEOUT,
- "The number of seconds the mysqld server is waiting for a connect packet before responding with 'Bad handshake'.",
- (uchar**) &connect_timeout, (uchar**) &connect_timeout,
- 0, GET_ULONG, REQUIRED_ARG, CONNECT_TIMEOUT, 2, LONG_TIMEOUT, 0, 1, 0 },
- { "date_format", OPT_DATE_FORMAT,
- "The DATE format (For future).",
- (uchar**) &opt_date_time_formats[MYSQL_TIMESTAMP_DATE],
- (uchar**) &opt_date_time_formats[MYSQL_TIMESTAMP_DATE],
- 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- { "datetime_format", OPT_DATETIME_FORMAT,
- "The DATETIME/TIMESTAMP format (for future).",
- (uchar**) &opt_date_time_formats[MYSQL_TIMESTAMP_DATETIME],
- (uchar**) &opt_date_time_formats[MYSQL_TIMESTAMP_DATETIME],
- 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- { "default_week_format", OPT_DEFAULT_WEEK_FORMAT,
- "The default week format used by WEEK() functions.",
- (uchar**) &global_system_variables.default_week_format,
- (uchar**) &max_system_variables.default_week_format,
- 0, GET_ULONG, REQUIRED_ARG, 0, 0, 7L, 0, 1, 0},
- {"delayed_insert_limit", OPT_DELAYED_INSERT_LIMIT,
- "After inserting delayed_insert_limit rows, the INSERT DELAYED handler will check if there are any SELECT statements pending. If so, it allows these to execute before continuing.",
- (uchar**) &delayed_insert_limit, (uchar**) &delayed_insert_limit, 0, GET_ULONG,
- REQUIRED_ARG, DELAYED_LIMIT, 1, ULONG_MAX, 0, 1, 0},
- {"delayed_insert_timeout", OPT_DELAYED_INSERT_TIMEOUT,
- "How long a INSERT DELAYED thread should wait for INSERT statements before terminating.",
- (uchar**) &delayed_insert_timeout, (uchar**) &delayed_insert_timeout, 0,
- GET_ULONG, REQUIRED_ARG, DELAYED_WAIT_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0},
- { "delayed_queue_size", OPT_DELAYED_QUEUE_SIZE,
- "What size queue (in rows) should be allocated for handling INSERT DELAYED. If the queue becomes full, any client that does INSERT DELAYED will wait until there is room in the queue again.",
- (uchar**) &delayed_queue_size, (uchar**) &delayed_queue_size, 0, GET_ULONG,
- REQUIRED_ARG, DELAYED_QUEUE_SIZE, 1, ULONG_MAX, 0, 1, 0},
- {"div_precision_increment", OPT_DIV_PRECINCREMENT,
- "Precision of the result of '/' operator will be increased on that value.",
- (uchar**) &global_system_variables.div_precincrement,
- (uchar**) &max_system_variables.div_precincrement, 0, GET_ULONG,
- REQUIRED_ARG, 4, 0, DECIMAL_MAX_SCALE, 0, 0, 0},
- {"expire_logs_days", OPT_EXPIRE_LOGS_DAYS,
- "If non-zero, binary logs will be purged after expire_logs_days "
- "days; possible purges happen at startup and at binary log rotation.",
- (uchar**) &expire_logs_days,
- (uchar**) &expire_logs_days, 0, GET_ULONG,
- REQUIRED_ARG, 0, 0, 99, 0, 1, 0},
- { "flush_time", OPT_FLUSH_TIME,
- "A dedicated thread is created to flush all tables at the given interval.",
- (uchar**) &flush_time, (uchar**) &flush_time, 0, GET_ULONG, REQUIRED_ARG,
- FLUSH_TIME, 0, LONG_TIMEOUT, 0, 1, 0},
- { "ft_boolean_syntax", OPT_FT_BOOLEAN_SYNTAX,
- "List of operators for MATCH ... AGAINST ( ... IN BOOLEAN MODE)",
- 0, 0, 0, GET_STR,
- REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- { "ft_max_word_len", OPT_FT_MAX_WORD_LEN,
- "The maximum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable.",
- (uchar**) &ft_max_word_len, (uchar**) &ft_max_word_len, 0, GET_ULONG,
- REQUIRED_ARG, HA_FT_MAXCHARLEN, 10, HA_FT_MAXCHARLEN, 0, 1, 0},
- { "ft_min_word_len", OPT_FT_MIN_WORD_LEN,
- "The minimum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable.",
- (uchar**) &ft_min_word_len, (uchar**) &ft_min_word_len, 0, GET_ULONG,
- REQUIRED_ARG, 4, 1, HA_FT_MAXCHARLEN, 0, 1, 0},
- { "ft_query_expansion_limit", OPT_FT_QUERY_EXPANSION_LIMIT,
- "Number of best matches to use for query expansion",
- (uchar**) &ft_query_expansion_limit, (uchar**) &ft_query_expansion_limit, 0, GET_ULONG,
- REQUIRED_ARG, 20, 0, 1000, 0, 1, 0},
- { "ft_stopword_file", OPT_FT_STOPWORD_FILE,
- "Use stopwords from this file instead of built-in list.",
- (uchar**) &ft_stopword_file, (uchar**) &ft_stopword_file, 0, GET_STR,
- REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- { "group_concat_max_len", OPT_GROUP_CONCAT_MAX_LEN,
- "The maximum length of the result of function group_concat.",
- (uchar**) &global_system_variables.group_concat_max_len,
- (uchar**) &max_system_variables.group_concat_max_len, 0, GET_ULONG,
- REQUIRED_ARG, 1024, 4, ULONG_MAX, 0, 1, 0},
- {"interactive_timeout", OPT_INTERACTIVE_TIMEOUT,
- "The number of seconds the server waits for activity on an interactive connection before closing it.",
- (uchar**) &global_system_variables.net_interactive_timeout,
- (uchar**) &max_system_variables.net_interactive_timeout, 0,
- GET_ULONG, REQUIRED_ARG, NET_WAIT_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0},
- {"join_buffer_size", OPT_JOIN_BUFF_SIZE,
- "The size of the buffer that is used for full joins.",
- (uchar**) &global_system_variables.join_buff_size,
- (uchar**) &max_system_variables.join_buff_size, 0, GET_ULONG,
- REQUIRED_ARG, 128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, ULONG_MAX,
- MALLOC_OVERHEAD, IO_SIZE, 0},
- {"keep_files_on_create", OPT_KEEP_FILES_ON_CREATE,
- "Don't overwrite stale .MYD and .MYI even if no directory is specified.",
- (uchar**) &global_system_variables.keep_files_on_create,
- (uchar**) &max_system_variables.keep_files_on_create,
- 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
- {"key_buffer_size", OPT_KEY_BUFFER_SIZE,
- "The size of the buffer used for index blocks for MyISAM tables. Increase this to get better index handling (for all reads and multiple writes) to as much as you can afford; 64M on a 256M machine that mainly runs MySQL is quite common.",
- (uchar**) &dflt_key_cache_var.param_buff_size,
- (uchar**) 0,
- 0, (GET_ULL | GET_ASK_ADDR),
- REQUIRED_ARG, KEY_CACHE_SIZE, MALLOC_OVERHEAD, SIZE_T_MAX, MALLOC_OVERHEAD,
- IO_SIZE, 0},
- {"key_cache_age_threshold", OPT_KEY_CACHE_AGE_THRESHOLD,
- "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",
- (uchar**) &dflt_key_cache_var.param_age_threshold,
- (uchar**) 0,
- 0, (GET_ULONG | GET_ASK_ADDR), REQUIRED_ARG,
- 300, 100, ULONG_MAX, 0, 100, 0},
- {"key_cache_block_size", OPT_KEY_CACHE_BLOCK_SIZE,
- "The default size of key cache blocks",
- (uchar**) &dflt_key_cache_var.param_block_size,
- (uchar**) 0,
- 0, (GET_ULONG | GET_ASK_ADDR), REQUIRED_ARG,
- KEY_CACHE_BLOCK_SIZE, 512, 1024 * 16, 0, 512, 0},
- {"key_cache_division_limit", OPT_KEY_CACHE_DIVISION_LIMIT,
- "The minimum percentage of warm blocks in key cache",
- (uchar**) &dflt_key_cache_var.param_division_limit,
- (uchar**) 0,
- 0, (GET_ULONG | GET_ASK_ADDR) , REQUIRED_ARG, 100,
- 1, 100, 0, 1, 0},
- {"long_query_time", OPT_LONG_QUERY_TIME,
- "Log all queries that have taken more than long_query_time seconds to execute to file. "
- "The argument will be treated as a decimal value with microsecond precission.",
- (uchar**) &long_query_time, (uchar**) &long_query_time, 0, GET_DOUBLE,
- REQUIRED_ARG, 10, 0, LONG_TIMEOUT, 0, 0, 0},
- {"lower_case_table_names", OPT_LOWER_CASE_TABLE_NAMES,
- "If set to 1 table names are stored in lowercase on disk and table names will be case-insensitive. Should be set to 2 if you are using a case insensitive file system",
- (uchar**) &lower_case_table_names,
- (uchar**) &lower_case_table_names, 0, GET_UINT, OPT_ARG,
-#ifdef FN_NO_CASE_SENCE
- 1
-#else
- 0
-#endif
- , 0, 2, 0, 1, 0},
- {"max_allowed_packet", OPT_MAX_ALLOWED_PACKET,
- "Max packetlength to send/receive from to server.",
- (uchar**) &global_system_variables.max_allowed_packet,
- (uchar**) &max_system_variables.max_allowed_packet, 0, GET_ULONG,
- REQUIRED_ARG, 1024*1024L, 1024, 1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0},
- {"max_binlog_cache_size", OPT_MAX_BINLOG_CACHE_SIZE,
- "Can be used to restrict the total size used to cache a multi-transaction query.",
- (uchar**) &max_binlog_cache_size, (uchar**) &max_binlog_cache_size, 0,
- GET_ULL, REQUIRED_ARG, ULONG_MAX, IO_SIZE, ULONGLONG_MAX, 0, IO_SIZE, 0},
- {"max_binlog_size", OPT_MAX_BINLOG_SIZE,
- "Binary log will be rotated automatically when the size exceeds this \
-value. Will also apply to relay logs if max_relay_log_size is 0. \
-The minimum value for this variable is 4096.",
- (uchar**) &max_binlog_size, (uchar**) &max_binlog_size, 0, GET_ULONG,
- REQUIRED_ARG, 1024*1024L*1024L, IO_SIZE, 1024*1024L*1024L, 0, IO_SIZE, 0},
- {"max_connect_errors", OPT_MAX_CONNECT_ERRORS,
- "If there is more than this number of interrupted connections from a host this host will be blocked from further connections.",
- (uchar**) &max_connect_errors, (uchar**) &max_connect_errors, 0, GET_ULONG,
- REQUIRED_ARG, MAX_CONNECT_ERRORS, 1, ULONG_MAX, 0, 1, 0},
- // Default max_connections of 151 is larger than Apache's default max
- // children, to avoid "too many connections" error in a common setup
- {"max_connections", OPT_MAX_CONNECTIONS,
- "The number of simultaneous clients allowed.", (uchar**) &max_connections,
- (uchar**) &max_connections, 0, GET_ULONG, REQUIRED_ARG, 151, 1, 100000, 0, 1,
- 0},
- {"max_delayed_threads", OPT_MAX_DELAYED_THREADS,
- "Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero, which means INSERT DELAYED is not used.",
- (uchar**) &global_system_variables.max_insert_delayed_threads,
- (uchar**) &max_system_variables.max_insert_delayed_threads,
- 0, GET_ULONG, REQUIRED_ARG, 20, 0, 16384, 0, 1, 0},
- {"max_error_count", OPT_MAX_ERROR_COUNT,
- "Max number of errors/warnings to store for a statement.",
- (uchar**) &global_system_variables.max_error_count,
- (uchar**) &max_system_variables.max_error_count,
- 0, GET_ULONG, REQUIRED_ARG, DEFAULT_ERROR_COUNT, 0, 65535, 0, 1, 0},
- {"max_heap_table_size", OPT_MAX_HEP_TABLE_SIZE,
- "Don't allow creation of heap tables bigger than this.",
- (uchar**) &global_system_variables.max_heap_table_size,
- (uchar**) &max_system_variables.max_heap_table_size, 0, GET_ULL,
- REQUIRED_ARG, 16*1024*1024L, 16384, MAX_MEM_TABLE_SIZE,
- MALLOC_OVERHEAD, 1024, 0},
- {"max_join_size", OPT_MAX_JOIN_SIZE,
- "Joins that are probably going to read more than max_join_size records return an error.",
- (uchar**) &global_system_variables.max_join_size,
- (uchar**) &max_system_variables.max_join_size, 0, GET_HA_ROWS, REQUIRED_ARG,
- HA_POS_ERROR, 1, HA_POS_ERROR, 0, 1, 0},
- {"max_length_for_sort_data", OPT_MAX_LENGTH_FOR_SORT_DATA,
- "Max number of bytes in sorted records.",
- (uchar**) &global_system_variables.max_length_for_sort_data,
- (uchar**) &max_system_variables.max_length_for_sort_data, 0, GET_ULONG,
- REQUIRED_ARG, 1024, 4, 8192*1024L, 0, 1, 0},
- {"max_prepared_stmt_count", OPT_MAX_PREPARED_STMT_COUNT,
- "Maximum number of prepared statements in the server.",
- (uchar**) &max_prepared_stmt_count, (uchar**) &max_prepared_stmt_count,
- 0, GET_ULONG, REQUIRED_ARG, 16382, 0, 1*1024*1024, 0, 1, 0},
- {"max_relay_log_size", OPT_MAX_RELAY_LOG_SIZE,
- "If non-zero: relay log will be rotated automatically when the size exceeds this value; if zero (the default): when the size exceeds max_binlog_size. 0 excepted, the minimum value for this variable is 4096.",
- (uchar**) &max_relay_log_size, (uchar**) &max_relay_log_size, 0, GET_ULONG,
- REQUIRED_ARG, 0L, 0L, 1024*1024L*1024L, 0, IO_SIZE, 0},
- { "max_seeks_for_key", OPT_MAX_SEEKS_FOR_KEY,
- "Limit assumed max number of seeks when looking up rows based on a key",
- (uchar**) &global_system_variables.max_seeks_for_key,
- (uchar**) &max_system_variables.max_seeks_for_key, 0, GET_ULONG,
- REQUIRED_ARG, ULONG_MAX, 1, ULONG_MAX, 0, 1, 0 },
- {"max_sort_length", OPT_MAX_SORT_LENGTH,
- "The number of bytes to use when sorting BLOB or TEXT values (only the first max_sort_length bytes of each value are used; the rest are ignored).",
- (uchar**) &global_system_variables.max_sort_length,
- (uchar**) &max_system_variables.max_sort_length, 0, GET_ULONG,
- REQUIRED_ARG, 1024, 4, 8192*1024L, 0, 1, 0},
- {"max_sp_recursion_depth", OPT_MAX_SP_RECURSION_DEPTH,
- "Maximum stored procedure recursion depth. (discussed with docs).",
- (uchar**) &global_system_variables.max_sp_recursion_depth,
- (uchar**) &max_system_variables.max_sp_recursion_depth, 0, GET_ULONG,
- OPT_ARG, 0, 0, 255, 0, 1, 0 },
- {"max_tmp_tables", OPT_MAX_TMP_TABLES,
- "Maximum number of temporary tables a client can keep open at a time.",
- (uchar**) &global_system_variables.max_tmp_tables,
- (uchar**) &max_system_variables.max_tmp_tables, 0, GET_ULONG,
- REQUIRED_ARG, 32, 1, ULONG_MAX, 0, 1, 0},
- {"max_user_connections", OPT_MAX_USER_CONNECTIONS,
- "The maximum number of active connections for a single user (0 = no limit).",
- (uchar**) &max_user_connections, (uchar**) &max_user_connections, 0, GET_UINT,
- REQUIRED_ARG, 0, 0, UINT_MAX, 0, 1, 0},
- {"max_write_lock_count", OPT_MAX_WRITE_LOCK_COUNT,
- "After this many write locks, allow some read locks to run in between.",
- (uchar**) &max_write_lock_count, (uchar**) &max_write_lock_count, 0, GET_ULONG,
- REQUIRED_ARG, ULONG_MAX, 1, ULONG_MAX, 0, 1, 0},
- {"min_examined_row_limit", OPT_MIN_EXAMINED_ROW_LIMIT,
- "Don't write queries to slow log that examine fewer than min_examined_row_limit rows.",
- (uchar**) &global_system_variables.min_examined_row_limit,
- (uchar**) &max_system_variables.min_examined_row_limit, 0, GET_ULONG,
- REQUIRED_ARG, 0, 0, ULONG_MAX, 0, 1L, 0},
- {"multi_range_count", OPT_MULTI_RANGE_COUNT,
- "Number of key ranges to request at once.",
- (uchar**) &global_system_variables.multi_range_count,
- (uchar**) &max_system_variables.multi_range_count, 0,
- GET_ULONG, REQUIRED_ARG, 256, 1, ULONG_MAX, 0, 1, 0},
- {"myisam_block_size", OPT_MYISAM_BLOCK_SIZE,
- "Block size to be used for MyISAM index pages.",
- (uchar**) &opt_myisam_block_size,
- (uchar**) &opt_myisam_block_size, 0, GET_ULONG, REQUIRED_ARG,
- MI_KEY_BLOCK_LENGTH, MI_MIN_KEY_BLOCK_LENGTH, MI_MAX_KEY_BLOCK_LENGTH,
- 0, MI_MIN_KEY_BLOCK_LENGTH, 0},
- {"myisam_data_pointer_size", OPT_MYISAM_DATA_POINTER_SIZE,
- "Default pointer size to be used for MyISAM tables.",
- (uchar**) &myisam_data_pointer_size,
- (uchar**) &myisam_data_pointer_size, 0, GET_ULONG, REQUIRED_ARG,
- 6, 2, 7, 0, 1, 0},
- {"myisam_max_extra_sort_file_size", OPT_MYISAM_MAX_EXTRA_SORT_FILE_SIZE,
- "Deprecated option",
- (uchar**) &global_system_variables.myisam_max_extra_sort_file_size,
- (uchar**) &max_system_variables.myisam_max_extra_sort_file_size,
- 0, GET_ULL, REQUIRED_ARG, (ulonglong) MI_MAX_TEMP_LENGTH,
- 0, (ulonglong) MAX_FILE_SIZE, 0, 1, 0},
- {"myisam_max_sort_file_size", OPT_MYISAM_MAX_SORT_FILE_SIZE,
- "Don't use the fast sort index method to created index if the temporary file would get bigger than this.",
- (uchar**) &global_system_variables.myisam_max_sort_file_size,
- (uchar**) &max_system_variables.myisam_max_sort_file_size, 0,
- GET_ULL, REQUIRED_ARG, (longlong) LONG_MAX, 0, (ulonglong) MAX_FILE_SIZE,
- 0, 1024*1024, 0},
- {"myisam_mmap_size", OPT_MYISAM_MMAP_SIZE,
- "Can be used to restrict the total memory used for memory mmaping of myisam files",
- (uchar**) &myisam_mmap_size, (uchar**) &myisam_mmap_size, 0,
- GET_ULL, REQUIRED_ARG, SIZE_T_MAX, MEMMAP_EXTRA_MARGIN, SIZE_T_MAX, 0, 1, 0},
- {"myisam_repair_threads", OPT_MYISAM_REPAIR_THREADS,
- "Number of threads to use when repairing MyISAM tables. The value of 1 disables parallel repair.",
- (uchar**) &global_system_variables.myisam_repair_threads,
- (uchar**) &max_system_variables.myisam_repair_threads, 0,
- GET_ULONG, REQUIRED_ARG, 1, 1, ULONG_MAX, 0, 1, 0},
- {"myisam_sort_buffer_size", OPT_MYISAM_SORT_BUFFER_SIZE,
- "The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE.",
- (uchar**) &global_system_variables.myisam_sort_buff_size,
- (uchar**) &max_system_variables.myisam_sort_buff_size, 0,
- GET_ULONG, REQUIRED_ARG, 8192*1024, 4, ~0L, 0, 1, 0},
- {"myisam_use_mmap", OPT_MYISAM_USE_MMAP,
- "Use memory mapping for reading and writing MyISAM tables",
- (uchar**) &opt_myisam_use_mmap,
- (uchar**) &opt_myisam_use_mmap, 0, GET_BOOL, NO_ARG, 0,
- 0, 0, 0, 0, 0},
- {"myisam_stats_method", OPT_MYISAM_STATS_METHOD,
- "Specifies how MyISAM index statistics collection code should threat NULLs. "
- "Possible values of name are \"nulls_unequal\" (default behavior for 4.1/5.0), "
- "\"nulls_equal\" (emulate 4.0 behavior), and \"nulls_ignored\".",
- (uchar**) &myisam_stats_method_str, (uchar**) &myisam_stats_method_str, 0,
- GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"net_buffer_length", OPT_NET_BUFFER_LENGTH,
- "Buffer length for TCP/IP and socket communication.",
- (uchar**) &global_system_variables.net_buffer_length,
- (uchar**) &max_system_variables.net_buffer_length, 0, GET_ULONG,
- REQUIRED_ARG, 16384, 1024, 1024*1024L, 0, 1024, 0},
- {"net_read_timeout", OPT_NET_READ_TIMEOUT,
- "Number of seconds to wait for more data from a connection before aborting the read.",
- (uchar**) &global_system_variables.net_read_timeout,
- (uchar**) &max_system_variables.net_read_timeout, 0, GET_ULONG,
- REQUIRED_ARG, NET_READ_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0},
- {"net_retry_count", OPT_NET_RETRY_COUNT,
- "If a read on a communication port is interrupted, retry this many times before giving up.",
- (uchar**) &global_system_variables.net_retry_count,
- (uchar**) &max_system_variables.net_retry_count,0,
- GET_ULONG, REQUIRED_ARG, MYSQLD_NET_RETRY_COUNT, 1, ULONG_MAX, 0, 1, 0},
- {"net_write_timeout", OPT_NET_WRITE_TIMEOUT,
- "Number of seconds to wait for a block to be written to a connection before aborting the write.",
- (uchar**) &global_system_variables.net_write_timeout,
- (uchar**) &max_system_variables.net_write_timeout, 0, GET_ULONG,
- REQUIRED_ARG, NET_WRITE_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0},
- { "old", OPT_OLD_MODE, "Use compatible behavior.",
- (uchar**) &global_system_variables.old_mode,
- (uchar**) &max_system_variables.old_mode, 0, GET_BOOL, NO_ARG,
- 0, 0, 0, 0, 0, 0},
- {"open_files_limit", OPT_OPEN_FILES_LIMIT,
- "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.",
- (uchar**) &open_files_limit, (uchar**) &open_files_limit, 0, GET_ULONG,
- REQUIRED_ARG, 0, 0, OS_FILE_LIMIT, 0, 1, 0},
- {"optimizer_prune_level", OPT_OPTIMIZER_PRUNE_LEVEL,
- "Controls the heuristic(s) applied during query optimization to prune less-promising partial plans from the optimizer search space. Meaning: 0 - do not apply any heuristic, thus perform exhaustive search; 1 - prune plans based on number of retrieved rows.",
- (uchar**) &global_system_variables.optimizer_prune_level,
- (uchar**) &max_system_variables.optimizer_prune_level,
- 0, GET_ULONG, OPT_ARG, 1, 0, 1, 0, 1, 0},
- {"optimizer_search_depth", OPT_OPTIMIZER_SEARCH_DEPTH,
- "Maximum depth of search performed by the query optimizer. Values larger than the number of relations in a query result in better query plans, but take longer to compile a query. Smaller values than the number of tables in a relation result in faster optimization, but may produce very bad query plans. If set to 0, the system will automatically pick a reasonable value; if set to MAX_TABLES+2, the optimizer will switch to the original find_best (used for testing/comparison).",
- (uchar**) &global_system_variables.optimizer_search_depth,
- (uchar**) &max_system_variables.optimizer_search_depth,
- 0, GET_ULONG, OPT_ARG, MAX_TABLES+1, 0, MAX_TABLES+2, 0, 1, 0},
- {"optimizer_switch", OPT_OPTIMIZER_SWITCH,
- "optimizer_switch=option=val[,option=val...], where option={index_merge, "
- "index_merge_union, index_merge_sort_union, index_merge_intersection} and "
- "val={on, off, default}.",
- (uchar**) &optimizer_switch_str, (uchar**) &optimizer_switch_str, 0, GET_STR, REQUIRED_ARG,
- /*OPTIMIZER_SWITCH_DEFAULT*/0,
- 0, 0, 0, 0, 0},
- {"plugin_dir", OPT_PLUGIN_DIR,
- "Directory for plugins.",
- (uchar**) &opt_plugin_dir_ptr, (uchar**) &opt_plugin_dir_ptr, 0,
- GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"plugin-load", OPT_PLUGIN_LOAD,
+ {"plugin-load", 0,
"Optional semicolon-separated list of plugins to load, where each plugin is "
"identified as name=library, where name is the plugin name and library "
"is the plugin library in plugin_dir.",
(uchar**) &opt_plugin_load, (uchar**) &opt_plugin_load, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"preload_buffer_size", OPT_PRELOAD_BUFFER_SIZE,
- "The size of the buffer that is allocated when preloading indexes",
- (uchar**) &global_system_variables.preload_buff_size,
- (uchar**) &max_system_variables.preload_buff_size, 0, GET_ULONG,
- REQUIRED_ARG, 32*1024L, 1024, 1024*1024*1024L, 0, 1, 0},
- {"query_alloc_block_size", OPT_QUERY_ALLOC_BLOCK_SIZE,
- "Allocation block size for query parsing and execution",
- (uchar**) &global_system_variables.query_alloc_block_size,
- (uchar**) &max_system_variables.query_alloc_block_size, 0, GET_ULONG,
- REQUIRED_ARG, QUERY_ALLOC_BLOCK_SIZE, 1024, ULONG_MAX, 0, 1024, 0},
-#ifdef HAVE_QUERY_CACHE
- {"query_cache_limit", OPT_QUERY_CACHE_LIMIT,
- "Don't cache results that are bigger than this.",
- (uchar**) &query_cache_limit, (uchar**) &query_cache_limit, 0, GET_ULONG,
- REQUIRED_ARG, 1024*1024L, 0, ULONG_MAX, 0, 1, 0},
- {"query_cache_min_res_unit", OPT_QUERY_CACHE_MIN_RES_UNIT,
- "minimal size of unit in wich space for results is allocated (last unit will be trimed after writing all result data.",
- (uchar**) &query_cache_min_res_unit, (uchar**) &query_cache_min_res_unit,
- 0, GET_ULONG, REQUIRED_ARG, QUERY_CACHE_MIN_RESULT_DATA_SIZE,
- 0, ULONG_MAX, 0, 1, 0},
-#endif /*HAVE_QUERY_CACHE*/
- {"query_cache_size", OPT_QUERY_CACHE_SIZE,
- "The memory allocated to store results from old queries.",
- (uchar**) &query_cache_size, (uchar**) &query_cache_size, 0, GET_ULONG,
- REQUIRED_ARG, 0, 0, (longlong) ULONG_MAX, 0, 1024, 0},
-#ifdef HAVE_QUERY_CACHE
- {"query_cache_type", OPT_QUERY_CACHE_TYPE,
- "0 = OFF = Don't cache or retrieve results. 1 = ON = Cache all results except SELECT SQL_NO_CACHE ... queries. 2 = DEMAND = Cache only SELECT SQL_CACHE ... queries.",
- (uchar**) &global_system_variables.query_cache_type,
- (uchar**) &max_system_variables.query_cache_type,
- 0, GET_ULONG, REQUIRED_ARG, 1, 0, 2, 0, 1, 0},
- {"query_cache_wlock_invalidate", OPT_QUERY_CACHE_WLOCK_INVALIDATE,
- "Invalidate queries in query cache on LOCK for write",
- (uchar**) &global_system_variables.query_cache_wlock_invalidate,
- (uchar**) &max_system_variables.query_cache_wlock_invalidate,
- 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0},
-#endif /*HAVE_QUERY_CACHE*/
- {"query_prealloc_size", OPT_QUERY_PREALLOC_SIZE,
- "Persistent buffer for query parsing and execution",
- (uchar**) &global_system_variables.query_prealloc_size,
- (uchar**) &max_system_variables.query_prealloc_size, 0, GET_ULONG,
- REQUIRED_ARG, QUERY_ALLOC_PREALLOC_SIZE, QUERY_ALLOC_PREALLOC_SIZE,
- ULONG_MAX, 0, 1024, 0},
- {"range_alloc_block_size", OPT_RANGE_ALLOC_BLOCK_SIZE,
- "Allocation block size for storing ranges during optimization",
- (uchar**) &global_system_variables.range_alloc_block_size,
- (uchar**) &max_system_variables.range_alloc_block_size, 0, GET_ULONG,
- REQUIRED_ARG, RANGE_ALLOC_BLOCK_SIZE, RANGE_ALLOC_BLOCK_SIZE, ULONG_MAX,
- 0, 1024, 0},
- {"read_buffer_size", OPT_RECORD_BUFFER,
- "Each thread that does a sequential scan allocates a buffer of this size for each table it scans. If you do many sequential scans, you may want to increase this value.",
+ {"record_buffer", 0, "Deprecated; use --read-buffer-size instead.",
(uchar**) &global_system_variables.read_buff_size,
(uchar**) &max_system_variables.read_buff_size,0, GET_ULONG, REQUIRED_ARG,
- 128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, INT_MAX32, MALLOC_OVERHEAD, IO_SIZE,
- 0},
- {"read_only", OPT_READONLY,
- "Make all non-temporary tables read-only, with the exception for replication (slave) threads and users with the SUPER privilege",
- (uchar**) &opt_readonly,
- (uchar**) &opt_readonly,
- 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0},
- {"read_rnd_buffer_size", OPT_RECORD_RND_BUFFER,
- "When reading rows in sorted order after a sort, the rows are read through this buffer to avoid a disk seeks. If not set, then it's set to the value of record_buffer.",
- (uchar**) &global_system_variables.read_rnd_buff_size,
- (uchar**) &max_system_variables.read_rnd_buff_size, 0,
- GET_ULONG, REQUIRED_ARG, 256*1024L, IO_SIZE*2+MALLOC_OVERHEAD,
- INT_MAX32, MALLOC_OVERHEAD, IO_SIZE, 0},
- {"record_buffer", OPT_RECORD_BUFFER,
- "Alias for read_buffer_size",
- (uchar**) &global_system_variables.read_buff_size,
- (uchar**) &max_system_variables.read_buff_size,0, GET_ULONG, REQUIRED_ARG,
- 128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, INT_MAX32, MALLOC_OVERHEAD, IO_SIZE, 0},
-#ifdef HAVE_REPLICATION
- {"relay_log_purge", OPT_RELAY_LOG_PURGE,
- "0 = do not purge relay logs. 1 = purge them as soon as they are no more needed.",
- (uchar**) &relay_log_purge,
- (uchar**) &relay_log_purge, 0, GET_BOOL, NO_ARG,
- 1, 0, 1, 0, 1, 0},
- {"relay_log_recovery", OPT_RELAY_LOG_RECOVERY,
- "Enables automatic relay log recovery right after the database startup, "
- "which means that the IO Thread starts re-fetching from the master "
- "right after the last transaction processed.",
- (uchar**) &relay_log_recovery,
- (uchar**) &relay_log_recovery, 0, GET_BOOL, NO_ARG,
- 0, 0, 1, 0, 1, 0},
- {"relay_log_space_limit", OPT_RELAY_LOG_SPACE_LIMIT,
- "Maximum space to use for all relay logs.",
- (uchar**) &relay_log_space_limit,
- (uchar**) &relay_log_space_limit, 0, GET_ULL, REQUIRED_ARG, 0L, 0L,
- (longlong) ULONG_MAX, 0, 1, 0},
- {"slave_compressed_protocol", OPT_SLAVE_COMPRESSED_PROTOCOL,
- "Use compression on master/slave protocol.",
- (uchar**) &opt_slave_compressed_protocol,
- (uchar**) &opt_slave_compressed_protocol,
- 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0},
- {"slave_net_timeout", OPT_SLAVE_NET_TIMEOUT,
- "Number of seconds to wait for more data from a master/slave connection before aborting the read.",
- (uchar**) &slave_net_timeout, (uchar**) &slave_net_timeout, 0,
- GET_ULONG, REQUIRED_ARG, SLAVE_NET_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0},
- {"slave_transaction_retries", OPT_SLAVE_TRANS_RETRIES,
- "Number of times the slave SQL thread will retry a transaction in case "
- "it failed with a deadlock or elapsed lock wait timeout, "
- "before giving up and stopping.",
- (uchar**) &slave_trans_retries, (uchar**) &slave_trans_retries, 0,
- GET_ULONG, REQUIRED_ARG, 10L, 0L, (longlong) ULONG_MAX, 0, 1, 0},
-#endif /* HAVE_REPLICATION */
- {"slow_launch_time", OPT_SLOW_LAUNCH_TIME,
- "If creating the thread takes longer than this value (in seconds), the Slow_launch_threads counter will be incremented.",
- (uchar**) &slow_launch_time, (uchar**) &slow_launch_time, 0, GET_ULONG,
- REQUIRED_ARG, 2L, 0L, LONG_TIMEOUT, 0, 1, 0},
- {"sort_buffer_size", OPT_SORT_BUFFER,
- "Each thread that needs to do a sort allocates a buffer of this size.",
- (uchar**) &global_system_variables.sortbuff_size,
- (uchar**) &max_system_variables.sortbuff_size, 0, GET_ULONG, REQUIRED_ARG,
- MAX_SORT_MEMORY, MIN_SORT_MEMORY+MALLOC_OVERHEAD*2, ~0L, MALLOC_OVERHEAD,
- 1, 0},
- {"sync-binlog", OPT_SYNC_BINLOG,
- "Synchronously flush binary log to disk after every #th event. "
- "Use 0 (default) to disable synchronous flushing.",
- (uchar**) &sync_binlog_period, (uchar**) &sync_binlog_period, 0, GET_UINT,
- REQUIRED_ARG, 0, 0, (longlong) UINT_MAX, 0, 1, 0},
- {"sync-relay-log", OPT_SYNC_RELAY_LOG,
- "Synchronously flush relay log to disk after every #th event. "
- "Use 0 (default) to disable synchronous flushing.",
- (uchar**) &sync_relaylog_period, (uchar**) &sync_relaylog_period, 0, GET_UINT,
- REQUIRED_ARG, 0, 0, (longlong) UINT_MAX, 0, 1, 0},
- {"sync-relay-log-info", OPT_SYNC_RELAY_LOG_INFO,
- "Synchronously flush relay log info to disk after #th transaction. "
- "Use 0 (default) to disable synchronous flushing.",
- (uchar**) &sync_relayloginfo_period, (uchar**) &sync_relayloginfo_period, 0, GET_UINT,
- REQUIRED_ARG, 0, 0, (longlong) UINT_MAX, 0, 1, 0},
- {"sync-master-info", OPT_SYNC_MASTER_INFO,
- "Synchronously flush master info to disk after every #th event. "
- "Use 0 (default) to disable synchronous flushing.",
- (uchar**) &sync_masterinfo_period, (uchar**) &sync_masterinfo_period, 0, GET_UINT,
- REQUIRED_ARG, 0, 0, (longlong) UINT_MAX, 0, 1, 0},
- {"sync-frm", OPT_SYNC_FRM, "Sync .frm to disk on create. Enabled by default.",
- (uchar**) &opt_sync_frm, (uchar**) &opt_sync_frm, 0, GET_BOOL, NO_ARG, 1, 0,
- 0, 0, 0, 0},
- {"table_cache", OPT_TABLE_OPEN_CACHE,
- "Deprecated; use --table_open_cache instead.",
- (uchar**) &table_cache_size, (uchar**) &table_cache_size, 0, GET_ULONG,
- REQUIRED_ARG, TABLE_OPEN_CACHE_DEFAULT, 1, 512*1024L, 0, 1, 0},
- {"table_definition_cache", OPT_TABLE_DEF_CACHE,
- "The number of cached table definitions.",
- (uchar**) &table_def_size, (uchar**) &table_def_size,
- 0, GET_ULONG, REQUIRED_ARG, TABLE_DEF_CACHE_DEFAULT, TABLE_DEF_CACHE_MIN,
- 512*1024L, 0, 1, 0},
- {"table_open_cache", OPT_TABLE_OPEN_CACHE,
- "The number of cached open tables.",
+ 128*1024L, IO_SIZE*2, INT_MAX32, 0, IO_SIZE, 0},
+ {"table_cache", 0, "Deprecated; use --table-open-cache instead.",
(uchar**) &table_cache_size, (uchar**) &table_cache_size, 0, GET_ULONG,
REQUIRED_ARG, TABLE_OPEN_CACHE_DEFAULT, 1, 512*1024L, 0, 1, 0},
- {"table_lock_wait_timeout", OPT_TABLE_LOCK_WAIT_TIMEOUT,
- "Timeout in seconds to wait for a table level lock before returning an "
- "error. Used only if the connection has active cursors.",
- (uchar**) &table_lock_wait_timeout, (uchar**) &table_lock_wait_timeout,
- 0, GET_ULONG, REQUIRED_ARG, 50, 1, 1024 * 1024 * 1024, 0, 1, 0},
- {"thread_cache_size", OPT_THREAD_CACHE_SIZE,
- "How many threads we should keep in a cache for reuse.",
- (uchar**) &thread_cache_size, (uchar**) &thread_cache_size, 0, GET_ULONG,
- REQUIRED_ARG, 0, 0, 16384, 0, 1, 0},
- {"thread_concurrency", OPT_THREAD_CONCURRENCY,
- "Permits the application to give the threads system a hint for the desired number of threads that should be run at the same time.",
- (uchar**) &concurrency, (uchar**) &concurrency, 0, GET_ULONG, REQUIRED_ARG,
- DEFAULT_CONCURRENCY, 1, 512, 0, 1, 0},
-#if HAVE_POOL_OF_THREADS == 1
- {"thread_pool_size", OPT_THREAD_CACHE_SIZE,
- "How many threads we should create to handle query requests in case of 'thread_handling=pool-of-threads'",
- (uchar**) &thread_pool_size, (uchar**) &thread_pool_size, 0, GET_ULONG,
- REQUIRED_ARG, 20, 1, 16384, 0, 1, 0},
-#endif
- {"thread_stack", OPT_THREAD_STACK,
- "The stack size for each thread.", (uchar**) &my_thread_stack_size,
- (uchar**) &my_thread_stack_size, 0, GET_ULONG, REQUIRED_ARG,DEFAULT_THREAD_STACK,
- 1024L*128L, ULONG_MAX, 0, 1024, 0},
- { "time_format", OPT_TIME_FORMAT,
- "The TIME format (for future).",
- (uchar**) &opt_date_time_formats[MYSQL_TIMESTAMP_TIME],
- (uchar**) &opt_date_time_formats[MYSQL_TIMESTAMP_TIME],
- 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"tmp_table_size", OPT_TMP_TABLE_SIZE,
- "If an internal in-memory temporary table exceeds this size, MySQL will"
- " automatically convert it to an on-disk MyISAM table.",
- (uchar**) &global_system_variables.tmp_table_size,
- (uchar**) &max_system_variables.tmp_table_size, 0, GET_ULL,
- REQUIRED_ARG, 16*1024*1024L, 1024, MAX_MEM_TABLE_SIZE, 0, 1, 0},
- {"transaction_alloc_block_size", OPT_TRANS_ALLOC_BLOCK_SIZE,
- "Allocation block size for transactions to be stored in binary log",
- (uchar**) &global_system_variables.trans_alloc_block_size,
- (uchar**) &max_system_variables.trans_alloc_block_size, 0, GET_ULONG,
- REQUIRED_ARG, QUERY_ALLOC_BLOCK_SIZE, 1024, ULONG_MAX, 0, 1024, 0},
- {"transaction_prealloc_size", OPT_TRANS_PREALLOC_SIZE,
- "Persistent buffer for transactions to be stored in binary log",
- (uchar**) &global_system_variables.trans_prealloc_size,
- (uchar**) &max_system_variables.trans_prealloc_size, 0, GET_ULONG,
- REQUIRED_ARG, TRANS_ALLOC_PREALLOC_SIZE, 1024, ULONG_MAX, 0, 1024, 0},
- {"thread_handling", OPT_THREAD_HANDLING,
- "Define threads usage for handling queries: "
- "one-thread-per-connection or no-threads", 0, 0,
- 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"updatable_views_with_limit", OPT_UPDATABLE_VIEWS_WITH_LIMIT,
- "1 = YES = Don't issue an error message (warning only) if a VIEW without presence of a key of the underlying table is used in queries with a LIMIT clause for updating. 0 = NO = Prohibit update of a VIEW, which does not contain a key of the underlying table and the query uses a LIMIT clause (usually get from GUI tools).",
- (uchar**) &global_system_variables.updatable_views_with_limit,
- (uchar**) &max_system_variables.updatable_views_with_limit,
- 0, GET_ULONG, REQUIRED_ARG, 1, 0, 1, 0, 1, 0},
- {"wait_timeout", OPT_WAIT_TIMEOUT,
- "The number of seconds the server waits for activity on a connection before closing it.",
- (uchar**) &global_system_variables.net_wait_timeout,
- (uchar**) &max_system_variables.net_wait_timeout, 0, GET_ULONG,
- REQUIRED_ARG, NET_WAIT_TIMEOUT, 1, IF_WIN(INT_MAX32/1000, LONG_TIMEOUT),
- 0, 1, 0},
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@@ -7638,6 +6344,12 @@ SHOW_VAR status_vars[]= {
{NullS, NullS, SHOW_LONG}
};
+static bool all_options_add_terminator()
+{
+ my_option empty_element= {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0};
+ return insert_dynamic(&all_options, (uchar *)&empty_element);
+}
+
#ifndef EMBEDDED_LIBRARY
static void print_version(void)
{
@@ -7647,8 +6359,52 @@ static void print_version(void)
server_version,SYSTEM_TYPE,MACHINE_TYPE, MYSQL_COMPILATION_COMMENT);
}
+/** Compares two options' names, treats - and _ the same */
+static int option_cmp(my_option *a, my_option *b)
+{
+ const char *sa= a->name;
+ const char *sb= b->name;
+ for (; *sa || *sb; sa++, sb++)
+ {
+ if (*sa < *sb)
+ {
+ if (*sa == '-' && *sb == '_')
+ continue;
+ else
+ return -1;
+ }
+ if (*sa > *sb)
+ {
+ if (*sa == '_' && *sb == '-')
+ continue;
+ else
+ return 1;
+ }
+ }
+ DBUG_ASSERT(a->name == b->name);
+ return 0;
+}
+
+static void print_help()
+{
+ MEM_ROOT mem_root;
+ init_alloc_root(&mem_root, 4096, 4096);
+
+ pop_dynamic(&all_options);
+ add_plugin_options(&all_options, &mem_root);
+ sort_dynamic(&all_options, (qsort_cmp) option_cmp);
+ all_options_add_terminator();
+
+ my_print_help((my_option*) all_options.buffer);
+ my_print_variables((my_option*) all_options.buffer);
+
+ free_root(&mem_root, MYF(0));
+ delete_dynamic(&all_options);
+}
+
static void usage(void)
{
+ DBUG_ENTER("usage");
if (!(default_charset_info= get_charset_by_csname(default_character_set_name,
MY_CS_PRIMARY,
MYF(MY_WME))))
@@ -7658,7 +6414,7 @@ static void usage(void)
print_version();
puts("\
Copyright (C) 2000-2008 MySQL AB, by Monty and others\n\
-Copyright (C) 2008 Sun Microsystems, Inc.\n\
+Copyright (C) 2008,2009 Sun Microsystems, Inc.\n\
This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n\
and you are welcome to modify and redistribute it under the GPL license\n\n\
Starts the MySQL database server\n");
@@ -7686,7 +6442,7 @@ Starts the MySQL database server\n");
set_ports();
/* Print out all the options including plugin supplied options */
- my_print_help_inc_plugins(my_long_options, sizeof(my_long_options)/sizeof(my_option));
+ print_help();
if (! plugins_are_initialized)
{
@@ -7699,15 +6455,12 @@ because execution stopped before plugins were initialized.");
To see what values a running MySQL server is using, type\n\
'mysqladmin variables' instead of 'mysqld --verbose --help'.");
}
+ DBUG_VOID_RETURN;
}
#endif /*!EMBEDDED_LIBRARY*/
-
/**
- Initialize all MySQL global variables to default values.
-
- We don't need to set numeric variables refered to in my_long_options
- as these are initialized by my_getopt.
+ Initialize MySQL global variables to default values.
@note
The reason to set a lot of global variables to zero is to allow one to
@@ -7715,27 +6468,24 @@ To see what values a running MySQL server is using, type\n\
It's also needed on some exotic platforms where global variables are
not set to 0 when a program starts.
- We don't need to set numeric variables refered to in my_long_options
+ We don't need to set variables refered to in my_long_options
as these are initialized by my_getopt.
*/
static int mysql_init_variables(void)
{
- int error;
/* Things reset to zero */
opt_skip_slave_start= opt_reckless_slave = 0;
mysql_home[0]= pidfile_name[0]= log_error_file[0]= 0;
myisam_test_invalid_symlink= test_if_data_home_dir;
opt_log= opt_slow_log= 0;
opt_update_log= 0;
- log_output_options= find_bit_type(log_output_str, &log_output_typelib);
opt_bin_log= 0;
opt_disable_networking= opt_skip_show_db=0;
opt_ignore_builtin_innodb= 0;
opt_logname= opt_update_logname= opt_binlog_index_name= opt_slow_logname= 0;
opt_tc_log_file= (char *)"tc.log"; // no hostname in tc_log file name !
opt_secure_auth= 0;
- opt_secure_file_priv= 0;
opt_bootstrap= opt_myisam_log= 0;
mqh_used= 0;
segfaulted= kill_in_progress= 0;
@@ -7776,25 +6526,12 @@ static int mysql_init_variables(void)
table_alias_charset= &my_charset_bin;
character_set_filesystem= &my_charset_bin;
- opt_date_time_formats[0]= opt_date_time_formats[1]= opt_date_time_formats[2]= 0;
-
- /* Things with default values that are not zero */
- delay_key_write_options= (uint) DELAY_KEY_WRITE_ON;
- slave_exec_mode_options= 0;
- slave_exec_mode_options= (uint)
- find_bit_type_or_exit(slave_exec_mode_str, &slave_exec_mode_typelib, NULL,
- &error);
- if (error)
- return 1;
opt_specialflag= SPECIAL_ENGLISH;
unix_sock= ip_sock= INVALID_SOCKET;
mysql_home_ptr= mysql_home;
pidfile_name_ptr= pidfile_name;
log_error_file_ptr= log_error_file;
lc_messages_dir_ptr= lc_messages_dir;
- mysql_data_home= mysql_real_data_home;
- thd_startup_options= (OPTION_BIN_LOG |
- OPTION_QUOTE_SHOW_CREATE | OPTION_SQL_NOTES);
protocol_version= PROTOCOL_VERSION;
what_to_log= ~ (1L << (uint) COM_TIME);
refresh_version= 1L; /* Increments on each reload */
@@ -7802,8 +6539,6 @@ static int mysql_init_variables(void)
my_atomic_rwlock_init(&global_query_id_lock);
my_atomic_rwlock_init(&thread_running_lock);
strmov(server_version, MYSQL_SERVER_VERSION);
- myisam_recover_options_str= sql_mode_str= "OFF";
- myisam_stats_method_str= "nulls_unequal";
threads.empty();
thread_cache.empty();
key_caches.empty();
@@ -7817,12 +6552,9 @@ static int mysql_init_variables(void)
multi_keycache_init();
/* Set directory paths */
- strmake(mysql_real_data_home, get_relative_path(MYSQL_DATADIR),
- sizeof(mysql_real_data_home)-1);
- mysql_data_home_buff[0]=FN_CURLIB; // all paths are relative from here
- mysql_data_home_buff[1]=0;
- mysql_data_home_len= 2;
-
+ mysql_real_data_home_len=
+ strmake(mysql_real_data_home, get_relative_path(MYSQL_DATADIR),
+ sizeof(mysql_real_data_home)-1) - mysql_real_data_home;
/* Replication parameters */
master_info_file= (char*) "master.info",
relay_log_info_file= (char*) "relay-log.info";
@@ -7833,28 +6565,10 @@ static int mysql_init_variables(void)
charsets_dir= 0;
default_character_set_name= (char*) MYSQL_DEFAULT_CHARSET_NAME;
default_collation_name= compiled_default_collation_name;
- sys_charset_system.value= (char*) system_charset_info->csname;
character_set_filesystem_name= (char*) "binary";
lc_messages= (char*) "en_US";
lc_time_names_name= (char*) "en_US";
- /* Set default values for some option variables */
- default_storage_engine_str= (char*) "MyISAM";
- global_system_variables.table_plugin= NULL;
- global_system_variables.tx_isolation= ISO_REPEATABLE_READ;
- global_system_variables.select_limit= (ulonglong) HA_POS_ERROR;
- max_system_variables.select_limit= (ulonglong) HA_POS_ERROR;
- global_system_variables.max_join_size= (ulonglong) HA_POS_ERROR;
- max_system_variables.max_join_size= (ulonglong) HA_POS_ERROR;
- global_system_variables.old_passwords= 0;
- global_system_variables.old_alter_table= 0;
- global_system_variables.binlog_format= BINLOG_FORMAT_UNSPEC;
- /*
- Default behavior for 4.1 and 5.0 is to treat NULL values as unequal
- when collecting index statistics for MyISAM tables.
- */
- global_system_variables.myisam_stats_method= MI_STATS_METHOD_NULLS_NOT_EQUAL;
- global_system_variables.optimizer_switch= OPTIMIZER_SWITCH_DEFAULT;
/* Variables that depends on compile options */
#ifndef DBUG_OFF
default_dbug_option=IF_WIN("d:t:i:O,\\mysqld.trace",
@@ -7866,12 +6580,7 @@ static int mysql_init_variables(void)
#else
have_profiling = SHOW_OPTION_NO;
#endif
- global_system_variables.ndb_index_stat_enable=FALSE;
- max_system_variables.ndb_index_stat_enable=TRUE;
- global_system_variables.ndb_index_stat_cache_entries=32;
- max_system_variables.ndb_index_stat_cache_entries=~0L;
- global_system_variables.ndb_index_stat_update_freq=20;
- max_system_variables.ndb_index_stat_update_freq=~0L;
+
#ifdef HAVE_OPENSSL
have_ssl=SHOW_OPTION_YES;
#else
@@ -7952,14 +6661,11 @@ static int mysql_init_variables(void)
return 0;
}
-
my_bool
mysqld_get_one_option(int optid,
const struct my_option *opt __attribute__((unused)),
char *argument)
{
- int error;
-
switch(optid) {
case '#':
#ifndef DBUG_OFF
@@ -7968,7 +6674,7 @@ mysqld_get_one_option(int optid,
opt_endinfo=1; /* unireg: memory allocation */
break;
case 'a':
- global_system_variables.sql_mode= fix_sql_mode(MODE_ANSI);
+ global_system_variables.sql_mode= MODE_ANSI;
global_system_variables.tx_isolation= ISO_SERIALIZABLE;
break;
case 'b':
@@ -7985,8 +6691,7 @@ mysqld_get_one_option(int optid,
case 'h':
strmake(mysql_real_data_home,argument, sizeof(mysql_real_data_home)-1);
/* Correct pointer set by my_getopt (for embedded library) */
- mysql_data_home= mysql_real_data_home;
- mysql_data_home_len= strlen(mysql_data_home);
+ mysql_real_data_home_ptr= mysql_real_data_home;
break;
case 'u':
if (!mysqld_user || !strcmp(mysqld_user, argument))
@@ -7996,22 +6701,10 @@ mysqld_get_one_option(int optid,
break;
case 'L':
strmake(lc_messages_dir, argument, sizeof(lc_messages_dir)-1);
+ lc_messages_dir_ptr= lc_messages_dir;
break;
-#ifdef HAVE_REPLICATION
- case OPT_SLAVE_SKIP_ERRORS:
- init_slave_skip_errors(argument);
- break;
- case OPT_SLAVE_EXEC_MODE:
- slave_exec_mode_options= (uint)
- find_bit_type_or_exit(argument, &slave_exec_mode_typelib, "", &error);
- if (error)
- return 1;
- break;
-#endif
- case OPT_SAFEMALLOC_MEM_LIMIT:
-#if !defined(DBUG_OFF) && defined(SAFEMALLOC)
- sf_malloc_mem_limit = atoi(argument);
-#endif
+ case OPT_BINLOG_FORMAT:
+ binlog_format_used= true;
break;
#include <sslopt-case.h>
#ifndef EMBEDDED_LIBRARY
@@ -8031,12 +6724,6 @@ mysqld_get_one_option(int optid,
test_flags= argument ? (uint) atoi(argument) : 0;
opt_endinfo=1;
break;
- case (int) OPT_BIG_TABLES:
- thd_startup_options|=OPTION_BIG_TABLES;
- break;
- case (int) OPT_IGNORE_BUILTIN_INNODB:
- opt_ignore_builtin_innodb= 1;
- break;
case (int) OPT_ISAM_LOG:
opt_myisam_log=1;
break;
@@ -8046,17 +6733,7 @@ mysqld_get_one_option(int optid,
case (int) OPT_BIN_LOG:
opt_bin_log= test(argument != disabled_my_option);
break;
- case (int) OPT_ERROR_LOG_FILE:
- opt_error_log= 1;
- break;
#ifdef HAVE_REPLICATION
- case (int) OPT_INIT_RPL_ROLE:
- {
- int role;
- role= find_type_or_exit(argument, &rpl_role_typelib, opt->name);
- rpl_status = (role == 1) ? RPL_AUTH_MASTER : RPL_IDLE_SLAVE;
- break;
- }
case (int)OPT_REPLICATE_IGNORE_DB:
{
rpl_filter->add_ignore_db(argument);
@@ -8103,13 +6780,6 @@ mysqld_get_one_option(int optid,
binlog_filter->add_ignore_db(argument);
break;
}
- case OPT_BINLOG_FORMAT:
- {
- int id;
- id= find_type_or_exit(argument, &binlog_format_typelib, opt->name);
- global_system_variables.binlog_format= opt_binlog_format_id= id - 1;
- break;
- }
case (int)OPT_BINLOG_DO_DB:
{
binlog_filter->add_do_db(argument);
@@ -8156,38 +6826,11 @@ mysqld_get_one_option(int optid,
WARN_DEPRECATED(NULL, 7, 0, "--log-slow-queries", "'--slow-query-log'/'--slow-query-log-file'");
opt_slow_log= 1;
break;
-#ifdef WITH_CSV_STORAGE_ENGINE
- case OPT_LOG_OUTPUT:
- {
- if (!argument || !argument[0])
- {
- log_output_options= LOG_FILE;
- log_output_str= log_output_typelib.type_names[1];
- }
- else
- {
- log_output_str= argument;
- log_output_options=
- find_bit_type_or_exit(argument, &log_output_typelib, opt->name, &error);
- if (error)
- return 1;
- }
- break;
- }
-#endif
- case OPT_EVENT_SCHEDULER:
-#ifndef HAVE_EVENT_SCHEDULER
- sql_perror("Event scheduler is not supported in embedded build.");
-#else
- if (Events::set_opt_event_scheduler(argument))
- return 1;
-#endif
- break;
case (int) OPT_SKIP_NEW:
opt_specialflag|= SPECIAL_NO_NEW_FUNC;
- delay_key_write_options= (uint) DELAY_KEY_WRITE_NONE;
+ delay_key_write_options= DELAY_KEY_WRITE_NONE;
myisam_concurrent_insert=0;
- myisam_recover_options= HA_RECOVER_NONE;
+ myisam_recover_options= HA_RECOVER_OFF;
sp_automatic_privileges=0;
my_use_symdir=0;
ha_open_options&= ~(HA_OPEN_ABORT_IF_CRASHED | HA_OPEN_DELAY_KEY_WRITE);
@@ -8197,7 +6840,7 @@ mysqld_get_one_option(int optid,
break;
case (int) OPT_SAFE:
opt_specialflag|= SPECIAL_SAFE_MODE;
- delay_key_write_options= (uint) DELAY_KEY_WRITE_NONE;
+ delay_key_write_options= DELAY_KEY_WRITE_NONE;
myisam_recover_options= HA_RECOVER_DEFAULT;
ha_open_options&= ~(HA_OPEN_DELAY_KEY_WRITE);
break;
@@ -8216,18 +6859,6 @@ mysqld_get_one_option(int optid,
case (int) OPT_SKIP_RESOLVE:
opt_specialflag|=SPECIAL_NO_RESOLVE;
break;
- case (int) OPT_SKIP_NETWORKING:
-#if defined(__NETWARE__)
- sql_perror("Can't start server: skip-networking option is currently not supported on NetWare");
- return 1;
-#endif
- opt_disable_networking=1;
- mysqld_port=0;
- break;
- case (int) OPT_SKIP_SHOW_DB:
- opt_skip_show_db=1;
- opt_specialflag|=SPECIAL_SKIP_SHOW_DB;
- break;
case (int) OPT_WANT_CORE:
test_flags |= TEST_CORE_ON_SIGNAL;
break;
@@ -8259,25 +6890,10 @@ mysqld_get_one_option(int optid,
freeaddrinfo(res_lst);
}
break;
- case (int) OPT_PID_FILE:
- strmake(pidfile_name, argument, sizeof(pidfile_name)-1);
- break;
-#ifdef __WIN__
- case (int) OPT_STANDALONE: /* Dummy option for NT */
- break;
-#endif
case OPT_CONSOLE:
if (opt_console)
opt_error_log= 0; // Force logs to stdout
break;
- case (int) OPT_FLUSH:
- myisam_flush=1;
- flush_time=0; // No auto flush
- break;
- case OPT_LOW_PRIORITY_UPDATES:
- thr_upgraded_concurrent_insert_lock= TL_WRITE_LOW_PRIORITY;
- global_system_variables.low_priority_updates=1;
- break;
case OPT_BOOTSTRAP:
opt_noacl=opt_bootstrap=1;
break;
@@ -8286,188 +6902,14 @@ mysqld_get_one_option(int optid,
break;
case OPT_DELAY_KEY_WRITE_ALL:
if (argument != disabled_my_option)
- argument= (char*) "ALL";
- /* Fall through */
- case OPT_DELAY_KEY_WRITE:
- if (argument == disabled_my_option)
- delay_key_write_options= (uint) DELAY_KEY_WRITE_NONE;
- else if (! argument)
- delay_key_write_options= (uint) DELAY_KEY_WRITE_ON;
- else
- {
- int type;
- type= find_type_or_exit(argument, &delay_key_write_typelib, opt->name);
- delay_key_write_options= (uint) type-1;
- }
- break;
- case OPT_CHARSETS_DIR:
- strmake(mysql_charsets_dir, argument, sizeof(mysql_charsets_dir)-1);
- charsets_dir = mysql_charsets_dir;
- break;
- case OPT_TX_ISOLATION:
- {
- int type;
- type= find_type_or_exit(argument, &tx_isolation_typelib, opt->name);
- global_system_variables.tx_isolation= (type-1);
- break;
- }
-#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
- case OPT_NDB_MGMD:
- case OPT_NDB_NODEID:
- {
- int len= my_snprintf(opt_ndb_constrbuf+opt_ndb_constrbuf_len,
- sizeof(opt_ndb_constrbuf)-opt_ndb_constrbuf_len,
- "%s%s%s",opt_ndb_constrbuf_len > 0 ? ",":"",
- optid == OPT_NDB_NODEID ? "nodeid=" : "",
- argument);
- opt_ndb_constrbuf_len+= len;
- }
- /* fall through to add the connectstring to the end
- * and set opt_ndbcluster_connectstring
- */
- case OPT_NDB_CONNECTSTRING:
- if (opt_ndb_connectstring && opt_ndb_connectstring[0])
- my_snprintf(opt_ndb_constrbuf+opt_ndb_constrbuf_len,
- sizeof(opt_ndb_constrbuf)-opt_ndb_constrbuf_len,
- "%s%s", opt_ndb_constrbuf_len > 0 ? ",":"",
- opt_ndb_connectstring);
- else
- opt_ndb_constrbuf[opt_ndb_constrbuf_len]= 0;
- opt_ndbcluster_connectstring= opt_ndb_constrbuf;
- break;
- case OPT_NDB_DISTRIBUTION:
- int id;
- id= find_type_or_exit(argument, &ndb_distribution_typelib, opt->name);
- opt_ndb_distribution_id= (enum ndb_distribution)(id-1);
- break;
- case OPT_NDB_EXTRA_LOGGING:
- if (!argument)
- ndb_extra_logging++;
- else if (argument == disabled_my_option)
- ndb_extra_logging= 0L;
+ delay_key_write_options= DELAY_KEY_WRITE_ALL;
else
- ndb_extra_logging= atoi(argument);
+ delay_key_write_options= DELAY_KEY_WRITE_NONE;
break;
-#endif
- case OPT_MYISAM_RECOVER:
- {
- if (!argument)
- {
- myisam_recover_options= HA_RECOVER_DEFAULT;
- myisam_recover_options_str= myisam_recover_typelib.type_names[0];
- }
- else if (!argument[0])
- {
- myisam_recover_options= HA_RECOVER_NONE;
- myisam_recover_options_str= "OFF";
- }
- else
- {
- myisam_recover_options_str=argument;
- myisam_recover_options=
- find_bit_type_or_exit(argument, &myisam_recover_typelib, opt->name,
- &error);
- if (error)
- return 1;
- }
- ha_open_options|=HA_OPEN_ABORT_IF_CRASHED;
- break;
- }
- case OPT_CONCURRENT_INSERT:
- /* The following code is mainly here to emulate old behavior */
- if (!argument) /* --concurrent-insert */
- myisam_concurrent_insert= 1;
- else if (argument == disabled_my_option)
- myisam_concurrent_insert= 0; /* --skip-concurrent-insert */
- break;
- case OPT_TC_HEURISTIC_RECOVER:
- tc_heuristic_recover= find_type_or_exit(argument,
- &tc_heuristic_recover_typelib,
- opt->name);
- break;
- case OPT_MYISAM_STATS_METHOD:
- {
- ulong method_conv;
- int method;
- LINT_INIT(method_conv);
-
- myisam_stats_method_str= argument;
- method= find_type_or_exit(argument, &myisam_stats_method_typelib,
- opt->name);
- switch (method-1) {
- case 2:
- method_conv= MI_STATS_METHOD_IGNORE_NULLS;
- break;
- case 1:
- method_conv= MI_STATS_METHOD_NULLS_EQUAL;
- break;
- case 0:
- default:
- method_conv= MI_STATS_METHOD_NULLS_NOT_EQUAL;
- break;
- }
- global_system_variables.myisam_stats_method= method_conv;
- break;
- }
- case OPT_SQL_MODE:
- {
- sql_mode_str= argument;
- global_system_variables.sql_mode=
- find_bit_type_or_exit(argument, &sql_mode_typelib, opt->name, &error);
- if (error)
- return 1;
- global_system_variables.sql_mode= fix_sql_mode(global_system_variables.
- sql_mode);
- break;
- }
- case OPT_OPTIMIZER_SWITCH:
- {
- bool not_used;
- char *error= 0;
- uint error_len= 0;
- optimizer_switch_str= argument;
- global_system_variables.optimizer_switch=
- (ulong)find_set_from_flags(&optimizer_switch_typelib,
- optimizer_switch_typelib.count,
- global_system_variables.optimizer_switch,
- global_system_variables.optimizer_switch,
- argument, strlen(argument), NULL,
- &error, &error_len, &not_used);
- if (error)
- {
- char buf[512];
- char *cbuf= buf;
- cbuf += my_snprintf(buf, 512, "Error in parsing optimizer_switch setting near %*s\n", error_len, error);
- sql_perror(buf);
- return 1;
- }
- break;
- }
case OPT_ONE_THREAD:
- global_system_variables.thread_handling=
- SCHEDULER_ONE_THREAD_PER_CONNECTION;
- break;
- case OPT_THREAD_HANDLING:
- {
- global_system_variables.thread_handling=
- find_type_or_exit(argument, &thread_handling_typelib, opt->name)-1;
- break;
- }
- case OPT_FT_BOOLEAN_SYNTAX:
- if (ft_boolean_check_syntax_string((uchar*) argument))
- {
- sql_print_error("Invalid ft-boolean-syntax string: %s\n", argument);
- return 1;
- }
- strmake(ft_boolean_syntax, argument, sizeof(ft_boolean_syntax)-1);
- break;
- case OPT_SKIP_SAFEMALLOC:
-#ifdef SAFEMALLOC
- sf_malloc_quick=1;
-#endif
+ thread_handling= SCHEDULER_ONE_THREAD_PER_CONNECTION;
break;
case OPT_LOWER_CASE_TABLE_NAMES:
- lower_case_table_names= argument ? atoi(argument) : 1;
lower_case_table_names_used= 1;
break;
#if defined(ENABLED_DEBUG_SYNC)
@@ -8559,24 +7001,92 @@ static int get_options(int *argc,char **argv)
int ho_error;
my_getopt_register_get_addr(mysql_getopt_value);
- strmake(def_ft_boolean_syntax, ft_boolean_syntax,
- sizeof(ft_boolean_syntax)-1);
my_getopt_error_reporter= option_error_reporter;
+ /* prepare all_options array */
+ my_init_dynamic_array(&all_options, sizeof(my_option),
+ array_elements(my_long_options), array_elements(my_long_options)/4);
+ for (my_option *opt= my_long_options;
+ opt < my_long_options + array_elements(my_long_options) - 1;
+ opt++)
+ insert_dynamic(&all_options, (uchar*) opt);
+ sys_var_init(&all_options);
+ all_options_add_terminator();
+
/* Skip unknown options so that they may be processed later by plugins */
my_getopt_skip_unknown= TRUE;
- if ((ho_error= handle_options(argc, &argv, my_long_options,
+ if ((ho_error= handle_options(argc, &argv, (my_option*)(all_options.buffer),
mysqld_get_one_option)))
return ho_error;
+
+ if (!opt_help)
+ delete_dynamic(&all_options);
+
(*argc)++; /* add back one for the progname handle_options removes */
/* no need to do this for argv as we are discarding it. */
+ /*
+ Options have been parsed. Now some of them need additional special
+ handling, like custom value checking, checking of incompatibilites
+ between options, setting of multiple variables, etc.
+ Do them here.
+ */
+
if ((opt_log_slow_admin_statements || opt_log_queries_not_using_indexes ||
opt_log_slow_slave_statements) &&
!opt_slow_log)
sql_print_warning("options --log-slow-admin-statements, --log-queries-not-using-indexes and --log-slow-slave-statements have no effect if --log_slow_queries is not set");
+ if (log_error_file_ptr != disabled_my_option)
+ opt_error_log= 1;
+ else
+ log_error_file_ptr= const_cast<char*>("");
+
+ opt_init_connect.length=strlen(opt_init_connect.str);
+ opt_init_slave.length=strlen(opt_init_slave.str);
+
+ if (global_system_variables.low_priority_updates)
+ thr_upgraded_concurrent_insert_lock= TL_WRITE_LOW_PRIORITY;
+
+ if (ft_boolean_check_syntax_string((uchar*) ft_boolean_syntax))
+ {
+ sql_print_error("Invalid ft-boolean-syntax string: %s\n",
+ ft_boolean_syntax);
+ return 1;
+ }
+
+ if (opt_disable_networking)
+ {
+#if defined(__NETWARE__)
+ sql_print_error("Can't start server: skip-networking option is currently not supported on NetWare");
+ return 1;
+#endif
+ mysqld_port= 0;
+ }
+ if (opt_skip_show_db)
+ opt_specialflag|= SPECIAL_SKIP_SHOW_DB;
+
+ if (myisam_flush)
+ flush_time= 0;
+
+#ifdef HAVE_REPLICATION
+ if (opt_slave_skip_errors)
+ init_slave_skip_errors(opt_slave_skip_errors);
+#endif
+
+ if (global_system_variables.max_join_size == HA_POS_ERROR)
+ global_system_variables.option_bits|= OPTION_BIG_SELECTS;
+ else
+ global_system_variables.option_bits&= ~OPTION_BIG_SELECTS;
+
+ if (global_system_variables.option_bits & OPTION_AUTOCOMMIT)
+ global_system_variables.option_bits&= ~OPTION_NOT_AUTOCOMMIT;
+ else
+ global_system_variables.option_bits|= OPTION_NOT_AUTOCOMMIT;
+
+ global_system_variables.sql_mode=
+ expand_sql_mode(global_system_variables.sql_mode);
#if defined(HAVE_BROKEN_REALPATH)
my_use_symdir=0;
my_disable_symlinks=1;
@@ -8595,15 +7105,13 @@ static int get_options(int *argc,char **argv)
test_flags&= ~TEST_CORE_ON_SIGNAL;
}
/* Set global MyISAM variables from delay_key_write_options */
- fix_delay_key_write((THD*) 0, OPT_GLOBAL);
- /* Set global slave_exec_mode from its option */
- fix_slave_exec_mode(OPT_GLOBAL);
+ fix_delay_key_write(0, 0, OPT_GLOBAL);
#ifndef EMBEDDED_LIBRARY
if (mysqld_chroot)
set_root(mysqld_chroot);
#else
- global_system_variables.thread_handling = SCHEDULER_NO_THREADS;
+ thread_handling = SCHEDULER_NO_THREADS;
max_allowed_packet= global_system_variables.max_allowed_packet;
net_buffer_length= global_system_variables.net_buffer_length;
#endif
@@ -8616,34 +7124,27 @@ static int get_options(int *argc,char **argv)
*/
my_disable_locking= myisam_single_user= test(opt_external_locking == 0);
my_default_record_cache_size=global_system_variables.read_buff_size;
- myisam_max_temp_length=
- (my_off_t) global_system_variables.myisam_max_sort_file_size;
- /* Set global variables based on startup options */
- myisam_block_size=(uint) 1 << my_bit_log2(opt_myisam_block_size);
-
- /* long_query_time is in microseconds */
- global_system_variables.long_query_time= max_system_variables.long_query_time=
- (longlong) (long_query_time * 1000000.0);
+ global_system_variables.long_query_time= (ulonglong)
+ (global_system_variables.long_query_time_double * 1e6);
if (opt_short_log_format)
opt_specialflag|= SPECIAL_SHORT_LOG_FORMAT;
if (init_global_datetime_format(MYSQL_TIMESTAMP_DATE,
- &global_system_variables.date_format) ||
+ &global_date_format) ||
init_global_datetime_format(MYSQL_TIMESTAMP_TIME,
- &global_system_variables.time_format) ||
+ &global_time_format) ||
init_global_datetime_format(MYSQL_TIMESTAMP_DATETIME,
- &global_system_variables.datetime_format))
+ &global_datetime_format))
return 1;
#ifdef EMBEDDED_LIBRARY
one_thread_scheduler(&thread_scheduler);
#else
- if (global_system_variables.thread_handling <=
- SCHEDULER_ONE_THREAD_PER_CONNECTION)
+ if (thread_handling <= SCHEDULER_ONE_THREAD_PER_CONNECTION)
one_thread_per_connection_scheduler(&thread_scheduler);
- else if (global_system_variables.thread_handling == SCHEDULER_NO_THREADS)
+ else if (thread_handling == SCHEDULER_NO_THREADS)
one_thread_scheduler(&thread_scheduler);
else
pool_of_threads_scheduler(&thread_scheduler); /* purecov: tested */
@@ -8729,7 +7230,7 @@ static int fix_paths(void)
convert_dirname(mysql_real_data_home,mysql_real_data_home,NullS);
(void) my_load_path(mysql_home,mysql_home,""); // Resolve current dir
(void) my_load_path(mysql_real_data_home,mysql_real_data_home,mysql_home);
- (void) my_load_path(pidfile_name,pidfile_name,mysql_real_data_home);
+ (void) my_load_path(pidfile_name, pidfile_name_ptr, mysql_real_data_home);
(void) my_load_path(opt_plugin_dir, opt_plugin_dir_ptr ? opt_plugin_dir_ptr :
get_relative_path(PLUGINDIR), mysql_home);
opt_plugin_dir_ptr= opt_plugin_dir;
@@ -8749,23 +7250,22 @@ static int fix_paths(void)
(void) my_load_path(lc_messages_dir, lc_messages_dir, buff);
/* If --character-sets-dir isn't given, use shared library dir */
- if (charsets_dir != mysql_charsets_dir)
- {
+ if (charsets_dir)
+ strmake(mysql_charsets_dir, charsets_dir, sizeof(mysql_charsets_dir)-1);
+ else
strxnmov(mysql_charsets_dir, sizeof(mysql_charsets_dir)-1, buff,
CHARSET_DIR, NullS);
- }
(void) my_load_path(mysql_charsets_dir, mysql_charsets_dir, buff);
convert_dirname(mysql_charsets_dir, mysql_charsets_dir, NullS);
charsets_dir=mysql_charsets_dir;
if (init_tmpdir(&mysql_tmpdir_list, opt_mysql_tmpdir))
return 1;
+ if (!opt_mysql_tmpdir)
+ opt_mysql_tmpdir= mysql_tmpdir;
#ifdef HAVE_REPLICATION
if (!slave_load_tmpdir)
- {
- if (!(slave_load_tmpdir = (char*) my_strdup(mysql_tmpdir, MYF(MY_FAE))))
- return 1;
- }
+ slave_load_tmpdir= mysql_tmpdir;
#endif /* HAVE_REPLICATION */
/*
Convert the secure-file-priv option to system format, allowing
@@ -8774,106 +7274,12 @@ static int fix_paths(void)
if (opt_secure_file_priv)
{
convert_dirname(buff, opt_secure_file_priv, NullS);
- my_free(opt_secure_file_priv, MYF(0));
+ x_free(opt_secure_file_priv);
opt_secure_file_priv= my_strdup(buff, MYF(MY_FAE));
}
return 0;
}
-
-static ulong find_bit_type_or_exit(const char *x, TYPELIB *bit_lib,
- const char *option, int *error)
-{
- ulong result;
- const char **ptr;
-
- *error= 0;
- if ((result= find_bit_type(x, bit_lib)) == ~(ulong) 0)
- {
- char *buff= (char *) my_alloca(2048);
- char *cbuf;
- ptr= bit_lib->type_names;
- cbuf= buff + ((!*x) ?
- my_snprintf(buff, 2048, "No option given to %s\n", option) :
- my_snprintf(buff, 2048, "Wrong option to %s. Option(s) given: %s\n",
- option, x));
- cbuf+= my_snprintf(cbuf, 2048 - (cbuf-buff), "Alternatives are: '%s'", *ptr);
- while (*++ptr)
- cbuf+= my_snprintf(cbuf, 2048 - (cbuf-buff), ",'%s'", *ptr);
- my_snprintf(cbuf, 2048 - (cbuf-buff), "\n");
- sql_perror(buff);
- *error= 1;
- my_afree(buff);
- return 0;
- }
-
- return result;
-}
-
-
-/**
- @return
- a bitfield from a string of substrings separated by ','
- or
- ~(ulong) 0 on error.
-*/
-
-static ulong find_bit_type(const char *x, TYPELIB *bit_lib)
-{
- bool found_end;
- int found_count;
- const char *end,*i,*j;
- const char **array, *pos;
- ulong found,found_int,bit;
- DBUG_ENTER("find_bit_type");
- DBUG_PRINT("enter",("x: '%s'",x));
-
- found=0;
- found_end= 0;
- pos=(char *) x;
- while (*pos == ' ') pos++;
- found_end= *pos == 0;
- while (!found_end)
- {
- if (!*(end=strcend(pos,','))) /* Let end point at fieldend */
- {
- while (end > pos && end[-1] == ' ')
- end--; /* Skip end-space */
- found_end=1;
- }
- found_int=0; found_count=0;
- for (array=bit_lib->type_names, bit=1 ; (i= *array++) ; bit<<=1)
- {
- j=pos;
- while (j != end)
- {
- if (my_toupper(mysqld_charset,*i++) !=
- my_toupper(mysqld_charset,*j++))
- goto skip;
- }
- found_int=bit;
- if (! *i)
- {
- found_count=1;
- break;
- }
- else if (j != pos) // Half field found
- {
- found_count++; // Could be one of two values
- }
-skip: ;
- }
- if (found_count != 1)
- DBUG_RETURN(~(ulong) 0); // No unique value
- found|=found_int;
- pos=end+1;
- }
-
- DBUG_PRINT("exit",("bit-field: %ld",(ulong) found));
- DBUG_RETURN(found);
-} /* find_bit_type */
-
-
/**
Check if file system used for databases is case insensitive.
@@ -8976,11 +7382,6 @@ void refresh_status(THD *thd)
This section should go away soon
*****************************************************************************/
-#ifndef WITH_NDBCLUSTER_STORAGE_ENGINE
-ulong ndb_cache_check_time;
-ulong ndb_extra_logging;
-#endif
-
/*****************************************************************************
Instantiate templates
*****************************************************************************/
@@ -8991,7 +7392,6 @@ template class I_List<THD>;
template class I_List_iterator<THD>;
template class I_List<i_string>;
template class I_List<i_string_pair>;
-template class I_List<NAMED_LIST>;
template class I_List<Statement>;
template class I_List_iterator<Statement>;
#endif
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index ac5b1f575de..741815585e2 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -5834,7 +5834,7 @@ get_mm_leaf(RANGE_OPT_PARAM *param, COND *conf_func, Field *field,
SEL_ARG *tree= 0;
MEM_ROOT *alloc= param->mem_root;
uchar *str;
- ulong orig_sql_mode;
+ ulonglong orig_sql_mode;
int err;
DBUG_ENTER("get_mm_leaf");
@@ -7574,7 +7574,6 @@ void SEL_ARG::test_use_count(SEL_ARG *root)
#endif
-
/*
Calculate estimate of number records that will be retrieved by a range
scan on given index using given SEL_ARG intervals tree.
@@ -7811,8 +7810,8 @@ check_quick_keys(PARAM *param, uint idx, SEL_ARG *key_tree,
param->range_count++;
if (!tmp_min_flag && ! tmp_max_flag &&
(uint) key_tree->part+1 == param->table->key_info[keynr].key_parts &&
- (param->table->key_info[keynr].flags & (HA_NOSAME | HA_END_SPACE_KEY)) ==
- HA_NOSAME && min_key_length == max_key_length &&
+ param->table->key_info[keynr].flags & HA_NOSAME &&
+ min_key_length == max_key_length &&
!memcmp(param->min_key, param->max_key, min_key_length) &&
!param->first_null_comp)
{
@@ -8105,8 +8104,7 @@ get_quick_keys(PARAM *param,QUICK_RANGE_SELECT *quick,KEY_PART *key,
{
KEY *table_key=quick->head->key_info+quick->index;
flag=EQ_RANGE;
- if ((table_key->flags & (HA_NOSAME | HA_END_SPACE_KEY)) == HA_NOSAME &&
- key->part == table_key->key_parts-1)
+ if ((table_key->flags & HA_NOSAME) && key->part == table_key->key_parts-1)
{
if (!(table_key->flags & HA_NULL_PART_KEY) ||
!null_part_in_key(key,
@@ -8155,8 +8153,7 @@ bool QUICK_RANGE_SELECT::unique_key_range()
if ((tmp->flag & (EQ_RANGE | NULL_RANGE)) == EQ_RANGE)
{
KEY *key=head->key_info+index;
- return ((key->flags & (HA_NOSAME | HA_END_SPACE_KEY)) == HA_NOSAME &&
- key->key_length == tmp->min_length);
+ return (key->flags & HA_NOSAME) && key->key_length == tmp->min_length;
}
}
return 0;
@@ -8274,8 +8271,7 @@ QUICK_RANGE_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table,
range->min_length= range->max_length= ref->key_length;
range->min_keypart_map= range->max_keypart_map=
make_prev_keypart_map(ref->key_parts);
- range->flag= ((ref->key_length == key_info->key_length &&
- (key_info->flags & HA_END_SPACE_KEY) == 0) ? EQ_RANGE : 0);
+ range->flag= (ref->key_length == key_info->key_length ? EQ_RANGE : 0);
if (!(quick->key_parts=key_part=(KEY_PART *)
alloc_root(&quick->alloc,sizeof(KEY_PART)*ref->key_parts)))
diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc
index 8392b2c1c3d..c4df268279a 100644
--- a/sql/repl_failsafe.cc
+++ b/sql/repl_failsafe.cc
@@ -38,7 +38,7 @@
#define SLAVE_ERRMSG_SIZE (FN_REFLEN+64)
-RPL_STATUS rpl_status=RPL_NULL;
+uint rpl_status=RPL_NULL;
pthread_mutex_t LOCK_rpl_status;
pthread_cond_t COND_rpl_status;
HASH slave_list;
@@ -49,7 +49,7 @@ TYPELIB rpl_role_typelib = {array_elements(rpl_role_type)-1,"",
const char* rpl_status_type[]=
{
- "AUTH_MASTER","ACTIVE_SLAVE","IDLE_SLAVE", "LOST_SOLDIER","TROOP_SOLDIER",
+ "AUTH_MASTER","IDLE_SLAVE","ACTIVE_SLAVE","LOST_SOLDIER","TROOP_SOLDIER",
"RECOVERY_CAPTAIN","NULL",NullS
};
TYPELIB rpl_status_typelib= {array_elements(rpl_status_type)-1,"",
@@ -98,9 +98,6 @@ static int init_failsafe_rpl_thread(THD* thd)
}
thd->mem_root->free= thd->mem_root->used= 0;
- if (thd->variables.max_join_size == HA_POS_ERROR)
- thd->options|= OPTION_BIG_SELECTS;
-
thd_proc_info(thd, "Thread initialized");
thd->version=refresh_version;
thd->set_time();
diff --git a/sql/repl_failsafe.h b/sql/repl_failsafe.h
index bce2c727050..f140b026bc1 100644
--- a/sql/repl_failsafe.h
+++ b/sql/repl_failsafe.h
@@ -22,11 +22,11 @@
#include "my_sys.h"
#include "slave.h"
-typedef enum {RPL_AUTH_MASTER=0,RPL_ACTIVE_SLAVE,RPL_IDLE_SLAVE,
+typedef enum {RPL_AUTH_MASTER=0,RPL_IDLE_SLAVE,RPL_ACTIVE_SLAVE,
RPL_LOST_SOLDIER,RPL_TROOP_SOLDIER,
RPL_RECOVERY_CAPTAIN,RPL_NULL /* inactive */,
RPL_ANY /* wild card used by change_rpl_status */ } RPL_STATUS;
-extern RPL_STATUS rpl_status;
+extern uint rpl_status;
extern pthread_mutex_t LOCK_rpl_status;
extern pthread_cond_t COND_rpl_status;
diff --git a/sql/rpl_record.cc b/sql/rpl_record.cc
index 8e80620dd2c..8f3a41fbeef 100644
--- a/sql/rpl_record.cc
+++ b/sql/rpl_record.cc
@@ -366,7 +366,6 @@ int prepare_record(TABLE *const table,
*/
for (Field **field_ptr= table->field+skip; *field_ptr; ++field_ptr)
{
- uint32 const mask= NOT_NULL_FLAG | NO_DEFAULT_VALUE_FLAG;
Field *const f= *field_ptr;
if ((f->flags & NO_DEFAULT_VALUE_FLAG) &&
(f->real_type() != MYSQL_TYPE_ENUM))
diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc
index 4bbafa0253a..70d24f42985 100644
--- a/sql/rpl_rli.cc
+++ b/sql/rpl_rli.cc
@@ -1043,7 +1043,7 @@ bool Relay_log_info::is_until_satisfied(THD *thd, Log_event *ev)
DBUG_RETURN(FALSE);
log_name= group_master_log_name;
log_pos= (!ev)? group_master_log_pos :
- ((thd->options & OPTION_BEGIN || !ev->log_pos) ?
+ ((thd->variables.option_bits & OPTION_BEGIN || !ev->log_pos) ?
group_master_log_pos : ev->log_pos - ev->data_written);
}
else
@@ -1168,7 +1168,7 @@ void Relay_log_info::stmt_done(my_off_t event_master_log_pos,
middle of the "transaction". START SLAVE will resume at BEGIN
while the MyISAM table has already been updated.
*/
- if ((sql_thd->options & OPTION_BEGIN) && opt_using_transactions)
+ if ((sql_thd->variables.option_bits & OPTION_BEGIN) && opt_using_transactions)
inc_event_relay_log_pos();
else
{
@@ -1221,8 +1221,8 @@ void Relay_log_info::cleanup_context(THD *thd, bool error)
/*
Cleanup for the flags that have been set at do_apply_event.
*/
- thd->options&= ~OPTION_NO_FOREIGN_KEY_CHECKS;
- thd->options&= ~OPTION_RELAXED_UNIQUE_CHECKS;
+ thd->variables.option_bits&= ~OPTION_NO_FOREIGN_KEY_CHECKS;
+ thd->variables.option_bits&= ~OPTION_RELAXED_UNIQUE_CHECKS;
DBUG_VOID_RETURN;
}
diff --git a/sql/rpl_rli.h b/sql/rpl_rli.h
index ec314e50cc7..33b708cb1bd 100644
--- a/sql/rpl_rli.h
+++ b/sql/rpl_rli.h
@@ -22,6 +22,7 @@
struct RPL_TABLE_LIST;
class Master_info;
+extern uint sql_slave_skip_counter;
/****************************************************************************
@@ -426,7 +427,7 @@ public:
@retval false Replication thread is currently not inside a group
*/
bool is_in_group() const {
- return (sql_thd->options & OPTION_BEGIN) ||
+ return (sql_thd->variables.option_bits & OPTION_BEGIN) ||
(m_flags & (1UL << IN_STMT));
}
diff --git a/sql/set_var.cc b/sql/set_var.cc
index 42829590942..65218dce1eb 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -13,2134 +13,324 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-/**
- @file
-
- @brief
- Handling of MySQL SQL variables
-
- @details
- To add a new variable, one has to do the following:
-
- - Use one of the 'sys_var... classes from set_var.h or write a specific
- one for the variable type.
- - Define it in the 'variable definition list' in this file.
- - If the variable is thread specific, add it to 'system_variables' struct.
- If not, add it to mysqld.cc and an declaration in 'mysql_priv.h'
- - If the variable should be changed from the command line, add a definition
- of it in the my_option structure list in mysqld.cc
- - Don't forget to initialize new fields in global_system_variables and
- max_system_variables!
-
- @todo
- Add full support for the variable character_set (for 4.1)
-
- @todo
- When updating myisam_delay_key_write, we should do a 'flush tables'
- of all MyISAM tables to ensure that they are reopen with the
- new attribute.
-
- @note
- Be careful with var->save_result: sys_var::check() only updates
- ulonglong_value; so other members of the union are garbage then; to use
- them you must first assign a value to them (in specific ::check() for
- example).
-*/
-
#ifdef USE_PRAGMA_IMPLEMENTATION
-#pragma implementation // gcc: Class implementation
+#pragma implementation
#endif
-#include "mysql_priv.h"
-#include <mysql.h>
-#include "slave.h"
-#include "rpl_mi.h"
-#include <my_getopt.h>
-#include <thr_alarm.h>
-#include <myisam.h>
-#include <my_dir.h>
-
-#include "events.h"
-
-/* WITH_NDBCLUSTER_STORAGE_ENGINE */
-#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
-extern ulong ndb_cache_check_time;
-extern char opt_ndb_constrbuf[];
-extern ulong ndb_extra_logging;
-#endif
-
-#ifdef HAVE_NDB_BINLOG
-extern ulong ndb_report_thresh_binlog_epoch_slip;
-extern ulong ndb_report_thresh_binlog_mem_usage;
-#endif
-
-extern CHARSET_INFO *character_set_filesystem;
+/* variable declarations are in sys_vars.cc now !!! */
+#include "mysql_priv.h"
+#include "sys_vars_shared.h"
static HASH system_variable_hash;
-
-const char *bool_type_names[]= { "OFF", "ON", NullS };
-TYPELIB bool_typelib=
-{
- array_elements(bool_type_names)-1, "", bool_type_names, NULL
-};
-
-const char *delay_key_write_type_names[]= { "OFF", "ON", "ALL", NullS };
-TYPELIB delay_key_write_typelib=
-{
- array_elements(delay_key_write_type_names)-1, "",
- delay_key_write_type_names, NULL
-};
-
-const char *slave_exec_mode_names[]=
-{ "STRICT", "IDEMPOTENT", NullS };
-static const unsigned int slave_exec_mode_names_len[]=
-{ sizeof("STRICT") - 1, sizeof("IDEMPOTENT") - 1, 0 };
-TYPELIB slave_exec_mode_typelib=
-{
- array_elements(slave_exec_mode_names)-1, "",
- slave_exec_mode_names, (unsigned int *) slave_exec_mode_names_len
-};
-
-static int sys_check_ftb_syntax(THD *thd, set_var *var);
-static bool sys_update_ftb_syntax(THD *thd, set_var * var);
-static void sys_default_ftb_syntax(THD *thd, enum_var_type type);
-static bool sys_update_init_connect(THD*, set_var*);
-static void sys_default_init_connect(THD*, enum_var_type type);
-static bool sys_update_init_slave(THD*, set_var*);
-static void sys_default_init_slave(THD*, enum_var_type type);
-static bool set_option_bit(THD *thd, set_var *var);
-static bool set_option_log_bin_bit(THD *thd, set_var *var);
-static bool set_option_autocommit(THD *thd, set_var *var);
-static int check_log_update(THD *thd, set_var *var);
-static bool set_log_update(THD *thd, set_var *var);
-static int check_pseudo_thread_id(THD *thd, set_var *var);
-void fix_binlog_format_after_update(THD *thd, enum_var_type type);
-static void fix_low_priority_updates(THD *thd, enum_var_type type);
-static int check_tx_isolation(THD *thd, set_var *var);
-static void fix_tx_isolation(THD *thd, enum_var_type type);
-static int check_completion_type(THD *thd, set_var *var);
-static void fix_completion_type(THD *thd, enum_var_type type);
-static void fix_net_read_timeout(THD *thd, enum_var_type type);
-static void fix_net_write_timeout(THD *thd, enum_var_type type);
-static void fix_net_retry_count(THD *thd, enum_var_type type);
-static void fix_max_join_size(THD *thd, enum_var_type type);
-#ifdef HAVE_QUERY_CACHE
-static void fix_query_cache_size(THD *thd, enum_var_type type);
-static void fix_query_cache_min_res_unit(THD *thd, enum_var_type type);
-#endif
-static void fix_myisam_max_sort_file_size(THD *thd, enum_var_type type);
-static void fix_max_binlog_size(THD *thd, enum_var_type type);
-static void fix_max_relay_log_size(THD *thd, enum_var_type type);
-static void fix_max_connections(THD *thd, enum_var_type type);
-static int check_max_delayed_threads(THD *thd, set_var *var);
-static void fix_thd_mem_root(THD *thd, enum_var_type type);
-static void fix_trans_mem_root(THD *thd, enum_var_type type);
-static void fix_server_id(THD *thd, enum_var_type type);
-bool throw_bounds_warning(THD *thd, bool fixed, bool unsignd,
- const char *name, longlong val);
-static KEY_CACHE *create_key_cache(const char *name, uint length);
-void fix_sql_mode_var(THD *thd, enum_var_type type);
-static uchar *get_error_count(THD *thd);
-static uchar *get_warning_count(THD *thd);
-static uchar *get_tmpdir(THD *thd);
-static int sys_check_log_path(THD *thd, set_var *var);
-static bool sys_update_general_log_path(THD *thd, set_var * var);
-static void sys_default_general_log_path(THD *thd, enum_var_type type);
-static bool sys_update_slow_log_path(THD *thd, set_var * var);
-static void sys_default_slow_log_path(THD *thd, enum_var_type type);
-static uchar *get_myisam_mmap_size(THD *thd);
-
-/*
- Variable definition list
-
- These are variables that can be set from the command line, in
- alphabetic order.
-
- The variables are linked into the list. A variable is added to
- it in the constructor (see sys_var class for details).
-*/
-
-static sys_var_chain vars = { NULL, NULL };
-
-static sys_var_thd_ulong
-sys_auto_increment_increment(&vars, "auto_increment_increment",
- &SV::auto_increment_increment, NULL, NULL,
- sys_var::SESSION_VARIABLE_IN_BINLOG);
-static sys_var_thd_ulong
-sys_auto_increment_offset(&vars, "auto_increment_offset",
- &SV::auto_increment_offset, NULL, NULL,
- sys_var::SESSION_VARIABLE_IN_BINLOG);
-
-static sys_var_bool_ptr sys_automatic_sp_privileges(&vars, "automatic_sp_privileges",
- &sp_automatic_privileges);
-
-static sys_var_const sys_back_log(&vars, "back_log",
- OPT_GLOBAL, SHOW_LONG,
- (uchar*) &back_log);
-static sys_var_const_os_str sys_basedir(&vars, "basedir", mysql_home);
-static sys_var_long_ptr sys_binlog_cache_size(&vars, "binlog_cache_size",
- &binlog_cache_size);
-static sys_var_thd_binlog_format sys_binlog_format(&vars, "binlog_format",
- &SV::binlog_format);
-static sys_var_thd_ulong sys_bulk_insert_buff_size(&vars, "bulk_insert_buffer_size",
- &SV::bulk_insert_buff_size);
-static sys_var_const_os sys_character_sets_dir(&vars,
- "character_sets_dir",
- OPT_GLOBAL, SHOW_CHAR,
- (uchar*)
- mysql_charsets_dir);
-static sys_var_character_set_sv
-sys_character_set_server(&vars, "character_set_server",
- &SV::collation_server, &default_charset_info, 0,
- sys_var::SESSION_VARIABLE_IN_BINLOG);
-sys_var_const_str sys_charset_system(&vars, "character_set_system",
- (char *)my_charset_utf8_general_ci.name);
-static sys_var_character_set_database
-sys_character_set_database(&vars, "character_set_database",
- sys_var::SESSION_VARIABLE_IN_BINLOG);
-static sys_var_character_set_client
-sys_character_set_client(&vars, "character_set_client",
- &SV::character_set_client,
- &default_charset_info,
- sys_var::SESSION_VARIABLE_IN_BINLOG);
-static sys_var_character_set_sv
-sys_character_set_connection(&vars, "character_set_connection",
- &SV::collation_connection,
- &default_charset_info, 0,
- sys_var::SESSION_VARIABLE_IN_BINLOG);
-static sys_var_character_set_sv sys_character_set_results(&vars, "character_set_results",
- &SV::character_set_results,
- &default_charset_info, true);
-static sys_var_character_set_sv sys_character_set_filesystem(&vars, "character_set_filesystem",
- &SV::character_set_filesystem,
- &character_set_filesystem);
-static sys_var_thd_ulong sys_completion_type(&vars, "completion_type",
- &SV::completion_type,
- check_completion_type,
- fix_completion_type);
-static sys_var_collation_sv
-sys_collation_connection(&vars, "collation_connection",
- &SV::collation_connection, &default_charset_info,
- sys_var::SESSION_VARIABLE_IN_BINLOG);
-static sys_var_collation_sv
-sys_collation_database(&vars, "collation_database", &SV::collation_database,
- &default_charset_info,
- sys_var::SESSION_VARIABLE_IN_BINLOG);
-static sys_var_collation_sv
-sys_collation_server(&vars, "collation_server", &SV::collation_server,
- &default_charset_info,
- sys_var::SESSION_VARIABLE_IN_BINLOG);
-static sys_var_long_ptr sys_concurrent_insert(&vars, "concurrent_insert",
- &myisam_concurrent_insert);
-static sys_var_long_ptr sys_connect_timeout(&vars, "connect_timeout",
- &connect_timeout);
-static sys_var_const_os_str sys_datadir(&vars, "datadir", mysql_real_data_home);
-#ifndef DBUG_OFF
-static sys_var_thd_dbug sys_dbug(&vars, "debug");
-#endif
-static sys_var_enum sys_delay_key_write(&vars, "delay_key_write",
- &delay_key_write_options,
- &delay_key_write_typelib,
- fix_delay_key_write);
-static sys_var_long_ptr sys_delayed_insert_limit(&vars, "delayed_insert_limit",
- &delayed_insert_limit);
-static sys_var_long_ptr sys_delayed_insert_timeout(&vars, "delayed_insert_timeout",
- &delayed_insert_timeout);
-static sys_var_long_ptr sys_delayed_queue_size(&vars, "delayed_queue_size",
- &delayed_queue_size);
-
-#ifdef HAVE_EVENT_SCHEDULER
-static sys_var_event_scheduler sys_event_scheduler(&vars, "event_scheduler");
-#endif
-
-static sys_var_long_ptr sys_expire_logs_days(&vars, "expire_logs_days",
- &expire_logs_days);
-static sys_var_bool_ptr sys_flush(&vars, "flush", &myisam_flush);
-static sys_var_long_ptr sys_flush_time(&vars, "flush_time", &flush_time);
-static sys_var_str sys_ft_boolean_syntax(&vars, "ft_boolean_syntax",
- sys_check_ftb_syntax,
- sys_update_ftb_syntax,
- sys_default_ftb_syntax,
- ft_boolean_syntax);
-static sys_var_const sys_ft_max_word_len(&vars, "ft_max_word_len",
- OPT_GLOBAL, SHOW_LONG,
- (uchar*) &ft_max_word_len);
-static sys_var_const sys_ft_min_word_len(&vars, "ft_min_word_len",
- OPT_GLOBAL, SHOW_LONG,
- (uchar*) &ft_min_word_len);
-static sys_var_const sys_ft_query_expansion_limit(&vars,
- "ft_query_expansion_limit",
- OPT_GLOBAL, SHOW_LONG,
- (uchar*)
- &ft_query_expansion_limit);
-static sys_var_const sys_ft_stopword_file(&vars, "ft_stopword_file",
- OPT_GLOBAL, SHOW_CHAR_PTR,
- (uchar*) &ft_stopword_file);
-
-static sys_var_const sys_ignore_builtin_innodb(&vars, "ignore_builtin_innodb",
- OPT_GLOBAL, SHOW_BOOL,
- (uchar*) &opt_ignore_builtin_innodb);
-
-sys_var_str sys_init_connect(&vars, "init_connect", 0,
- sys_update_init_connect,
- sys_default_init_connect,0);
-static sys_var_const sys_init_file(&vars, "init_file",
- OPT_GLOBAL, SHOW_CHAR_PTR,
- (uchar*) &opt_init_file);
-sys_var_str sys_init_slave(&vars, "init_slave", 0,
- sys_update_init_slave,
- sys_default_init_slave,0);
-static sys_var_thd_ulong sys_interactive_timeout(&vars, "interactive_timeout",
- &SV::net_interactive_timeout);
-static sys_var_thd_ulong sys_join_buffer_size(&vars, "join_buffer_size",
- &SV::join_buff_size);
-static sys_var_key_buffer_size sys_key_buffer_size(&vars, "key_buffer_size");
-static sys_var_key_cache_long sys_key_cache_block_size(&vars, "key_cache_block_size",
- offsetof(KEY_CACHE,
- param_block_size));
-static sys_var_key_cache_long sys_key_cache_division_limit(&vars, "key_cache_division_limit",
- offsetof(KEY_CACHE,
- param_division_limit));
-static sys_var_key_cache_long sys_key_cache_age_threshold(&vars, "key_cache_age_threshold",
- offsetof(KEY_CACHE,
- param_age_threshold));
-static sys_var_const sys_large_files_support(&vars, "large_files_support",
- OPT_GLOBAL, SHOW_BOOL,
- (uchar*) &opt_large_files);
-static sys_var_const sys_large_page_size(&vars, "large_page_size",
- OPT_GLOBAL, SHOW_INT,
- (uchar*) &opt_large_page_size);
-static sys_var_const sys_large_pages(&vars, "large_pages",
- OPT_GLOBAL, SHOW_MY_BOOL,
- (uchar*) &opt_large_pages);
-static sys_var_const sys_language(&vars, "lc_messages_dir",
- OPT_GLOBAL, SHOW_CHAR,
- (uchar*) lc_messages_dir);
-static sys_var_bool_ptr sys_local_infile(&vars, "local_infile",
- &opt_local_infile);
-#ifdef HAVE_MLOCKALL
-static sys_var_const sys_locked_in_memory(&vars, "locked_in_memory",
- OPT_GLOBAL, SHOW_MY_BOOL,
- (uchar*) &locked_in_memory);
-#endif
-static sys_var_const sys_log_bin(&vars, "log_bin",
- OPT_GLOBAL, SHOW_BOOL,
- (uchar*) &opt_bin_log);
-static sys_var_bool_ptr
-sys_trust_function_creators(&vars, "log_bin_trust_function_creators",
- &trust_function_creators);
-static sys_var_const sys_log_error(&vars, "log_error",
- OPT_GLOBAL, SHOW_CHAR,
- (uchar*) log_error_file);
-static sys_var_bool_ptr
- sys_log_queries_not_using_indexes(&vars, "log_queries_not_using_indexes",
- &opt_log_queries_not_using_indexes);
-static sys_var_thd_ulong sys_log_warnings(&vars, "log_warnings", &SV::log_warnings);
-static sys_var_microseconds sys_var_long_query_time(&vars, "long_query_time",
- &SV::long_query_time);
-static sys_var_thd_bool sys_low_priority_updates(&vars, "low_priority_updates",
- &SV::low_priority_updates,
- fix_low_priority_updates);
-#ifndef TO_BE_DELETED /* Alias for the low_priority_updates */
-static sys_var_thd_bool sys_sql_low_priority_updates(&vars, "sql_low_priority_updates",
- &SV::low_priority_updates,
- fix_low_priority_updates);
-#endif
-static sys_var_const sys_lower_case_file_system(&vars,
- "lower_case_file_system",
- OPT_GLOBAL, SHOW_MY_BOOL,
- (uchar*)
- &lower_case_file_system);
-static sys_var_const sys_lower_case_table_names(&vars,
- "lower_case_table_names",
- OPT_GLOBAL, SHOW_INT,
- (uchar*)
- &lower_case_table_names);
-static sys_var_thd_ulong_session_readonly sys_max_allowed_packet(&vars, "max_allowed_packet",
- &SV::max_allowed_packet);
-static sys_var_ulonglong_ptr sys_max_binlog_cache_size(&vars, "max_binlog_cache_size",
- &max_binlog_cache_size);
-static sys_var_long_ptr sys_max_binlog_size(&vars, "max_binlog_size",
- &max_binlog_size,
- fix_max_binlog_size);
-static sys_var_long_ptr sys_max_connections(&vars, "max_connections",
- &max_connections,
- fix_max_connections);
-static sys_var_long_ptr sys_max_connect_errors(&vars, "max_connect_errors",
- &max_connect_errors);
-static sys_var_thd_ulong sys_max_insert_delayed_threads(&vars, "max_insert_delayed_threads",
- &SV::max_insert_delayed_threads,
- check_max_delayed_threads,
- fix_max_connections);
-static sys_var_thd_ulong sys_max_delayed_threads(&vars, "max_delayed_threads",
- &SV::max_insert_delayed_threads,
- check_max_delayed_threads,
- fix_max_connections);
-static sys_var_thd_ulong sys_max_error_count(&vars, "max_error_count",
- &SV::max_error_count);
-static sys_var_thd_ulonglong sys_max_heap_table_size(&vars, "max_heap_table_size",
- &SV::max_heap_table_size);
-static sys_var_thd_ulong sys_pseudo_thread_id(&vars, "pseudo_thread_id",
- &SV::pseudo_thread_id,
- check_pseudo_thread_id, 0,
- sys_var::SESSION_VARIABLE_IN_BINLOG);
-static sys_var_thd_ha_rows sys_max_join_size(&vars, "max_join_size",
- &SV::max_join_size,
- fix_max_join_size);
-static sys_var_thd_ulong sys_max_seeks_for_key(&vars, "max_seeks_for_key",
- &SV::max_seeks_for_key);
-static sys_var_thd_ulong sys_max_length_for_sort_data(&vars, "max_length_for_sort_data",
- &SV::max_length_for_sort_data);
-#ifndef TO_BE_DELETED /* Alias for max_join_size */
-static sys_var_thd_ha_rows sys_sql_max_join_size(&vars, "sql_max_join_size",
- &SV::max_join_size,
- fix_max_join_size);
-#endif
-static sys_var_long_ptr_global
-sys_max_prepared_stmt_count(&vars, "max_prepared_stmt_count",
- &max_prepared_stmt_count,
- &LOCK_prepared_stmt_count);
-static sys_var_long_ptr sys_max_relay_log_size(&vars, "max_relay_log_size",
- &max_relay_log_size,
- fix_max_relay_log_size);
-static sys_var_thd_ulong sys_max_sort_length(&vars, "max_sort_length",
- &SV::max_sort_length);
-static sys_var_thd_ulong sys_max_sp_recursion_depth(&vars, "max_sp_recursion_depth",
- &SV::max_sp_recursion_depth);
-static sys_var_max_user_conn sys_max_user_connections(&vars, "max_user_connections");
-static sys_var_thd_ulong sys_max_tmp_tables(&vars, "max_tmp_tables",
- &SV::max_tmp_tables);
-static sys_var_long_ptr sys_max_write_lock_count(&vars, "max_write_lock_count",
- &max_write_lock_count);
-static sys_var_thd_ulong sys_min_examined_row_limit(&vars, "min_examined_row_limit",
- &SV::min_examined_row_limit);
-static sys_var_thd_ulong sys_multi_range_count(&vars, "multi_range_count",
- &SV::multi_range_count);
-static sys_var_long_ptr sys_myisam_data_pointer_size(&vars, "myisam_data_pointer_size",
- &myisam_data_pointer_size);
-static sys_var_thd_ulonglong sys_myisam_max_sort_file_size(&vars, "myisam_max_sort_file_size", &SV::myisam_max_sort_file_size, fix_myisam_max_sort_file_size, 1);
-static sys_var_const sys_myisam_recover_options(&vars, "myisam_recover_options",
- OPT_GLOBAL, SHOW_CHAR_PTR,
- (uchar*)
- &myisam_recover_options_str);
-static sys_var_thd_ulong sys_myisam_repair_threads(&vars, "myisam_repair_threads", &SV::myisam_repair_threads);
-static sys_var_thd_ulong sys_myisam_sort_buffer_size(&vars, "myisam_sort_buffer_size", &SV::myisam_sort_buff_size);
-static sys_var_bool_ptr sys_myisam_use_mmap(&vars, "myisam_use_mmap",
- &opt_myisam_use_mmap);
-
-static sys_var_thd_enum sys_myisam_stats_method(&vars, "myisam_stats_method",
- &SV::myisam_stats_method,
- &myisam_stats_method_typelib,
- NULL);
-
-#ifdef _WIN32
-/* purecov: begin inspected */
-static sys_var_const sys_named_pipe(&vars, "named_pipe",
- OPT_GLOBAL, SHOW_MY_BOOL,
- (uchar*) &opt_enable_named_pipe);
-/* purecov: end */
-#endif
-static sys_var_thd_ulong_session_readonly sys_net_buffer_length(&vars, "net_buffer_length",
- &SV::net_buffer_length);
-static sys_var_thd_ulong sys_net_read_timeout(&vars, "net_read_timeout",
- &SV::net_read_timeout,
- 0, fix_net_read_timeout);
-static sys_var_thd_ulong sys_net_write_timeout(&vars, "net_write_timeout",
- &SV::net_write_timeout,
- 0, fix_net_write_timeout);
-static sys_var_thd_ulong sys_net_retry_count(&vars, "net_retry_count",
- &SV::net_retry_count,
- 0, fix_net_retry_count);
-static sys_var_thd_bool sys_new_mode(&vars, "new", &SV::new_mode);
-static sys_var_bool_ptr_readonly sys_old_mode(&vars, "old",
- &global_system_variables.old_mode);
-/* these two cannot be static */
-sys_var_thd_bool sys_old_alter_table(&vars, "old_alter_table",
- &SV::old_alter_table);
-sys_var_thd_bool sys_old_passwords(&vars, "old_passwords", &SV::old_passwords);
-static sys_var_const sys_open_files_limit(&vars, "open_files_limit",
- OPT_GLOBAL, SHOW_LONG,
- (uchar*)
- &open_files_limit);
-static sys_var_thd_ulong sys_optimizer_prune_level(&vars, "optimizer_prune_level",
- &SV::optimizer_prune_level);
-static sys_var_thd_ulong sys_optimizer_search_depth(&vars, "optimizer_search_depth",
- &SV::optimizer_search_depth);
-static sys_var_thd_optimizer_switch sys_optimizer_switch(&vars, "optimizer_switch",
- &SV::optimizer_switch);
-static sys_var_const sys_pid_file(&vars, "pid_file",
- OPT_GLOBAL, SHOW_CHAR,
- (uchar*) pidfile_name);
-static sys_var_const_os sys_plugin_dir(&vars, "plugin_dir",
- OPT_GLOBAL, SHOW_CHAR,
- (uchar*) opt_plugin_dir);
-static sys_var_const sys_port(&vars, "port",
- OPT_GLOBAL, SHOW_INT,
- (uchar*) &mysqld_port);
-static sys_var_thd_ulong sys_preload_buff_size(&vars, "preload_buffer_size",
- &SV::preload_buff_size);
-static sys_var_const sys_protocol_version(&vars, "protocol_version",
- OPT_GLOBAL, SHOW_INT,
- (uchar*)
- &protocol_version);
-static sys_var_thd_ulong sys_read_buff_size(&vars, "read_buffer_size",
- &SV::read_buff_size);
-static sys_var_opt_readonly sys_readonly(&vars, "read_only", &opt_readonly);
-static sys_var_thd_ulong sys_read_rnd_buff_size(&vars, "read_rnd_buffer_size",
- &SV::read_rnd_buff_size);
-static sys_var_thd_ulong sys_div_precincrement(&vars, "div_precision_increment",
- &SV::div_precincrement);
-static sys_var_long_ptr sys_rpl_recovery_rank(&vars, "rpl_recovery_rank",
- &rpl_recovery_rank);
-
-static sys_var_thd_ulong sys_range_alloc_block_size(&vars, "range_alloc_block_size",
- &SV::range_alloc_block_size);
-static sys_var_thd_ulong sys_query_alloc_block_size(&vars, "query_alloc_block_size",
- &SV::query_alloc_block_size,
- 0, fix_thd_mem_root);
-static sys_var_thd_ulong sys_query_prealloc_size(&vars, "query_prealloc_size",
- &SV::query_prealloc_size,
- 0, fix_thd_mem_root);
-#ifdef HAVE_SMEM
-/* purecov: begin tested */
-static sys_var_const sys_shared_memory(&vars, "shared_memory",
- OPT_GLOBAL, SHOW_MY_BOOL,
- (uchar*)
- &opt_enable_shared_memory);
-static sys_var_const sys_shared_memory_base_name(&vars,
- "shared_memory_base_name",
- OPT_GLOBAL, SHOW_CHAR_PTR,
- (uchar*)
- &shared_memory_base_name);
-/* purecov: end */
-#endif
-static sys_var_const sys_skip_external_locking(&vars,
- "skip_external_locking",
- OPT_GLOBAL, SHOW_MY_BOOL,
- (uchar*)
- &my_disable_locking);
-static sys_var_const sys_skip_networking(&vars, "skip_networking",
- OPT_GLOBAL, SHOW_BOOL,
- (uchar*) &opt_disable_networking);
-static sys_var_const sys_skip_show_database(&vars, "skip_show_database",
- OPT_GLOBAL, SHOW_BOOL,
- (uchar*) &opt_skip_show_db);
-
-static sys_var_const sys_socket(&vars, "socket",
- OPT_GLOBAL, SHOW_CHAR_PTR,
- (uchar*) &mysqld_unix_port);
-
-#ifdef HAVE_THR_SETCONCURRENCY
-/* purecov: begin tested */
-static sys_var_const sys_thread_concurrency(&vars, "thread_concurrency",
- OPT_GLOBAL, SHOW_LONG,
- (uchar*) &concurrency);
-/* purecov: end */
-#endif
-static sys_var_const sys_thread_stack(&vars, "thread_stack",
- OPT_GLOBAL, SHOW_LONG,
- (uchar*) &my_thread_stack_size);
-static sys_var_readonly_os sys_tmpdir(&vars, "tmpdir", OPT_GLOBAL, SHOW_CHAR, get_tmpdir);
-static sys_var_thd_ulong sys_trans_alloc_block_size(&vars, "transaction_alloc_block_size",
- &SV::trans_alloc_block_size,
- 0, fix_trans_mem_root);
-static sys_var_thd_ulong sys_trans_prealloc_size(&vars, "transaction_prealloc_size",
- &SV::trans_prealloc_size,
- 0, fix_trans_mem_root);
-sys_var_enum_const sys_thread_handling(&vars, "thread_handling",
- &SV::thread_handling,
- &thread_handling_typelib,
- NULL);
-
-#ifdef HAVE_QUERY_CACHE
-static sys_var_long_ptr sys_query_cache_size(&vars, "query_cache_size",
- &query_cache_size,
- fix_query_cache_size);
-static sys_var_long_ptr sys_query_cache_limit(&vars, "query_cache_limit",
- &query_cache.query_cache_limit);
-static sys_var_long_ptr
- sys_query_cache_min_res_unit(&vars, "query_cache_min_res_unit",
- &query_cache_min_res_unit,
- fix_query_cache_min_res_unit);
-static int check_query_cache_type(THD *thd, set_var *var);
-static sys_var_thd_enum sys_query_cache_type(&vars, "query_cache_type",
- &SV::query_cache_type,
- &query_cache_type_typelib, NULL,
- check_query_cache_type);
-static sys_var_thd_bool
-sys_query_cache_wlock_invalidate(&vars, "query_cache_wlock_invalidate",
- &SV::query_cache_wlock_invalidate);
-#endif /* HAVE_QUERY_CACHE */
-static sys_var_bool_ptr sys_secure_auth(&vars, "secure_auth", &opt_secure_auth);
-static sys_var_const_str_ptr sys_secure_file_priv(&vars, "secure_file_priv",
- &opt_secure_file_priv);
-static sys_var_long_ptr sys_server_id(&vars, "server_id", &server_id, fix_server_id);
-static sys_var_bool_ptr sys_slave_compressed_protocol(&vars, "slave_compressed_protocol",
- &opt_slave_compressed_protocol);
-static sys_var_set_slave_mode slave_exec_mode(&vars,
- "slave_exec_mode",
- &slave_exec_mode_options,
- &slave_exec_mode_typelib,
- 0);
-static sys_var_long_ptr sys_slow_launch_time(&vars, "slow_launch_time",
- &slow_launch_time);
-static sys_var_thd_ulong sys_sort_buffer(&vars, "sort_buffer_size",
- &SV::sortbuff_size);
-/*
- sql_mode should *not* have binlog_mode=SESSION_VARIABLE_IN_BINLOG:
- even though it is written to the binlog, the slave ignores the
- MODE_NO_DIR_IN_CREATE variable, so slave's value differs from
- master's (see log_event.cc: Query_log_event::do_apply_event()).
-*/
-static sys_var_thd_sql_mode sys_sql_mode(&vars, "sql_mode",
- &SV::sql_mode);
-#ifdef HAVE_OPENSSL
-extern char *opt_ssl_ca, *opt_ssl_capath, *opt_ssl_cert, *opt_ssl_cipher,
- *opt_ssl_key;
-static sys_var_const_os_str_ptr sys_ssl_ca(&vars, "ssl_ca", &opt_ssl_ca);
-static sys_var_const_os_str_ptr sys_ssl_capath(&vars, "ssl_capath", &opt_ssl_capath);
-static sys_var_const_os_str_ptr sys_ssl_cert(&vars, "ssl_cert", &opt_ssl_cert);
-static sys_var_const_os_str_ptr sys_ssl_cipher(&vars, "ssl_cipher", &opt_ssl_cipher);
-static sys_var_const_os_str_ptr sys_ssl_key(&vars, "ssl_key", &opt_ssl_key);
-#else
-static sys_var_const_os_str sys_ssl_ca(&vars, "ssl_ca", NULL);
-static sys_var_const_os_str sys_ssl_capath(&vars, "ssl_capath", NULL);
-static sys_var_const_os_str sys_ssl_cert(&vars, "ssl_cert", NULL);
-static sys_var_const_os_str sys_ssl_cipher(&vars, "ssl_cipher", NULL);
-static sys_var_const_os_str sys_ssl_key(&vars, "ssl_key", NULL);
-#endif
-static sys_var_thd_enum
-sys_updatable_views_with_limit(&vars, "updatable_views_with_limit",
- &SV::updatable_views_with_limit,
- &updatable_views_with_limit_typelib);
-
-static sys_var_thd_storage_engine sys_storage_engine(&vars, "storage_engine",
- &SV::table_plugin);
-static sys_var_bool_ptr sys_sync_frm(&vars, "sync_frm", &opt_sync_frm);
-static sys_var_const_str sys_system_time_zone(&vars, "system_time_zone",
- system_time_zone);
-static sys_var_long_ptr sys_table_def_size(&vars, "table_definition_cache",
- &table_def_size);
-static sys_var_long_ptr sys_table_cache_size(&vars, "table_open_cache",
- &table_cache_size);
-static sys_var_long_ptr sys_table_lock_wait_timeout(&vars, "table_lock_wait_timeout",
- &table_lock_wait_timeout);
-
-#if defined(ENABLED_DEBUG_SYNC)
-/* Debug Sync Facility. Implemented in debug_sync.cc. */
-static sys_var_debug_sync sys_debug_sync(&vars, "debug_sync");
-#endif /* defined(ENABLED_DEBUG_SYNC) */
-
-static sys_var_long_ptr sys_thread_cache_size(&vars, "thread_cache_size",
- &thread_cache_size);
-#if HAVE_POOL_OF_THREADS == 1
-sys_var_long_ptr sys_thread_pool_size(&vars, "thread_pool_size",
- &thread_pool_size);
-#endif
-static sys_var_thd_enum sys_tx_isolation(&vars, "tx_isolation",
- &SV::tx_isolation,
- &tx_isolation_typelib,
- fix_tx_isolation,
- check_tx_isolation);
-static sys_var_thd_ulonglong sys_tmp_table_size(&vars, "tmp_table_size",
- &SV::tmp_table_size);
-static sys_var_bool_ptr sys_timed_mutexes(&vars, "timed_mutexes",
- &timed_mutexes);
-static sys_var_const_str sys_version(&vars, "version", server_version);
-static sys_var_const_str sys_version_comment(&vars, "version_comment",
- MYSQL_COMPILATION_COMMENT);
-static sys_var_const_str sys_version_compile_machine(&vars, "version_compile_machine",
- MACHINE_TYPE);
-static sys_var_const_str sys_version_compile_os(&vars, "version_compile_os",
- SYSTEM_TYPE);
-static sys_var_thd_ulong sys_net_wait_timeout(&vars, "wait_timeout",
- &SV::net_wait_timeout);
-
-/* Condition pushdown to storage engine */
-static sys_var_thd_bool
-sys_engine_condition_pushdown(&vars, "engine_condition_pushdown",
- &SV::engine_condition_pushdown);
-
-#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
-/* ndb thread specific variable settings */
-static sys_var_thd_ulong
-sys_ndb_autoincrement_prefetch_sz(&vars, "ndb_autoincrement_prefetch_sz",
- &SV::ndb_autoincrement_prefetch_sz);
-static sys_var_thd_bool
-sys_ndb_force_send(&vars, "ndb_force_send", &SV::ndb_force_send);
-#ifdef HAVE_NDB_BINLOG
-static sys_var_long_ptr
-sys_ndb_report_thresh_binlog_epoch_slip(&vars, "ndb_report_thresh_binlog_epoch_slip",
- &ndb_report_thresh_binlog_epoch_slip);
-static sys_var_long_ptr
-sys_ndb_report_thresh_binlog_mem_usage(&vars, "ndb_report_thresh_binlog_mem_usage",
- &ndb_report_thresh_binlog_mem_usage);
-#endif
-static sys_var_thd_bool
-sys_ndb_use_exact_count(&vars, "ndb_use_exact_count", &SV::ndb_use_exact_count);
-static sys_var_thd_bool
-sys_ndb_use_transactions(&vars, "ndb_use_transactions", &SV::ndb_use_transactions);
-static sys_var_long_ptr
-sys_ndb_cache_check_time(&vars, "ndb_cache_check_time", &ndb_cache_check_time);
-static sys_var_const_str
-sys_ndb_connectstring(&vars, "ndb_connectstring", opt_ndb_constrbuf);
-static sys_var_thd_bool
-sys_ndb_index_stat_enable(&vars, "ndb_index_stat_enable",
- &SV::ndb_index_stat_enable);
-static sys_var_thd_ulong
-sys_ndb_index_stat_cache_entries(&vars, "ndb_index_stat_cache_entries",
- &SV::ndb_index_stat_cache_entries);
-static sys_var_thd_ulong
-sys_ndb_index_stat_update_freq(&vars, "ndb_index_stat_update_freq",
- &SV::ndb_index_stat_update_freq);
-static sys_var_long_ptr
-sys_ndb_extra_logging(&vars, "ndb_extra_logging", &ndb_extra_logging);
-static sys_var_thd_bool
-sys_ndb_use_copying_alter_table(&vars, "ndb_use_copying_alter_table", &SV::ndb_use_copying_alter_table);
-#endif //WITH_NDBCLUSTER_STORAGE_ENGINE
-
-/* Time/date/datetime formats */
-
-static sys_var_thd_date_time_format sys_time_format(&vars, "time_format",
- &SV::time_format,
- MYSQL_TIMESTAMP_TIME);
-static sys_var_thd_date_time_format sys_date_format(&vars, "date_format",
- &SV::date_format,
- MYSQL_TIMESTAMP_DATE);
-static sys_var_thd_date_time_format sys_datetime_format(&vars, "datetime_format",
- &SV::datetime_format,
- MYSQL_TIMESTAMP_DATETIME);
-
-/* Variables that are bits in THD */
-
-sys_var_thd_bit sys_autocommit(&vars, "autocommit", 0,
- set_option_autocommit,
- OPTION_NOT_AUTOCOMMIT,
- 1);
-static sys_var_thd_bit sys_big_tables(&vars, "big_tables", 0,
- set_option_bit,
- OPTION_BIG_TABLES);
-#ifndef TO_BE_DELETED /* Alias for big_tables */
-static sys_var_thd_bit sys_sql_big_tables(&vars, "sql_big_tables", 0,
- set_option_bit,
- OPTION_BIG_TABLES);
-#endif
-static sys_var_thd_bit sys_big_selects(&vars, "sql_big_selects", 0,
- set_option_bit,
- OPTION_BIG_SELECTS);
-static sys_var_thd_bit sys_log_off(&vars, "sql_log_off",
- check_log_update,
- set_option_bit,
- OPTION_LOG_OFF);
-static sys_var_thd_bit sys_log_update(&vars, "sql_log_update",
- check_log_update,
- set_log_update,
- OPTION_BIN_LOG);
-static sys_var_thd_bit sys_log_binlog(&vars, "sql_log_bin",
- check_log_update,
- set_option_log_bin_bit,
- OPTION_BIN_LOG);
-static sys_var_thd_bit sys_sql_warnings(&vars, "sql_warnings", 0,
- set_option_bit,
- OPTION_WARNINGS);
-static sys_var_thd_bit sys_sql_notes(&vars, "sql_notes", 0,
- set_option_bit,
- OPTION_SQL_NOTES);
-static sys_var_thd_bit sys_auto_is_null(&vars, "sql_auto_is_null", 0,
- set_option_bit,
- OPTION_AUTO_IS_NULL, 0,
- sys_var::SESSION_VARIABLE_IN_BINLOG);
-static sys_var_thd_bit sys_safe_updates(&vars, "sql_safe_updates", 0,
- set_option_bit,
- OPTION_SAFE_UPDATES);
-static sys_var_thd_bit sys_buffer_results(&vars, "sql_buffer_result", 0,
- set_option_bit,
- OPTION_BUFFER_RESULT);
-static sys_var_thd_bit sys_quote_show_create(&vars, "sql_quote_show_create", 0,
- set_option_bit,
- OPTION_QUOTE_SHOW_CREATE);
-static sys_var_thd_bit sys_foreign_key_checks(&vars, "foreign_key_checks", 0,
- set_option_bit,
- OPTION_NO_FOREIGN_KEY_CHECKS,
- 1, sys_var::SESSION_VARIABLE_IN_BINLOG);
-static sys_var_thd_bit sys_unique_checks(&vars, "unique_checks", 0,
- set_option_bit,
- OPTION_RELAXED_UNIQUE_CHECKS,
- 1,
- sys_var::SESSION_VARIABLE_IN_BINLOG);
-#if defined(ENABLED_PROFILING)
-static sys_var_thd_bit sys_profiling(&vars, "profiling", NULL,
- set_option_bit,
- ulonglong(OPTION_PROFILING));
-static sys_var_thd_ulong sys_profiling_history_size(&vars, "profiling_history_size",
- &SV::profiling_history_size);
-#endif
-
-/* Local state variables */
-
-static sys_var_thd_ha_rows sys_select_limit(&vars, "sql_select_limit",
- &SV::select_limit);
-static sys_var_timestamp sys_timestamp(&vars, "timestamp",
- sys_var::SESSION_VARIABLE_IN_BINLOG);
-static sys_var_last_insert_id
-sys_last_insert_id(&vars, "last_insert_id",
- sys_var::SESSION_VARIABLE_IN_BINLOG);
-/*
- identity is an alias for last_insert_id(), so that we are compatible
- with Sybase
-*/
-static sys_var_last_insert_id
-sys_identity(&vars, "identity", sys_var::SESSION_VARIABLE_IN_BINLOG);
-
-static sys_var_thd_lc_messages
-sys_lc_messages(&vars, "lc_messages", sys_var::NOT_IN_BINLOG);
-
-static sys_var_thd_lc_time_names
-sys_lc_time_names(&vars, "lc_time_names", sys_var::SESSION_VARIABLE_IN_BINLOG);
-
-/*
- insert_id should *not* be marked as written to the binlog (i.e., it
- should *not* have binlog_status==SESSION_VARIABLE_IN_BINLOG),
- because we want any statement that refers to insert_id explicitly to
- be unsafe. (By "explicitly", we mean using @@session.insert_id,
- whereas insert_id is used "implicitly" when NULL value is inserted
- into an auto_increment column).
-
- We want statements referring explicitly to @@session.insert_id to be
- unsafe, because insert_id is modified internally by the slave sql
- thread when NULL values are inserted in an AUTO_INCREMENT column.
- This modification interfers with the value of the
- @@session.insert_id variable if @@session.insert_id is referred
- explicitly by an insert statement (as is seen by executing "SET
- @@session.insert_id=0; CREATE TABLE t (a INT, b INT KEY
- AUTO_INCREMENT); INSERT INTO t(a) VALUES (@@session.insert_id);" in
- statement-based logging mode: t will be different on master and
- slave).
-*/
-static sys_var_insert_id sys_insert_id(&vars, "insert_id");
-static sys_var_readonly sys_error_count(&vars, "error_count",
- OPT_SESSION,
- SHOW_LONG,
- get_error_count);
-static sys_var_readonly sys_warning_count(&vars, "warning_count",
- OPT_SESSION,
- SHOW_LONG,
- get_warning_count);
-
-static sys_var_rand_seed1 sys_rand_seed1(&vars, "rand_seed1",
- sys_var::SESSION_VARIABLE_IN_BINLOG);
-static sys_var_rand_seed2 sys_rand_seed2(&vars, "rand_seed2",
- sys_var::SESSION_VARIABLE_IN_BINLOG);
-
-static sys_var_thd_ulong sys_default_week_format(&vars, "default_week_format",
- &SV::default_week_format);
-
-sys_var_thd_ulong sys_group_concat_max_len(&vars, "group_concat_max_len",
- &SV::group_concat_max_len);
-
-sys_var_thd_time_zone sys_time_zone(&vars, "time_zone",
- sys_var::SESSION_VARIABLE_IN_BINLOG);
-
-/* Global read-only variable containing hostname */
-static sys_var_const_str sys_hostname(&vars, "hostname", glob_hostname);
-
-#ifndef EMBEDDED_LIBRARY
-static sys_var_const_str_ptr sys_repl_report_host(&vars, "report_host", &report_host);
-static sys_var_const_str_ptr sys_repl_report_user(&vars, "report_user", &report_user);
-static sys_var_const_str_ptr sys_repl_report_password(&vars, "report_password", &report_password);
-
-static uchar *slave_get_report_port(THD *thd)
-{
- thd->sys_var_tmp.long_value= report_port;
- return (uchar*) &thd->sys_var_tmp.long_value;
-}
-
-static sys_var_readonly sys_repl_report_port(&vars, "report_port", OPT_GLOBAL, SHOW_LONG, slave_get_report_port);
-
-#endif
-
-sys_var_thd_bool sys_keep_files_on_create(&vars, "keep_files_on_create",
- &SV::keep_files_on_create);
-/* Read only variables */
-
-static sys_var_have_variable sys_have_compress(&vars, "have_compress", &have_compress);
-static sys_var_have_variable sys_have_crypt(&vars, "have_crypt", &have_crypt);
-static sys_var_have_plugin sys_have_csv(&vars, "have_csv", C_STRING_WITH_LEN("csv"), MYSQL_STORAGE_ENGINE_PLUGIN);
-static sys_var_have_variable sys_have_dlopen(&vars, "have_dynamic_loading", &have_dlopen);
-static sys_var_have_variable sys_have_geometry(&vars, "have_geometry", &have_geometry);
-static sys_var_have_plugin sys_have_innodb(&vars, "have_innodb", C_STRING_WITH_LEN("innodb"), MYSQL_STORAGE_ENGINE_PLUGIN);
-static sys_var_have_plugin sys_have_ndbcluster(&vars, "have_ndbcluster", C_STRING_WITH_LEN("ndbcluster"), MYSQL_STORAGE_ENGINE_PLUGIN);
-static sys_var_have_variable sys_have_openssl(&vars, "have_openssl", &have_ssl);
-static sys_var_have_variable sys_have_ssl(&vars, "have_ssl", &have_ssl);
-static sys_var_have_plugin sys_have_partition_db(&vars, "have_partitioning", C_STRING_WITH_LEN("partition"), MYSQL_STORAGE_ENGINE_PLUGIN);
-static sys_var_have_variable sys_have_profiling(&vars, "have_profiling", &have_profiling);
-static sys_var_have_variable sys_have_query_cache(&vars, "have_query_cache",
- &have_query_cache);
-static sys_var_have_variable sys_have_rtree_keys(&vars, "have_rtree_keys", &have_rtree_keys);
-static sys_var_have_variable sys_have_symlink(&vars, "have_symlink", &have_symlink);
-/* Global read-only variable describing server license */
-static sys_var_const_str sys_license(&vars, "license", STRINGIFY_ARG(LICENSE));
-/* Global variables which enable|disable logging */
-static sys_var_log_state sys_var_general_log(&vars, "general_log", &opt_log,
- QUERY_LOG_GENERAL);
-/* Synonym of "general_log" for consistency with SHOW VARIABLES output */
-static sys_var_log_state sys_var_log(&vars, "log", &opt_log,
- QUERY_LOG_GENERAL);
-static sys_var_log_state sys_var_slow_query_log(&vars, "slow_query_log", &opt_slow_log,
- QUERY_LOG_SLOW);
-/* Synonym of "slow_query_log" for consistency with SHOW VARIABLES output */
-static sys_var_log_state sys_var_log_slow(&vars, "log_slow_queries",
- &opt_slow_log, QUERY_LOG_SLOW);
-sys_var_str sys_var_general_log_path(&vars, "general_log_file", sys_check_log_path,
- sys_update_general_log_path,
- sys_default_general_log_path,
- opt_logname);
-sys_var_str sys_var_slow_log_path(&vars, "slow_query_log_file", sys_check_log_path,
- sys_update_slow_log_path,
- sys_default_slow_log_path,
- opt_slow_logname);
-static sys_var_log_output sys_var_log_output_state(&vars, "log_output", &log_output_options,
- &log_output_typelib, 0);
-static sys_var_readonly sys_myisam_mmap_size(&vars, "myisam_mmap_size",
- OPT_GLOBAL,
- SHOW_LONGLONG,
- get_myisam_mmap_size);
-
-
-bool sys_var::check(THD *thd, set_var *var)
-{
- var->save_result.ulonglong_value= var->value->val_int();
- return 0;
-}
-
-bool sys_var_str::check(THD *thd, set_var *var)
-{
- int res;
- if (!check_func)
- return 0;
-
- if ((res=(*check_func)(thd, var)) < 0)
- {
- ErrConvString err(&var->value->str_value);
- my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, err.ptr());
- }
- return res;
-}
-
-/*
- Functions to check and update variables
-*/
-
-
-/*
- Update variables 'init_connect, init_slave'.
-
- In case of 'DEFAULT' value
- (for example: 'set GLOBAL init_connect=DEFAULT')
- 'var' parameter is NULL pointer.
-*/
-
-bool update_sys_var_str(sys_var_str *var_str, rw_lock_t *var_mutex,
- set_var *var)
-{
- char *res= 0, *old_value=(char *)(var ? var->value->str_value.ptr() : 0);
- uint new_length= (var ? var->value->str_value.length() : 0);
- if (!old_value)
- old_value= (char*) "";
- if (!(res= my_strndup(old_value, new_length, MYF(0))))
- return 1;
- /*
- Replace the old value in such a way that the any thread using
- the value will work.
- */
- rw_wrlock(var_mutex);
- old_value= var_str->value;
- var_str->value= res;
- var_str->value_length= new_length;
- var_str->is_os_charset= FALSE;
- rw_unlock(var_mutex);
- my_free(old_value, MYF(MY_ALLOW_ZERO_PTR));
- return 0;
-}
-
-
-static bool sys_update_init_connect(THD *thd, set_var *var)
-{
- return update_sys_var_str(&sys_init_connect, &LOCK_sys_init_connect, var);
-}
-
-
-static void sys_default_init_connect(THD* thd, enum_var_type type)
-{
- update_sys_var_str(&sys_init_connect, &LOCK_sys_init_connect, 0);
-}
-
-
-static bool sys_update_init_slave(THD *thd, set_var *var)
-{
- return update_sys_var_str(&sys_init_slave, &LOCK_sys_init_slave, var);
-}
-
-
-static void sys_default_init_slave(THD* thd, enum_var_type type)
-{
- update_sys_var_str(&sys_init_slave, &LOCK_sys_init_slave, 0);
-}
-
-static int sys_check_ftb_syntax(THD *thd, set_var *var)
-{
- if (thd->security_ctx->master_access & SUPER_ACL)
- return (ft_boolean_check_syntax_string((uchar*)
- var->value->str_value.c_ptr()) ?
- -1 : 0);
- else
- {
- my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "SUPER");
- return 1;
- }
-}
-
-static bool sys_update_ftb_syntax(THD *thd, set_var * var)
-{
- strmake(ft_boolean_syntax, var->value->str_value.c_ptr(),
- sizeof(ft_boolean_syntax)-1);
-
-#ifdef HAVE_QUERY_CACHE
- query_cache.flush();
-#endif /* HAVE_QUERY_CACHE */
-
- return 0;
-}
-
-static void sys_default_ftb_syntax(THD *thd, enum_var_type type)
-{
- strmake(ft_boolean_syntax, def_ft_boolean_syntax,
- sizeof(ft_boolean_syntax)-1);
-}
-
+static PolyLock_mutex PLock_global_system_variables(&LOCK_global_system_variables);
/**
- If one sets the LOW_PRIORIY UPDATES flag, we also must change the
- used lock type.
-*/
-
-static void fix_low_priority_updates(THD *thd, enum_var_type type)
-{
- if (type == OPT_GLOBAL)
- thr_upgraded_concurrent_insert_lock=
- (global_system_variables.low_priority_updates ?
- TL_WRITE_LOW_PRIORITY : TL_WRITE);
- else
- thd->update_lock_default= (thd->variables.low_priority_updates ?
- TL_WRITE_LOW_PRIORITY : TL_WRITE);
-}
-
-
-static void
-fix_myisam_max_sort_file_size(THD *thd, enum_var_type type)
-{
- myisam_max_temp_length=
- (my_off_t) global_system_variables.myisam_max_sort_file_size;
-}
-
-/**
- Set the OPTION_BIG_SELECTS flag if max_join_size == HA_POS_ERROR.
+ Return variable name and length for hashing of variables.
*/
-static void fix_max_join_size(THD *thd, enum_var_type type)
+static uchar *get_sys_var_length(const sys_var *var, size_t *length,
+ my_bool first)
{
- if (type != OPT_GLOBAL)
- {
- if (thd->variables.max_join_size == HA_POS_ERROR)
- thd->options|= OPTION_BIG_SELECTS;
- else
- thd->options&= ~OPTION_BIG_SELECTS;
- }
+ *length= var->name.length;
+ return (uchar*) var->name.str;
}
+sys_var_chain all_sys_vars = { NULL, NULL };
-/**
- Can't change the 'next' tx_isolation while we are already in
- a transaction
-*/
-static int check_tx_isolation(THD *thd, set_var *var)
-{
- if (var->type == OPT_DEFAULT && (thd->server_status & SERVER_STATUS_IN_TRANS))
- {
- my_error(ER_CANT_CHANGE_TX_ISOLATION, MYF(0));
- return 1;
- }
- return 0;
-}
-
-/*
- If one doesn't use the SESSION modifier, the isolation level
- is only active for the next command.
-*/
-static void fix_tx_isolation(THD *thd, enum_var_type type)
+int sys_var_init(DYNAMIC_ARRAY *long_options)
{
- if (type == OPT_SESSION)
- thd->session_tx_isolation= ((enum_tx_isolation)
- thd->variables.tx_isolation);
-}
+ uint count= 0;
+ uint saved_elements= long_options->elements;
-static void fix_completion_type(THD *thd __attribute__((unused)),
- enum_var_type type __attribute__((unused))) {}
-
-static int check_completion_type(THD *thd, set_var *var)
-{
- longlong val= var->value->val_int();
- if (val < 0 || val > 2)
- {
- char buf[64];
- my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->var->name, llstr(val, buf));
- return 1;
- }
- return 0;
-}
+ DBUG_ENTER("sys_var_init");
+ for (sys_var *var=all_sys_vars.first; var; var= var->next, count++)
+ if (var->register_option(long_options))
+ goto error;
-/*
- If we are changing the thread variable, we have to copy it to NET too
-*/
+ if (my_hash_init(&system_variable_hash, system_charset_info, 100, 0,
+ 0, (my_hash_get_key) get_sys_var_length, 0, HASH_UNIQUE))
+ goto error;
-#ifdef HAVE_REPLICATION
-static void fix_net_read_timeout(THD *thd, enum_var_type type)
-{
- if (type != OPT_GLOBAL)
- my_net_set_read_timeout(&thd->net, thd->variables.net_read_timeout);
-}
+ if (mysql_add_sys_var_chain(all_sys_vars.first))
+ goto error;
+ DBUG_RETURN(0);
-static void fix_net_write_timeout(THD *thd, enum_var_type type)
-{
- if (type != OPT_GLOBAL)
- my_net_set_write_timeout(&thd->net, thd->variables.net_write_timeout);
+error:
+ fprintf(stderr, "failed to initialize System variables");
+ long_options->elements= saved_elements;
+ DBUG_RETURN(1);
}
-static void fix_net_retry_count(THD *thd, enum_var_type type)
+void sys_var_end()
{
- if (type != OPT_GLOBAL)
- thd->net.retry_count=thd->variables.net_retry_count;
-}
-#else /* HAVE_REPLICATION */
-static void fix_net_read_timeout(THD *thd __attribute__((unused)),
- enum_var_type type __attribute__((unused)))
-{}
-static void fix_net_write_timeout(THD *thd __attribute__((unused)),
- enum_var_type type __attribute__((unused)))
-{}
-static void fix_net_retry_count(THD *thd __attribute__((unused)),
- enum_var_type type __attribute__((unused)))
-{}
-#endif /* HAVE_REPLICATION */
+ DBUG_ENTER("sys_var_end");
-#ifdef HAVE_QUERY_CACHE
-static void fix_query_cache_size(THD *thd, enum_var_type type)
-{
- ulong new_cache_size= query_cache.resize(query_cache_size);
+ my_hash_free(&system_variable_hash);
- /*
- Note: query_cache_size is a global variable reflecting the
- requested cache size. See also query_cache_size_arg
- */
+ for (sys_var *var=all_sys_vars.first; var; var= var->next)
+ var->~sys_var();
- if (query_cache_size != new_cache_size)
- push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_WARN_QC_RESIZE, ER(ER_WARN_QC_RESIZE),
- query_cache_size, new_cache_size);
-
- query_cache_size= new_cache_size;
+ DBUG_VOID_RETURN;
}
-
/**
- Trigger before query_cache_type variable is updated.
- @param thd Thread handler
- @param var Pointer to the new variable status
-
- @return Status code
- @retval 1 Failure
- @retval 0 Success
-*/
-
-static int check_query_cache_type(THD *thd, set_var *var)
-{
- /*
- Don't allow changes of the query_cache_type if the query cache
- is disabled.
- */
- if (query_cache.is_disabled())
+ sys_var constructor
+
+ @param chain variables are linked into chain for mysql_add_sys_var_chain()
+ @param name_arg the name of the variable. @sa my_option::name
+ @param comment shown in mysqld --help, @sa my_option::comment
+ @param flags_arg or'ed flag_enum values
+ @param off offset of the global variable value from the
+ &global_system_variables.
+ @param getopt_id -1 for no command-line option, otherwise @sa my_option::id
+ @param getopt_arg_type @sa my_option::arg_type
+ @param show_val_type_arg what value_ptr() returns for sql_show.cc
+ @param def_val default value, @sa my_option::def_value
+ @param lock mutex or rw_lock that protects the global variable
+ *in addition* to LOCK_global_system_variables.
+ @param binlog_status_enum @sa binlog_status_enum
+ @param on_check_func a function to be called at the end of sys_var::check,
+ put your additional checks here
+ @param on_update_func a function to be called at the end of sys_var::update,
+ any post-update activity should happen here
+ @param deprecated_version if not 0 - when this variable will go away
+ @param substitute if not 0 - what one should use instead when this
+ deprecated variable
+*/
+sys_var::sys_var(sys_var_chain *chain, const char *name_arg,
+ const char *comment, int flags_arg, ptrdiff_t off,
+ int getopt_id, enum get_opt_arg_type getopt_arg_type,
+ SHOW_TYPE show_val_type_arg, longlong def_val,
+ PolyLock *lock, enum binlog_status_enum binlog_status_arg,
+ on_check_function on_check_func,
+ on_update_function on_update_func,
+ uint deprecated_version, const char *substitute) :
+ next(0),
+ binlog_status(binlog_status_arg),
+ flags(flags_arg), show_val_type(show_val_type_arg),
+ guard(lock), offset(off), on_check(on_check_func), on_update(on_update_func),
+ is_os_charset(FALSE)
+{
+ name.str= name_arg;
+ name.length= strlen(name_arg);
+ DBUG_ASSERT(name.length <= NAME_CHAR_LEN);
+
+ bzero(&option, sizeof(option));
+ option.name= name_arg;
+ option.id= getopt_id;
+ option.comment= comment;
+ option.arg_type= getopt_arg_type;
+ option.value= (uchar **)global_var_ptr();
+ option.def_value= def_val;
+
+ deprecated.version= deprecated_version;
+ deprecated.substitute= substitute;
+ DBUG_ASSERT((deprecated_version != 0) || (substitute == 0));
+ DBUG_ASSERT(deprecated_version % 100 == 0);
+ DBUG_ASSERT(!deprecated_version || MYSQL_VERSION_ID < deprecated_version);
+
+ if (chain->last)
+ chain->last->next= this;
+ else
+ chain->first= this;
+ chain->last= this;
+}
+
+bool sys_var::update(THD *thd, set_var *var)
+{
+ enum_var_type type= var->type;
+ if (type == OPT_GLOBAL || scope() == GLOBAL)
{
- my_error(ER_QUERY_CACHE_DISABLED,MYF(0));
- return 1;
+ /*
+ Yes, both locks need to be taken before an update, just as
+ both are taken to get a value. If we'll take only 'guard' here,
+ then value_ptr() for strings won't be safe in SHOW VARIABLES anymore,
+ to make it safe we'll need value_ptr_unlock().
+ */
+ AutoWLock lock1(&PLock_global_system_variables);
+ AutoWLock lock2(guard);
+ return global_update(thd, var) ||
+ (on_update && on_update(this, thd, OPT_GLOBAL));
}
-
- return 0;
-}
-
-
-static void fix_query_cache_min_res_unit(THD *thd, enum_var_type type)
-{
- query_cache_min_res_unit=
- query_cache.set_min_res_unit(query_cache_min_res_unit);
+ else
+ return session_update(thd, var) ||
+ (on_update && on_update(this, thd, OPT_SESSION));
}
-#endif
-
-extern void fix_delay_key_write(THD *thd, enum_var_type type)
+uchar *sys_var::session_value_ptr(THD *thd, LEX_STRING *base)
{
- switch ((enum_delay_key_write) delay_key_write_options) {
- case DELAY_KEY_WRITE_NONE:
- myisam_delay_key_write=0;
- break;
- case DELAY_KEY_WRITE_ON:
- myisam_delay_key_write=1;
- break;
- case DELAY_KEY_WRITE_ALL:
- myisam_delay_key_write=1;
- ha_open_options|= HA_OPEN_DELAY_KEY_WRITE;
- break;
- }
+ return session_var_ptr(thd);
}
-bool sys_var_set::update(THD *thd, set_var *var)
+uchar *sys_var::global_value_ptr(THD *thd, LEX_STRING *base)
{
- *value= var->save_result.ulong_value;
- return 0;
+ return global_var_ptr();
}
-uchar *sys_var_set::value_ptr(THD *thd, enum_var_type type,
- LEX_STRING *base)
+bool sys_var::check(THD *thd, set_var *var)
{
- char buff[256];
- String tmp(buff, sizeof(buff), &my_charset_latin1);
- ulong length;
- ulong val= *value;
-
- tmp.length(0);
- for (uint i= 0; val; val>>= 1, i++)
+ do_deprecated_warning(thd);
+ if ((var->value && do_check(thd, var))
+ || (on_check && on_check(this, thd, var)))
{
- if (val & 1)
+ if (!thd->is_error())
{
- tmp.append(enum_names->type_names[i],
- enum_names->type_lengths[i]);
- tmp.append(',');
- }
- }
-
- if ((length= tmp.length()))
- length--;
- return (uchar*) thd->strmake(tmp.ptr(), length);
-}
-
-void sys_var_set_slave_mode::set_default(THD *thd, enum_var_type type)
-{
- slave_exec_mode_options= 0;
- bit_do_set(slave_exec_mode_options, SLAVE_EXEC_MODE_STRICT);
-}
-
-bool sys_var_set_slave_mode::check(THD *thd, set_var *var)
-{
- bool rc= sys_var_set::check(thd, var);
- if (!rc &&
- bit_is_set(var->save_result.ulong_value, SLAVE_EXEC_MODE_STRICT) == 1 &&
- bit_is_set(var->save_result.ulong_value, SLAVE_EXEC_MODE_IDEMPOTENT) == 1)
- {
- rc= true;
- my_error(ER_SLAVE_AMBIGOUS_EXEC_MODE, MYF(0), "");
- }
- return rc;
-}
-
-bool sys_var_set_slave_mode::update(THD *thd, set_var *var)
-{
- bool rc;
- pthread_mutex_lock(&LOCK_global_system_variables);
- rc= sys_var_set::update(thd, var);
- pthread_mutex_unlock(&LOCK_global_system_variables);
- return rc;
-}
+ char buff[STRING_BUFFER_USUAL_SIZE];
+ String str(buff, sizeof(buff), system_charset_info), *res;
-void fix_slave_exec_mode(enum_var_type type)
-{
- DBUG_ENTER("fix_slave_exec_mode");
- compile_time_assert(sizeof(slave_exec_mode_options) * CHAR_BIT
- > SLAVE_EXEC_MODE_LAST_BIT - 1);
- if (bit_is_set(slave_exec_mode_options, SLAVE_EXEC_MODE_STRICT) == 1 &&
- bit_is_set(slave_exec_mode_options, SLAVE_EXEC_MODE_IDEMPOTENT) == 1)
- {
- sql_print_error("Ambiguous slave modes combination."
- " STRICT will be used");
- bit_do_clear(slave_exec_mode_options, SLAVE_EXEC_MODE_IDEMPOTENT);
+ if (!var->value)
+ {
+ str.set(STRING_WITH_LEN("DEFAULT"), &my_charset_latin1);
+ res= &str;
+ }
+ else if (!(res=var->value->val_str(&str)))
+ {
+ str.set(STRING_WITH_LEN("NULL"), &my_charset_latin1);
+ res= &str;
+ }
+ ErrConvString err(res);
+ my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name.str, err.ptr());
+ }
+ return true;
}
- if (bit_is_set(slave_exec_mode_options, SLAVE_EXEC_MODE_IDEMPOTENT) == 0)
- bit_do_set(slave_exec_mode_options, SLAVE_EXEC_MODE_STRICT);
- DBUG_VOID_RETURN;
-}
-
-
-bool sys_var_thd_binlog_format::check(THD *thd, set_var *var) {
- /*
- All variables that affect writing to binary log (either format or
- turning logging on and off) use the same checking. We call the
- superclass ::check function to assign the variable correctly, and
- then check the value.
- */
- bool result= sys_var_thd_enum::check(thd, var);
- if (!result)
- result= check_log_update(thd, var);
- return result;
+ return false;
}
-
-bool sys_var_thd_binlog_format::is_readonly() const
+uchar *sys_var::value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
{
- /*
- Under certain circumstances, the variable is read-only (unchangeable):
- */
- THD *thd= current_thd;
- /*
- If RBR and open temporary tables, their CREATE TABLE may not be in the
- binlog, so we can't toggle to SBR in this connection.
- The test below will also prevent SET GLOBAL, well it was not easy to test
- if global or not here.
- And this test will also prevent switching from RBR to RBR (a no-op which
- should not happen too often).
-
- If we don't have row-based replication compiled in, the variable
- is always read-only.
- */
- if ((thd->variables.binlog_format == BINLOG_FORMAT_ROW) &&
- thd->temporary_tables)
- {
- my_error(ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR, MYF(0));
- return 1;
- }
- /*
- if in a stored function/trigger, it's too late to change mode
- */
- if (thd->in_sub_stmt)
+ if (type == OPT_GLOBAL || scope() == GLOBAL)
{
- my_error(ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT, MYF(0));
- return 1;
+ safe_mutex_assert_owner(&LOCK_global_system_variables);
+ AutoRLock lock(guard);
+ return global_value_ptr(thd, base);
}
- return sys_var_thd_enum::is_readonly();
+ else
+ return session_value_ptr(thd, base);
}
-
-void fix_binlog_format_after_update(THD *thd, enum_var_type type)
+bool sys_var::set_default(THD *thd, enum_var_type type)
{
- thd->reset_current_stmt_binlog_row_based();
-}
-
+ LEX_STRING empty={0,0};
+ set_var var(type, 0, &empty, 0);
-static void fix_max_binlog_size(THD *thd, enum_var_type type)
-{
- DBUG_ENTER("fix_max_binlog_size");
- DBUG_PRINT("info",("max_binlog_size=%lu max_relay_log_size=%lu",
- max_binlog_size, max_relay_log_size));
- mysql_bin_log.set_max_size(max_binlog_size);
-#ifdef HAVE_REPLICATION
- if (!max_relay_log_size)
- active_mi->rli.relay_log.set_max_size(max_binlog_size);
-#endif
- DBUG_VOID_RETURN;
-}
+ if (type == OPT_GLOBAL || scope() == GLOBAL)
+ global_save_default(thd, &var);
+ else
+ session_save_default(thd, &var);
-static void fix_max_relay_log_size(THD *thd, enum_var_type type)
-{
- DBUG_ENTER("fix_max_relay_log_size");
- DBUG_PRINT("info",("max_binlog_size=%lu max_relay_log_size=%lu",
- max_binlog_size, max_relay_log_size));
-#ifdef HAVE_REPLICATION
- active_mi->rli.relay_log.set_max_size(max_relay_log_size ?
- max_relay_log_size: max_binlog_size);
-#endif
- DBUG_VOID_RETURN;
+ return check(thd, &var) || update(thd, &var);
}
-
-static int check_max_delayed_threads(THD *thd, set_var *var)
+void sys_var::do_deprecated_warning(THD *thd)
{
- longlong val= var->value->val_int();
- if (var->type != OPT_GLOBAL && val != 0 &&
- val != (longlong) global_system_variables.max_insert_delayed_threads)
+ if (deprecated.version)
{
- char buf[64];
- my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->var->name, llstr(val, buf));
- return 1;
+ char buf1[NAME_CHAR_LEN + 3], buf2[10];
+ strxnmov(buf1, sizeof(buf1)-1, "@@", name.str, 0);
+ my_snprintf(buf2, sizeof(buf2), "%d.%d", deprecated.version/100/100,
+ deprecated.version/100%100);
+ uint errmsg= deprecated.substitute
+ ? ER_WARN_DEPRECATED_SYNTAX_WITH_VER
+ : ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT;
+ if (thd)
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_WARN_DEPRECATED_SYNTAX, ER(errmsg),
+ buf1, buf2, deprecated.substitute);
+ else
+ sql_print_warning(ER_DEFAULT(errmsg), buf1, buf2, deprecated.substitute);
}
- return 0;
-}
-
-static void fix_max_connections(THD *thd, enum_var_type type)
-{
-#ifndef EMBEDDED_LIBRARY
- resize_thr_alarm(max_connections +
- global_system_variables.max_insert_delayed_threads + 10);
-#endif
-}
-
-
-static void fix_thd_mem_root(THD *thd, enum_var_type type)
-{
- if (type != OPT_GLOBAL)
- reset_root_defaults(thd->mem_root,
- thd->variables.query_alloc_block_size,
- thd->variables.query_prealloc_size);
-}
-
-
-static void fix_trans_mem_root(THD *thd, enum_var_type type)
-{
- if (type != OPT_GLOBAL)
- reset_root_defaults(&thd->transaction.mem_root,
- thd->variables.trans_alloc_block_size,
- thd->variables.trans_prealloc_size);
-}
-
-
-static void fix_server_id(THD *thd, enum_var_type type)
-{
- server_id_supplied = 1;
- thd->server_id= server_id;
}
-
/**
Throw warning (error in STRICT mode) if value for variable needed bounding.
- Only call from check(), not update(), because an error in update() would be
- bad mojo. Plug-in interface also uses this.
+ Plug-in interface also uses this.
- @param thd thread handle
- @param fixed did we have to correct the value? (throw warn/err if so)
- @param unsignd is value's type unsigned?
- @param name variable's name
- @param val variable's value
+ @param thd thread handle
+ @param name variable's name
+ @param fixed did we have to correct the value? (throw warn/err if so)
+ @param is_unsigned is value's type unsigned?
+ @param v variable's value
- @retval TRUE on error, FALSE otherwise (warning or OK)
+ @retval true on error, false otherwise (warning or ok)
*/
-bool throw_bounds_warning(THD *thd, bool fixed, bool unsignd,
- const char *name, longlong val)
+bool throw_bounds_warning(THD *thd, const char *name,
+ bool fixed, bool is_unsigned, longlong v)
{
- if (fixed)
+ if (fixed || (!is_unsigned && v < 0))
{
char buf[22];
- if (unsignd)
- ullstr((ulonglong) val, buf);
+ if (is_unsigned)
+ ullstr((ulonglong) v, buf);
else
- llstr(val, buf);
+ llstr(v, buf);
if (thd->variables.sql_mode & MODE_STRICT_ALL_TABLES)
{
my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, buf);
- return TRUE;
+ return true;
}
-
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TRUNCATED_WRONG_VALUE,
ER(ER_TRUNCATED_WRONG_VALUE), name, buf);
}
- return FALSE;
-}
-
-
-/**
- check an unsigned user-supplied value for a systemvariable against bounds.
-
- TODO: This is a wrapper function to call clipping from within an update()
- function. Calling bounds from within update() is fair game in theory,
- but we can only send warnings from in there, not errors, and besides,
- it violates our model of separating check from update phase.
- To avoid breaking out of the server with an ASSERT() in strict mode,
- we pretend we're not in strict mode when we go through here. Bug#43233
- was opened to remind us to replace this kludge with The Right Thing,
- which of course is to do the check in the actual check phase, and then
- throw an error or warning accordingly.
-
- @param thd thread handle
- @param num the value to limit
- @param option_limits the bounds-record, or NULL if none
- */
-static void bound_unsigned(THD *thd, ulonglong *num,
- const struct my_option *option_limits)
-{
- if (option_limits)
- {
- my_bool fixed = FALSE;
- ulonglong unadjusted= *num;
-
- *num= getopt_ull_limit_value(unadjusted, option_limits, &fixed);
-
- if (fixed)
- {
- ulong ssm= thd->variables.sql_mode;
- thd->variables.sql_mode&= ~MODE_STRICT_ALL_TABLES;
- throw_bounds_warning(thd, fixed, TRUE, option_limits->name, unadjusted);
- thd->variables.sql_mode= ssm;
- }
- }
-}
-
-
-/**
- Get unsigned system-variable.
- Negative value does not wrap around, but becomes zero.
- Check user-supplied value for a systemvariable against bounds.
- If we needed to adjust the value, throw a warning or error depending
- on SQL-mode.
-
- @param thd thread handle
- @param var the system-variable to get
- @param user_max a limit given with --maximum-variable-name=... or 0
- @param var_type function will bound on systems where necessary.
-
- @retval TRUE on error, FALSE otherwise (warning or OK)
- */
-static bool get_unsigned(THD *thd, set_var *var, ulonglong user_max,
- ulong var_type)
-{
- int warnings= 0;
- ulonglong unadjusted;
- const struct my_option *limits= var->var->option_limits;
- struct my_option fallback;
-
- /* get_unsigned() */
- if (var->value->unsigned_flag)
- var->save_result.ulonglong_value= (ulonglong) var->value->val_int();
- else
- {
- longlong v= var->value->val_int();
- var->save_result.ulonglong_value= (ulonglong) ((v < 0) ? 0 : v);
- if (v < 0)
- {
- warnings++;
- if (throw_bounds_warning(thd, TRUE, FALSE, var->var->name, v))
- return TRUE; /* warning was promoted to error, give up */
- }
- }
-
- unadjusted= var->save_result.ulonglong_value;
-
- /* max, if any */
-
- if ((user_max > 0) && (unadjusted > user_max))
- {
- var->save_result.ulonglong_value= user_max;
-
- if ((warnings == 0) && throw_bounds_warning(thd, TRUE, TRUE,
- var->var->name,
- (longlong) unadjusted))
- return TRUE;
-
- warnings++;
- }
-
- /*
- if the sysvar doesn't have a proper bounds record but the check
- function would like bounding to ULONG where its size differs from
- that of ULONGLONG, we make up a bogus limits record here and let
- the usual suspects handle the actual limiting.
- */
-
- if (!limits && var_type != GET_ULL)
- {
- bzero(&fallback, sizeof(fallback));
- fallback.var_type= var_type;
- limits= &fallback;
- }
-
- /* fix_unsigned() */
- if (limits)
- {
- my_bool fixed;
-
- var->save_result.ulonglong_value= getopt_ull_limit_value(var->save_result.
- ulonglong_value,
- limits, &fixed);
-
- if ((warnings == 0) && throw_bounds_warning(thd, fixed, TRUE,
- var->var->name,
- (longlong) unadjusted))
- return TRUE;
- }
-
- return FALSE;
-}
-
-
-bool sys_var_uint_ptr::check(THD *thd, set_var *var)
-{
- var->save_result.ulong_value= (ulong) var->value->val_uint();
- return 0;
-}
-
-bool sys_var_uint_ptr::update(THD *thd, set_var *var)
-{
- *value= (uint) var->save_result.ulong_value;
- return 0;
-}
-
-void sys_var_uint_ptr::set_default(THD *thd, enum_var_type type)
-{
- *value= (uint) option_limits->def_value;
-}
-
-sys_var_long_ptr::
-sys_var_long_ptr(sys_var_chain *chain, const char *name_arg, ulong *value_ptr_arg,
- sys_after_update_func after_update_arg)
- :sys_var_long_ptr_global(chain, name_arg, value_ptr_arg,
- &LOCK_global_system_variables, after_update_arg)
-{}
-
-
-bool sys_var_long_ptr_global::check(THD *thd, set_var *var)
-{
- return get_unsigned(thd, var, 0, GET_ULONG);
+ return false;
}
-bool sys_var_long_ptr_global::update(THD *thd, set_var *var)
+bool throw_bounds_warning(THD *thd, const char *name, bool fixed, double v)
{
- pthread_mutex_lock(guard);
- *value= (ulong) var->save_result.ulonglong_value;
- pthread_mutex_unlock(guard);
- return 0;
-}
-
-
-void sys_var_long_ptr_global::set_default(THD *thd, enum_var_type type)
-{
- my_bool not_used;
- pthread_mutex_lock(guard);
- *value= (ulong) getopt_ull_limit_value((ulong) option_limits->def_value,
- option_limits, &not_used);
- pthread_mutex_unlock(guard);
-}
-
-
-bool sys_var_ulonglong_ptr::update(THD *thd, set_var *var)
-{
- ulonglong tmp= var->save_result.ulonglong_value;
- pthread_mutex_lock(&LOCK_global_system_variables);
- bound_unsigned(thd, &tmp, option_limits);
- *value= (ulonglong) tmp;
- pthread_mutex_unlock(&LOCK_global_system_variables);
- return 0;
-}
-
-
-void sys_var_ulonglong_ptr::set_default(THD *thd, enum_var_type type)
-{
- my_bool not_used;
- pthread_mutex_lock(&LOCK_global_system_variables);
- *value= getopt_ull_limit_value((ulonglong) option_limits->def_value,
- option_limits, &not_used);
- pthread_mutex_unlock(&LOCK_global_system_variables);
-}
-
-
-bool sys_var_bool_ptr::update(THD *thd, set_var *var)
-{
- *value= (my_bool) var->save_result.ulong_value;
- return 0;
-}
-
-
-void sys_var_bool_ptr::set_default(THD *thd, enum_var_type type)
-{
- *value= (my_bool) option_limits->def_value;
-}
-
-
-bool sys_var_enum::update(THD *thd, set_var *var)
-{
- *value= (uint) var->save_result.ulong_value;
- return 0;
-}
-
-
-uchar *sys_var_enum::value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
-{
- return (uchar*) enum_names->type_names[*value];
-}
-
-
-uchar *sys_var_enum_const::value_ptr(THD *thd, enum_var_type type,
- LEX_STRING *base)
-{
- return (uchar*) enum_names->type_names[global_system_variables.*offset];
-}
-
-bool sys_var_thd_ulong::check(THD *thd, set_var *var)
-{
- if (get_unsigned(thd, var, max_system_variables.*offset, GET_ULONG))
- return TRUE;
- DBUG_ASSERT(var->save_result.ulonglong_value <= ULONG_MAX);
- return ((check_func && (*check_func)(thd, var)));
-}
-
-bool sys_var_thd_ulong::update(THD *thd, set_var *var)
-{
- if (var->type == OPT_GLOBAL)
- global_system_variables.*offset= (ulong) var->save_result.ulonglong_value;
- else
- thd->variables.*offset= (ulong) var->save_result.ulonglong_value;
-
- return 0;
-}
-
-
-void sys_var_thd_ulong::set_default(THD *thd, enum_var_type type)
-{
- if (type == OPT_GLOBAL)
- {
- my_bool not_used;
- /* We will not come here if option_limits is not set */
- global_system_variables.*offset=
- (ulong) getopt_ull_limit_value((ulong) option_limits->def_value,
- option_limits, &not_used);
- }
- else
- thd->variables.*offset= global_system_variables.*offset;
-}
-
-
-uchar *sys_var_thd_ulong::value_ptr(THD *thd, enum_var_type type,
- LEX_STRING *base)
-{
- if (type == OPT_GLOBAL)
- return (uchar*) &(global_system_variables.*offset);
- return (uchar*) &(thd->variables.*offset);
-}
-
-
-bool sys_var_thd_ha_rows::update(THD *thd, set_var *var)
-{
- ulonglong tmp= var->save_result.ulonglong_value;
-
- /* Don't use bigger value than given with --maximum-variable-name=.. */
- if ((ha_rows) tmp > max_system_variables.*offset)
- tmp= max_system_variables.*offset;
-
- bound_unsigned(thd, &tmp, option_limits);
-
- if (var->type == OPT_GLOBAL)
- {
- /* Lock is needed to make things safe on 32 bit systems */
- pthread_mutex_lock(&LOCK_global_system_variables);
- global_system_variables.*offset= (ha_rows) tmp;
- pthread_mutex_unlock(&LOCK_global_system_variables);
- }
- else
- thd->variables.*offset= (ha_rows) tmp;
- return 0;
-}
-
-
-void sys_var_thd_ha_rows::set_default(THD *thd, enum_var_type type)
-{
- if (type == OPT_GLOBAL)
- {
- my_bool not_used;
- /* We will not come here if option_limits is not set */
- pthread_mutex_lock(&LOCK_global_system_variables);
- global_system_variables.*offset=
- (ha_rows) getopt_ull_limit_value((ha_rows) option_limits->def_value,
- option_limits, &not_used);
- pthread_mutex_unlock(&LOCK_global_system_variables);
- }
- else
- thd->variables.*offset= global_system_variables.*offset;
-}
-
-
-uchar *sys_var_thd_ha_rows::value_ptr(THD *thd, enum_var_type type,
- LEX_STRING *base)
-{
- if (type == OPT_GLOBAL)
- return (uchar*) &(global_system_variables.*offset);
- return (uchar*) &(thd->variables.*offset);
-}
-
-bool sys_var_thd_ulonglong::check(THD *thd, set_var *var)
-{
- return get_unsigned(thd, var, max_system_variables.*offset, GET_ULL);
-}
-
-bool sys_var_thd_ulonglong::update(THD *thd, set_var *var)
-{
- if (var->type == OPT_GLOBAL)
- {
- /* Lock is needed to make things safe on 32 bit systems */
- pthread_mutex_lock(&LOCK_global_system_variables);
- global_system_variables.*offset= (ulonglong)
- var->save_result.ulonglong_value;
- pthread_mutex_unlock(&LOCK_global_system_variables);
- }
- else
- thd->variables.*offset= (ulonglong) var->save_result.ulonglong_value;
- return 0;
-}
-
-
-void sys_var_thd_ulonglong::set_default(THD *thd, enum_var_type type)
-{
- if (type == OPT_GLOBAL)
- {
- my_bool not_used;
- pthread_mutex_lock(&LOCK_global_system_variables);
- global_system_variables.*offset=
- getopt_ull_limit_value((ulonglong) option_limits->def_value,
- option_limits, &not_used);
- pthread_mutex_unlock(&LOCK_global_system_variables);
- }
- else
- thd->variables.*offset= global_system_variables.*offset;
-}
-
-
-uchar *sys_var_thd_ulonglong::value_ptr(THD *thd, enum_var_type type,
- LEX_STRING *base)
-{
- if (type == OPT_GLOBAL)
- return (uchar*) &(global_system_variables.*offset);
- return (uchar*) &(thd->variables.*offset);
-}
-
-
-bool sys_var_thd_bool::update(THD *thd, set_var *var)
-{
- if (var->type == OPT_GLOBAL)
- global_system_variables.*offset= (my_bool) var->save_result.ulong_value;
- else
- thd->variables.*offset= (my_bool) var->save_result.ulong_value;
- return 0;
-}
-
-
-void sys_var_thd_bool::set_default(THD *thd, enum_var_type type)
-{
- if (type == OPT_GLOBAL)
- global_system_variables.*offset= (my_bool) option_limits->def_value;
- else
- thd->variables.*offset= global_system_variables.*offset;
-}
-
-
-uchar *sys_var_thd_bool::value_ptr(THD *thd, enum_var_type type,
- LEX_STRING *base)
-{
- if (type == OPT_GLOBAL)
- return (uchar*) &(global_system_variables.*offset);
- return (uchar*) &(thd->variables.*offset);
-}
-
-
-bool sys_var::check_enum(THD *thd, set_var *var, const TYPELIB *enum_names)
-{
- char buff[STRING_BUFFER_USUAL_SIZE];
- const char *value;
- String str(buff, sizeof(buff), system_charset_info), *res;
-
- if (var->value->result_type() == STRING_RESULT)
- {
- if (!(res=var->value->val_str(&str)) ||
- ((long) (var->save_result.ulong_value=
- (ulong) find_type(enum_names, res->ptr(),
- res->length(), FALSE) - 1)) < 0)
- {
- if (res)
- {
- ErrConvString err(res);
- my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, err.ptr());
- return 1;
- }
- value= "NULL";
- goto err;
- }
- }
- else
- {
- ulonglong tmp=var->value->val_int();
- if (tmp >= enum_names->count)
- {
- llstr(tmp,buff);
- value=buff; // Wrong value is here
- goto err;
- }
- var->save_result.ulong_value= (ulong) tmp; // Save for update
- }
- return 0;
-
-err:
- my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, value);
- return 1;
-}
-
-
-bool sys_var::check_set(THD *thd, set_var *var, TYPELIB *enum_names)
-{
- bool not_used;
- char buff[STRING_BUFFER_USUAL_SIZE], *error= 0;
- uint error_len= 0;
- String str(buff, sizeof(buff), system_charset_info), *res;
-
- if (var->value->result_type() == STRING_RESULT)
- {
- if (!(res= var->value->val_str(&str)))
- {
- strmov(buff, "NULL");
- goto err;
- }
-
- if (!m_allow_empty_value &&
- res->length() == 0)
- {
- buff[0]= 0;
- goto err;
- }
-
- var->save_result.ulong_value= ((ulong)
- find_set(enum_names, res->c_ptr(),
- res->length(),
- NULL,
- &error, &error_len,
- &not_used));
- if (error_len)
- {
- ErrConvString err(error, error_len, res->charset());
- my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, err.ptr());
- return 1;
- }
- }
- else
+ if (fixed)
{
- ulonglong tmp= var->value->val_int();
+ char buf[64];
- if (!m_allow_empty_value &&
- tmp == 0)
- {
- buff[0]= '0';
- buff[1]= 0;
- goto err;
- }
+ snprintf(buf, sizeof(buf)-1, "%g", v);
- /*
- For when the enum is made to contain 64 elements, as 1ULL<<64 is
- undefined, we guard with a "count<64" test.
- */
- if (unlikely((tmp >= ((ULL(1)) << enum_names->count)) &&
- (enum_names->count < 64)))
+ if (thd->variables.sql_mode & MODE_STRICT_ALL_TABLES)
{
- llstr(tmp, buff);
- goto err;
+ my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, buf);
+ return true;
}
- var->save_result.ulong_value= (ulong) tmp; // Save for update
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_TRUNCATED_WRONG_VALUE,
+ ER(ER_TRUNCATED_WRONG_VALUE), name, buf);
}
- return 0;
-
-err:
- my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, buff);
- return 1;
+ return false;
}
-
CHARSET_INFO *sys_var::charset(THD *thd)
{
- return is_os_charset ? thd->variables.character_set_filesystem :
+ return is_os_charset ? thd->variables.character_set_filesystem :
system_charset_info;
}
-
-bool sys_var_thd_enum::update(THD *thd, set_var *var)
-{
- if (var->type == OPT_GLOBAL)
- global_system_variables.*offset= var->save_result.ulong_value;
- else
- thd->variables.*offset= var->save_result.ulong_value;
- return 0;
-}
-
-
-void sys_var_thd_enum::set_default(THD *thd, enum_var_type type)
-{
- if (type == OPT_GLOBAL)
- global_system_variables.*offset= (ulong) option_limits->def_value;
- else
- thd->variables.*offset= global_system_variables.*offset;
-}
-
-
-uchar *sys_var_thd_enum::value_ptr(THD *thd, enum_var_type type,
- LEX_STRING *base)
-{
- ulong tmp= ((type == OPT_GLOBAL) ?
- global_system_variables.*offset :
- thd->variables.*offset);
- return (uchar*) enum_names->type_names[tmp];
-}
-
-bool sys_var_thd_bit::check(THD *thd, set_var *var)
-{
- return (check_enum(thd, var, &bool_typelib) ||
- (check_func && (*check_func)(thd, var)));
-}
-
-bool sys_var_thd_bit::update(THD *thd, set_var *var)
-{
- int res= (*update_func)(thd, var);
- return res;
-}
-
-
-uchar *sys_var_thd_bit::value_ptr(THD *thd, enum_var_type type,
- LEX_STRING *base)
-{
- /*
- If reverse is 0 (default) return 1 if bit is set.
- If reverse is 1, return 0 if bit is set
- */
- thd->sys_var_tmp.my_bool_value= ((thd->options & bit_flag) ?
- !reverse : reverse);
- return (uchar*) &thd->sys_var_tmp.my_bool_value;
-}
-
-
-/** Update a date_time format variable based on given value. */
-
-void sys_var_thd_date_time_format::update2(THD *thd, enum_var_type type,
- DATE_TIME_FORMAT *new_value)
-{
- DATE_TIME_FORMAT *old;
- DBUG_ENTER("sys_var_date_time_format::update2");
- DBUG_DUMP("positions", (uchar*) new_value->positions,
- sizeof(new_value->positions));
-
- if (type == OPT_GLOBAL)
- {
- pthread_mutex_lock(&LOCK_global_system_variables);
- old= (global_system_variables.*offset);
- (global_system_variables.*offset)= new_value;
- pthread_mutex_unlock(&LOCK_global_system_variables);
- }
- else
- {
- old= (thd->variables.*offset);
- (thd->variables.*offset)= new_value;
- }
- my_free((char*) old, MYF(MY_ALLOW_ZERO_PTR));
- DBUG_VOID_RETURN;
-}
-
-
-bool sys_var_thd_date_time_format::update(THD *thd, set_var *var)
-{
- DATE_TIME_FORMAT *new_value;
- /* We must make a copy of the last value to get it into normal memory */
- new_value= date_time_format_copy((THD*) 0,
- var->save_result.date_time_format);
- if (!new_value)
- return 1; // Out of memory
- update2(thd, var->type, new_value); // Can't fail
- return 0;
-}
-
-
-bool sys_var_thd_date_time_format::check(THD *thd, set_var *var)
-{
- char buff[STRING_BUFFER_USUAL_SIZE];
- String str(buff,sizeof(buff), system_charset_info), *res;
- DATE_TIME_FORMAT *format;
-
- if (!(res=var->value->val_str(&str)))
- res= &my_empty_string;
-
- if (!(format= date_time_format_make(date_time_type,
- res->ptr(), res->length())))
- {
- ErrConvString err(res);
- my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, err.ptr());
- return 1;
- }
-
- /*
- We must copy result to thread space to not get a memory leak if
- update is aborted
- */
- var->save_result.date_time_format= date_time_format_copy(thd, format);
- my_free((char*) format, MYF(0));
- return var->save_result.date_time_format == 0;
-}
-
-
-void sys_var_thd_date_time_format::set_default(THD *thd, enum_var_type type)
-{
- DATE_TIME_FORMAT *res= 0;
-
- if (type == OPT_GLOBAL)
- {
- const char *format;
- if ((format= opt_date_time_formats[date_time_type]))
- res= date_time_format_make(date_time_type, format, strlen(format));
- }
- else
- {
- /* Make copy with malloc */
- res= date_time_format_copy((THD *) 0, global_system_variables.*offset);
- }
-
- if (res) // Should always be true
- update2(thd, type, res);
-}
-
-
-uchar *sys_var_thd_date_time_format::value_ptr(THD *thd, enum_var_type type,
- LEX_STRING *base)
-{
- if (type == OPT_GLOBAL)
- {
- char *res;
- /*
- We do a copy here just to be sure things will work even if someone
- is modifying the original string while the copy is accessed
- (Can't happen now in SQL SHOW, but this is a good safety for the future)
- */
- res= thd->strmake((global_system_variables.*offset)->format.str,
- (global_system_variables.*offset)->format.length);
- return (uchar*) res;
- }
- return (uchar*) (thd->variables.*offset)->format.str;
-}
-
-
typedef struct old_names_map_st
{
const char *old_name;
const char *new_name;
} my_old_conv;
-static my_old_conv old_conv[]=
-{
- { "cp1251_koi8" , "cp1251" },
- { "cp1250_latin2" , "cp1250" },
- { "kam_latin2" , "keybcs2" },
- { "mac_latin2" , "MacRoman" },
- { "macce_latin2" , "MacCE" },
- { "pc2_latin2" , "pclatin2" },
- { "vga_latin2" , "pclatin1" },
- { "koi8_cp1251" , "koi8r" },
- { "win1251ukr_koi8_ukr" , "win1251ukr" },
- { "koi8_ukr_win1251ukr" , "koi8u" },
- { NULL , NULL }
+static my_old_conv old_conv[]=
+{
+ { "cp1251_koi8" , "cp1251" },
+ { "cp1250_latin2" , "cp1250" },
+ { "kam_latin2" , "keybcs2" },
+ { "mac_latin2" , "MacRoman" },
+ { "macce_latin2" , "MacCE" },
+ { "pc2_latin2" , "pclatin2" },
+ { "vga_latin2" , "pclatin1" },
+ { "koi8_cp1251" , "koi8r" },
+ { "win1251ukr_koi8_ukr" , "win1251ukr" },
+ { "koi8_ukr_win1251ukr" , "koi8u" },
+ { NULL , NULL }
};
CHARSET_INFO *get_old_charset_by_name(const char *name)
{
my_old_conv *conv;
-
+
for (conv= old_conv; conv->old_name; conv++)
{
if (!my_strcasecmp(&my_charset_latin1, name, conv->old_name))
@@ -2149,1169 +339,6 @@ CHARSET_INFO *get_old_charset_by_name(const char *name)
return NULL;
}
-
-bool sys_var_collation::check(THD *thd, set_var *var)
-{
- CHARSET_INFO *tmp;
- LINT_INIT(tmp);
-
- if (var->value->result_type() == STRING_RESULT)
- {
- char buff[STRING_BUFFER_USUAL_SIZE];
- String str(buff,sizeof(buff), system_charset_info), *res;
- if (!(res=var->value->val_str(&str)))
- {
- my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, "NULL");
- return 1;
- }
- if (!(tmp=get_charset_by_name(res->c_ptr(),MYF(0))))
- {
- ErrConvString err(res);
- my_error(ER_UNKNOWN_COLLATION, MYF(0), err.ptr());
- return 1;
- }
- }
- else // INT_RESULT
- {
- if (!(tmp=get_charset((int) var->value->val_int(),MYF(0))))
- {
- char buf[20];
- int10_to_str((int) var->value->val_int(), buf, -10);
- my_error(ER_UNKNOWN_COLLATION, MYF(0), buf);
- return 1;
- }
- }
- var->save_result.charset= tmp; // Save for update
- return 0;
-}
-
-
-bool sys_var_character_set::check(THD *thd, set_var *var)
-{
- CHARSET_INFO *tmp;
- LINT_INIT(tmp);
-
- if (var->value->result_type() == STRING_RESULT)
- {
- char buff[STRING_BUFFER_USUAL_SIZE];
- String str(buff,sizeof(buff), system_charset_info), *res;
- if (!(res=var->value->val_str(&str)))
- {
- if (!nullable)
- {
- my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, "NULL");
- return 1;
- }
- tmp= NULL;
- }
- else if (!(tmp=get_charset_by_csname(res->c_ptr(),MY_CS_PRIMARY,MYF(0))) &&
- !(tmp=get_old_charset_by_name(res->c_ptr())))
- {
- ErrConvString err(res);
- my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), err.ptr());
- return 1;
- }
- }
- else // INT_RESULT
- {
- if (!(tmp=get_charset((int) var->value->val_int(),MYF(0))))
- {
- char buf[20];
- int10_to_str((int) var->value->val_int(), buf, -10);
- my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), buf);
- return 1;
- }
- }
- var->save_result.charset= tmp; // Save for update
- return 0;
-}
-
-
-bool sys_var_character_set::update(THD *thd, set_var *var)
-{
- ci_ptr(thd,var->type)[0]= var->save_result.charset;
- thd->update_charset();
- return 0;
-}
-
-
-uchar *sys_var_character_set::value_ptr(THD *thd, enum_var_type type,
- LEX_STRING *base)
-{
- CHARSET_INFO *cs= ci_ptr(thd,type)[0];
- return cs ? (uchar*) cs->csname : (uchar*) NULL;
-}
-
-
-void sys_var_character_set_sv::set_default(THD *thd, enum_var_type type)
-{
- if (type == OPT_GLOBAL)
- global_system_variables.*offset= *global_default;
- else
- {
- thd->variables.*offset= global_system_variables.*offset;
- thd->update_charset();
- }
-}
-CHARSET_INFO **sys_var_character_set_sv::ci_ptr(THD *thd, enum_var_type type)
-{
- if (type == OPT_GLOBAL)
- return &(global_system_variables.*offset);
- else
- return &(thd->variables.*offset);
-}
-
-
-bool sys_var_character_set_client::check(THD *thd, set_var *var)
-{
- if (sys_var_character_set_sv::check(thd, var))
- return 1;
- /* Currently, UCS-2 cannot be used as a client character set */
- if (var->save_result.charset->mbminlen > 1)
- {
- my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name,
- var->save_result.charset->csname);
- return 1;
- }
- return 0;
-}
-
-
-CHARSET_INFO ** sys_var_character_set_database::ci_ptr(THD *thd,
- enum_var_type type)
-{
- if (type == OPT_GLOBAL)
- return &global_system_variables.collation_database;
- else
- return &thd->variables.collation_database;
-}
-
-
-void sys_var_character_set_database::set_default(THD *thd, enum_var_type type)
-{
- if (type == OPT_GLOBAL)
- global_system_variables.collation_database= default_charset_info;
- else
- {
- thd->variables.collation_database= thd->db_charset;
- thd->update_charset();
- }
-}
-
-
-bool sys_var_collation_sv::update(THD *thd, set_var *var)
-{
- if (var->type == OPT_GLOBAL)
- global_system_variables.*offset= var->save_result.charset;
- else
- {
- thd->variables.*offset= var->save_result.charset;
- thd->update_charset();
- }
- return 0;
-}
-
-
-void sys_var_collation_sv::set_default(THD *thd, enum_var_type type)
-{
- if (type == OPT_GLOBAL)
- global_system_variables.*offset= *global_default;
- else
- {
- thd->variables.*offset= global_system_variables.*offset;
- thd->update_charset();
- }
-}
-
-
-uchar *sys_var_collation_sv::value_ptr(THD *thd, enum_var_type type,
- LEX_STRING *base)
-{
- CHARSET_INFO *cs= ((type == OPT_GLOBAL) ?
- global_system_variables.*offset : thd->variables.*offset);
- return cs ? (uchar*) cs->name : (uchar*) "NULL";
-}
-
-
-LEX_STRING default_key_cache_base= {(char *) "default", 7 };
-
-static KEY_CACHE zero_key_cache;
-
-KEY_CACHE *get_key_cache(LEX_STRING *cache_name)
-{
- safe_mutex_assert_owner(&LOCK_global_system_variables);
- if (!cache_name || ! cache_name->length)
- cache_name= &default_key_cache_base;
- return ((KEY_CACHE*) find_named(&key_caches,
- cache_name->str, cache_name->length, 0));
-}
-
-
-uchar *sys_var_key_cache_param::value_ptr(THD *thd, enum_var_type type,
- LEX_STRING *base)
-{
- KEY_CACHE *key_cache= get_key_cache(base);
- if (!key_cache)
- key_cache= &zero_key_cache;
- return (uchar*) key_cache + offset ;
-}
-
-
-bool sys_var_key_buffer_size::update(THD *thd, set_var *var)
-{
- ulonglong tmp= var->save_result.ulonglong_value;
- LEX_STRING *base_name= &var->base;
- KEY_CACHE *key_cache;
- bool error= 0;
-
- /* If no basename, assume it's for the key cache named 'default' */
- if (!base_name->length)
- base_name= &default_key_cache_base;
-
- pthread_mutex_lock(&LOCK_global_system_variables);
- key_cache= get_key_cache(base_name);
-
- if (!key_cache)
- {
- /* Key cache didn't exists */
- if (!tmp) // Tried to delete cache
- goto end; // Ok, nothing to do
- if (!(key_cache= create_key_cache(base_name->str, base_name->length)))
- {
- error= 1;
- goto end;
- }
- }
-
- /*
- Abort if some other thread is changing the key cache
- TODO: This should be changed so that we wait until the previous
- assignment is done and then do the new assign
- */
- if (key_cache->in_init)
- goto end;
-
- if (!tmp) // Zero size means delete
- {
- if (key_cache == dflt_key_cache)
- {
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_WARN_CANT_DROP_DEFAULT_KEYCACHE,
- ER(ER_WARN_CANT_DROP_DEFAULT_KEYCACHE));
- goto end; // Ignore default key cache
- }
-
- if (key_cache->key_cache_inited) // If initied
- {
- /*
- Move tables using this key cache to the default key cache
- and clear the old key cache.
- */
- NAMED_LIST *list;
- key_cache= (KEY_CACHE *) find_named(&key_caches, base_name->str,
- base_name->length, &list);
- key_cache->in_init= 1;
- pthread_mutex_unlock(&LOCK_global_system_variables);
- error= reassign_keycache_tables(thd, key_cache, dflt_key_cache);
- pthread_mutex_lock(&LOCK_global_system_variables);
- key_cache->in_init= 0;
- }
- /*
- We don't delete the key cache as some running threads my still be
- in the key cache code with a pointer to the deleted (empty) key cache
- */
- goto end;
- }
-
- bound_unsigned(thd, &tmp, option_limits);
- key_cache->param_buff_size= (ulonglong) tmp;
-
- /* If key cache didn't exist initialize it, else resize it */
- key_cache->in_init= 1;
- pthread_mutex_unlock(&LOCK_global_system_variables);
-
- if (!key_cache->key_cache_inited)
- error= (bool) (ha_init_key_cache("", key_cache));
- else
- error= (bool)(ha_resize_key_cache(key_cache));
-
- pthread_mutex_lock(&LOCK_global_system_variables);
- key_cache->in_init= 0;
-
-end:
- pthread_mutex_unlock(&LOCK_global_system_variables);
- return error;
-}
-
-
-/**
- @todo
- Abort if some other thread is changing the key cache.
- This should be changed so that we wait until the previous
- assignment is done and then do the new assign
-*/
-bool sys_var_key_cache_long::update(THD *thd, set_var *var)
-{
- ulonglong tmp= var->value->val_int();
- LEX_STRING *base_name= &var->base;
- bool error= 0;
-
- if (!base_name->length)
- base_name= &default_key_cache_base;
-
- pthread_mutex_lock(&LOCK_global_system_variables);
- KEY_CACHE *key_cache= get_key_cache(base_name);
-
- if (!key_cache && !(key_cache= create_key_cache(base_name->str,
- base_name->length)))
- {
- error= 1;
- goto end;
- }
-
- /*
- Abort if some other thread is changing the key cache
- TODO: This should be changed so that we wait until the previous
- assignment is done and then do the new assign
- */
- if (key_cache->in_init)
- goto end;
-
- bound_unsigned(thd, &tmp, option_limits);
- *((ulong*) (((char*) key_cache) + offset))= (ulong) tmp;
-
- /*
- Don't create a new key cache if it didn't exist
- (key_caches are created only when the user sets block_size)
- */
- key_cache->in_init= 1;
-
- pthread_mutex_unlock(&LOCK_global_system_variables);
-
- error= (bool) (ha_resize_key_cache(key_cache));
-
- pthread_mutex_lock(&LOCK_global_system_variables);
- key_cache->in_init= 0;
-
-end:
- pthread_mutex_unlock(&LOCK_global_system_variables);
- return error;
-}
-
-
-bool sys_var_log_state::update(THD *thd, set_var *var)
-{
- bool res;
-
- if (this == &sys_var_log)
- WARN_DEPRECATED(thd, 7, 0, "@@log", "'@@general_log'");
- else if (this == &sys_var_log_slow)
- WARN_DEPRECATED(thd, 7, 0, "@@log_slow_queries", "'@@slow_query_log'");
-
- pthread_mutex_lock(&LOCK_global_system_variables);
- if (!var->save_result.ulong_value)
- {
- logger.deactivate_log_handler(thd, log_type);
- res= false;
- }
- else
- res= logger.activate_log_handler(thd, log_type);
- pthread_mutex_unlock(&LOCK_global_system_variables);
- return res;
-}
-
-void sys_var_log_state::set_default(THD *thd, enum_var_type type)
-{
- if (this == &sys_var_log)
- WARN_DEPRECATED(thd, 7, 0, "@@log", "'@@general_log'");
- else if (this == &sys_var_log_slow)
- WARN_DEPRECATED(thd, 7, 0, "@@log_slow_queries", "'@@slow_query_log'");
-
- pthread_mutex_lock(&LOCK_global_system_variables);
- logger.deactivate_log_handler(thd, log_type);
- pthread_mutex_unlock(&LOCK_global_system_variables);
-}
-
-
-static int sys_check_log_path(THD *thd, set_var *var)
-{
- char path[FN_REFLEN], buff[FN_REFLEN];
- MY_STAT f_stat;
- String str(buff, sizeof(buff), system_charset_info), *res;
- const char *log_file_str;
- size_t path_length;
-
- if (!(res= var->value->val_str(&str)))
- goto err;
-
- log_file_str= res->c_ptr();
- bzero(&f_stat, sizeof(MY_STAT));
-
- path_length= unpack_filename(path, log_file_str);
-
- if (!path_length)
- {
- /* File name is empty. */
-
- goto err;
- }
-
- if (my_stat(path, &f_stat, MYF(0)))
- {
- /*
- A file system object exists. Check if argument is a file and we have
- 'write' permission.
- */
-
- if (!MY_S_ISREG(f_stat.st_mode) ||
- !(f_stat.st_mode & MY_S_IWRITE))
- goto err;
-
- return 0;
- }
-
- /* Get dirname of the file path. */
- (void) dirname_part(path, log_file_str, &path_length);
-
- /* Dirname is empty if file path is relative. */
- if (!path_length)
- return 0;
-
- /*
- Check if directory exists and we have permission to create file and
- write to file.
- */
- if (my_access(path, (F_OK|W_OK)))
- goto err;
-
- return 0;
-
-err:
- my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->var->name,
- res ? log_file_str : "NULL");
- return 1;
-}
-
-
-bool update_sys_var_str_path(THD *thd, sys_var_str *var_str,
- set_var *var, const char *log_ext,
- bool log_state, uint log_type)
-{
- MYSQL_QUERY_LOG *file_log;
- char buff[FN_REFLEN];
- char *res= 0, *old_value= 0;
- bool result= 0;
- uint str_length= 0;
-
- if (var)
- {
- String str(buff, sizeof(buff), system_charset_info), *newval;
-
- newval= var->value->val_str(&str);
- old_value= newval->c_ptr_safe();
- str_length= strlen(old_value);
- }
-
-
-
- switch (log_type) {
- case QUERY_LOG_SLOW:
- file_log= logger.get_slow_log_file_handler();
- break;
- case QUERY_LOG_GENERAL:
- file_log= logger.get_log_file_handler();
- break;
- default:
- assert(0); // Impossible
- }
-
- if (!old_value)
- {
- old_value= make_default_log_name(buff, log_ext);
- str_length= strlen(old_value);
- }
- if (!(res= my_strndup(old_value, str_length, MYF(MY_FAE+MY_WME))))
- {
- result= 1;
- goto err;
- }
-
- pthread_mutex_lock(&LOCK_global_system_variables);
- logger.lock_exclusive();
-
- if (file_log && log_state)
- file_log->close(0);
- old_value= var_str->value;
- var_str->value= res;
- var_str->value_length= str_length;
- my_free(old_value, MYF(MY_ALLOW_ZERO_PTR));
- if (file_log && log_state)
- {
- switch (log_type) {
- case QUERY_LOG_SLOW:
- file_log->open_slow_log(sys_var_slow_log_path.value);
- break;
- case QUERY_LOG_GENERAL:
- file_log->open_query_log(sys_var_general_log_path.value);
- break;
- default:
- DBUG_ASSERT(0);
- }
- }
-
- logger.unlock();
- pthread_mutex_unlock(&LOCK_global_system_variables);
-
-err:
- return result;
-}
-
-
-static bool sys_update_general_log_path(THD *thd, set_var * var)
-{
- return update_sys_var_str_path(thd, &sys_var_general_log_path,
- var, ".log", opt_log, QUERY_LOG_GENERAL);
-}
-
-
-static void sys_default_general_log_path(THD *thd, enum_var_type type)
-{
- (void) update_sys_var_str_path(thd, &sys_var_general_log_path,
- 0, ".log", opt_log, QUERY_LOG_GENERAL);
-}
-
-
-static bool sys_update_slow_log_path(THD *thd, set_var * var)
-{
- return update_sys_var_str_path(thd, &sys_var_slow_log_path,
- var, "-slow.log", opt_slow_log,
- QUERY_LOG_SLOW);
-}
-
-
-static void sys_default_slow_log_path(THD *thd, enum_var_type type)
-{
- (void) update_sys_var_str_path(thd, &sys_var_slow_log_path,
- 0, "-slow.log", opt_slow_log,
- QUERY_LOG_SLOW);
-}
-
-
-bool sys_var_log_output::update(THD *thd, set_var *var)
-{
- pthread_mutex_lock(&LOCK_global_system_variables);
- logger.lock_exclusive();
- logger.init_slow_log(var->save_result.ulong_value);
- logger.init_general_log(var->save_result.ulong_value);
- *value= var->save_result.ulong_value;
- logger.unlock();
- pthread_mutex_unlock(&LOCK_global_system_variables);
- return 0;
-}
-
-
-void sys_var_log_output::set_default(THD *thd, enum_var_type type)
-{
- pthread_mutex_lock(&LOCK_global_system_variables);
- logger.lock_exclusive();
- logger.init_slow_log(LOG_FILE);
- logger.init_general_log(LOG_FILE);
- *value= LOG_FILE;
- logger.unlock();
- pthread_mutex_unlock(&LOCK_global_system_variables);
-}
-
-
-uchar *sys_var_log_output::value_ptr(THD *thd, enum_var_type type,
- LEX_STRING *base)
-{
- char buff[256];
- String tmp(buff, sizeof(buff), &my_charset_latin1);
- ulong length;
- ulong val= *value;
-
- tmp.length(0);
- for (uint i= 0; val; val>>= 1, i++)
- {
- if (val & 1)
- {
- tmp.append(log_output_typelib.type_names[i],
- log_output_typelib.type_lengths[i]);
- tmp.append(',');
- }
- }
-
- if ((length= tmp.length()))
- length--;
- return (uchar*) thd->strmake(tmp.ptr(), length);
-}
-
-
-/*****************************************************************************
- Functions to handle SET NAMES and SET CHARACTER SET
-*****************************************************************************/
-
-int set_var_collation_client::check(THD *thd)
-{
- /* Currently, UCS-2 cannot be used as a client character set */
- if (character_set_client->mbminlen > 1)
- {
- my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), "character_set_client",
- character_set_client->csname);
- return 1;
- }
- return 0;
-}
-
-int set_var_collation_client::update(THD *thd)
-{
- thd->variables.character_set_client= character_set_client;
- thd->variables.character_set_results= character_set_results;
- thd->variables.collation_connection= collation_connection;
- thd->update_charset();
- thd->protocol_text.init(thd);
- thd->protocol_binary.init(thd);
- return 0;
-}
-
-/****************************************************************************/
-
-bool sys_var_timestamp::update(THD *thd, set_var *var)
-{
- thd->set_time((time_t) var->save_result.ulonglong_value);
- return 0;
-}
-
-
-void sys_var_timestamp::set_default(THD *thd, enum_var_type type)
-{
- thd->user_time=0;
-}
-
-
-uchar *sys_var_timestamp::value_ptr(THD *thd, enum_var_type type,
- LEX_STRING *base)
-{
- thd->sys_var_tmp.long_value= (long) thd->start_time;
- return (uchar*) &thd->sys_var_tmp.long_value;
-}
-
-
-bool sys_var_last_insert_id::update(THD *thd, set_var *var)
-{
- thd->first_successful_insert_id_in_prev_stmt=
- var->save_result.ulonglong_value;
- return 0;
-}
-
-
-uchar *sys_var_last_insert_id::value_ptr(THD *thd, enum_var_type type,
- LEX_STRING *base)
-{
- /*
- this tmp var makes it robust againt change of type of
- read_first_successful_insert_id_in_prev_stmt().
- */
- thd->sys_var_tmp.ulonglong_value=
- thd->read_first_successful_insert_id_in_prev_stmt();
- return (uchar*) &thd->sys_var_tmp.ulonglong_value;
-}
-
-
-bool sys_var_insert_id::update(THD *thd, set_var *var)
-{
- thd->force_one_auto_inc_interval(var->save_result.ulonglong_value);
- return 0;
-}
-
-
-uchar *sys_var_insert_id::value_ptr(THD *thd, enum_var_type type,
- LEX_STRING *base)
-{
- thd->sys_var_tmp.ulonglong_value=
- thd->auto_inc_intervals_forced.minimum();
- return (uchar*) &thd->sys_var_tmp.ulonglong_value;
-}
-
-
-bool sys_var_rand_seed1::update(THD *thd, set_var *var)
-{
- thd->rand.seed1= (ulong) var->save_result.ulonglong_value;
- return 0;
-}
-
-bool sys_var_rand_seed2::update(THD *thd, set_var *var)
-{
- thd->rand.seed2= (ulong) var->save_result.ulonglong_value;
- return 0;
-}
-
-
-bool sys_var_thd_time_zone::check(THD *thd, set_var *var)
-{
- char buff[MAX_TIME_ZONE_NAME_LENGTH];
- String str(buff, sizeof(buff), &my_charset_latin1);
- String *res= var->value->val_str(&str);
-
- if (!(var->save_result.time_zone= my_tz_find(thd, res)))
- {
- my_error(ER_UNKNOWN_TIME_ZONE, MYF(0), res ? res->c_ptr() : "NULL");
- return 1;
- }
- return 0;
-}
-
-
-bool sys_var_thd_time_zone::update(THD *thd, set_var *var)
-{
- /* We are using Time_zone object found during check() phase. */
- if (var->type == OPT_GLOBAL)
- {
- pthread_mutex_lock(&LOCK_global_system_variables);
- global_system_variables.time_zone= var->save_result.time_zone;
- pthread_mutex_unlock(&LOCK_global_system_variables);
- }
- else
- thd->variables.time_zone= var->save_result.time_zone;
- return 0;
-}
-
-
-uchar *sys_var_thd_time_zone::value_ptr(THD *thd, enum_var_type type,
- LEX_STRING *base)
-{
- /*
- We can use ptr() instead of c_ptr() here because String contaning
- time zone name is guaranteed to be zero ended.
- */
- if (type == OPT_GLOBAL)
- return (uchar *)(global_system_variables.time_zone->get_name()->ptr());
- else
- {
- /*
- This is an ugly fix for replication: we don't replicate properly queries
- invoking system variables' values to update tables; but
- CONVERT_TZ(,,@@session.time_zone) is so popular that we make it
- replicable (i.e. we tell the binlog code to store the session
- timezone). If it's the global value which was used we can't replicate
- (binlog code stores session value only).
- */
- thd->time_zone_used= 1;
- return (uchar *)(thd->variables.time_zone->get_name()->ptr());
- }
-}
-
-
-void sys_var_thd_time_zone::set_default(THD *thd, enum_var_type type)
-{
- pthread_mutex_lock(&LOCK_global_system_variables);
- if (type == OPT_GLOBAL)
- {
- if (default_tz_name)
- {
- String str(default_tz_name, &my_charset_latin1);
- /*
- We are guaranteed to find this time zone since its existence
- is checked during start-up.
- */
- global_system_variables.time_zone= my_tz_find(thd, &str);
- }
- else
- global_system_variables.time_zone= my_tz_SYSTEM;
- }
- else
- thd->variables.time_zone= global_system_variables.time_zone;
- pthread_mutex_unlock(&LOCK_global_system_variables);
-}
-
-
-bool sys_var_max_user_conn::check(THD *thd, set_var *var)
-{
- if (var->type == OPT_GLOBAL)
- return sys_var_thd::check(thd, var);
- else
- {
- /*
- Per-session values of max_user_connections can't be set directly.
- May be we should have a separate error message for this?
- */
- my_error(ER_GLOBAL_VARIABLE, MYF(0), name);
- return TRUE;
- }
-}
-
-bool sys_var_max_user_conn::update(THD *thd, set_var *var)
-{
- DBUG_ASSERT(var->type == OPT_GLOBAL);
- pthread_mutex_lock(&LOCK_global_system_variables);
- max_user_connections= (uint)var->save_result.ulonglong_value;
- pthread_mutex_unlock(&LOCK_global_system_variables);
- return 0;
-}
-
-
-void sys_var_max_user_conn::set_default(THD *thd, enum_var_type type)
-{
- DBUG_ASSERT(type == OPT_GLOBAL);
- pthread_mutex_lock(&LOCK_global_system_variables);
- max_user_connections= (ulong) option_limits->def_value;
- pthread_mutex_unlock(&LOCK_global_system_variables);
-}
-
-
-uchar *sys_var_max_user_conn::value_ptr(THD *thd, enum_var_type type,
- LEX_STRING *base)
-{
- if (type != OPT_GLOBAL &&
- thd->user_connect && thd->user_connect->user_resources.user_conn)
- return (uchar*) &(thd->user_connect->user_resources.user_conn);
- return (uchar*) &(max_user_connections);
-}
-
-
-bool sys_var_thd_ulong_session_readonly::check(THD *thd, set_var *var)
-{
- if (var->type != OPT_GLOBAL)
- {
- my_error(ER_VARIABLE_IS_READONLY, MYF(0), "SESSION", name, "GLOBAL");
- return TRUE;
- }
-
- return sys_var_thd_ulong::check(thd, var);
-}
-
-
-static MY_LOCALE *check_locale(THD *thd, const char *name, set_var *var)
-{
- MY_LOCALE *locale_match;
-
- if (var->value->result_type() == INT_RESULT)
- {
- if (!(locale_match= my_locale_by_number((uint) var->value->val_int())))
- {
- char buf[20];
- int10_to_str((int) var->value->val_int(), buf, -10);
- my_printf_error(ER_UNKNOWN_LOCALE, ER(ER_UNKNOWN_LOCALE), MYF(0), buf);
- return 0;
- }
- }
- else // STRING_RESULT
- {
- char buff[6];
- String str(buff, sizeof(buff), system_charset_info), *res;
- if (!(res=var->value->val_str(&str)))
- {
- my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, "NULL");
- return 0;
- }
- const char *locale_str= res->c_ptr();
- if (!(locale_match= my_locale_by_name(locale_str)))
- {
- my_printf_error(ER_UNKNOWN_LOCALE, ER(ER_UNKNOWN_LOCALE),
- MYF(0), locale_str);
- return 0;
- }
- }
-
- return var->save_result.locale_value= locale_match;
-}
-
-
-bool sys_var_thd_lc::check(THD *thd, set_var *var)
-{
- MY_LOCALE *locale_match;
-
- if (!(locale_match= check_locale(thd, name, var)))
- return 1;
- return 0;
-}
-
-
-bool sys_var_thd_lc_time_names::update(THD *thd, set_var *var)
-{
- if (var->type == OPT_GLOBAL)
- global_system_variables.lc_time_names= var->save_result.locale_value;
- else
- thd->variables.lc_time_names= var->save_result.locale_value;
- return 0;
-}
-
-
-uchar *sys_var_thd_lc_time_names::value_ptr(THD *thd, enum_var_type type,
- LEX_STRING *base)
-{
- return type == OPT_GLOBAL ?
- (uchar *) global_system_variables.lc_time_names->name :
- (uchar *) thd->variables.lc_time_names->name;
-}
-
-
-void sys_var_thd_lc_time_names::set_default(THD *thd, enum_var_type type)
-{
- if (type == OPT_GLOBAL)
- global_system_variables.lc_time_names= my_default_lc_time_names;
- else
- thd->variables.lc_time_names= global_system_variables.lc_time_names;
-}
-
-
-bool sys_var_thd_lc_messages::update(THD *thd, set_var *var)
-{
- MY_LOCALE *locale= var->save_result.locale_value;
-
- if (!locale->errmsgs->errmsgs)
- {
- pthread_mutex_lock(&LOCK_error_messages);
- if (!locale->errmsgs->errmsgs &&
- read_texts(ERRMSG_FILE, locale->errmsgs->language,
- &locale->errmsgs->errmsgs,
- ER_ERROR_LAST - ER_ERROR_FIRST + 1))
- {
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_UNKNOWN_ERROR,
- "Can't process error message file for locale '%s'",
- locale->name);
- pthread_mutex_unlock(&LOCK_error_messages);
- return 0;
- }
- pthread_mutex_unlock(&LOCK_error_messages);
- }
-
- if (var->type == OPT_GLOBAL)
- global_system_variables.lc_messages= locale;
- else
- thd->variables.lc_messages= locale;
-
- return 0;
-}
-
-
-uchar *sys_var_thd_lc_messages::value_ptr(THD *thd, enum_var_type type,
- LEX_STRING *base)
-{
- return type == OPT_GLOBAL ?
- (uchar *) global_system_variables.lc_messages->name :
- (uchar *) thd->variables.lc_messages->name;
-}
-
-
-void sys_var_thd_lc_messages::set_default(THD *thd, enum_var_type type)
-{
- if (type == OPT_GLOBAL)
- global_system_variables.lc_messages= my_default_lc_messages;
- else
- thd->variables.lc_messages= global_system_variables.lc_messages;
-}
-
-
-/*
- Handling of microseoncds given as seconds.part_seconds
-
- NOTES
- The argument to long query time is in seconds in decimal
- which is converted to ulonglong integer holding microseconds for storage.
- This is used for handling long_query_time
-*/
-
-bool sys_var_microseconds::update(THD *thd, set_var *var)
-{
- double num= var->value->val_real();
- longlong microseconds;
- if (num > (double) option_limits->max_value)
- num= (double) option_limits->max_value;
- if (num < (double) option_limits->min_value)
- num= (double) option_limits->min_value;
- microseconds= (longlong) (num * 1000000.0 + 0.5);
- if (var->type == OPT_GLOBAL)
- {
- pthread_mutex_lock(&LOCK_global_system_variables);
- (global_system_variables.*offset)= microseconds;
- pthread_mutex_unlock(&LOCK_global_system_variables);
- }
- else
- thd->variables.*offset= microseconds;
- return 0;
-}
-
-
-void sys_var_microseconds::set_default(THD *thd, enum_var_type type)
-{
- longlong microseconds= (longlong) (option_limits->def_value * 1000000.0);
- if (type == OPT_GLOBAL)
- {
- pthread_mutex_lock(&LOCK_global_system_variables);
- global_system_variables.*offset= microseconds;
- pthread_mutex_unlock(&LOCK_global_system_variables);
- }
- else
- thd->variables.*offset= microseconds;
-}
-
-
-uchar *sys_var_microseconds::value_ptr(THD *thd, enum_var_type type,
- LEX_STRING *base)
-{
- thd->tmp_double_value= (double) ((type == OPT_GLOBAL) ?
- global_system_variables.*offset :
- thd->variables.*offset) / 1000000.0;
- return (uchar*) &thd->tmp_double_value;
-}
-
-
-/*
- Functions to update thd->options bits
-*/
-
-static bool set_option_bit(THD *thd, set_var *var)
-{
- sys_var_thd_bit *sys_var= ((sys_var_thd_bit*) var->var);
- if ((var->save_result.ulong_value != 0) == sys_var->reverse)
- thd->options&= ~sys_var->bit_flag;
- else
- thd->options|= sys_var->bit_flag;
- return 0;
-}
-
-/*
- Functions to be only used to update thd->options OPTION_BIN_LOG bit
-*/
-static bool set_option_log_bin_bit(THD *thd, set_var *var)
-{
- set_option_bit(thd, var);
- if (!thd->in_sub_stmt)
- thd->sql_log_bin_toplevel= thd->options & OPTION_BIN_LOG;
- return 0;
-}
-
-static bool set_option_autocommit(THD *thd, set_var *var)
-{
- /* The test is negative as the flag we use is NOT autocommit */
-
- ulonglong org_options= thd->options;
-
- /*
- If we are setting AUTOCOMMIT=1 and it was not already 1, then we
- need to commit any outstanding transactions.
- */
- if (var->save_result.ulong_value != 0 &&
- (thd->options & OPTION_NOT_AUTOCOMMIT) &&
- ha_commit(thd))
- return 1;
-
- if (var->save_result.ulong_value != 0)
- thd->options&= ~((sys_var_thd_bit*) var->var)->bit_flag;
- else
- thd->options|= ((sys_var_thd_bit*) var->var)->bit_flag;
-
- if ((org_options ^ thd->options) & OPTION_NOT_AUTOCOMMIT)
- {
- if ((org_options & OPTION_NOT_AUTOCOMMIT))
- {
- /* We changed to auto_commit mode */
- thd->options&= ~(ulonglong) (OPTION_BEGIN | OPTION_KEEP_LOG);
- thd->transaction.all.modified_non_trans_table= FALSE;
- thd->server_status|= SERVER_STATUS_AUTOCOMMIT;
- }
- else
- {
- thd->transaction.all.modified_non_trans_table= FALSE;
- thd->server_status&= ~SERVER_STATUS_AUTOCOMMIT;
- }
- }
- return 0;
-}
-
-static int check_log_update(THD *thd, set_var *var)
-{
-#ifndef NO_EMBEDDED_ACCESS_CHECKS
- if (!(thd->security_ctx->master_access & SUPER_ACL))
- {
- my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "SUPER");
- return 1;
- }
-#endif
- return 0;
-}
-
-static bool set_log_update(THD *thd, set_var *var)
-{
- /*
- The update log is not supported anymore since 5.0.
- See sql/mysqld.cc/, comments in function init_server_components() for an
- explaination of the different warnings we send below
- */
-
- if (opt_sql_bin_update)
- {
- push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
- ER_UPDATE_LOG_DEPRECATED_TRANSLATED,
- ER(ER_UPDATE_LOG_DEPRECATED_TRANSLATED));
- }
- else
- push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
- ER_UPDATE_LOG_DEPRECATED_IGNORED,
- ER(ER_UPDATE_LOG_DEPRECATED_IGNORED));
- set_option_bit(thd, var);
- return 0;
-}
-
-
-static int check_pseudo_thread_id(THD *thd, set_var *var)
-{
- var->save_result.ulonglong_value= var->value->val_int();
-#ifndef NO_EMBEDDED_ACCESS_CHECKS
- if (thd->security_ctx->master_access & SUPER_ACL)
- return 0;
- else
- {
- my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "SUPER");
- return 1;
- }
-#else
- return 0;
-#endif
-}
-
-static uchar *get_warning_count(THD *thd)
-{
- thd->sys_var_tmp.long_value= thd->warning_info->warn_count();
- return (uchar*) &thd->sys_var_tmp.long_value;
-}
-
-static uchar *get_error_count(THD *thd)
-{
- thd->sys_var_tmp.long_value= thd->warning_info->error_count();
- return (uchar*) &thd->sys_var_tmp.long_value;
-}
-
-
-/**
- Get the tmpdir that was specified or chosen by default.
-
- This is necessary because if the user does not specify a temporary
- directory via the command line, one is chosen based on the environment
- or system defaults. But we can't just always use mysql_tmpdir, because
- that is actually a call to my_tmpdir() which cycles among possible
- temporary directories.
-
- @param thd thread handle
-
- @retval
- ptr pointer to NUL-terminated string
-*/
-static uchar *get_tmpdir(THD *thd)
-{
- if (opt_mysql_tmpdir)
- return (uchar *)opt_mysql_tmpdir;
- return (uchar*)mysql_tmpdir;
-}
-
-static uchar *get_myisam_mmap_size(THD *thd)
-{
- return (uchar *)&myisam_mmap_size;
-}
-
-
/****************************************************************************
Main handling of variables:
- Initialisation
@@ -3320,77 +347,31 @@ static uchar *get_myisam_mmap_size(THD *thd)
****************************************************************************/
/**
- Find variable name in option my_getopt structure used for
- command line args.
+ Add variables to the dynamic hash of system variables
- @param opt option structure array to search in
- @param name variable name
+ @param first Pointer to first system variable to add
@retval
- 0 Error
- @retval
- ptr pointer to option structure
-*/
-
-static struct my_option *find_option(struct my_option *opt, const char *name)
-{
- uint length=strlen(name);
- for (; opt->name; opt++)
- {
- if (!getopt_compare_strings(opt->name, name, length) &&
- !opt->name[length])
- {
- /*
- Only accept the option if one can set values through it.
- If not, there is no default value or limits in the option.
- */
- return (opt->value) ? opt : 0;
- }
- }
- return 0;
-}
-
-
-/**
- Return variable name and length for hashing of variables.
-*/
-
-static uchar *get_sys_var_length(const sys_var *var, size_t *length,
- my_bool first)
-{
- *length= var->name_length;
- return (uchar*) var->name;
-}
-
-
-/*
- Add variables to the dynamic hash of system variables
-
- SYNOPSIS
- mysql_add_sys_var_chain()
- first Pointer to first system variable to add
- long_opt (optional)command line arguments may be tied for limit checks.
-
- RETURN VALUES
0 SUCCESS
+ @retval
otherwise FAILURE
*/
-int mysql_add_sys_var_chain(sys_var *first, struct my_option *long_options)
+int mysql_add_sys_var_chain(sys_var *first)
{
sys_var *var;
-
+
/* A write lock should be held on LOCK_system_variables_hash */
-
+
for (var= first; var; var= var->next)
{
- var->name_length= strlen(var->name);
/* this fails if there is a conflicting variable name. see HASH_UNIQUE */
if (my_hash_insert(&system_variable_hash, (uchar*) var))
+ {
+ fprintf(stderr, "*** duplicate variable name '%s' ?\n", var->name.str);
goto error;
- if (long_options)
- var->option_limits= find_option(long_options, var->name);
+ }
}
return 0;
@@ -3399,53 +380,53 @@ error:
my_hash_delete(&system_variable_hash, (uchar*) first);
return 1;
}
-
-
+
+
/*
Remove variables to the dynamic hash of system variables
-
+
SYNOPSIS
mysql_del_sys_var_chain()
first Pointer to first system variable to remove
-
+
RETURN VALUES
0 SUCCESS
otherwise FAILURE
*/
-
+
int mysql_del_sys_var_chain(sys_var *first)
{
int result= 0;
-
+
/* A write lock should be held on LOCK_system_variables_hash */
-
+
for (sys_var *var= first; var; var= var->next)
result|= my_hash_delete(&system_variable_hash, (uchar*) var);
return result;
}
-
-
+
+
static int show_cmp(SHOW_VAR *a, SHOW_VAR *b)
{
return strcmp(a->name, b->name);
}
-
-
-/*
+
+
+/**
Constructs an array of system variables for display to the user.
-
- SYNOPSIS
- enumerate_sys_vars()
- thd current thread
- sorted If TRUE, the system variables should be sorted
-
- RETURN VALUES
+
+ @param thd current thread
+ @param sorted If TRUE, the system variables should be sorted
+ @param type OPT_GLOBAL or OPT_SESSION for SHOW GLOBAL|SESSION VARIABLES
+
+ @retval
pointer Array of SHOW_VAR elements for display
+ @retval
NULL FAILURE
*/
-SHOW_VAR* enumerate_sys_vars(THD *thd, bool sorted)
+SHOW_VAR* enumerate_sys_vars(THD *thd, bool sorted, enum enum_var_type type)
{
int count= system_variable_hash.records, i;
int size= sizeof(SHOW_VAR) * (count + 1);
@@ -3458,7 +439,12 @@ SHOW_VAR* enumerate_sys_vars(THD *thd, bool sorted)
for (i= 0; i < count; i++)
{
sys_var *var= (sys_var*) my_hash_element(&system_variable_hash, i);
- show->name= var->name;
+
+ // don't show session-only variables in SHOW GLOBAL VARIABLES
+ if (type == OPT_GLOBAL && var->check_type(type))
+ continue;
+
+ show->name= var->name.str;
show->value= (char*) var;
show->type= SHOW_SYS;
show++;
@@ -3466,79 +452,29 @@ SHOW_VAR* enumerate_sys_vars(THD *thd, bool sorted)
/* sort into order */
if (sorted)
- my_qsort(result, count, sizeof(SHOW_VAR),
+ my_qsort(result, show-result, sizeof(SHOW_VAR),
(qsort_cmp) show_cmp);
-
+
/* make last element empty */
bzero(show, sizeof(SHOW_VAR));
}
return result;
}
-
-/*
- Initialize the system variables
-
- SYNOPSIS
- set_var_init()
-
- RETURN VALUES
- 0 SUCCESS
- otherwise FAILURE
-*/
-
-int set_var_init()
-{
- uint count= 0;
- DBUG_ENTER("set_var_init");
-
- for (sys_var *var=vars.first; var; var= var->next, count++) ;
-
- if (my_hash_init(&system_variable_hash, system_charset_info, count, 0,
- 0, (my_hash_get_key) get_sys_var_length, 0, HASH_UNIQUE))
- goto error;
-
- vars.last->next= NULL;
- if (mysql_add_sys_var_chain(vars.first, my_long_options))
- goto error;
-
- /*
- Special cases
- Needed because MySQL can't find the limits for a variable it it has
- a different name than the command line option.
- As these variables are deprecated, this code will disappear soon...
- */
- sys_sql_max_join_size.option_limits= sys_max_join_size.option_limits;
-
- DBUG_RETURN(0);
-
-error:
- fprintf(stderr, "failed to initialize system variables");
- DBUG_RETURN(1);
-}
-
-
-void set_var_free()
-{
- my_hash_free(&system_variable_hash);
-}
-
-
/**
Find a user set-table variable.
- @param str Name of system variable to find
+ @param str Name of system variable to find
@param length Length of variable. zero means that we should use strlen()
on the variable
- @param no_error Refuse to emit an error, even if one occurred.
@retval
- pointer pointer to variable definitions
+ pointer pointer to variable definitions
@retval
- 0 Unknown variable (error message is given)
+ 0 Unknown variable (error message is given)
*/
-sys_var *intern_find_sys_var(const char *str, uint length, bool no_error)
+sys_var *intern_find_sys_var(const char *str, uint length)
{
sys_var *var;
@@ -3547,10 +483,7 @@ sys_var *intern_find_sys_var(const char *str, uint length, bool no_error)
A lock on LOCK_system_variable_hash should be held
*/
var= (sys_var*) my_hash_search(&system_variable_hash,
- (uchar*) str, length ? length : strlen(str));
- if (!(var || no_error))
- my_error(ER_UNKNOWN_SYSTEM_VARIABLE, MYF(0), (char*) str);
-
+ (uchar*) str, length ? length : strlen(str));
return var;
}
@@ -3564,13 +497,13 @@ sys_var *intern_find_sys_var(const char *str, uint length, bool no_error)
This should ensure that in all normal cases none all or variables are
updated.
- @param THD Thread id
+ @param THD Thread id
@param var_list List of variables to update
@retval
- 0 ok
+ 0 ok
@retval
- 1 ERROR, message sent (normally no variables was updated)
+ 1 ERROR, message sent (normally no variables was updated)
@retval
-1 ERROR, message not sent
*/
@@ -3599,36 +532,6 @@ err:
DBUG_RETURN(error);
}
-
-/**
- Say if all variables set by a SET support the ONE_SHOT keyword
- (currently, only character set and collation do; later timezones
- will).
-
- @param var_list List of variables to update
-
- @note
- It has a "not_" because it makes faster tests (no need to "!")
-
- @retval
- 0 all variables of the list support ONE_SHOT
- @retval
- 1 at least one does not support ONE_SHOT
-*/
-
-bool not_all_support_one_shot(List<set_var_base> *var_list)
-{
- List_iterator_fast<set_var_base> it(*var_list);
- set_var_base *var;
- while ((var= it++))
- {
- if (var->no_support_one_shot())
- return 1;
- }
- return 0;
-}
-
-
/*****************************************************************************
Functions to handle SET mysql_internal_variable=const_expr
*****************************************************************************/
@@ -3639,42 +542,35 @@ bool not_all_support_one_shot(List<set_var_base> *var_list)
@param thd Thread handler
@return status code
- @retval -1 Failure
- @retval 0 Success
-*/
+ @retval -1 Failure
+ @retval 0 Success
+ */
int set_var::check(THD *thd)
{
if (var->is_readonly())
{
- my_error(ER_INCORRECT_GLOBAL_LOCAL_VAR, MYF(0), var->name, "read only");
+ my_error(ER_INCORRECT_GLOBAL_LOCAL_VAR, MYF(0), var->name.str, "read only");
return -1;
}
if (var->check_type(type))
{
int err= type == OPT_GLOBAL ? ER_LOCAL_VARIABLE : ER_GLOBAL_VARIABLE;
- my_error(err, MYF(0), var->name);
+ my_error(err, MYF(0), var->name.str);
return -1;
}
if ((type == OPT_GLOBAL && check_global_access(thd, SUPER_ACL)))
return 1;
/* value is a NULL pointer if we are using SET ... = DEFAULT */
if (!value)
- {
- if (var->check_default(type))
- {
- my_error(ER_NO_DEFAULT, MYF(0), var->name);
- return -1;
- }
return 0;
- }
if ((!value->fixed &&
value->fix_fields(thd, &value)) || value->check_cols(1))
return -1;
if (var->check_update_type(value->result_type()))
{
- my_error(ER_WRONG_TYPE_FOR_VAR, MYF(0), var->name);
+ my_error(ER_WRONG_TYPE_FOR_VAR, MYF(0), var->name.str);
return -1;
}
return var->check(thd, this) ? -1 : 0;
@@ -3684,12 +580,12 @@ int set_var::check(THD *thd)
/**
Check variable, but without assigning value (used by PS).
- @param thd thread handler
+ @param thd thread handler
@retval
- 0 ok
+ 0 ok
@retval
- 1 ERROR, message sent (normally no variables was updated)
+ 1 ERROR, message sent (normally no variables was updated)
@retval
-1 ERROR, message not sent
*/
@@ -3714,7 +610,7 @@ int set_var::light_check(THD *thd)
Update variable
@param thd thread handler
- @returns 0|1 ok or ERROR
+ @returns 0|1 ok or ERROR
@note ERROR can be only due to abnormal operations involving
the server's execution evironment such as
@@ -3724,13 +620,7 @@ int set_var::light_check(THD *thd)
*/
int set_var::update(THD *thd)
{
- if (!value)
- var->set_default(thd, type);
- else if (var->update(thd, this))
- return -1; // should never happen
- if (var->after_update)
- (*var->after_update)(thd, type);
- return 0;
+ return value ? var->update(thd, this) : var->set_default(thd, type);
}
@@ -3745,19 +635,19 @@ int set_var_user::check(THD *thd)
0 can be passed as last argument (reference on item)
*/
return (user_var_item->fix_fields(thd, (Item**) 0) ||
- user_var_item->check(0)) ? -1 : 0;
+ user_var_item->check(0)) ? -1 : 0;
}
/**
Check variable, but without assigning value (used by PS).
- @param thd thread handler
+ @param thd thread handler
@retval
- 0 ok
+ 0 ok
@retval
- 1 ERROR, message sent (normally no variables was updated)
+ 1 ERROR, message sent (normally no variables was updated)
@retval
-1 ERROR, message not sent
*/
@@ -3823,583 +713,36 @@ int set_var_password::update(THD *thd)
#ifndef NO_EMBEDDED_ACCESS_CHECKS
/* Returns 1 as the function sends error to client */
return change_password(thd, user->host.str, user->user.str, password) ?
- 1 : 0;
+ 1 : 0;
#else
return 0;
#endif
}
-/****************************************************************************
- Functions to handle table_type
-****************************************************************************/
-
-/* Based upon sys_var::check_enum() */
-
-bool sys_var_thd_storage_engine::check(THD *thd, set_var *var)
-{
- char buff[STRING_BUFFER_USUAL_SIZE];
- const char *value;
- String str(buff, sizeof(buff), &my_charset_latin1), *res;
-
- var->save_result.plugin= NULL;
- if (var->value->result_type() == STRING_RESULT)
- {
- LEX_STRING engine_name;
- handlerton *hton;
- if (!(res=var->value->val_str(&str)) ||
- !(engine_name.str= (char *)res->ptr()) ||
- !(engine_name.length= res->length()) ||
- !(var->save_result.plugin= ha_resolve_by_name(thd, &engine_name)) ||
- !(hton= plugin_data(var->save_result.plugin, handlerton *)) ||
- ha_checktype(thd, ha_legacy_type(hton), 1, 0) != hton)
- {
- value= res ? res->c_ptr() : "NULL";
- goto err;
- }
- return 0;
- }
- value= "unknown";
-
-err:
- my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), value);
- return 1;
-}
-
-
-uchar *sys_var_thd_storage_engine::value_ptr(THD *thd, enum_var_type type,
- LEX_STRING *base)
-{
- uchar* result;
- handlerton *hton;
- LEX_STRING *engine_name;
- plugin_ref plugin= thd->variables.*offset;
- if (type == OPT_GLOBAL)
- plugin= my_plugin_lock(thd, &(global_system_variables.*offset));
- hton= plugin_data(plugin, handlerton*);
- engine_name= &hton2plugin[hton->slot]->name;
- result= (uchar *) thd->strmake(engine_name->str, engine_name->length);
- if (type == OPT_GLOBAL)
- plugin_unlock(thd, plugin);
- return result;
-}
-
-
-void sys_var_thd_storage_engine::set_default(THD *thd, enum_var_type type)
-{
- plugin_ref old_value, new_value, *value;
- if (type == OPT_GLOBAL)
- {
- value= &(global_system_variables.*offset);
- new_value= ha_lock_engine(NULL, myisam_hton);
- }
- else
- {
- value= &(thd->variables.*offset);
- new_value= my_plugin_lock(NULL, &(global_system_variables.*offset));
- }
- DBUG_ASSERT(new_value);
- old_value= *value;
- *value= new_value;
- plugin_unlock(NULL, old_value);
-}
-
-
-bool sys_var_thd_storage_engine::update(THD *thd, set_var *var)
-{
- plugin_ref *value= &(global_system_variables.*offset), old_value;
- if (var->type != OPT_GLOBAL)
- value= &(thd->variables.*offset);
- old_value= *value;
- if (old_value != var->save_result.plugin)
- {
- *value= my_plugin_lock(NULL, &var->save_result.plugin);
- plugin_unlock(NULL, old_value);
- }
- return 0;
-}
-
-/****************************************************************************
- Functions to handle sql_mode
-****************************************************************************/
-
-/**
- Make string representation of mode.
-
- @param[in] thd thread handler
- @param[in] val sql_mode value
- @param[out] len pointer on length of string
-
- @return
- pointer to string with sql_mode representation
-*/
-
-bool
-sys_var_thd_sql_mode::
-symbolic_mode_representation(THD *thd, ulonglong val, LEX_STRING *rep)
-{
- char buff[STRING_BUFFER_USUAL_SIZE*8];
- String tmp(buff, sizeof(buff), &my_charset_latin1);
-
- tmp.length(0);
-
- for (uint i= 0; val; val>>= 1, i++)
- {
- if (val & 1)
- {
- tmp.append(sql_mode_typelib.type_names[i],
- sql_mode_typelib.type_lengths[i]);
- tmp.append(',');
- }
- }
-
- if (tmp.length())
- tmp.length(tmp.length() - 1); /* trim the trailing comma */
-
- rep->str= thd->strmake(tmp.ptr(), tmp.length());
-
- rep->length= rep->str ? tmp.length() : 0;
-
- return rep->length != tmp.length();
-}
-
-
-uchar *sys_var_thd_sql_mode::value_ptr(THD *thd, enum_var_type type,
- LEX_STRING *base)
-{
- LEX_STRING sql_mode;
- ulonglong val= ((type == OPT_GLOBAL) ? global_system_variables.*offset :
- thd->variables.*offset);
- (void) symbolic_mode_representation(thd, val, &sql_mode);
- return (uchar *) sql_mode.str;
-}
-
-
-void sys_var_thd_sql_mode::set_default(THD *thd, enum_var_type type)
-{
- if (type == OPT_GLOBAL)
- global_system_variables.*offset= 0;
- else
- thd->variables.*offset= global_system_variables.*offset;
-}
-
-
-void fix_sql_mode_var(THD *thd, enum_var_type type)
-{
- if (type == OPT_GLOBAL)
- global_system_variables.sql_mode=
- fix_sql_mode(global_system_variables.sql_mode);
- else
- {
- thd->variables.sql_mode= fix_sql_mode(thd->variables.sql_mode);
- /*
- Update thd->server_status
- */
- if (thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES)
- thd->server_status|= SERVER_STATUS_NO_BACKSLASH_ESCAPES;
- else
- thd->server_status&= ~SERVER_STATUS_NO_BACKSLASH_ESCAPES;
- }
-}
-
-/** Map database specific bits to function bits. */
-
-ulong fix_sql_mode(ulong sql_mode)
-{
- /*
- Note that we dont set
- MODE_NO_KEY_OPTIONS | MODE_NO_TABLE_OPTIONS | MODE_NO_FIELD_OPTIONS
- to allow one to get full use of MySQL in this mode.
- */
-
- if (sql_mode & MODE_ANSI)
- {
- sql_mode|= (MODE_REAL_AS_FLOAT | MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES |
- MODE_IGNORE_SPACE);
- /*
- MODE_ONLY_FULL_GROUP_BY removed from ANSI mode because it is currently
- overly restrictive (see BUG#8510).
- */
- }
- if (sql_mode & MODE_ORACLE)
- sql_mode|= (MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES |
- MODE_IGNORE_SPACE |
- MODE_NO_KEY_OPTIONS | MODE_NO_TABLE_OPTIONS |
- MODE_NO_FIELD_OPTIONS | MODE_NO_AUTO_CREATE_USER);
- if (sql_mode & MODE_MSSQL)
- sql_mode|= (MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES |
- MODE_IGNORE_SPACE |
- MODE_NO_KEY_OPTIONS | MODE_NO_TABLE_OPTIONS |
- MODE_NO_FIELD_OPTIONS);
- if (sql_mode & MODE_POSTGRESQL)
- sql_mode|= (MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES |
- MODE_IGNORE_SPACE |
- MODE_NO_KEY_OPTIONS | MODE_NO_TABLE_OPTIONS |
- MODE_NO_FIELD_OPTIONS);
- if (sql_mode & MODE_DB2)
- sql_mode|= (MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES |
- MODE_IGNORE_SPACE |
- MODE_NO_KEY_OPTIONS | MODE_NO_TABLE_OPTIONS |
- MODE_NO_FIELD_OPTIONS);
- if (sql_mode & MODE_MAXDB)
- sql_mode|= (MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES |
- MODE_IGNORE_SPACE |
- MODE_NO_KEY_OPTIONS | MODE_NO_TABLE_OPTIONS |
- MODE_NO_FIELD_OPTIONS | MODE_NO_AUTO_CREATE_USER);
- if (sql_mode & MODE_MYSQL40)
- sql_mode|= MODE_HIGH_NOT_PRECEDENCE;
- if (sql_mode & MODE_MYSQL323)
- sql_mode|= MODE_HIGH_NOT_PRECEDENCE;
- if (sql_mode & MODE_TRADITIONAL)
- sql_mode|= (MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES |
- MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE |
- MODE_ERROR_FOR_DIVISION_BY_ZERO | MODE_NO_AUTO_CREATE_USER |
- MODE_NO_ENGINE_SUBSTITUTION);
- return sql_mode;
-}
-
-
-bool
-sys_var_thd_optimizer_switch::
-symbolic_mode_representation(THD *thd, ulonglong val, LEX_STRING *rep)
-{
- char buff[STRING_BUFFER_USUAL_SIZE*8];
- String tmp(buff, sizeof(buff), &my_charset_latin1);
- int i;
- ulonglong bit;
- tmp.length(0);
-
- for (i= 0, bit=1; bit != OPTIMIZER_SWITCH_LAST; i++, bit= bit << 1)
- {
- tmp.append(optimizer_switch_typelib.type_names[i],
- optimizer_switch_typelib.type_lengths[i]);
- tmp.append('=');
- tmp.append((val & bit)? "on":"off");
- tmp.append(',');
- }
-
- if (tmp.length())
- tmp.length(tmp.length() - 1); /* trim the trailing comma */
-
- rep->str= thd->strmake(tmp.ptr(), tmp.length());
-
- rep->length= rep->str ? tmp.length() : 0;
-
- return rep->length != tmp.length();
-}
-
-
-uchar *sys_var_thd_optimizer_switch::value_ptr(THD *thd, enum_var_type type,
- LEX_STRING *base)
-{
- LEX_STRING opts;
- ulonglong val= ((type == OPT_GLOBAL) ? global_system_variables.*offset :
- thd->variables.*offset);
- (void) symbolic_mode_representation(thd, val, &opts);
- return (uchar *) opts.str;
-}
-
-
-/*
- Check (and actually parse) string representation of @@optimizer_switch.
-*/
-
-bool sys_var_thd_optimizer_switch::check(THD *thd, set_var *var)
-{
- bool not_used;
- char buff[STRING_BUFFER_USUAL_SIZE], *error= 0;
- uint error_len= 0;
- String str(buff, sizeof(buff), system_charset_info), *res;
-
- if (!(res= var->value->val_str(&str)))
- {
- strmov(buff, "NULL");
- goto err;
- }
-
- if (res->length() == 0)
- {
- buff[0]= 0;
- goto err;
- }
-
- var->save_result.ulong_value=
- (ulong)find_set_from_flags(&optimizer_switch_typelib,
- optimizer_switch_typelib.count,
- thd->variables.optimizer_switch,
- global_system_variables.optimizer_switch,
- res->c_ptr_safe(), res->length(), NULL,
- &error, &error_len, &not_used);
- if (error_len)
- {
- ErrConvString err(error, error_len, res->charset());
- my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, err.ptr());
- return TRUE;
- }
- return FALSE;
-err:
- my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, buff);
- return TRUE;
-}
-
-
-void sys_var_thd_optimizer_switch::set_default(THD *thd, enum_var_type type)
-{
- if (type == OPT_GLOBAL)
- global_system_variables.*offset= OPTIMIZER_SWITCH_DEFAULT;
- else
- thd->variables.*offset= global_system_variables.*offset;
-}
-
-/****************************************************************************
- Named list handling
-****************************************************************************/
-
-uchar* find_named(I_List<NAMED_LIST> *list, const char *name, uint length,
- NAMED_LIST **found)
-{
- I_List_iterator<NAMED_LIST> it(*list);
- NAMED_LIST *element;
- while ((element= it++))
- {
- if (element->cmp(name, length))
- {
- if (found)
- *found= element;
- return element->data;
- }
- }
- return 0;
-}
-
-
-void delete_elements(I_List<NAMED_LIST> *list,
- void (*free_element)(const char *name, uchar*))
-{
- NAMED_LIST *element;
- DBUG_ENTER("delete_elements");
- while ((element= list->get()))
- {
- (*free_element)(element->name, element->data);
- delete element;
- }
- DBUG_VOID_RETURN;
-}
-
-
-/* Key cache functions */
-
-static KEY_CACHE *create_key_cache(const char *name, uint length)
-{
- KEY_CACHE *key_cache;
- DBUG_ENTER("create_key_cache");
- DBUG_PRINT("enter",("name: %.*s", length, name));
-
- if ((key_cache= (KEY_CACHE*) my_malloc(sizeof(KEY_CACHE),
- MYF(MY_ZEROFILL | MY_WME))))
- {
- if (!new NAMED_LIST(&key_caches, name, length, (uchar*) key_cache))
- {
- my_free((char*) key_cache, MYF(0));
- key_cache= 0;
- }
- else
- {
- /*
- Set default values for a key cache
- The values in dflt_key_cache_var is set by my_getopt() at startup
-
- We don't set 'buff_size' as this is used to enable the key cache
- */
- key_cache->param_block_size= dflt_key_cache_var.param_block_size;
- key_cache->param_division_limit= dflt_key_cache_var.param_division_limit;
- key_cache->param_age_threshold= dflt_key_cache_var.param_age_threshold;
- }
- }
- DBUG_RETURN(key_cache);
-}
-
-
-KEY_CACHE *get_or_create_key_cache(const char *name, uint length)
-{
- LEX_STRING key_cache_name;
- KEY_CACHE *key_cache;
-
- key_cache_name.str= (char *) name;
- key_cache_name.length= length;
- pthread_mutex_lock(&LOCK_global_system_variables);
- if (!(key_cache= get_key_cache(&key_cache_name)))
- key_cache= create_key_cache(name, length);
- pthread_mutex_unlock(&LOCK_global_system_variables);
- return key_cache;
-}
-
-
-void free_key_cache(const char *name, KEY_CACHE *key_cache)
-{
- ha_end_key_cache(key_cache);
- my_free((char*) key_cache, MYF(0));
-}
-
+/*****************************************************************************
+ Functions to handle SET NAMES and SET CHARACTER SET
+*****************************************************************************/
-bool process_key_caches(process_key_cache_t func)
+int set_var_collation_client::check(THD *thd)
{
- I_List_iterator<NAMED_LIST> it(key_caches);
- NAMED_LIST *element;
-
- while ((element= it++))
+ /* Currently, UCS-2 cannot be used as a client character set */
+ if (character_set_client->mbminlen > 1)
{
- KEY_CACHE *key_cache= (KEY_CACHE *) element->data;
- func(element->name, key_cache);
+ my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), "character_set_client",
+ character_set_client->csname);
+ return 1;
}
return 0;
}
-bool sys_var_opt_readonly::update(THD *thd, set_var *var)
-{
- bool result;
-
- DBUG_ENTER("sys_var_opt_readonly::update");
-
- /* Prevent self dead-lock */
- if (thd->locked_tables || thd->active_transaction())
- {
- my_error(ER_LOCK_OR_ACTIVE_TRANSACTION, MYF(0));
- DBUG_RETURN(true);
- }
-
- if (thd->global_read_lock)
- {
- /*
- This connection already holds the global read lock.
- This can be the case with:
- - FLUSH TABLES WITH READ LOCK
- - SET GLOBAL READ_ONLY = 1
- */
- result= sys_var_bool_ptr::update(thd, var);
- DBUG_RETURN(result);
- }
-
- /*
- Perform a 'FLUSH TABLES WITH READ LOCK'.
- This is a 3 step process:
- - [1] lock_global_read_lock()
- - [2] close_cached_tables()
- - [3] make_global_read_lock_block_commit()
- [1] prevents new connections from obtaining tables locked for write.
- [2] waits until all existing connections close their tables.
- [3] prevents transactions from being committed.
- */
-
- if (lock_global_read_lock(thd))
- DBUG_RETURN(true);
-
- /*
- This call will be blocked by any connection holding a READ or WRITE lock.
- Ideally, we want to wait only for pending WRITE locks, but since:
- con 1> LOCK TABLE T FOR READ;
- con 2> LOCK TABLE T FOR WRITE; (blocked by con 1)
- con 3> SET GLOBAL READ ONLY=1; (blocked by con 2)
- can cause to wait on a read lock, it's required for the client application
- to unlock everything, and acceptable for the server to wait on all locks.
- */
- if ((result= close_cached_tables(thd, NULL, FALSE, TRUE, TRUE)))
- goto end_with_read_lock;
-
- if ((result= make_global_read_lock_block_commit(thd)))
- goto end_with_read_lock;
-
- /* Change the opt_readonly system variable, safe because the lock is held */
- result= sys_var_bool_ptr::update(thd, var);
-
-end_with_read_lock:
- /* Release the lock */
- unlock_global_read_lock(thd);
- DBUG_RETURN(result);
-}
-
-
-#ifndef DBUG_OFF
-/* even session variable here requires SUPER, because of -#o,file */
-bool sys_var_thd_dbug::check(THD *thd, set_var *var)
-{
- return check_global_access(thd, SUPER_ACL);
-}
-
-bool sys_var_thd_dbug::update(THD *thd, set_var *var)
+int set_var_collation_client::update(THD *thd)
{
- if (var->type == OPT_GLOBAL)
- DBUG_SET_INITIAL(var ? var->value->str_value.c_ptr() : "");
- else
- DBUG_SET(var ? var->value->str_value.c_ptr() : "");
-
+ thd->variables.character_set_client= character_set_client;
+ thd->variables.character_set_results= character_set_results;
+ thd->variables.collation_connection= collation_connection;
+ thd->update_charset();
+ thd->protocol_text.init(thd);
+ thd->protocol_binary.init(thd);
return 0;
}
-
-uchar *sys_var_thd_dbug::value_ptr(THD *thd, enum_var_type type, LEX_STRING *b)
-{
- char buf[256];
- if (type == OPT_GLOBAL)
- DBUG_EXPLAIN_INITIAL(buf, sizeof(buf));
- else
- DBUG_EXPLAIN(buf, sizeof(buf));
- return (uchar*) thd->strdup(buf);
-}
-#endif /* DBUG_OFF */
-
-
-#ifdef HAVE_EVENT_SCHEDULER
-bool sys_var_event_scheduler::check(THD *thd, set_var *var)
-{
- return check_enum(thd, var, &Events::var_typelib);
-}
-
-/*
- The update method of the global variable event_scheduler.
- If event_scheduler is switched from 0 to 1 then the scheduler main
- thread is resumed and if from 1 to 0 the scheduler thread is suspended
-
- SYNOPSIS
- sys_var_event_scheduler::update()
- thd Thread context (unused)
- var The new value
-
- Returns
- FALSE OK
- TRUE Error
-*/
-
-bool
-sys_var_event_scheduler::update(THD *thd, set_var *var)
-{
- int res;
- /* here start the thread if not running. */
- DBUG_ENTER("sys_var_event_scheduler::update");
- DBUG_PRINT("info", ("new_value: %d", (int) var->save_result.ulong_value));
-
- enum Events::enum_opt_event_scheduler
- new_state=
- (enum Events::enum_opt_event_scheduler) var->save_result.ulong_value;
-
- res= Events::switch_event_scheduler_state(new_state);
-
- DBUG_RETURN((bool) res);
-}
-
-
-uchar *sys_var_event_scheduler::value_ptr(THD *thd, enum_var_type type,
- LEX_STRING *base)
-{
- return (uchar *) Events::get_opt_event_scheduler_str();
-}
-#endif
-
-/****************************************************************************
- Used templates
-****************************************************************************/
-
-#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
-template class List<set_var_base>;
-template class List_iterator_fast<set_var_base>;
-template class I_List_iterator<NAMED_LIST>;
-#endif
diff --git a/sql/set_var.h b/sql/set_var.h
index 120388415f5..d878e85cec0 100644
--- a/sql/set_var.h
+++ b/sql/set_var.h
@@ -1,7 +1,6 @@
#ifndef SET_VAR_INCLUDED
#define SET_VAR_INCLUDED
-
-/* Copyright (C) 2002-2006 MySQL AB
+/* Copyright 2000-2008 MySQL AB, 2009 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -16,31 +15,23 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-/* Classes to support the SET command */
+/**
+ @file
+ "public" interface to sys_var - server configuration variables.
+*/
#ifdef USE_PRAGMA_INTERFACE
-#pragma interface /* gcc class implementation */
+#pragma interface /* gcc class implementation */
#endif
-/****************************************************************************
- Variables that are changable runtime are declared using the
- following classes
-****************************************************************************/
+#include <my_getopt.h>
class sys_var;
class set_var;
-class sys_var_pluginvar; /* opaque */
-typedef struct system_variables SV;
-typedef struct my_locale_st MY_LOCALE;
+class sys_var_pluginvar;
+class PolyLock;
-extern TYPELIB bool_typelib, delay_key_write_typelib, sql_mode_typelib,
- optimizer_switch_typelib, slave_exec_mode_typelib;
-
-typedef int (*sys_check_func)(THD *, set_var *);
-typedef bool (*sys_update_func)(THD *, set_var *);
-typedef void (*sys_after_update_func)(THD *,enum_var_type);
-typedef void (*sys_set_default_func)(THD *, enum_var_type);
-typedef uchar *(*sys_value_ptr_func)(THD *thd);
+extern TYPELIB bool_typelib;
struct sys_var_chain
{
@@ -48,1297 +39,165 @@ struct sys_var_chain
sys_var *last;
};
+int mysql_add_sys_var_chain(sys_var *chain);
+int mysql_del_sys_var_chain(sys_var *chain);
+
+/**
+ A class representing one system variable - that is something
+ that can be accessed as @@global.variable_name or @@session.variable_name,
+ visible in SHOW xxx VARIABLES and in INFORMATION_SCHEMA.xxx_VARIABLES,
+ optionally it can be assigned to, optionally it can have a command-line
+ counterpart with the same name.
+*/
class sys_var
{
public:
+ sys_var *next;
+ LEX_CSTRING name;
+ enum flag_enum { GLOBAL, SESSION, ONLY_SESSION, SCOPE_MASK=1023,
+ READONLY=1024, ALLOCATED=2048 };
+ /**
+ Enumeration type to indicate for a system variable whether
+ it will be written to the binlog or not.
+ */
+ enum binlog_status_enum { VARIABLE_NOT_IN_BINLOG,
+ SESSION_VARIABLE_IN_BINLOG } binlog_status;
+protected:
+ typedef bool (*on_check_function)(sys_var *self, THD *thd, set_var *var);
+ typedef bool (*on_update_function)(sys_var *self, THD *thd, enum_var_type type);
+
+ int flags; ///< or'ed flag_enum values
+ const SHOW_TYPE show_val_type; ///< what value_ptr() returns for sql_show.cc
+ my_option option; ///< min, max, default values are stored here
+ PolyLock *guard; ///< *second* lock that protects the variable
+ ptrdiff_t offset; ///< offset to the value from global_system_variables
+ on_check_function on_check;
+ on_update_function on_update;
+ struct { uint version; const char *substitute; } deprecated;
+ bool is_os_charset; ///< true if the value is in character_set_filesystem
+
+public:
+ sys_var(sys_var_chain *chain, const char *name_arg, const char *comment,
+ int flag_args, ptrdiff_t off, int getopt_id,
+ enum get_opt_arg_type getopt_arg_type, SHOW_TYPE show_val_type_arg,
+ longlong def_val, PolyLock *lock, enum binlog_status_enum binlog_status_arg,
+ on_check_function on_check_func, on_update_function on_update_func,
+ uint deprecated_version, const char *substitute);
/**
- Enumeration type to indicate for a system variable whether it will be written to the binlog or not.
+ The instance should only be destroyed on shutdown, as it doesn't unlink
+ itself from the chain.
*/
- enum Binlog_status_enum
- {
- /* The variable value is not in the binlog. */
- NOT_IN_BINLOG,
- /* The value of the @@session variable is in the binlog. */
- SESSION_VARIABLE_IN_BINLOG
- /*
- Currently, no @@global variable is ever in the binlog, so we
- don't need an enumeration value for that.
- */
- };
-
- sys_var *next;
- struct my_option *option_limits; /* Updated by by set_var_init() */
- uint name_length; /* Updated by by set_var_init() */
- const char *name;
-
- sys_after_update_func after_update;
- bool no_support_one_shot;
- /*
- true if the value is in character_set_filesystem,
- false otherwise.
- Note that we can't use a pointer to the charset as the system var is
- instantiated in global scope and the charset pointers are initialized
- later.
- */
- bool is_os_charset;
- sys_var(const char *name_arg, sys_after_update_func func= NULL,
- Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG)
- :name(name_arg), after_update(func), no_support_one_shot(1),
- is_os_charset (FALSE),
- binlog_status(binlog_status_arg),
- m_allow_empty_value(TRUE)
- {}
virtual ~sys_var() {}
- void chain_sys_var(sys_var_chain *chain_arg)
- {
- if (chain_arg->last)
- chain_arg->last->next= this;
- else
- chain_arg->first= this;
- chain_arg->last= this;
- }
- virtual bool check(THD *thd, set_var *var);
- bool check_enum(THD *thd, set_var *var, const TYPELIB *enum_names);
- bool check_set(THD *thd, set_var *var, TYPELIB *enum_names);
- bool is_written_to_binlog(enum_var_type type)
- {
- return (type == OPT_SESSION || type == OPT_DEFAULT) &&
- (binlog_status == SESSION_VARIABLE_IN_BINLOG);
- }
- virtual bool update(THD *thd, set_var *var)=0;
- virtual void set_default(THD *thd_arg, enum_var_type type) {}
- virtual SHOW_TYPE show_type() { return SHOW_UNDEF; }
- virtual uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
- { return 0; }
- virtual bool check_type(enum_var_type type)
- { return type != OPT_GLOBAL; } /* Error if not GLOBAL */
- virtual bool check_update_type(Item_result type)
- { return type != INT_RESULT; } /* Assume INT */
- virtual bool check_default(enum_var_type type)
- { return option_limits == 0; }
- virtual bool is_struct() { return 0; }
- virtual bool is_readonly() const { return 0; }
- CHARSET_INFO *charset(THD *thd);
+ /**
+ downcast for sys_var_pluginvar. Returns this if it's an instance
+ of sys_var_pluginvar, and 0 otherwise.
+ */
virtual sys_var_pluginvar *cast_pluginvar() { return 0; }
-protected:
- void set_allow_empty_value(bool allow_empty_value)
- {
- m_allow_empty_value= allow_empty_value;
- }
-
-private:
- const Binlog_status_enum binlog_status;
-
- bool m_allow_empty_value;
-};
-
-
-/*
- A base class for all variables that require its access to
- be guarded with a mutex.
-*/
-
-class sys_var_global: public sys_var
-{
-protected:
- pthread_mutex_t *guard;
-public:
- sys_var_global(const char *name_arg, sys_after_update_func after_update_arg,
- pthread_mutex_t *guard_arg)
- :sys_var(name_arg, after_update_arg), guard(guard_arg) {}
-};
-
-
-/*
- A global-only ulong variable that requires its access to be
- protected with a mutex.
-*/
-
-class sys_var_long_ptr_global: public sys_var_global
-{
-public:
- ulong *value;
- sys_var_long_ptr_global(sys_var_chain *chain, const char *name_arg,
- ulong *value_ptr_arg,
- pthread_mutex_t *guard_arg,
- sys_after_update_func after_update_arg= NULL)
- :sys_var_global(name_arg, after_update_arg, guard_arg),
- value(value_ptr_arg)
- { chain_sys_var(chain); }
bool check(THD *thd, set_var *var);
- bool update(THD *thd, set_var *var);
- void set_default(THD *thd, enum_var_type type);
- SHOW_TYPE show_type() { return SHOW_LONG; }
- uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
- { return (uchar*) value; }
-};
-
-/**
- Unsigned int system variable class
- */
-class sys_var_uint_ptr :public sys_var
-{
-public:
- sys_var_uint_ptr(sys_var_chain *chain, const char *name_arg,
- uint *value_ptr_arg,
- sys_after_update_func after_update_arg= NULL)
- :sys_var(name_arg, after_update_arg),
- value(value_ptr_arg)
- { chain_sys_var(chain); }
- bool check(THD *thd, set_var *var);
- bool update(THD *thd, set_var *var);
- void set_default(THD *thd, enum_var_type type);
- SHOW_TYPE show_type() { return SHOW_INT; }
- uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
- { return (uchar*) value; }
-private:
- uint *value;
-};
-
-/*
- A global ulong variable that is protected by LOCK_global_system_variables
-*/
-
-class sys_var_long_ptr :public sys_var_long_ptr_global
-{
-public:
- sys_var_long_ptr(sys_var_chain *chain, const char *name_arg, ulong *value_ptr,
- sys_after_update_func after_update_arg= NULL);
-};
-
-
-class sys_var_ulonglong_ptr :public sys_var
-{
-public:
- ulonglong *value;
- sys_var_ulonglong_ptr(sys_var_chain *chain, const char *name_arg, ulonglong *value_ptr_arg)
- :sys_var(name_arg),value(value_ptr_arg)
- { chain_sys_var(chain); }
- sys_var_ulonglong_ptr(sys_var_chain *chain, const char *name_arg, ulonglong *value_ptr_arg,
- sys_after_update_func func)
- :sys_var(name_arg,func), value(value_ptr_arg)
- { chain_sys_var(chain); }
- bool update(THD *thd, set_var *var);
- void set_default(THD *thd, enum_var_type type);
- SHOW_TYPE show_type() { return SHOW_LONGLONG; }
- uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
- { return (uchar*) value; }
-};
-
-
-class sys_var_bool_ptr :public sys_var
-{
-public:
- my_bool *value;
- sys_var_bool_ptr(sys_var_chain *chain, const char *name_arg, my_bool *value_arg)
- :sys_var(name_arg),value(value_arg)
- { chain_sys_var(chain); }
- bool check(THD *thd, set_var *var)
- {
- return check_enum(thd, var, &bool_typelib);
- }
- bool update(THD *thd, set_var *var);
- void set_default(THD *thd, enum_var_type type);
- SHOW_TYPE show_type() { return SHOW_MY_BOOL; }
- uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
- { return (uchar*) value; }
- bool check_update_type(Item_result type) { return 0; }
-};
-
-
-class sys_var_bool_ptr_readonly :public sys_var_bool_ptr
-{
-public:
- sys_var_bool_ptr_readonly(sys_var_chain *chain, const char *name_arg,
- my_bool *value_arg)
- :sys_var_bool_ptr(chain, name_arg, value_arg)
- {}
- bool is_readonly() const { return 1; }
-};
-
-
-class sys_var_str :public sys_var
-{
-public:
- char *value; // Pointer to allocated string
- uint value_length;
- sys_check_func check_func;
- sys_update_func update_func;
- sys_set_default_func set_default_func;
- sys_var_str(sys_var_chain *chain, const char *name_arg,
- sys_check_func check_func_arg,
- sys_update_func update_func_arg,
- sys_set_default_func set_default_func_arg,
- char *value_arg)
- :sys_var(name_arg), value(value_arg), check_func(check_func_arg),
- update_func(update_func_arg),set_default_func(set_default_func_arg)
- { chain_sys_var(chain); }
- bool check(THD *thd, set_var *var);
- bool update(THD *thd, set_var *var)
- {
- return (*update_func)(thd, var);
- }
- void set_default(THD *thd, enum_var_type type)
- {
- (*set_default_func)(thd, type);
- }
- SHOW_TYPE show_type() { return SHOW_CHAR; }
- uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
- { return (uchar*) value; }
- bool check_update_type(Item_result type)
- {
- return type != STRING_RESULT; /* Only accept strings */
- }
- bool check_default(enum_var_type type) { return 0; }
-};
-
-
-class sys_var_const_str :public sys_var
-{
-public:
- char *value; // Pointer to const value
- sys_var_const_str(sys_var_chain *chain, const char *name_arg,
- const char *value_arg)
- :sys_var(name_arg), value((char*) value_arg)
- { chain_sys_var(chain); }
- bool check(THD *thd, set_var *var)
- {
- return 1;
- }
- bool update(THD *thd, set_var *var)
- {
- return 1;
- }
- SHOW_TYPE show_type() { return SHOW_CHAR; }
- uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
- {
- return (uchar*) value;
- }
- bool check_update_type(Item_result type)
- {
- return 1;
- }
- bool check_default(enum_var_type type) { return 1; }
- bool is_readonly() const { return 1; }
-};
-
-
-class sys_var_const_os_str: public sys_var_const_str
-{
-public:
- sys_var_const_os_str(sys_var_chain *chain, const char *name_arg,
- const char *value_arg)
- :sys_var_const_str(chain, name_arg, value_arg)
- {
- is_os_charset= TRUE;
- }
-};
-
-
-class sys_var_const_str_ptr :public sys_var
-{
-public:
- char **value; // Pointer to const value
- sys_var_const_str_ptr(sys_var_chain *chain, const char *name_arg, char **value_arg)
- :sys_var(name_arg),value(value_arg)
- { chain_sys_var(chain); }
- bool check(THD *thd, set_var *var)
- {
- return 1;
- }
- bool update(THD *thd, set_var *var)
- {
- return 1;
- }
- SHOW_TYPE show_type() { return SHOW_CHAR; }
- uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
- {
- return (uchar*) *value;
- }
- bool check_update_type(Item_result type)
- {
- return 1;
- }
- bool check_default(enum_var_type type) { return 1; }
- bool is_readonly() const { return 1; }
-};
-
-
-class sys_var_const_os_str_ptr :public sys_var_const_str_ptr
-{
-public:
- sys_var_const_os_str_ptr(sys_var_chain *chain, const char *name_arg,
- char **value_arg)
- :sys_var_const_str_ptr(chain, name_arg, value_arg)
- {
- is_os_charset= TRUE;
- }
-};
-
-
-class sys_var_enum :public sys_var
-{
- uint *value;
- TYPELIB *enum_names;
-public:
- sys_var_enum(sys_var_chain *chain, const char *name_arg, uint *value_arg,
- TYPELIB *typelib, sys_after_update_func func)
- :sys_var(name_arg,func), value(value_arg), enum_names(typelib)
- { chain_sys_var(chain); }
- bool check(THD *thd, set_var *var)
- {
- return check_enum(thd, var, enum_names);
- }
- bool update(THD *thd, set_var *var);
- SHOW_TYPE show_type() { return SHOW_CHAR; }
uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
- bool check_update_type(Item_result type) { return 0; }
-};
-
-
-class sys_var_enum_const :public sys_var
-{
- ulong SV::*offset;
- TYPELIB *enum_names;
-public:
- sys_var_enum_const(sys_var_chain *chain, const char *name_arg, ulong SV::*offset_arg,
- TYPELIB *typelib, sys_after_update_func func)
- :sys_var(name_arg,func), offset(offset_arg), enum_names(typelib)
- { chain_sys_var(chain); }
- bool check(THD *thd, set_var *var) { return 1; }
- bool update(THD *thd, set_var *var) { return 1; }
- SHOW_TYPE show_type() { return SHOW_CHAR; }
- bool check_update_type(Item_result type) { return 1; }
- bool is_readonly() const { return 1; }
- uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
-};
-
-
-class sys_var_thd :public sys_var
-{
-public:
- sys_var_thd(const char *name_arg,
- sys_after_update_func func= NULL,
- Binlog_status_enum binlog_status= NOT_IN_BINLOG)
- :sys_var(name_arg, func, binlog_status)
- {}
- bool check_type(enum_var_type type) { return 0; }
- bool check_default(enum_var_type type)
- {
- return type == OPT_GLOBAL && !option_limits;
- }
-};
-
-
-class sys_var_thd_ulong :public sys_var_thd
-{
- sys_check_func check_func;
-public:
- ulong SV::*offset;
- sys_var_thd_ulong(sys_var_chain *chain, const char *name_arg,
- ulong SV::*offset_arg,
- sys_check_func c_func= NULL,
- sys_after_update_func au_func= NULL,
- Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG)
- :sys_var_thd(name_arg, au_func, binlog_status_arg), check_func(c_func),
- offset(offset_arg)
- { chain_sys_var(chain); }
- bool check(THD *thd, set_var *var);
+ bool set_default(THD *thd, enum_var_type type);
bool update(THD *thd, set_var *var);
- void set_default(THD *thd, enum_var_type type);
- SHOW_TYPE show_type() { return SHOW_LONG; }
- uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
-};
-
-
-class sys_var_thd_ha_rows :public sys_var_thd
-{
-public:
- ha_rows SV::*offset;
- sys_var_thd_ha_rows(sys_var_chain *chain, const char *name_arg,
- ha_rows SV::*offset_arg)
- :sys_var_thd(name_arg), offset(offset_arg)
- { chain_sys_var(chain); }
- sys_var_thd_ha_rows(sys_var_chain *chain, const char *name_arg,
- ha_rows SV::*offset_arg,
- sys_after_update_func func)
- :sys_var_thd(name_arg,func), offset(offset_arg)
- { chain_sys_var(chain); }
- bool update(THD *thd, set_var *var);
- void set_default(THD *thd, enum_var_type type);
- SHOW_TYPE show_type() { return SHOW_HA_ROWS; }
- uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
-};
-
-class sys_var_thd_ulonglong :public sys_var_thd
-{
-public:
- ulonglong SV::*offset;
- bool only_global;
- sys_var_thd_ulonglong(sys_var_chain *chain, const char *name_arg,
- ulonglong SV::*offset_arg)
- :sys_var_thd(name_arg), offset(offset_arg)
- { chain_sys_var(chain); }
- sys_var_thd_ulonglong(sys_var_chain *chain, const char *name_arg,
- ulonglong SV::*offset_arg,
- sys_after_update_func func, bool only_global_arg)
- :sys_var_thd(name_arg, func), offset(offset_arg),
- only_global(only_global_arg)
- { chain_sys_var(chain); }
- bool update(THD *thd, set_var *var);
- void set_default(THD *thd, enum_var_type type);
- SHOW_TYPE show_type() { return SHOW_LONGLONG; }
- uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
- bool check(THD *thd, set_var *var);
- bool check_default(enum_var_type type)
- {
- return type == OPT_GLOBAL && !option_limits;
- }
+ SHOW_TYPE show_type() { return show_val_type; }
+ int scope() const { return flags & SCOPE_MASK; }
+ CHARSET_INFO *charset(THD *thd);
+ bool is_readonly() const { return flags & READONLY; }
+ /**
+ the following is only true for keycache variables,
+ that support the syntax @@keycache_name.variable_name
+ */
+ bool is_struct() { return option.var_type & GET_ASK_ADDR; }
+ bool is_written_to_binlog(enum_var_type type)
+ { return type != OPT_GLOBAL && binlog_status == SESSION_VARIABLE_IN_BINLOG; }
+ virtual bool check_update_type(Item_result type) = 0;
bool check_type(enum_var_type type)
{
- return (only_global && type != OPT_GLOBAL);
- }
-};
-
-
-class sys_var_thd_bool :public sys_var_thd
-{
-public:
- my_bool SV::*offset;
- sys_var_thd_bool(sys_var_chain *chain, const char *name_arg, my_bool SV::*offset_arg)
- :sys_var_thd(name_arg), offset(offset_arg)
- { chain_sys_var(chain); }
- sys_var_thd_bool(sys_var_chain *chain, const char *name_arg, my_bool SV::*offset_arg,
- sys_after_update_func func)
- :sys_var_thd(name_arg,func), offset(offset_arg)
- { chain_sys_var(chain); }
- bool update(THD *thd, set_var *var);
- void set_default(THD *thd, enum_var_type type);
- SHOW_TYPE show_type() { return SHOW_MY_BOOL; }
- uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
- bool check(THD *thd, set_var *var)
- {
- return check_enum(thd, var, &bool_typelib);
- }
- bool check_update_type(Item_result type) { return 0; }
-};
-
-
-class sys_var_thd_enum :public sys_var_thd
-{
-protected:
- ulong SV::*offset;
- TYPELIB *enum_names;
- sys_check_func check_func;
-public:
- sys_var_thd_enum(sys_var_chain *chain, const char *name_arg,
- ulong SV::*offset_arg, TYPELIB *typelib,
- sys_after_update_func func= NULL,
- sys_check_func check= NULL)
- :sys_var_thd(name_arg, func), offset(offset_arg),
- enum_names(typelib), check_func(check)
- { chain_sys_var(chain); }
- bool check(THD *thd, set_var *var)
- {
- /*
- check_enum fails if the character representation supplied was wrong
- or that the integer value was wrong or missing.
- */
- if (check_enum(thd, var, enum_names))
- return TRUE;
- else if ((check_func && (*check_func)(thd, var)))
- return TRUE;
- else
- return FALSE;
- }
- bool update(THD *thd, set_var *var);
- void set_default(THD *thd, enum_var_type type);
- SHOW_TYPE show_type() { return SHOW_CHAR; }
- uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
- bool check_update_type(Item_result type) { return 0; }
-};
-
-
-class sys_var_thd_optimizer_switch :public sys_var_thd_enum
-{
-public:
- sys_var_thd_optimizer_switch(sys_var_chain *chain, const char *name_arg,
- ulong SV::*offset_arg)
- :sys_var_thd_enum(chain, name_arg, offset_arg, &optimizer_switch_typelib)
- {}
- bool check(THD *thd, set_var *var);
- void set_default(THD *thd, enum_var_type type);
- uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
- static bool symbolic_mode_representation(THD *thd, ulonglong sql_mode,
- LEX_STRING *rep);
-};
-
-extern void fix_sql_mode_var(THD *thd, enum_var_type type);
-
-class sys_var_thd_sql_mode :public sys_var_thd_enum
-{
-public:
- sys_var_thd_sql_mode(sys_var_chain *chain, const char *name_arg,
- ulong SV::*offset_arg)
- :sys_var_thd_enum(chain, name_arg, offset_arg, &sql_mode_typelib,
- fix_sql_mode_var)
- {}
- bool check(THD *thd, set_var *var)
- {
- return check_set(thd, var, enum_names);
- }
- void set_default(THD *thd, enum_var_type type);
- uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
- static bool symbolic_mode_representation(THD *thd, ulonglong sql_mode,
- LEX_STRING *rep);
-};
-
-
-class sys_var_thd_storage_engine :public sys_var_thd
-{
-protected:
- plugin_ref SV::*offset;
-public:
- sys_var_thd_storage_engine(sys_var_chain *chain, const char *name_arg,
- plugin_ref SV::*offset_arg)
- :sys_var_thd(name_arg), offset(offset_arg)
- { chain_sys_var(chain); }
- bool check(THD *thd, set_var *var);
- SHOW_TYPE show_type() { return SHOW_CHAR; }
- bool check_update_type(Item_result type)
- {
- return type != STRING_RESULT; /* Only accept strings */
- }
- void set_default(THD *thd, enum_var_type type);
- bool update(THD *thd, set_var *var);
- uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
-};
-
-class sys_var_thd_bit :public sys_var_thd
-{
- sys_check_func check_func;
- sys_update_func update_func;
-public:
- ulonglong bit_flag;
- bool reverse;
- sys_var_thd_bit(sys_var_chain *chain, const char *name_arg,
- sys_check_func c_func, sys_update_func u_func,
- ulonglong bit, bool reverse_arg=0,
- Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG)
- :sys_var_thd(name_arg, NULL, binlog_status_arg), check_func(c_func),
- update_func(u_func), bit_flag(bit), reverse(reverse_arg)
- { chain_sys_var(chain); }
- bool check(THD *thd, set_var *var);
- bool update(THD *thd, set_var *var);
- bool check_update_type(Item_result type) { return 0; }
- bool check_type(enum_var_type type) { return type == OPT_GLOBAL; }
- SHOW_TYPE show_type() { return SHOW_MY_BOOL; }
- uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
-};
-
-#ifndef DBUG_OFF
-class sys_var_thd_dbug :public sys_var_thd
-{
-public:
- sys_var_thd_dbug(sys_var_chain *chain, const char *name_arg)
- :sys_var_thd(name_arg)
- { chain_sys_var(chain); }
- bool check_update_type(Item_result type) { return type != STRING_RESULT; }
- bool check(THD *thd, set_var *var);
- SHOW_TYPE show_type() { return SHOW_CHAR; }
- bool update(THD *thd, set_var *var);
- void set_default(THD *thd, enum_var_type type) { DBUG_POP(); }
- uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *b);
-};
-#endif /* DBUG_OFF */
-
-#if defined(ENABLED_DEBUG_SYNC)
-/* Debug Sync Facility. Implemented in debug_sync.cc. */
-class sys_var_debug_sync :public sys_var_thd
-{
-public:
- sys_var_debug_sync(sys_var_chain *chain, const char *name_arg)
- :sys_var_thd(name_arg)
- { chain_sys_var(chain); }
- bool check(THD *thd, set_var *var);
- bool update(THD *thd, set_var *var);
- SHOW_TYPE show_type() { return SHOW_CHAR; }
- bool check_update_type(Item_result type) { return type != STRING_RESULT; }
- uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
-};
-#endif /* defined(ENABLED_DEBUG_SYNC) */
-
-/* some variables that require special handling */
-
-class sys_var_timestamp :public sys_var
-{
-public:
- sys_var_timestamp(sys_var_chain *chain, const char *name_arg,
- Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG)
- :sys_var(name_arg, NULL, binlog_status_arg)
- { chain_sys_var(chain); }
- bool update(THD *thd, set_var *var);
- void set_default(THD *thd, enum_var_type type);
- bool check_type(enum_var_type type) { return type == OPT_GLOBAL; }
- bool check_default(enum_var_type type) { return 0; }
- SHOW_TYPE show_type() { return SHOW_LONG; }
- uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
-};
-
-
-class sys_var_last_insert_id :public sys_var
-{
-public:
- sys_var_last_insert_id(sys_var_chain *chain, const char *name_arg,
- Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG)
- :sys_var(name_arg, NULL, binlog_status_arg)
- { chain_sys_var(chain); }
- bool update(THD *thd, set_var *var);
- bool check_type(enum_var_type type) { return type == OPT_GLOBAL; }
- SHOW_TYPE show_type() { return SHOW_LONGLONG; }
- uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
-};
-
-
-class sys_var_insert_id :public sys_var
-{
-public:
- sys_var_insert_id(sys_var_chain *chain, const char *name_arg)
- :sys_var(name_arg)
- { chain_sys_var(chain); }
- bool update(THD *thd, set_var *var);
- bool check_type(enum_var_type type) { return type == OPT_GLOBAL; }
- SHOW_TYPE show_type() { return SHOW_LONGLONG; }
- uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
-};
-
-
-class sys_var_rand_seed1 :public sys_var
-{
-public:
- sys_var_rand_seed1(sys_var_chain *chain, const char *name_arg,
- Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG)
- :sys_var(name_arg, NULL, binlog_status_arg)
- { chain_sys_var(chain); }
- bool update(THD *thd, set_var *var);
- bool check_type(enum_var_type type) { return type == OPT_GLOBAL; }
-};
-
-class sys_var_rand_seed2 :public sys_var
-{
-public:
- sys_var_rand_seed2(sys_var_chain *chain, const char *name_arg,
- Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG)
- :sys_var(name_arg, NULL, binlog_status_arg)
- { chain_sys_var(chain); }
- bool update(THD *thd, set_var *var);
- bool check_type(enum_var_type type) { return type == OPT_GLOBAL; }
-};
-
-
-class sys_var_collation :public sys_var_thd
-{
-public:
- sys_var_collation(const char *name_arg,
- Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG)
- :sys_var_thd(name_arg, NULL, binlog_status_arg)
- {
- no_support_one_shot= 0;
- }
- bool check(THD *thd, set_var *var);
- SHOW_TYPE show_type() { return SHOW_CHAR; }
- bool check_update_type(Item_result type)
- {
- return ((type != STRING_RESULT) && (type != INT_RESULT));
- }
- bool check_default(enum_var_type type) { return 0; }
- virtual void set_default(THD *thd, enum_var_type type)= 0;
-};
-
-class sys_var_character_set :public sys_var_thd
-{
-public:
- bool nullable;
- sys_var_character_set(const char *name_arg, bool is_nullable= 0,
- Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG)
- :sys_var_thd(name_arg, NULL, binlog_status_arg), nullable(is_nullable)
- {
- /*
- In fact only almost all variables derived from sys_var_character_set
- support ONE_SHOT; character_set_results doesn't. But that's good enough.
- */
- no_support_one_shot= 0;
- }
- bool check(THD *thd, set_var *var);
- SHOW_TYPE show_type() { return SHOW_CHAR; }
- bool check_update_type(Item_result type)
- {
- return ((type != STRING_RESULT) && (type != INT_RESULT));
- }
- bool check_default(enum_var_type type) { return 0; }
- bool update(THD *thd, set_var *var);
- uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
- virtual void set_default(THD *thd, enum_var_type type)= 0;
- virtual CHARSET_INFO **ci_ptr(THD *thd, enum_var_type type)= 0;
-};
-
-class sys_var_character_set_sv :public sys_var_character_set
-{
- CHARSET_INFO *SV::*offset;
- CHARSET_INFO **global_default;
-public:
- sys_var_character_set_sv(sys_var_chain *chain, const char *name_arg,
- CHARSET_INFO *SV::*offset_arg,
- CHARSET_INFO **global_default_arg,
- bool is_nullable= 0,
- Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG)
- : sys_var_character_set(name_arg, is_nullable, binlog_status_arg),
- offset(offset_arg), global_default(global_default_arg)
- { chain_sys_var(chain); }
- void set_default(THD *thd, enum_var_type type);
- CHARSET_INFO **ci_ptr(THD *thd, enum_var_type type);
-};
-
-
-class sys_var_character_set_client: public sys_var_character_set_sv
-{
-public:
- sys_var_character_set_client(sys_var_chain *chain, const char *name_arg,
- CHARSET_INFO *SV::*offset_arg,
- CHARSET_INFO **global_default_arg,
- Binlog_status_enum binlog_status_arg)
- : sys_var_character_set_sv(chain, name_arg, offset_arg, global_default_arg,
- 0, binlog_status_arg)
- { }
- bool check(THD *thd, set_var *var);
-};
-
-
-class sys_var_character_set_database :public sys_var_character_set
-{
-public:
- sys_var_character_set_database(sys_var_chain *chain, const char *name_arg,
- Binlog_status_enum binlog_status_arg=
- NOT_IN_BINLOG)
- : sys_var_character_set(name_arg, 0, binlog_status_arg)
- { chain_sys_var(chain); }
- void set_default(THD *thd, enum_var_type type);
- CHARSET_INFO **ci_ptr(THD *thd, enum_var_type type);
-};
-
-class sys_var_collation_sv :public sys_var_collation
-{
- CHARSET_INFO *SV::*offset;
- CHARSET_INFO **global_default;
-public:
- sys_var_collation_sv(sys_var_chain *chain, const char *name_arg,
- CHARSET_INFO *SV::*offset_arg,
- CHARSET_INFO **global_default_arg,
- Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG)
- :sys_var_collation(name_arg, binlog_status_arg),
- offset(offset_arg), global_default(global_default_arg)
- {
- chain_sys_var(chain);
- }
- bool update(THD *thd, set_var *var);
- void set_default(THD *thd, enum_var_type type);
- uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
-};
-
-
-class sys_var_key_cache_param :public sys_var
-{
-protected:
- size_t offset;
-public:
- sys_var_key_cache_param(sys_var_chain *chain, const char *name_arg,
- size_t offset_arg)
- :sys_var(name_arg), offset(offset_arg)
- { chain_sys_var(chain); }
- uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
- bool check_default(enum_var_type type) { return 1; }
- bool is_struct() { return 1; }
-};
-
-
-class sys_var_key_buffer_size :public sys_var_key_cache_param
-{
-public:
- sys_var_key_buffer_size(sys_var_chain *chain, const char *name_arg)
- :sys_var_key_cache_param(chain, name_arg,
- offsetof(KEY_CACHE, param_buff_size))
- {}
- bool update(THD *thd, set_var *var);
- SHOW_TYPE show_type() { return SHOW_LONGLONG; }
-};
-
-
-class sys_var_key_cache_long :public sys_var_key_cache_param
-{
-public:
- sys_var_key_cache_long(sys_var_chain *chain, const char *name_arg, size_t offset_arg)
- :sys_var_key_cache_param(chain, name_arg, offset_arg)
- {}
- bool update(THD *thd, set_var *var);
- SHOW_TYPE show_type() { return SHOW_LONG; }
-};
-
-
-class sys_var_thd_date_time_format :public sys_var_thd
-{
- DATE_TIME_FORMAT *SV::*offset;
- timestamp_type date_time_type;
-public:
- sys_var_thd_date_time_format(sys_var_chain *chain, const char *name_arg,
- DATE_TIME_FORMAT *SV::*offset_arg,
- timestamp_type date_time_type_arg)
- :sys_var_thd(name_arg), offset(offset_arg),
- date_time_type(date_time_type_arg)
- { chain_sys_var(chain); }
- SHOW_TYPE show_type() { return SHOW_CHAR; }
- bool check_update_type(Item_result type)
- {
- return type != STRING_RESULT; /* Only accept strings */
- }
- bool check_default(enum_var_type type) { return 0; }
- bool check(THD *thd, set_var *var);
- bool update(THD *thd, set_var *var);
- void update2(THD *thd, enum_var_type type, DATE_TIME_FORMAT *new_value);
- uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
- void set_default(THD *thd, enum_var_type type);
-};
-
-
-class sys_var_log_state :public sys_var_bool_ptr
-{
- uint log_type;
-public:
- sys_var_log_state(sys_var_chain *chain, const char *name_arg, my_bool *value_arg,
- uint log_type_arg)
- :sys_var_bool_ptr(chain, name_arg, value_arg), log_type(log_type_arg) {}
- bool update(THD *thd, set_var *var);
- void set_default(THD *thd, enum_var_type type);
-};
-
-
-class sys_var_set :public sys_var
-{
-protected:
- ulong *value;
- TYPELIB *enum_names;
-public:
- sys_var_set(sys_var_chain *chain, const char *name_arg, ulong *value_arg,
- TYPELIB *typelib, sys_after_update_func func)
- :sys_var(name_arg, func), value(value_arg), enum_names(typelib)
- { chain_sys_var(chain); }
- virtual bool check(THD *thd, set_var *var)
- {
- return check_set(thd, var, enum_names);
- }
- virtual void set_default(THD *thd, enum_var_type type)
- {
- *value= 0;
- }
- bool update(THD *thd, set_var *var);
- uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
- bool check_update_type(Item_result type) { return 0; }
- SHOW_TYPE show_type() { return SHOW_CHAR; }
-};
-
-class sys_var_set_slave_mode :public sys_var_set
-{
-public:
- sys_var_set_slave_mode(sys_var_chain *chain, const char *name_arg,
- ulong *value_arg,
- TYPELIB *typelib, sys_after_update_func func) :
- sys_var_set(chain, name_arg, value_arg, typelib, func) {}
- void set_default(THD *thd, enum_var_type type);
- bool check(THD *thd, set_var *var);
- bool update(THD *thd, set_var *var);
-};
-
-class sys_var_log_output :public sys_var
-{
- ulong *value;
- TYPELIB *enum_names;
-public:
- sys_var_log_output(sys_var_chain *chain, const char *name_arg, ulong *value_arg,
- TYPELIB *typelib, sys_after_update_func func)
- :sys_var(name_arg,func), value(value_arg), enum_names(typelib)
- {
- chain_sys_var(chain);
- set_allow_empty_value(FALSE);
- }
- virtual bool check(THD *thd, set_var *var)
- {
- return check_set(thd, var, enum_names);
- }
- bool update(THD *thd, set_var *var);
- uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
- bool check_update_type(Item_result type) { return 0; }
- void set_default(THD *thd, enum_var_type type);
- SHOW_TYPE show_type() { return SHOW_CHAR; }
-};
-
-
-/* Variable that you can only read from */
-
-class sys_var_readonly: public sys_var
-{
-public:
- enum_var_type var_type;
- SHOW_TYPE show_type_value;
- sys_value_ptr_func value_ptr_func;
- sys_var_readonly(sys_var_chain *chain, const char *name_arg, enum_var_type type,
- SHOW_TYPE show_type_arg,
- sys_value_ptr_func value_ptr_func_arg)
- :sys_var(name_arg), var_type(type),
- show_type_value(show_type_arg), value_ptr_func(value_ptr_func_arg)
- { chain_sys_var(chain); }
- bool update(THD *thd, set_var *var) { return 1; }
- bool check_default(enum_var_type type) { return 1; }
- bool check_type(enum_var_type type) { return type != var_type; }
- bool check_update_type(Item_result type) { return 1; }
- uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
- {
- return (*value_ptr_func)(thd);
- }
- SHOW_TYPE show_type() { return show_type_value; }
- bool is_readonly() const { return 1; }
-};
-
-
-class sys_var_readonly_os: public sys_var_readonly
-{
-public:
- sys_var_readonly_os(sys_var_chain *chain, const char *name_arg, enum_var_type type,
- SHOW_TYPE show_type_arg,
- sys_value_ptr_func value_ptr_func_arg)
- :sys_var_readonly(chain, name_arg, type, show_type_arg, value_ptr_func_arg)
- {
- is_os_charset= TRUE;
- }
-};
-
-
-/**
- Global-only, read-only variable. E.g. command line option.
-*/
-
-class sys_var_const: public sys_var
-{
-public:
- enum_var_type var_type;
- SHOW_TYPE show_type_value;
- uchar *ptr;
- sys_var_const(sys_var_chain *chain, const char *name_arg, enum_var_type type,
- SHOW_TYPE show_type_arg, uchar *ptr_arg)
- :sys_var(name_arg), var_type(type),
- show_type_value(show_type_arg), ptr(ptr_arg)
- { chain_sys_var(chain); }
- bool update(THD *thd, set_var *var) { return 1; }
- bool check_default(enum_var_type type) { return 1; }
- bool check_type(enum_var_type type) { return type != var_type; }
- bool check_update_type(Item_result type) { return 1; }
- uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
- {
- return ptr;
- }
- SHOW_TYPE show_type() { return show_type_value; }
- bool is_readonly() const { return 1; }
-};
-
-
-class sys_var_const_os: public sys_var_const
-{
-public:
- enum_var_type var_type;
- SHOW_TYPE show_type_value;
- uchar *ptr;
- sys_var_const_os(sys_var_chain *chain, const char *name_arg,
- enum_var_type type,
- SHOW_TYPE show_type_arg, uchar *ptr_arg)
- :sys_var_const(chain, name_arg, type, show_type_arg, ptr_arg)
- {
- is_os_charset= TRUE;
+ switch (scope())
+ {
+ case GLOBAL: return type != OPT_GLOBAL;
+ case SESSION: return false; // always ok
+ case ONLY_SESSION: return type == OPT_GLOBAL;
+ }
+ return true; // keep gcc happy
}
-};
+ bool register_option(DYNAMIC_ARRAY *array)
+ { return option.id != -1 && insert_dynamic(array, (uchar*)&option); }
-
-class sys_var_have_option: public sys_var
-{
+private:
+ virtual bool do_check(THD *thd, set_var *var) = 0;
+ /**
+ save the session default value of the variable in var
+ */
+ virtual void session_save_default(THD *thd, set_var *var) = 0;
+ /**
+ save the global default value of the variable in var
+ */
+ virtual void global_save_default(THD *thd, set_var *var) = 0;
+ virtual bool session_update(THD *thd, set_var *var) = 0;
+ virtual bool global_update(THD *thd, set_var *var) = 0;
+ void do_deprecated_warning(THD *thd);
protected:
- virtual SHOW_COMP_OPTION get_option() = 0;
-public:
- sys_var_have_option(sys_var_chain *chain, const char *variable_name):
- sys_var(variable_name)
- { chain_sys_var(chain); }
- uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
- {
- return (uchar*) show_comp_option_name[get_option()];
- }
- bool update(THD *thd, set_var *var) { return 1; }
- bool check_default(enum_var_type type) { return 1; }
- bool check_type(enum_var_type type) { return type != OPT_GLOBAL; }
- bool check_update_type(Item_result type) { return 1; }
- SHOW_TYPE show_type() { return SHOW_CHAR; }
- bool is_readonly() const { return 1; }
-};
-
-
-class sys_var_have_variable: public sys_var_have_option
-{
- SHOW_COMP_OPTION *have_variable;
-
-public:
- sys_var_have_variable(sys_var_chain *chain, const char *variable_name,
- SHOW_COMP_OPTION *have_variable_arg):
- sys_var_have_option(chain, variable_name),
- have_variable(have_variable_arg)
- { }
- SHOW_COMP_OPTION get_option() { return *have_variable; }
-};
-
-
-class sys_var_have_plugin: public sys_var_have_option
-{
- const char *plugin_name_str;
- const uint plugin_name_len;
- const int plugin_type;
-
-public:
- sys_var_have_plugin(sys_var_chain *chain, const char *variable_name,
- const char *plugin_name_str_arg, uint plugin_name_len_arg,
- int plugin_type_arg):
- sys_var_have_option(chain, variable_name),
- plugin_name_str(plugin_name_str_arg), plugin_name_len(plugin_name_len_arg),
- plugin_type(plugin_type_arg)
- { }
- /* the following method is declared in sql_plugin.cc */
- SHOW_COMP_OPTION get_option();
-};
-
-
-class sys_var_thd_time_zone :public sys_var_thd
-{
-public:
- sys_var_thd_time_zone(sys_var_chain *chain, const char *name_arg,
- Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG)
- :sys_var_thd(name_arg, NULL, binlog_status_arg)
- {
- no_support_one_shot= 0;
- chain_sys_var(chain);
- }
- bool check(THD *thd, set_var *var);
- SHOW_TYPE show_type() { return SHOW_CHAR; }
- bool check_update_type(Item_result type)
- {
- return type != STRING_RESULT; /* Only accept strings */
- }
- bool check_default(enum_var_type type) { return 0; }
- bool update(THD *thd, set_var *var);
- uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
- virtual void set_default(THD *thd, enum_var_type type);
-};
-
-
-class sys_var_max_user_conn : public sys_var_thd
-{
-public:
- sys_var_max_user_conn(sys_var_chain *chain, const char *name_arg):
- sys_var_thd(name_arg)
- { chain_sys_var(chain); }
- bool check(THD *thd, set_var *var);
- bool update(THD *thd, set_var *var);
- bool check_default(enum_var_type type)
- {
- return type != OPT_GLOBAL || !option_limits;
- }
- void set_default(THD *thd, enum_var_type type);
- SHOW_TYPE show_type() { return SHOW_INT; }
- uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
-};
-
-
-/**
- * @brief This is a specialization of sys_var_thd_ulong that implements a
- read-only session variable. The class overrides check() and check_default()
- to achieve the read-only property for the session part of the variable.
- */
-class sys_var_thd_ulong_session_readonly : public sys_var_thd_ulong
-{
-public:
- sys_var_thd_ulong_session_readonly(sys_var_chain *chain_arg,
- const char *name_arg, ulong SV::*offset_arg,
- sys_check_func c_func= NULL,
- sys_after_update_func au_func= NULL,
- Binlog_status_enum bl_status_arg= NOT_IN_BINLOG):
- sys_var_thd_ulong(chain_arg, name_arg, offset_arg, c_func, au_func, bl_status_arg)
- { }
- bool check(THD *thd, set_var *var);
- bool check_default(enum_var_type type)
- {
- return type != OPT_GLOBAL || !option_limits;
- }
-};
-
-
-class sys_var_microseconds :public sys_var_thd
-{
- ulonglong SV::*offset;
-public:
- sys_var_microseconds(sys_var_chain *chain, const char *name_arg,
- ulonglong SV::*offset_arg):
- sys_var_thd(name_arg), offset(offset_arg)
- { chain_sys_var(chain); }
- bool check(THD *thd, set_var *var) {return 0;}
- bool update(THD *thd, set_var *var);
- void set_default(THD *thd, enum_var_type type);
- SHOW_TYPE show_type() { return SHOW_DOUBLE; }
- bool check_update_type(Item_result type)
- {
- return (type != INT_RESULT && type != REAL_RESULT && type != DECIMAL_RESULT);
- }
- uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
-};
-
-
-/**
- Handler for setting the system variable --read-only.
-*/
-
-class sys_var_opt_readonly :public sys_var_bool_ptr
-{
-public:
- sys_var_opt_readonly(sys_var_chain *chain, const char *name_arg,
- my_bool *value_arg) :
- sys_var_bool_ptr(chain, name_arg, value_arg) {};
- ~sys_var_opt_readonly() {};
- bool update(THD *thd, set_var *var);
-};
-
-
-
-class sys_var_thd_lc: public sys_var_thd
-{
-public:
- sys_var_thd_lc(sys_var_chain *chain, const char *name_arg,
- Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG)
- : sys_var_thd(name_arg, NULL, binlog_status_arg)
- {
-#if MYSQL_VERSION_ID < 50000
- no_support_one_shot= 0;
-#endif
- chain_sys_var(chain);
- }
- bool check(THD *thd, set_var *var);
- SHOW_TYPE show_type() { return SHOW_CHAR; }
- bool check_update_type(Item_result type)
- {
- return ((type != STRING_RESULT) && (type != INT_RESULT));
- }
- bool check_default(enum_var_type type) { return 0; }
-};
-
-
-class sys_var_thd_lc_time_names :public sys_var_thd_lc
-{
-public:
- sys_var_thd_lc_time_names(sys_var_chain *chain_arg, const char *name_arg,
- Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG)
- : sys_var_thd_lc(chain_arg, name_arg, binlog_status_arg)
- {}
- bool update(THD *thd, set_var *var);
- uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
- void set_default(THD *thd, enum_var_type type);
-};
-
-
-class sys_var_thd_lc_messages :public sys_var_thd_lc
-{
-public:
- sys_var_thd_lc_messages(sys_var_chain *chain_arg, const char *name_arg,
- Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG)
- : sys_var_thd_lc(chain_arg, name_arg, binlog_status_arg)
- {}
- bool update(THD *thd, set_var *var);
- uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
- void set_default(THD *thd, enum_var_type type);
-};
+ /**
+ A pointer to a value of the variable for SHOW.
+ It must be of show_val_type type (bool for SHOW_BOOL, int for SHOW_INT,
+ longlong for SHOW_LONGLONG, etc).
+ */
+ virtual uchar *session_value_ptr(THD *thd, LEX_STRING *base);
+ virtual uchar *global_value_ptr(THD *thd, LEX_STRING *base);
+ /**
+ A pointer to a storage area of the variable, to the raw data.
+ Typically it's the same as session_value_ptr(), but it's different,
+ for example, for ENUM, that is printed as a string, but stored as a number.
+ */
+ uchar *session_var_ptr(THD *thd)
+ { return ((uchar*)&(thd->variables)) + offset; }
-#ifdef HAVE_EVENT_SCHEDULER
-class sys_var_event_scheduler :public sys_var_long_ptr
-{
- /* We need a derived class only to have a warn_deprecated() */
-public:
- sys_var_event_scheduler(sys_var_chain *chain, const char *name_arg) :
- sys_var_long_ptr(chain, name_arg, NULL, NULL) {};
- bool update(THD *thd, set_var *var);
- uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
- SHOW_TYPE show_type() { return SHOW_CHAR; }
- bool check(THD *thd, set_var *var);
- bool check_update_type(Item_result type)
- {
- return type != STRING_RESULT && type != INT_RESULT;
- }
-};
-#endif
-
-extern void fix_binlog_format_after_update(THD *thd, enum_var_type type);
-
-class sys_var_thd_binlog_format :public sys_var_thd_enum
-{
-public:
- sys_var_thd_binlog_format(sys_var_chain *chain, const char *name_arg,
- ulong SV::*offset_arg)
- :sys_var_thd_enum(chain, name_arg, offset_arg,
- &binlog_format_typelib,
- fix_binlog_format_after_update)
- {};
- bool check(THD *thd, set_var *var);
- bool is_readonly() const;
+ uchar *global_var_ptr()
+ { return ((uchar*)&global_system_variables) + offset; }
};
/****************************************************************************
Classes for parsing of the SET command
****************************************************************************/
+/**
+ A base class for everything that can be set with SET command.
+ It's similar to Items, an instance of this is created by the parser
+ for every assigmnent in SET (or elsewhere, e.g. in SELECT).
+*/
class set_var_base :public Sql_alloc
{
public:
set_var_base() {}
virtual ~set_var_base() {}
- virtual int check(THD *thd)=0; /* To check privileges etc. */
- virtual int update(THD *thd)=0; /* To set the value */
- /* light check for PS */
- virtual int light_check(THD *thd) { return check(thd); }
- virtual bool no_support_one_shot() { return 1; }
+ virtual int check(THD *thd)=0; /* To check privileges etc. */
+ virtual int update(THD *thd)=0; /* To set the value */
+ virtual int light_check(THD *thd) { return check(thd); } /* for PS */
};
-/* MySQL internal variables, like query_cache_size */
-
+/**
+ set_var_base descendant for assignments to the system variables.
+*/
class set_var :public set_var_base
{
public:
- sys_var *var;
- Item *value;
+ sys_var *var; ///< system variable to be updated
+ Item *value; ///< the expression that provides the new value of the variable
enum_var_type type;
- union
- {
- CHARSET_INFO *charset;
- ulong ulong_value;
- ulonglong ulonglong_value;
- plugin_ref plugin;
- DATE_TIME_FORMAT *date_time_format;
- Time_zone *time_zone;
- MY_LOCALE *locale_value;
+ union ///< temp storage to hold a value between sys_var::check and ::update
+ {
+ ulonglong ulonglong_value; ///< for all integer, set, enum sysvars
+ double double_value; ///< for Sys_var_double
+ plugin_ref plugin; ///< for Sys_var_plugin
+ Time_zone *time_zone; ///< for Sys_var_tz
+ LEX_STRING string_value; ///< for Sys_var_charptr and others
+ void *ptr; ///< for Sys_var_struct
} save_result;
- LEX_STRING base; /* for structs */
+ LEX_STRING base; /**< for structured variables, like keycache_name.variable_name */
set_var(enum_var_type type_arg, sys_var *var_arg,
const LEX_STRING *base_name_arg, Item *value_arg)
@@ -1351,10 +210,10 @@ public:
if (value_arg && value_arg->type() == Item::FIELD_ITEM)
{
Item_field *item= (Item_field*) value_arg;
- if (!(value=new Item_string(item->field_name,
+ if (!(value=new Item_string(item->field_name,
(uint) strlen(item->field_name),
- system_charset_info)))
- value=value_arg; /* Give error message later */
+ system_charset_info))) // names are utf8
+ value=value_arg; /* Give error message later */
}
else
value=value_arg;
@@ -1362,12 +221,10 @@ public:
int check(THD *thd);
int update(THD *thd);
int light_check(THD *thd);
- bool no_support_one_shot() { return var->no_support_one_shot; }
};
/* User variables like @my_own_variable */
-
class set_var_user: public set_var_base
{
Item_func_set_user_var *user_var_item;
@@ -1404,8 +261,8 @@ class set_var_collation_client: public set_var_base
CHARSET_INFO *collation_connection;
public:
set_var_collation_client(CHARSET_INFO *client_coll_arg,
- CHARSET_INFO *connection_coll_arg,
- CHARSET_INFO *result_coll_arg)
+ CHARSET_INFO *connection_coll_arg,
+ CHARSET_INFO *result_coll_arg)
:character_set_client(client_coll_arg),
character_set_results(result_coll_arg),
collation_connection(connection_coll_arg)
@@ -1414,86 +271,26 @@ public:
int update(THD *thd);
};
-
-extern "C"
-{
- typedef int (*process_key_cache_t) (const char *, KEY_CACHE *);
-}
-
-/* Named lists (used for keycaches) */
-
-class NAMED_LIST :public ilink
-{
- const char *name;
- uint name_length;
-public:
- uchar* data;
-
- NAMED_LIST(I_List<NAMED_LIST> *links, const char *name_arg,
- uint name_length_arg, uchar* data_arg)
- :name_length(name_length_arg), data(data_arg)
- {
- name= my_strndup(name_arg, name_length, MYF(MY_WME));
- links->push_back(this);
- }
- inline bool cmp(const char *name_cmp, uint length)
- {
- return length == name_length && !memcmp(name, name_cmp, length);
- }
- ~NAMED_LIST()
- {
- my_free((uchar*) name, MYF(0));
- }
- friend bool process_key_caches(process_key_cache_t func);
- friend void delete_elements(I_List<NAMED_LIST> *list,
- void (*free_element)(const char*, uchar*));
-};
-
-/* updated in sql_acl.cc */
-
-extern sys_var_thd_bool sys_old_alter_table;
-extern sys_var_thd_bool sys_old_passwords;
-extern LEX_STRING default_key_cache_base;
-
-/* For sql_yacc */
-struct sys_var_with_base
-{
- sys_var *var;
- LEX_STRING base_name;
-};
-
/*
Prototypes for helper functions
*/
-int set_var_init();
-void set_var_free();
-SHOW_VAR* enumerate_sys_vars(THD *thd, bool sorted);
-int mysql_add_sys_var_chain(sys_var *chain, struct my_option *long_options);
-int mysql_del_sys_var_chain(sys_var *chain);
+SHOW_VAR* enumerate_sys_vars(THD *thd, bool sorted, enum enum_var_type type);
+
sys_var *find_sys_var(THD *thd, const char *str, uint length=0);
int sql_set_variables(THD *thd, List<set_var_base> *var_list);
-bool not_all_support_one_shot(List<set_var_base> *var_list);
-void fix_delay_key_write(THD *thd, enum_var_type type);
-void fix_slave_exec_mode(enum_var_type type);
-ulong fix_sql_mode(ulong sql_mode);
-extern sys_var_const_str sys_charset_system;
-extern sys_var_str sys_init_connect;
-extern sys_var_str sys_init_slave;
-extern sys_var_thd_time_zone sys_time_zone;
-extern sys_var_thd_bit sys_autocommit;
+
+bool fix_delay_key_write(sys_var *self, THD *thd, enum_var_type type);
+
+ulong expand_sql_mode(ulonglong sql_mode);
+bool sql_mode_string_representation(THD *thd, ulong sql_mode, LEX_STRING *ls);
+
+extern sys_var *Sys_autocommit_ptr;
+
CHARSET_INFO *get_old_charset_by_name(const char *old_name);
-uchar* find_named(I_List<NAMED_LIST> *list, const char *name, uint length,
- NAMED_LIST **found);
-extern sys_var_str sys_var_general_log_path, sys_var_slow_log_path;
+int sys_var_init(DYNAMIC_ARRAY *long_options);
+void sys_var_end(void);
-/* key_cache functions */
-KEY_CACHE *get_key_cache(LEX_STRING *cache_name);
-KEY_CACHE *get_or_create_key_cache(const char *name, uint length);
-void free_key_cache(const char *name, KEY_CACHE *key_cache);
-bool process_key_caches(process_key_cache_t func);
-void delete_elements(I_List<NAMED_LIST> *list,
- void (*free_element)(const char*, uchar*));
+#endif
-#endif /* SET_VAR_INCLUDED */
diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt
index 03d7ff30f7e..09812583745 100644
--- a/sql/share/errmsg-utf8.txt
+++ b/sql/share/errmsg-utf8.txt
@@ -6108,7 +6108,7 @@ ER_TRG_CANT_OPEN_TABLE
ER_CANT_CREATE_SROUTINE
eng "Cannot create stored routine `%-.64s`. Check warnings"
-ER_SLAVE_AMBIGOUS_EXEC_MODE
+ER_NEVER_USED
eng "Ambiguous slave modes combination. %s"
ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT
@@ -6260,3 +6260,9 @@ ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
eng "Field '%-.192s' is of a not allowed type for this type of partitioning"
ER_PARTITION_FIELDS_TOO_LONG
eng "The total length of the partitioning fields is too large"
+ER_PATH_LENGTH
+ eng "The path specified for %.64s is too long."
+ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT
+ eng "The syntax '%s' is deprecated and will be removed in MySQL %s."
+ ger "Die Syntax '%s' ist veraltet und wird in MySQL %s entfernt."
+
diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt
index ab81c122497..84cd6247493 100644
--- a/sql/share/errmsg.txt
+++ b/sql/share/errmsg.txt
@@ -6109,7 +6109,7 @@ ER_TRG_CANT_OPEN_TABLE
ER_CANT_CREATE_SROUTINE
eng "Cannot create stored routine `%-.64s`. Check warnings"
-ER_SLAVE_AMBIGOUS_EXEC_MODE
+ER_NEVER_USED
eng "Ambiguous slave modes combination. %s"
ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT
@@ -6260,3 +6260,9 @@ ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
eng "Field '%-.192s' is of a not allowed type for this type of partitioning"
ER_PARTITION_FIELDS_TOO_LONG
eng "The total length of the partitioning fields is too large"
+ER_PATH_LENGTH
+ eng "The path specified for %.64s is too long."
+ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT
+ eng "The syntax '%s' is deprecated and will be removed in MySQL %s."
+ ger "Die Syntax '%s' ist veraltet und wird in MySQL %s entfernt."
+
diff --git a/sql/slave.cc b/sql/slave.cc
index 1cfd54a7dc0..4dea78596ba 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -362,6 +362,9 @@ static void print_slave_skip_errors(void)
DBUG_ASSERT(sizeof(slave_skip_error_names) > MIN_ROOM);
DBUG_ASSERT(MAX_SLAVE_ERROR <= 999999); // 6 digits
+ /* Make @@slave_skip_errors show the nice human-readable value. */
+ opt_slave_skip_errors= slave_skip_error_names;
+
if (!use_slave_mask || bitmap_is_clear_all(&slave_error_mask))
{
/* purecov: begin tested */
@@ -1871,12 +1874,12 @@ void set_slave_thread_options(THD* thd)
when max_join_size is 4G, OPTION_BIG_SELECTS is automatically set, but
only for client threads.
*/
- ulonglong options= thd->options | OPTION_BIG_SELECTS;
+ ulonglong options= thd->variables.option_bits | OPTION_BIG_SELECTS;
if (opt_log_slave_updates)
options|= OPTION_BIN_LOG;
else
options&= ~OPTION_BIN_LOG;
- thd->options= options;
+ thd->variables.option_bits= options;
thd->variables.completion_type= 0;
DBUG_VOID_RETURN;
}
@@ -2187,8 +2190,8 @@ int apply_event_and_update_pos(Log_event* ev, THD* thd, Relay_log_info* rli)
ev->get_type_str(), ev->get_type_code(),
ev->server_id));
DBUG_PRINT("info", ("thd->options: %s%s; rli->last_event_start_time: %lu",
- FLAGSTR(thd->options, OPTION_NOT_AUTOCOMMIT),
- FLAGSTR(thd->options, OPTION_BEGIN),
+ FLAGSTR(thd->variables.option_bits, OPTION_NOT_AUTOCOMMIT),
+ FLAGSTR(thd->variables.option_bits, OPTION_BEGIN),
rli->last_event_start_time));
/*
@@ -2224,7 +2227,7 @@ int apply_event_and_update_pos(Log_event* ev, THD* thd, Relay_log_info* rli)
int reason= ev->shall_skip(rli);
if (reason == Log_event::EVENT_SKIP_COUNT)
- --rli->slave_skip_counter;
+ sql_slave_skip_counter= --rli->slave_skip_counter;
pthread_mutex_unlock(&rli->data_lock);
if (reason == Log_event::EVENT_SKIP_NOT)
exec_res= ev->apply_event(rli);
@@ -2244,7 +2247,7 @@ int apply_event_and_update_pos(Log_event* ev, THD* thd, Relay_log_info* rli)
"skipped because event skip counter was non-zero"
};
DBUG_PRINT("info", ("OPTION_BEGIN: %d; IN_STMT: %d",
- thd->options & OPTION_BEGIN ? 1 : 0,
+ test(thd->variables.option_bits & OPTION_BEGIN),
rli->get_flag(Relay_log_info::IN_STMT)));
DBUG_PRINT("skip_event", ("%s event was %s",
ev->get_type_str(), explain[reason]));
@@ -3133,9 +3136,9 @@ log '%s' at position %s, relay log '%s' position: %s", RPL_LOG_NAME,
}
/* execute init_slave variable */
- if (sys_init_slave.value_length)
+ if (opt_init_slave.length)
{
- execute_init_command(thd, &sys_init_slave, &LOCK_sys_init_slave);
+ execute_init_command(thd, &opt_init_slave, &LOCK_sys_init_slave);
if (thd->is_slave_error)
{
rli->report(ERROR_LEVEL, thd->stmt_da->sql_errno(),
diff --git a/sql/slave.h b/sql/slave.h
index 8fb44007032..69290ecac0a 100644
--- a/sql/slave.h
+++ b/sql/slave.h
@@ -115,6 +115,7 @@ extern char *master_info_file, *relay_log_info_file;
extern char *opt_relay_logname, *opt_relaylog_index_name;
extern my_bool opt_skip_slave_start, opt_reckless_slave;
extern my_bool opt_log_slave_updates;
+extern char *opt_slave_skip_errors;
extern ulonglong relay_log_space_limit;
/*
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index 3f7d812384c..6e69b2e39a4 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -24,6 +24,7 @@
#include "sp_pcontext.h"
#include "sp_rcontext.h"
#include "sp_cache.h"
+#include "set_var.h"
/*
Sufficient max length of printed destinations and frame offsets (all uints).
@@ -1707,7 +1708,7 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount,
each substatement be binlogged its way.
*/
need_binlog_call= mysql_bin_log.is_open() &&
- (thd->options & OPTION_BIN_LOG) && !thd->current_stmt_binlog_row_based;
+ (thd->variables.option_bits & OPTION_BIN_LOG) && !thd->current_stmt_binlog_row_based;
/*
Remember the original arguments for unrolled replication of functions
@@ -1770,8 +1771,8 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount,
q= global_query_id;
pthread_mutex_unlock(&LOCK_thread_count);
mysql_bin_log.start_union_events(thd, q + 1);
- binlog_save_options= thd->options;
- thd->options&= ~OPTION_BIN_LOG;
+ binlog_save_options= thd->variables.option_bits;
+ thd->variables.option_bits&= ~OPTION_BIN_LOG;
}
/*
@@ -1791,7 +1792,7 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount,
if (need_binlog_call)
{
mysql_bin_log.stop_union_events(thd);
- thd->options= binlog_save_options;
+ thd->variables.option_bits= binlog_save_options;
if (thd->binlog_evt_union.unioned_events)
{
int errcode = query_error_code(thd, thd->killed == THD::NOT_KILLED);
@@ -1984,12 +1985,12 @@ sp_head::execute_procedure(THD *thd, List<Item> *args)
save_enable_slow_log= true;
thd->enable_slow_log= FALSE;
}
- if (!(m_flags & LOG_GENERAL_LOG) && !(thd->options & OPTION_LOG_OFF))
+ if (!(m_flags & LOG_GENERAL_LOG) && !(thd->variables.option_bits & OPTION_LOG_OFF))
{
DBUG_PRINT("info", ("Disabling general log for the execution"));
save_log_general= true;
/* disable this bit */
- thd->options |= OPTION_LOG_OFF;
+ thd->variables.option_bits |= OPTION_LOG_OFF;
}
thd->spcont= nctx;
@@ -2003,7 +2004,7 @@ sp_head::execute_procedure(THD *thd, List<Item> *args)
err_status= execute(thd);
if (save_log_general)
- thd->options &= ~OPTION_LOG_OFF;
+ thd->variables.option_bits &= ~OPTION_LOG_OFF;
if (save_enable_slow_log)
thd->enable_slow_log= true;
/*
@@ -2441,8 +2442,7 @@ sp_head::show_create_routine(THD *thd, int type)
if (check_show_routine_access(thd, this, &full_access))
DBUG_RETURN(TRUE);
- sys_var_thd_sql_mode::symbolic_mode_representation(
- thd, m_sql_mode, &sql_mode);
+ sql_mode_string_representation(thd, m_sql_mode, &sql_mode);
/* Send header. */
@@ -2881,7 +2881,7 @@ sp_instr_stmt::execute(THD *thd, uint *nextp)
(the order of query cache and subst_spvars calls is irrelevant because
queries with SP vars can't be cached)
*/
- if (unlikely((thd->options & OPTION_LOG_OFF)==0))
+ if (unlikely((thd->variables.option_bits & OPTION_LOG_OFF)==0))
general_log_write(thd, COM_QUERY, thd->query(), thd->query_length());
if (query_cache_send_result_to_client(thd,
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 05e8cee9151..4cbae0bbb5a 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -31,6 +31,8 @@
#include "sp_head.h"
#include "sp.h"
+bool mysql_user_table_is_in_short_password_format= false;
+
static const
TABLE_FIELD_TYPE mysql_db_table_fields[MYSQL_DB_FIELD_COUNT] = {
{
@@ -219,25 +221,6 @@ set_user_salt(ACL_USER *acl_user, const char *password, uint password_len)
}
/*
- This after_update function is used when user.password is less than
- SCRAMBLE_LENGTH bytes.
-*/
-
-static void restrict_update_of_old_passwords_var(THD *thd,
- enum_var_type var_type)
-{
- if (var_type == OPT_GLOBAL)
- {
- pthread_mutex_lock(&LOCK_global_system_variables);
- global_system_variables.old_passwords= 1;
- pthread_mutex_unlock(&LOCK_global_system_variables);
- }
- else
- thd->variables.old_passwords= 1;
-}
-
-
-/*
Initialize structures responsible for user/db-level privilege checking and
load privilege information for them from tables in the 'mysql' database.
@@ -398,7 +381,7 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
"but server started with --secure-auth option.");
goto end;
}
- sys_old_passwords.after_update= restrict_update_of_old_passwords_var;
+ mysql_user_table_is_in_short_password_format= true;
if (global_system_variables.old_passwords)
pthread_mutex_unlock(&LOCK_global_system_variables);
else
@@ -413,7 +396,7 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
}
else
{
- sys_old_passwords.after_update= 0;
+ mysql_user_table_is_in_short_password_format= false;
pthread_mutex_unlock(&LOCK_global_system_variables);
}
diff --git a/sql/sql_acl.h b/sql/sql_acl.h
index 25a4766e58c..59409299f73 100644
--- a/sql/sql_acl.h
+++ b/sql/sql_acl.h
@@ -169,6 +169,7 @@ enum mysql_db_table_field
};
extern const TABLE_FIELD_DEF mysql_db_table_def;
+extern bool mysql_user_table_is_in_short_password_format;
/* Classes */
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 9a778e75a11..348f4305b02 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -1365,7 +1365,7 @@ void close_thread_tables(THD *thd)
good idea to turn off OPTION_TABLE_LOCK flag.
*/
DBUG_ASSERT(thd->lex->requires_prelocking());
- thd->options&= ~(OPTION_TABLE_LOCK);
+ thd->variables.option_bits&= ~(OPTION_TABLE_LOCK);
}
DBUG_VOID_RETURN;
@@ -1445,7 +1445,7 @@ void close_temporary_tables(THD *thd)
TABLE *table;
TABLE *next= NULL;
TABLE *prev_table;
- /* Assume thd->options has OPTION_QUOTE_SHOW_CREATE */
+ /* Assume thd->variables.option_bits has OPTION_QUOTE_SHOW_CREATE */
bool was_quote_show= TRUE;
if (!thd->temporary_tables)
@@ -1513,9 +1513,9 @@ void close_temporary_tables(THD *thd)
/* We always quote db,table names though it is slight overkill */
if (found_user_tables &&
- !(was_quote_show= test(thd->options & OPTION_QUOTE_SHOW_CREATE)))
+ !(was_quote_show= test(thd->variables.option_bits & OPTION_QUOTE_SHOW_CREATE)))
{
- thd->options |= OPTION_QUOTE_SHOW_CREATE;
+ thd->variables.option_bits |= OPTION_QUOTE_SHOW_CREATE;
}
/* scan sorted tmps to generate sequence of DROP */
@@ -1572,7 +1572,7 @@ void close_temporary_tables(THD *thd)
}
}
if (!was_quote_show)
- thd->options&= ~OPTION_QUOTE_SHOW_CREATE; /* restore option */
+ thd->variables.option_bits&= ~OPTION_QUOTE_SHOW_CREATE; /* restore option */
thd->temporary_tables=0;
}
@@ -4456,7 +4456,7 @@ bool fix_merge_after_open(TABLE_LIST *old_child_list, TABLE_LIST **old_last,
thr_lock_type read_lock_type_for_table(THD *thd, TABLE *table)
{
- bool log_on= mysql_bin_log.is_open() && (thd->options & OPTION_BIN_LOG);
+ bool log_on= mysql_bin_log.is_open() && (thd->variables.option_bits & OPTION_BIN_LOG);
ulong binlog_format= thd->variables.binlog_format;
if ((log_on == FALSE) || (binlog_format == BINLOG_FORMAT_ROW) ||
(table->s->table_category == TABLE_CATEGORY_PERFORMANCE))
@@ -5151,7 +5151,7 @@ int decide_logging_format(THD *thd, TABLE_LIST *tables)
This check here is needed to prevent some spurious error to be
raised in some cases (See BUG#42829).
*/
- if (mysql_bin_log.is_open() && (thd->options & OPTION_BIN_LOG) &&
+ if (mysql_bin_log.is_open() && (thd->variables.option_bits & OPTION_BIN_LOG) &&
(thd->variables.binlog_format != BINLOG_FORMAT_STMT ||
binlog_filter->db_ok(thd->db)))
{
@@ -5193,7 +5193,7 @@ int decide_logging_format(THD *thd, TABLE_LIST *tables)
DBUG_PRINT("info", ("flags_some_set: %s%s",
FLAGSTR(flags_some_set, HA_BINLOG_STMT_CAPABLE),
FLAGSTR(flags_some_set, HA_BINLOG_ROW_CAPABLE)));
- DBUG_PRINT("info", ("thd->variables.binlog_format: %ld",
+ DBUG_PRINT("info", ("thd->variables.binlog_format: %u",
thd->variables.binlog_format));
DBUG_PRINT("info", ("multi_engine: %s",
multi_engine ? "TRUE" : "FALSE"));
@@ -5334,7 +5334,7 @@ int lock_tables(THD *thd, TABLE_LIST *tables, uint count, bool *need_reopen)
if (thd->lex->requires_prelocking())
{
thd->in_lock_tables=1;
- thd->options|= OPTION_TABLE_LOCK;
+ thd->variables.option_bits|= OPTION_TABLE_LOCK;
/*
A query that modifies autoinc column in sub-statement can make the
master and slave inconsistent.
@@ -5355,7 +5355,7 @@ int lock_tables(THD *thd, TABLE_LIST *tables, uint count, bool *need_reopen)
{
if (thd->lex->requires_prelocking())
{
- thd->options&= ~(OPTION_TABLE_LOCK);
+ thd->variables.option_bits&= ~(OPTION_TABLE_LOCK);
thd->in_lock_tables=0;
}
DBUG_RETURN(-1);
@@ -5398,7 +5398,7 @@ int lock_tables(THD *thd, TABLE_LIST *tables, uint count, bool *need_reopen)
{
mysql_unlock_tables(thd, thd->locked_tables);
thd->locked_tables= 0;
- thd->options&= ~(OPTION_TABLE_LOCK);
+ thd->variables.option_bits&= ~(OPTION_TABLE_LOCK);
DBUG_RETURN(-1);
}
}
diff --git a/sql/sql_builtin.cc.in b/sql/sql_builtin.cc.in
index 3becdbaccfe..f8767949fe3 100644
--- a/sql/sql_builtin.cc.in
+++ b/sql/sql_builtin.cc.in
@@ -18,10 +18,16 @@
typedef struct st_mysql_plugin builtin_plugin[];
extern builtin_plugin
- builtin_binlog_plugin@mysql_plugin_defs@;
+ @mysql_mandatory_plugins@ @mysql_optional_plugins@ builtin_binlog_plugin;
-struct st_mysql_plugin *mysqld_builtins[]=
+struct st_mysql_plugin *mysql_optional_plugins[]=
{
- builtin_binlog_plugin@mysql_plugin_defs@,(struct st_mysql_plugin *)0
+ @mysql_optional_plugins@ 0
};
+struct st_mysql_plugin *mysql_mandatory_plugins[]=
+{
+ builtin_binlog_plugin, @mysql_mandatory_plugins@ 0
+};
+
+
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index 40316299366..07d36b1551a 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -407,13 +407,6 @@ static void debug_wait_for_kill(const char *info)
#define DUMP(C)
#endif
-const char *query_cache_type_names[]= { "OFF", "ON", "DEMAND",NullS };
-TYPELIB query_cache_type_typelib=
-{
- array_elements(query_cache_type_names)-1,"", query_cache_type_names, NULL
-};
-
-
/**
Serialize access to the query cache.
If the lock cannot be granted the thread hangs in a conditional wait which
@@ -1074,12 +1067,12 @@ Query_cache::Query_cache(ulong query_cache_limit_arg,
:query_cache_size(0),
query_cache_limit(query_cache_limit_arg),
queries_in_cache(0), hits(0), inserts(0), refused(0),
- total_blocks(0), lowmem_prunes(0),
+ total_blocks(0), lowmem_prunes(0), m_query_cache_is_disabled(FALSE),
min_allocation_unit(ALIGN_SIZE(min_allocation_unit_arg)),
min_result_data_size(ALIGN_SIZE(min_result_data_size_arg)),
def_query_hash_size(ALIGN_SIZE(def_query_hash_size_arg)),
def_table_hash_size(ALIGN_SIZE(def_table_hash_size_arg)),
- initialized(0), m_query_cache_is_disabled(FALSE)
+ initialized(0)
{
ulong min_needed= (ALIGN_SIZE(sizeof(Query_cache_block)) +
ALIGN_SIZE(sizeof(Query_cache_block_table)) +
@@ -1548,7 +1541,7 @@ def_week_frmt: %lu, in_trans: %d, autocommit: %d",
}
DBUG_PRINT("qcache", ("Query have result 0x%lx", (ulong) query));
- if ((thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) &&
+ if ((thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) &&
(query->tables_type() & HA_CACHE_TBL_TRANSACT))
{
DBUG_PRINT("qcache",
@@ -1706,7 +1699,7 @@ void Query_cache::invalidate(THD *thd, TABLE_LIST *tables_used,
DBUG_VOID_RETURN;
using_transactions= using_transactions &&
- (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
+ (thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
for (; tables_used; tables_used= tables_used->next_local)
{
DBUG_ASSERT(!using_transactions || tables_used->table!=0);
@@ -1791,7 +1784,7 @@ void Query_cache::invalidate(THD *thd, TABLE *table,
DBUG_VOID_RETURN;
using_transactions= using_transactions &&
- (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
+ (thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
if (using_transactions &&
(table->file->table_cache_type() == HA_CACHE_TBL_TRANSACT))
thd->add_changed_table(table);
@@ -1810,7 +1803,7 @@ void Query_cache::invalidate(THD *thd, const char *key, uint32 key_length,
DBUG_VOID_RETURN;
using_transactions= using_transactions &&
- (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
+ (thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
if (using_transactions) // used for innodb => has_transactions() is TRUE
thd->add_changed_table(key, key_length);
else
@@ -2159,7 +2152,7 @@ ulong Query_cache::init_cache()
(void) my_hash_init(&queries, &my_charset_bin, def_query_hash_size, 0, 0,
query_cache_query_get_key, 0, 0);
-#ifndef FN_NO_CASE_SENCE
+#ifndef FN_NO_CASE_SENSE
/*
If lower_case_table_names!=0 then db and table names are already
converted to lower case and we can use binary collation for their
@@ -3580,7 +3573,7 @@ Query_cache::is_cacheable(THD *thd, size_t query_len, const char *query,
tables_type)))
DBUG_RETURN(0);
- if ((thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) &&
+ if ((thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) &&
((*tables_type)&HA_CACHE_TBL_TRANSACT))
{
DBUG_PRINT("qcache", ("not in autocommin mode"));
diff --git a/sql/sql_cache.h b/sql/sql_cache.h
index 695d6fb4db3..33e535b2580 100644
--- a/sql/sql_cache.h
+++ b/sql/sql_cache.h
@@ -503,5 +503,4 @@ protected:
};
extern Query_cache query_cache;
-extern TYPELIB query_cache_type_typelib;
#endif
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 019c22d9dd2..53a96f8b9d9 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -296,7 +296,7 @@ void **thd_ha_data(const THD *thd, const struct handlerton *hton)
extern "C"
long long thd_test_options(const THD *thd, long long test_options)
{
- return thd->options & test_options;
+ return thd->variables.option_bits & test_options;
}
extern "C"
@@ -684,7 +684,7 @@ void THD::raise_note(uint sql_errno)
{
DBUG_ENTER("THD::raise_note");
DBUG_PRINT("enter", ("code: %d", sql_errno));
- if (!(this->options & OPTION_SQL_NOTES))
+ if (!(variables.option_bits & OPTION_SQL_NOTES))
DBUG_VOID_RETURN;
const char* msg= ER(sql_errno);
(void) raise_condition(sql_errno,
@@ -700,7 +700,7 @@ void THD::raise_note_printf(uint sql_errno, ...)
char ebuff[MYSQL_ERRMSG_SIZE];
DBUG_ENTER("THD::raise_note_printf");
DBUG_PRINT("enter",("code: %u", sql_errno));
- if (!(this->options & OPTION_SQL_NOTES))
+ if (!(variables.option_bits & OPTION_SQL_NOTES))
DBUG_VOID_RETURN;
const char* format= ER(sql_errno);
va_start(args, sql_errno);
@@ -721,7 +721,7 @@ MYSQL_ERROR* THD::raise_condition(uint sql_errno,
MYSQL_ERROR *cond= NULL;
DBUG_ENTER("THD::raise_condition");
- if (!(this->options & OPTION_SQL_NOTES) &&
+ if (!(variables.option_bits & OPTION_SQL_NOTES) &&
(level == MYSQL_ERROR::WARN_LEVEL_NOTE))
DBUG_RETURN(NULL);
@@ -887,12 +887,6 @@ void THD::init(void)
{
pthread_mutex_lock(&LOCK_global_system_variables);
plugin_thdvar_init(this);
- variables.time_format= date_time_format_copy((THD*) 0,
- variables.time_format);
- variables.date_format= date_time_format_copy((THD*) 0,
- variables.date_format);
- variables.datetime_format= date_time_format_copy((THD*) 0,
- variables.datetime_format);
/*
variables= global_system_variables above has reset
variables.pseudo_thread_id to 0. We need to correct it here to
@@ -903,12 +897,6 @@ void THD::init(void)
server_status= SERVER_STATUS_AUTOCOMMIT;
if (variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES)
server_status|= SERVER_STATUS_NO_BACKSLASH_ESCAPES;
- options= thd_startup_options;
-
- if (variables.max_join_size == HA_POS_ERROR)
- options |= OPTION_BIG_SELECTS;
- else
- options &= ~OPTION_BIG_SELECTS;
transaction.all.modified_non_trans_table= transaction.stmt.modified_non_trans_table= FALSE;
open_options=ha_open_options;
@@ -919,7 +907,7 @@ void THD::init(void)
update_charset();
reset_current_stmt_binlog_row_based();
bzero((char *) &status_var, sizeof(status_var));
- sql_log_bin_toplevel= options & OPTION_BIN_LOG;
+ sql_log_bin_toplevel= variables.option_bits & OPTION_BIN_LOG;
#if defined(ENABLED_DEBUG_SYNC)
/* Initialize the Debug Sync Facility. See debug_sync.cc. */
@@ -1012,10 +1000,6 @@ void THD::cleanup(void)
delete_dynamic(&user_var_events);
my_hash_free(&user_vars);
close_temporary_tables(this);
- my_free((char*) variables.time_format, MYF(MY_ALLOW_ZERO_PTR));
- my_free((char*) variables.date_format, MYF(MY_ALLOW_ZERO_PTR));
- my_free((char*) variables.datetime_format, MYF(MY_ALLOW_ZERO_PTR));
-
sp_cache_clear(&sp_proc_cache);
sp_cache_clear(&sp_func_cache);
@@ -1384,15 +1368,21 @@ bool THD::convert_string(String *s, CHARSET_INFO *from_cs, CHARSET_INFO *to_cs)
void THD::update_charset()
{
uint32 not_used;
- charset_is_system_charset= !String::needs_conversion(0,charset(),
- system_charset_info,
- &not_used);
+ charset_is_system_charset=
+ !String::needs_conversion(0,
+ variables.character_set_client,
+ system_charset_info,
+ &not_used);
charset_is_collation_connection=
- !String::needs_conversion(0,charset(),variables.collation_connection,
+ !String::needs_conversion(0,
+ variables.character_set_client,
+ variables.collation_connection,
&not_used);
charset_is_character_set_filesystem=
- !String::needs_conversion(0, charset(),
- variables.character_set_filesystem, &not_used);
+ !String::needs_conversion(0,
+ variables.character_set_client,
+ variables.character_set_filesystem,
+ &not_used);
}
@@ -1415,8 +1405,8 @@ void THD::add_changed_table(TABLE *table)
{
DBUG_ENTER("THD::add_changed_table(table)");
- DBUG_ASSERT((options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) &&
- table->file->has_transactions());
+ DBUG_ASSERT(variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
+ DBUG_ASSERT(table->file->has_transactions());
add_changed_table(table->s->table_cache_key.str,
(long) table->s->table_cache_key.length);
DBUG_VOID_RETURN;
@@ -3100,7 +3090,7 @@ extern "C" int thd_non_transactional_update(const MYSQL_THD thd)
extern "C" int thd_binlog_format(const MYSQL_THD thd)
{
- if (mysql_bin_log.is_open() && (thd->options & OPTION_BIN_LOG))
+ if (mysql_bin_log.is_open() && (thd->variables.option_bits & OPTION_BIN_LOG))
return (int) thd->variables.binlog_format;
else
return BINLOG_FORMAT_UNSPEC;
@@ -3161,7 +3151,7 @@ void THD::reset_sub_statement_state(Sub_statement_state *backup,
}
#endif
- backup->options= options;
+ backup->option_bits= variables.option_bits;
backup->in_sub_stmt= in_sub_stmt;
backup->enable_slow_log= enable_slow_log;
backup->limit_found_rows= limit_found_rows;
@@ -3178,10 +3168,10 @@ void THD::reset_sub_statement_state(Sub_statement_state *backup,
if ((!lex->requires_prelocking() || is_update_query(lex->sql_command)) &&
!current_stmt_binlog_row_based)
{
- options&= ~OPTION_BIN_LOG;
+ variables.option_bits&= ~OPTION_BIN_LOG;
}
- if ((backup->options & OPTION_BIN_LOG) && is_update_query(lex->sql_command)&&
+ if ((backup->option_bits & OPTION_BIN_LOG) && is_update_query(lex->sql_command)&&
!current_stmt_binlog_row_based)
mysql_bin_log.start_union_events(this, this->query_id);
@@ -3225,7 +3215,7 @@ void THD::restore_sub_statement_state(Sub_statement_state *backup)
(void)ha_release_savepoint(this, sv);
}
transaction.savepoints= backup->savepoints;
- options= backup->options;
+ variables.option_bits= backup->option_bits;
in_sub_stmt= backup->in_sub_stmt;
enable_slow_log= backup->enable_slow_log;
first_successful_insert_id_in_prev_stmt=
@@ -3243,7 +3233,7 @@ void THD::restore_sub_statement_state(Sub_statement_state *backup)
if (!in_sub_stmt)
is_fatal_sub_stmt_error= FALSE;
- if ((options & OPTION_BIN_LOG) && is_update_query(lex->sql_command) &&
+ if ((variables.option_bits & OPTION_BIN_LOG) && is_update_query(lex->sql_command) &&
!current_stmt_binlog_row_based)
mysql_bin_log.stop_union_events(this);
diff --git a/sql/sql_class.h b/sql/sql_class.h
index d3e3f2a48b6..03f06e5aa26 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -309,7 +309,7 @@ class Time_zone;
#define THD_CHECK_SENTRY(thd) DBUG_ASSERT(thd->dbug_sentry == THD_SENTRY_MAGIC)
-struct system_variables
+typedef struct system_variables
{
/*
How dynamically allocated system variables are handled:
@@ -326,10 +326,12 @@ struct system_variables
uint dynamic_variables_size; /* how many bytes are in use */
ulonglong myisam_max_extra_sort_file_size;
- ulonglong myisam_max_sort_file_size;
ulonglong max_heap_table_size;
ulonglong tmp_table_size;
ulonglong long_query_time;
+ ulonglong optimizer_switch;
+ ulonglong sql_mode; ///< which non-standard SQL behaviour should be enabled
+ ulonglong option_bits; ///< OPTION_xxx constants, e.g. OPTION_PROFILING
ha_rows select_limit;
ha_rows max_join_size;
ulong auto_increment_increment, auto_increment_offset;
@@ -343,9 +345,6 @@ struct system_variables
ulong max_insert_delayed_threads;
ulong min_examined_row_limit;
ulong multi_range_count;
- ulong myisam_repair_threads;
- ulong myisam_sort_buff_size;
- ulong myisam_stats_method;
ulong net_buffer_length;
ulong net_interactive_timeout;
ulong net_read_timeout;
@@ -354,23 +353,13 @@ struct system_variables
ulong net_write_timeout;
ulong optimizer_prune_level;
ulong optimizer_search_depth;
- /* A bitmap for switching optimizations on/off */
- ulong optimizer_switch;
ulong preload_buff_size;
ulong profiling_history_size;
- ulong query_cache_type;
ulong read_buff_size;
ulong read_rnd_buff_size;
ulong div_precincrement;
ulong sortbuff_size;
- ulong thread_handling;
- ulong tx_isolation;
- ulong completion_type;
- /* Determines which non-standard SQL behaviour should be enabled */
- ulong sql_mode;
ulong max_sp_recursion_depth;
- /* check of key presence in updatable view */
- ulong updatable_views_with_limit;
ulong default_week_format;
ulong max_seeks_for_key;
ulong range_alloc_block_size;
@@ -380,11 +369,14 @@ struct system_variables
ulong trans_prealloc_size;
ulong log_warnings;
ulong group_concat_max_len;
- ulong ndb_autoincrement_prefetch_sz;
- ulong ndb_index_stat_cache_entries;
- ulong ndb_index_stat_update_freq;
- ulong binlog_format; // binlog format for this thd (see enum_binlog_format)
- /*
+
+ uint binlog_format; ///< binlog format for this thd (see enum_binlog_format)
+ uint completion_type;
+ uint query_cache_type;
+ uint tx_isolation;
+ uint updatable_views_with_limit;
+ uint max_user_connections;
+ /**
In slave thread we need to know in behalf of which
thread the query is being run to replicate temp tables properly
*/
@@ -392,22 +384,13 @@ struct system_variables
my_bool low_priority_updates;
my_bool new_mode;
- /*
- compatibility option:
- - index usage hints (USE INDEX without a FOR clause) behave as in 5.0
- */
- my_bool old_mode;
my_bool query_cache_wlock_invalidate;
my_bool engine_condition_pushdown;
my_bool keep_files_on_create;
- my_bool ndb_force_send;
- my_bool ndb_use_copying_alter_table;
- my_bool ndb_use_exact_count;
- my_bool ndb_use_transactions;
- my_bool ndb_index_stat_enable;
my_bool old_alter_table;
my_bool old_passwords;
+ my_bool big_tables;
plugin_ref table_plugin;
@@ -428,12 +411,10 @@ struct system_variables
Time_zone *time_zone;
- /* DATE, DATETIME and MYSQL_TIME formats */
- DATE_TIME_FORMAT *date_format;
- DATE_TIME_FORMAT *datetime_format;
- DATE_TIME_FORMAT *time_format;
my_bool sysdate_is_now;
-};
+
+ double long_query_time_double;
+} SV;
/* per thread status variables */
@@ -1015,7 +996,7 @@ public:
class Sub_statement_state
{
public:
- ulonglong options;
+ ulonglong option_bits;
ulonglong first_successful_insert_id_in_prev_stmt;
ulonglong first_successful_insert_id_in_cur_stmt, insert_id_for_cur_row;
Discrete_interval auto_inc_interval_for_cur_row;
@@ -1307,7 +1288,6 @@ public:
*/
const char *where;
- double tmp_double_value; /* Used in set_var.cc */
ulong client_capabilities; /* What the client supports */
ulong max_client_packet_length;
@@ -1618,7 +1598,6 @@ public:
}
ulonglong limit_found_rows;
- ulonglong options; /* Bitmap of states */
longlong row_count_func; /* For the ROW_COUNT() function */
ha_rows cuted_fields;
@@ -2371,10 +2350,10 @@ my_eof(THD *thd)
}
#define tmp_disable_binlog(A) \
- {ulonglong tmp_disable_binlog__save_options= (A)->options; \
- (A)->options&= ~OPTION_BIN_LOG
+ {ulonglong tmp_disable_binlog__save_options= (A)->variables.option_bits; \
+ (A)->variables.option_bits&= ~OPTION_BIN_LOG
-#define reenable_binlog(A) (A)->options= tmp_disable_binlog__save_options;}
+#define reenable_binlog(A) (A)->variables.option_bits= tmp_disable_binlog__save_options;}
/*
diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc
index 8ecafce6f93..a966d4a6bd4 100644
--- a/sql/sql_connect.cc
+++ b/sql/sql_connect.cc
@@ -121,8 +121,9 @@ int check_for_max_user_connections(THD *thd, USER_CONN *uc)
DBUG_ENTER("check_for_max_user_connections");
(void) pthread_mutex_lock(&LOCK_user_conn);
- if (max_user_connections && !uc->user_resources.user_conn &&
- max_user_connections < (uint) uc->connections)
+ if (global_system_variables.max_user_connections &&
+ !uc->user_resources.user_conn &&
+ global_system_variables.max_user_connections < (uint) uc->connections)
{
my_error(ER_TOO_MANY_USER_CONNECTIONS, MYF(0), uc->user);
error=1;
@@ -443,7 +444,7 @@ check_user(THD *thd, enum enum_server_command command,
/* Don't allow user to connect if he has done too many queries */
if ((ur.questions || ur.updates || ur.conn_per_hour || ur.user_conn ||
- max_user_connections) &&
+ global_system_variables.max_user_connections) &&
get_or_create_user_conn(thd,
(opt_old_style_user_limits ? thd->main_security_ctx.user :
thd->main_security_ctx.priv_user),
@@ -457,7 +458,7 @@ check_user(THD *thd, enum enum_server_command command,
if (thd->user_connect &&
(thd->user_connect->user_resources.conn_per_hour ||
thd->user_connect->user_resources.user_conn ||
- max_user_connections) &&
+ global_system_variables.max_user_connections) &&
check_for_max_user_connections(thd, thd->user_connect))
{
/* The error is set in check_for_max_user_connections(). */
@@ -1052,8 +1053,6 @@ static void prepare_new_connection_state(THD* thd)
netware_reg_user(sctx->ip, sctx->user, "MySQL");
#endif
- if (thd->variables.max_join_size == HA_POS_ERROR)
- thd->options |= OPTION_BIG_SELECTS;
if (thd->client_capabilities & CLIENT_COMPRESS)
thd->net.compress=1; // Use compression
@@ -1068,9 +1067,9 @@ static void prepare_new_connection_state(THD* thd)
thd->set_time();
thd->init_for_queries();
- if (sys_init_connect.value_length && !(sctx->master_access & SUPER_ACL))
+ if (opt_init_connect.length && !(sctx->master_access & SUPER_ACL))
{
- execute_init_command(thd, &sys_init_connect, &LOCK_sys_init_connect);
+ execute_init_command(thd, &opt_init_connect, &LOCK_sys_init_connect);
if (thd->is_error())
{
thd->killed= THD::KILL_CONNECTION;
diff --git a/sql/sql_cursor.cc b/sql/sql_cursor.cc
index 533b47e61da..66c4460c1cd 100644
--- a/sql/sql_cursor.cc
+++ b/sql/sql_cursor.cc
@@ -721,7 +721,7 @@ bool Select_materialize::send_result_set_metadata(List<Item> &list, uint flags)
{
DBUG_ASSERT(table == 0);
if (create_result_table(unit->thd, unit->get_unit_column_types(),
- FALSE, thd->options | TMP_TABLE_ALL_COLUMNS, ""))
+ FALSE, thd->variables.option_bits | TMP_TABLE_ALL_COLUMNS, ""))
return TRUE;
materialized_cursor= new (&table->mem_root)
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index ab898950a1d..086aacb495e 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -92,7 +92,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
}
const_cond= (!conds || conds->const_item());
- safe_update=test(thd->options & OPTION_SAFE_UPDATES);
+ safe_update=test(thd->variables.option_bits & OPTION_SAFE_UPDATES);
if (safe_update && const_cond)
{
my_message(ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE,
@@ -631,7 +631,7 @@ multi_delete::initialize_tables(JOIN *join)
Unique **tempfiles_ptr;
DBUG_ENTER("initialize_tables");
- if ((thd->options & OPTION_SAFE_UPDATES) && error_if_full_join(join))
+ if ((thd->variables.option_bits & OPTION_SAFE_UPDATES) && error_if_full_join(join))
DBUG_RETURN(1);
table_map tables_to_delete_from=0;
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc
index 9b747759ece..24088872471 100644
--- a/sql/sql_derived.cc
+++ b/sql/sql_derived.cc
@@ -154,7 +154,7 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *orig_table_list)
if ((res= check_duplicate_names(unit->types, 0)))
goto exit;
- create_options= (first_select->options | thd->options |
+ create_options= (first_select->options | thd->variables.option_bits |
TMP_TABLE_ALL_COLUMNS);
/*
Temp table is created so that it hounours if UNION without ALL is to be
@@ -289,7 +289,7 @@ bool mysql_derived_filling(THD *thd, LEX *lex, TABLE_LIST *orig_table_list)
(ORDER *) first_select->order_list.first,
(ORDER *) first_select->group_list.first,
first_select->having, (ORDER*) NULL,
- (first_select->options | thd->options |
+ (first_select->options | thd->variables.option_bits |
SELECT_NO_UNLOCK),
derived_result, unit, first_select);
}
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 147e03ddf55..c774cb4f3ad 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -455,7 +455,7 @@ void upgrade_lock_type(THD *thd, thr_lock_type *lock_type,
return;
}
- bool log_on= (thd->options & OPTION_BIN_LOG ||
+ bool log_on= (thd->variables.option_bits & OPTION_BIN_LOG ||
! (thd->security_ctx->master_access & SUPER_ACL));
if (global_system_variables.binlog_format == BINLOG_FORMAT_STMT &&
log_on && mysql_bin_log.is_open() && is_multi_insert)
@@ -607,7 +607,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
By default, both logs are enabled (this won't cause problems if the server
runs without --log-update or --log-bin).
*/
- bool log_on= ((thd->options & OPTION_BIN_LOG) ||
+ bool log_on= ((thd->variables.option_bits & OPTION_BIN_LOG) ||
(!(thd->security_ctx->master_access & SUPER_ACL)));
#endif
thr_lock_type lock_type;
@@ -976,7 +976,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
if (error)
goto abort;
- if (values_list.elements == 1 && (!(thd->options & OPTION_WARNINGS) ||
+ if (values_list.elements == 1 && (!(thd->variables.option_bits & OPTION_WARNINGS) ||
!thd->cuted_fields))
{
thd->row_count_func= info.copied + info.deleted +
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index e80d9dfcb3f..27f099ef9ef 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -33,15 +33,23 @@ class sp_pcontext;
class st_alter_tablespace;
class partition_info;
class Event_parse_data;
+class set_var_base;
+class sys_var;
+
+/**
+ used by the parser to store internal variable name
+*/
+struct sys_var_with_base
+{
+ sys_var *var;
+ LEX_STRING base_name;
+};
#ifdef MYSQL_SERVER
/*
The following hack is needed because mysql_yacc.cc does not define
YYSTYPE before including this file
*/
-
-#include "set_var.h"
-
#ifdef MYSQL_YACC
#define LEX_YYSTYPE void *
#else
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 0774e373908..63a8c17e145 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -30,6 +30,7 @@
#include "sql_trigger.h"
#include "sql_prepare.h"
#include "probes_mysql.h"
+#include "set_var.h"
/**
@defgroup Runtime_Environment Runtime Environment
@@ -134,7 +135,7 @@ static bool xa_trans_rollback(THD *thd)
bool status= test(ha_rollback(thd));
- thd->options&= ~(ulong) OPTION_BEGIN;
+ thd->variables.option_bits&= ~(ulong) OPTION_BEGIN;
thd->transaction.all.modified_non_trans_table= FALSE;
thd->server_status&= ~SERVER_STATUS_IN_TRANS;
xid_cache_delete(&thd->transaction.xid_state);
@@ -169,18 +170,18 @@ bool end_active_trans(THD *thd)
xa_state_names[thd->transaction.xid_state.xa_state]);
DBUG_RETURN(1);
}
- if (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN |
+ if (thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN |
OPTION_TABLE_LOCK))
{
- DBUG_PRINT("info",("options: 0x%llx", thd->options));
+ DBUG_PRINT("info",("options: 0x%llx", thd->variables.option_bits));
/* Safety if one did "drop table" on locked tables */
if (!thd->locked_tables)
- thd->options&= ~OPTION_TABLE_LOCK;
+ thd->variables.option_bits&= ~OPTION_TABLE_LOCK;
thd->server_status&= ~SERVER_STATUS_IN_TRANS;
if (ha_commit(thd))
error=1;
}
- thd->options&= ~(OPTION_BEGIN | OPTION_KEEP_LOG);
+ thd->variables.option_bits&= ~(OPTION_BEGIN | OPTION_KEEP_LOG);
thd->transaction.all.modified_non_trans_table= FALSE;
DBUG_RETURN(error);
}
@@ -204,7 +205,7 @@ bool begin_trans(THD *thd)
error= -1;
else
{
- thd->options|= OPTION_BEGIN;
+ thd->variables.option_bits|= OPTION_BEGIN;
thd->server_status|= SERVER_STATUS_IN_TRANS;
}
return error;
@@ -374,25 +375,34 @@ bool is_log_table_write_query(enum enum_sql_command command)
return (sql_command_flags[command] & CF_WRITE_LOGS_COMMAND) != 0;
}
-void execute_init_command(THD *thd, sys_var_str *init_command_var,
- rw_lock_t *var_mutex)
+void execute_init_command(THD *thd, LEX_STRING *init_command,
+ rw_lock_t *var_lock)
{
Vio* save_vio;
ulong save_client_capabilities;
+ rw_rdlock(var_lock);
+ if (!init_command->length)
+ {
+ rw_unlock(var_lock);
+ return;
+ }
+
+ /*
+ copy the value under a lock, and release the lock.
+ init_command has to be executed without a lock held,
+ as it may try to change itself
+ */
+ size_t len= init_command->length;
+ char *buf= thd->strmake(init_command->str, len);
+ rw_unlock(var_lock);
+
#if defined(ENABLED_PROFILING)
thd->profiling.start_new_query();
- thd->profiling.set_query_source(init_command_var->value,
- init_command_var->value_length);
+ thd->profiling.set_query_source(buf, len);
#endif
thd_proc_info(thd, "Execution of init_command");
- /*
- We need to lock init_command_var because
- during execution of init_command_var query
- values of init_command_var can't be changed
- */
- rw_rdlock(var_mutex);
save_client_capabilities= thd->client_capabilities;
thd->client_capabilities|= CLIENT_MULTI_QUERIES;
/*
@@ -401,10 +411,7 @@ void execute_init_command(THD *thd, sys_var_str *init_command_var,
*/
save_vio= thd->net.vio;
thd->net.vio= 0;
- dispatch_command(COM_QUERY, thd,
- init_command_var->value,
- init_command_var->value_length);
- rw_unlock(var_mutex);
+ dispatch_command(COM_QUERY, thd, buf, len);
thd->client_capabilities= save_client_capabilities;
thd->net.vio= save_vio;
@@ -427,9 +434,6 @@ static void handle_bootstrap_impl(THD *thd)
thd->thread_stack= (char*) &thd;
#endif /* EMBEDDED_LIBRARY */
- if (thd->variables.max_join_size == HA_POS_ERROR)
- thd->options |= OPTION_BIG_SELECTS;
-
thd_proc_info(thd, 0);
thd->version=refresh_version;
thd->security_ctx->priv_user=
@@ -657,7 +661,7 @@ int end_trans(THD *thd, enum enum_mysql_completiontype completion)
*/
thd->server_status&= ~SERVER_STATUS_IN_TRANS;
res= ha_commit(thd);
- thd->options&= ~(OPTION_BEGIN | OPTION_KEEP_LOG);
+ thd->variables.option_bits&= ~(OPTION_BEGIN | OPTION_KEEP_LOG);
thd->transaction.all.modified_non_trans_table= FALSE;
break;
case COMMIT_RELEASE:
@@ -675,7 +679,7 @@ int end_trans(THD *thd, enum enum_mysql_completiontype completion)
thd->server_status&= ~SERVER_STATUS_IN_TRANS;
if (ha_rollback(thd))
res= -1;
- thd->options&= ~(OPTION_BEGIN | OPTION_KEEP_LOG);
+ thd->variables.option_bits&= ~(OPTION_BEGIN | OPTION_KEEP_LOG);
thd->transaction.all.modified_non_trans_table= FALSE;
if (!res && (completion == ROLLBACK_AND_CHAIN))
res= begin_trans(thd);
@@ -728,7 +732,7 @@ bool do_command(THD *thd)
This thread will do a blocking read from the client which
will be interrupted when the next command is received from
the client, the connection is closed or "net_wait_timeout"
- number of seconds has passed
+ number of seconds has passed.
*/
my_net_set_read_timeout(net, thd->variables.net_wait_timeout);
@@ -1847,8 +1851,6 @@ bool sp_process_definer(THD *thd)
TODO: this is workaround. right way will be move invalidating in
the unlock procedure.
- TODO: use check_change_password()
- - JOIN is not supported yet. TODO
- - SUSPEND and FOR MIGRATE are not supported yet. TODO
@retval
FALSE OK
@@ -2541,7 +2543,7 @@ case SQLCOM_PREPARE:
{
/* So that CREATE TEMPORARY TABLE gets to binlog at commit/rollback */
if (create_info.options & HA_LEX_CREATE_TMP_TABLE)
- thd->options|= OPTION_KEEP_LOG;
+ thd->variables.option_bits|= OPTION_KEEP_LOG;
/* regular create */
if (create_info.options & HA_LEX_CREATE_TABLE_LIKE)
res= mysql_create_like_table(thd, create_table, select_tables,
@@ -3262,7 +3264,7 @@ end_with_restore_list:
select_lex->where,
0, (ORDER *)NULL, (ORDER *)NULL, (Item *)NULL,
(ORDER *)NULL,
- select_lex->options | thd->options |
+ select_lex->options | thd->variables.option_bits |
SELECT_NO_JOIN_CACHE | SELECT_NO_UNLOCK |
OPTION_SETUP_TABLES_DONE,
del_result, unit, select_lex);
@@ -3303,7 +3305,7 @@ end_with_restore_list:
lex->drop_if_exists= 1;
/* So that DROP TEMPORARY TABLE gets to binlog at commit/rollback */
- thd->options|= OPTION_KEEP_LOG;
+ thd->variables.option_bits|= OPTION_KEEP_LOG;
}
/* DDL and binlog write order protected by LOCK_open */
res= mysql_rm_table(thd, first_table, lex->drop_if_exists,
@@ -3392,11 +3394,6 @@ end_with_restore_list:
if ((check_table_access(thd, SELECT_ACL, all_tables, FALSE, UINT_MAX, FALSE)
|| open_and_lock_tables(thd, all_tables)))
goto error;
- if (lex->one_shot_set && not_all_support_one_shot(lex_var_list))
- {
- my_error(ER_RESERVED_SYNTAX, MYF(0), "SET ONE_SHOT");
- goto error;
- }
if (!(res= sql_set_variables(thd, lex_var_list)))
{
/*
@@ -3429,10 +3426,10 @@ end_with_restore_list:
false, mysqldump will not work.
*/
unlock_locked_tables(thd);
- if (thd->options & OPTION_TABLE_LOCK)
+ if (thd->variables.option_bits & OPTION_TABLE_LOCK)
{
end_active_trans(thd);
- thd->options&= ~(OPTION_TABLE_LOCK);
+ thd->variables.option_bits&= ~OPTION_TABLE_LOCK;
}
if (thd->global_read_lock)
unlock_global_read_lock(thd);
@@ -3450,7 +3447,7 @@ end_with_restore_list:
!(need_start_waiting= !wait_if_global_read_lock(thd, 0, 1)))
goto error;
thd->in_lock_tables=1;
- thd->options|= OPTION_TABLE_LOCK;
+ thd->variables.option_bits |= OPTION_TABLE_LOCK;
if (!(res= simple_open_n_lock_tables(thd, all_tables)))
{
@@ -3471,7 +3468,6 @@ end_with_restore_list:
*/
ha_autocommit_or_rollback(thd, 1);
end_active_trans(thd);
- thd->options&= ~(OPTION_TABLE_LOCK);
}
thd->in_lock_tables=0;
break;
@@ -4037,7 +4033,7 @@ end_with_restore_list:
res= TRUE; // cannot happen
else
{
- if (((thd->options & OPTION_KEEP_LOG) ||
+ if (((thd->variables.option_bits & OPTION_KEEP_LOG) ||
thd->transaction.all.modified_non_trans_table) &&
!thd->slave_thread)
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
@@ -4052,7 +4048,7 @@ end_with_restore_list:
break;
}
case SQLCOM_SAVEPOINT:
- if (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN) ||
+ if (!(thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN) ||
thd->in_sub_stmt) || !opt_using_transactions)
my_ok(thd);
else
@@ -4609,7 +4605,7 @@ create_sp_error:
break;
}
if (thd->lex->xa_opt != XA_NONE)
- { // JOIN is not supported yet. TODO
+ { /// @todo JOIN is not supported yet.
my_error(ER_XAER_INVAL, MYF(0));
break;
}
@@ -4635,14 +4631,14 @@ create_sp_error:
thd->transaction.xid_state.xid.set(thd->lex->xid);
xid_cache_insert(&thd->transaction.xid_state);
thd->transaction.all.modified_non_trans_table= FALSE;
- thd->options= ((thd->options & ~(OPTION_KEEP_LOG)) | OPTION_BEGIN);
+ thd->variables.option_bits= ((thd->variables.option_bits & ~(OPTION_KEEP_LOG)) | OPTION_BEGIN);
thd->server_status|= SERVER_STATUS_IN_TRANS;
my_ok(thd);
break;
case SQLCOM_XA_END:
/* fake it */
if (thd->lex->xa_opt != XA_NONE)
- { // SUSPEND and FOR MIGRATE are not supported yet. TODO
+ { /// @todo SUSPEND and FOR MIGRATE are not supported yet.
my_error(ER_XAER_INVAL, MYF(0));
break;
}
@@ -4741,7 +4737,7 @@ create_sp_error:
xa_state_names[thd->transaction.xid_state.xa_state]);
break;
}
- thd->options&= ~(OPTION_BEGIN | OPTION_KEEP_LOG);
+ thd->variables.option_bits&= ~(OPTION_BEGIN | OPTION_KEEP_LOG);
thd->transaction.all.modified_non_trans_table= FALSE;
thd->server_status&= ~SERVER_STATUS_IN_TRANS;
xid_cache_delete(&thd->transaction.xid_state);
@@ -5470,7 +5466,7 @@ check_routine_access(THD *thd, ulong want_access,char *db, char *name,
0, no_errors, 0))
return TRUE;
- return check_grant_routine(thd, want_access, tables, is_proc, no_errors);
+ return check_grant_routine(thd, want_access, tables, is_proc, no_errors);
}
@@ -5694,9 +5690,9 @@ void mysql_reset_thd_for_next_command(THD *thd)
OPTION_STATUS_NO_TRANS_UPDATE | OPTION_KEEP_LOG to not get warnings
in ha_rollback_trans() about some tables couldn't be rolled back.
*/
- if (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))
+ if (!(thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))
{
- thd->options&= ~OPTION_KEEP_LOG;
+ thd->variables.option_bits&= ~OPTION_KEEP_LOG;
thd->transaction.all.modified_non_trans_table= FALSE;
}
DBUG_ASSERT(thd->security_ctx== &thd->main_security_ctx);
@@ -7305,7 +7301,7 @@ bool multi_delete_precheck(THD *thd, TABLE_LIST *tables)
}
thd->lex->query_tables_own_last= save_query_tables_own_last;
- if ((thd->options & OPTION_SAFE_UPDATES) && !select_lex->where)
+ if ((thd->variables.option_bits & OPTION_SAFE_UPDATES) && !select_lex->where)
{
my_message(ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE,
ER(ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE), MYF(0));
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index b6112e51565..a5ae5d24796 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -1977,11 +1977,11 @@ static int add_part_field_list(File fptr, List<char> field_list)
const char *field_str= part_it++;
String field_string("", 0, system_charset_info);
THD *thd= current_thd;
- ulonglong save_options= thd->options;
- thd->options= 0;
+ ulonglong save_options= thd->variables.option_bits;
+ thd->variables.option_bits= 0;
append_identifier(thd, &field_string, field_str,
strlen(field_str));
- thd->options= save_options;
+ thd->variables.option_bits= save_options;
err+= add_string_object(fptr, &field_string);
if (i != (num_fields-1))
err+= add_comma(fptr);
@@ -1996,12 +1996,12 @@ static int add_name_string(File fptr, const char *name)
int err;
String name_string("", 0, system_charset_info);
THD *thd= current_thd;
- ulonglong save_options= thd->options;
+ ulonglong save_options= thd->variables.option_bits;
- thd->options= 0;
+ thd->variables.option_bits= 0;
append_identifier(thd, &name_string, name,
strlen(name));
- thd->options= save_options;
+ thd->variables.option_bits= save_options;
err= add_string_object(fptr, &name_string);
return err;
}
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index 4d60caf2931..953f0b3c680 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -13,13 +13,14 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include "mysql_priv.h"
+#include "sys_vars_shared.h"
#include <my_pthread.h>
#include <my_getopt.h>
#define REPORT_TO_LOG 1
#define REPORT_TO_USER 2
-extern struct st_mysql_plugin *mysqld_builtins[];
+extern struct st_mysql_plugin *mysql_optional_plugins[];
+extern struct st_mysql_plugin *mysql_mandatory_plugins[];
/**
@note The order of the enumeration is critical.
@@ -164,6 +165,8 @@ struct st_mysql_sys_var
MYSQL_PLUGIN_VAR_HEADER;
};
+static SHOW_TYPE pluginvar_show_type(st_mysql_sys_var *plugin_var);
+
/*
sys_var class for access to all plugin variables visible to the user
@@ -173,28 +176,44 @@ class sys_var_pluginvar: public sys_var
public:
struct st_plugin_int *plugin;
struct st_mysql_sys_var *plugin_var;
+ /**
+ variable name from whatever is hard-coded in the plugin source
+ and doesn't have pluginname- prefix is replaced by an allocated name
+ with a plugin prefix. When plugin is uninstalled we need to restore the
+ pointer to point to the hard-coded value, because plugin may be
+ installed/uninstalled many times without reloading the shared object.
+ */
+ const char *orig_pluginvar_name;
static void *operator new(size_t size, MEM_ROOT *mem_root)
- { return (void*) alloc_root(mem_root, (uint) size); }
+ { return (void*) alloc_root(mem_root, size); }
static void operator delete(void *ptr_arg,size_t size)
{ TRASH(ptr_arg, size); }
- sys_var_pluginvar(const char *name_arg,
+ sys_var_pluginvar(sys_var_chain *chain, const char *name_arg,
struct st_mysql_sys_var *plugin_var_arg)
- :sys_var(name_arg), plugin_var(plugin_var_arg) {}
+ :sys_var(chain, name_arg, plugin_var_arg->comment,
+ (plugin_var_arg->flags & PLUGIN_VAR_THDLOCAL ? SESSION : GLOBAL) |
+ (plugin_var_arg->flags & PLUGIN_VAR_READONLY ? READONLY : 0),
+ 0, -1, NO_ARG, pluginvar_show_type(plugin_var_arg), 0, 0,
+ VARIABLE_NOT_IN_BINLOG, 0, 0, 0, 0),
+ plugin_var(plugin_var_arg), orig_pluginvar_name(plugin_var_arg->name)
+ { plugin_var->name= name_arg; }
sys_var_pluginvar *cast_pluginvar() { return this; }
- bool is_readonly() const { return plugin_var->flags & PLUGIN_VAR_READONLY; }
- bool check_type(enum_var_type type)
- { return !(plugin_var->flags & PLUGIN_VAR_THDLOCAL) && type != OPT_GLOBAL; }
bool check_update_type(Item_result type);
SHOW_TYPE show_type();
uchar* real_value_ptr(THD *thd, enum_var_type type);
TYPELIB* plugin_var_typelib(void);
- uchar* value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
- bool check(THD *thd, set_var *var);
- bool check_default(enum_var_type type) { return is_readonly(); }
- void set_default(THD *thd, enum_var_type type);
- bool update(THD *thd, set_var *var);
+ uchar* do_value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
+ uchar* session_value_ptr(THD *thd, LEX_STRING *base)
+ { return do_value_ptr(thd, OPT_SESSION, base); }
+ uchar* global_value_ptr(THD *thd, LEX_STRING *base)
+ { return do_value_ptr(thd, OPT_GLOBAL, base); }
+ bool do_check(THD *thd, set_var *var);
+ virtual void session_save_default(THD *thd, set_var *var) {}
+ virtual void global_save_default(THD *thd, set_var *var) {}
+ bool session_update(THD *thd, set_var *var);
+ bool global_update(THD *thd, set_var *var);
};
@@ -209,8 +228,9 @@ static bool register_builtin(struct st_mysql_plugin *, struct st_plugin_int *,
static void unlock_variables(THD *thd, struct system_variables *vars);
static void cleanup_variables(THD *thd, struct system_variables *vars);
static void plugin_vars_free_values(sys_var *vars);
-static void plugin_opt_set_limits(struct my_option *options,
- const struct st_mysql_sys_var *opt);
+static void restore_pluginvar_names(sys_var *first);
+static void plugin_opt_set_limits(struct my_option *,
+ const struct st_mysql_sys_var *);
#define my_intern_plugin_lock(A,B) intern_plugin_lock(A,B CALLER_INFO)
#define my_intern_plugin_lock_ci(A,B) intern_plugin_lock(A,B ORIG_CALLER_INFO)
static plugin_ref intern_plugin_lock(LEX *lex, plugin_ref plugin
@@ -218,12 +238,6 @@ static plugin_ref intern_plugin_lock(LEX *lex, plugin_ref plugin
static void intern_plugin_unlock(LEX *lex, plugin_ref plugin);
static void reap_plugins(void);
-
-/* declared in set_var.cc */
-extern sys_var *intern_find_sys_var(const char *str, uint length, bool no_error);
-extern bool throw_bounds_warning(THD *thd, bool fixed, bool unsignd,
- const char *name, longlong val);
-
#ifdef EMBEDDED_LIBRARY
/* declared in sql_base.cc */
extern bool check_if_table_exists(THD *thd, TABLE_LIST *table, bool *exists);
@@ -289,6 +303,11 @@ static int item_val_int(struct st_mysql_value *value, long long *buf)
return 0;
}
+static int item_is_unsigned(struct st_mysql_value *value)
+{
+ Item *item= ((st_item_value_holder*)value)->item;
+ return item->unsigned_flag;
+}
static int item_val_real(struct st_mysql_value *value, double *buf)
{
@@ -617,10 +636,10 @@ bool plugin_is_ready(const LEX_STRING *name, int type)
}
-SHOW_COMP_OPTION sys_var_have_plugin::get_option()
+SHOW_COMP_OPTION plugin_status(const char *name, int len, size_t type)
{
- LEX_STRING plugin_name= { (char *) plugin_name_str, plugin_name_len };
- return plugin_status(&plugin_name, plugin_type);
+ LEX_STRING plugin_name= { (char *) name, len };
+ return plugin_status(&plugin_name, type);
}
@@ -776,6 +795,7 @@ static bool plugin_add(MEM_ROOT *tmp_root,
tmp_plugin_ptr->state= PLUGIN_IS_FREED;
}
mysql_del_sys_var_chain(tmp.system_vars);
+ restore_pluginvar_names(tmp.system_vars);
goto err;
/* plugin was disabled */
@@ -802,12 +822,12 @@ static void plugin_deinitialize(struct st_plugin_int *plugin, bool ref_check)
if (plugin->plugin->status_vars)
{
#ifdef FIX_LATER
- /*
- We have a problem right now where we can not prepend without
- breaking backwards compatibility. We will fix this shortly so
- that engines have "use names" and we wil use those for
- CREATE TABLE, and use the plugin name then for adding automatic
- variable names.
+ /**
+ @todo
+ unfortunately, status variables were introduced without a
+ pluginname_ namespace, that is pluginname_ was not added automatically
+ to status variable names. It should be fixed together with the next
+ incompatible API change.
*/
SHOW_VAR array[2]= {
{plugin->plugin->name, (char*)plugin->plugin->status_vars, SHOW_ARRAY},
@@ -847,21 +867,21 @@ static void plugin_deinitialize(struct st_plugin_int *plugin, bool ref_check)
plugin->name.str, plugin->ref_count);
}
-
static void plugin_del(struct st_plugin_int *plugin)
{
DBUG_ENTER("plugin_del(plugin)");
safe_mutex_assert_owner(&LOCK_plugin);
/* Free allocated strings before deleting the plugin. */
+ rw_wrlock(&LOCK_system_variables_hash);
+ mysql_del_sys_var_chain(plugin->system_vars);
+ rw_unlock(&LOCK_system_variables_hash);
+ restore_pluginvar_names(plugin->system_vars);
plugin_vars_free_values(plugin->system_vars);
my_hash_delete(&plugin_hash[plugin->plugin->type], (uchar*)plugin);
if (plugin->plugin_dl)
plugin_dl_del(&plugin->plugin_dl->dl);
plugin->state= PLUGIN_IS_FREED;
plugin_array_version++;
- rw_wrlock(&LOCK_system_variables_hash);
- mysql_del_sys_var_chain(plugin->system_vars);
- rw_unlock(&LOCK_system_variables_hash);
free_root(&plugin->mem_root, MYF(0));
DBUG_VOID_RETURN;
}
@@ -1002,6 +1022,7 @@ void plugin_unlock_list(THD *thd, plugin_ref *list, uint count)
static int plugin_initialize(struct st_plugin_int *plugin)
{
+ int ret= 1;
DBUG_ENTER("plugin_initialize");
safe_mutex_assert_owner(&LOCK_plugin);
@@ -1063,9 +1084,15 @@ static int plugin_initialize(struct st_plugin_int *plugin)
}
}
- DBUG_RETURN(0);
+ ret= 0;
+
err:
- DBUG_RETURN(1);
+ /* maintain the obsolete @@have_innodb variable */
+ if (!my_strcasecmp(&my_charset_latin1, plugin->name.str, "InnoDB"))
+ have_innodb= plugin->state & PLUGIN_IS_READY ? SHOW_OPTION_YES
+ : SHOW_OPTION_DISABLED;
+
+ DBUG_RETURN(ret);
}
@@ -1120,7 +1147,8 @@ int plugin_init(int *argc, char **argv, int flags)
struct st_mysql_plugin *plugin;
struct st_plugin_int tmp, *plugin_ptr, **reap;
MEM_ROOT tmp_root;
- bool reaped_mandatory_plugin= FALSE;
+ bool reaped_mandatory_plugin= false;
+ bool mandatory= true;
DBUG_ENTER("plugin_init");
if (initialized)
@@ -1156,8 +1184,15 @@ int plugin_init(int *argc, char **argv, int flags)
/*
First we register builtin plugins
*/
- for (builtins= mysqld_builtins; *builtins; builtins++)
+ for (builtins= mysql_mandatory_plugins; *builtins || mandatory; builtins++)
{
+ if (!*builtins)
+ {
+ builtins= mysql_optional_plugins;
+ mandatory= false;
+ if (!*builtins)
+ break;
+ }
for (plugin= *builtins; plugin->info; plugin++)
{
if (opt_ignore_builtin_innodb &&
@@ -1169,6 +1204,7 @@ int plugin_init(int *argc, char **argv, int flags)
tmp.name.str= (char *)plugin->name;
tmp.name.length= strlen(plugin->name);
tmp.state= 0;
+ tmp.is_mandatory= mandatory;
free_root(&tmp_root, MYF(MY_MARK_BLOCKS_FREE));
if (test_plugin_options(&tmp_root, &tmp, argc, argv))
tmp.state= PLUGIN_IS_DISABLED;
@@ -1183,7 +1219,7 @@ int plugin_init(int *argc, char **argv, int flags)
my_strcasecmp(&my_charset_latin1, plugin->name, "CSV"))
continue;
- if (plugin_ptr->state == PLUGIN_IS_UNINITIALIZED &&
+ if (plugin_ptr->state != PLUGIN_IS_UNINITIALIZED ||
plugin_initialize(plugin_ptr))
goto err_unlock;
@@ -1292,7 +1328,6 @@ static bool register_builtin(struct st_mysql_plugin *plugin,
DBUG_RETURN(0);
}
-
#ifdef NOT_USED_YET
/*
Register a plugin at run time. (note, this doesn't initialize a plugin)
@@ -1325,7 +1360,10 @@ bool plugin_register_builtin(THD *thd, struct st_mysql_plugin *plugin)
goto end;
tmp.state= PLUGIN_IS_UNINITIALIZED;
if ((result= register_builtin(plugin, &tmp, &ptr)))
+ {
mysql_del_sys_var_chain(tmp.system_vars);
+ restore_pluginvar_names(tmp.system_vars);
+ }
end:
rw_unlock(&LOCK_system_variables_hash);
@@ -1900,7 +1938,7 @@ static int check_func_bool(THD *thd, struct st_mysql_sys_var *var,
void *save, st_mysql_value *value)
{
char buff[STRING_BUFFER_USUAL_SIZE];
- const char *strvalue= "NULL", *str;
+ const char *str;
int result, length;
long long tmp;
@@ -1909,28 +1947,19 @@ static int check_func_bool(THD *thd, struct st_mysql_sys_var *var,
length= sizeof(buff);
if (!(str= value->val_str(value, buff, &length)) ||
(result= find_type(&bool_typelib, str, length, 1)-1) < 0)
- {
- if (str)
- strvalue= str;
goto err;
- }
}
else
{
if (value->val_int(value, &tmp) < 0)
goto err;
if (tmp > 1)
- {
- llstr(tmp, buff);
- strvalue= buff;
goto err;
- }
result= (int) tmp;
}
*(my_bool *) save= -result;
return 0;
err:
- my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->name, strvalue);
return 1;
}
@@ -1938,60 +1967,87 @@ err:
static int check_func_int(THD *thd, struct st_mysql_sys_var *var,
void *save, st_mysql_value *value)
{
- my_bool fixed;
- long long tmp;
+ my_bool fixed1, fixed2;
+ long long orig, val;
struct my_option options;
- value->val_int(value, &tmp);
+ value->val_int(value, &orig);
+ val= orig;
plugin_opt_set_limits(&options, var);
if (var->flags & PLUGIN_VAR_UNSIGNED)
- *(uint *)save= (uint) getopt_ull_limit_value((ulonglong) tmp, &options,
- &fixed);
+ {
+ if ((fixed1= (!value->is_unsigned(value) && val < 0)))
+ val=0;
+ *(uint *)save= (uint) getopt_ull_limit_value((ulonglong) val, &options,
+ &fixed2);
+ }
else
- *(int *)save= (int) getopt_ll_limit_value(tmp, &options, &fixed);
+ {
+ if ((fixed1= (value->is_unsigned(value) && val < 0)))
+ val=LONGLONG_MAX;
+ *(int *)save= (int) getopt_ll_limit_value(val, &options, &fixed2);
+ }
- return throw_bounds_warning(thd, fixed, var->flags & PLUGIN_VAR_UNSIGNED,
- var->name, (longlong) tmp);
+ return throw_bounds_warning(thd, var->name, fixed1 || fixed2,
+ value->is_unsigned(value), (longlong) orig);
}
static int check_func_long(THD *thd, struct st_mysql_sys_var *var,
void *save, st_mysql_value *value)
{
- my_bool fixed;
- long long tmp;
+ my_bool fixed1, fixed2;
+ long long orig, val;
struct my_option options;
- value->val_int(value, &tmp);
+ value->val_int(value, &orig);
+ val= orig;
plugin_opt_set_limits(&options, var);
if (var->flags & PLUGIN_VAR_UNSIGNED)
- *(ulong *)save= (ulong) getopt_ull_limit_value((ulonglong) tmp, &options,
- &fixed);
+ {
+ if ((fixed1= (!value->is_unsigned(value) && val < 0)))
+ val=0;
+ *(ulong *)save= (ulong) getopt_ull_limit_value((ulonglong) val, &options,
+ &fixed2);
+ }
else
- *(long *)save= (long) getopt_ll_limit_value(tmp, &options, &fixed);
+ {
+ if ((fixed1= (value->is_unsigned(value) && val < 0)))
+ val=LONGLONG_MAX;
+ *(long *)save= (long) getopt_ll_limit_value(val, &options, &fixed2);
+ }
- return throw_bounds_warning(thd, fixed, var->flags & PLUGIN_VAR_UNSIGNED,
- var->name, (longlong) tmp);
+ return throw_bounds_warning(thd, var->name, fixed1 || fixed2,
+ value->is_unsigned(value), (longlong) orig);
}
static int check_func_longlong(THD *thd, struct st_mysql_sys_var *var,
void *save, st_mysql_value *value)
{
- my_bool fixed;
- long long tmp;
+ my_bool fixed1, fixed2;
+ long long orig, val;
struct my_option options;
- value->val_int(value, &tmp);
+ value->val_int(value, &orig);
+ val= orig;
plugin_opt_set_limits(&options, var);
if (var->flags & PLUGIN_VAR_UNSIGNED)
- *(ulonglong *)save= getopt_ull_limit_value((ulonglong) tmp, &options,
- &fixed);
+ {
+ if ((fixed1= (!value->is_unsigned(value) && val < 0)))
+ val=0;
+ *(ulonglong *)save= getopt_ull_limit_value((ulonglong) val, &options,
+ &fixed2);
+ }
else
- *(longlong *)save= getopt_ll_limit_value(tmp, &options, &fixed);
+ {
+ if ((fixed1= (value->is_unsigned(value) && val < 0)))
+ val=LONGLONG_MAX;
+ *(longlong *)save= getopt_ll_limit_value(val, &options, &fixed2);
+ }
- return throw_bounds_warning(thd, fixed, var->flags & PLUGIN_VAR_UNSIGNED,
- var->name, (longlong) tmp);
+ return throw_bounds_warning(thd, var->name, fixed1 || fixed2,
+ value->is_unsigned(value), (longlong) orig);
}
static int check_func_str(THD *thd, struct st_mysql_sys_var *var,
@@ -2013,7 +2069,7 @@ static int check_func_enum(THD *thd, struct st_mysql_sys_var *var,
void *save, st_mysql_value *value)
{
char buff[STRING_BUFFER_USUAL_SIZE];
- const char *strvalue= "NULL", *str;
+ const char *str;
TYPELIB *typelib;
long long tmp;
long result;
@@ -2029,28 +2085,20 @@ static int check_func_enum(THD *thd, struct st_mysql_sys_var *var,
length= sizeof(buff);
if (!(str= value->val_str(value, buff, &length)))
goto err;
- if ((result= (long)find_type(typelib, str, length, 1)-1) < 0)
- {
- strvalue= str;
+ if ((result= (long)find_type(typelib, str, length, 0) - 1) < 0)
goto err;
- }
}
else
{
if (value->val_int(value, &tmp))
goto err;
- if (tmp >= typelib->count)
- {
- llstr(tmp, buff);
- strvalue= buff;
+ if (tmp < 0 || tmp >= typelib->count)
goto err;
- }
result= (long) tmp;
}
*(long*)save= result;
return 0;
err:
- my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->name, strvalue);
return 1;
}
@@ -2059,7 +2107,7 @@ static int check_func_set(THD *thd, struct st_mysql_sys_var *var,
void *save, st_mysql_value *value)
{
char buff[STRING_BUFFER_USUAL_SIZE], *error= 0;
- const char *strvalue= "NULL", *str;
+ const char *str;
TYPELIB *typelib;
ulonglong result;
uint error_len= 0; // init as only set on error
@@ -2079,11 +2127,7 @@ static int check_func_set(THD *thd, struct st_mysql_sys_var *var,
result= find_set(typelib, str, length, NULL,
&error, &error_len, &not_used);
if (error_len)
- {
- strmake(buff, error, min(sizeof(buff), error_len));
- strvalue= buff;
goto err;
- }
}
else
{
@@ -2091,16 +2135,11 @@ static int check_func_set(THD *thd, struct st_mysql_sys_var *var,
goto err;
if (unlikely((result >= (ULL(1) << typelib->count)) &&
(typelib->count < sizeof(long)*8)))
- {
- llstr(result, buff);
- strvalue= buff;
goto err;
- }
}
*(ulonglong*)save= result;
return 0;
err:
- my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->name, strvalue);
return 1;
}
@@ -2160,7 +2199,7 @@ sys_var *find_sys_var(THD *thd, const char *str, uint length)
pthread_mutex_lock(&LOCK_plugin);
rw_rdlock(&LOCK_system_variables_hash);
- if ((var= intern_find_sys_var(str, length, false)) &&
+ if ((var= intern_find_sys_var(str, length)) &&
(pi= var->cast_pluginvar()))
{
rw_unlock(&LOCK_system_variables_hash);
@@ -2183,7 +2222,7 @@ sys_var *find_sys_var(THD *thd, const char *str, uint length)
If the variable exists but the plugin it is associated with is not ready
then the intern_plugin_lock did not raise an error, so we do it here.
*/
- if (pi && !var)
+ if (!var)
my_error(ER_UNKNOWN_SYSTEM_VARIABLE, MYF(0), (char*) str);
DBUG_RETURN(var);
}
@@ -2333,6 +2372,15 @@ static st_bookmark *register_var(const char *plugin, const char *name,
return result;
}
+static void restore_pluginvar_names(sys_var *first)
+{
+ for (sys_var *var= first; var; var= var->next)
+ {
+ sys_var_pluginvar *pv= var->cast_pluginvar();
+ pv->plugin_var->name= pv->orig_pluginvar_name;
+ }
+}
+
/*
returns a pointer to the memory which holds the thd-local variable or
@@ -2386,7 +2434,7 @@ static uchar *intern_sys_var_ptr(THD* thd, int offset, bool global_lock)
st_bookmark *v= (st_bookmark*) my_hash_element(&bookmark_hash,idx);
if (v->version <= thd->variables.dynamic_variables_version ||
- !(var= intern_find_sys_var(v->key + 1, v->name_len, true)) ||
+ !(var= intern_find_sys_var(v->key + 1, v->name_len)) ||
!(pi= var->cast_pluginvar()) ||
v->key[0] != (pi->plugin_var->flags & PLUGIN_VAR_TYPEMASK))
continue;
@@ -2479,7 +2527,7 @@ static void cleanup_variables(THD *thd, struct system_variables *vars)
{
v= (st_bookmark*) my_hash_element(&bookmark_hash, idx);
if (v->version > vars->dynamic_variables_version ||
- !(var= intern_find_sys_var(v->key + 1, v->name_len, true)) ||
+ !(var= intern_find_sys_var(v->key + 1, v->name_len)) ||
!(pivar= var->cast_pluginvar()) ||
v->key[0] != (pivar->plugin_var->flags & PLUGIN_VAR_TYPEMASK))
continue;
@@ -2558,7 +2606,7 @@ static void plugin_vars_free_values(sys_var *vars)
/* Free the string from global_system_variables. */
char **valptr= (char**) piv->real_value_ptr(NULL, OPT_GLOBAL);
DBUG_PRINT("plugin", ("freeing value for: '%s' addr: 0x%lx",
- var->name, (long) valptr));
+ var->name.str, (long) valptr));
my_free(*valptr, MYF(MY_WME | MY_FAE | MY_ALLOW_ZERO_PTR));
*valptr= NULL;
}
@@ -2566,43 +2614,44 @@ static void plugin_vars_free_values(sys_var *vars)
DBUG_VOID_RETURN;
}
-
-bool sys_var_pluginvar::check_update_type(Item_result type)
+static SHOW_TYPE pluginvar_show_type(st_mysql_sys_var *plugin_var)
{
- if (is_readonly())
- return 1;
switch (plugin_var->flags & PLUGIN_VAR_TYPEMASK) {
+ case PLUGIN_VAR_BOOL:
+ return SHOW_MY_BOOL;
case PLUGIN_VAR_INT:
+ return SHOW_INT;
case PLUGIN_VAR_LONG:
+ return SHOW_LONG;
case PLUGIN_VAR_LONGLONG:
- return type != INT_RESULT;
+ return SHOW_LONGLONG;
case PLUGIN_VAR_STR:
- return type != STRING_RESULT;
+ return SHOW_CHAR_PTR;
+ case PLUGIN_VAR_ENUM:
+ case PLUGIN_VAR_SET:
+ return SHOW_CHAR;
default:
- return 0;
+ DBUG_ASSERT(0);
+ return SHOW_UNDEF;
}
}
-SHOW_TYPE sys_var_pluginvar::show_type()
+bool sys_var_pluginvar::check_update_type(Item_result type)
{
switch (plugin_var->flags & PLUGIN_VAR_TYPEMASK) {
- case PLUGIN_VAR_BOOL:
- return SHOW_MY_BOOL;
case PLUGIN_VAR_INT:
- return SHOW_INT;
case PLUGIN_VAR_LONG:
- return SHOW_LONG;
case PLUGIN_VAR_LONGLONG:
- return SHOW_LONGLONG;
+ return type != INT_RESULT;
case PLUGIN_VAR_STR:
- return SHOW_CHAR_PTR;
+ return type != STRING_RESULT;
case PLUGIN_VAR_ENUM:
+ case PLUGIN_VAR_BOOL:
case PLUGIN_VAR_SET:
- return SHOW_CHAR;
+ return type != STRING_RESULT && type != INT_RESULT;
default:
- DBUG_ASSERT(0);
- return SHOW_UNDEF;
+ return true;
}
}
@@ -2639,8 +2688,8 @@ TYPELIB* sys_var_pluginvar::plugin_var_typelib(void)
}
-uchar* sys_var_pluginvar::value_ptr(THD *thd, enum_var_type type,
- LEX_STRING *base)
+uchar* sys_var_pluginvar::do_value_ptr(THD *thd, enum_var_type type,
+ LEX_STRING *base)
{
uchar* result;
@@ -2649,139 +2698,104 @@ uchar* sys_var_pluginvar::value_ptr(THD *thd, enum_var_type type,
if ((plugin_var->flags & PLUGIN_VAR_TYPEMASK) == PLUGIN_VAR_ENUM)
result= (uchar*) get_type(plugin_var_typelib(), *(ulong*)result);
else if ((plugin_var->flags & PLUGIN_VAR_TYPEMASK) == PLUGIN_VAR_SET)
- {
- char buffer[STRING_BUFFER_USUAL_SIZE];
- String str(buffer, sizeof(buffer), system_charset_info);
- TYPELIB *typelib= plugin_var_typelib();
- ulonglong mask= 1, value= *(ulonglong*) result;
- uint i;
-
- str.length(0);
- for (i= 0; i < typelib->count; i++, mask<<=1)
- {
- if (!(value & mask))
- continue;
- str.append(typelib->type_names[i], typelib->type_lengths
- ? typelib->type_lengths[i]
- : strlen(typelib->type_names[i]));
- str.append(',');
- }
-
- result= (uchar*) "";
- if (str.length())
- result= (uchar*) thd->strmake(str.ptr(), str.length()-1);
- }
+ result= (uchar*) set_to_string(thd, 0, *(ulonglong*) result,
+ plugin_var_typelib()->type_names);
return result;
}
-
-bool sys_var_pluginvar::check(THD *thd, set_var *var)
+bool sys_var_pluginvar::do_check(THD *thd, set_var *var)
{
st_item_value_holder value;
- DBUG_ASSERT(is_readonly() || plugin_var->check);
+ DBUG_ASSERT(!is_readonly());
+ DBUG_ASSERT(plugin_var->check);
value.value_type= item_value_type;
value.val_str= item_val_str;
value.val_int= item_val_int;
value.val_real= item_val_real;
+ value.is_unsigned= item_is_unsigned;
value.item= var->value;
- return is_readonly() ||
- plugin_var->check(thd, plugin_var, &var->save_result, &value);
+ return plugin_var->check(thd, plugin_var, &var->save_result, &value);
}
-
-void sys_var_pluginvar::set_default(THD *thd, enum_var_type type)
+bool sys_var_pluginvar::session_update(THD *thd, set_var *var)
{
- const void *src;
- void *tgt;
-
- DBUG_ASSERT(is_readonly() || plugin_var->update);
-
- if (is_readonly())
- return;
+ DBUG_ASSERT(!is_readonly());
+ DBUG_ASSERT(plugin_var->flags & PLUGIN_VAR_THDLOCAL);
+ DBUG_ASSERT(thd == current_thd);
pthread_mutex_lock(&LOCK_global_system_variables);
- tgt= real_value_ptr(thd, type);
- src= ((void **) (plugin_var + 1) + 1);
+ void *tgt= real_value_ptr(thd, var->type);
+ const void *src= var->value ? (void*)&var->save_result
+ : (void*)real_value_ptr(thd, OPT_GLOBAL);
+ pthread_mutex_unlock(&LOCK_global_system_variables);
+ plugin_var->update(thd, plugin_var, tgt, src);
- if (plugin_var->flags & PLUGIN_VAR_THDLOCAL)
- {
- if (type != OPT_GLOBAL)
- src= real_value_ptr(thd, OPT_GLOBAL);
- else
- switch (plugin_var->flags & PLUGIN_VAR_TYPEMASK) {
- case PLUGIN_VAR_INT:
- src= &((thdvar_uint_t*) plugin_var)->def_val;
- break;
- case PLUGIN_VAR_LONG:
- src= &((thdvar_ulong_t*) plugin_var)->def_val;
- break;
- case PLUGIN_VAR_LONGLONG:
- src= &((thdvar_ulonglong_t*) plugin_var)->def_val;
- break;
- case PLUGIN_VAR_ENUM:
- src= &((thdvar_enum_t*) plugin_var)->def_val;
- break;
- case PLUGIN_VAR_SET:
- src= &((thdvar_set_t*) plugin_var)->def_val;
- break;
- case PLUGIN_VAR_BOOL:
- src= &((thdvar_bool_t*) plugin_var)->def_val;
- break;
- case PLUGIN_VAR_STR:
- src= &((thdvar_str_t*) plugin_var)->def_val;
- break;
- default:
- DBUG_ASSERT(0);
- }
- }
-
- /* thd must equal current_thd if PLUGIN_VAR_THDLOCAL flag is set */
- DBUG_ASSERT(!(plugin_var->flags & PLUGIN_VAR_THDLOCAL) ||
- thd == current_thd);
-
- if (!(plugin_var->flags & PLUGIN_VAR_THDLOCAL) || type == OPT_GLOBAL)
- {
- plugin_var->update(thd, plugin_var, tgt, src);
- pthread_mutex_unlock(&LOCK_global_system_variables);
- }
- else
- {
- pthread_mutex_unlock(&LOCK_global_system_variables);
- plugin_var->update(thd, plugin_var, tgt, src);
- }
+ return false;
}
-
-bool sys_var_pluginvar::update(THD *thd, set_var *var)
+bool sys_var_pluginvar::global_update(THD *thd, set_var *var)
{
- void *tgt;
-
- DBUG_ASSERT(is_readonly() || plugin_var->update);
+ DBUG_ASSERT(!is_readonly());
+ safe_mutex_assert_owner(&LOCK_global_system_variables);
- /* thd must equal current_thd if PLUGIN_VAR_THDLOCAL flag is set */
- DBUG_ASSERT(!(plugin_var->flags & PLUGIN_VAR_THDLOCAL) ||
- thd == current_thd);
+ void *tgt= real_value_ptr(thd, var->type);
+ const void *src= &var->save_result;
- if (is_readonly())
- return 1;
-
- pthread_mutex_lock(&LOCK_global_system_variables);
- tgt= real_value_ptr(thd, var->type);
-
- if (!(plugin_var->flags & PLUGIN_VAR_THDLOCAL) || var->type == OPT_GLOBAL)
- {
- /* variable we are updating has global scope, so we unlock after updating */
- plugin_var->update(thd, plugin_var, tgt, &var->save_result);
- pthread_mutex_unlock(&LOCK_global_system_variables);
- }
- else
+ if (!var->value)
{
- pthread_mutex_unlock(&LOCK_global_system_variables);
- plugin_var->update(thd, plugin_var, tgt, &var->save_result);
+ switch (plugin_var->flags & (PLUGIN_VAR_TYPEMASK | PLUGIN_VAR_THDLOCAL)) {
+ case PLUGIN_VAR_INT:
+ src= &((sysvar_uint_t*) plugin_var)->def_val;
+ break;
+ case PLUGIN_VAR_LONG:
+ src= &((sysvar_ulong_t*) plugin_var)->def_val;
+ break;
+ case PLUGIN_VAR_LONGLONG:
+ src= &((sysvar_ulonglong_t*) plugin_var)->def_val;
+ break;
+ case PLUGIN_VAR_ENUM:
+ src= &((sysvar_enum_t*) plugin_var)->def_val;
+ break;
+ case PLUGIN_VAR_SET:
+ src= &((sysvar_set_t*) plugin_var)->def_val;
+ break;
+ case PLUGIN_VAR_BOOL:
+ src= &((sysvar_bool_t*) plugin_var)->def_val;
+ break;
+ case PLUGIN_VAR_STR:
+ src= &((sysvar_str_t*) plugin_var)->def_val;
+ break;
+ case PLUGIN_VAR_INT | PLUGIN_VAR_THDLOCAL:
+ src= &((thdvar_uint_t*) plugin_var)->def_val;
+ break;
+ case PLUGIN_VAR_LONG | PLUGIN_VAR_THDLOCAL:
+ src= &((thdvar_ulong_t*) plugin_var)->def_val;
+ break;
+ case PLUGIN_VAR_LONGLONG | PLUGIN_VAR_THDLOCAL:
+ src= &((thdvar_ulonglong_t*) plugin_var)->def_val;
+ break;
+ case PLUGIN_VAR_ENUM | PLUGIN_VAR_THDLOCAL:
+ src= &((thdvar_enum_t*) plugin_var)->def_val;
+ break;
+ case PLUGIN_VAR_SET | PLUGIN_VAR_THDLOCAL:
+ src= &((thdvar_set_t*) plugin_var)->def_val;
+ break;
+ case PLUGIN_VAR_BOOL | PLUGIN_VAR_THDLOCAL:
+ src= &((thdvar_bool_t*) plugin_var)->def_val;
+ break;
+ case PLUGIN_VAR_STR | PLUGIN_VAR_THDLOCAL:
+ src= &((thdvar_str_t*) plugin_var)->def_val;
+ break;
+ default:
+ DBUG_ASSERT(0);
+ }
}
- return 0;
+
+ plugin_var->update(thd, plugin_var, tgt, src);
+
+ return false;
}
@@ -2944,40 +2958,48 @@ static int construct_options(MEM_ROOT *mem_root, struct st_plugin_int *tmp,
DBUG_ENTER("construct_options");
- options[0].name= plugin_name_ptr= (char*) alloc_root(mem_root,
- plugin_name_len + 1);
+ plugin_name_ptr= (char*) alloc_root(mem_root, plugin_name_len + 1);
strcpy(plugin_name_ptr, plugin_name);
my_casedn_str(&my_charset_latin1, plugin_name_ptr);
convert_underscore_to_dash(plugin_name_ptr, plugin_name_len);
- /* support --skip-plugin-foo syntax */
- options[1].name= plugin_name_with_prefix_ptr= (char*) alloc_root(mem_root,
- plugin_name_len +
- plugin_dash.length + 1);
- strxmov(plugin_name_with_prefix_ptr, plugin_dash.str, options[0].name, NullS);
-
- options[0].id= options[1].id= 256; /* must be >255. dup id ok */
- options[0].var_type= options[1].var_type= GET_ENUM;
- options[0].arg_type= options[1].arg_type= OPT_ARG;
- options[0].def_value= options[1].def_value= 1; /* ON */
- options[0].typelib= options[1].typelib= &global_plugin_typelib;
-
- strxnmov(comment, max_comment_len, "Enable or disable ", plugin_name,
- " plugin. Possible values are ON, OFF, FORCE (don't start "
- "if the plugin fails to load).", NullS);
- options[0].comment= comment;
+ plugin_name_with_prefix_ptr= (char*) alloc_root(mem_root,
+ plugin_name_len +
+ plugin_dash.length + 1);
+ strxmov(plugin_name_with_prefix_ptr, plugin_dash.str, plugin_name_ptr, NullS);
+
+ if (!tmp->is_mandatory)
+ {
+ /* support --skip-plugin-foo syntax */
+ options[0].name= plugin_name_ptr;
+ options[1].name= plugin_name_with_prefix_ptr;
+ options[0].id= options[1].id= 0;
+ options[0].var_type= options[1].var_type= GET_ENUM;
+ options[0].arg_type= options[1].arg_type= OPT_ARG;
+ options[0].def_value= options[1].def_value= 1; /* ON */
+ options[0].typelib= options[1].typelib= &global_plugin_typelib;
+
+ strxnmov(comment, max_comment_len, "Enable or disable ", plugin_name,
+ " plugin. Possible values are ON, OFF, FORCE (don't start "
+ "if the plugin fails to load).", NullS);
+ options[0].comment= comment;
+ /*
+ Allocate temporary space for the value of the tristate.
+ This option will have a limited lifetime and is not used beyond
+ server initialization.
+ GET_ENUM value is an unsigned integer.
+ */
+ options[0].value= options[1].value=
+ (uchar **)alloc_root(mem_root, sizeof(uint));
+ *((uint*) options[0].value)= (uint) options[0].def_value;
- /*
- Allocate temporary space for the value of the tristate.
- This option will have a limited lifetime and is not used beyond
- server initialization.
- GET_ENUM value is an integer.
- */
- options[0].value= options[1].value= (uchar **)alloc_root(mem_root,
- sizeof(int));
- *((uint*) options[0].value)= *((uint*) options[1].value)=
- (uint) options[0].def_value;
+ options+= 2;
+ }
- options+= 2;
+ if (!my_strcasecmp(&my_charset_latin1, plugin_name_ptr, "NDBCLUSTER"))
+ {
+ plugin_name_ptr= const_cast<char*>("ndb"); // Use legacy "ndb" prefix
+ plugin_name_len= 3;
+ }
/*
Two passes as the 2nd pass will take pointer addresses for use
@@ -3125,7 +3147,7 @@ static int construct_options(MEM_ROOT *mem_root, struct st_plugin_int *tmp,
options->name= optname;
options->comment= opt->comment;
options->app_type= opt;
- options->id= (options-1)->id + 1;
+ options->id= 0;
plugin_opt_set_limits(options, opt);
@@ -3166,13 +3188,20 @@ static my_option *construct_help_options(MEM_ROOT *mem_root,
bzero(opts, sizeof(my_option) * count);
+ /**
+ some plugin variables (those that don't have PLUGIN_VAR_NOSYSVAR flag)
+ have their names prefixed with the plugin name. Restore the names here
+ to get the correct (not double-prefixed) help text.
+ We won't need @@sysvars anymore and don't care about their proper names.
+ */
+ restore_pluginvar_names(p->system_vars);
+
if (construct_options(mem_root, p, opts))
DBUG_RETURN(NULL);
DBUG_RETURN(opts);
}
-
/**
Create and register system variables supplied from the plugin and
assigns initial values from corresponding command line arguments.
@@ -3197,18 +3226,17 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp,
int *argc, char **argv)
{
struct sys_var_chain chain= { NULL, NULL };
- my_bool can_disable;
bool disable_plugin;
- enum_plugin_load_policy plugin_load_policy= PLUGIN_ON;
+ enum_plugin_load_policy plugin_load_policy= tmp->is_mandatory ? PLUGIN_FORCE : PLUGIN_ON;
MEM_ROOT *mem_root= alloc_root_inited(&tmp->mem_root) ?
&tmp->mem_root : &plugin_mem_root;
st_mysql_sys_var **opt;
my_option *opts= NULL;
+ LEX_STRING plugin_name;
char *varname;
int error;
- st_mysql_sys_var *o;
- sys_var *v;
+ sys_var *v __attribute__((unused));
struct st_bookmark *var;
uint len, count= EXTRA_OPTIONS;
DBUG_ENTER("test_plugin_options");
@@ -3244,7 +3272,8 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp,
We adjust the default value to account for the hardcoded exceptions
we have set for the federated and ndbcluster storage engines.
*/
- opts[0].def_value= opts[1].def_value= (int)plugin_load_policy;
+ if (!tmp->is_mandatory)
+ opts[0].def_value= opts[1].def_value= plugin_load_policy;
error= handle_options(argc, &argv, opts, get_one_plugin_option);
(*argc)++; /* add back one for the program name */
@@ -3259,24 +3288,12 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp,
Set plugin loading policy from option value. First element in the option
list is always the <plugin name> option value.
*/
- plugin_load_policy= (enum_plugin_load_policy)*(uint*)opts[0].value;
+ if (!tmp->is_mandatory)
+ plugin_load_policy= (enum_plugin_load_policy)*(uint*)opts[0].value;
}
disable_plugin= (plugin_load_policy == PLUGIN_OFF);
- /*
- The 'MyISAM' and 'Memory' storage engines currently can't be disabled.
- */
- can_disable=
- my_strcasecmp(&my_charset_latin1, tmp->name.str, "MyISAM") &&
- my_strcasecmp(&my_charset_latin1, tmp->name.str, "MEMORY");
-
- tmp->is_mandatory= (plugin_load_policy == PLUGIN_FORCE) || !can_disable;
-
- if (disable_plugin && !can_disable)
- {
- sql_print_warning("Plugin '%s' cannot be disabled", tmp->name.str);
- disable_plugin= FALSE;
- }
+ tmp->is_mandatory= (plugin_load_policy == PLUGIN_FORCE);
/*
If the plugin is disabled it should not be initialized.
@@ -3291,34 +3308,37 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp,
DBUG_RETURN(1);
}
+ if (!my_strcasecmp(&my_charset_latin1, tmp->name.str, "NDBCLUSTER"))
+ {
+ plugin_name.str= const_cast<char*>("ndb"); // Use legacy "ndb" prefix
+ plugin_name.length= 3;
+ }
+ else
+ plugin_name= tmp->name;
+
error= 1;
for (opt= tmp->plugin->system_vars; opt && *opt; opt++)
{
+ st_mysql_sys_var *o;
if (((o= *opt)->flags & PLUGIN_VAR_NOSYSVAR))
continue;
- if ((var= find_bookmark(tmp->name.str, o->name, o->flags)))
- v= new (mem_root) sys_var_pluginvar(var->key + 1, o);
+ if ((var= find_bookmark(plugin_name.str, o->name, o->flags)))
+ v= new (mem_root) sys_var_pluginvar(&chain, var->key + 1, o);
else
{
- len= tmp->name.length + strlen(o->name) + 2;
+ len= plugin_name.length + strlen(o->name) + 2;
varname= (char*) alloc_root(mem_root, len);
- strxmov(varname, tmp->name.str, "-", o->name, NullS);
+ strxmov(varname, plugin_name.str, "-", o->name, NullS);
my_casedn_str(&my_charset_latin1, varname);
convert_dash_to_underscore(varname, len-1);
- v= new (mem_root) sys_var_pluginvar(varname, o);
+ v= new (mem_root) sys_var_pluginvar(&chain, varname, o);
}
DBUG_ASSERT(v); /* check that an object was actually constructed */
- /*
- Add to the chain of variables.
- Done like this for easier debugging so that the
- pointer to v is not lost on optimized builds.
- */
- v->chain_sys_var(&chain);
} /* end for */
if (chain.first)
{
chain.last->next = NULL;
- if (mysql_add_sys_var_chain(chain.first, NULL))
+ if (mysql_add_sys_var_chain(chain.first))
{
sql_print_error("Plugin '%s' has conflicting system variables",
tmp->name.str);
@@ -3339,49 +3359,26 @@ err:
Help Verbose text with Plugin System Variables
****************************************************************************/
-static int option_cmp(my_option *a, my_option *b)
-{
- return my_strcasecmp(&my_charset_latin1, a->name, b->name);
-}
-
-void my_print_help_inc_plugins(my_option *main_options, uint size)
+void add_plugin_options(DYNAMIC_ARRAY *options, MEM_ROOT *mem_root)
{
- DYNAMIC_ARRAY all_options;
struct st_plugin_int *p;
- MEM_ROOT mem_root;
my_option *opt;
- init_alloc_root(&mem_root, 4096, 4096);
- my_init_dynamic_array(&all_options, sizeof(my_option), size, size/4);
-
- if (initialized)
- for (uint idx= 0; idx < plugin_array.elements; idx++)
- {
- p= *dynamic_element(&plugin_array, idx, struct st_plugin_int **);
-
- if (!p->plugin->system_vars ||
- !(opt= construct_help_options(&mem_root, p)))
- continue;
-
- /* Only options with a non-NULL comment are displayed in help text */
- for (;opt->id; opt++)
- if (opt->comment)
- insert_dynamic(&all_options, (uchar*) opt);
- }
-
- for (;main_options->id; main_options++)
- insert_dynamic(&all_options, (uchar*) main_options);
-
- sort_dynamic(&all_options, (qsort_cmp) option_cmp);
+ if (!initialized)
+ return;
- /* main_options now points to the empty option terminator */
- insert_dynamic(&all_options, (uchar*) main_options);
+ for (uint idx= 0; idx < plugin_array.elements; idx++)
+ {
+ p= *dynamic_element(&plugin_array, idx, struct st_plugin_int **);
- my_print_help((my_option*) all_options.buffer);
- my_print_variables((my_option*) all_options.buffer);
+ if (!(opt= construct_help_options(mem_root, p)))
+ continue;
- delete_dynamic(&all_options);
- free_root(&mem_root, MYF(0));
+ /* Only options with a non-NULL comment are displayed in help text */
+ for (;opt->name; opt++)
+ if (opt->comment)
+ insert_dynamic(options, (uchar*) opt);
+ }
}
diff --git a/sql/sql_plugin.h b/sql/sql_plugin.h
index 23ce85c994b..bec880b21d2 100644
--- a/sql/sql_plugin.h
+++ b/sql/sql_plugin.h
@@ -17,6 +17,9 @@
#define _sql_plugin_h
class sys_var;
+enum SHOW_COMP_OPTION { SHOW_OPTION_YES, SHOW_OPTION_NO, SHOW_OPTION_DISABLED};
+
+#include <my_sys.h>
#ifdef DBUG_OFF
#define plugin_ref_to_int(A) A
@@ -37,6 +40,7 @@ class sys_var;
typedef enum enum_mysql_show_type SHOW_TYPE;
typedef struct st_mysql_show_var SHOW_VAR;
+typedef struct st_mysql_lex_string LEX_STRING;
#define MYSQL_ANY_PLUGIN -1
@@ -112,7 +116,7 @@ extern const LEX_STRING plugin_type_names[];
extern int plugin_init(int *argc, char **argv, int init_flags);
extern void plugin_shutdown(void);
-extern void my_print_help_inc_plugins(struct my_option *options, uint size);
+void add_plugin_options(DYNAMIC_ARRAY *options, MEM_ROOT *mem_root);
extern bool plugin_is_ready(const LEX_STRING *name, int type);
#define my_plugin_lock_by_name(A,B,C) plugin_lock_by_name(A,B,C CALLER_INFO)
#define my_plugin_lock_by_name_ci(A,B,C) plugin_lock_by_name(A,B,C ORIG_CALLER_INFO)
@@ -129,6 +133,7 @@ extern bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name);
extern bool plugin_register_builtin(struct st_mysql_plugin *plugin);
extern void plugin_thdvar_init(THD *thd);
extern void plugin_thdvar_cleanup(THD *thd);
+extern SHOW_COMP_OPTION plugin_status(const char *name, int len, size_t type);
typedef my_bool (plugin_foreach_func)(THD *thd,
plugin_ref plugin,
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index d624c22f43a..f19f12ddc13 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -84,6 +84,7 @@ When one supplies long data for a placeholder:
*/
#include "mysql_priv.h"
+#include "set_var.h"
#include "sql_prepare.h"
#include "sql_select.h" // for JOIN
#include "sql_cursor.h"
diff --git a/sql/sql_profile.cc b/sql/sql_profile.cc
index 69e5bc3cbb4..84ee0768b25 100644
--- a/sql/sql_profile.cc
+++ b/sql/sql_profile.cc
@@ -341,7 +341,7 @@ void PROFILING::start_new_query(const char *initial_state)
finish_current_query();
}
- enabled= (((thd)->options & OPTION_PROFILING) != 0);
+ enabled= ((thd->variables.option_bits & OPTION_PROFILING) != 0);
if (! enabled) DBUG_VOID_RETURN;
@@ -379,7 +379,7 @@ void PROFILING::finish_current_query()
status_change("ending", NULL, NULL, 0);
if ((enabled) && /* ON at start? */
- ((thd->options & OPTION_PROFILING) != 0) && /* and ON at end? */
+ ((thd->variables.option_bits & OPTION_PROFILING) != 0) && /* and ON at end? */
(current->query_source != NULL) &&
(! current->entries.is_empty()))
{
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index aa06b1cfb0e..517fbb97b73 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -29,6 +29,14 @@ my_bool opt_sporadic_binlog_dump_fail = 0;
static int binlog_dump_count = 0;
#endif
+/**
+ a copy of active_mi->rli->slave_skip_counter, for showing in SHOW VARIABLES,
+ INFORMATION_SCHEMA.GLOBAL_VARIABLES and @@sql_slave_skip_counter without
+ taking all the mutexes needed to access active_mi->rli->slave_skip_counter
+ properly.
+*/
+uint sql_slave_skip_counter;
+
/*
fake_rotate_event() builds a fake (=which does not exist physically in any
binlog) Rotate event, which contains the name of the binlog we are going to
@@ -1985,147 +1993,4 @@ int log_loaded_block(IO_CACHE* file)
DBUG_RETURN(0);
}
-/*
- Replication System Variables
-*/
-
-class sys_var_slave_skip_counter :public sys_var
-{
-public:
- sys_var_slave_skip_counter(sys_var_chain *chain, const char *name_arg)
- :sys_var(name_arg)
- { chain_sys_var(chain); }
- bool check(THD *thd, set_var *var);
- bool update(THD *thd, set_var *var);
- bool check_type(enum_var_type type) { return type != OPT_GLOBAL; }
- /*
- We can't retrieve the value of this, so we don't have to define
- type() or value_ptr()
- */
-};
-
-class sys_var_sync_binlog_period :public sys_var_long_ptr
-{
-public:
- sys_var_sync_binlog_period(sys_var_chain *chain, const char *name_arg,
- ulong *value_ptr)
- :sys_var_long_ptr(chain, name_arg,value_ptr) {}
- bool update(THD *thd, set_var *var);
-};
-
-static void fix_slave_net_timeout(THD *thd, enum_var_type type)
-{
- DBUG_ENTER("fix_slave_net_timeout");
-#ifdef HAVE_REPLICATION
- pthread_mutex_lock(&LOCK_active_mi);
- DBUG_PRINT("info",("slave_net_timeout=%lu mi->heartbeat_period=%.3f",
- slave_net_timeout,
- (active_mi? active_mi->heartbeat_period : 0.0)));
- if (active_mi && slave_net_timeout < active_mi->heartbeat_period)
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE,
- "The currect value for master_heartbeat_period"
- " exceeds the new value of `slave_net_timeout' sec."
- " A sensible value for the period should be"
- " less than the timeout.");
- pthread_mutex_unlock(&LOCK_active_mi);
-#endif
- DBUG_VOID_RETURN;
-}
-
-static sys_var_chain vars = { NULL, NULL };
-
-static sys_var_const sys_log_slave_updates(&vars, "log_slave_updates",
- OPT_GLOBAL, SHOW_MY_BOOL,
- (uchar*) &opt_log_slave_updates);
-static sys_var_const sys_relay_log(&vars, "relay_log",
- OPT_GLOBAL, SHOW_CHAR_PTR,
- (uchar*) &opt_relay_logname);
-static sys_var_const sys_relay_log_index(&vars, "relay_log_index",
- OPT_GLOBAL, SHOW_CHAR_PTR,
- (uchar*) &opt_relaylog_index_name);
-static sys_var_const sys_relay_log_info_file(&vars, "relay_log_info_file",
- OPT_GLOBAL, SHOW_CHAR_PTR,
- (uchar*) &relay_log_info_file);
-static sys_var_bool_ptr sys_relay_log_purge(&vars, "relay_log_purge",
- &relay_log_purge);
-static sys_var_bool_ptr sys_relay_log_recovery(&vars, "relay_log_recovery",
- &relay_log_recovery);
-static sys_var_uint_ptr sys_sync_binlog_period(&vars, "sync_binlog",
- &sync_binlog_period);
-static sys_var_uint_ptr sys_sync_relaylog_period(&vars, "sync_relay_log",
- &sync_relaylog_period);
-static sys_var_uint_ptr sys_sync_relayloginfo_period(&vars, "sync_relay_log_info",
- &sync_relayloginfo_period);
-static sys_var_uint_ptr sys_sync_masterinfo_period(&vars, "sync_master_info",
- &sync_masterinfo_period);
-static sys_var_const sys_relay_log_space_limit(&vars,
- "relay_log_space_limit",
- OPT_GLOBAL, SHOW_LONGLONG,
- (uchar*)
- &relay_log_space_limit);
-static sys_var_const sys_slave_load_tmpdir(&vars, "slave_load_tmpdir",
- OPT_GLOBAL, SHOW_CHAR_PTR,
- (uchar*) &slave_load_tmpdir);
-static sys_var_long_ptr sys_slave_net_timeout(&vars, "slave_net_timeout",
- &slave_net_timeout,
- fix_slave_net_timeout);
-static sys_var_const sys_slave_skip_errors(&vars, "slave_skip_errors",
- OPT_GLOBAL, SHOW_CHAR,
- (uchar*) slave_skip_error_names);
-static sys_var_long_ptr sys_slave_trans_retries(&vars, "slave_transaction_retries",
- &slave_trans_retries);
-static sys_var_slave_skip_counter sys_slave_skip_counter(&vars, "sql_slave_skip_counter");
-
-
-bool sys_var_slave_skip_counter::check(THD *thd, set_var *var)
-{
- int result= 0;
- pthread_mutex_lock(&LOCK_active_mi);
- pthread_mutex_lock(&active_mi->rli.run_lock);
- if (active_mi->rli.slave_running)
- {
- my_message(ER_SLAVE_MUST_STOP, ER(ER_SLAVE_MUST_STOP), MYF(0));
- result=1;
- }
- pthread_mutex_unlock(&active_mi->rli.run_lock);
- pthread_mutex_unlock(&LOCK_active_mi);
- var->save_result.ulong_value= (ulong) var->value->val_int();
- return result;
-}
-
-
-bool sys_var_slave_skip_counter::update(THD *thd, set_var *var)
-{
- pthread_mutex_lock(&LOCK_active_mi);
- pthread_mutex_lock(&active_mi->rli.run_lock);
- /*
- The following test should normally never be true as we test this
- in the check function; To be safe against multiple
- SQL_SLAVE_SKIP_COUNTER request, we do the check anyway
- */
- if (!active_mi->rli.slave_running)
- {
- pthread_mutex_lock(&active_mi->rli.data_lock);
- active_mi->rli.slave_skip_counter= var->save_result.ulong_value;
- pthread_mutex_unlock(&active_mi->rli.data_lock);
- }
- pthread_mutex_unlock(&active_mi->rli.run_lock);
- pthread_mutex_unlock(&LOCK_active_mi);
- return 0;
-}
-
-
-int init_replication_sys_vars()
-{
- if (mysql_add_sys_var_chain(vars.first, my_long_options))
- {
- /* should not happen */
- fprintf(stderr, "failed to initialize replication system variables");
- unireg_abort(1);
- }
- return 0;
-}
-
-
#endif /* HAVE_REPLICATION */
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 5f52ef9f856..5f1c5ac2a34 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -120,8 +120,7 @@ static COND *optimize_cond(JOIN *join, COND *conds,
Item::cond_result *cond_value);
static bool const_expression_in_where(COND *conds,Item *item, Item **comp_item);
static bool open_tmp_table(TABLE *table);
-static bool create_myisam_tmp_table(TABLE *table,TMP_TABLE_PARAM *param,
- ulonglong options);
+static bool create_myisam_tmp_table(TABLE *,TMP_TABLE_PARAM *, ulonglong, my_bool);
static int do_select(JOIN *join,List<Item> *fields,TABLE *tmp_table,
Procedure *proc);
@@ -267,7 +266,7 @@ bool handle_select(THD *thd, LEX *lex, select_result *result,
(ORDER*) select_lex->group_list.first,
select_lex->having,
(ORDER*) lex->proc_list.first,
- select_lex->options | thd->options |
+ select_lex->options | thd->variables.option_bits |
setup_tables_done_option,
result, unit, select_lex);
}
@@ -1017,7 +1016,7 @@ JOIN::optimize()
error= 0;
DBUG_RETURN(0);
}
- if (!(thd->options & OPTION_BIG_SELECTS) &&
+ if (!(thd->variables.option_bits & OPTION_BIG_SELECTS) &&
best_read > (double) thd->variables.max_join_size &&
!(select_options & SELECT_DESCRIBE))
{ /* purecov: inspected */
@@ -1505,15 +1504,10 @@ JOIN::optimize()
if (!(exec_tmp_table1=
create_tmp_table(thd, &tmp_table_param, all_fields,
- tmp_group,
- group_list ? 0 : select_distinct,
+ tmp_group, group_list ? 0 : select_distinct,
group_list && simple_group,
- select_options,
- tmp_rows_limit,
- (char *) "")))
- {
+ select_options, tmp_rows_limit, "")))
DBUG_RETURN(1);
- }
/*
We don't have to store rows in temp table that doesn't match HAVING if:
@@ -1987,8 +1981,7 @@ JOIN::exec()
curr_join->select_distinct &&
!curr_join->group_list,
1, curr_join->select_options,
- HA_POS_ERROR,
- (char *) "")))
+ HA_POS_ERROR, "")))
DBUG_VOID_RETURN;
curr_join->exec_tmp_table2= exec_tmp_table2;
}
@@ -2834,8 +2827,7 @@ make_join_statistics(JOIN *join, TABLE_LIST *tables_arg, COND *conds,
!table->fulltext_searched &&
!table->pos_in_table_list->embedding)
{
- if ((table->key_info[key].flags & (HA_NOSAME | HA_END_SPACE_KEY))
- == HA_NOSAME)
+ if (table->key_info[key].flags & HA_NOSAME)
{
if (const_ref == eq_part)
{ // Found everything for ref.
@@ -5815,8 +5807,7 @@ static bool create_ref_for_key(JOIN *join, JOIN_TAB *j, KEYUSE *org_keyuse,
DBUG_RETURN(0);
if (j->type == JT_CONST)
j->table->const_table= 1;
- else if (((keyinfo->flags & (HA_NOSAME | HA_NULL_PART_KEY |
- HA_END_SPACE_KEY)) != HA_NOSAME) ||
+ else if (((keyinfo->flags & (HA_NOSAME | HA_NULL_PART_KEY)) != HA_NOSAME) ||
keyparts != keyinfo->key_parts || null_ref_key)
{
/* Must read with repeat */
@@ -9373,7 +9364,7 @@ remove_eq_conds(THD *thd, COND *cond, Item::cond_result *cond_value)
{
Field *field=((Item_field*) args[0])->field;
if (field->flags & AUTO_INCREMENT_FLAG && !field->table->maybe_null &&
- (thd->options & OPTION_AUTO_IS_NULL) &&
+ (thd->variables.option_bits & OPTION_AUTO_IS_NULL) &&
(thd->first_successful_insert_id_in_prev_stmt > 0 &&
thd->substitute_null_with_insert_id))
{
@@ -9923,7 +9914,7 @@ TABLE *
create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
ORDER *group, bool distinct, bool save_sum_fields,
ulonglong select_options, ha_rows rows_limit,
- char *table_alias)
+ const char *table_alias)
{
MEM_ROOT *mem_root_save, own_root;
TABLE *table;
@@ -10238,9 +10229,9 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
/* If result table is small; use a heap */
/* future: storage engine selection can be made dynamic? */
- if (blob_count || using_unique_constraint ||
- (select_options & (OPTION_BIG_TABLES | SELECT_SMALL_RESULT)) ==
- OPTION_BIG_TABLES || (select_options & TMP_TABLE_FORCE_MYISAM))
+ if (blob_count || using_unique_constraint
+ || (thd->variables.big_tables && !(select_options & SELECT_SMALL_RESULT))
+ || (select_options & TMP_TABLE_FORCE_MYISAM))
{
share->db_plugin= ha_lock_engine(0, myisam_hton);
table->file= get_new_handler(share, &table->mem_root,
@@ -10567,7 +10558,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
share->db_record_offset= 1;
if (share->db_type() == myisam_hton)
{
- if (create_myisam_tmp_table(table,param,select_options))
+ if (create_myisam_tmp_table(table, param, select_options,
+ thd->variables.big_tables))
goto err;
}
if (open_tmp_table(table))
@@ -10731,7 +10723,7 @@ static bool open_tmp_table(TABLE *table)
static bool create_myisam_tmp_table(TABLE *table,TMP_TABLE_PARAM *param,
- ulonglong options)
+ ulonglong options, my_bool big_tables)
{
int error;
MI_KEYDEF keydef;
@@ -10818,8 +10810,7 @@ static bool create_myisam_tmp_table(TABLE *table,TMP_TABLE_PARAM *param,
MI_CREATE_INFO create_info;
bzero((char*) &create_info,sizeof(create_info));
- if ((options & (OPTION_BIG_TABLES | SELECT_SMALL_RESULT)) ==
- OPTION_BIG_TABLES)
+ if (big_tables && !(options & SELECT_SMALL_RESULT))
create_info.data_file_length= ~(ulonglong) 0;
if ((error=mi_create(share->table_name.str, share->keys, &keydef,
@@ -10920,7 +10911,8 @@ bool create_myisam_from_heap(THD *thd, TABLE *table, TMP_TABLE_PARAM *param,
thd_proc_info(thd, "converting HEAP to MyISAM");
if (create_myisam_tmp_table(&new_table, param,
- thd->lex->select_lex.options | thd->options))
+ thd->lex->select_lex.options | thd->variables.option_bits,
+ thd->variables.big_tables))
goto err2;
if (open_tmp_table(&new_table))
goto err1;
@@ -16786,7 +16778,7 @@ bool mysql_explain_union(THD *thd, SELECT_LEX_UNIT *unit, select_result *result)
(ORDER*) first->group_list.first,
first->having,
(ORDER*) thd->lex->proc_list.first,
- first->options | thd->options | SELECT_DESCRIBE,
+ first->options | thd->variables.option_bits | SELECT_DESCRIBE,
result, unit, first);
}
DBUG_RETURN(res || thd->is_error());
diff --git a/sql/sql_select.h b/sql/sql_select.h
index bdca4b196bc..3a664546397 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -578,7 +578,7 @@ bool store_val_in_field(Field *field, Item *val, enum_check_fields check_flag);
TABLE *create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
ORDER *group, bool distinct, bool save_sum_fields,
ulonglong select_options, ha_rows rows_limit,
- char* alias);
+ const char* alias);
void free_tmp_table(THD *thd, TABLE *entry);
void count_field_types(SELECT_LEX *select_lex, TMP_TABLE_PARAM *param,
List<Item> &fields, bool reset_with_sum_func);
@@ -644,7 +644,7 @@ public:
enum store_key_result result;
THD *thd= to_field->table->in_use;
enum_check_fields saved_count_cuted_fields= thd->count_cuted_fields;
- ulong sql_mode= thd->variables.sql_mode;
+ ulonglong sql_mode= thd->variables.sql_mode;
thd->variables.sql_mode&= ~(MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE);
thd->count_cuted_fields= CHECK_FIELD_IGNORE;
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index cb77f2b2a1d..92366b4bc1a 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -22,6 +22,7 @@
#include "repl_failsafe.h"
#include "sp.h"
#include "sp_head.h"
+#include "set_var.h"
#include "sql_trigger.h"
#include "authors.h"
#include "contributors.h"
@@ -960,7 +961,7 @@ int get_quote_char_for_identifier(THD *thd, const char *name, uint length)
if (length &&
!is_keyword(name,length) &&
!require_quotes(name, length) &&
- !(thd->options & OPTION_QUOTE_SHOW_CREATE))
+ !(thd->variables.option_bits & OPTION_QUOTE_SHOW_CREATE))
return EOF;
if (thd->variables.sql_mode & MODE_ANSI_QUOTES)
return '"';
@@ -2214,6 +2215,15 @@ static bool show_status_array(THD *thd, const char *wild,
end= strend(pos);
break;
}
+ case SHOW_LEX_STRING:
+ {
+ LEX_STRING *ls=(LEX_STRING*)value;
+ if (!(pos= ls->str))
+ end= pos= "";
+ else
+ end= pos + ls->length;
+ break;
+ }
case SHOW_KEY_CACHE_LONG:
value= (char*) dflt_key_cache + (ulong)value;
end= int10_to_str(*(long*) value, buff, 10);
@@ -4589,8 +4599,7 @@ static bool store_trigger(THD *thd, TABLE *table, LEX_STRING *db_name,
table->field[14]->store(STRING_WITH_LEN("OLD"), cs);
table->field[15]->store(STRING_WITH_LEN("NEW"), cs);
- sys_var_thd_sql_mode::symbolic_mode_representation(thd, sql_mode,
- &sql_mode_rep);
+ sql_mode_string_representation(thd, sql_mode, &sql_mode_rep);
table->field[17]->store(sql_mode_rep.str, sql_mode_rep.length, cs);
table->field[18]->store(definer_buffer->str, definer_buffer->length, cs);
table->field[19]->store(client_cs_name->str, client_cs_name->length, cs);
@@ -5321,8 +5330,7 @@ copy_event_to_schema_table(THD *thd, TABLE *sch_table, TABLE *event_table)
/* SQL_MODE */
{
LEX_STRING sql_mode;
- sys_var_thd_sql_mode::symbolic_mode_representation(thd, et.sql_mode,
- &sql_mode);
+ sql_mode_string_representation(thd, et.sql_mode, &sql_mode);
sch_table->field[ISE_SQL_MODE]->
store(sql_mode.str, sql_mode.length, scs);
}
@@ -5486,7 +5494,7 @@ int fill_variables(THD *thd, TABLE_LIST *tables, COND *cond)
option_type= OPT_GLOBAL;
rw_rdlock(&LOCK_system_variables_hash);
- res= show_status_array(thd, wild, enumerate_sys_vars(thd, sorted_vars),
+ res= show_status_array(thd, wild, enumerate_sys_vars(thd, sorted_vars, option_type),
option_type, NULL, "", tables->table, upper_case_names, cond);
rw_unlock(&LOCK_system_variables_hash);
DBUG_RETURN(res);
@@ -5811,7 +5819,7 @@ TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list)
SELECT_LEX *select_lex= thd->lex->current_select;
if (!(table= create_tmp_table(thd, tmp_table_param,
field_list, (ORDER*) 0, 0, 0,
- (select_lex->options | thd->options |
+ (select_lex->options | thd->variables.option_bits |
TMP_TABLE_ALL_COLUMNS),
HA_POS_ERROR, table_list->alias)))
DBUG_RETURN(0);
@@ -7057,9 +7065,7 @@ static bool show_create_trigger_impl(THD *thd,
&trg_connection_cl_name,
&trg_db_cl_name);
- sys_var_thd_sql_mode::symbolic_mode_representation(thd,
- trg_sql_mode,
- &trg_sql_mode_str);
+ sql_mode_string_representation(thd, trg_sql_mode, &trg_sql_mode_str);
/* Resolve trigger client character set. */
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index c4904feffa6..633c405ea25 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -22,6 +22,7 @@
#include "sp_head.h"
#include "sql_trigger.h"
#include "sql_show.h"
+#include "keycaches.h"
#ifdef __WIN__
#include <io.h>
@@ -2214,10 +2215,10 @@ static int sort_keys(KEY *a, KEY *b)
{
if (!(b_flags & HA_NOSAME))
return -1;
- if ((a_flags ^ b_flags) & (HA_NULL_PART_KEY | HA_END_SPACE_KEY))
+ if ((a_flags ^ b_flags) & HA_NULL_PART_KEY)
{
/* Sort NOT NULL keys before other keys */
- return (a_flags & (HA_NULL_PART_KEY | HA_END_SPACE_KEY)) ? 1 : -1;
+ return (a_flags & HA_NULL_PART_KEY) ? 1 : -1;
}
if (a->name == primary_key_name)
return -1;
@@ -5057,45 +5058,6 @@ bool mysql_assign_to_keycache(THD* thd, TABLE_LIST* tables,
/*
- Reassign all tables assigned to a key cache to another key cache
-
- SYNOPSIS
- reassign_keycache_tables()
- thd Thread object
- src_cache Reference to the key cache to clean up
- dest_cache New key cache
-
- NOTES
- This is called when one sets a key cache size to zero, in which
- case we have to move the tables associated to this key cache to
- the "default" one.
-
- One has to ensure that one never calls this function while
- some other thread is changing the key cache. This is assured by
- the caller setting src_cache->in_init before calling this function.
-
- We don't delete the old key cache as there may still be pointers pointing
- to it for a while after this function returns.
-
- RETURN VALUES
- 0 ok
-*/
-
-int reassign_keycache_tables(THD *thd, KEY_CACHE *src_cache,
- KEY_CACHE *dst_cache)
-{
- DBUG_ENTER("reassign_keycache_tables");
-
- DBUG_ASSERT(src_cache != dst_cache);
- DBUG_ASSERT(src_cache->in_init);
- src_cache->param_buff_size= 0; // Free key cache
- ha_resize_key_cache(src_cache);
- ha_change_key_cache(src_cache, dst_cache);
- DBUG_RETURN(0);
-}
-
-
-/*
Preload specified indexes for a table into key cache
SYNOPSIS
diff --git a/sql/sql_test.cc b/sql/sql_test.cc
index ac1dae3197d..8dc4b4ffeb6 100644
--- a/sql/sql_test.cc
+++ b/sql/sql_test.cc
@@ -19,6 +19,7 @@
#include "mysql_priv.h"
#include "sql_select.h"
+#include "keycaches.h"
#include <hash.h>
#include <thr_alarm.h>
#if defined(HAVE_MALLINFO) && defined(HAVE_MALLOC_H)
@@ -442,8 +443,10 @@ writes: %10s\n\
r_requests: %10s\n\
reads: %10s\n\n",
name,
- (ulong) key_cache->param_buff_size, key_cache->param_block_size,
- key_cache->param_division_limit, key_cache->param_age_threshold,
+ (ulong) key_cache->param_buff_size,
+ (ulong)key_cache->param_block_size,
+ (ulong)key_cache->param_division_limit,
+ (ulong)key_cache->param_age_threshold,
key_cache->blocks_used,key_cache->global_blocks_changed,
llstr(key_cache->global_cache_w_requests,llbuff1),
llstr(key_cache->global_cache_write,llbuff2),
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index cbf94ad7181..5bdff4dc9bf 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -121,7 +121,7 @@ select_union::create_result_table(THD *thd_arg, List<Item> *column_types,
if (! (table= create_tmp_table(thd_arg, &tmp_table_param, *column_types,
(ORDER*) 0, is_union_distinct, 1,
- options, HA_POS_ERROR, (char*) alias)))
+ options, HA_POS_ERROR, alias)))
return TRUE;
table->file->extra(HA_EXTRA_WRITE_CACHE);
table->file->extra(HA_EXTRA_IGNORE_DUP_KEY);
@@ -232,7 +232,7 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
bool can_skip_order_by;
sl->options|= SELECT_NO_UNLOCK;
JOIN *join= new JOIN(thd_arg, sl->item_list,
- sl->options | thd_arg->options | additional_options,
+ sl->options | thd_arg->variables.option_bits | additional_options,
tmp_result);
/*
setup_tables_done_option should be set only for very first SELECT,
@@ -335,7 +335,7 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
}
}
- create_options= (first_sl->options | thd_arg->options |
+ create_options= (first_sl->options | thd_arg->variables.option_bits |
TMP_TABLE_ALL_COLUMNS);
/*
Force the temporary table to be a MyISAM table if we're going to use
@@ -376,7 +376,7 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
init_prepare_fake_select_lex(thd);
/* Should be done only once (the only item_list per statement) */
DBUG_ASSERT(fake_select_lex->join == 0);
- if (!(fake_select_lex->join= new JOIN(thd, item_list, thd->options,
+ if (!(fake_select_lex->join= new JOIN(thd, item_list, thd->variables.option_bits,
result)))
{
fake_select_lex->table_list.empty();
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index cc92d224cd9..b197434d798 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -185,7 +185,7 @@ int mysql_update(THD *thd,
ha_rows *found_return, ha_rows *updated_return)
{
bool using_limit= limit != HA_POS_ERROR;
- bool safe_update= test(thd->options & OPTION_SAFE_UPDATES);
+ bool safe_update= test(thd->variables.option_bits & OPTION_SAFE_UPDATES);
bool used_key_is_modified, transactional_table, will_batch;
bool can_compare_record;
int res;
@@ -1493,7 +1493,7 @@ multi_update::initialize_tables(JOIN *join)
TABLE_LIST *table_ref;
DBUG_ENTER("initialize_tables");
- if ((thd->options & OPTION_SAFE_UPDATES) && error_if_full_join(join))
+ if ((thd->variables.option_bits & OPTION_SAFE_UPDATES) && error_if_full_join(join))
DBUG_RETURN(1);
main_table=join->join_tab->table;
table_to_update= 0;
@@ -1617,13 +1617,14 @@ loop_end:
tmp_param->field_count=temp_fields.elements;
tmp_param->group_parts=1;
tmp_param->group_length= table->file->ref_length;
- if (!(tmp_tables[cnt]=create_tmp_table(thd,
- tmp_param,
- temp_fields,
- (ORDER*) &group, 0, 0,
- TMP_TABLE_ALL_COLUMNS,
- HA_POS_ERROR,
- (char *) "")))
+ /* small table, ignore SQL_BIG_TABLES */
+ my_bool save_big_tables= thd->variables.big_tables;
+ thd->variables.big_tables= FALSE;
+ tmp_tables[cnt]=create_tmp_table(thd, tmp_param, temp_fields,
+ (ORDER*) &group, 0, 0,
+ TMP_TABLE_ALL_COLUMNS, HA_POS_ERROR, "");
+ thd->variables.big_tables= save_big_tables;
+ if (!tmp_tables[cnt])
DBUG_RETURN(1);
tmp_tables[cnt]->file->extra(HA_EXTRA_WRITE_CACHE);
}
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index 8305303f351..cb60c3b34e4 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -29,15 +29,6 @@ const LEX_STRING view_type= { C_STRING_WITH_LEN("VIEW") };
static int mysql_register_view(THD *thd, TABLE_LIST *view,
enum_view_create_mode mode);
-const char *updatable_views_with_limit_names[]= { "NO", "YES", NullS };
-TYPELIB updatable_views_with_limit_typelib=
-{
- array_elements(updatable_views_with_limit_names)-1, "",
- updatable_views_with_limit_names,
- 0
-};
-
-
/*
Make a unique name for an anonymous view column
SYNOPSIS
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 0d3610ccee1..296316896c9 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -47,6 +47,8 @@
#include "event_parse_data.h"
#include <myisam.h>
#include <myisammrg.h>
+#include "keycaches.h"
+#include "set_var.h"
/* this is to get the bison compilation windows warnings out */
#ifdef _MSC_VER
@@ -426,7 +428,7 @@ set_system_variable(THD *thd, struct sys_var_with_base *tmp,
LEX *lex= thd->lex;
/* No AUTOCOMMIT from a stored function or trigger. */
- if (lex->spcont && tmp->var == &sys_autocommit)
+ if (lex->spcont && tmp->var == Sys_autocommit_ptr)
lex->sphead->m_flags|= sp_head::HAS_SET_AUTOCOMMIT_STMT;
if (! (var= new set_var(var_type, tmp->var, &tmp->base_name, val)))
@@ -4719,7 +4721,6 @@ part_value_item:
part_value_item_list {}
')'
{
- LEX *lex= Lex;
partition_info *part_info= Lex->part_info;
part_info->print_debug(") part_value_item", NULL);
if (part_info->num_columns == 0)
@@ -4750,7 +4751,6 @@ part_value_expr_item:
MAX_VALUE_SYM
{
partition_info *part_info= Lex->part_info;
- part_column_list_val *col_val;
if (part_info->part_type == LIST_PARTITION)
{
my_parse_error(ER(ER_MAXVALUE_IN_VALUES_IN));
@@ -7019,7 +7019,7 @@ cache_keys_spec:
{
Lex->select_lex.alloc_index_hints(YYTHD);
Select->set_index_hint_type(INDEX_HINT_USE,
- global_system_variables.old_mode ?
+ old_mode ?
INDEX_HINT_MASK_JOIN :
INDEX_HINT_MASK_ALL);
}
@@ -9372,8 +9372,7 @@ opt_outer:
index_hint_clause:
/* empty */
{
- $$= global_system_variables.old_mode ?
- INDEX_HINT_MASK_JOIN : INDEX_HINT_MASK_ALL;
+ $$= old_mode ? INDEX_HINT_MASK_JOIN : INDEX_HINT_MASK_ALL;
}
| FOR_SYM JOIN_SYM { $$= INDEX_HINT_MASK_JOIN; }
| FOR_SYM ORDER_SYM BY { $$= INDEX_HINT_MASK_ORDER; }
diff --git a/sql/strfunc.cc b/sql/strfunc.cc
index 56fa4a380ea..d7ab102b225 100644
--- a/sql/strfunc.cc
+++ b/sql/strfunc.cc
@@ -45,6 +45,7 @@ ulonglong find_set(TYPELIB *lib, const char *str, uint length, CHARSET_INFO *cs,
const char *end= str + strip->cset->lengthsp(strip, str, length);
ulonglong found= 0;
*err_pos= 0; // No error yet
+ *err_len= 0;
if (str != end)
{
const char *start= str;
@@ -71,7 +72,7 @@ ulonglong find_set(TYPELIB *lib, const char *str, uint length, CHARSET_INFO *cs,
var_len= (uint) (pos - start);
uint find= cs ? find_type2(lib, start, var_len, cs) :
find_type(lib, start, var_len, (bool) 0);
- if (!find)
+ if (!find && *err_len == 0) // report the first error with length > 0
{
*err_pos= (char*) start;
*err_len= var_len;
@@ -87,209 +88,6 @@ ulonglong find_set(TYPELIB *lib, const char *str, uint length, CHARSET_INFO *cs,
return found;
}
-
-static const char *on_off_default_names[]=
-{
- "off","on","default", NullS
-};
-
-static const unsigned int on_off_default_names_len[]=
-{
- sizeof("off") - 1,
- sizeof("on") - 1,
- sizeof("default") - 1
-};
-
-static TYPELIB on_off_default_typelib= {array_elements(on_off_default_names)-1,
- "", on_off_default_names,
- (unsigned int *)on_off_default_names_len};
-
-
-/*
- Parse a TYPELIB name from the buffer
-
- SYNOPSIS
- parse_name()
- lib Set of names to scan for.
- strpos INOUT Start of the buffer (updated to point to the next
- character after the name)
- end End of the buffer
- cs Charset used in the buffer
-
- DESCRIPTION
- Parse a TYPELIB name from the buffer. The buffer is assumed to contain
- one of the names specified in the TYPELIB, followed by comma, '=', or
- end of the buffer.
-
- RETURN
- 0 No matching name
- >0 Offset+1 in typelib for matched name
-*/
-
-static uint parse_name(TYPELIB *lib, const char **strpos, const char *end,
- CHARSET_INFO *cs)
-{
- const char *pos= *strpos;
- const char *start= pos;
-
- /* Find the length */
- if (cs && cs->mbminlen > 1)
- {
- int mblen= 0;
- for ( ; pos < end; pos+= mblen)
- {
- my_wc_t wc;
- if ((mblen= cs->cset->mb_wc(cs, &wc, (const uchar *) pos,
- (const uchar *) end)) < 1)
- mblen= 1; // Not to hang on a wrong multibyte sequence
- if (wc == (my_wc_t) '=' || wc == (my_wc_t) ',')
- break;
- }
- }
- else
- for (; pos != end && *pos != '=' && *pos !=',' ; pos++) ;
-
- uint var_len= (uint) (pos - start);
- /* Determine which flag it is */
- uint find= cs ? find_type2(lib, start, var_len, cs) :
- find_type(lib, start, var_len, (bool) 0);
- *strpos= pos;
- return find;
-}
-
-
-/* Read next character from the buffer in a charset-aware way */
-
-static my_wc_t get_next_char(const char **pos, const char *end, CHARSET_INFO *cs)
-{
- my_wc_t wc;
- if (*pos == end)
- return (my_wc_t)-1;
-
- if (cs && cs->mbminlen > 1)
- {
- int mblen;
- if ((mblen= cs->cset->mb_wc(cs, &wc, (const uchar *) *pos,
- (const uchar *) end)) < 1)
- mblen= 1; // Not to hang on a wrong multibyte sequence
- *pos += mblen;
- return wc;
- }
- else
- return *((*pos)++);
-}
-
-
-/*
- Parse and apply a set of flag assingments
-
- SYNOPSIS
- find_set_from_flags()
- lib Flag names
- default_name Number of "default" in the typelib
- cur_set Current set of flags (start from this state)
- default_set Default set of flags (use this for assign-default
- keyword and flag=default assignments)
- str String to be parsed
- length Length of the string
- cs String charset
- err_pos OUT If error, set to point to start of wrong set string
- NULL on success
- err_len OUT If error, set to the length of wrong set string
- set_warning OUT TRUE <=> Some string in set couldn't be used
-
- DESCRIPTION
- Parse a set of flag assignments, that is, parse a string in form:
-
- param_name1=value1,param_name2=value2,...
-
- where the names are specified in the TYPELIB, and each value can be
- either 'on','off', or 'default'. Setting the same name twice is not
- allowed.
-
- Besides param=val assignments, we support the "default" keyword (keyword
- #default_name in the typelib). It can be used one time, if specified it
- causes us to build the new set over the default_set rather than cur_set
- value.
-
- RETURN
- Parsed set value if (*errpos == NULL)
- Otherwise undefined
-*/
-
-ulonglong find_set_from_flags(TYPELIB *lib, uint default_name,
- ulonglong cur_set, ulonglong default_set,
- const char *str, uint length, CHARSET_INFO *cs,
- char **err_pos, uint *err_len, bool *set_warning)
-{
- CHARSET_INFO *strip= cs ? cs : &my_charset_latin1;
- const char *end= str + strip->cset->lengthsp(strip, str, length);
- ulonglong flags_to_set= 0, flags_to_clear= 0;
- bool set_defaults= 0;
- *err_pos= 0; // No error yet
- if (str != end)
- {
- const char *start= str;
- for (;;)
- {
- const char *pos= start;
- uint flag_no, value;
-
- if (!(flag_no= parse_name(lib, &pos, end, cs)))
- goto err;
-
- if (flag_no == default_name)
- {
- /* Using 'default' twice isn't allowed. */
- if (set_defaults)
- goto err;
- set_defaults= TRUE;
- }
- else
- {
- ulonglong bit= ((longlong) 1 << (flag_no - 1));
- /* parse the '=on|off|default' */
- if ((flags_to_clear | flags_to_set) & bit ||
- get_next_char(&pos, end, cs) != '=' ||
- !(value= parse_name(&on_off_default_typelib, &pos, end, cs)))
- {
- goto err;
- }
-
- if (value == 1) // this is '=off'
- flags_to_clear|= bit;
- else if (value == 2) // this is '=on'
- flags_to_set|= bit;
- else // this is '=default'
- {
- if (default_set & bit)
- flags_to_set|= bit;
- else
- flags_to_clear|= bit;
- }
- }
- if (pos >= end)
- break;
-
- if (get_next_char(&pos, end, cs) != ',')
- goto err;
-
- start=pos;
- continue;
- err:
- *err_pos= (char*)start;
- *err_len= end - start;
- *set_warning= TRUE;
- break;
- }
- }
- ulonglong res= set_defaults? default_set : cur_set;
- res|= flags_to_set;
- res&= ~flags_to_clear;
- return res;
-}
-
-
/*
Function to find a string in a TYPELIB
(Same format as mysys/typelib.c)
@@ -543,3 +341,60 @@ int find_string_in_array(LEX_STRING * const haystack, LEX_STRING * const needle,
}
return -1;
}
+
+
+char *set_to_string(THD *thd, LEX_STRING *result, ulonglong set,
+ const char *lib[])
+{
+ char buff[STRING_BUFFER_USUAL_SIZE*8];
+ String tmp(buff, sizeof(buff), &my_charset_latin1);
+ LEX_STRING unused;
+
+ if (!result)
+ result= &unused;
+
+ tmp.length(0);
+
+ for (uint i= 0; set; i++, set >>= 1)
+ if (set & 1) {
+ tmp.append(lib[i]);
+ tmp.append(',');
+ }
+
+ if (tmp.length())
+ {
+ result->str= thd->strmake(tmp.ptr(), tmp.length()-1);
+ result->length= tmp.length()-1;
+ }
+ else
+ {
+ result->str= const_cast<char*>("");
+ result->length= 0;
+ }
+ return result->str;
+}
+
+char *flagset_to_string(THD *thd, LEX_STRING *result, ulonglong set,
+ const char *lib[])
+{
+ char buff[STRING_BUFFER_USUAL_SIZE*8];
+ String tmp(buff, sizeof(buff), &my_charset_latin1);
+ LEX_STRING unused;
+
+ if (!result) result= &unused;
+
+ tmp.length(0);
+
+ // note that the last element is always "default", and it's ignored below
+ for (uint i= 0; lib[i+1]; i++, set >>= 1)
+ {
+ tmp.append(lib[i]);
+ tmp.append(set & 1 ? "=on," : "=off,");
+ }
+
+ result->str= thd->strmake(tmp.ptr(), tmp.length()-1);
+ result->length= tmp.length()-1;
+
+ return result->str;
+}
+
diff --git a/sql/structs.h b/sql/structs.h
index 33b7148c4b3..041a6809804 100644
--- a/sql/structs.h
+++ b/sql/structs.h
@@ -142,8 +142,6 @@ typedef struct st_known_date_time_format {
const char *time_format;
} KNOWN_DATE_TIME_FORMAT;
-enum SHOW_COMP_OPTION { SHOW_OPTION_YES, SHOW_OPTION_NO, SHOW_OPTION_DISABLED};
-
extern const char *show_comp_option_name[];
typedef int *(*update_var)(THD *, struct st_mysql_show_var *);
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
new file mode 100644
index 00000000000..3c4683d23f9
--- /dev/null
+++ b/sql/sys_vars.cc
@@ -0,0 +1,2738 @@
+/* Copyright (C) 2002-2006 MySQL AB, 2009 Sun Microsystems, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+/*
+ How to add new variables:
+
+ 1. copy one of the existing variables, and edit the declaration.
+ 2. if you need special behavior on assignment or additional checks
+ use ON_CHECK and ON_UPDATE callbacks.
+ 3. *Don't* add new Sys_var classes or uncle Occam will come
+ with his razor to haunt you at nights
+
+ Note - all storage engine variables (for example myisam_whatever)
+ should go into the corresponding storage engine sources
+ (for example in storage/myisam/ha_myisam.cc) !
+*/
+
+#include "sys_vars.h"
+
+#include "events.h"
+#include <thr_alarm.h>
+#include "slave.h"
+#include "rpl_mi.h"
+
+/*
+ The rule for this file: everything should be 'static'. When a sys_var
+ variable or a function from this file is - in very rare cases - needed
+ elsewhere it should be explicitly declared 'export' here to show that it's
+ not a mistakenly forgotten 'static' keyword.
+*/
+#define export /* not static */
+
+static Sys_var_ulong Sys_auto_increment_increment(
+ "auto_increment_increment",
+ "Auto-increment columns are incremented by this",
+ SESSION_VAR(auto_increment_increment),
+ CMD_LINE(OPT_ARG),
+ VALID_RANGE(1, 65535), DEFAULT(1), BLOCK_SIZE(1),
+ NO_MUTEX_GUARD, IN_BINLOG);
+
+static Sys_var_ulong Sys_auto_increment_offset(
+ "auto_increment_offset",
+ "Offset added to Auto-increment columns. Used when "
+ "auto-increment-increment != 1",
+ SESSION_VAR(auto_increment_offset),
+ CMD_LINE(OPT_ARG),
+ VALID_RANGE(1, 65535), DEFAULT(1), BLOCK_SIZE(1),
+ NO_MUTEX_GUARD, IN_BINLOG);
+
+static Sys_var_mybool Sys_automatic_sp_privileges(
+ "automatic_sp_privileges",
+ "Creating and dropping stored procedures alters ACLs",
+ GLOBAL_VAR(sp_automatic_privileges),
+ CMD_LINE(OPT_ARG), DEFAULT(TRUE));
+
+static Sys_var_ulong Sys_back_log(
+ "back_log", "The number of outstanding connection requests "
+ "MySQL can have. This comes into play when the main MySQL thread "
+ "gets very many connection requests in a very short time",
+ READ_ONLY GLOBAL_VAR(back_log), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(1, 65535), DEFAULT(50), BLOCK_SIZE(1));
+
+static Sys_var_charptr Sys_basedir(
+ "basedir", "Path to installation directory. All paths are "
+ "usually resolved relative to this",
+ READ_ONLY GLOBAL_VAR(mysql_home_ptr), CMD_LINE(REQUIRED_ARG, 'b'),
+ IN_FS_CHARSET, DEFAULT(0));
+
+static Sys_var_ulong Sys_binlog_cache_size(
+ "binlog_cache_size", "The size of the cache to "
+ "hold the SQL statements for the binary log during a "
+ "transaction. If you often use big, multi-statement "
+ "transactions you can increase this to get more performance",
+ GLOBAL_VAR(binlog_cache_size),
+ CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(IO_SIZE, ULONG_MAX), DEFAULT(32768), BLOCK_SIZE(IO_SIZE));
+
+static bool check_has_super(sys_var *self, THD *thd, set_var *var)
+{
+ DBUG_ASSERT(self->scope() != sys_var::GLOBAL);// don't abuse check_has_super()
+#ifndef NO_EMBEDDED_ACCESS_CHECKS
+ if (!(thd->security_ctx->master_access & SUPER_ACL))
+ {
+ my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "SUPER");
+ return true;
+ }
+#endif
+ return false;
+}
+static bool binlog_format_check(sys_var *self, THD *thd, set_var *var)
+{
+ if (check_has_super(self, thd, var))
+ return true;
+ if (var->type == OPT_GLOBAL ||
+ (thd->variables.binlog_format == var->save_result.ulonglong_value))
+ return false;
+
+ /*
+ If RBR and open temporary tables, their CREATE TABLE may not be in the
+ binlog, so we can't toggle to SBR in this connection.
+ */
+ if ((thd->variables.binlog_format == BINLOG_FORMAT_ROW) &&
+ thd->temporary_tables)
+ {
+ my_error(ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR, MYF(0));
+ return true;
+ }
+ /*
+ if in a stored function/trigger, it's too late to change mode
+ */
+ if (thd->in_sub_stmt)
+ {
+ my_error(ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT, MYF(0));
+ return true;
+ }
+ return false;
+}
+
+static bool fix_binlog_format_after_update(sys_var *self, THD *thd,
+ enum_var_type type)
+{
+ if (type == OPT_SESSION)
+ thd->reset_current_stmt_binlog_row_based();
+ return false;
+}
+
+static Sys_var_enum Sys_binlog_format(
+ "binlog_format", "What form of binary logging the master will "
+ "use: either ROW for row-based binary logging, STATEMENT "
+ "for statement-based binary logging, or MIXED. MIXED is statement-"
+ "based binary logging except for those statements where only row-"
+ "based is correct: those which involve user-defined functions (i.e. "
+ "UDFs) or the UUID() function; for those, row-based binary logging is "
+ "automatically used. If NDBCLUSTER is enabled and binlog-format is "
+ "MIXED, the format switches to row-based and back implicitly per each "
+ "query accessing an NDBCLUSTER table",
+ SESSION_VAR(binlog_format), CMD_LINE(REQUIRED_ARG, OPT_BINLOG_FORMAT),
+ binlog_format_names, DEFAULT(BINLOG_FORMAT_STMT),
+ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(binlog_format_check),
+ ON_UPDATE(fix_binlog_format_after_update));
+
+static Sys_var_ulong Sys_bulk_insert_buff_size(
+ "bulk_insert_buffer_size", "Size of tree cache used in bulk "
+ "insert optimisation. Note that this is a limit per thread!",
+ SESSION_VAR(bulk_insert_buff_size), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(0, ULONG_MAX), DEFAULT(8192*1024), BLOCK_SIZE(1));
+
+static Sys_var_charptr Sys_character_sets_dir(
+ "character_sets_dir", "Directory where character sets are",
+ READ_ONLY GLOBAL_VAR(charsets_dir), CMD_LINE(REQUIRED_ARG),
+ IN_FS_CHARSET, DEFAULT(0));
+
+static bool check_not_null(sys_var *self, THD *thd, set_var *var)
+{
+ return var->value && var->value->is_null();
+}
+static bool check_charset(sys_var *self, THD *thd, set_var *var)
+{
+ if (!var->value)
+ return false;
+
+ char buff[STRING_BUFFER_USUAL_SIZE];
+ if (var->value->result_type() == STRING_RESULT)
+ {
+ String str(buff, sizeof(buff), system_charset_info), *res;
+ if (!(res=var->value->val_str(&str)))
+ var->save_result.ptr= NULL;
+ else if (!(var->save_result.ptr= get_charset_by_csname(res->c_ptr(),
+ MY_CS_PRIMARY,
+ MYF(0))) &&
+ !(var->save_result.ptr= get_old_charset_by_name(res->c_ptr())))
+ {
+ ErrConvString err(res);
+ my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), err.ptr());
+ return true;
+ }
+ }
+ else // INT_RESULT
+ {
+ int csno= (int)var->value->val_int();
+ if (!(var->save_result.ptr= get_charset(csno, MYF(0))))
+ {
+ my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), llstr(csno, buff));
+ return true;
+ }
+ }
+ return false;
+}
+static bool check_charset_not_null(sys_var *self, THD *thd, set_var *var)
+{
+ return check_charset(self, thd, var) || check_not_null(self, thd, var);
+}
+static Sys_var_struct Sys_character_set_system(
+ "character_set_system", "The character set used by the server "
+ "for storing identifiers",
+ READ_ONLY GLOBAL_VAR(system_charset_info), NO_CMD_LINE,
+ offsetof(CHARSET_INFO, csname), DEFAULT(0));
+
+static Sys_var_struct Sys_character_set_server(
+ "character_set_server", "The default character set",
+ SESSION_VAR(collation_server), NO_CMD_LINE,
+ offsetof(CHARSET_INFO, csname), DEFAULT(&default_charset_info),
+ NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(check_charset_not_null));
+
+static bool check_charset_db(sys_var *self, THD *thd, set_var *var)
+{
+ if (check_charset_not_null(self, thd, var))
+ return true;
+ if (!var->value) // = DEFAULT
+ var->save_result.ptr= thd->db_charset;
+ return false;
+}
+static Sys_var_struct Sys_character_set_database(
+ "character_set_database",
+ " The character set used by the default database",
+ SESSION_VAR(collation_database), NO_CMD_LINE,
+ offsetof(CHARSET_INFO, csname), DEFAULT(&default_charset_info),
+ NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(check_charset_db));
+
+static bool check_cs_client(sys_var *self, THD *thd, set_var *var)
+{
+ if (check_charset_not_null(self, thd, var))
+ return true;
+
+ // Currently, UCS-2 cannot be used as a client character set
+ if (((CHARSET_INFO *)(var->save_result.ptr))->mbminlen > 1)
+ return true;
+
+ return false;
+}
+static bool fix_thd_charset(sys_var *self, THD *thd, enum_var_type type)
+{
+ if (type == OPT_SESSION)
+ thd->update_charset();
+ return false;
+}
+static Sys_var_struct Sys_character_set_client(
+ "character_set_client", "The character set for statements "
+ "that arrive from the client",
+ SESSION_VAR(character_set_client), NO_CMD_LINE,
+ offsetof(CHARSET_INFO, csname), DEFAULT(&default_charset_info),
+ NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(check_cs_client),
+ ON_UPDATE(fix_thd_charset));
+
+static Sys_var_struct Sys_character_set_connection(
+ "character_set_connection", "The character set used for "
+ "literals that do not have a character set introducer and for "
+ "number-to-string conversion",
+ SESSION_VAR(collation_connection), NO_CMD_LINE,
+ offsetof(CHARSET_INFO, csname), DEFAULT(&default_charset_info),
+ NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(check_charset_not_null),
+ ON_UPDATE(fix_thd_charset));
+
+static Sys_var_struct Sys_character_set_results(
+ "character_set_results", "The character set used for returning "
+ "query results to the client",
+ SESSION_VAR(character_set_results), NO_CMD_LINE,
+ offsetof(CHARSET_INFO, csname), DEFAULT(&default_charset_info),
+ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_charset));
+
+static Sys_var_struct Sys_character_set_filesystem(
+ "character_set_filesystem", "The filesystem character set",
+ SESSION_VAR(character_set_filesystem), NO_CMD_LINE,
+ offsetof(CHARSET_INFO, csname), DEFAULT(&character_set_filesystem),
+ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_charset_not_null),
+ ON_UPDATE(fix_thd_charset));
+
+static const char *completion_type_names[]= {"NO_CHAIN", "CHAIN", "RELEASE", 0};
+static Sys_var_enum Sys_completion_type(
+ "completion_type", "The transaction completion type, one of "
+ "NO_CHAIN, CHAIN, RELEASE",
+ SESSION_VAR(completion_type), CMD_LINE(REQUIRED_ARG),
+ completion_type_names, DEFAULT(0));
+
+static bool check_collation_not_null(sys_var *self, THD *thd, set_var *var)
+{
+ if (!var->value)
+ return false;
+
+ char buff[STRING_BUFFER_USUAL_SIZE];
+ if (var->value->result_type() == STRING_RESULT)
+ {
+ String str(buff, sizeof(buff), system_charset_info), *res;
+ if (!(res= var->value->val_str(&str)))
+ var->save_result.ptr= NULL;
+ else if (!(var->save_result.ptr= get_charset_by_name(res->c_ptr(), MYF(0))))
+ {
+ ErrConvString err(res);
+ my_error(ER_UNKNOWN_COLLATION, MYF(0), err.ptr());
+ return true;
+ }
+ }
+ else // INT_RESULT
+ {
+ int csno= (int)var->value->val_int();
+ if (!(var->save_result.ptr= get_charset(csno, MYF(0))))
+ {
+ my_error(ER_UNKNOWN_COLLATION, MYF(0), llstr(csno, buff));
+ return true;
+ }
+ }
+ return check_not_null(self, thd, var);
+}
+static Sys_var_struct Sys_collation_connection(
+ "collation_connection", "The collation of the connection "
+ "character set",
+ SESSION_VAR(collation_connection), NO_CMD_LINE,
+ offsetof(CHARSET_INFO, name), DEFAULT(&default_charset_info),
+ NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(check_collation_not_null),
+ ON_UPDATE(fix_thd_charset));
+
+static bool check_collation_db(sys_var *self, THD *thd, set_var *var)
+{
+ if (check_collation_not_null(self, thd, var))
+ return true;
+ if (!var->value) // = DEFAULT
+ var->save_result.ptr= thd->db_charset;
+ return false;
+}
+static Sys_var_struct Sys_collation_database(
+ "collation_database", "The collation of the database "
+ "character set",
+ SESSION_VAR(collation_database), NO_CMD_LINE,
+ offsetof(CHARSET_INFO, name), DEFAULT(&default_charset_info),
+ NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(check_collation_db));
+
+static Sys_var_struct Sys_collation_server(
+ "collation_server", "The server default collation",
+ SESSION_VAR(collation_server), NO_CMD_LINE,
+ offsetof(CHARSET_INFO, name), DEFAULT(&default_charset_info),
+ NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(check_collation_not_null));
+
+static const char *concurrent_insert_names[]= {"NEVER", "AUTO", "ALWAYS", 0};
+static Sys_var_enum Sys_concurrent_insert(
+ "concurrent_insert", "Use concurrent insert with MyISAM. Possible "
+ "values are NEVER, AUTO, ALWAYS",
+ GLOBAL_VAR(myisam_concurrent_insert), CMD_LINE(OPT_ARG),
+ concurrent_insert_names, DEFAULT(1));
+
+static Sys_var_ulong Sys_connect_timeout(
+ "connect_timeout",
+ "The number of seconds the mysqld server is waiting for a connect "
+ "packet before responding with 'Bad handshake'",
+ GLOBAL_VAR(connect_timeout), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(2, LONG_TIMEOUT), DEFAULT(CONNECT_TIMEOUT), BLOCK_SIZE(1));
+
+static Sys_var_charptr Sys_datadir(
+ "datadir", "Path to the database root directory",
+ READ_ONLY GLOBAL_VAR(mysql_real_data_home_ptr),
+ CMD_LINE(REQUIRED_ARG, 'h'), IN_FS_CHARSET, DEFAULT(0));
+
+#ifndef DBUG_OFF
+static Sys_var_dbug Sys_dbug(
+ "debug", "Debug log", sys_var::SESSION,
+ CMD_LINE(OPT_ARG, '#'), DEFAULT(""), NO_MUTEX_GUARD, NOT_IN_BINLOG,
+ ON_CHECK(check_has_super));
+#endif
+
+/**
+ @todo
+ When updating myisam_delay_key_write, we should do a 'flush tables'
+ of all MyISAM tables to ensure that they are reopen with the
+ new attribute.
+*/
+export bool fix_delay_key_write(sys_var *self, THD *thd, enum_var_type type)
+{
+ switch (delay_key_write_options) {
+ case DELAY_KEY_WRITE_NONE:
+ myisam_delay_key_write=0;
+ break;
+ case DELAY_KEY_WRITE_ON:
+ myisam_delay_key_write=1;
+ break;
+ case DELAY_KEY_WRITE_ALL:
+ myisam_delay_key_write=1;
+ ha_open_options|= HA_OPEN_DELAY_KEY_WRITE;
+ break;
+ }
+ return false;
+}
+static const char *delay_key_write_names[]= { "OFF", "ON", "ALL", NullS };
+static Sys_var_enum Sys_delay_key_write(
+ "delay_key_write", "Type of DELAY_KEY_WRITE",
+ GLOBAL_VAR(delay_key_write_options), CMD_LINE(OPT_ARG),
+ delay_key_write_names, DEFAULT(DELAY_KEY_WRITE_ON),
+ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+ ON_UPDATE(fix_delay_key_write));
+
+static Sys_var_ulong Sys_delayed_insert_limit(
+ "delayed_insert_limit",
+ "After inserting delayed_insert_limit rows, the INSERT DELAYED "
+ "handler will check if there are any SELECT statements pending. "
+ "If so, it allows these to execute before continuing",
+ GLOBAL_VAR(delayed_insert_limit), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(1, ULONG_MAX), DEFAULT(DELAYED_LIMIT), BLOCK_SIZE(1));
+
+static Sys_var_ulong Sys_delayed_insert_timeout(
+ "delayed_insert_timeout",
+ "How long a INSERT DELAYED thread should wait for INSERT statements "
+ "before terminating",
+ GLOBAL_VAR(delayed_insert_timeout), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(1, LONG_TIMEOUT), DEFAULT(DELAYED_WAIT_TIMEOUT),
+ BLOCK_SIZE(1));
+
+static Sys_var_ulong Sys_delayed_queue_size(
+ "delayed_queue_size",
+ "What size queue (in rows) should be allocated for handling INSERT "
+ "DELAYED. If the queue becomes full, any client that does INSERT "
+ "DELAYED will wait until there is room in the queue again",
+ GLOBAL_VAR(delayed_queue_size), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(1, ULONG_MAX), DEFAULT(DELAYED_QUEUE_SIZE), BLOCK_SIZE(1));
+
+#ifdef HAVE_EVENT_SCHEDULER
+static const char *event_scheduler_names[]= { "OFF", "ON", "DISABLED", NullS };
+static bool event_scheduler_check(sys_var *self, THD *thd, set_var *var)
+{
+ /* DISABLED is only accepted on the command line */
+ if (var->save_result.ulonglong_value == Events::EVENTS_DISABLED)
+ return true;
+ /*
+ If the scheduler was disabled because there are no/bad
+ system tables, produce a more meaningful error message
+ than ER_OPTION_PREVENTS_STATEMENT
+ */
+ if (Events::check_if_system_tables_error())
+ return true;
+ if (Events::opt_event_scheduler == Events::EVENTS_DISABLED)
+ {
+ my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0),
+ "--event-scheduler=DISABLED or --skip-grant-tables");
+ return true;
+ }
+ return false;
+}
+static bool event_scheduler_update(sys_var *self, THD *thd, enum_var_type type)
+{
+ pthread_mutex_unlock(&LOCK_global_system_variables);
+ /*
+ Events::start() is heavyweight. In particular it creates a new THD,
+ which takes LOCK_global_system_variables internally.
+ Thus we have to release it here.
+ We need to re-take it before returning, though.
+ And we need to take it *without* holding Events::LOCK_event_metadata.
+ */
+ bool ret= Events::opt_event_scheduler == Events::EVENTS_ON
+ ? Events::start()
+ : Events::stop();
+ pthread_mutex_unlock(&Events::LOCK_event_metadata);
+ pthread_mutex_lock(&LOCK_global_system_variables);
+ pthread_mutex_lock(&Events::LOCK_event_metadata);
+ if (ret)
+ my_error(ER_EVENT_SET_VAR_ERROR, MYF(0));
+ return ret;
+}
+static PolyLock_mutex PLock_event_metadata(&Events::LOCK_event_metadata);
+static Sys_var_enum Sys_event_scheduler(
+ "event_scheduler", "Enable the event scheduler. Possible values are "
+ "ON, OFF, and DISABLED (keep the event scheduler completely "
+ "deactivated, it cannot be activated run-time)",
+ GLOBAL_VAR(Events::opt_event_scheduler), CMD_LINE(OPT_ARG),
+ event_scheduler_names, DEFAULT(Events::EVENTS_OFF),
+ &PLock_event_metadata, NOT_IN_BINLOG,
+ ON_CHECK(event_scheduler_check), ON_UPDATE(event_scheduler_update));
+#endif
+
+static Sys_var_ulong Sys_expire_logs_days(
+ "expire_logs_days",
+ "If non-zero, binary logs will be purged after expire_logs_days "
+ "days; possible purges happen at startup and at binary log rotation",
+ GLOBAL_VAR(expire_logs_days),
+ CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 99), DEFAULT(0), BLOCK_SIZE(1));
+
+static Sys_var_mybool Sys_flush(
+ "flush", "Flush MyISAM tables to disk between SQL commands",
+ GLOBAL_VAR(myisam_flush),
+ CMD_LINE(OPT_ARG), DEFAULT(FALSE));
+
+static Sys_var_ulong Sys_flush_time(
+ "flush_time",
+ "A dedicated thread is created to flush all tables at the "
+ "given interval",
+ GLOBAL_VAR(flush_time),
+ CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, LONG_TIMEOUT),
+ DEFAULT(FLUSH_TIME), BLOCK_SIZE(1));
+
+static bool check_ftb_syntax(sys_var *self, THD *thd, set_var *var)
+{
+ return ft_boolean_check_syntax_string((uchar*)
+ (var->save_result.string_value.str));
+}
+static bool query_cache_flush(sys_var *self, THD *thd, enum_var_type type)
+{
+#ifdef HAVE_QUERY_CACHE
+ query_cache.flush();
+#endif /* HAVE_QUERY_CACHE */
+ return false;
+}
+/// @todo make SESSION_VAR (usability enhancement and a fix for a race condition)
+static Sys_var_charptr Sys_ft_boolean_syntax(
+ "ft_boolean_syntax", "List of operators for "
+ "MATCH ... AGAINST ( ... IN BOOLEAN MODE)",
+ GLOBAL_VAR(ft_boolean_syntax),
+ CMD_LINE(REQUIRED_ARG), IN_SYSTEM_CHARSET,
+ DEFAULT(DEFAULT_FTB_SYNTAX), NO_MUTEX_GUARD,
+ NOT_IN_BINLOG, ON_CHECK(check_ftb_syntax), ON_UPDATE(query_cache_flush));
+
+static Sys_var_ulong Sys_ft_max_word_len(
+ "ft_max_word_len",
+ "The maximum length of the word to be included in a FULLTEXT index. "
+ "Note: FULLTEXT indexes must be rebuilt after changing this variable",
+ READ_ONLY GLOBAL_VAR(ft_max_word_len), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(10, HA_FT_MAXCHARLEN), DEFAULT(HA_FT_MAXCHARLEN),
+ BLOCK_SIZE(1));
+
+static Sys_var_ulong Sys_ft_min_word_len(
+ "ft_min_word_len",
+ "The minimum length of the word to be included in a FULLTEXT index. "
+ "Note: FULLTEXT indexes must be rebuilt after changing this variable",
+ READ_ONLY GLOBAL_VAR(ft_min_word_len), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(1, HA_FT_MAXCHARLEN), DEFAULT(4), BLOCK_SIZE(1));
+
+/// @todo make it an updatable SESSION_VAR
+static Sys_var_ulong Sys_ft_query_expansion_limit(
+ "ft_query_expansion_limit",
+ "Number of best matches to use for query expansion",
+ READ_ONLY GLOBAL_VAR(ft_query_expansion_limit),
+ CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(0, 1000), DEFAULT(20), BLOCK_SIZE(1));
+
+static Sys_var_charptr Sys_ft_stopword_file(
+ "ft_stopword_file",
+ "Use stopwords from this file instead of built-in list",
+ READ_ONLY GLOBAL_VAR(ft_stopword_file), CMD_LINE(REQUIRED_ARG),
+ IN_FS_CHARSET, DEFAULT(0));
+
+static Sys_var_mybool Sys_ignore_builtin_innodb(
+ "ignore_builtin_innodb",
+ "Disable initialization of builtin InnoDB plugin",
+ READ_ONLY GLOBAL_VAR(opt_ignore_builtin_innodb),
+ CMD_LINE(OPT_ARG), DEFAULT(FALSE));
+
+static bool check_init_string(sys_var *self, THD *thd, set_var *var)
+{
+ if (var->save_result.string_value.str == 0)
+ {
+ var->save_result.string_value.str= const_cast<char*>("");
+ var->save_result.string_value.length= 0;
+ }
+ return false;
+}
+static PolyLock_rwlock PLock_sys_init_connect(&LOCK_sys_init_connect);
+static Sys_var_lexstring Sys_init_connect(
+ "init_connect", "Command(s) that are executed for each "
+ "new connection", GLOBAL_VAR(opt_init_connect),
+ CMD_LINE(REQUIRED_ARG), IN_SYSTEM_CHARSET,
+ DEFAULT(""), &PLock_sys_init_connect, NOT_IN_BINLOG,
+ ON_CHECK(check_init_string));
+
+static Sys_var_charptr Sys_init_file(
+ "init_file", "Read SQL commands from this file at startup",
+ READ_ONLY GLOBAL_VAR(opt_init_file),
+ IF_DISABLE_GRANT_OPTIONS(NO_CMD_LINE, CMD_LINE(REQUIRED_ARG)),
+ IN_FS_CHARSET, DEFAULT(0));
+
+static PolyLock_rwlock PLock_sys_init_slave(&LOCK_sys_init_slave);
+static Sys_var_lexstring Sys_init_slave(
+ "init_slave", "Command(s) that are executed by a slave server "
+ "each time the SQL thread starts", GLOBAL_VAR(opt_init_slave),
+ CMD_LINE(REQUIRED_ARG), IN_SYSTEM_CHARSET,
+ DEFAULT(""), &PLock_sys_init_slave,
+ NOT_IN_BINLOG, ON_CHECK(check_init_string));
+
+static Sys_var_ulong Sys_interactive_timeout(
+ "interactive_timeout",
+ "The number of seconds the server waits for activity on an interactive "
+ "connection before closing it",
+ SESSION_VAR(net_interactive_timeout),
+ CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(1, LONG_TIMEOUT), DEFAULT(NET_WAIT_TIMEOUT), BLOCK_SIZE(1));
+
+static Sys_var_ulong Sys_join_buffer_size(
+ "join_buffer_size",
+ "The size of the buffer that is used for full joins",
+ SESSION_VAR(join_buff_size), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(128, ULONG_MAX), DEFAULT(128*1024), BLOCK_SIZE(128));
+
+static Sys_var_keycache Sys_key_buffer_size(
+ "key_buffer_size", "The size of the buffer used for "
+ "index blocks for MyISAM tables. Increase this to get better index "
+ "handling (for all reads and multiple writes) to as much as you can "
+ "afford",
+ KEYCACHE_VAR(param_buff_size),
+ CMD_LINE(REQUIRED_ARG, OPT_KEY_BUFFER_SIZE),
+ VALID_RANGE(0, SIZE_T_MAX), DEFAULT(KEY_CACHE_SIZE),
+ BLOCK_SIZE(IO_SIZE), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+ ON_UPDATE(update_buffer_size));
+
+static Sys_var_keycache Sys_key_cache_block_size(
+ "key_cache_block_size", "The default size of key cache blocks",
+ KEYCACHE_VAR(param_block_size),
+ CMD_LINE(REQUIRED_ARG, OPT_KEY_CACHE_BLOCK_SIZE),
+ VALID_RANGE(512, 1024*16), DEFAULT(KEY_CACHE_BLOCK_SIZE),
+ BLOCK_SIZE(512), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+ ON_UPDATE(update_keycache_param));
+
+static Sys_var_keycache Sys_key_cache_division_limit(
+ "key_cache_division_limit",
+ "The minimum percentage of warm blocks in key cache",
+ KEYCACHE_VAR(param_division_limit),
+ CMD_LINE(REQUIRED_ARG, OPT_KEY_CACHE_DIVISION_LIMIT),
+ VALID_RANGE(1, 100), DEFAULT(100),
+ BLOCK_SIZE(1), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+ ON_UPDATE(update_keycache_param));
+
+static Sys_var_keycache Sys_key_cache_age_threshold(
+ "key_cache_age_threshold", "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",
+ KEYCACHE_VAR(param_age_threshold),
+ CMD_LINE(REQUIRED_ARG, OPT_KEY_CACHE_AGE_THRESHOLD),
+ VALID_RANGE(100, ULONG_MAX), DEFAULT(300),
+ BLOCK_SIZE(100), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+ ON_UPDATE(update_keycache_param));
+
+static Sys_var_mybool Sys_large_files_support(
+ "large_files_support",
+ "Whether mysqld was compiled with options for large file support",
+ READ_ONLY GLOBAL_VAR(opt_large_files),
+ NO_CMD_LINE, DEFAULT(sizeof(my_off_t) > 4));
+
+static Sys_var_uint Sys_large_page_size(
+ "large_page_size",
+ "If large page support is enabled, this shows the size of memory pages",
+ READ_ONLY GLOBAL_VAR(opt_large_page_size), NO_CMD_LINE,
+ VALID_RANGE(0, UINT_MAX), DEFAULT(0), BLOCK_SIZE(1));
+
+static Sys_var_mybool Sys_large_pages(
+ "large_pages", "Enable support for large pages",
+ READ_ONLY GLOBAL_VAR(opt_large_files),
+ IF_WIN(NO_CMD_LINE, CMD_LINE(OPT_ARG)), DEFAULT(FALSE));
+
+static Sys_var_charptr Sys_language(
+ "lc_messages_dir", "Directory where error messages are",
+ READ_ONLY GLOBAL_VAR(lc_messages_dir_ptr), CMD_LINE(REQUIRED_ARG, 'L'),
+ IN_FS_CHARSET, DEFAULT(0));
+
+static Sys_var_mybool Sys_local_infile(
+ "local_infile", "Enable LOAD DATA LOCAL INFILE",
+ GLOBAL_VAR(opt_local_infile), CMD_LINE(OPT_ARG), DEFAULT(TRUE));
+
+#ifdef HAVE_MLOCKALL
+static Sys_var_mybool Sys_locked_in_memory(
+ "locked_in_memory",
+ "Whether mysqld was locked in memory with --memlock",
+ READ_ONLY GLOBAL_VAR(locked_in_memory), NO_CMD_LINE, DEFAULT(FALSE));
+#endif
+
+/* this says NO_CMD_LINE, as command-line option takes a string, not a bool */
+static Sys_var_mybool Sys_log_bin(
+ "log_bin", "Whether the binary log is enabled",
+ READ_ONLY GLOBAL_VAR(opt_bin_log), NO_CMD_LINE, DEFAULT(FALSE));
+
+static Sys_var_mybool Sys_trust_function_creators(
+ "log_bin_trust_function_creators",
+ "If set to FALSE (the default), then when --log-bin is used, creation "
+ "of a stored function (or trigger) is allowed only to users having the "
+ "SUPER privilege and only if this stored function (trigger) may not "
+ "break binary logging. Note that if ALL connections to this server "
+ "ALWAYS use row-based binary logging, the security issues do not "
+ "exist and the binary logging cannot break, so you can safely set "
+ "this to TRUE",
+ GLOBAL_VAR(trust_function_creators),
+ CMD_LINE(OPT_ARG), DEFAULT(FALSE));
+
+static Sys_var_charptr Sys_log_error(
+ "log_error", "Error log file",
+ READ_ONLY GLOBAL_VAR(log_error_file_ptr), CMD_LINE(OPT_ARG),
+ IN_FS_CHARSET, DEFAULT(disabled_my_option));
+
+static Sys_var_mybool Sys_log_queries_not_using_indexes(
+ "log_queries_not_using_indexes",
+ "Log queries that are executed without benefit of any index to the "
+ "slow log if it is open",
+ GLOBAL_VAR(opt_log_queries_not_using_indexes),
+ CMD_LINE(OPT_ARG), DEFAULT(FALSE));
+
+static Sys_var_ulong Sys_log_warnings(
+ "log_warnings",
+ "Log some not critical warnings to the log file",
+ SESSION_VAR(log_warnings),
+ CMD_LINE(OPT_ARG, 'W'),
+ VALID_RANGE(0, ULONG_MAX), DEFAULT(1), BLOCK_SIZE(1));
+
+static bool update_cached_long_query_time(sys_var *self, THD *thd,
+ enum_var_type type)
+{
+ if (type == OPT_SESSION)
+ thd->variables.long_query_time=
+ thd->variables.long_query_time_double * 1e6;
+ else
+ global_system_variables.long_query_time=
+ global_system_variables.long_query_time_double * 1e6;
+ return false;
+}
+
+static Sys_var_double Sys_long_query_time(
+ "long_query_time",
+ "Log all queries that have taken more than long_query_time seconds "
+ "to execute to file. The argument will be treated as a decimal value "
+ "with microsecond precision",
+ SESSION_VAR(long_query_time_double),
+ CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, LONG_TIMEOUT), DEFAULT(10),
+ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+ ON_UPDATE(update_cached_long_query_time));
+
+static bool fix_low_prio_updates(sys_var *self, THD *thd, enum_var_type type)
+{
+ if (type == OPT_SESSION)
+ thd->update_lock_default= (thd->variables.low_priority_updates ?
+ TL_WRITE_LOW_PRIORITY : TL_WRITE);
+ else
+ thr_upgraded_concurrent_insert_lock=
+ (global_system_variables.low_priority_updates ?
+ TL_WRITE_LOW_PRIORITY : TL_WRITE);
+ return false;
+}
+static Sys_var_mybool Sys_low_priority_updates(
+ "low_priority_updates",
+ "INSERT/DELETE/UPDATE has lower priority than selects",
+ SESSION_VAR(low_priority_updates),
+ CMD_LINE(OPT_ARG),
+ DEFAULT(FALSE), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+ ON_UPDATE(fix_low_prio_updates));
+
+#ifndef TO_BE_DELETED /* Alias for the low_priority_updates */
+static Sys_var_mybool Sys_sql_low_priority_updates(
+ "sql_low_priority_updates",
+ "INSERT/DELETE/UPDATE has lower priority than selects",
+ SESSION_VAR(low_priority_updates), NO_CMD_LINE,
+ DEFAULT(FALSE), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+ ON_UPDATE(fix_low_prio_updates));
+#endif
+
+static Sys_var_mybool Sys_lower_case_file_system(
+ "lower_case_file_system",
+ "Case sensitivity of file names on the file system where the "
+ "data directory is located",
+ READ_ONLY GLOBAL_VAR(lower_case_file_system), NO_CMD_LINE,
+ DEFAULT(FALSE));
+
+static Sys_var_uint Sys_lower_case_table_names(
+ "lower_case_table_names",
+ "If set to 1 table names are stored in lowercase on disk and table "
+ "names will be case-insensitive. Should be set to 2 if you are using "
+ "a case insensitive file system",
+ READ_ONLY GLOBAL_VAR(lower_case_table_names),
+ CMD_LINE(OPT_ARG, OPT_LOWER_CASE_TABLE_NAMES),
+ VALID_RANGE(0, 2),
+#ifdef FN_NO_CASE_SENSE
+ DEFAULT(1),
+#else
+ DEFAULT(0),
+#endif
+ BLOCK_SIZE(1));
+
+static bool session_readonly(sys_var *self, THD *thd, set_var *var)
+{
+ if (var->type == OPT_GLOBAL)
+ return false;
+ my_error(ER_VARIABLE_IS_READONLY, MYF(0), "SESSION",
+ self->name.str, "GLOBAL");
+ return true;
+}
+static Sys_var_ulong Sys_max_allowed_packet(
+ "max_allowed_packet",
+ "Max packet length to send to or receive from the server",
+ SESSION_VAR(max_allowed_packet), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(1024, 1024*1024*1024), DEFAULT(1024*1024),
+ BLOCK_SIZE(1024), NO_MUTEX_GUARD, NOT_IN_BINLOG,
+ ON_CHECK(session_readonly));
+
+static Sys_var_ulonglong Sys_max_binlog_cache_size(
+ "max_binlog_cache_size",
+ "Can be used to restrict the total size used to cache a "
+ "multi-transaction query",
+ GLOBAL_VAR(max_binlog_cache_size), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(IO_SIZE, ULONGLONG_MAX),
+ DEFAULT((ULONGLONG_MAX/IO_SIZE)*IO_SIZE),
+ BLOCK_SIZE(IO_SIZE));
+
+static bool fix_max_binlog_size(sys_var *self, THD *thd, enum_var_type type)
+{
+ mysql_bin_log.set_max_size(max_binlog_size);
+#ifdef HAVE_REPLICATION
+ if (!max_relay_log_size)
+ active_mi->rli.relay_log.set_max_size(max_binlog_size);
+#endif
+ return false;
+}
+static Sys_var_ulong Sys_max_binlog_size(
+ "max_binlog_size",
+ "Binary log will be rotated automatically when the size exceeds this "
+ "value. Will also apply to relay logs if max_relay_log_size is 0",
+ GLOBAL_VAR(max_binlog_size), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(IO_SIZE, 1024*1024L*1024L), DEFAULT(1024*1024L*1024L),
+ BLOCK_SIZE(IO_SIZE), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+ ON_UPDATE(fix_max_binlog_size));
+
+static bool fix_max_connections(sys_var *self, THD *thd, enum_var_type type)
+{
+#ifndef EMBEDDED_LIBRARY
+ resize_thr_alarm(max_connections +
+ global_system_variables.max_insert_delayed_threads + 10);
+#endif
+ return false;
+}
+
+// Default max_connections of 151 is larger than Apache's default max
+// children, to avoid "too many connections" error in a common setup
+static Sys_var_ulong Sys_max_connections(
+ "max_connections", "The number of simultaneous clients allowed",
+ GLOBAL_VAR(max_connections), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(1, 100000), DEFAULT(151), BLOCK_SIZE(1), NO_MUTEX_GUARD,
+ NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(fix_max_connections));
+
+static Sys_var_ulong Sys_max_connect_errors(
+ "max_connect_errors",
+ "If there is more than this number of interrupted connections from "
+ "a host this host will be blocked from further connections",
+ GLOBAL_VAR(max_connect_errors), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(1, ULONG_MAX), DEFAULT(MAX_CONNECT_ERRORS),
+ BLOCK_SIZE(1));
+
+static bool check_max_delayed_threads(sys_var *self, THD *thd, set_var *var)
+{
+ return var->type != OPT_GLOBAL &&
+ var->save_result.ulonglong_value != 0 &&
+ var->save_result.ulonglong_value !=
+ global_system_variables.max_insert_delayed_threads;
+}
+
+// Alias for max_delayed_threads
+static Sys_var_ulong Sys_max_insert_delayed_threads(
+ "max_insert_delayed_threads",
+ "Don't start more than this number of threads to handle INSERT "
+ "DELAYED statements. If set to zero INSERT DELAYED will be not used",
+ SESSION_VAR(max_insert_delayed_threads),
+ NO_CMD_LINE, VALID_RANGE(0, 16384), DEFAULT(20),
+ BLOCK_SIZE(1), NO_MUTEX_GUARD, NOT_IN_BINLOG,
+ ON_CHECK(check_max_delayed_threads), ON_UPDATE(fix_max_connections));
+
+static Sys_var_ulong Sys_max_delayed_threads(
+ "max_delayed_threads",
+ "Don't start more than this number of threads to handle INSERT "
+ "DELAYED statements. If set to zero INSERT DELAYED will be not used",
+ SESSION_VAR(max_insert_delayed_threads),
+ CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 16384), DEFAULT(20),
+ BLOCK_SIZE(1), NO_MUTEX_GUARD, NOT_IN_BINLOG,
+ ON_CHECK(check_max_delayed_threads), ON_UPDATE(fix_max_connections));
+
+static Sys_var_ulong Sys_max_error_count(
+ "max_error_count",
+ "Max number of errors/warnings to store for a statement",
+ SESSION_VAR(max_error_count), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(0, 65535), DEFAULT(DEFAULT_ERROR_COUNT), BLOCK_SIZE(1));
+
+static Sys_var_ulonglong Sys_max_heap_table_size(
+ "max_heap_table_size",
+ "Don't allow creation of heap tables bigger than this",
+ SESSION_VAR(max_heap_table_size), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(16384, (ulonglong)~(intptr)0), DEFAULT(16*1024*1024),
+ BLOCK_SIZE(1024));
+
+static Sys_var_ulong Sys_pseudo_thread_id(
+ "pseudo_thread_id",
+ "This variable is for internal server use",
+ SESSION_ONLY(pseudo_thread_id),
+ NO_CMD_LINE, VALID_RANGE(0, ULONG_MAX), DEFAULT(0),
+ BLOCK_SIZE(1), NO_MUTEX_GUARD, IN_BINLOG,
+ ON_CHECK(check_has_super));
+
+static bool fix_max_join_size(sys_var *self, THD *thd, enum_var_type type)
+{
+ SV *sv= type == OPT_GLOBAL ? &global_system_variables : &thd->variables;
+ if (sv->max_join_size == HA_POS_ERROR)
+ sv->option_bits|= OPTION_BIG_SELECTS;
+ else
+ sv->option_bits&= ~OPTION_BIG_SELECTS;
+ return false;
+}
+static Sys_var_harows Sys_max_join_size(
+ "max_join_size",
+ "Joins that are probably going to read more than max_join_size "
+ "records return an error",
+ SESSION_VAR(max_join_size), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(1, HA_POS_ERROR), DEFAULT(HA_POS_ERROR), BLOCK_SIZE(1),
+ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+ ON_UPDATE(fix_max_join_size));
+
+static Sys_var_ulong Sys_max_seeks_for_key(
+ "max_seeks_for_key",
+ "Limit assumed max number of seeks when looking up rows based on a key",
+ SESSION_VAR(max_seeks_for_key), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(1, ULONG_MAX), DEFAULT(ULONG_MAX), BLOCK_SIZE(1));
+
+static Sys_var_ulong Sys_max_length_for_sort_data(
+ "max_length_for_sort_data",
+ "Max number of bytes in sorted records",
+ SESSION_VAR(max_length_for_sort_data), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(4, 8192*1024L), DEFAULT(1024), BLOCK_SIZE(1));
+
+static Sys_var_harows Sys_sql_max_join_size(
+ "sql_max_join_size", "Alias for max_join_size",
+ SESSION_VAR(max_join_size), NO_CMD_LINE,
+ VALID_RANGE(1, HA_POS_ERROR), DEFAULT(HA_POS_ERROR), BLOCK_SIZE(1),
+ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+ ON_UPDATE(fix_max_join_size), DEPRECATED(70000, 0));
+
+static PolyLock_mutex PLock_prepared_stmt_count(&LOCK_prepared_stmt_count);
+static Sys_var_ulong Sys_max_prepared_stmt_count(
+ "max_prepared_stmt_count",
+ "Maximum number of prepared statements in the server",
+ GLOBAL_VAR(max_prepared_stmt_count), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(0, 1024*1024), DEFAULT(16382), BLOCK_SIZE(1),
+ &PLock_prepared_stmt_count);
+
+static bool fix_max_relay_log_size(sys_var *self, THD *thd, enum_var_type type)
+{
+#ifdef HAVE_REPLICATION
+ active_mi->rli.relay_log.set_max_size(max_relay_log_size ?
+ max_relay_log_size: max_binlog_size);
+#endif
+ return false;
+}
+static Sys_var_ulong Sys_max_relay_log_size(
+ "max_relay_log_size",
+ "If non-zero: relay log will be rotated automatically when the "
+ "size exceeds this value; if zero: when the size "
+ "exceeds max_binlog_size",
+ GLOBAL_VAR(max_relay_log_size), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(0, 1024L*1024*1024), DEFAULT(0), BLOCK_SIZE(IO_SIZE),
+ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+ ON_UPDATE(fix_max_relay_log_size));
+
+static Sys_var_ulong Sys_max_sort_length(
+ "max_sort_length",
+ "The number of bytes to use when sorting BLOB or TEXT values (only "
+ "the first max_sort_length bytes of each value are used; the rest "
+ "are ignored)",
+ SESSION_VAR(max_sort_length), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(4, 8192*1024L), DEFAULT(1024), BLOCK_SIZE(1));
+
+static Sys_var_ulong Sys_max_sp_recursion_depth(
+ "max_sp_recursion_depth",
+ "Maximum stored procedure recursion depth",
+ SESSION_VAR(max_sp_recursion_depth), CMD_LINE(OPT_ARG),
+ VALID_RANGE(0, 255), DEFAULT(0), BLOCK_SIZE(1));
+
+// non-standard session_value_ptr() here
+static Sys_var_max_user_conn Sys_max_user_connections(
+ "max_user_connections",
+ "The maximum number of active connections for a single user "
+ "(0 = no limit)",
+ SESSION_VAR(max_user_connections), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(0, UINT_MAX), DEFAULT(0), BLOCK_SIZE(1), NO_MUTEX_GUARD,
+ NOT_IN_BINLOG, ON_CHECK(session_readonly));
+
+static Sys_var_ulong Sys_max_tmp_tables(
+ "max_tmp_tables",
+ "Maximum number of temporary tables a client can keep open at a time",
+ SESSION_VAR(max_tmp_tables), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(1, ULONG_MAX), DEFAULT(32), BLOCK_SIZE(1));
+
+static Sys_var_ulong Sys_max_write_lock_count(
+ "max_write_lock_count",
+ "After this many write locks, allow some read locks to run in between",
+ GLOBAL_VAR(max_write_lock_count), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(1, ULONG_MAX), DEFAULT(ULONG_MAX), BLOCK_SIZE(1));
+
+static Sys_var_ulong Sys_min_examined_row_limit(
+ "min_examined_row_limit",
+ "Don't write queries to slow log that examine fewer rows "
+ "than that",
+ SESSION_VAR(min_examined_row_limit), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(0, ULONG_MAX), DEFAULT(0), BLOCK_SIZE(1));
+
+#ifdef _WIN32
+static Sys_var_mybool Sys_named_pipe(
+ "named_pipe", "Enable the named pipe (NT)",
+ READ_ONLY GLOBAL_VAR(opt_enable_named_pipe), CMD_LINE(OPT_ARG),
+ DEFAULT(FALSE));
+#endif
+
+static Sys_var_ulong Sys_net_buffer_length(
+ "net_buffer_length",
+ "Buffer length for TCP/IP and socket communication",
+ SESSION_VAR(net_buffer_length), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(1024, 1024*1024), DEFAULT(16384), BLOCK_SIZE(1024),
+ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(session_readonly));
+
+static bool fix_net_read_timeout(sys_var *self, THD *thd, enum_var_type type)
+{
+ if (type != OPT_GLOBAL)
+ my_net_set_read_timeout(&thd->net, thd->variables.net_read_timeout);
+ return false;
+}
+static Sys_var_ulong Sys_net_read_timeout(
+ "net_read_timeout",
+ "Number of seconds to wait for more data from a connection before "
+ "aborting the read",
+ SESSION_VAR(net_read_timeout), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(1, LONG_TIMEOUT), DEFAULT(NET_READ_TIMEOUT), BLOCK_SIZE(1),
+ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+ ON_UPDATE(fix_net_read_timeout));
+
+static bool fix_net_write_timeout(sys_var *self, THD *thd, enum_var_type type)
+{
+ if (type != OPT_GLOBAL)
+ my_net_set_write_timeout(&thd->net, thd->variables.net_write_timeout);
+ return false;
+}
+static Sys_var_ulong Sys_net_write_timeout(
+ "net_write_timeout",
+ "Number of seconds to wait for a block to be written to a connection "
+ "before aborting the write",
+ SESSION_VAR(net_write_timeout), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(1, LONG_TIMEOUT), DEFAULT(NET_WRITE_TIMEOUT), BLOCK_SIZE(1),
+ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+ ON_UPDATE(fix_net_write_timeout));
+
+static bool fix_net_retry_count(sys_var *self, THD *thd, enum_var_type type)
+{
+ if (type != OPT_GLOBAL)
+ thd->net.retry_count=thd->variables.net_retry_count;
+ return false;
+}
+static Sys_var_ulong Sys_net_retry_count(
+ "net_retry_count",
+ "If a read on a communication port is interrupted, retry this "
+ "many times before giving up",
+ SESSION_VAR(net_retry_count), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(1, ULONG_MAX), DEFAULT(MYSQLD_NET_RETRY_COUNT),
+ BLOCK_SIZE(1), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+ ON_UPDATE(fix_net_retry_count));
+
+static Sys_var_mybool Sys_new_mode(
+ "new", "Use very new possible \"unsafe\" functions",
+ SESSION_VAR(new_mode), CMD_LINE(OPT_ARG, 'n'), DEFAULT(FALSE));
+
+static Sys_var_mybool Sys_old_mode(
+ "old", "Use compatible behavior",
+ READ_ONLY GLOBAL_VAR(old_mode), CMD_LINE(OPT_ARG), DEFAULT(FALSE));
+
+static Sys_var_mybool Sys_old_alter_table(
+ "old_alter_table", "Use old, non-optimized alter table",
+ SESSION_VAR(old_alter_table), CMD_LINE(OPT_ARG), DEFAULT(FALSE));
+
+static bool check_old_passwords(sys_var *self, THD *thd, set_var *var)
+{
+ return mysql_user_table_is_in_short_password_format;
+}
+static Sys_var_mybool Sys_old_passwords(
+ "old_passwords",
+ "Use old password encryption method (needed for 4.0 and older clients)",
+ SESSION_VAR(old_passwords), CMD_LINE(OPT_ARG), DEFAULT(FALSE),
+ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_old_passwords));
+
+static Sys_var_ulong Sys_open_files_limit(
+ "open_files_limit",
+ "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 file descriptors",
+ READ_ONLY GLOBAL_VAR(open_files_limit), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(0, OS_FILE_LIMIT), DEFAULT(0), BLOCK_SIZE(1));
+
+/// @todo change to enum
+static Sys_var_ulong Sys_optimizer_prune_level(
+ "optimizer_prune_level",
+ "Controls the heuristic(s) applied during query optimization to prune "
+ "less-promising partial plans from the optimizer search space. "
+ "Meaning: 0 - do not apply any heuristic, thus perform exhaustive "
+ "search; 1 - prune plans based on number of retrieved rows",
+ SESSION_VAR(optimizer_prune_level), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(0, 1), DEFAULT(1), BLOCK_SIZE(1));
+
+static Sys_var_ulong Sys_optimizer_search_depth(
+ "optimizer_search_depth",
+ "Maximum depth of search performed by the query optimizer. Values "
+ "larger than the number of relations in a query result in better "
+ "query plans, but take longer to compile a query. Values smaller "
+ "than the number of tables in a relation result in faster "
+ "optimization, but may produce very bad query plans. If set to 0, "
+ "the system will automatically pick a reasonable value; if set to "
+ "63, the optimizer will switch to the original find_best search"
+ "(used for testing/comparison)",
+ SESSION_VAR(optimizer_search_depth), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(0, MAX_TABLES+2), DEFAULT(MAX_TABLES+1), BLOCK_SIZE(1));
+
+static const char *optimizer_switch_names[]=
+{
+ "index_merge", "index_merge_union", "index_merge_sort_union",
+ "index_merge_intersection",
+ "default", NullS
+};
+static Sys_var_flagset Sys_optimizer_switch(
+ "optimizer_switch",
+ "optimizer_switch=option=val[,option=val...], where option is one of "
+ "{index_merge, index_merge_union, index_merge_sort_union, "
+ "index_merge_intersection} and val is one of {on, off, default}",
+ SESSION_VAR(optimizer_switch), CMD_LINE(REQUIRED_ARG),
+ optimizer_switch_names, DEFAULT(OPTIMIZER_SWITCH_DEFAULT));
+
+static Sys_var_charptr Sys_pid_file(
+ "pid_file", "Pid file used by safe_mysqld",
+ READ_ONLY GLOBAL_VAR(pidfile_name_ptr), CMD_LINE(REQUIRED_ARG),
+ IN_FS_CHARSET, DEFAULT(0));
+
+static Sys_var_charptr Sys_plugin_dir(
+ "plugin_dir", "Directory for plugins",
+ READ_ONLY GLOBAL_VAR(opt_plugin_dir_ptr), CMD_LINE(REQUIRED_ARG),
+ IN_FS_CHARSET, DEFAULT(0));
+
+static Sys_var_uint Sys_port(
+ "port",
+ "Port number to use for connection or 0 to default to, "
+ "my.cnf, $MYSQL_TCP_PORT, "
+#if MYSQL_PORT_DEFAULT == 0
+ "/etc/services, "
+#endif
+ "built-in default (" STRINGIFY_ARG(MYSQL_PORT) "), whatever comes first",
+ READ_ONLY GLOBAL_VAR(mysqld_port), CMD_LINE(REQUIRED_ARG, 'P'),
+ VALID_RANGE(0, UINT_MAX32), DEFAULT(0), BLOCK_SIZE(1));
+
+static Sys_var_ulong Sys_preload_buff_size(
+ "preload_buffer_size",
+ "The size of the buffer that is allocated when preloading indexes",
+ SESSION_VAR(preload_buff_size), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(1024, 1024*1024*1024), DEFAULT(32768), BLOCK_SIZE(1));
+
+static Sys_var_uint Sys_protocol_version(
+ "protocol_version",
+ "The version of the client/server protocol used by the MySQL server",
+ READ_ONLY GLOBAL_VAR(protocol_version), NO_CMD_LINE,
+ VALID_RANGE(0, ~0), DEFAULT(PROTOCOL_VERSION), BLOCK_SIZE(1));
+
+static Sys_var_ulong Sys_read_buff_size(
+ "read_buffer_size",
+ "Each thread that does a sequential scan allocates a buffer of "
+ "this size for each table it scans. If you do many sequential scans, "
+ "you may want to increase this value",
+ SESSION_VAR(read_buff_size), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(IO_SIZE*2, INT_MAX32), DEFAULT(128*1024),
+ BLOCK_SIZE(IO_SIZE));
+
+static my_bool read_only;
+static bool check_read_only(sys_var *self, THD *thd, set_var *var)
+{
+ /* Prevent self dead-lock */
+ if (thd->locked_tables || thd->active_transaction())
+ {
+ my_error(ER_LOCK_OR_ACTIVE_TRANSACTION, MYF(0));
+ return true;
+ }
+ return false;
+}
+static bool fix_read_only(sys_var *self, THD *thd, enum_var_type type)
+{
+ bool result= true;
+ my_bool new_read_only= read_only; // make a copy before releasing a mutex
+ DBUG_ENTER("sys_var_opt_readonly::update");
+
+ if (read_only == FALSE || read_only == opt_readonly)
+ {
+ opt_readonly= read_only;
+ DBUG_RETURN(false);
+ }
+
+ if (check_read_only(self, thd, 0)) // just in case
+ goto end;
+
+ if (thd->global_read_lock)
+ {
+ /*
+ This connection already holds the global read lock.
+ This can be the case with:
+ - FLUSH TABLES WITH READ LOCK
+ - SET GLOBAL READ_ONLY = 1
+ */
+ opt_readonly= read_only;
+ DBUG_RETURN(false);
+ }
+
+ /*
+ Perform a 'FLUSH TABLES WITH READ LOCK'.
+ This is a 3 step process:
+ - [1] lock_global_read_lock()
+ - [2] close_cached_tables()
+ - [3] make_global_read_lock_block_commit()
+ [1] prevents new connections from obtaining tables locked for write.
+ [2] waits until all existing connections close their tables.
+ [3] prevents transactions from being committed.
+ */
+
+ read_only= opt_readonly;
+ pthread_mutex_unlock(&LOCK_global_system_variables);
+
+ if (lock_global_read_lock(thd))
+ goto end_with_mutex_unlock;
+
+ /*
+ This call will be blocked by any connection holding a READ or WRITE lock.
+ Ideally, we want to wait only for pending WRITE locks, but since:
+ con 1> LOCK TABLE T FOR READ;
+ con 2> LOCK TABLE T FOR WRITE; (blocked by con 1)
+ con 3> SET GLOBAL READ ONLY=1; (blocked by con 2)
+ can cause to wait on a read lock, it's required for the client application
+ to unlock everything, and acceptable for the server to wait on all locks.
+ */
+ if ((result= close_cached_tables(thd, NULL, FALSE, TRUE, TRUE)))
+ goto end_with_read_lock;
+
+ if ((result= make_global_read_lock_block_commit(thd)))
+ goto end_with_read_lock;
+
+ /* Change the opt_readonly system variable, safe because the lock is held */
+ opt_readonly= new_read_only;
+ result= false;
+
+ end_with_read_lock:
+ /* Release the lock */
+ unlock_global_read_lock(thd);
+ end_with_mutex_unlock:
+ pthread_mutex_lock(&LOCK_global_system_variables);
+ end:
+ read_only= opt_readonly;
+ DBUG_RETURN(result);
+}
+static Sys_var_mybool Sys_readonly(
+ "read_only",
+ "Make all non-temporary tables read-only, with the exception for "
+ "replication (slave) threads and users with the SUPER privilege",
+ GLOBAL_VAR(read_only), CMD_LINE(OPT_ARG), DEFAULT(FALSE),
+ NO_MUTEX_GUARD, NOT_IN_BINLOG,
+ ON_CHECK(check_read_only), ON_UPDATE(fix_read_only));
+
+// Small lower limit to be able to test MRR
+static Sys_var_ulong Sys_read_rnd_buff_size(
+ "read_rnd_buffer_size",
+ "When reading rows in sorted order after a sort, the rows are read "
+ "through this buffer to avoid a disk seeks. If not set, then it's "
+ "set to the value of record_buffer",
+ SESSION_VAR(read_rnd_buff_size), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(1, INT_MAX32), DEFAULT(256*1024), BLOCK_SIZE(1));
+
+static Sys_var_ulong Sys_div_precincrement(
+ "div_precision_increment", "Precision of the result of '/' "
+ "operator will be increased on that value",
+ SESSION_VAR(div_precincrement), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(0, DECIMAL_MAX_SCALE), DEFAULT(4), BLOCK_SIZE(1));
+
+static Sys_var_ulong Sys_rpl_recovery_rank(
+ "rpl_recovery_rank", "Unused, will be removed",
+ GLOBAL_VAR(rpl_recovery_rank), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(0, ULONG_MAX), DEFAULT(0), BLOCK_SIZE(1),
+ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(0),
+ DEPRECATED(70000, 0));
+
+static Sys_var_ulong Sys_range_alloc_block_size(
+ "range_alloc_block_size",
+ "Allocation block size for storing ranges during optimization",
+ SESSION_VAR(range_alloc_block_size), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(RANGE_ALLOC_BLOCK_SIZE, ULONG_MAX),
+ DEFAULT(RANGE_ALLOC_BLOCK_SIZE), BLOCK_SIZE(1024));
+
+static Sys_var_ulong Sys_multi_range_count(
+ "multi_range_count", "Number of key ranges to request at once",
+ SESSION_VAR(multi_range_count), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(1, ULONG_MAX), DEFAULT(256), BLOCK_SIZE(1));
+
+static bool fix_thd_mem_root(sys_var *self, THD *thd, enum_var_type type)
+{
+ if (type != OPT_GLOBAL)
+ reset_root_defaults(thd->mem_root,
+ thd->variables.query_alloc_block_size,
+ thd->variables.query_prealloc_size);
+ return false;
+}
+static Sys_var_ulong Sys_query_alloc_block_size(
+ "query_alloc_block_size",
+ "Allocation block size for query parsing and execution",
+ SESSION_VAR(query_alloc_block_size), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(1024, ULONG_MAX), DEFAULT(QUERY_ALLOC_BLOCK_SIZE),
+ BLOCK_SIZE(1024), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+ ON_UPDATE(fix_thd_mem_root));
+
+static Sys_var_ulong Sys_query_prealloc_size(
+ "query_prealloc_size",
+ "Persistent buffer for query parsing and execution",
+ SESSION_VAR(query_prealloc_size), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(QUERY_ALLOC_PREALLOC_SIZE, ULONG_MAX),
+ DEFAULT(QUERY_ALLOC_PREALLOC_SIZE),
+ BLOCK_SIZE(1024), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+ ON_UPDATE(fix_thd_mem_root));
+
+#ifdef HAVE_SMEM
+static Sys_var_mybool Sys_shared_memory(
+ "shared_memory", "Enable the shared memory",
+ READ_ONLY GLOBAL_VAR(opt_enable_shared_memory), CMD_LINE(OPT_ARG),
+ DEFAULT(FALSE));
+
+static Sys_var_charptr Sys_shared_memory_base_name(
+ "shared_memory_base_name", "Base name of shared memory",
+ READ_ONLY GLOBAL_VAR(shared_memory_base_name), CMD_LINE(REQUIRED_ARG),
+ IN_FS_CHARSET, DEFAULT(0));
+#endif
+
+// this has to be NO_CMD_LINE as the command-line option has a different name
+static Sys_var_mybool Sys_skip_external_locking(
+ "skip_external_locking", "Don't use system (external) locking",
+ READ_ONLY GLOBAL_VAR(my_disable_locking), NO_CMD_LINE, DEFAULT(TRUE));
+
+static Sys_var_mybool Sys_skip_networking(
+ "skip_networking", "Don't allow connection with TCP/IP",
+ READ_ONLY GLOBAL_VAR(opt_disable_networking), CMD_LINE(OPT_ARG),
+ DEFAULT(FALSE));
+
+static Sys_var_mybool Sys_skip_show_database(
+ "skip_show_database", "Don't allow 'SHOW DATABASE' commands",
+ READ_ONLY GLOBAL_VAR(opt_skip_show_db), CMD_LINE(OPT_ARG),
+ DEFAULT(FALSE));
+
+static Sys_var_charptr Sys_socket(
+ "socket", "Socket file to use for connection",
+ READ_ONLY GLOBAL_VAR(mysqld_unix_port), CMD_LINE(REQUIRED_ARG),
+ IN_FS_CHARSET, DEFAULT(0));
+
+#ifdef HAVE_THR_SETCONCURRENCY
+static Sys_var_ulong Sys_thread_concurrency(
+ "thread_concurrency",
+ "Permits the application to give the threads system a hint for "
+ "the desired number of threads that should be run at the same time",
+ READ_ONLY GLOBAL_VAR(concurrency), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(1, 512), DEFAULT(DEFAULT_CONCURRENCY), BLOCK_SIZE(1));
+#endif
+
+static Sys_var_ulong Sys_thread_stack(
+ "thread_stack", "The stack size for each thread",
+ READ_ONLY GLOBAL_VAR(my_thread_stack_size), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(128*1024, ULONG_MAX), DEFAULT(DEFAULT_THREAD_STACK),
+ BLOCK_SIZE(1024));
+
+static Sys_var_charptr Sys_tmpdir(
+ "tmpdir", "Path for temporary files. Several paths may "
+ "be specified, separated by a "
+#if defined(__WIN__) || defined(__NETWARE__)
+ "semicolon (;)"
+#else
+ "colon (:)"
+#endif
+ ", in this case they are used in a round-robin fashion",
+ READ_ONLY GLOBAL_VAR(opt_mysql_tmpdir), CMD_LINE(REQUIRED_ARG, 't'),
+ IN_FS_CHARSET, DEFAULT(0));
+
+static bool fix_trans_mem_root(sys_var *self, THD *thd, enum_var_type type)
+{
+ if (type != OPT_GLOBAL)
+ reset_root_defaults(&thd->transaction.mem_root,
+ thd->variables.trans_alloc_block_size,
+ thd->variables.trans_prealloc_size);
+ return false;
+}
+static Sys_var_ulong Sys_trans_alloc_block_size(
+ "transaction_alloc_block_size",
+ "Allocation block size for transactions to be stored in binary log",
+ SESSION_VAR(trans_alloc_block_size), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(1024, ULONG_MAX), DEFAULT(QUERY_ALLOC_BLOCK_SIZE),
+ BLOCK_SIZE(1024), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+ ON_UPDATE(fix_trans_mem_root));
+
+static Sys_var_ulong Sys_trans_prealloc_size(
+ "transaction_prealloc_size",
+ "Persistent buffer for transactions to be stored in binary log",
+ SESSION_VAR(trans_prealloc_size), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(1024, ULONG_MAX), DEFAULT(TRANS_ALLOC_PREALLOC_SIZE),
+ BLOCK_SIZE(1024), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+ ON_UPDATE(fix_trans_mem_root));
+
+static const char *thread_handling_names[]=
+{
+ "one-thread-per-connection", "no-threads",
+#if HAVE_POOL_OF_THREADS == 1
+ "pool-of-threads",
+#endif
+ 0
+};
+static Sys_var_enum Sys_thread_handling(
+ "thread_handling",
+ "Define threads usage for handling queries, one of "
+ "one-thread-per-connection, no-threads"
+#if HAVE_POOL_OF_THREADS == 1
+ ", pool-of-threads"
+#endif
+ , READ_ONLY GLOBAL_VAR(thread_handling), CMD_LINE(REQUIRED_ARG),
+ thread_handling_names, DEFAULT(0));
+
+#ifdef HAVE_QUERY_CACHE
+static bool fix_query_cache_size(sys_var *self, THD *thd, enum_var_type type)
+{
+ ulong new_cache_size= query_cache.resize(query_cache_size);
+ /*
+ Note: query_cache_size is a global variable reflecting the
+ requested cache size. See also query_cache_size_arg
+ */
+ if (query_cache_size != new_cache_size)
+ push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_WARN_QC_RESIZE, ER(ER_WARN_QC_RESIZE),
+ query_cache_size, new_cache_size);
+
+ query_cache_size= new_cache_size;
+ return false;
+}
+static Sys_var_ulong Sys_query_cache_size(
+ "query_cache_size",
+ "The memory allocated to store results from old queries",
+ GLOBAL_VAR(query_cache_size), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(0, ULONG_MAX), DEFAULT(0), BLOCK_SIZE(1024),
+ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+ ON_UPDATE(fix_query_cache_size));
+
+static Sys_var_ulong Sys_query_cache_limit(
+ "query_cache_limit",
+ "Don't cache results that are bigger than this",
+ GLOBAL_VAR(query_cache.query_cache_limit), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(0, ULONG_MAX), DEFAULT(1024*1024), BLOCK_SIZE(1));
+
+static bool fix_qcache_min_res_unit(sys_var *self, THD *thd, enum_var_type type)
+{
+ query_cache_min_res_unit=
+ query_cache.set_min_res_unit(query_cache_min_res_unit);
+ return false;
+}
+static Sys_var_ulong Sys_query_cache_min_res_unit(
+ "query_cache_min_res_unit",
+ "The minimum size for blocks allocated by the query cache",
+ GLOBAL_VAR(query_cache_min_res_unit), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(0, ULONG_MAX), DEFAULT(QUERY_CACHE_MIN_RESULT_DATA_SIZE),
+ BLOCK_SIZE(1), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+ ON_UPDATE(fix_qcache_min_res_unit));
+
+static const char *query_cache_type_names[]= { "OFF", "ON", "DEMAND", 0 };
+static bool check_query_cache_type(sys_var *self, THD *thd, set_var *var)
+{
+ if (query_cache.is_disabled())
+ {
+ my_error(ER_QUERY_CACHE_DISABLED, MYF(0));
+ return true;
+ }
+ return false;
+}
+static Sys_var_enum Sys_query_cache_type(
+ "query_cache_type",
+ "OFF = Don't cache or retrieve results. ON = Cache all results "
+ "except SELECT SQL_NO_CACHE ... queries. DEMAND = Cache only "
+ "SELECT SQL_CACHE ... queries",
+ SESSION_VAR(query_cache_type), CMD_LINE(REQUIRED_ARG),
+ query_cache_type_names, DEFAULT(1), NO_MUTEX_GUARD, NOT_IN_BINLOG,
+ ON_CHECK(check_query_cache_type));
+
+static Sys_var_mybool Sys_query_cache_wlock_invalidate(
+ "query_cache_wlock_invalidate",
+ "Invalidate queries in query cache on LOCK for write",
+ SESSION_VAR(query_cache_wlock_invalidate), CMD_LINE(OPT_ARG),
+ DEFAULT(FALSE));
+#endif /* HAVE_QUERY_CACHE */
+
+static Sys_var_mybool Sys_secure_auth(
+ "secure_auth",
+ "Disallow authentication for accounts that have old (pre-4.1) "
+ "passwords",
+ GLOBAL_VAR(opt_secure_auth), CMD_LINE(OPT_ARG),
+ DEFAULT(FALSE));
+
+static Sys_var_charptr Sys_secure_file_priv(
+ "secure_file_priv",
+ "Limit LOAD DATA, SELECT ... OUTFILE, and LOAD_FILE() to files "
+ "within specified directory",
+ PREALLOCATED READ_ONLY GLOBAL_VAR(opt_secure_file_priv),
+ CMD_LINE(REQUIRED_ARG), IN_FS_CHARSET, DEFAULT(0));
+
+static bool fix_server_id(sys_var *self, THD *thd, enum_var_type type)
+{
+ server_id_supplied = 1;
+ thd->server_id= server_id;
+ return false;
+}
+static Sys_var_ulong Sys_server_id(
+ "server_id",
+ "Uniquely identifies the server instance in the community of "
+ "replication partners",
+ GLOBAL_VAR(server_id), CMD_LINE(REQUIRED_ARG, OPT_SERVER_ID),
+ VALID_RANGE(0, UINT_MAX32), DEFAULT(0), BLOCK_SIZE(1), NO_MUTEX_GUARD,
+ NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(fix_server_id));
+
+static Sys_var_mybool Sys_slave_compressed_protocol(
+ "slave_compressed_protocol",
+ "Use compression on master/slave protocol",
+ GLOBAL_VAR(opt_slave_compressed_protocol), CMD_LINE(OPT_ARG),
+ DEFAULT(FALSE));
+
+#ifdef HAVE_REPLICATION
+static const char *slave_exec_mode_names[]= {"STRICT", "IDEMPOTENT", 0};
+static Sys_var_enum Slave_exec_mode(
+ "slave_exec_mode",
+ "Modes for how replication events should be executed. Legal values "
+ "are STRICT (default) and IDEMPOTENT. In IDEMPOTENT mode, "
+ "replication will not stop for operations that are idempotent. "
+ "In STRICT mode, replication will stop on any unexpected difference "
+ "between the master and the slave",
+ GLOBAL_VAR(slave_exec_mode_options), CMD_LINE(REQUIRED_ARG),
+ slave_exec_mode_names, DEFAULT(SLAVE_EXEC_MODE_STRICT));
+#endif
+
+static Sys_var_ulong Sys_slow_launch_time(
+ "slow_launch_time",
+ "If creating the thread takes longer than this value (in seconds), "
+ "the Slow_launch_threads counter will be incremented",
+ GLOBAL_VAR(slow_launch_time), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(0, LONG_TIMEOUT), DEFAULT(2), BLOCK_SIZE(1));
+
+static Sys_var_ulong Sys_sort_buffer(
+ "sort_buffer_size",
+ "Each thread that needs to do a sort allocates a buffer of this size",
+ SESSION_VAR(sortbuff_size), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(MIN_SORT_MEMORY, ULONG_MAX), DEFAULT(MAX_SORT_MEMORY),
+ BLOCK_SIZE(1));
+
+export ulong expand_sql_mode(ulonglong sql_mode)
+{
+ if (sql_mode & MODE_ANSI)
+ {
+ /*
+ Note that we dont set
+ MODE_NO_KEY_OPTIONS | MODE_NO_TABLE_OPTIONS | MODE_NO_FIELD_OPTIONS
+ to allow one to get full use of MySQL in this mode.
+
+ MODE_ONLY_FULL_GROUP_BY was removed from ANSI mode because it is
+ currently overly restrictive (see BUG#8510).
+ */
+ sql_mode|= (MODE_REAL_AS_FLOAT | MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES |
+ MODE_IGNORE_SPACE);
+ }
+ if (sql_mode & MODE_ORACLE)
+ sql_mode|= (MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES |
+ MODE_IGNORE_SPACE |
+ MODE_NO_KEY_OPTIONS | MODE_NO_TABLE_OPTIONS |
+ MODE_NO_FIELD_OPTIONS | MODE_NO_AUTO_CREATE_USER);
+ if (sql_mode & MODE_MSSQL)
+ sql_mode|= (MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES |
+ MODE_IGNORE_SPACE |
+ MODE_NO_KEY_OPTIONS | MODE_NO_TABLE_OPTIONS |
+ MODE_NO_FIELD_OPTIONS);
+ if (sql_mode & MODE_POSTGRESQL)
+ sql_mode|= (MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES |
+ MODE_IGNORE_SPACE |
+ MODE_NO_KEY_OPTIONS | MODE_NO_TABLE_OPTIONS |
+ MODE_NO_FIELD_OPTIONS);
+ if (sql_mode & MODE_DB2)
+ sql_mode|= (MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES |
+ MODE_IGNORE_SPACE |
+ MODE_NO_KEY_OPTIONS | MODE_NO_TABLE_OPTIONS |
+ MODE_NO_FIELD_OPTIONS);
+ if (sql_mode & MODE_MAXDB)
+ sql_mode|= (MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES |
+ MODE_IGNORE_SPACE |
+ MODE_NO_KEY_OPTIONS | MODE_NO_TABLE_OPTIONS |
+ MODE_NO_FIELD_OPTIONS | MODE_NO_AUTO_CREATE_USER);
+ if (sql_mode & MODE_MYSQL40)
+ sql_mode|= MODE_HIGH_NOT_PRECEDENCE;
+ if (sql_mode & MODE_MYSQL323)
+ sql_mode|= MODE_HIGH_NOT_PRECEDENCE;
+ if (sql_mode & MODE_TRADITIONAL)
+ sql_mode|= (MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES |
+ MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE |
+ MODE_ERROR_FOR_DIVISION_BY_ZERO | MODE_NO_AUTO_CREATE_USER |
+ MODE_NO_ENGINE_SUBSTITUTION);
+ return sql_mode;
+}
+static bool check_sql_mode(sys_var *self, THD *thd, set_var *var)
+{
+ var->save_result.ulonglong_value=
+ expand_sql_mode(var->save_result.ulonglong_value);
+ return false;
+}
+static bool fix_sql_mode(sys_var *self, THD *thd, enum_var_type type)
+{
+ if (type != OPT_GLOBAL)
+ {
+ /* Update thd->server_status */
+ if (thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES)
+ thd->server_status|= SERVER_STATUS_NO_BACKSLASH_ESCAPES;
+ else
+ thd->server_status&= ~SERVER_STATUS_NO_BACKSLASH_ESCAPES;
+ }
+ return false;
+}
+/*
+ WARNING: When adding new SQL modes don't forget to update the
+ tables definitions that stores it's value (ie: mysql.event, mysql.proc)
+*/
+static const char *sql_mode_names[]=
+{
+ "REAL_AS_FLOAT", "PIPES_AS_CONCAT", "ANSI_QUOTES", "IGNORE_SPACE", ",",
+ "ONLY_FULL_GROUP_BY", "NO_UNSIGNED_SUBTRACTION", "NO_DIR_IN_CREATE",
+ "POSTGRESQL", "ORACLE", "MSSQL", "DB2", "MAXDB", "NO_KEY_OPTIONS",
+ "NO_TABLE_OPTIONS", "NO_FIELD_OPTIONS", "MYSQL323", "MYSQL40", "ANSI",
+ "NO_AUTO_VALUE_ON_ZERO", "NO_BACKSLASH_ESCAPES", "STRICT_TRANS_TABLES",
+ "STRICT_ALL_TABLES", "NO_ZERO_IN_DATE", "NO_ZERO_DATE",
+ "ALLOW_INVALID_DATES", "ERROR_FOR_DIVISION_BY_ZERO", "TRADITIONAL",
+ "NO_AUTO_CREATE_USER", "HIGH_NOT_PRECEDENCE", "NO_ENGINE_SUBSTITUTION",
+ "PAD_CHAR_TO_FULL_LENGTH",
+ 0
+};
+export bool sql_mode_string_representation(THD *thd, ulong sql_mode,
+ LEX_STRING *ls)
+{
+ set_to_string(thd, ls, sql_mode, sql_mode_names);
+ return ls->str == 0;
+}
+/*
+ sql_mode should *not* be IN_BINLOG: even though it is written to the binlog,
+ the slave ignores the MODE_NO_DIR_IN_CREATE variable, so slave's value
+ differs from master's (see log_event.cc: Query_log_event::do_apply_event()).
+*/
+static Sys_var_set Sys_sql_mode(
+ "sql_mode",
+ "Syntax: sql-mode=mode[,mode[,mode...]]. See the manual for the "
+ "complete list of valid sql modes",
+ SESSION_VAR(sql_mode), CMD_LINE(REQUIRED_ARG),
+ sql_mode_names, DEFAULT(0), NO_MUTEX_GUARD, NOT_IN_BINLOG,
+ ON_CHECK(check_sql_mode), ON_UPDATE(fix_sql_mode));
+
+static Sys_var_charptr Sys_ssl_ca(
+ "ssl_ca",
+ "CA file in PEM format (check OpenSSL docs, implies --ssl)",
+ READ_ONLY GLOBAL_VAR(opt_ssl_ca), CMD_LINE(REQUIRED_ARG, OPT_SSL_CA),
+ IN_FS_CHARSET, DEFAULT(0));
+
+static Sys_var_charptr Sys_ssl_capath(
+ "ssl_capath",
+ "CA directory (check OpenSSL docs, implies --ssl)",
+ READ_ONLY GLOBAL_VAR(opt_ssl_capath),
+ CMD_LINE(REQUIRED_ARG, OPT_SSL_CAPATH), IN_FS_CHARSET, DEFAULT(0));
+
+static Sys_var_charptr Sys_ssl_cert(
+ "ssl_cert", "X509 cert in PEM format (implies --ssl)",
+ READ_ONLY GLOBAL_VAR(opt_ssl_cert), CMD_LINE(REQUIRED_ARG, OPT_SSL_CERT),
+ IN_FS_CHARSET, DEFAULT(0));
+
+static Sys_var_charptr Sys_ssl_cipher(
+ "ssl_cipher", "SSL cipher to use (implies --ssl)",
+ READ_ONLY GLOBAL_VAR(opt_ssl_cipher),
+ CMD_LINE(REQUIRED_ARG, OPT_SSL_CIPHER), IN_FS_CHARSET, DEFAULT(0));
+
+static Sys_var_charptr Sys_ssl_key(
+ "ssl_key", "X509 key in PEM format (implies --ssl)",
+ READ_ONLY GLOBAL_VAR(opt_ssl_key), CMD_LINE(REQUIRED_ARG, OPT_SSL_KEY),
+ IN_FS_CHARSET, DEFAULT(0));
+
+// why ENUM and not BOOL ?
+static const char *updatable_views_with_limit_names[]= {"NO", "YES", 0};
+static Sys_var_enum Sys_updatable_views_with_limit(
+ "updatable_views_with_limit",
+ "YES = Don't issue an error message (warning only) if a VIEW without "
+ "presence of a key of the underlying table is used in queries with a "
+ "LIMIT clause for updating. NO = Prohibit update of a VIEW, which "
+ "does not contain a key of the underlying table and the query uses "
+ "a LIMIT clause (usually get from GUI tools)",
+ SESSION_VAR(updatable_views_with_limit), CMD_LINE(REQUIRED_ARG),
+ updatable_views_with_limit_names, DEFAULT(TRUE));
+
+static Sys_var_mybool Sys_sync_frm(
+ "sync_frm", "Sync .frm files to disk on creation",
+ GLOBAL_VAR(opt_sync_frm), CMD_LINE(OPT_ARG),
+ DEFAULT(TRUE));
+
+static char *system_time_zone_ptr;
+static Sys_var_charptr Sys_system_time_zone(
+ "system_time_zone", "The server system time zone",
+ READ_ONLY GLOBAL_VAR(system_time_zone_ptr), NO_CMD_LINE,
+ IN_FS_CHARSET, DEFAULT(system_time_zone));
+
+static Sys_var_ulong Sys_table_def_size(
+ "table_definition_cache",
+ "The number of cached table definitions",
+ GLOBAL_VAR(table_def_size), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(TABLE_DEF_CACHE_MIN, 512*1024),
+ DEFAULT(TABLE_DEF_CACHE_DEFAULT), BLOCK_SIZE(1));
+
+static Sys_var_ulong Sys_table_cache_size(
+ "table_open_cache", "The number of cached open tables",
+ GLOBAL_VAR(table_cache_size), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(1, 512*1024), DEFAULT(TABLE_OPEN_CACHE_DEFAULT),
+ BLOCK_SIZE(1));
+
+static Sys_var_ulong Sys_table_lock_wait_timeout(
+ "table_lock_wait_timeout",
+ "Timeout in seconds to wait for a table level lock before returning an "
+ "error. Used only if the connection has active cursors",
+ GLOBAL_VAR(table_lock_wait_timeout), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(1, 1024*1024*1024), DEFAULT(50), BLOCK_SIZE(1));
+
+static Sys_var_ulong Sys_thread_cache_size(
+ "thread_cache_size",
+ "How many threads we should keep in a cache for reuse",
+ GLOBAL_VAR(thread_cache_size), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(0, 16384), DEFAULT(0), BLOCK_SIZE(1));
+
+#if HAVE_POOL_OF_THREADS == 1
+static Sys_var_ulong Sys_thread_pool_size(
+ "thread_pool_size",
+ "How many threads we should create to handle query requests in "
+ "case of 'thread_handling=pool-of-threads'",
+ GLOBAL_VAR(thread_pool_size), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(1, 16384), DEFAULT(20), BLOCK_SIZE(0));
+#endif
+
+// Can't change the 'next' tx_isolation if we are already in a transaction
+static bool check_tx_isolation(sys_var *self, THD *thd, set_var *var)
+{
+ if (var->type == OPT_DEFAULT && (thd->server_status & SERVER_STATUS_IN_TRANS))
+ {
+ my_error(ER_CANT_CHANGE_TX_ISOLATION, MYF(0));
+ return true;
+ }
+ return false;
+}
+
+/*
+ If one doesn't use the SESSION modifier, the isolation level
+ is only active for the next command.
+*/
+static bool fix_tx_isolation(sys_var *self, THD *thd, enum_var_type type)
+{
+ if (type == OPT_SESSION)
+ thd->session_tx_isolation= (enum_tx_isolation)thd->variables.tx_isolation;
+ return false;
+}
+// NO_CMD_LINE - different name of the option
+static Sys_var_enum Sys_tx_isolation(
+ "tx_isolation", "Default transaction isolation level",
+ SESSION_VAR(tx_isolation), NO_CMD_LINE,
+ tx_isolation_names, DEFAULT(ISO_REPEATABLE_READ),
+ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_tx_isolation),
+ ON_UPDATE(fix_tx_isolation));
+
+static Sys_var_ulonglong Sys_tmp_table_size(
+ "tmp_table_size",
+ "If an internal in-memory temporary table exceeds this size, MySQL "
+ "will automatically convert it to an on-disk MyISAM table",
+ SESSION_VAR(tmp_table_size), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(1024, (ulonglong)~(intptr)0), DEFAULT(16*1024*1024),
+ BLOCK_SIZE(1));
+
+static Sys_var_mybool Sys_timed_mutexes(
+ "timed_mutexes",
+ "Specify whether to time mutexes (only InnoDB mutexes are currently "
+ "supported)",
+ GLOBAL_VAR(timed_mutexes), CMD_LINE(OPT_ARG), DEFAULT(0));
+
+static char *server_version_ptr;
+static Sys_var_charptr Sys_version(
+ "version", "Server version",
+ READ_ONLY GLOBAL_VAR(server_version_ptr), NO_CMD_LINE,
+ IN_SYSTEM_CHARSET, DEFAULT(server_version));
+
+static char *server_version_comment_ptr;
+static Sys_var_charptr Sys_version_comment(
+ "version_comment", "version_comment",
+ READ_ONLY GLOBAL_VAR(server_version_comment_ptr), NO_CMD_LINE,
+ IN_SYSTEM_CHARSET, DEFAULT(MYSQL_COMPILATION_COMMENT));
+
+static char *server_version_compile_machine_ptr;
+static Sys_var_charptr Sys_version_compile_machine(
+ "version_compile_machine", "version_compile_machine",
+ READ_ONLY GLOBAL_VAR(server_version_compile_machine_ptr), NO_CMD_LINE,
+ IN_SYSTEM_CHARSET, DEFAULT(MACHINE_TYPE));
+
+static char *server_version_compile_os_ptr;
+static Sys_var_charptr Sys_version_compile_os(
+ "version_compile_os", "version_compile_os",
+ READ_ONLY GLOBAL_VAR(server_version_compile_os_ptr), NO_CMD_LINE,
+ IN_SYSTEM_CHARSET, DEFAULT(SYSTEM_TYPE));
+
+static Sys_var_ulong Sys_net_wait_timeout(
+ "wait_timeout",
+ "The number of seconds the server waits for activity on a "
+ "connection before closing it",
+ SESSION_VAR(net_wait_timeout), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(1, IF_WIN(INT_MAX32/1000, LONG_TIMEOUT)),
+ DEFAULT(NET_WAIT_TIMEOUT), BLOCK_SIZE(1));
+
+static Sys_var_mybool Sys_engine_condition_pushdown(
+ "engine_condition_pushdown",
+ "Push supported query conditions to the storage engine",
+ SESSION_VAR(engine_condition_pushdown), CMD_LINE(OPT_ARG),
+ DEFAULT(TRUE));
+
+static Sys_var_plugin Sys_default_storage_engine(
+ "default_storage_engine", "The default storage engine for new tables",
+ SESSION_VAR(table_plugin), NO_CMD_LINE,
+ MYSQL_STORAGE_ENGINE_PLUGIN, DEFAULT(&default_storage_engine),
+ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_not_null));
+
+// Alias for @@default_storage_engine
+static Sys_var_plugin Sys_storage_engine(
+ "storage_engine", "Alias for @@default_storage_engine. Deprecated",
+ SESSION_VAR(table_plugin), NO_CMD_LINE,
+ MYSQL_STORAGE_ENGINE_PLUGIN, DEFAULT(&default_storage_engine),
+ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_not_null));
+
+#if defined(ENABLED_DEBUG_SYNC)
+/*
+ Variable can be set for the session only.
+
+ This could be changed later. Then we need to have a global array of
+ actions in addition to the thread local ones. SET GLOBAL would
+ manage the global array, SET [SESSION] the local array. A sync point
+ would need to look for a local and a global action. Setting and
+ executing of global actions need to be protected by a mutex.
+
+ The purpose of global actions could be to allow synchronizing with
+ connectionless threads that cannot execute SET statements.
+*/
+static Sys_var_debug_sync Sys_debug_sync(
+ "debug_sync", "Debug Sync Facility",
+ sys_var::ONLY_SESSION, NO_CMD_LINE,
+ DEFAULT(0), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_has_super));
+#endif /* defined(ENABLED_DEBUG_SYNC) */
+
+/**
+ "time_format" "date_format" "datetime_format"
+
+ the following three variables are unused, and the source of confusion
+ (bug reports like "I've changed date_format, but date format hasn't changed.
+ I've made them read-only, to alleviate the situation somewhat.
+
+ @todo make them NO_CMD_LINE ?
+*/
+static Sys_var_charptr Sys_date_format(
+ "date_format", "The DATE format (ignored)",
+ READ_ONLY GLOBAL_VAR(global_date_format.format.str),
+ CMD_LINE(REQUIRED_ARG), IN_SYSTEM_CHARSET,
+ DEFAULT(known_date_time_formats[ISO_FORMAT].date_format));
+
+static Sys_var_charptr Sys_datetime_format(
+ "datetime_format", "The DATETIME format (ignored)",
+ READ_ONLY GLOBAL_VAR(global_datetime_format.format.str),
+ CMD_LINE(REQUIRED_ARG), IN_SYSTEM_CHARSET,
+ DEFAULT(known_date_time_formats[ISO_FORMAT].datetime_format));
+
+static Sys_var_charptr Sys_time_format(
+ "time_format", "The TIME format (ignored)",
+ READ_ONLY GLOBAL_VAR(global_time_format.format.str),
+ CMD_LINE(REQUIRED_ARG), IN_SYSTEM_CHARSET,
+ DEFAULT(known_date_time_formats[ISO_FORMAT].time_format));
+
+static bool fix_autocommit(sys_var *self, THD *thd, enum_var_type type)
+{
+ if (type == OPT_GLOBAL)
+ {
+ if (global_system_variables.option_bits & OPTION_AUTOCOMMIT)
+ global_system_variables.option_bits&= ~OPTION_NOT_AUTOCOMMIT;
+ else
+ global_system_variables.option_bits|= OPTION_NOT_AUTOCOMMIT;
+ return false;
+ }
+
+ if (thd->variables.option_bits & OPTION_AUTOCOMMIT &&
+ thd->variables.option_bits & OPTION_NOT_AUTOCOMMIT)
+ { // activating autocommit
+
+ if (ha_commit(thd))
+ {
+ thd->variables.option_bits&= ~OPTION_AUTOCOMMIT;
+ return true;
+ }
+
+ thd->variables.option_bits&=
+ ~(OPTION_BEGIN | OPTION_KEEP_LOG | OPTION_NOT_AUTOCOMMIT);
+ thd->transaction.all.modified_non_trans_table= false;
+ thd->server_status|= SERVER_STATUS_AUTOCOMMIT;
+ return false;
+ }
+
+ if (!(thd->variables.option_bits & OPTION_AUTOCOMMIT) &&
+ !(thd->variables.option_bits & OPTION_NOT_AUTOCOMMIT))
+ { // disabling autocommit
+
+ thd->transaction.all.modified_non_trans_table= false;
+ thd->server_status&= ~SERVER_STATUS_AUTOCOMMIT;
+ thd->variables.option_bits|= OPTION_NOT_AUTOCOMMIT;
+ return false;
+ }
+
+ return false; // autocommit value wasn't changed
+}
+static Sys_var_bit Sys_autocommit(
+ "autocommit", "autocommit",
+ SESSION_VAR(option_bits), NO_CMD_LINE, OPTION_AUTOCOMMIT, DEFAULT(TRUE),
+ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(fix_autocommit));
+export sys_var *Sys_autocommit_ptr= &Sys_autocommit; // for sql_yacc.yy
+
+static Sys_var_mybool Sys_big_tables(
+ "big_tables", "Allow big result sets by saving all "
+ "temporary sets on file (Solves most 'table full' errors)",
+ SESSION_VAR(big_tables), CMD_LINE(OPT_ARG), DEFAULT(FALSE));
+
+#ifndef TO_BE_DELETED /* Alias for big_tables */
+static Sys_var_mybool Sys_sql_big_tables(
+ "sql_big_tables", "alias for big_tables",
+ SESSION_VAR(big_tables), NO_CMD_LINE, DEFAULT(FALSE));
+#endif
+
+static Sys_var_bit Sys_big_selects(
+ "sql_big_selects", "sql_big_selects",
+ SESSION_VAR(option_bits), NO_CMD_LINE, OPTION_BIG_SELECTS,
+ DEFAULT(FALSE));
+
+static Sys_var_bit Sys_log_off(
+ "sql_log_off", "sql_log_off",
+ SESSION_VAR(option_bits), NO_CMD_LINE, OPTION_LOG_OFF,
+ DEFAULT(FALSE), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_has_super));
+
+static bool fix_sql_log_bin(sys_var *self, THD *thd, enum_var_type type)
+{
+ if (type != OPT_GLOBAL && !thd->in_sub_stmt)
+ thd->sql_log_bin_toplevel= thd->variables.option_bits & OPTION_BIN_LOG;
+ return false;
+}
+static Sys_var_bit Sys_log_binlog(
+ "sql_log_bin", "sql_log_bin",
+ SESSION_VAR(option_bits), NO_CMD_LINE, OPTION_BIN_LOG,
+ DEFAULT(TRUE), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_has_super),
+ ON_UPDATE(fix_sql_log_bin));
+
+static bool deprecated_log_update(sys_var *self, THD *thd, set_var *var)
+{
+ /*
+ The update log is not supported anymore since 5.0.
+ See sql/mysqld.cc/, comments in function init_server_components() for an
+ explaination of the different warnings we send below
+ */
+
+ if (opt_sql_bin_update)
+ push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
+ ER_UPDATE_LOG_DEPRECATED_TRANSLATED,
+ ER(ER_UPDATE_LOG_DEPRECATED_TRANSLATED));
+ else
+ push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
+ ER_UPDATE_LOG_DEPRECATED_IGNORED,
+ ER(ER_UPDATE_LOG_DEPRECATED_IGNORED));
+ return check_has_super(self, thd, var);
+}
+static Sys_var_bit Sys_log_update(
+ "sql_log_update", "alias for sql_log_bin",
+ SESSION_VAR(option_bits), NO_CMD_LINE, OPTION_BIN_LOG,
+ DEFAULT(TRUE), NO_MUTEX_GUARD, NOT_IN_BINLOG,
+ ON_CHECK(deprecated_log_update), ON_UPDATE(fix_sql_log_bin));
+
+static Sys_var_bit Sys_sql_warnings(
+ "sql_warnings", "sql_warnings",
+ SESSION_VAR(option_bits), NO_CMD_LINE, OPTION_WARNINGS,
+ DEFAULT(FALSE));
+
+static Sys_var_bit Sys_sql_notes(
+ "sql_notes", "sql_notes",
+ SESSION_VAR(option_bits), NO_CMD_LINE, OPTION_SQL_NOTES,
+ DEFAULT(TRUE));
+
+static Sys_var_bit Sys_auto_is_null(
+ "sql_auto_is_null", "sql_auto_is_null",
+ SESSION_VAR(option_bits), NO_CMD_LINE, OPTION_AUTO_IS_NULL,
+ DEFAULT(FALSE), NO_MUTEX_GUARD, IN_BINLOG);
+
+static Sys_var_bit Sys_safe_updates(
+ "sql_safe_updates", "sql_safe_updates",
+ SESSION_VAR(option_bits), NO_CMD_LINE, OPTION_SAFE_UPDATES,
+ DEFAULT(FALSE));
+
+static Sys_var_bit Sys_buffer_results(
+ "sql_buffer_result", "sql_buffer_result",
+ SESSION_VAR(option_bits), NO_CMD_LINE, OPTION_BUFFER_RESULT,
+ DEFAULT(FALSE));
+
+static Sys_var_bit Sys_quote_show_create(
+ "sql_quote_show_create", "sql_quote_show_create",
+ SESSION_VAR(option_bits), NO_CMD_LINE, OPTION_QUOTE_SHOW_CREATE,
+ DEFAULT(TRUE));
+
+static Sys_var_bit Sys_foreign_key_checks(
+ "foreign_key_checks", "foreign_key_checks",
+ SESSION_VAR(option_bits), NO_CMD_LINE,
+ REVERSE(OPTION_NO_FOREIGN_KEY_CHECKS),
+ DEFAULT(TRUE), NO_MUTEX_GUARD, IN_BINLOG);
+
+static Sys_var_bit Sys_unique_checks(
+ "unique_checks", "unique_checks",
+ SESSION_VAR(option_bits), NO_CMD_LINE,
+ REVERSE(OPTION_RELAXED_UNIQUE_CHECKS),
+ DEFAULT(TRUE), NO_MUTEX_GUARD, IN_BINLOG);
+
+#ifdef ENABLED_PROFILING
+static Sys_var_bit Sys_profiling(
+ "profiling", "profiling",
+ SESSION_VAR(option_bits), NO_CMD_LINE, OPTION_PROFILING,
+ DEFAULT(FALSE));
+
+static Sys_var_ulong Sys_profiling_history_size(
+ "profiling_history_size", "Limit of query profiling memory",
+ SESSION_VAR(profiling_history_size), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(0, 100), DEFAULT(15), BLOCK_SIZE(1));
+#endif
+
+static Sys_var_harows Sys_select_limit(
+ "sql_select_limit",
+ "The maximum number of rows to return from SELECT statements",
+ SESSION_VAR(select_limit), NO_CMD_LINE,
+ VALID_RANGE(1, HA_POS_ERROR), DEFAULT(HA_POS_ERROR), BLOCK_SIZE(1));
+
+static bool update_timestamp(THD *thd, set_var *var)
+{
+ if (var->value)
+ thd->set_time((time_t) var->save_result.ulonglong_value);
+ else // SET timestamp=DEFAULT
+ thd->user_time= 0;
+ return false;
+}
+static ulonglong read_timestamp(THD *thd)
+{
+ return (ulonglong) thd->start_time;
+}
+static Sys_var_session_special Sys_timestamp(
+ "timestamp", "Set the time for this client",
+ sys_var::ONLY_SESSION, NO_CMD_LINE,
+ VALID_RANGE(0, ~(time_t)0), BLOCK_SIZE(1),
+ NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(0), ON_UPDATE(update_timestamp),
+ ON_READ(read_timestamp));
+
+static bool update_last_insert_id(THD *thd, set_var *var)
+{
+ if (!var->value)
+ {
+ my_error(ER_NO_DEFAULT, MYF(0), var->var->name);
+ return true;
+ }
+ thd->first_successful_insert_id_in_prev_stmt=
+ var->save_result.ulonglong_value;
+ return false;
+}
+static ulonglong read_last_insert_id(THD *thd)
+{
+ return (ulonglong) thd->read_first_successful_insert_id_in_prev_stmt();
+}
+static Sys_var_session_special Sys_last_insert_id(
+ "last_insert_id", "The value to be returned from LAST_INSERT_ID()",
+ sys_var::ONLY_SESSION, NO_CMD_LINE,
+ VALID_RANGE(0, ULONGLONG_MAX), BLOCK_SIZE(1),
+ NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(0),
+ ON_UPDATE(update_last_insert_id), ON_READ(read_last_insert_id));
+
+// alias for last_insert_id(), Sybase-style
+static Sys_var_session_special Sys_identity(
+ "identity", "Synonym for the last_insert_id variable",
+ sys_var::ONLY_SESSION, NO_CMD_LINE,
+ VALID_RANGE(0, ULONGLONG_MAX), BLOCK_SIZE(1),
+ NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(0),
+ ON_UPDATE(update_last_insert_id), ON_READ(read_last_insert_id));
+
+/*
+ insert_id should *not* be marked as written to the binlog (i.e., it
+ should *not* be IN_BINLOG), because we want any statement that
+ refers to insert_id explicitly to be unsafe. (By "explicitly", we
+ mean using @@session.insert_id, whereas insert_id is used
+ "implicitly" when NULL value is inserted into an auto_increment
+ column).
+
+ We want statements referring explicitly to @@session.insert_id to be
+ unsafe, because insert_id is modified internally by the slave sql
+ thread when NULL values are inserted in an AUTO_INCREMENT column.
+ This modification interfers with the value of the
+ @@session.insert_id variable if @@session.insert_id is referred
+ explicitly by an insert statement (as is seen by executing "SET
+ @@session.insert_id=0; CREATE TABLE t (a INT, b INT KEY
+ AUTO_INCREMENT); INSERT INTO t(a) VALUES (@@session.insert_id);" in
+ statement-based logging mode: t will be different on master and
+ slave).
+*/
+static bool update_insert_id(THD *thd, set_var *var)
+{
+ if (!var->value)
+ {
+ my_error(ER_NO_DEFAULT, MYF(0), var->var->name);
+ return true;
+ }
+ thd->force_one_auto_inc_interval(var->save_result.ulonglong_value);
+ return false;
+}
+
+static ulonglong read_insert_id(THD *thd)
+{
+ return thd->auto_inc_intervals_forced.minimum();
+}
+static Sys_var_session_special Sys_insert_id(
+ "insert_id", "The value to be used by the following INSERT "
+ "or ALTER TABLE statement when inserting an AUTO_INCREMENT value",
+ sys_var::ONLY_SESSION, NO_CMD_LINE,
+ VALID_RANGE(0, ULONGLONG_MAX), BLOCK_SIZE(1),
+ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+ ON_UPDATE(update_insert_id), ON_READ(read_insert_id));
+
+static bool update_rand_seed1(THD *thd, set_var *var)
+{
+ if (!var->value)
+ {
+ my_error(ER_NO_DEFAULT, MYF(0), var->var->name);
+ return true;
+ }
+ thd->rand.seed1= (ulong) var->save_result.ulonglong_value;
+ return false;
+}
+static ulonglong read_rand_seed(THD *thd)
+{
+ return 0;
+}
+static Sys_var_session_special Sys_rand_seed1(
+ "rand_seed1", "Sets the internal state of the RAND() "
+ "generator for replication purposes",
+ sys_var::ONLY_SESSION, NO_CMD_LINE,
+ VALID_RANGE(0, ULONG_MAX), BLOCK_SIZE(1),
+ NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(0),
+ ON_UPDATE(update_rand_seed1), ON_READ(read_rand_seed));
+
+static bool update_rand_seed2(THD *thd, set_var *var)
+{
+ if (!var->value)
+ {
+ my_error(ER_NO_DEFAULT, MYF(0), var->var->name);
+ return true;
+ }
+ thd->rand.seed2= (ulong) var->save_result.ulonglong_value;
+ return false;
+}
+static Sys_var_session_special Sys_rand_seed2(
+ "rand_seed2", "Sets the internal state of the RAND() "
+ "generator for replication purposes",
+ sys_var::ONLY_SESSION, NO_CMD_LINE,
+ VALID_RANGE(0, ULONG_MAX), BLOCK_SIZE(1),
+ NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(0),
+ ON_UPDATE(update_rand_seed2), ON_READ(read_rand_seed));
+
+static ulonglong read_error_count(THD *thd)
+{
+ return thd->warning_info->error_count();
+}
+// this really belongs to the SHOW STATUS
+static Sys_var_session_special Sys_error_count(
+ "error_count", "The number of errors that resulted from the "
+ "last statement that generated messages",
+ READ_ONLY sys_var::ONLY_SESSION, NO_CMD_LINE,
+ VALID_RANGE(0, ULONGLONG_MAX), BLOCK_SIZE(1), NO_MUTEX_GUARD,
+ NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(0), ON_READ(read_error_count));
+
+static ulonglong read_warning_count(THD *thd)
+{
+ return thd->warning_info->warn_count();
+}
+// this really belongs to the SHOW STATUS
+static Sys_var_session_special Sys_warning_count(
+ "warning_count", "The number of errors, warnings, and notes "
+ "that resulted from the last statement that generated messages",
+ READ_ONLY sys_var::ONLY_SESSION, NO_CMD_LINE,
+ VALID_RANGE(0, ULONGLONG_MAX), BLOCK_SIZE(1), NO_MUTEX_GUARD,
+ NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(0), ON_READ(read_warning_count));
+
+static Sys_var_ulong Sys_default_week_format(
+ "default_week_format",
+ "The default week format used by WEEK() functions",
+ SESSION_VAR(default_week_format), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(0, 7), DEFAULT(0), BLOCK_SIZE(1));
+
+static Sys_var_ulong Sys_group_concat_max_len(
+ "group_concat_max_len",
+ "The maximum length of the result of function GROUP_CONCAT()",
+ SESSION_VAR(group_concat_max_len), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(4, ULONG_MAX), DEFAULT(1024), BLOCK_SIZE(1));
+
+static char *glob_hostname_ptr;
+static Sys_var_charptr Sys_hostname(
+ "hostname", "Server host name",
+ READ_ONLY GLOBAL_VAR(glob_hostname_ptr), NO_CMD_LINE,
+ IN_FS_CHARSET, DEFAULT(glob_hostname));
+
+#ifndef EMBEDDED_LIBRARY
+static Sys_var_charptr Sys_repl_report_host(
+ "report_host",
+ "Hostname or IP of the slave to be reported to the master during "
+ "slave registration. Will appear in the output of SHOW SLAVE HOSTS. "
+ "Leave unset if you do not want the slave to register itself with the "
+ "master. Note that it is not sufficient for the master to simply read "
+ "the IP of the slave off the socket once the slave connects. Due to "
+ "NAT and other routing issues, that IP may not be valid for connecting "
+ "to the slave from the master or other hosts",
+ READ_ONLY GLOBAL_VAR(report_host), CMD_LINE(REQUIRED_ARG),
+ IN_FS_CHARSET, DEFAULT(0));
+
+static Sys_var_charptr Sys_repl_report_user(
+ "report_user",
+ "The account user name of the slave to be reported to the master "
+ "during slave registration",
+ READ_ONLY GLOBAL_VAR(report_user), CMD_LINE(REQUIRED_ARG),
+ IN_FS_CHARSET, DEFAULT(0));
+
+static Sys_var_charptr Sys_repl_report_password(
+ "report_password",
+ "The account password of the slave to be reported to the master "
+ "during slave registration",
+ READ_ONLY GLOBAL_VAR(report_password), CMD_LINE(REQUIRED_ARG),
+ IN_FS_CHARSET, DEFAULT(0));
+
+static Sys_var_uint Sys_repl_report_port(
+ "report_port",
+ "Port for connecting to slave reported to the master during slave "
+ "registration. Set it only if the slave is listening on a non-default "
+ "port or if you have a special tunnel from the master or other clients "
+ "to the slave. If not sure, leave this option unset",
+ READ_ONLY GLOBAL_VAR(report_port), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(0, UINT_MAX), DEFAULT(MYSQL_PORT), BLOCK_SIZE(1));
+#endif
+
+static Sys_var_mybool Sys_keep_files_on_create(
+ "keep_files_on_create",
+ "Don't overwrite stale .MYD and .MYI even if no directory is specified",
+ SESSION_VAR(keep_files_on_create), CMD_LINE(OPT_ARG),
+ DEFAULT(FALSE));
+
+static char *license;
+static Sys_var_charptr Sys_license(
+ "license", "The type of license the server has",
+ READ_ONLY GLOBAL_VAR(license), NO_CMD_LINE, IN_SYSTEM_CHARSET,
+ DEFAULT(STRINGIFY_ARG(LICENSE)));
+
+static bool check_log_path(sys_var *self, THD *thd, set_var *var)
+{
+ if (!var->value)
+ return false; // DEFAULT is ok
+
+ if (!var->save_result.string_value.str)
+ return true;
+
+ if (var->save_result.string_value.length > FN_REFLEN)
+ { // path is too long
+ my_error(ER_PATH_LENGTH, MYF(0), self->name.str);
+ return true;
+ }
+
+ char path[FN_REFLEN];
+ size_t path_length= unpack_filename(path, var->save_result.string_value.str);
+
+ if (!path_length)
+ return true;
+
+ MY_STAT f_stat;
+
+ if (my_stat(path, &f_stat, MYF(0)))
+ {
+ if (!MY_S_ISREG(f_stat.st_mode) || !(f_stat.st_mode & MY_S_IWRITE))
+ return true; // not a regular writable file
+ return false;
+ }
+
+ (void) dirname_part(path, var->save_result.string_value.str, &path_length);
+
+ if (var->save_result.string_value.length - path_length >= FN_LEN)
+ { // filename is too long
+ my_error(ER_PATH_LENGTH, MYF(0), self->name.str);
+ return true;
+ }
+
+ if (!path_length) // no path is good path (remember, relative to datadir)
+ return false;
+
+ if (my_access(path, (F_OK|W_OK)))
+ return true; // directory is not writable
+
+ return false;
+}
+static bool fix_log(char** logname, const char* default_logname,
+ const char*ext, bool enabled, void (*reopen)(char*))
+{
+ if (!*logname) // SET ... = DEFAULT
+ {
+ char buff[FN_REFLEN];
+ *logname= my_strdup(make_log_name(buff, default_logname, ext),
+ MYF(MY_FAE+MY_WME));
+ if (!*logname)
+ return true;
+ }
+ logger.lock_exclusive();
+ pthread_mutex_unlock(&LOCK_global_system_variables);
+ if (enabled)
+ reopen(*logname);
+ logger.unlock();
+ pthread_mutex_lock(&LOCK_global_system_variables);
+ return false;
+}
+static void reopen_general_log(char* name)
+{
+ logger.get_log_file_handler()->close(0);
+ logger.get_log_file_handler()->open_query_log(name);
+}
+static bool fix_general_log_file(sys_var *self, THD *thd, enum_var_type type)
+{
+ return fix_log(&opt_logname, default_logfile_name, ".log", opt_log,
+ reopen_general_log);
+}
+static Sys_var_charptr Sys_general_log_path(
+ "general_log_file", "Log connections and queries to given file",
+ PREALLOCATED GLOBAL_VAR(opt_logname), CMD_LINE(REQUIRED_ARG),
+ IN_FS_CHARSET, DEFAULT(0), NO_MUTEX_GUARD, NOT_IN_BINLOG,
+ ON_CHECK(check_log_path), ON_UPDATE(fix_general_log_file));
+
+static void reopen_slow_log(char* name)
+{
+ logger.get_slow_log_file_handler()->close(0);
+ logger.get_slow_log_file_handler()->open_slow_log(name);
+}
+static bool fix_slow_log_file(sys_var *self, THD *thd, enum_var_type type)
+{
+ return fix_log(&opt_slow_logname, default_logfile_name, "-slow.log",
+ opt_slow_log, reopen_slow_log);
+}
+static Sys_var_charptr Sys_slow_log_path(
+ "slow_query_log_file", "Log slow queries to given log file. "
+ "Defaults logging to hostname-slow.log. Must be enabled to activate "
+ "other slow log options",
+ PREALLOCATED GLOBAL_VAR(opt_slow_logname), CMD_LINE(REQUIRED_ARG),
+ IN_FS_CHARSET, DEFAULT(0), NO_MUTEX_GUARD, NOT_IN_BINLOG,
+ ON_CHECK(check_log_path), ON_UPDATE(fix_slow_log_file));
+
+/// @todo deprecate these four legacy have_PLUGIN variables and use I_S instead
+export SHOW_COMP_OPTION have_csv, have_innodb;
+export SHOW_COMP_OPTION have_ndbcluster, have_partitioning;
+static Sys_var_have Sys_have_csv(
+ "have_csv", "have_csv",
+ READ_ONLY GLOBAL_VAR(have_csv), NO_CMD_LINE);
+
+static Sys_var_have Sys_have_innodb(
+ "have_innodb", "have_innodb",
+ READ_ONLY GLOBAL_VAR(have_innodb), NO_CMD_LINE);
+
+static Sys_var_have Sys_have_ndbcluster(
+ "have_ndbcluster", "have_ndbcluster",
+ READ_ONLY GLOBAL_VAR(have_ndbcluster), NO_CMD_LINE);
+
+static Sys_var_have Sys_have_partition_db(
+ "have_partitioning", "have_partitioning",
+ READ_ONLY GLOBAL_VAR(have_partitioning), NO_CMD_LINE);
+
+static Sys_var_have Sys_have_compress(
+ "have_compress", "have_compress",
+ READ_ONLY GLOBAL_VAR(have_compress), NO_CMD_LINE);
+
+static Sys_var_have Sys_have_crypt(
+ "have_crypt", "have_crypt",
+ READ_ONLY GLOBAL_VAR(have_crypt), NO_CMD_LINE);
+
+static Sys_var_have Sys_have_dlopen(
+ "have_dynamic_loading", "have_dynamic_loading",
+ READ_ONLY GLOBAL_VAR(have_dlopen), NO_CMD_LINE);
+
+static Sys_var_have Sys_have_geometry(
+ "have_geometry", "have_geometry",
+ READ_ONLY GLOBAL_VAR(have_geometry), NO_CMD_LINE);
+
+static Sys_var_have Sys_have_openssl(
+ "have_openssl", "have_openssl",
+ READ_ONLY GLOBAL_VAR(have_ssl), NO_CMD_LINE);
+
+static Sys_var_have Sys_have_profiling(
+ "have_profiling", "have_profiling",
+ READ_ONLY GLOBAL_VAR(have_profiling), NO_CMD_LINE);
+
+static Sys_var_have Sys_have_query_cache(
+ "have_query_cache", "have_query_cache",
+ READ_ONLY GLOBAL_VAR(have_query_cache), NO_CMD_LINE);
+
+static Sys_var_have Sys_have_rtree_keys(
+ "have_rtree_keys", "have_rtree_keys",
+ READ_ONLY GLOBAL_VAR(have_rtree_keys), NO_CMD_LINE);
+
+static Sys_var_have Sys_have_ssl(
+ "have_ssl", "have_ssl",
+ READ_ONLY GLOBAL_VAR(have_ssl), NO_CMD_LINE);
+
+static Sys_var_have Sys_have_symlink(
+ "have_symlink", "have_symlink",
+ READ_ONLY GLOBAL_VAR(have_symlink), NO_CMD_LINE);
+
+static bool fix_log_state(sys_var *self, THD *thd, enum_var_type type);
+static Sys_var_mybool Sys_general_log(
+ "general_log", "Log connections and queries to a table or log file. "
+ "Defaults logging to a file hostname.log or a table mysql.general_log"
+ "if --log-output=TABLE is used",
+ GLOBAL_VAR(opt_log), CMD_LINE(OPT_ARG),
+ DEFAULT(FALSE), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+ ON_UPDATE(fix_log_state));
+
+// Synonym of "general_log" for consistency with SHOW VARIABLES output
+static Sys_var_mybool Sys_log(
+ "log", "Alias for --general-log. Deprecated",
+ GLOBAL_VAR(opt_log), NO_CMD_LINE,
+ DEFAULT(FALSE), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+ ON_UPDATE(fix_log_state), DEPRECATED(70000, "'@@general_log'"));
+
+static Sys_var_mybool Sys_slow_query_log(
+ "slow_query_log",
+ "Log slow queries to a table or log file. Defaults logging to a file "
+ "hostname-slow.log or a table mysql.slow_log if --log-output=TABLE is "
+ "used. Must be enabled to activate other slow log options",
+ GLOBAL_VAR(opt_slow_log), CMD_LINE(OPT_ARG),
+ DEFAULT(FALSE), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+ ON_UPDATE(fix_log_state));
+
+/* Synonym of "slow_query_log" for consistency with SHOW VARIABLES output */
+static Sys_var_mybool Sys_log_slow(
+ "log_slow_queries",
+ "Alias for --slow-query-log. Deprecated",
+ GLOBAL_VAR(opt_slow_log), NO_CMD_LINE,
+ DEFAULT(FALSE), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+ ON_UPDATE(fix_log_state), DEPRECATED(70000, "'@@slow_query_log'"));
+
+static bool fix_log_state(sys_var *self, THD *thd, enum_var_type type)
+{
+ bool res;
+ my_bool *newvalptr, newval, oldval;
+ uint log_type;
+
+ if (self == &Sys_general_log || self == &Sys_log)
+ {
+ newvalptr= &opt_log;
+ oldval= logger.get_log_file_handler()->is_open();
+ log_type= QUERY_LOG_GENERAL;
+ }
+ else if (self == &Sys_slow_query_log || self == &Sys_log_slow)
+ {
+ newvalptr= &opt_slow_log;
+ oldval= logger.get_slow_log_file_handler()->is_open();
+ log_type= QUERY_LOG_SLOW;
+ }
+ else
+ DBUG_ASSERT(FALSE);
+
+ newval= *newvalptr;
+ if (oldval == newval)
+ return false;
+
+ *newvalptr= oldval; // [de]activate_log_handler works that way (sigh)
+
+ pthread_mutex_unlock(&LOCK_global_system_variables);
+ if (!newval)
+ {
+ logger.deactivate_log_handler(thd, log_type);
+ res= false;
+ }
+ else
+ res= logger.activate_log_handler(thd, log_type);
+ pthread_mutex_lock(&LOCK_global_system_variables);
+ return res;
+}
+
+static bool check_not_empty_set(sys_var *self, THD *thd, set_var *var)
+{
+ return var->save_result.ulonglong_value == 0;
+}
+static bool fix_log_output(sys_var *self, THD *thd, enum_var_type type)
+{
+ logger.lock_exclusive();
+ logger.init_slow_log(log_output_options);
+ logger.init_general_log(log_output_options);
+ logger.unlock();
+ return false;
+}
+
+static Sys_var_set Sys_log_output(
+ "log_output", "Syntax: log-output=value[,value...], "
+ "where \"value\" could be TABLE, FILE or NONE",
+ GLOBAL_VAR(log_output_options), CMD_LINE(REQUIRED_ARG),
+ log_output_names, DEFAULT(LOG_FILE), NO_MUTEX_GUARD, NOT_IN_BINLOG,
+ ON_CHECK(check_not_empty_set), ON_UPDATE(fix_log_output));
+
+#ifdef HAVE_REPLICATION
+static Sys_var_mybool Sys_log_slave_updates(
+ "log_slave_updates", "Tells the slave to log the updates from "
+ "the slave thread to the binary log. You will need to turn it on if "
+ "you plan to daisy-chain the slaves",
+ READ_ONLY GLOBAL_VAR(opt_log_slave_updates), CMD_LINE(OPT_ARG),
+ DEFAULT(0));
+
+static Sys_var_charptr Sys_relay_log(
+ "relay_log", "The location and name to use for relay logs",
+ READ_ONLY GLOBAL_VAR(opt_relay_logname), CMD_LINE(REQUIRED_ARG),
+ IN_FS_CHARSET, DEFAULT(0));
+
+static Sys_var_charptr Sys_relay_log_index(
+ "relay_log_index", "The location and name to use for the file "
+ "that keeps a list of the last relay logs",
+ READ_ONLY GLOBAL_VAR(opt_relaylog_index_name), CMD_LINE(REQUIRED_ARG),
+ IN_FS_CHARSET, DEFAULT(0));
+
+static Sys_var_charptr Sys_relay_log_info_file(
+ "relay_log_info_file", "The location and name of the file that "
+ "remembers where the SQL replication thread is in the relay logs",
+ READ_ONLY GLOBAL_VAR(relay_log_info_file), CMD_LINE(REQUIRED_ARG),
+ IN_FS_CHARSET, DEFAULT(0));
+
+static Sys_var_mybool Sys_relay_log_purge(
+ "relay_log_purge", "if disabled - do not purge relay logs. "
+ "if enabled - purge them as soon as they are no more needed",
+ GLOBAL_VAR(relay_log_purge), CMD_LINE(OPT_ARG), DEFAULT(TRUE));
+
+static Sys_var_mybool Sys_relay_log_recovery(
+ "relay_log_recovery", "Enables automatic relay log recovery "
+ "right after the database startup, which means that the IO Thread "
+ "starts re-fetching from the master right after the last transaction "
+ "processed",
+ GLOBAL_VAR(relay_log_recovery), CMD_LINE(OPT_ARG), DEFAULT(FALSE));
+
+static Sys_var_charptr Sys_slave_load_tmpdir(
+ "slave_load_tmpdir", "The location where the slave should put "
+ "its temporary files when replicating a LOAD DATA INFILE command",
+ READ_ONLY GLOBAL_VAR(slave_load_tmpdir), CMD_LINE(REQUIRED_ARG),
+ IN_FS_CHARSET, DEFAULT(0));
+
+static bool fix_slave_net_timeout(sys_var *self, THD *thd, enum_var_type type)
+{
+ pthread_mutex_lock(&LOCK_active_mi);
+ DBUG_PRINT("info", ("slave_net_timeout=%lu mi->heartbeat_period=%.3f",
+ slave_net_timeout,
+ (active_mi? active_mi->heartbeat_period : 0.0)));
+ if (active_mi && slave_net_timeout < active_mi->heartbeat_period)
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE,
+ "The current value for master_heartbeat_period"
+ " exceeds the new value of `slave_net_timeout' sec."
+ " A sensible value for the period should be"
+ " less than the timeout.");
+ pthread_mutex_unlock(&LOCK_active_mi);
+ return false;
+}
+static Sys_var_ulong Sys_slave_net_timeout(
+ "slave_net_timeout", "Number of seconds to wait for more data "
+ "from a master/slave connection before aborting the read",
+ GLOBAL_VAR(slave_net_timeout), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(1, LONG_TIMEOUT), DEFAULT(SLAVE_NET_TIMEOUT), BLOCK_SIZE(1),
+ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+ ON_UPDATE(fix_slave_net_timeout));
+
+static bool check_slave_skip_counter(sys_var *self, THD *thd, set_var *var)
+{
+ bool result= false;
+ pthread_mutex_lock(&LOCK_active_mi);
+ pthread_mutex_lock(&active_mi->rli.run_lock);
+ if (active_mi->rli.slave_running)
+ {
+ my_message(ER_SLAVE_MUST_STOP, ER(ER_SLAVE_MUST_STOP), MYF(0));
+ result= true;
+ }
+ pthread_mutex_unlock(&active_mi->rli.run_lock);
+ pthread_mutex_unlock(&LOCK_active_mi);
+ return result;
+}
+static bool fix_slave_skip_counter(sys_var *self, THD *thd, enum_var_type type)
+{
+ pthread_mutex_lock(&LOCK_active_mi);
+ pthread_mutex_lock(&active_mi->rli.run_lock);
+ /*
+ The following test should normally never be true as we test this
+ in the check function; To be safe against multiple
+ SQL_SLAVE_SKIP_COUNTER request, we do the check anyway
+ */
+ if (!active_mi->rli.slave_running)
+ {
+ pthread_mutex_lock(&active_mi->rli.data_lock);
+ active_mi->rli.slave_skip_counter= sql_slave_skip_counter;
+ pthread_mutex_unlock(&active_mi->rli.data_lock);
+ }
+ pthread_mutex_unlock(&active_mi->rli.run_lock);
+ pthread_mutex_unlock(&LOCK_active_mi);
+ return 0;
+}
+static Sys_var_uint Sys_slave_skip_counter(
+ "sql_slave_skip_counter", "sql_slave_skip_counter",
+ GLOBAL_VAR(sql_slave_skip_counter), NO_CMD_LINE,
+ VALID_RANGE(0, UINT_MAX), DEFAULT(0), BLOCK_SIZE(1),
+ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_slave_skip_counter),
+ ON_UPDATE(fix_slave_skip_counter));
+
+static Sys_var_charptr Sys_slave_skip_errors(
+ "slave_skip_errors", "Tells the slave thread to continue "
+ "replication when a query event returns an error from the "
+ "provided list",
+ READ_ONLY GLOBAL_VAR(opt_slave_skip_errors), CMD_LINE(REQUIRED_ARG),
+ IN_SYSTEM_CHARSET, DEFAULT(0));
+
+static Sys_var_ulonglong Sys_relay_log_space_limit(
+ "relay_log_space_limit", "Maximum space to use for all relay logs",
+ READ_ONLY GLOBAL_VAR(relay_log_space_limit), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(0, ULONG_MAX), DEFAULT(0), BLOCK_SIZE(1));
+
+static Sys_var_uint Sys_sync_relaylog_period(
+ "sync_relay_log", "Synchronously flush relay log to disk after "
+ "every #th event. Use 0 (default) to disable synchronous flushing",
+ GLOBAL_VAR(sync_relaylog_period), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(0, UINT_MAX), DEFAULT(0), BLOCK_SIZE(1));
+
+static Sys_var_uint Sys_sync_relayloginfo_period(
+ "sync_relay_log_info", "Synchronously flush relay log info "
+ "to disk after every #th transaction. Use 0 (default) to disable "
+ "synchronous flushing",
+ GLOBAL_VAR(sync_relayloginfo_period), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(0, UINT_MAX), DEFAULT(0), BLOCK_SIZE(1));
+#endif
+
+static Sys_var_uint Sys_sync_binlog_period(
+ "sync_binlog", "Synchronously flush binary log to disk after "
+ "every #th event. Use 0 (default) to disable synchronous flushing",
+ GLOBAL_VAR(sync_binlog_period), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(0, UINT_MAX), DEFAULT(0), BLOCK_SIZE(1));
+
+static Sys_var_uint Sys_sync_masterinfo_period(
+ "sync_master_info", "Synchronously flush master info to disk "
+ "after every #th event. Use 0 (default) to disable synchronous flushing",
+ GLOBAL_VAR(sync_masterinfo_period), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(0, UINT_MAX), DEFAULT(0), BLOCK_SIZE(1));
+
+#ifdef HAVE_REPLICATION
+static Sys_var_ulong Sys_slave_trans_retries(
+ "slave_transaction_retries", "Number of times the slave SQL "
+ "thread will retry a transaction in case it failed with a deadlock "
+ "or elapsed lock wait timeout, before giving up and stopping",
+ GLOBAL_VAR(slave_trans_retries), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(0, ULONG_MAX), DEFAULT(10), BLOCK_SIZE(1));
+#endif
+
+static bool check_locale(sys_var *self, THD *thd, set_var *var)
+{
+ if (!var->value)
+ return false;
+
+ MY_LOCALE *locale;
+ char buff[STRING_BUFFER_USUAL_SIZE];
+ if (var->value->result_type() == INT_RESULT)
+ {
+ int lcno= (int)var->value->val_int();
+ if (!(locale= my_locale_by_number(lcno)))
+ {
+ my_error(ER_UNKNOWN_LOCALE, MYF(0), llstr(lcno, buff));
+ return true;
+ }
+ if (check_not_null(self, thd, var))
+ return true;
+ }
+ else // STRING_RESULT
+ {
+ String str(buff, sizeof(buff), system_charset_info), *res;
+ if (!(res=var->value->val_str(&str)))
+ return true;
+ else if (!(locale= my_locale_by_name(res->c_ptr())))
+ {
+ ErrConvString err(res);
+ my_error(ER_UNKNOWN_LOCALE, MYF(0), err.ptr());
+ return true;
+ }
+ }
+
+ var->save_result.ptr= locale;
+
+ if (!locale->errmsgs->errmsgs)
+ {
+ pthread_mutex_lock(&LOCK_error_messages);
+ if (!locale->errmsgs->errmsgs &&
+ read_texts(ERRMSG_FILE, locale->errmsgs->language,
+ &locale->errmsgs->errmsgs,
+ ER_ERROR_LAST - ER_ERROR_FIRST + 1))
+ {
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR,
+ "Can't process error message file for locale '%s'",
+ locale->name);
+ pthread_mutex_unlock(&LOCK_error_messages);
+ return true;
+ }
+ pthread_mutex_unlock(&LOCK_error_messages);
+ }
+ return false;
+}
+static Sys_var_struct Sys_lc_messages(
+ "lc_messages", "Set the language used for the error messages",
+ SESSION_VAR(lc_messages), NO_CMD_LINE,
+ offsetof(MY_LOCALE, name), DEFAULT(&my_default_lc_messages),
+ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_locale));
+
+static Sys_var_struct Sys_lc_time_names(
+ "lc_time_names", "Set the language used for the month "
+ "names and the days of the week",
+ SESSION_VAR(lc_time_names), NO_CMD_LINE,
+ offsetof(MY_LOCALE, name), DEFAULT(&my_default_lc_time_names),
+ NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(check_locale));
+
+static Sys_var_tz Sys_time_zone(
+ "time_zone", "time_zone",
+ SESSION_VAR(time_zone), NO_CMD_LINE,
+ DEFAULT(&default_tz), NO_MUTEX_GUARD, IN_BINLOG);
+
diff --git a/sql/sys_vars.h b/sql/sys_vars.h
new file mode 100644
index 00000000000..bdbbcbbbd59
--- /dev/null
+++ b/sql/sys_vars.h
@@ -0,0 +1,1600 @@
+/* Copyright (C) 2002-2006 MySQL AB, 2009 Sun Microsystems, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+/**
+ @file
+ "private" interface to sys_var - server configuration variables.
+
+ This header is included only by the file that contains declarations
+ of sys_var variables (sys_vars.cc).
+*/
+
+#include "sys_vars_shared.h"
+#include <my_getopt.h>
+#include <my_bit.h>
+#include <my_dir.h>
+#include "keycaches.h"
+
+/*
+ a set of mostly trivial (as in f(X)=X) defines below to make system variable
+ declarations more readable
+*/
+#define VALID_RANGE(X,Y) X,Y
+#define DEFAULT(X) X
+#define BLOCK_SIZE(X) X
+#define GLOBAL_VAR(X) sys_var::GLOBAL, (((char*)&(X))-(char*)&global_system_variables), sizeof(X)
+#define SESSION_VAR(X) sys_var::SESSION, offsetof(SV, X), sizeof(((SV *)0)->X)
+#define SESSION_ONLY(X) sys_var::ONLY_SESSION, offsetof(SV, X), sizeof(((SV *)0)->X)
+#define NO_CMD_LINE CMD_LINE(NO_ARG, -1)
+/*
+ the define below means that there's no *second* mutex guard,
+ LOCK_global_system_variables always guards all system variables
+*/
+#define NO_MUTEX_GUARD ((PolyLock*)0)
+#define IN_BINLOG sys_var::SESSION_VARIABLE_IN_BINLOG
+#define NOT_IN_BINLOG sys_var::VARIABLE_NOT_IN_BINLOG
+#define ON_READ(X) X
+#define ON_CHECK(X) X
+#define ON_UPDATE(X) X
+#define READ_ONLY sys_var::READONLY+
+// this means that Sys_var_charptr initial value was malloc()ed
+#define PREALLOCATED sys_var::ALLOCATED+
+/*
+ Sys_var_bit meaning is reversed, like in
+ @@foreign_key_checks <-> OPTION_NO_FOREIGN_KEY_CHECKS
+*/
+#define REVERSE(X) ~(X)
+#define DEPRECATED(X, Y) X, Y
+
+#define session_var(THD, TYPE) (*(TYPE*)session_var_ptr(THD))
+#define global_var(TYPE) (*(TYPE*)global_var_ptr())
+
+#if SIZEOF_OFF_T > 4 && defined(BIG_TABLES)
+#define GET_HA_ROWS GET_ULL
+#else
+#define GET_HA_ROWS GET_ULONG
+#endif
+
+enum charset_enum {IN_SYSTEM_CHARSET, IN_FS_CHARSET};
+
+static const char *bool_values[3]= {"OFF", "ON", 0};
+TYPELIB bool_typelib={ array_elements(bool_values)-1, "", bool_values, 0 };
+
+/**
+ A small wrapper class to pass getopt arguments as a pair
+ to the Sys_var_* constructors. It improves type safety and helps
+ to catch errors in the argument order.
+*/
+struct CMD_LINE
+{
+ int id;
+ enum get_opt_arg_type arg_type;
+ CMD_LINE(enum get_opt_arg_type getopt_arg_type, int getopt_id=0)
+ : id(getopt_id), arg_type(getopt_arg_type) {}
+};
+
+/**
+ Sys_var_unsigned template is used to generate Sys_var_* classes
+ for variables that represent the value as an unsigned integer.
+ They are Sys_var_uint, Sys_var_ulong, Sys_var_harows, Sys_var_ulonglong.
+
+ An integer variable has a minimal and maximal values, and a "block_size"
+ (any valid value of the variable must be divisible by the block_size).
+
+ Class specific constructor arguments: min, max, block_size
+ Backing store: uint, ulong, ha_rows, ulonglong, depending on the Sys_var_*
+*/
+template <typename T, ulong ARGT, enum enum_mysql_show_type SHOWT>
+class Sys_var_unsigned: public sys_var
+{
+public:
+ Sys_var_unsigned(const char *name_arg,
+ const char *comment, int flag_args, ptrdiff_t off, size_t size,
+ CMD_LINE getopt,
+ T min_val, T max_val, T def_val, uint block_size, PolyLock *lock=0,
+ enum binlog_status_enum binlog_status_arg=VARIABLE_NOT_IN_BINLOG,
+ on_check_function on_check_func=0,
+ on_update_function on_update_func=0,
+ uint deprecated_version=0, const char *substitute=0)
+ : sys_var(&all_sys_vars, name_arg, comment, flag_args, off, getopt.id,
+ getopt.arg_type, SHOWT, def_val, lock, binlog_status_arg,
+ on_check_func, on_update_func, deprecated_version,
+ substitute)
+ {
+ option.var_type= ARGT;
+ option.min_value= min_val;
+ option.max_value= max_val;
+ option.block_size= block_size;
+ option.u_max_value= (uchar**)max_var_ptr();
+ if (max_var_ptr())
+ *max_var_ptr()= max_val;
+ global_var(T)= def_val;
+ DBUG_ASSERT(size == sizeof(T));
+ DBUG_ASSERT(min_val < max_val);
+ DBUG_ASSERT(min_val <= def_val);
+ DBUG_ASSERT(max_val >= def_val);
+ DBUG_ASSERT(block_size > 0);
+ DBUG_ASSERT(def_val % block_size == 0);
+ }
+ bool do_check(THD *thd, set_var *var)
+ {
+ my_bool fixed= FALSE;
+ ulonglong uv;
+ longlong v;
+
+ v= var->value->val_int();
+ if (var->value->unsigned_flag)
+ uv= (ulonglong) v;
+ else
+ uv= (ulonglong) (v < 0 ? 0 : v);
+
+ var->save_result.ulonglong_value=
+ getopt_ull_limit_value(uv, &option, &fixed);
+
+ if (max_var_ptr() && var->save_result.ulonglong_value > *max_var_ptr())
+ var->save_result.ulonglong_value= *max_var_ptr();
+
+ return throw_bounds_warning(thd, name.str,
+ var->save_result.ulonglong_value != uv,
+ var->value->unsigned_flag, v);
+ }
+ bool session_update(THD *thd, set_var *var)
+ {
+ session_var(thd, T)= var->save_result.ulonglong_value;
+ return false;
+ }
+ bool global_update(THD *thd, set_var *var)
+ {
+ global_var(T)= var->save_result.ulonglong_value;
+ return false;
+ }
+ bool check_update_type(Item_result type)
+ { return type != INT_RESULT; }
+ void session_save_default(THD *thd, set_var *var)
+ { var->save_result.ulonglong_value= (ulonglong)*(T*)global_value_ptr(thd, 0); }
+ void global_save_default(THD *thd, set_var *var)
+ { var->save_result.ulonglong_value= option.def_value; }
+ private:
+ T *max_var_ptr()
+ {
+ return scope() == SESSION ? (T*)(((uchar*)&max_system_variables) + offset)
+ : 0;
+ }
+};
+
+typedef Sys_var_unsigned<uint, GET_UINT, SHOW_INT> Sys_var_uint;
+typedef Sys_var_unsigned<ulong, GET_ULONG, SHOW_LONG> Sys_var_ulong;
+typedef Sys_var_unsigned<ha_rows, GET_HA_ROWS, SHOW_HA_ROWS> Sys_var_harows;
+typedef Sys_var_unsigned<ulonglong, GET_ULL, SHOW_LONGLONG> Sys_var_ulonglong;
+
+/**
+ Helper class for variables that take values from a TYPELIB
+*/
+class Sys_var_typelib: public sys_var
+{
+protected:
+ TYPELIB typelib;
+public:
+ Sys_var_typelib(const char *name_arg,
+ const char *comment, int flag_args, ptrdiff_t off,
+ CMD_LINE getopt,
+ SHOW_TYPE show_val_type_arg, const char *values[],
+ ulonglong def_val, PolyLock *lock,
+ enum binlog_status_enum binlog_status_arg,
+ on_check_function on_check_func, on_update_function on_update_func,
+ uint deprecated_version, const char *substitute)
+ : sys_var(&all_sys_vars, name_arg, comment, flag_args, off, getopt.id,
+ getopt.arg_type, show_val_type_arg, def_val, lock,
+ binlog_status_arg, on_check_func,
+ on_update_func, deprecated_version, substitute)
+ {
+ for (typelib.count= 0; values[typelib.count]; typelib.count++) /*no-op */;
+ typelib.name="";
+ typelib.type_names= values;
+ typelib.type_lengths= 0; // only used by Fields_enum and Field_set
+ option.typelib= &typelib;
+ }
+ bool do_check(THD *thd, set_var *var) // works for enums and my_bool
+ {
+ char buff[STRING_BUFFER_USUAL_SIZE];
+ String str(buff, sizeof(buff), system_charset_info), *res;
+
+ if (var->value->result_type() == STRING_RESULT)
+ {
+ if (!(res=var->value->val_str(&str)))
+ return true;
+ else
+ if (!(var->save_result.ulonglong_value=
+ find_type(&typelib, res->ptr(), res->length(), false)))
+ return true;
+ else
+ var->save_result.ulonglong_value--;
+ }
+ else
+ {
+ longlong tmp=var->value->val_int();
+ if (tmp < 0 || tmp >= typelib.count)
+ return true;
+ else
+ var->save_result.ulonglong_value= tmp;
+ }
+
+ return false;
+ }
+ bool check_update_type(Item_result type)
+ { return type != INT_RESULT && type != STRING_RESULT; }
+};
+
+/**
+ The class for ENUM variables - variables that take one value from a fixed
+ list of values.
+
+ Class specific constructor arguments:
+ char* values[] - 0-terminated list of strings of valid values
+
+ Backing store: uint
+
+ @note
+ Do *not* use "enum FOO" variables as a backing store, there is no
+ guarantee that sizeof(enum FOO) == sizeof(uint), there is no guarantee
+ even that sizeof(enum FOO) == sizeof(enum BAR)
+*/
+class Sys_var_enum: public Sys_var_typelib
+{
+public:
+ Sys_var_enum(const char *name_arg,
+ const char *comment, int flag_args, ptrdiff_t off, size_t size,
+ CMD_LINE getopt,
+ const char *values[], uint def_val, PolyLock *lock=0,
+ enum binlog_status_enum binlog_status_arg=VARIABLE_NOT_IN_BINLOG,
+ on_check_function on_check_func=0,
+ on_update_function on_update_func=0,
+ uint deprecated_version=0, const char *substitute=0)
+ : Sys_var_typelib(name_arg, comment, flag_args, off, getopt,
+ SHOW_CHAR, values, def_val, lock,
+ binlog_status_arg, on_check_func, on_update_func,
+ deprecated_version, substitute)
+ {
+ option.var_type= GET_ENUM;
+ global_var(uint)= def_val;
+ DBUG_ASSERT(def_val < typelib.count);
+ DBUG_ASSERT(size == sizeof(uint));
+ }
+ bool session_update(THD *thd, set_var *var)
+ {
+ session_var(thd, uint)= var->save_result.ulonglong_value;
+ return false;
+ }
+ bool global_update(THD *thd, set_var *var)
+ {
+ global_var(uint)= var->save_result.ulonglong_value;
+ return false;
+ }
+ void session_save_default(THD *thd, set_var *var)
+ { var->save_result.ulonglong_value= global_var(uint); }
+ void global_save_default(THD *thd, set_var *var)
+ { var->save_result.ulonglong_value= option.def_value; }
+ uchar *session_value_ptr(THD *thd, LEX_STRING *base)
+ { return (uchar*)typelib.type_names[session_var(thd, uint)]; }
+ uchar *global_value_ptr(THD *thd, LEX_STRING *base)
+ { return (uchar*)typelib.type_names[global_var(uint)]; }
+};
+
+/**
+ The class for boolean variables - a variant of ENUM variables
+ with the fixed list of values of { OFF , ON }
+
+ Backing store: my_bool
+*/
+class Sys_var_mybool: public Sys_var_typelib
+{
+public:
+ Sys_var_mybool(const char *name_arg,
+ const char *comment, int flag_args, ptrdiff_t off, size_t size,
+ CMD_LINE getopt,
+ my_bool def_val, PolyLock *lock=0,
+ enum binlog_status_enum binlog_status_arg=VARIABLE_NOT_IN_BINLOG,
+ on_check_function on_check_func=0,
+ on_update_function on_update_func=0,
+ uint deprecated_version=0, const char *substitute=0)
+ : Sys_var_typelib(name_arg, comment, flag_args, off, getopt,
+ SHOW_MY_BOOL, bool_values, def_val, lock,
+ binlog_status_arg, on_check_func, on_update_func,
+ deprecated_version, substitute)
+ {
+ option.var_type= GET_BOOL;
+ global_var(my_bool)= def_val;
+ DBUG_ASSERT(def_val < 2);
+ DBUG_ASSERT(getopt.arg_type == OPT_ARG || getopt.id == -1);
+ DBUG_ASSERT(size == sizeof(my_bool));
+ }
+ bool session_update(THD *thd, set_var *var)
+ {
+ session_var(thd, my_bool)= var->save_result.ulonglong_value;
+ return false;
+ }
+ bool global_update(THD *thd, set_var *var)
+ {
+ global_var(my_bool)= var->save_result.ulonglong_value;
+ return false;
+ }
+ void session_save_default(THD *thd, set_var *var)
+ { var->save_result.ulonglong_value= (ulonglong)*(my_bool *)global_value_ptr(thd, 0); }
+ void global_save_default(THD *thd, set_var *var)
+ { var->save_result.ulonglong_value= option.def_value; }
+};
+
+/**
+ The class for string variables. The string can be in character_set_filesystem
+ or in character_set_system. The string can be allocated with my_malloc()
+ or not. The state of the initial value is specified in the constructor,
+ after that it's managed automatically. The value of NULL is supported.
+
+ Class specific constructor arguments:
+ enum charset_enum is_os_charset_arg
+
+ Backing store: char*
+
+ @note
+ This class supports only GLOBAL variables, because THD on destruction
+ does not destroy individual members of SV, there's no way to free
+ allocated string variables for every thread.
+*/
+class Sys_var_charptr: public sys_var
+{
+public:
+ Sys_var_charptr(const char *name_arg,
+ const char *comment, int flag_args, ptrdiff_t off, size_t size,
+ CMD_LINE getopt,
+ enum charset_enum is_os_charset_arg,
+ const char *def_val, PolyLock *lock=0,
+ enum binlog_status_enum binlog_status_arg=VARIABLE_NOT_IN_BINLOG,
+ on_check_function on_check_func=0,
+ on_update_function on_update_func=0,
+ uint deprecated_version=0, const char *substitute=0)
+ : sys_var(&all_sys_vars, name_arg, comment, flag_args, off, getopt.id,
+ getopt.arg_type, SHOW_CHAR_PTR, (intptr)def_val,
+ lock, binlog_status_arg, on_check_func, on_update_func,
+ deprecated_version, substitute)
+ {
+ is_os_charset= is_os_charset_arg == IN_FS_CHARSET;
+ /*
+ use GET_STR_ALLOC - if ALLOCATED it must be *always* allocated,
+ otherwise (GET_STR) you'll never know whether to free it or not.
+ (think of an exit because of an error right after my_getopt)
+ */
+ option.var_type= (flags & ALLOCATED) ? GET_STR_ALLOC : GET_STR;
+ global_var(const char*)= def_val;
+ DBUG_ASSERT(scope() == GLOBAL);
+ DBUG_ASSERT(size == sizeof(char *));
+ }
+ ~Sys_var_charptr()
+ {
+ if (flags & ALLOCATED)
+ my_free(global_var(char*), MYF(MY_ALLOW_ZERO_PTR));
+ flags&= ~ALLOCATED;
+ }
+ bool do_check(THD *thd, set_var *var)
+ {
+ char buff[STRING_BUFFER_USUAL_SIZE], buff2[STRING_BUFFER_USUAL_SIZE];
+ String str(buff, sizeof(buff), charset(thd));
+ String str2(buff2, sizeof(buff2), charset(thd)), *res;
+
+ if (!(res=var->value->val_str(&str)))
+ var->save_result.string_value.str= 0;
+ else
+ {
+ uint32 unused;
+ if (String::needs_conversion(res->length(), res->charset(),
+ charset(thd), &unused))
+ {
+ uint errors;
+ str2.copy(res->ptr(), res->length(), res->charset(), charset(thd),
+ &errors);
+ res=&str2;
+
+ }
+ var->save_result.string_value.str= thd->strmake(res->ptr(), res->length());
+ var->save_result.string_value.length= res->length();
+ }
+
+ return false;
+ }
+ bool session_update(THD *thd, set_var *var)
+ {
+ DBUG_ASSERT(FALSE);
+ return true;
+ }
+ bool global_update(THD *thd, set_var *var)
+ {
+ char *new_val, *ptr= var->save_result.string_value.str;
+ size_t len=var->save_result.string_value.length;
+ if (ptr)
+ {
+ new_val= (char*)my_memdup(ptr, len+1, MYF(MY_WME));
+ if (!new_val) return true;
+ new_val[len]=0;
+ }
+ else
+ new_val= 0;
+ if (flags & ALLOCATED)
+ my_free(global_var(char*), MYF(MY_ALLOW_ZERO_PTR));
+ flags|= ALLOCATED;
+ global_var(char*)= new_val;
+ return false;
+ }
+ void session_save_default(THD *thd, set_var *var)
+ { DBUG_ASSERT(FALSE); }
+ void global_save_default(THD *thd, set_var *var)
+ {
+ char *ptr= (char*)(intptr)option.def_value;
+ var->save_result.string_value.str= ptr;
+ var->save_result.string_value.length= ptr ? strlen(ptr) : 0;
+ }
+ bool check_update_type(Item_result type)
+ { return type != STRING_RESULT; }
+};
+
+/**
+ The class for string variables. Useful for strings that aren't necessarily
+ \0-terminated. Otherwise the same as Sys_var_charptr.
+
+ Class specific constructor arguments:
+ enum charset_enum is_os_charset_arg
+
+ Backing store: LEX_STRING
+
+ @note
+ Behaves exactly as Sys_var_charptr, only the backing store is different.
+*/
+class Sys_var_lexstring: public Sys_var_charptr
+{
+public:
+ Sys_var_lexstring(const char *name_arg,
+ const char *comment, int flag_args, ptrdiff_t off, size_t size,
+ CMD_LINE getopt,
+ enum charset_enum is_os_charset_arg,
+ const char *def_val, PolyLock *lock=0,
+ enum binlog_status_enum binlog_status_arg=VARIABLE_NOT_IN_BINLOG,
+ on_check_function on_check_func=0,
+ on_update_function on_update_func=0,
+ uint deprecated_version=0, const char *substitute=0)
+ : Sys_var_charptr(name_arg, comment, flag_args, off, sizeof(char*),
+ getopt, is_os_charset_arg, def_val, lock, binlog_status_arg,
+ on_check_func, on_update_func, deprecated_version, substitute)
+ {
+ global_var(LEX_STRING).length= strlen(def_val);
+ DBUG_ASSERT(size == sizeof(LEX_STRING));
+ *const_cast<SHOW_TYPE*>(&show_val_type)= SHOW_LEX_STRING;
+ }
+ bool global_update(THD *thd, set_var *var)
+ {
+ if (Sys_var_charptr::global_update(thd, var))
+ return true;
+ global_var(LEX_STRING).length= var->save_result.string_value.length;
+ return false;
+ }
+};
+
+#ifndef DBUG_OFF
+/**
+ @@session.dbug and @@global.dbug variables.
+
+ @@dbug variable differs from other variables in one aspect:
+ if its value is not assigned in the session, it "points" to the global
+ value, and so when the global value is changed, the change
+ immediately takes effect in the session.
+
+ This semantics is intentional, to be able to debug one session from
+ another.
+*/
+class Sys_var_dbug: public sys_var
+{
+public:
+ Sys_var_dbug(const char *name_arg,
+ const char *comment, int flag_args,
+ CMD_LINE getopt,
+ const char *def_val, PolyLock *lock=0,
+ enum binlog_status_enum binlog_status_arg=VARIABLE_NOT_IN_BINLOG,
+ on_check_function on_check_func=0,
+ on_update_function on_update_func=0,
+ uint deprecated_version=0, const char *substitute=0)
+ : sys_var(&all_sys_vars, name_arg, comment, flag_args, 0, getopt.id,
+ getopt.arg_type, SHOW_CHAR, (intptr)def_val,
+ lock, binlog_status_arg, on_check_func, on_update_func,
+ deprecated_version, substitute)
+ { option.var_type= GET_NO_ARG; }
+ bool do_check(THD *thd, set_var *var)
+ {
+ char buff[STRING_BUFFER_USUAL_SIZE];
+ String str(buff, sizeof(buff), system_charset_info), *res;
+
+ if (!(res=var->value->val_str(&str)))
+ var->save_result.string_value.str= const_cast<char*>("");
+ else
+ var->save_result.string_value.str= thd->strmake(res->ptr(), res->length());
+ return false;
+ }
+ bool session_update(THD *thd, set_var *var)
+ {
+ const char *val= var->save_result.string_value.str;
+ if (!var->value)
+ DBUG_POP();
+ else
+ DBUG_SET(val);
+ return false;
+ }
+ bool global_update(THD *thd, set_var *var)
+ {
+ const char *val= var->save_result.string_value.str;
+ DBUG_SET_INITIAL(val);
+ return false;
+ }
+ void session_save_default(THD *thd, set_var *var)
+ { }
+ void global_save_default(THD *thd, set_var *var)
+ {
+ char *ptr= (char*)(intptr)option.def_value;
+ var->save_result.string_value.str= ptr;
+ }
+ uchar *session_value_ptr(THD *thd, LEX_STRING *base)
+ {
+ char buf[256];
+ DBUG_EXPLAIN(buf, sizeof(buf));
+ return (uchar*) thd->strdup(buf);
+ }
+ uchar *global_value_ptr(THD *thd, LEX_STRING *base)
+ {
+ char buf[256];
+ DBUG_EXPLAIN_INITIAL(buf, sizeof(buf));
+ return (uchar*) thd->strdup(buf);
+ }
+ bool check_update_type(Item_result type)
+ { return type != STRING_RESULT; }
+};
+#endif
+
+#define KEYCACHE_VAR(X) sys_var::GLOBAL,offsetof(KEY_CACHE, X), sizeof(((KEY_CACHE *)0)->X)
+#define keycache_var_ptr(KC, OFF) (((uchar*)(KC))+(OFF))
+#define keycache_var(KC, OFF) (*(ulonglong*)keycache_var_ptr(KC, OFF))
+typedef bool (*keycache_update_function)(THD *, KEY_CACHE *, ptrdiff_t, ulonglong);
+
+/**
+ The class for keycache_* variables. Supports structured names,
+ keycache_name.variable_name.
+
+ Class specific constructor arguments:
+ everything derived from Sys_var_ulonglong
+
+ Backing store: ulonglong
+
+ @note these variables can be only GLOBAL
+*/
+class Sys_var_keycache: public Sys_var_ulonglong
+{
+ keycache_update_function keycache_update;
+public:
+ Sys_var_keycache(const char *name_arg,
+ const char *comment, int flag_args, ptrdiff_t off, size_t size,
+ CMD_LINE getopt,
+ ulonglong min_val, ulonglong max_val, ulonglong def_val,
+ ulonglong block_size, PolyLock *lock,
+ enum binlog_status_enum binlog_status_arg,
+ on_check_function on_check_func,
+ keycache_update_function on_update_func,
+ uint deprecated_version=0, const char *substitute=0)
+ : Sys_var_ulonglong(name_arg, comment, flag_args, off, size,
+ getopt, min_val, max_val, def_val,
+ block_size, lock, binlog_status_arg, on_check_func, 0,
+ deprecated_version, substitute),
+ keycache_update(on_update_func)
+ {
+ option.var_type|= GET_ASK_ADDR;
+ option.value= (uchar**)1; // crash me, please
+ keycache_var(dflt_key_cache, off)= def_val;
+ DBUG_ASSERT(scope() == GLOBAL);
+ }
+ bool global_update(THD *thd, set_var *var)
+ {
+ ulonglong new_value= var->save_result.ulonglong_value;
+ LEX_STRING *base_name= &var->base;
+ KEY_CACHE *key_cache;
+
+ /* If no basename, assume it's for the key cache named 'default' */
+ if (!base_name->length)
+ base_name= &default_key_cache_base;
+
+ key_cache= get_key_cache(base_name);
+
+ if (!key_cache)
+ { // Key cache didn't exists */
+ if (!new_value) // Tried to delete cache
+ return false; // Ok, nothing to do
+ if (!(key_cache= create_key_cache(base_name->str, base_name->length)))
+ return true;
+ }
+
+ /**
+ Abort if some other thread is changing the key cache
+ @todo This should be changed so that we wait until the previous
+ assignment is done and then do the new assign
+ */
+ if (key_cache->in_init)
+ return true;
+
+ return keycache_update(thd, key_cache, offset, new_value);
+ }
+ uchar *global_value_ptr(THD *thd, LEX_STRING *base)
+ {
+ KEY_CACHE *key_cache= get_key_cache(base);
+ if (!key_cache)
+ key_cache= &zero_key_cache;
+ return keycache_var_ptr(key_cache, offset);
+ }
+};
+
+static bool update_buffer_size(THD *thd, KEY_CACHE *key_cache,
+ ptrdiff_t offset, ulonglong new_value)
+{
+ bool error= false;
+ DBUG_ASSERT(offset == offsetof(KEY_CACHE, param_buff_size));
+
+ if (new_value == 0)
+ {
+ if (key_cache == dflt_key_cache)
+ {
+ my_error(ER_WARN_CANT_DROP_DEFAULT_KEYCACHE, MYF(0));
+ return true;
+ }
+
+ if (key_cache->key_cache_inited) // If initied
+ {
+ /*
+ Move tables using this key cache to the default key cache
+ and clear the old key cache.
+ */
+ key_cache->in_init= 1;
+ pthread_mutex_unlock(&LOCK_global_system_variables);
+ key_cache->param_buff_size= 0;
+ ha_resize_key_cache(key_cache);
+ ha_change_key_cache(key_cache, dflt_key_cache);
+ /*
+ We don't delete the key cache as some running threads my still be in
+ the key cache code with a pointer to the deleted (empty) key cache
+ */
+ pthread_mutex_lock(&LOCK_global_system_variables);
+ key_cache->in_init= 0;
+ }
+ return error;
+ }
+
+ key_cache->param_buff_size= new_value;
+
+ /* If key cache didn't exist initialize it, else resize it */
+ key_cache->in_init= 1;
+ pthread_mutex_unlock(&LOCK_global_system_variables);
+
+ if (!key_cache->key_cache_inited)
+ error= ha_init_key_cache(0, key_cache);
+ else
+ error= ha_resize_key_cache(key_cache);
+
+ pthread_mutex_lock(&LOCK_global_system_variables);
+ key_cache->in_init= 0;
+
+ return error;
+}
+
+static bool update_keycache_param(THD *thd, KEY_CACHE *key_cache,
+ ptrdiff_t offset, ulonglong new_value)
+{
+ bool error= false;
+ DBUG_ASSERT(offset != offsetof(KEY_CACHE, param_buff_size));
+
+ keycache_var(key_cache, offset)= new_value;
+
+ key_cache->in_init= 1;
+ pthread_mutex_unlock(&LOCK_global_system_variables);
+ error= ha_resize_key_cache(key_cache);
+
+ pthread_mutex_lock(&LOCK_global_system_variables);
+ key_cache->in_init= 0;
+
+ return error;
+}
+
+/**
+ The class for floating point variables
+
+ Class specific constructor arguments: min, max
+
+ Backing store: double
+*/
+class Sys_var_double: public sys_var
+{
+public:
+ Sys_var_double(const char *name_arg,
+ const char *comment, int flag_args, ptrdiff_t off, size_t size,
+ CMD_LINE getopt,
+ double min_val, double max_val, double def_val, PolyLock *lock=0,
+ enum binlog_status_enum binlog_status_arg=VARIABLE_NOT_IN_BINLOG,
+ on_check_function on_check_func=0,
+ on_update_function on_update_func=0,
+ uint deprecated_version=0, const char *substitute=0)
+ : sys_var(&all_sys_vars, name_arg, comment, flag_args, off, getopt.id,
+ getopt.arg_type, SHOW_DOUBLE, def_val, lock, binlog_status_arg,
+ on_check_func, on_update_func, deprecated_version, substitute)
+ {
+ option.var_type= GET_DOUBLE;
+ option.min_value= min_val;
+ option.max_value= max_val;
+ global_var(double)= (double)option.def_value;
+ DBUG_ASSERT(min_val < max_val);
+ DBUG_ASSERT(min_val <= def_val);
+ DBUG_ASSERT(max_val >= def_val);
+ DBUG_ASSERT(size == sizeof(double));
+ }
+ bool do_check(THD *thd, set_var *var)
+ {
+ my_bool fixed;
+ double v= var->value->val_real();
+ var->save_result.double_value= getopt_double_limit_value(v, &option, &fixed);
+
+ return throw_bounds_warning(thd, name.str, fixed, v);
+ }
+ bool session_update(THD *thd, set_var *var)
+ {
+ session_var(thd, double)= var->save_result.double_value;
+ return false;
+ }
+ bool global_update(THD *thd, set_var *var)
+ {
+ global_var(double)= var->save_result.double_value;
+ return false;
+ }
+ bool check_update_type(Item_result type)
+ {
+ return type != INT_RESULT && type != REAL_RESULT && type != DECIMAL_RESULT;
+ }
+ void session_save_default(THD *thd, set_var *var)
+ { var->save_result.double_value= global_var(double); }
+ void global_save_default(THD *thd, set_var *var)
+ { var->save_result.double_value= (double)option.def_value; }
+};
+
+/**
+ The class for the @max_user_connections.
+ It's derived from Sys_var_uint, but non-standard session value
+ requires a new class.
+
+ Class specific constructor arguments:
+ everything derived from Sys_var_uint
+
+ Backing store: uint
+*/
+class Sys_var_max_user_conn: public Sys_var_uint
+{
+public:
+ Sys_var_max_user_conn(const char *name_arg,
+ const char *comment, int flag_args, ptrdiff_t off, size_t size,
+ CMD_LINE getopt,
+ uint min_val, uint max_val, uint def_val,
+ uint block_size, PolyLock *lock=0,
+ enum binlog_status_enum binlog_status_arg=VARIABLE_NOT_IN_BINLOG,
+ on_check_function on_check_func=0,
+ on_update_function on_update_func=0,
+ uint deprecated_version=0, const char *substitute=0)
+ : Sys_var_uint(name_arg, comment, SESSION, off, size, getopt,
+ min_val, max_val, def_val, block_size,
+ lock, binlog_status_arg, on_check_func, on_update_func,
+ deprecated_version, substitute)
+ { }
+ uchar *session_value_ptr(THD *thd, LEX_STRING *base)
+ {
+ if (thd->user_connect && thd->user_connect->user_resources.user_conn)
+ return (uchar*) &(thd->user_connect->user_resources.user_conn);
+ return global_value_ptr(thd, base);
+ }
+};
+
+// overflow-safe (1 << X)-1
+#define MAX_SET(X) ((((1UL << ((X)-1))-1) << 1) | 1)
+
+/**
+ The class for flagset variables - a variant of SET that allows in-place
+ editing (turning on/off individual bits). String representations looks like
+ a "flag=val,flag=val,...". Example: @@optimizer_switch
+
+ Class specific constructor arguments:
+ char* values[] - 0-terminated list of strings of valid values
+
+ Backing store: ulonglong
+
+ @note
+ the last value in the values[] array should
+ *always* be the string "default".
+*/
+class Sys_var_flagset: public Sys_var_typelib
+{
+public:
+ Sys_var_flagset(const char *name_arg,
+ const char *comment, int flag_args, ptrdiff_t off, size_t size,
+ CMD_LINE getopt,
+ const char *values[], ulonglong def_val, PolyLock *lock=0,
+ enum binlog_status_enum binlog_status_arg=VARIABLE_NOT_IN_BINLOG,
+ on_check_function on_check_func=0,
+ on_update_function on_update_func=0,
+ uint deprecated_version=0, const char *substitute=0)
+ : Sys_var_typelib(name_arg, comment, flag_args, off, getopt,
+ SHOW_CHAR, values, def_val, lock,
+ binlog_status_arg, on_check_func, on_update_func,
+ deprecated_version, substitute)
+ {
+ option.var_type= GET_FLAGSET;
+ global_var(ulonglong)= def_val;
+ DBUG_ASSERT(typelib.count > 1);
+ DBUG_ASSERT(typelib.count <= 65);
+ DBUG_ASSERT(def_val < MAX_SET(typelib.count));
+ DBUG_ASSERT(strcmp(values[typelib.count-1], "default") == 0);
+ DBUG_ASSERT(size == sizeof(ulonglong));
+ }
+ bool do_check(THD *thd, set_var *var)
+ {
+ char buff[STRING_BUFFER_USUAL_SIZE];
+ String str(buff, sizeof(buff), system_charset_info), *res;
+ ulonglong default_value, current_value;
+ if (var->type == OPT_GLOBAL)
+ {
+ default_value= option.def_value;
+ current_value= global_var(ulonglong);
+ }
+ else
+ {
+ default_value= global_var(ulonglong);
+ current_value= session_var(thd, ulonglong);
+ }
+
+ if (var->value->result_type() == STRING_RESULT)
+ {
+ if (!(res=var->value->val_str(&str)))
+ return true;
+ else
+ {
+ char *error;
+ uint error_len;
+
+ var->save_result.ulonglong_value=
+ find_set_from_flags(&typelib,
+ typelib.count,
+ current_value,
+ default_value,
+ res->ptr(), res->length(),
+ &error, &error_len);
+ if (error)
+ {
+ ErrConvString err(error, error_len, res->charset());
+ my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name.str, err.ptr());
+ return true;
+ }
+ }
+ }
+ else
+ {
+ longlong tmp=var->value->val_int();
+ if ((tmp < 0 && ! var->value->unsigned_flag)
+ || (ulonglong)tmp > MAX_SET(typelib.count))
+ return true;
+ else
+ var->save_result.ulonglong_value= tmp;
+ }
+
+ return false;
+ }
+ bool session_update(THD *thd, set_var *var)
+ {
+ session_var(thd, ulonglong)= var->save_result.ulonglong_value;
+ return false;
+ }
+ bool global_update(THD *thd, set_var *var)
+ {
+ global_var(ulonglong)= var->save_result.ulonglong_value;
+ return false;
+ }
+ void session_save_default(THD *thd, set_var *var)
+ { var->save_result.ulonglong_value= global_var(ulonglong); }
+ void global_save_default(THD *thd, set_var *var)
+ { var->save_result.ulonglong_value= option.def_value; }
+ uchar *session_value_ptr(THD *thd, LEX_STRING *base)
+ {
+ return (uchar*)flagset_to_string(thd, 0, session_var(thd, ulonglong),
+ typelib.type_names);
+ }
+ uchar *global_value_ptr(THD *thd, LEX_STRING *base)
+ {
+ return (uchar*)flagset_to_string(thd, 0, global_var(ulonglong),
+ typelib.type_names);
+ }
+};
+
+/**
+ The class for SET variables - variables taking zero or more values
+ from the given list. Example: @@sql_mode
+
+ Class specific constructor arguments:
+ char* values[] - 0-terminated list of strings of valid values
+
+ Backing store: ulonglong
+*/
+class Sys_var_set: public Sys_var_typelib
+{
+public:
+ Sys_var_set(const char *name_arg,
+ const char *comment, int flag_args, ptrdiff_t off, size_t size,
+ CMD_LINE getopt,
+ const char *values[], ulonglong def_val, PolyLock *lock=0,
+ enum binlog_status_enum binlog_status_arg=VARIABLE_NOT_IN_BINLOG,
+ on_check_function on_check_func=0,
+ on_update_function on_update_func=0,
+ uint deprecated_version=0, const char *substitute=0)
+ : Sys_var_typelib(name_arg, comment, flag_args, off, getopt,
+ SHOW_CHAR, values, def_val, lock,
+ binlog_status_arg, on_check_func, on_update_func,
+ deprecated_version, substitute)
+ {
+ option.var_type= GET_SET;
+ global_var(ulonglong)= def_val;
+ DBUG_ASSERT(typelib.count > 0);
+ DBUG_ASSERT(typelib.count <= 64);
+ DBUG_ASSERT(def_val < MAX_SET(typelib.count));
+ DBUG_ASSERT(size == sizeof(ulonglong));
+ }
+ bool do_check(THD *thd, set_var *var)
+ {
+ char buff[STRING_BUFFER_USUAL_SIZE];
+ String str(buff, sizeof(buff), system_charset_info), *res;
+
+ if (var->value->result_type() == STRING_RESULT)
+ {
+ if (!(res=var->value->val_str(&str)))
+ return true;
+ else
+ {
+ char *error;
+ uint error_len;
+ bool not_used;
+
+ var->save_result.ulonglong_value=
+ find_set(&typelib, res->ptr(), res->length(), NULL,
+ &error, &error_len, &not_used);
+ /*
+ note, we only issue an error if error_len > 0.
+ That is even while empty (zero-length) values are considered
+ errors by find_set(), these errors are ignored here
+ */
+ if (error_len)
+ {
+ ErrConvString err(error, error_len, res->charset());
+ my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name.str, err.ptr());
+ return true;
+ }
+ }
+ }
+ else
+ {
+ longlong tmp=var->value->val_int();
+ if ((tmp < 0 && ! var->value->unsigned_flag)
+ || (ulonglong)tmp > MAX_SET(typelib.count))
+ return true;
+ else
+ var->save_result.ulonglong_value= tmp;
+ }
+
+ return false;
+ }
+ bool session_update(THD *thd, set_var *var)
+ {
+ session_var(thd, ulonglong)= var->save_result.ulonglong_value;
+ return false;
+ }
+ bool global_update(THD *thd, set_var *var)
+ {
+ global_var(ulonglong)= var->save_result.ulonglong_value;
+ return false;
+ }
+ void session_save_default(THD *thd, set_var *var)
+ { var->save_result.ulonglong_value= global_var(ulonglong); }
+ void global_save_default(THD *thd, set_var *var)
+ { var->save_result.ulonglong_value= option.def_value; }
+ uchar *session_value_ptr(THD *thd, LEX_STRING *base)
+ {
+ return (uchar*)set_to_string(thd, 0, session_var(thd, ulonglong),
+ typelib.type_names);
+ }
+ uchar *global_value_ptr(THD *thd, LEX_STRING *base)
+ {
+ return (uchar*)set_to_string(thd, 0, global_var(ulonglong),
+ typelib.type_names);
+ }
+};
+
+/**
+ The class for variables which value is a plugin.
+ Example: @@default_storage_engine
+
+ Class specific constructor arguments:
+ int plugin_type_arg (for example MYSQL_STORAGE_ENGINE_PLUGIN)
+
+ Backing store: plugin_ref
+
+ @note
+ these variables don't support command-line equivalents, any such
+ command-line options should be added manually to my_long_options in mysqld.cc
+*/
+class Sys_var_plugin: public sys_var
+{
+ int plugin_type;
+public:
+ Sys_var_plugin(const char *name_arg,
+ const char *comment, int flag_args, ptrdiff_t off, size_t size,
+ CMD_LINE getopt,
+ int plugin_type_arg, char **def_val, PolyLock *lock=0,
+ enum binlog_status_enum binlog_status_arg=VARIABLE_NOT_IN_BINLOG,
+ on_check_function on_check_func=0,
+ on_update_function on_update_func=0,
+ uint deprecated_version=0, const char *substitute=0)
+ : sys_var(&all_sys_vars, name_arg, comment, flag_args, off, getopt.id,
+ getopt.arg_type, SHOW_CHAR, (intptr)def_val,
+ lock, binlog_status_arg, on_check_func, on_update_func,
+ deprecated_version, substitute),
+ plugin_type(plugin_type_arg)
+ {
+ option.var_type= GET_STR;
+ DBUG_ASSERT(size == sizeof(plugin_ref));
+ DBUG_ASSERT(getopt.id == -1); // force NO_CMD_LINE
+ }
+ bool do_check(THD *thd, set_var *var)
+ {
+ char buff[STRING_BUFFER_USUAL_SIZE];
+ String str(buff,sizeof(buff), system_charset_info), *res;
+ if (!(res=var->value->val_str(&str)))
+ var->save_result.plugin= NULL;
+ else
+ {
+ const LEX_STRING pname= { const_cast<char*>(res->ptr()), res->length() };
+ plugin_ref plugin;
+
+ // special code for storage engines (e.g. to handle historical aliases)
+ if (plugin_type == MYSQL_STORAGE_ENGINE_PLUGIN)
+ plugin= ha_resolve_by_name(thd, &pname);
+ else
+ plugin= my_plugin_lock_by_name(thd, &pname, plugin_type);
+ if (!plugin)
+ {
+ // historically different error code
+ if (plugin_type == MYSQL_STORAGE_ENGINE_PLUGIN)
+ {
+ ErrConvString err(res);
+ my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), err.ptr());
+ }
+ return true;
+ }
+ var->save_result.plugin= plugin;
+ }
+ return false;
+ }
+ void do_update(plugin_ref *valptr, plugin_ref newval)
+ {
+ plugin_ref oldval= *valptr;
+ if (oldval != newval)
+ {
+ *valptr= my_plugin_lock(NULL, &newval);
+ plugin_unlock(NULL, oldval);
+ }
+ }
+ bool session_update(THD *thd, set_var *var)
+ {
+ do_update((plugin_ref*)session_var_ptr(thd),
+ var->save_result.plugin);
+ return false;
+ }
+ bool global_update(THD *thd, set_var *var)
+ {
+ do_update((plugin_ref*)global_var_ptr(),
+ var->save_result.plugin);
+ return false;
+ }
+ void session_save_default(THD *thd, set_var *var)
+ {
+ plugin_ref plugin= global_var(plugin_ref);
+ var->save_result.plugin= my_plugin_lock(thd, &plugin);
+ }
+ void global_save_default(THD *thd, set_var *var)
+ {
+ LEX_STRING pname;
+ pname.str= *(char**)option.def_value;
+ pname.length= strlen(pname.str);
+
+ plugin_ref plugin;
+ if (plugin_type == MYSQL_STORAGE_ENGINE_PLUGIN)
+ plugin= ha_resolve_by_name(thd, &pname);
+ else
+ plugin= my_plugin_lock_by_name(thd, &pname, plugin_type);
+ DBUG_ASSERT(plugin);
+
+ var->save_result.plugin= my_plugin_lock(thd, &plugin);
+ }
+ bool check_update_type(Item_result type)
+ { return type != STRING_RESULT; }
+ uchar *session_value_ptr(THD *thd, LEX_STRING *base)
+ {
+ plugin_ref plugin= session_var(thd, plugin_ref);
+ return (uchar*)(plugin ? thd->strmake(plugin_name(plugin)->str,
+ plugin_name(plugin)->length) : 0);
+ }
+ uchar *global_value_ptr(THD *thd, LEX_STRING *base)
+ {
+ plugin_ref plugin= global_var(plugin_ref);
+ return (uchar*)(plugin ? thd->strmake(plugin_name(plugin)->str,
+ plugin_name(plugin)->length) : 0);
+ }
+};
+
+#if defined(ENABLED_DEBUG_SYNC)
+/**
+ The class for @@debug_sync session-only variable
+*/
+class Sys_var_debug_sync :public sys_var
+{
+public:
+ Sys_var_debug_sync(const char *name_arg,
+ const char *comment, int flag_args,
+ CMD_LINE getopt,
+ const char *def_val, PolyLock *lock=0,
+ enum binlog_status_enum binlog_status_arg=VARIABLE_NOT_IN_BINLOG,
+ on_check_function on_check_func=0,
+ on_update_function on_update_func=0,
+ uint deprecated_version=0, const char *substitute=0)
+ : sys_var(&all_sys_vars, name_arg, comment, flag_args, 0, getopt.id,
+ getopt.arg_type, SHOW_CHAR, (intptr)def_val,
+ lock, binlog_status_arg, on_check_func, on_update_func,
+ deprecated_version, substitute)
+ {
+ DBUG_ASSERT(scope() == ONLY_SESSION);
+ option.var_type= GET_NO_ARG;
+ }
+ bool do_check(THD *thd, set_var *var)
+ {
+ char buff[STRING_BUFFER_USUAL_SIZE];
+ String str(buff, sizeof(buff), system_charset_info), *res;
+
+ if (!(res=var->value->val_str(&str)))
+ var->save_result.string_value.str= const_cast<char*>("");
+ else
+ var->save_result.string_value.str= thd->strmake(res->ptr(), res->length());
+ return false;
+ }
+ bool session_update(THD *thd, set_var *var)
+ {
+ extern bool debug_sync_update(THD *thd, char *val_str);
+ return debug_sync_update(thd, var->save_result.string_value.str);
+ }
+ bool global_update(THD *thd, set_var *var)
+ {
+ DBUG_ASSERT(FALSE);
+ return true;
+ }
+ void session_save_default(THD *thd, set_var *var)
+ {
+ var->save_result.string_value.str= const_cast<char*>("");
+ var->save_result.string_value.length= 0;
+ }
+ void global_save_default(THD *thd, set_var *var)
+ {
+ DBUG_ASSERT(FALSE);
+ }
+ uchar *session_value_ptr(THD *thd, LEX_STRING *base)
+ {
+ extern uchar *debug_sync_value_ptr(THD *thd);
+ return debug_sync_value_ptr(thd);
+ }
+ uchar *global_value_ptr(THD *thd, LEX_STRING *base)
+ {
+ DBUG_ASSERT(FALSE);
+ return 0;
+ }
+ bool check_update_type(Item_result type)
+ { return type != STRING_RESULT; }
+};
+#endif /* defined(ENABLED_DEBUG_SYNC) */
+
+/**
+ The class for bit variables - a variant of boolean that stores the value
+ in a bit.
+
+ Class specific constructor arguments:
+ ulonglong bitmask_arg - the mask for the bit to set in the ulonglong
+ backing store
+
+ Backing store: ulonglong
+
+ @note
+ This class supports the "reverse" semantics, when the value of the bit
+ being 0 corresponds to the value of variable being set. To activate it
+ use REVERSE(bitmask) instead of simply bitmask in the constructor.
+
+ @note
+ variables of this class cannot be set from the command line as
+ my_getopt does not support bits.
+*/
+class Sys_var_bit: public Sys_var_typelib
+{
+ ulonglong bitmask;
+ bool reverse_semantics;
+ void set(uchar *ptr, ulonglong value)
+ {
+ if ((value != 0) ^ reverse_semantics)
+ (*(ulonglong *)ptr)|= bitmask;
+ else
+ (*(ulonglong *)ptr)&= ~bitmask;
+ }
+public:
+ Sys_var_bit(const char *name_arg,
+ const char *comment, int flag_args, ptrdiff_t off, size_t size,
+ CMD_LINE getopt,
+ ulonglong bitmask_arg, my_bool def_val, PolyLock *lock=0,
+ enum binlog_status_enum binlog_status_arg=VARIABLE_NOT_IN_BINLOG,
+ on_check_function on_check_func=0,
+ on_update_function on_update_func=0,
+ uint deprecated_version=0, const char *substitute=0)
+ : Sys_var_typelib(name_arg, comment, flag_args, off, getopt,
+ SHOW_MY_BOOL, bool_values, def_val, lock,
+ binlog_status_arg, on_check_func, on_update_func,
+ deprecated_version, substitute)
+ {
+ option.var_type= GET_BOOL;
+ reverse_semantics= my_count_bits(bitmask_arg) > 1;
+ bitmask= reverse_semantics ? ~bitmask_arg : bitmask_arg;
+ set(global_var_ptr(), def_val);
+ DBUG_ASSERT(def_val < 2);
+ DBUG_ASSERT(getopt.id == -1); // force NO_CMD_LINE
+ DBUG_ASSERT(size == sizeof(ulonglong));
+ }
+ bool session_update(THD *thd, set_var *var)
+ {
+ set(session_var_ptr(thd), var->save_result.ulonglong_value);
+ return false;
+ }
+ bool global_update(THD *thd, set_var *var)
+ {
+ set(global_var_ptr(), var->save_result.ulonglong_value);
+ return false;
+ }
+ void session_save_default(THD *thd, set_var *var)
+ { var->save_result.ulonglong_value= global_var(ulonglong) & bitmask; }
+ void global_save_default(THD *thd, set_var *var)
+ { var->save_result.ulonglong_value= option.def_value; }
+ uchar *session_value_ptr(THD *thd, LEX_STRING *base)
+ {
+ thd->sys_var_tmp.my_bool_value= reverse_semantics ^
+ ((session_var(thd, ulonglong) & bitmask) != 0);
+ return (uchar*) &thd->sys_var_tmp.my_bool_value;
+ }
+ uchar *global_value_ptr(THD *thd, LEX_STRING *base)
+ {
+ thd->sys_var_tmp.my_bool_value= reverse_semantics ^
+ ((global_var(ulonglong) & bitmask) != 0);
+ return (uchar*) &thd->sys_var_tmp.my_bool_value;
+ }
+};
+
+/**
+ The class for variables that have a special meaning for a session,
+ such as @@timestamp or @@rnd_seed1, their values typically cannot be read
+ from SV structure, and a special "read" callback is provided.
+
+ Class specific constructor arguments:
+ everything derived from Sys_var_ulonglong
+ session_special_read_function read_func_arg
+
+ Backing store: ulonglong
+
+ @note
+ These variables are session-only, global or command-line equivalents
+ are not supported as they're generally meaningless.
+*/
+class Sys_var_session_special: public Sys_var_ulonglong
+{
+ typedef bool (*session_special_update_function)(THD *thd, set_var *var);
+ typedef ulonglong (*session_special_read_function)(THD *thd);
+
+ session_special_read_function read_func;
+ session_special_update_function update_func;
+public:
+ Sys_var_session_special(const char *name_arg,
+ const char *comment, int flag_args,
+ CMD_LINE getopt,
+ ulonglong min_val, ulonglong max_val, ulonglong block_size,
+ PolyLock *lock, enum binlog_status_enum binlog_status_arg,
+ on_check_function on_check_func,
+ session_special_update_function update_func_arg,
+ session_special_read_function read_func_arg,
+ uint deprecated_version=0, const char *substitute=0)
+ : Sys_var_ulonglong(name_arg, comment, flag_args, 0,
+ sizeof(ulonglong), getopt, min_val,
+ max_val, 0, block_size, lock, binlog_status_arg, on_check_func, 0,
+ deprecated_version, substitute),
+ read_func(read_func_arg), update_func(update_func_arg)
+ {
+ DBUG_ASSERT(scope() == ONLY_SESSION);
+ DBUG_ASSERT(getopt.id == -1); // NO_CMD_LINE, because the offset is fake
+ }
+ bool session_update(THD *thd, set_var *var)
+ { return update_func(thd, var); }
+ bool global_update(THD *thd, set_var *var)
+ {
+ DBUG_ASSERT(FALSE);
+ return true;
+ }
+ void session_save_default(THD *thd, set_var *var)
+ { var->value= 0; }
+ void global_save_default(THD *thd, set_var *var)
+ { DBUG_ASSERT(FALSE); }
+ uchar *session_value_ptr(THD *thd, LEX_STRING *base)
+ {
+ thd->sys_var_tmp.ulonglong_value= read_func(thd);
+ return (uchar*) &thd->sys_var_tmp.ulonglong_value;
+ }
+ uchar *global_value_ptr(THD *thd, LEX_STRING *base)
+ {
+ DBUG_ASSERT(FALSE);
+ return 0;
+ }
+};
+
+/**
+ The class for read-only variables that show whether a particular
+ feature is supported by the server. Example: have_compression
+
+ Backing store: enum SHOW_COMP_OPTION
+
+ @note
+ These variables are necessarily read-only, only global, and have no
+ command-line equivalent.
+*/
+class Sys_var_have: public sys_var
+{
+public:
+ Sys_var_have(const char *name_arg,
+ const char *comment, int flag_args, ptrdiff_t off, size_t size,
+ CMD_LINE getopt,
+ PolyLock *lock=0,
+ enum binlog_status_enum binlog_status_arg=VARIABLE_NOT_IN_BINLOG,
+ on_check_function on_check_func=0,
+ on_update_function on_update_func=0,
+ uint deprecated_version=0, const char *substitute=0)
+ : sys_var(&all_sys_vars, name_arg, comment, flag_args, off, getopt.id,
+ getopt.arg_type, SHOW_CHAR, 0,
+ lock, binlog_status_arg, on_check_func, on_update_func,
+ deprecated_version, substitute)
+ {
+ DBUG_ASSERT(scope() == GLOBAL);
+ DBUG_ASSERT(getopt.id == -1);
+ DBUG_ASSERT(lock == 0);
+ DBUG_ASSERT(binlog_status_arg == VARIABLE_NOT_IN_BINLOG);
+ DBUG_ASSERT(is_readonly());
+ DBUG_ASSERT(on_update == 0);
+ DBUG_ASSERT(size == sizeof(enum SHOW_COMP_OPTION));
+ }
+ bool do_check(THD *thd, set_var *var) {
+ DBUG_ASSERT(FALSE);
+ return true;
+ }
+ bool session_update(THD *thd, set_var *var)
+ {
+ DBUG_ASSERT(FALSE);
+ return true;
+ }
+ bool global_update(THD *thd, set_var *var)
+ {
+ DBUG_ASSERT(FALSE);
+ return true;
+ }
+ void session_save_default(THD *thd, set_var *var) { }
+ void global_save_default(THD *thd, set_var *var) { }
+ uchar *session_value_ptr(THD *thd, LEX_STRING *base)
+ {
+ DBUG_ASSERT(FALSE);
+ return 0;
+ }
+ uchar *global_value_ptr(THD *thd, LEX_STRING *base)
+ {
+ return (uchar*)show_comp_option_name[global_var(enum SHOW_COMP_OPTION)];
+ }
+ bool check_update_type(Item_result type) { return false; }
+};
+
+/**
+ Generic class for variables for storing entities that are internally
+ represented as structures, have names, and possibly can be referred to by
+ numbers. Examples: character sets, collations, locales,
+
+ Class specific constructor arguments:
+ ptrdiff_t name_offset - offset of the 'name' field in the structure
+
+ Backing store: void*
+
+ @note
+ As every such a structure requires special treatment from my_getopt,
+ these variables don't support command-line equivalents, any such
+ command-line options should be added manually to my_long_options in mysqld.cc
+*/
+class Sys_var_struct: public sys_var
+{
+ ptrdiff_t name_offset; // offset to the 'name' property in the structure
+public:
+ Sys_var_struct(const char *name_arg,
+ const char *comment, int flag_args, ptrdiff_t off, size_t size,
+ CMD_LINE getopt,
+ ptrdiff_t name_off, void *def_val, PolyLock *lock=0,
+ enum binlog_status_enum binlog_status_arg=VARIABLE_NOT_IN_BINLOG,
+ on_check_function on_check_func=0,
+ on_update_function on_update_func=0,
+ uint deprecated_version=0, const char *substitute=0)
+ : sys_var(&all_sys_vars, name_arg, comment, flag_args, off, getopt.id,
+ getopt.arg_type, SHOW_CHAR, (intptr)def_val,
+ lock, binlog_status_arg, on_check_func, on_update_func,
+ deprecated_version, substitute), name_offset(name_off)
+ {
+ option.var_type= GET_STR;
+ /*
+ struct variables are special on the command line - often (e.g. for
+ charsets) the name cannot be immediately resolved, but only after all
+ options (in particular, basedir) are parsed.
+
+ thus all struct command-line options should be added manually
+ to my_long_options in mysqld.cc
+ */
+ DBUG_ASSERT(getopt.id == -1);
+ DBUG_ASSERT(size == sizeof(void *));
+ }
+ bool do_check(THD *thd, set_var *var)
+ { return false; }
+ bool session_update(THD *thd, set_var *var)
+ {
+ session_var(thd, void*)= var->save_result.ptr;
+ return false;
+ }
+ bool global_update(THD *thd, set_var *var)
+ {
+ global_var(void*)= var->save_result.ptr;
+ return false;
+ }
+ void session_save_default(THD *thd, set_var *var)
+ { var->save_result.ptr= global_var(void*); }
+ void global_save_default(THD *thd, set_var *var)
+ { var->save_result.ptr= *(void**)option.def_value; }
+ bool check_update_type(Item_result type)
+ { return type != INT_RESULT && type != STRING_RESULT; }
+ uchar *session_value_ptr(THD *thd, LEX_STRING *base)
+ {
+ uchar *ptr= session_var(thd, uchar*);
+ return ptr ? *(uchar**)(ptr+name_offset) : 0;
+ }
+ uchar *global_value_ptr(THD *thd, LEX_STRING *base)
+ {
+ uchar *ptr= global_var(uchar*);
+ return ptr ? *(uchar**)(ptr+name_offset) : 0;
+ }
+};
+
+/**
+ The class for variables that store time zones
+
+ Backing store: Time_zone*
+
+ @note
+ Time zones cannot be supported directly by my_getopt, thus
+ these variables don't support command-line equivalents, any such
+ command-line options should be added manually to my_long_options in mysqld.cc
+*/
+class Sys_var_tz: public sys_var
+{
+public:
+ Sys_var_tz(const char *name_arg,
+ const char *comment, int flag_args, ptrdiff_t off, size_t size,
+ CMD_LINE getopt,
+ Time_zone **def_val, PolyLock *lock=0,
+ enum binlog_status_enum binlog_status_arg=VARIABLE_NOT_IN_BINLOG,
+ on_check_function on_check_func=0,
+ on_update_function on_update_func=0,
+ uint deprecated_version=0, const char *substitute=0)
+ : sys_var(&all_sys_vars, name_arg, comment, flag_args, off, getopt.id,
+ getopt.arg_type, SHOW_CHAR, (intptr)def_val,
+ lock, binlog_status_arg, on_check_func, on_update_func,
+ deprecated_version, substitute)
+ {
+ DBUG_ASSERT(getopt.id == -1);
+ DBUG_ASSERT(size == sizeof(Time_zone *));
+ }
+ bool do_check(THD *thd, set_var *var)
+ {
+ char buff[MAX_TIME_ZONE_NAME_LENGTH];
+ String str(buff, sizeof(buff), &my_charset_latin1);
+ String *res= var->value->val_str(&str);
+
+ if (!res)
+ return true;
+
+ if (!(var->save_result.time_zone= my_tz_find(thd, res)))
+ {
+ ErrConvString err(res);
+ my_error(ER_UNKNOWN_TIME_ZONE, MYF(0), err.ptr());
+ return true;
+ }
+ return false;
+ }
+ bool session_update(THD *thd, set_var *var)
+ {
+ session_var(thd, Time_zone*)= var->save_result.time_zone;
+ return false;
+ }
+ bool global_update(THD *thd, set_var *var)
+ {
+ global_var(Time_zone*)= var->save_result.time_zone;
+ return false;
+ }
+ void session_save_default(THD *thd, set_var *var)
+ {
+ var->save_result.time_zone= global_var(Time_zone*);
+ }
+ void global_save_default(THD *thd, set_var *var)
+ {
+ var->save_result.time_zone=
+ *(Time_zone**)(intptr)option.def_value;
+ }
+ uchar *session_value_ptr(THD *thd, LEX_STRING *base)
+ {
+ /*
+ This is an ugly fix for replication: we don't replicate properly queries
+ invoking system variables' values to update tables; but
+ CONVERT_TZ(,,@@session.time_zone) is so popular that we make it
+ replicable (i.e. we tell the binlog code to store the session
+ timezone). If it's the global value which was used we can't replicate
+ (binlog code stores session value only).
+ */
+ thd->time_zone_used= 1;
+ return (uchar *)(session_var(thd, Time_zone*)->get_name()->ptr());
+ }
+ uchar *global_value_ptr(THD *thd, LEX_STRING *base)
+ {
+ return (uchar *)(global_var(Time_zone*)->get_name()->ptr());
+ }
+ bool check_update_type(Item_result type)
+ { return type != STRING_RESULT; }
+};
+
+/****************************************************************************
+ Used templates
+****************************************************************************/
+
+#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
+template class List<set_var_base>;
+template class List_iterator_fast<set_var_base>;
+template class Sys_var_unsigned<uint, GET_UINT, SHOW_INT>;
+template class Sys_var_unsigned<ulong, GET_ULONG, SHOW_LONG>;
+template class Sys_var_unsigned<ha_rows, GET_HA_ROWS, SHOW_HA_ROWS>;
+template class Sys_var_unsigned<ulonglong, GET_ULL, SHOW_LONGLONG>;
+#endif
+
diff --git a/sql/sys_vars_shared.h b/sql/sys_vars_shared.h
new file mode 100644
index 00000000000..e996fdba52e
--- /dev/null
+++ b/sql/sys_vars_shared.h
@@ -0,0 +1,81 @@
+/* Copyright (C) 2002-2006 MySQL AB, 2009 Sun Microsystems, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+/**
+ @file
+ "protected" interface to sys_var - server configuration variables.
+
+ This header is included by files implementing support and utility
+ functions of sys_var's (set_var.cc) and files implementing
+ classes in the sys_var hierarchy (sql_plugin.cc)
+*/
+
+#include <mysql_priv.h>
+#include "set_var.h"
+
+extern bool throw_bounds_warning(THD *thd, const char *name,
+ bool fixed, bool is_unsigned, longlong v);
+extern bool throw_bounds_warning(THD *thd, const char *name, bool fixed,
+ double v);
+extern sys_var *intern_find_sys_var(const char *str, uint length);
+
+extern sys_var_chain all_sys_vars;
+
+/** wrapper to hide a mutex and an rwlock under a common interface */
+class PolyLock
+{
+public:
+ virtual void rdlock()= 0;
+ virtual void wrlock()= 0;
+ virtual void unlock()= 0;
+ virtual ~PolyLock() {}
+};
+
+class PolyLock_mutex: public PolyLock
+{
+ pthread_mutex_t *mutex;
+public:
+ PolyLock_mutex(pthread_mutex_t *arg): mutex(arg) {}
+ void rdlock() { pthread_mutex_lock(mutex); }
+ void wrlock() { pthread_mutex_lock(mutex); }
+ void unlock() { pthread_mutex_unlock(mutex); }
+};
+
+class PolyLock_rwlock: public PolyLock
+{
+ rw_lock_t *rwlock;
+public:
+ PolyLock_rwlock(rw_lock_t *arg): rwlock(arg) {}
+ void rdlock() { rw_rdlock(rwlock); }
+ void wrlock() { rw_wrlock(rwlock); }
+ void unlock() { rw_unlock(rwlock); }
+};
+
+class AutoWLock
+{
+ PolyLock *lock;
+public:
+ AutoWLock(PolyLock *l) : lock(l) { if (lock) lock->wrlock(); }
+ ~AutoWLock() { if (lock) lock->unlock(); }
+};
+
+class AutoRLock
+{
+ PolyLock *lock;
+public:
+ AutoRLock(PolyLock *l) : lock(l) { if (lock) lock->rdlock(); }
+ ~AutoRLock() { if (lock) lock->unlock(); }
+};
+
diff --git a/sql/table.cc b/sql/table.cc
index 0f68bb7c29e..eef03955183 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -1406,12 +1406,6 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
keyinfo->extra_length+=HA_KEY_BLOB_LENGTH;
key_part->store_length+=HA_KEY_BLOB_LENGTH;
keyinfo->key_length+= HA_KEY_BLOB_LENGTH;
- /*
- Mark that there may be many matching values for one key
- combination ('a', 'a ', 'a '...)
- */
- if (!(field->flags & BINARY_FLAG))
- keyinfo->flags|= HA_END_SPACE_KEY;
}
if (field->type() == MYSQL_TYPE_BIT)
key_part->key_part_flag|= HA_BIT_PART;
diff --git a/sql/tztime.cc b/sql/tztime.cc
index dbed1a16982..0784b73f353 100644
--- a/sql/tztime.cc
+++ b/sql/tztime.cc
@@ -1756,6 +1756,10 @@ end:
my_pthread_setspecific_ptr(THR_THD, 0);
my_pthread_setspecific_ptr(THR_MALLOC, 0);
}
+
+ default_tz= default_tz_name ? global_system_variables.time_zone
+ : my_tz_SYSTEM;
+
DBUG_RETURN(return_val);
}
diff --git a/sql/unireg.h b/sql/unireg.h
index 80c6ad23907..006ffff5d52 100644
--- a/sql/unireg.h
+++ b/sql/unireg.h
@@ -93,8 +93,8 @@
#define MAX_SELECT_NESTING (sizeof(nesting_map)*8-1)
-#define MAX_SORT_MEMORY (2048*1024-MALLOC_OVERHEAD)
-#define MIN_SORT_MEMORY (32*1024-MALLOC_OVERHEAD)
+#define MAX_SORT_MEMORY 2048*1024
+#define MIN_SORT_MEMORY 32*1024
/* Memory allocated when parsing a statement / saving a statement */
#define MEM_ROOT_BLOCK_SIZE 8192
diff --git a/storage/heap/hp_create.c b/storage/heap/hp_create.c
index 3f651d1573c..85e632e5aad 100644
--- a/storage/heap/hp_create.c
+++ b/storage/heap/hp_create.c
@@ -85,8 +85,6 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
keyinfo->seg[j].type= HA_KEYTYPE_VARTEXT1;
/* fall_through */
case HA_KEYTYPE_VARTEXT1:
- if (!my_binary_compare(keyinfo->seg[j].charset))
- keyinfo->flag|= HA_END_SPACE_KEY;
keyinfo->flag|= HA_VAR_LENGTH_KEY;
length+= 2;
/* Save number of bytes used to store length */
@@ -96,8 +94,6 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
/* Case-insensitiveness is handled in coll->hash_sort */
/* fall_through */
case HA_KEYTYPE_VARTEXT2:
- if (!my_binary_compare(keyinfo->seg[j].charset))
- keyinfo->flag|= HA_END_SPACE_KEY;
keyinfo->flag|= HA_VAR_LENGTH_KEY;
length+= 2;
/* Save number of bytes used to store length */
@@ -111,8 +107,6 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
default:
break;
}
- if (keyinfo->seg[j].flag & HA_END_SPACE_ARE_EQUAL)
- keyinfo->flag|= HA_END_SPACE_KEY;
}
keyinfo->length= length;
length+= keyinfo->rb_tree.size_of_element +
diff --git a/storage/heap/hp_rkey.c b/storage/heap/hp_rkey.c
index 6eeac6acd7b..27d1114770e 100644
--- a/storage/heap/hp_rkey.c
+++ b/storage/heap/hp_rkey.c
@@ -63,7 +63,7 @@ int heap_rkey(HP_INFO *info, uchar *record, int inx, const uchar *key,
info->update= 0;
DBUG_RETURN(my_errno);
}
- if (!(keyinfo->flag & HA_NOSAME) || (keyinfo->flag & HA_END_SPACE_KEY))
+ if (!(keyinfo->flag & HA_NOSAME))
memcpy(info->lastkey, key, (size_t) keyinfo->length);
}
memcpy(record, pos, (size_t) share->reclength);
diff --git a/storage/myisam/ft_parser.c b/storage/myisam/ft_parser.c
index 4cde3834ed7..8f5779b04ee 100644
--- a/storage/myisam/ft_parser.c
+++ b/storage/myisam/ft_parser.c
@@ -83,10 +83,10 @@ my_bool ft_boolean_check_syntax_string(const uchar *str)
uint i, j;
if (!str ||
- (strlen((char*) str)+1 != sizeof(ft_boolean_syntax)) ||
+ (strlen((char*) str)+1 != sizeof(DEFAULT_FTB_SYNTAX)) ||
(str[0] != ' ' && str[1] != ' '))
return 1;
- for (i=0; i<sizeof(ft_boolean_syntax); i++)
+ for (i=0; i<sizeof(DEFAULT_FTB_SYNTAX); i++)
{
/* limiting to 7-bit ascii only */
if ((unsigned char)(str[i]) > 127 || my_isalnum(default_charset_info, str[i]))
@@ -127,7 +127,6 @@ uchar ft_get_word(CHARSET_INFO *cs, uchar **start, uchar *end,
break;
if (*doc == FTB_RQUOT && param->quot)
{
- param->quot= (char*) doc;
*start=doc+1;
param->type= FT_TOKEN_RIGHT_PAREN;
goto ret;
@@ -139,7 +138,7 @@ uchar ft_get_word(CHARSET_INFO *cs, uchar **start, uchar *end,
/* param->prev=' '; */
*start=doc+1;
if (*doc == FTB_LQUOT)
- param->quot= (char*) *start;
+ param->quot= (char*) 1;
param->type= (*doc == FTB_RBR ? FT_TOKEN_RIGHT_PAREN : FT_TOKEN_LEFT_PAREN);
goto ret;
}
@@ -193,7 +192,6 @@ uchar ft_get_word(CHARSET_INFO *cs, uchar **start, uchar *end,
if (param->quot)
{
*start= doc;
- param->quot= (char*) doc;
param->type= 3; /* FT_RBR */
goto ret;
}
diff --git a/storage/myisam/ft_static.c b/storage/myisam/ft_static.c
index 16cbfa1dada..78fbc5781e9 100644
--- a/storage/myisam/ft_static.c
+++ b/storage/myisam/ft_static.c
@@ -17,12 +17,12 @@
#include "ftdefs.h"
-ulong ft_min_word_len=4;
-ulong ft_max_word_len=HA_FT_MAXCHARLEN;
-ulong ft_query_expansion_limit=5;
-char ft_boolean_syntax[]="+ -><()~*:\"\"&|";
+ulong ft_min_word_len= 4;
+ulong ft_max_word_len= HA_FT_MAXCHARLEN;
+ulong ft_query_expansion_limit= 5;
+const char *ft_boolean_syntax= DEFAULT_FTB_SYNTAX;
-const HA_KEYSEG ft_keysegs[FT_SEGS]={
+const HA_KEYSEG ft_keysegs[FT_SEGS]= {
{
0, /* charset */
HA_FT_WLEN, /* start */
@@ -45,11 +45,11 @@ const HA_KEYSEG ft_keysegs[FT_SEGS]={
}
};
-const struct _ft_vft _ft_vft_nlq = {
+const struct _ft_vft _ft_vft_nlq= {
ft_nlq_read_next, ft_nlq_find_relevance, ft_nlq_close_search,
ft_nlq_get_relevance, ft_nlq_reinit_search
};
-const struct _ft_vft _ft_vft_boolean = {
+const struct _ft_vft _ft_vft_boolean= {
ft_boolean_read_next, ft_boolean_find_relevance, ft_boolean_close_search,
ft_boolean_get_relevance, ft_boolean_reinit_search
};
@@ -68,8 +68,8 @@ FT_INFO *ft_init_search(uint flags, void *info, uint keynr,
return res;
}
-const char *ft_stopword_file = 0;
-const char *ft_precompiled_stopwords[] = {
+const char *ft_stopword_file= 0;
+const char *ft_precompiled_stopwords[]= {
#ifdef COMPILE_STOPWORDS_IN
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index 33678e9677b..d09eefda463 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -30,11 +30,12 @@
#include "myisamdef.h"
#include "rt_index.h"
-ulong myisam_recover_options= HA_RECOVER_NONE;
+ulonglong myisam_recover_options;
+static ulong opt_myisam_block_size;
/* bits in myisam_recover_options */
const char *myisam_recover_names[] =
-{ "DEFAULT", "BACKUP", "FORCE", "QUICK", NullS};
+{ "DEFAULT", "BACKUP", "FORCE", "QUICK", "OFF", NullS};
TYPELIB myisam_recover_typelib= {array_elements(myisam_recover_names)-1,"",
myisam_recover_names, NULL};
@@ -44,6 +45,54 @@ TYPELIB myisam_stats_method_typelib= {
array_elements(myisam_stats_method_names) - 1, "",
myisam_stats_method_names, NULL};
+static MYSQL_SYSVAR_ULONG(block_size, opt_myisam_block_size,
+ PLUGIN_VAR_NOSYSVAR | PLUGIN_VAR_RQCMDARG,
+ "Block size to be used for MyISAM index pages", NULL, NULL,
+ MI_KEY_BLOCK_LENGTH, MI_MIN_KEY_BLOCK_LENGTH, MI_MAX_KEY_BLOCK_LENGTH,
+ MI_MIN_KEY_BLOCK_LENGTH);
+
+static MYSQL_SYSVAR_ULONG(data_pointer_size, myisam_data_pointer_size,
+ PLUGIN_VAR_RQCMDARG, "Default pointer size to be used for MyISAM tables",
+ NULL, NULL, 6, 2, 7, 1);
+
+#define MB (1024*1024)
+static MYSQL_SYSVAR_ULONGLONG(max_sort_file_size, myisam_max_temp_length,
+ PLUGIN_VAR_RQCMDARG, "Don't use the fast sort index method to created "
+ "index if the temporary file would get bigger than this", NULL, NULL,
+ LONG_MAX/MB*MB, 0, MAX_FILE_SIZE, MB);
+
+static MYSQL_SYSVAR_SET(recover_options, myisam_recover_options,
+ PLUGIN_VAR_OPCMDARG|PLUGIN_VAR_READONLY,
+ "Syntax: myisam-recover-options[=option[,option...]], where option can be "
+ "DEFAULT, BACKUP, FORCE, QUICK, or OFF",
+ NULL, NULL, 0, &myisam_recover_typelib);
+
+static MYSQL_THDVAR_ULONG(repair_threads, PLUGIN_VAR_RQCMDARG,
+ "If larger than 1, when repairing a MyISAM table all indexes will be "
+ "created in parallel, with one thread per index. The value of 1 "
+ "disables parallel repair", NULL, NULL,
+ 1, 1, ULONG_MAX, 1);
+
+static MYSQL_THDVAR_ULONG(sort_buffer_size, PLUGIN_VAR_RQCMDARG,
+ "The buffer that is allocated when sorting the index when doing "
+ "a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE", NULL, NULL,
+ 8192*1024, 4, ULONG_MAX, 1);
+
+static MYSQL_SYSVAR_BOOL(use_mmap, opt_myisam_use_mmap, PLUGIN_VAR_NOCMDARG,
+ "Use memory mapping for reading and writing MyISAM tables", NULL, NULL, FALSE);
+
+static MYSQL_SYSVAR_ULONGLONG(mmap_size, myisam_mmap_size,
+ PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_READONLY, "Restricts the total memory "
+ "used for memory mapping of MySQL tables", NULL, NULL,
+ SIZE_T_MAX, MEMMAP_EXTRA_MARGIN, SIZE_T_MAX, 1);
+
+static MYSQL_THDVAR_ENUM(stats_method, PLUGIN_VAR_RQCMDARG,
+ "Specifies how MyISAM index statistics collection code should "
+ "treat NULLs. Possible values of name are NULLS_UNEQUAL (default "
+ "behavior for 4.1 and later), NULLS_EQUAL (emulate 4.0 behavior), "
+ "and NULLS_IGNORED", NULL, NULL,
+ MI_STATS_METHOD_NULLS_NOT_EQUAL, &myisam_stats_method_typelib);
+
#ifndef DBUG_OFF
/**
Causes the thread to wait in a spin lock for a query kill signal.
@@ -751,7 +800,7 @@ int ha_myisam::check(THD* thd, HA_CHECK_OPT* check_opt)
param.db_name= table->s->db.str;
param.table_name= table->alias;
param.testflag = check_opt->flags | T_CHECK | T_SILENT;
- param.stats_method= (enum_mi_stats_method)thd->variables.myisam_stats_method;
+ param.stats_method= (enum_mi_stats_method)THDVAR(thd, stats_method);
if (!(table->db_stat & HA_READ_ONLY))
param.testflag|= T_STATISTICS;
@@ -843,7 +892,7 @@ int ha_myisam::analyze(THD *thd, HA_CHECK_OPT* check_opt)
param.testflag= (T_FAST | T_CHECK | T_SILENT | T_STATISTICS |
T_DONT_CHECK_CHECKSUM);
param.using_global_keycache = 1;
- param.stats_method= (enum_mi_stats_method)thd->variables.myisam_stats_method;
+ param.stats_method= (enum_mi_stats_method)THDVAR(thd, stats_method);
if (!(share->state.changed & STATE_NOT_ANALYZED))
return HA_ADMIN_ALREADY_DONE;
@@ -875,7 +924,7 @@ int ha_myisam::repair(THD* thd, HA_CHECK_OPT *check_opt)
param.testflag= ((check_opt->flags & ~(T_EXTEND)) |
T_SILENT | T_FORCE_CREATE | T_CALC_CHECKSUM |
(check_opt->flags & T_EXTEND ? T_REP : T_REP_BY_SORT));
- param.sort_buffer_length= check_opt->sort_buffer_size;
+ param.sort_buffer_length= THDVAR(thd, sort_buffer_size);
start_records=file->state->records;
while ((error=repair(thd,param,0)) && param.retry_repair)
{
@@ -921,7 +970,7 @@ int ha_myisam::optimize(THD* thd, HA_CHECK_OPT *check_opt)
param.op_name= "optimize";
param.testflag= (check_opt->flags | T_SILENT | T_FORCE_CREATE |
T_REP_BY_SORT | T_STATISTICS | T_SORT_INDEX);
- param.sort_buffer_length= check_opt->sort_buffer_size;
+ param.sort_buffer_length= THDVAR(thd, sort_buffer_size);
if ((error= repair(thd,param,1)) && param.retry_repair)
{
sql_print_warning("Warning: Optimize table got errno %d on %s.%s, retrying",
@@ -979,7 +1028,7 @@ int ha_myisam::repair(THD *thd, MI_CHECK &param, bool do_optimize)
local_testflag|= T_STATISTICS;
param.testflag|= T_STATISTICS; // We get this for free
statistics_done=1;
- if (thd->variables.myisam_repair_threads>1)
+ if (THDVAR(thd, repair_threads)>1)
{
char buf[40];
/* TODO: respect myisam_repair_threads variable */
@@ -1290,8 +1339,8 @@ int ha_myisam::enable_indexes(uint mode)
param.testflag= (T_SILENT | T_REP_BY_SORT | T_QUICK |
T_CREATE_MISSING_KEYS);
param.myf_rw&= ~MY_WAIT_IF_FULL;
- param.sort_buffer_length= thd->variables.myisam_sort_buff_size;
- param.stats_method= (enum_mi_stats_method)thd->variables.myisam_stats_method;
+ param.sort_buffer_length= THDVAR(thd, sort_buffer_size);
+ param.stats_method= (enum_mi_stats_method)THDVAR(thd, stats_method);
param.tmpdir=&mysql_tmpdir_list;
if ((error= (repair(thd,param,0) != HA_ADMIN_OK)) && param.retry_repair)
{
@@ -1970,6 +2019,14 @@ static int myisam_init(void *p)
init_myisam_psi_keys();
#endif
+ /* Set global variables based on startup options */
+ if (myisam_recover_options)
+ ha_open_options|=HA_OPEN_ABORT_IF_CRASHED;
+ else
+ myisam_recover_options= HA_RECOVER_OFF;
+
+ myisam_block_size=(uint) 1 << my_bit_log2(opt_myisam_block_size);
+
myisam_hton= (handlerton *)p;
myisam_hton->state= SHOW_OPTION_YES;
myisam_hton->db_type= DB_TYPE_MYISAM;
@@ -1979,6 +2036,19 @@ static int myisam_init(void *p)
return 0;
}
+static struct st_mysql_sys_var* myisam_sysvars[]= {
+ MYSQL_SYSVAR(block_size),
+ MYSQL_SYSVAR(data_pointer_size),
+ MYSQL_SYSVAR(max_sort_file_size),
+ MYSQL_SYSVAR(recover_options),
+ MYSQL_SYSVAR(repair_threads),
+ MYSQL_SYSVAR(sort_buffer_size),
+ MYSQL_SYSVAR(use_mmap),
+ MYSQL_SYSVAR(mmap_size),
+ MYSQL_SYSVAR(stats_method),
+ 0
+};
+
struct st_mysql_storage_engine myisam_storage_engine=
{ MYSQL_HANDLERTON_INTERFACE_VERSION };
@@ -1994,8 +2064,8 @@ mysql_declare_plugin(myisam)
NULL, /* Plugin Deinit */
0x0100, /* 1.0 */
NULL, /* status variables */
- NULL, /* system variables */
- NULL /* config options */
+ myisam_sysvars, /* system variables */
+ NULL
}
mysql_declare_plugin_end;
diff --git a/storage/myisam/ha_myisam.h b/storage/myisam/ha_myisam.h
index 5bb46b03650..2f41670b934 100644
--- a/storage/myisam/ha_myisam.h
+++ b/storage/myisam/ha_myisam.h
@@ -23,15 +23,16 @@
#include <myisam.h>
#include <ft_global.h>
-#define HA_RECOVER_NONE 0 /* No automatic recover */
#define HA_RECOVER_DEFAULT 1 /* Automatic recover active */
#define HA_RECOVER_BACKUP 2 /* Make a backupfile on recover */
#define HA_RECOVER_FORCE 4 /* Recover even if we loose rows */
#define HA_RECOVER_QUICK 8 /* Don't check rows in data file */
+#define HA_RECOVER_OFF 16 /* No automatic recover */
extern ulong myisam_sort_buffer_size;
extern TYPELIB myisam_recover_typelib;
-extern ulong myisam_recover_options;
+extern const char *myisam_recover_names[];
+extern ulonglong myisam_recover_options;
class ha_myisam: public handler
{
diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c
index 8e55a7bc50e..1cc521baf0e 100644
--- a/storage/myisam/mi_check.c
+++ b/storage/myisam/mi_check.c
@@ -4673,8 +4673,7 @@ static my_bool mi_too_big_key_for_sort(MI_KEYDEF *key, ha_rows rows)
}
return (key->flag & HA_SPATIAL) ||
(key->flag & (HA_BINARY_PACK_KEY | HA_VAR_LENGTH_KEY | HA_FULLTEXT) &&
- ((ulonglong) rows * key_maxlength >
- (ulonglong) myisam_max_temp_length));
+ ((ulonglong) rows * key_maxlength > myisam_max_temp_length));
}
/*
diff --git a/storage/myisam/mi_static.c b/storage/myisam/mi_static.c
index 85a3124cba9..614ae6689f8 100644
--- a/storage/myisam/mi_static.c
+++ b/storage/myisam/mi_static.c
@@ -33,11 +33,11 @@ uint myisam_quick_table_bits=9;
ulong myisam_block_size= MI_KEY_BLOCK_LENGTH; /* Best by test */
my_bool myisam_flush=0, myisam_delay_key_write=0, myisam_single_user=0;
#if defined(THREAD) && !defined(DONT_USE_RW_LOCKS)
-ulong myisam_concurrent_insert= 2;
+uint myisam_concurrent_insert= 2;
#else
-ulong myisam_concurrent_insert= 0;
+uint myisam_concurrent_insert= 0;
#endif
-my_off_t myisam_max_temp_length= MAX_FILE_SIZE;
+ulonglong myisam_max_temp_length= MAX_FILE_SIZE;
ulong myisam_bulk_insert_tree_size=8192*1024;
ulong myisam_data_pointer_size=4;
ulonglong myisam_mmap_size= SIZE_T_MAX, myisam_mmap_used= 0;
diff --git a/strings/longlong2str.c b/strings/longlong2str.c
index d7de5bb0f7c..641ae0955d3 100644
--- a/strings/longlong2str.c
+++ b/strings/longlong2str.c
@@ -40,17 +40,18 @@
#include <my_global.h>
#include "m_string.h"
-#if defined(HAVE_LONG_LONG) && !defined(longlong2str) && !defined(HAVE_LONGLONG2STR)
+#ifndef ll2str
/*
This assumes that longlong multiplication is faster than longlong division.
*/
-char *longlong2str(longlong val,char *dst,int radix)
+char *ll2str(longlong val,char *dst,int radix, int upcase)
{
char buffer[65];
register char *p;
long long_val;
+ char *dig_vec= upcase ? _dig_vec_upper : _dig_vec_lower;
ulonglong uval= (ulonglong) val;
if (radix < 0)
@@ -80,20 +81,19 @@ char *longlong2str(longlong val,char *dst,int radix)
{
ulonglong quo= uval/(uint) radix;
uint rem= (uint) (uval- quo* (uint) radix);
- *--p = _dig_vec_upper[rem];
+ *--p= dig_vec[rem];
uval= quo;
}
long_val= (long) uval;
while (long_val != 0)
{
long quo= long_val/radix;
- *--p = _dig_vec_upper[(uchar) (long_val - quo*radix)];
+ *--p= dig_vec[(uchar) (long_val - quo*radix)];
long_val= quo;
}
while ((*dst++ = *p++) != 0) ;
return dst-1;
}
-
#endif
#ifndef longlong10_to_str
diff --git a/strings/longlong2str_asm.c b/strings/longlong2str_asm.c
index 637815e52c5..70fe5d7bd48 100644
--- a/strings/longlong2str_asm.c
+++ b/strings/longlong2str_asm.c
@@ -26,7 +26,7 @@
extern char *longlong2str_with_dig_vector(longlong val,char *dst,int radix,
const char *dig_vector);
-char *longlong2str(longlong val,char *dst,int radix)
+char *ll2str(longlong val,char *dst,int radix, int upcase)
{
return longlong2str_with_dig_vector(val, dst, radix, _dig_vec_upper);
}
diff --git a/strings/my_vsnprintf.c b/strings/my_vsnprintf.c
index ad8e7c8c776..bbefa083298 100644
--- a/strings/my_vsnprintf.c
+++ b/strings/my_vsnprintf.c
@@ -36,7 +36,6 @@ struct pos_arg_info
uint have_longlong; /* used from integer values */
char *str_arg; /* string value of the arg */
longlong longlong_arg; /* integer value of the arg */
- double double_arg; /* double value of the arg */
};
@@ -235,19 +234,23 @@ static char *process_int_arg(char *to, char *end, size_t length,
store_start= buff;
if (arg_type == 'd')
- store_end= int10_to_str(par, store_start, -10);
+ store_end= longlong10_to_str(par, store_start, -10);
else if (arg_type == 'u')
- store_end= int10_to_str(par, store_start, 10);
+ store_end= longlong10_to_str(par, store_start, 10);
else if (arg_type == 'p')
{
store_start[0]= '0';
store_start[1]= 'x';
- store_end= int2str(par, store_start + 2, 16, 0);
+ store_end= ll2str(par, store_start + 2, 16, 0);
+ }
+ else if (arg_type == 'o')
+ {
+ store_end= ll2str(par, store_start, 8, 0);
}
else
{
DBUG_ASSERT(arg_type == 'X' || arg_type =='x');
- store_end= int2str(par, store_start, 16, (arg_type == 'X'));
+ store_end= ll2str(par, store_start, 16, (arg_type == 'X'));
}
if ((res_length= (size_t) (store_end - store_start)) > to_length)
@@ -369,14 +372,11 @@ start:
case 'b':
args_arr[i].str_arg= va_arg(ap, char *);
break;
- case 'f':
- case 'g':
- args_arr[i].double_arg= va_arg(ap, double);
- break;
case 'd':
case 'u':
case 'x':
case 'X':
+ case 'o':
case 'p':
if (args_arr[i].have_longlong)
args_arr[i].longlong_arg= va_arg(ap,longlong);
@@ -395,21 +395,23 @@ start:
/* Print result string */
for (i= 0; i <= idx; i++)
{
- uint width= 0, length= 0;
+ size_t width= 0, length= 0;
switch (print_arr[i].arg_type) {
case 's':
{
char *par= args_arr[print_arr[i].arg_idx].str_arg;
- width= (print_arr[i].flags & WIDTH_ARG) ?
- args_arr[print_arr[i].width].longlong_arg : print_arr[i].width;
+ width= (print_arr[i].flags & WIDTH_ARG)
+ ? (size_t)args_arr[print_arr[i].width].longlong_arg
+ : print_arr[i].width;
to= process_str_arg(cs, to, end, width, par, print_arr[i].flags);
break;
}
case 'b':
{
char *par = args_arr[print_arr[i].arg_idx].str_arg;
- width= (print_arr[i].flags & WIDTH_ARG) ?
- args_arr[print_arr[i].width].longlong_arg : print_arr[i].width;
+ width= (print_arr[i].flags & WIDTH_ARG)
+ ? (size_t)args_arr[print_arr[i].width].longlong_arg
+ : print_arr[i].width;
to= process_bin_arg(to, end, width, par);
break;
}
@@ -424,12 +426,14 @@ start:
case 'u':
case 'x':
case 'X':
+ case 'o':
case 'p':
{
/* Integer parameter */
longlong larg;
- length= (print_arr[i].flags & LENGTH_ARG) ?
- args_arr[print_arr[i].length].longlong_arg : print_arr[i].length;
+ length= (print_arr[i].flags & LENGTH_ARG)
+ ? (size_t)args_arr[print_arr[i].length].longlong_arg
+ : print_arr[i].length;
if (args_arr[print_arr[i].arg_idx].have_longlong)
larg = args_arr[print_arr[i].arg_idx].longlong_arg;
@@ -571,7 +575,7 @@ size_t my_vsnprintf_ex(CHARSET_INFO *cs, char *to, size_t n,
continue;
}
else if (*fmt == 'd' || *fmt == 'u' || *fmt == 'x' || *fmt == 'X' ||
- *fmt == 'p')
+ *fmt == 'p' || *fmt == 'o')
{
/* Integer parameter */
longlong larg;
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index 94f3ab210d6..e9c70257e01 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -17692,9 +17692,9 @@ static void test_bug20023()
SQL_BIG_SELECTS will be 1.
***********************************************************************/
- /* Set MAX_JOIN_SIZE to the default value (-1). */
+ /* Set MAX_JOIN_SIZE to the default value (2^64-1). */
- DIE_IF(mysql_query(&con, "SET @@global.max_join_size = -1"));
+ DIE_IF(mysql_query(&con, "SET @@global.max_join_size = cast(-1 as unsigned int)"));
DIE_IF(mysql_query(&con, "SET @@session.max_join_size = default"));
/* Issue COM_CHANGE_USER. */
@@ -17725,7 +17725,7 @@ static void test_bug20023()
DIE_IF(mysql_query(&con, query_buffer));
- DIE_IF(mysql_query(&con, "SET @@global.max_join_size = -1"));
+ DIE_IF(mysql_query(&con, "SET @@global.max_join_size = cast(-1 as unsigned int)"));
DIE_IF(mysql_query(&con, "SET @@session.max_join_size = default"));
/* Issue COM_CHANGE_USER. */
diff --git a/unittest/mysys/my_vsnprintf-t.c b/unittest/mysys/my_vsnprintf-t.c
index f3a6b5700da..c83757782b6 100644
--- a/unittest/mysys/my_vsnprintf-t.c
+++ b/unittest/mysys/my_vsnprintf-t.c
@@ -31,7 +31,7 @@ void test1(const char *res, const char *fmt, ...)
int main(void)
{
- plan(47);
+ plan(50);
test1("Constant string",
"Constant string");
@@ -46,6 +46,8 @@ int main(void)
"Format specifier d %d", 1);
test1("Format specifier u 2",
"Format specifier u %u", 2);
+ test1("Format specifier o 375",
+ "Format specifier o %o", 0375);
test1("Format specifier x a",
"Format specifier x %x", 10);
test1("Format specifier X B",
@@ -71,6 +73,9 @@ int main(void)
test1("Length modifiers work: 1 * -1 * 2 * 3",
"Length modifiers work: %d * %ld * %lld * %zd", 1, -1L, 2LL, (size_t)3);
+ test1("long long X: 123456789abcdef0",
+ "long long X: %llx", 0x123456789abcdef0LL);
+
test1("(null) pointer is fine",
"%s pointer is fine", NULL);
@@ -93,6 +98,9 @@ int main(void)
test1("Positional arguments and a width: <0000ab>",
"Positional arguments and a width: <%1$06x>", 0xab);
+ test1("Positional arguments octal: <7777>",
+ "Positional arguments octal: <%1$o>", 07777);
+
test1("Padding and %p <0x12> <0x034> <0x0000ab> < 0xcd>",
"Padding and %%p <%04p> <%05p> <%08p> <%8p>", 0x12, 0x34, 0xab, 0xcd);
diff --git a/vio/viosocket.c b/vio/viosocket.c
index 484eb44fe63..6c361e4a462 100644
--- a/vio/viosocket.c
+++ b/vio/viosocket.c
@@ -208,7 +208,7 @@ int vio_fastsend(Vio * vio __attribute__((unused)))
#endif
r= setsockopt(vio->sd, IPPROTO_TCP, TCP_NODELAY,
- IF_WIN(const char*, void*) &nodelay,
+ IF_WIN((const char*), (void*)) &nodelay,
sizeof(nodelay));
}
@@ -240,11 +240,20 @@ int vio_keepalive(Vio* vio, my_bool set_keep_alive)
my_bool
-vio_should_retry(Vio * vio __attribute__((unused)))
+vio_should_retry(Vio * vio)
{
int en = socket_errno;
- return (en == SOCKET_EAGAIN || en == SOCKET_EINTR ||
- en == SOCKET_EWOULDBLOCK);
+ /*
+ man 2 read write
+ EAGAIN or EWOULDBLOCK when a socket is a non-blocking mode means
+ that the read/write would block.
+ man 7 socket
+ EAGAIN or EWOULDBLOCK when a socket is in a blocking mode means
+ that the corresponding receiving or sending timeout was reached.
+ */
+ return en == SOCKET_EINTR ||
+ (!vio_is_blocking(vio) &&
+ (en == SOCKET_EAGAIN || en == SOCKET_EWOULDBLOCK));
}
@@ -682,15 +691,13 @@ void vio_timeout(Vio *vio, uint which, uint timeout)
#endif
r= setsockopt(vio->sd, SOL_SOCKET, which ? SO_SNDTIMEO : SO_RCVTIMEO,
- IF_WIN(const char*, const void*)&wait_timeout,
+ IF_WIN((const char*), (const void*))&wait_timeout,
sizeof(wait_timeout));
}
-#ifndef DBUG_OFF
if (r != 0)
DBUG_PRINT("error", ("setsockopt failed: %d, errno: %d", r, socket_errno));
-#endif
DBUG_VOID_RETURN;
#else